Git Komut Rehberi & Terminal Asistanı
Sıfırdan Yeni Bir Depo Başlatın:
Mevcut Bir Git Deposu veya Klasörü Gönderin:
Hataları Geri Alma, İptal & Temizlik:
Son commit'i geri al (yapılan değişiklikleri korur):
git reset --soft HEAD~1
Yapılan yerel değişiklikleri iptal et (çalışma ağacını temizler):
git restore .
Takip edilmeyen gereksiz dosyaları sil:
git clean -fd
Değişiklikleri geçici sakla ve geri getir (stash):
git stash git stash pop
Dal (Branch) ve Sürüm Etiketleri:
Yeni dal aç ve geçiş yap:
git checkout -b yeni-ozellik git push -u origin yeni-ozellik
Sürüm etiketi (tag) oluştur ve gönder:
git tag -a v1.0.0 -m "Sürüm 1.0.0" git push origin --tags
feat: SketchUp klasik arayuzu, kisayollar, VCB olcu kutusu ve YakNet 3B bilesen havuzu
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -351,8 +351,16 @@ export function GlobalAccessibilityToolbar({
|
||||
setDrawerOpen(false);
|
||||
}
|
||||
};
|
||||
const onOpenA11yDrawer = () => {
|
||||
setDrawerOpen(true);
|
||||
setPaletteOpen(false);
|
||||
};
|
||||
window.addEventListener("keydown", onKeyDown);
|
||||
return () => window.removeEventListener("keydown", onKeyDown);
|
||||
window.addEventListener("snapcad:open-a11y-drawer", onOpenA11yDrawer);
|
||||
return () => {
|
||||
window.removeEventListener("keydown", onKeyDown);
|
||||
window.removeEventListener("snapcad:open-a11y-drawer", onOpenA11yDrawer);
|
||||
};
|
||||
}, []);
|
||||
|
||||
const update = (patch: Partial<SnapCadA11ySettings>, msg?: string) => {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
"use client";
|
||||
|
||||
import { Box, Compass, Crosshair, Eye, Grid3X3, Layers, Maximize2, MoveRight, Ruler } from "lucide-react";
|
||||
import { useCallback, useEffect, useRef, useState, type ChangeEvent, type KeyboardEvent } from "react";
|
||||
import { Box, Compass, Crosshair, Eye, Grid3X3, MoveRight, Ruler } from "lucide-react";
|
||||
import { useEffect, useRef, useState, type ChangeEvent, type KeyboardEvent } from "react";
|
||||
import { SKETCHUP_TOOLS, type SketchUpToolId } from "@/lib/sketchupInterface";
|
||||
import type { GridSize } from "@/types/sketchforge";
|
||||
|
||||
export type DirectModelingToolMode = "select" | "push-pull" | "face-sketch" | "measure";
|
||||
@@ -24,6 +25,9 @@ export interface PrecisionBarData {
|
||||
interface EnterprisePrecisionBarProps {
|
||||
data: PrecisionBarData;
|
||||
activeTool: DirectModelingToolMode;
|
||||
activeSketchUpTool?: SketchUpToolId;
|
||||
activeHintText?: string;
|
||||
vcbDisplayText?: string;
|
||||
onToolChange?: (tool: DirectModelingToolMode) => void;
|
||||
snapGrid: GridSize;
|
||||
onSnapGridChange?: (size: GridSize) => void;
|
||||
@@ -32,6 +36,7 @@ interface EnterprisePrecisionBarProps {
|
||||
onResetView?: () => void;
|
||||
onSetCameraView?: (face: "top" | "front" | "right" | "isometric") => void;
|
||||
onCommitValue?: (value: number) => void;
|
||||
onCommitVcbRaw?: (raw: string) => void;
|
||||
unitLabel?: string;
|
||||
className?: string;
|
||||
axisLock?: "x" | "z" | null;
|
||||
@@ -42,31 +47,38 @@ const SNAP_OPTIONS: GridSize[] = ["0.1 mm", "0.25 mm", "0.5 mm", "1.0 mm", "2.0
|
||||
export function EnterprisePrecisionBar({
|
||||
data,
|
||||
activeTool,
|
||||
activeSketchUpTool = "select",
|
||||
activeHintText,
|
||||
vcbDisplayText,
|
||||
onToolChange,
|
||||
snapGrid,
|
||||
onSnapGridChange,
|
||||
isOrthographic = false,
|
||||
onToggleProjection,
|
||||
onResetView,
|
||||
onSetCameraView,
|
||||
onCommitValue,
|
||||
onCommitVcbRaw,
|
||||
unitLabel = "mm",
|
||||
className = "",
|
||||
axisLock = null,
|
||||
}: EnterprisePrecisionBarProps) {
|
||||
const [inputValue, setInputValue] = useState<string>("");
|
||||
const inputRef = useRef<HTMLInputElement | null>(null);
|
||||
const toolMeta = SKETCHUP_TOOLS[activeSketchUpTool] ?? SKETCHUP_TOOLS.select;
|
||||
const resolvedLabel = data.valueLabel || toolMeta.vcbLabel || "Ölçü";
|
||||
const resolvedHint = activeHintText || toolMeta.hint;
|
||||
|
||||
// Sync input value with live distance during dragging if user hasn't focused it
|
||||
// Sync input value with live distance/dimensions during dragging if user hasn't focused it
|
||||
useEffect(() => {
|
||||
if (data.currentValue !== undefined && data.currentValue !== null) {
|
||||
if (document.activeElement !== inputRef.current) {
|
||||
setInputValue(data.currentValue.toFixed(2));
|
||||
}
|
||||
} else if (!data.isDragging && document.activeElement !== inputRef.current) {
|
||||
if (document.activeElement === inputRef.current) return;
|
||||
if (vcbDisplayText) {
|
||||
setInputValue(vcbDisplayText);
|
||||
} else if (data.currentValue !== undefined && data.currentValue !== null) {
|
||||
setInputValue(data.currentValue.toFixed(2));
|
||||
} else if (!data.isDragging) {
|
||||
setInputValue("");
|
||||
}
|
||||
}, [data.currentValue, data.isDragging]);
|
||||
}, [data.currentValue, data.isDragging, vcbDisplayText]);
|
||||
|
||||
const handleInputChange = (e: ChangeEvent<HTMLInputElement>) => {
|
||||
setInputValue(e.target.value);
|
||||
@@ -75,14 +87,27 @@ export function EnterprisePrecisionBar({
|
||||
const handleInputKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {
|
||||
if (e.key === "Enter") {
|
||||
e.preventDefault();
|
||||
const num = parseFloat(inputValue.replace(",", "."));
|
||||
const trimmed = inputValue.trim();
|
||||
if (!trimmed) return;
|
||||
if (onCommitVcbRaw) {
|
||||
onCommitVcbRaw(trimmed);
|
||||
inputRef.current?.blur();
|
||||
return;
|
||||
}
|
||||
const num = parseFloat(trimmed.replace(",", "."));
|
||||
if (!Number.isNaN(num)) {
|
||||
onCommitValue?.(num);
|
||||
inputRef.current?.blur();
|
||||
}
|
||||
} else if (e.key === "Escape") {
|
||||
inputRef.current?.blur();
|
||||
setInputValue(data.currentValue !== undefined && data.currentValue !== null ? data.currentValue.toFixed(2) : "");
|
||||
setInputValue(
|
||||
vcbDisplayText
|
||||
? vcbDisplayText
|
||||
: data.currentValue !== undefined && data.currentValue !== null
|
||||
? data.currentValue.toFixed(2)
|
||||
: "",
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -90,9 +115,9 @@ export function EnterprisePrecisionBar({
|
||||
<footer
|
||||
className={`enterprise-precision-bar ${className}`}
|
||||
role="region"
|
||||
aria-label="Hassas Çizim ve Durum Çubuğu (Precision HUD)"
|
||||
aria-label="Hassas Çizim ve Ölçü Kutusu (Measurements VCB)"
|
||||
>
|
||||
{/* 1. Sol Kısım: Araç Modu ve Yüzey Rozeti */}
|
||||
{/* 1. Sol Kısım: Araç Modu, Canlı Eğitmen İpucu ve Yüzey Rozeti */}
|
||||
<div className="precision-group tools-group">
|
||||
<button
|
||||
type="button"
|
||||
@@ -102,7 +127,7 @@ export function EnterprisePrecisionBar({
|
||||
aria-pressed={activeTool === "select"}
|
||||
>
|
||||
<Box size={14} className="icon" aria-hidden="true" />
|
||||
<span>3B Katı CAD</span>
|
||||
<span>3B Katı</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
@@ -113,11 +138,21 @@ export function EnterprisePrecisionBar({
|
||||
aria-pressed={activeTool === "push-pull"}
|
||||
>
|
||||
<MoveRight size={14} className="icon" aria-hidden="true" />
|
||||
<span>İt / Çek (Push/Pull)</span>
|
||||
<span>İt / Çek</span>
|
||||
</button>
|
||||
|
||||
{resolvedHint ? (
|
||||
<span
|
||||
className="hidden xl:inline-block truncate max-w-[340px] text-[11px] text-slate-400"
|
||||
title={resolvedHint}
|
||||
>
|
||||
<strong className="text-sky-400 mr-1">{toolMeta.name}:</strong>
|
||||
{resolvedHint}
|
||||
</span>
|
||||
) : null}
|
||||
|
||||
{data.activeFaceInfo ? (
|
||||
<span className="face-indicator-badge" title="Algılanan Yüzey Normali">
|
||||
<span className="face-indicator-badge hidden 2xl:inline-flex" title="Algılanan Yüzey Normali">
|
||||
<span className="dot" />
|
||||
<span className="name">{data.activeFaceInfo.shapeName}</span>
|
||||
<span className="normal font-mono">
|
||||
@@ -133,13 +168,13 @@ export function EnterprisePrecisionBar({
|
||||
<div className="live-coords-hud" title="İmleç Dünyası Koordinatları">
|
||||
<Crosshair size={13} className="text-sky-400" aria-hidden="true" />
|
||||
<span className="coord-item">
|
||||
<strong className="text-rose-400">X:</strong> {data.cursorX.toFixed(2)}
|
||||
<strong className="text-rose-400">X:</strong> {data.cursorX.toFixed(1)}
|
||||
</span>
|
||||
<span className="coord-item">
|
||||
<strong className="text-emerald-400">Y:</strong> {data.cursorY.toFixed(2)}
|
||||
<strong className="text-emerald-400">Y:</strong> {data.cursorY.toFixed(1)}
|
||||
</span>
|
||||
<span className="coord-item">
|
||||
<strong className="text-sky-400">Z:</strong> {data.cursorZ.toFixed(2)} {unitLabel}
|
||||
<strong className="text-sky-400">Z:</strong> {data.cursorZ.toFixed(1)} {unitLabel}
|
||||
</span>
|
||||
{axisLock ? (
|
||||
<span
|
||||
@@ -161,23 +196,26 @@ export function EnterprisePrecisionBar({
|
||||
</div>
|
||||
|
||||
{/* Değer Kontrol Kutusu (VCB) */}
|
||||
<div className="vcb-input-box" title="Değer Kontrol Kutusu: Bir sayı yazıp Enter'a basarak doğrudan ölçülendirin">
|
||||
<div
|
||||
className="vcb-input-box"
|
||||
title="SketchUp Ölçü Kutusu (VCB): Örn. 100;60 (Boyut), *5 (Çoğalt), /4 (Böl), 45° (Açı), 25 (Ölçü) yazıp Enter'a basın"
|
||||
>
|
||||
<label htmlFor="precision-vcb-input" className="vcb-label">
|
||||
<Ruler size={13} aria-hidden="true" />
|
||||
<span>{data.valueLabel || "Ölçü"}:</span>
|
||||
<span>{resolvedLabel}:</span>
|
||||
</label>
|
||||
<div className="vcb-input-wrap">
|
||||
<input
|
||||
id="precision-vcb-input"
|
||||
ref={inputRef}
|
||||
type="text"
|
||||
inputMode="decimal"
|
||||
inputMode="text"
|
||||
className="vcb-field font-mono"
|
||||
placeholder={data.isDragging ? "Ölçü yazın..." : "0.00"}
|
||||
placeholder={data.isDragging ? "Ölçü..." : "100;50 / *5"}
|
||||
value={inputValue}
|
||||
onChange={handleInputChange}
|
||||
onKeyDown={handleInputKeyDown}
|
||||
aria-label={`${data.valueLabel || "Ölçü"} değeri milimetre cinsinden`}
|
||||
aria-label={`${resolvedLabel} değeri (100;50, *5, /4 veya mm)`}
|
||||
/>
|
||||
<span className="unit-suffix font-mono">{unitLabel}</span>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,990 @@
|
||||
"use client";
|
||||
|
||||
import { useCallback, useEffect, useMemo, useState } from "react";
|
||||
import {
|
||||
BookOpen,
|
||||
Box,
|
||||
Boxes,
|
||||
Camera,
|
||||
Check,
|
||||
ChevronDown,
|
||||
ChevronRight,
|
||||
Cloud,
|
||||
CloudUpload,
|
||||
Compass,
|
||||
Download,
|
||||
Eye,
|
||||
EyeOff,
|
||||
FolderTree,
|
||||
Info,
|
||||
Layers,
|
||||
Lock,
|
||||
PaintBucket,
|
||||
Palette,
|
||||
Plus,
|
||||
RefreshCw,
|
||||
Search,
|
||||
Sparkles,
|
||||
Sun,
|
||||
Trash2,
|
||||
Unlock,
|
||||
} from "lucide-react";
|
||||
import { ARCHITECTURAL_TEXTURES, getTextureDefinition } from "@/lib/architecturalTextures";
|
||||
import {
|
||||
CLOUD_COMPONENT_CATEGORIES,
|
||||
deleteCloudComponent,
|
||||
getCloudComponent,
|
||||
instantiateComponentShapes,
|
||||
listCloudComponents,
|
||||
publishCloudComponent,
|
||||
type CloudComponentSummary,
|
||||
} from "@/lib/cloudComponents";
|
||||
import {
|
||||
SKETCHUP_TOOLS,
|
||||
VISUAL_STYLE_OPTIONS,
|
||||
type DefaultTraySectionId,
|
||||
type SketchUpToolId,
|
||||
type VisualStyleMode,
|
||||
} from "@/lib/sketchupInterface";
|
||||
import { SNAPCAD_PREFABS } from "@/lib/snapcadPrefabs";
|
||||
import { calculateSunPosition, SOLAR_LOCATIONS, type SolarStudySettings } from "@/lib/solarSystem";
|
||||
import type { ArchitecturalScene, ArchitecturalTextureId, WorkplaneShape } from "@/types/sketchforge";
|
||||
|
||||
const QUICK_COLORS = [
|
||||
"#e2e8f0",
|
||||
"#94a3b8",
|
||||
"#475569",
|
||||
"#ef4444",
|
||||
"#b91c1c",
|
||||
"#f59e0b",
|
||||
"#b45309",
|
||||
"#10b981",
|
||||
"#0ea5e9",
|
||||
"#2563eb",
|
||||
"#8b5cf6",
|
||||
"#1e293b",
|
||||
];
|
||||
|
||||
export interface SketchUpDefaultTrayProps {
|
||||
openSections: DefaultTraySectionId[];
|
||||
onToggleSection: (section: DefaultTraySectionId) => void;
|
||||
shapes: WorkplaneShape[];
|
||||
selectedIds: string[];
|
||||
onSelectShapes: (ids: string[]) => void;
|
||||
onUpdateShape: (id: string, patch: Partial<WorkplaneShape>) => void;
|
||||
onUpdateAllShapes: (shapes: WorkplaneShape[], notice?: string) => void;
|
||||
onInsertShapes: (newShapes: WorkplaneShape[], notice?: string) => void;
|
||||
onMakeComponent: () => void;
|
||||
onMakeUnique: () => void;
|
||||
activeTool: SketchUpToolId;
|
||||
visualStyle: VisualStyleMode;
|
||||
onSelectVisualStyle: (style: VisualStyleMode) => void;
|
||||
xRayMode: boolean;
|
||||
onToggleXRay: () => void;
|
||||
backEdgesEnabled: boolean;
|
||||
onToggleBackEdges: () => void;
|
||||
skyGroundEnabled: boolean;
|
||||
onToggleSkyGround: () => void;
|
||||
activePaintColor: string;
|
||||
onSelectPaintColor: (color: string) => void;
|
||||
activePaintTexture: ArchitecturalTextureId;
|
||||
onSelectPaintTexture: (texture: ArchitecturalTextureId) => void;
|
||||
paintBucketMode: boolean;
|
||||
onTogglePaintBucket: () => void;
|
||||
solarSettings: SolarStudySettings;
|
||||
onChangeSolarSettings: (settings: SolarStudySettings) => void;
|
||||
scenes: ArchitecturalScene[];
|
||||
onAddScene: () => void;
|
||||
onDeleteScene: (id: string) => void;
|
||||
onSelectScene: (scene: ArchitecturalScene) => void;
|
||||
onOpenLayersModal: () => void;
|
||||
onZoomSelection: () => void;
|
||||
onNotice: (message: string) => void;
|
||||
}
|
||||
|
||||
const SECTION_META: Array<{ id: DefaultTraySectionId; title: string; icon: typeof Info }> = [
|
||||
{ id: "entity-info", title: "Öğe Bilgisi (Entity Info)", icon: Info },
|
||||
{ id: "outliner", title: "Ana Hatlar (Outliner)", icon: FolderTree },
|
||||
{ id: "components", title: "Bileşenler (3B Havuz)", icon: Boxes },
|
||||
{ id: "materials", title: "Malzemeler (Materials)", icon: PaintBucket },
|
||||
{ id: "styles", title: "Stiller (Styles)", icon: Palette },
|
||||
{ id: "tags", title: "Etiketler (Tags / Layers)", icon: Layers },
|
||||
{ id: "shadows", title: "Gölgeler & Güneş (Shadows)", icon: Sun },
|
||||
{ id: "scenes", title: "Sahneler (Scenes)", icon: Camera },
|
||||
{ id: "instructor", title: "Eğitmen (Instructor)", icon: BookOpen },
|
||||
];
|
||||
|
||||
export function SketchUpDefaultTray({
|
||||
openSections,
|
||||
onToggleSection,
|
||||
shapes,
|
||||
selectedIds,
|
||||
onSelectShapes,
|
||||
onUpdateShape,
|
||||
onUpdateAllShapes,
|
||||
onInsertShapes,
|
||||
onMakeComponent,
|
||||
onMakeUnique,
|
||||
activeTool,
|
||||
visualStyle,
|
||||
onSelectVisualStyle,
|
||||
xRayMode,
|
||||
onToggleXRay,
|
||||
backEdgesEnabled,
|
||||
onToggleBackEdges,
|
||||
skyGroundEnabled,
|
||||
onToggleSkyGround,
|
||||
activePaintColor,
|
||||
onSelectPaintColor,
|
||||
activePaintTexture,
|
||||
onSelectPaintTexture,
|
||||
paintBucketMode,
|
||||
onTogglePaintBucket,
|
||||
solarSettings,
|
||||
onChangeSolarSettings,
|
||||
scenes,
|
||||
onAddScene,
|
||||
onDeleteScene,
|
||||
onSelectScene,
|
||||
onOpenLayersModal,
|
||||
onZoomSelection,
|
||||
onNotice,
|
||||
}: SketchUpDefaultTrayProps) {
|
||||
const [outlinerQuery, setOutlinerQuery] = useState("");
|
||||
const [componentTab, setComponentTab] = useState<"local" | "cloud">("local");
|
||||
const [compSearch, setCompSearch] = useState("");
|
||||
const [compCategory, setCompCategory] = useState("Tümü");
|
||||
const [cloudComponents, setCloudComponents] = useState<CloudComponentSummary[]>([]);
|
||||
const [cloudLoading, setCloudLoading] = useState(false);
|
||||
const [cloudError, setCloudError] = useState<string | null>(null);
|
||||
const [publishOpen, setPublishOpen] = useState(false);
|
||||
const [publishTitle, setPublishTitle] = useState("");
|
||||
const [publishCategory, setPublishCategory] = useState(CLOUD_COMPONENT_CATEGORIES[0]);
|
||||
const [publishDesc, setPublishDesc] = useState("");
|
||||
const [publishBusy, setPublishBusy] = useState(false);
|
||||
|
||||
const selectedShapes = useMemo(
|
||||
() => shapes.filter((s) => selectedIds.includes(s.id)),
|
||||
[shapes, selectedIds],
|
||||
);
|
||||
const primaryShape = selectedShapes.length === 1 ? selectedShapes[0] : null;
|
||||
|
||||
const componentSiblingsCount = useMemo(() => {
|
||||
if (!primaryShape?.componentDefId) return 0;
|
||||
return shapes.filter((s) => s.componentDefId === primaryShape.componentDefId).length;
|
||||
}, [primaryShape?.componentDefId, shapes]);
|
||||
|
||||
const filteredOutlinerShapes = useMemo(() => {
|
||||
const q = outlinerQuery.trim().toLowerCase();
|
||||
if (!q) return shapes;
|
||||
return shapes.filter(
|
||||
(s) =>
|
||||
(s.name || "").toLowerCase().includes(q) ||
|
||||
(s.tag || "").toLowerCase().includes(q) ||
|
||||
(s.componentName || "").toLowerCase().includes(q),
|
||||
);
|
||||
}, [shapes, outlinerQuery]);
|
||||
|
||||
const tagSummary = useMemo(() => {
|
||||
const map = new Map<string, { name: string; count: number; allHidden: boolean }>();
|
||||
for (const s of shapes) {
|
||||
const name = (s.tag && s.tag.trim()) || "Katman 0 (Genel)";
|
||||
const cur = map.get(name) ?? { name, count: 0, allHidden: true };
|
||||
cur.count += 1;
|
||||
if (!s.hidden) cur.allHidden = false;
|
||||
map.set(name, cur);
|
||||
}
|
||||
return Array.from(map.values());
|
||||
}, [shapes]);
|
||||
|
||||
const refreshCloudComponents = useCallback(async () => {
|
||||
setCloudLoading(true);
|
||||
setCloudError(null);
|
||||
const result = await listCloudComponents({
|
||||
category: compCategory === "Tümü" ? undefined : compCategory,
|
||||
q: compSearch.trim() || undefined,
|
||||
});
|
||||
setCloudLoading(false);
|
||||
if (!result.ok) {
|
||||
setCloudError(result.error || "Bileşen havuzu yüklenemedi.");
|
||||
return;
|
||||
}
|
||||
setCloudComponents(result.components);
|
||||
}, [compCategory, compSearch]);
|
||||
|
||||
useEffect(() => {
|
||||
if (openSections.includes("components") && componentTab === "cloud") {
|
||||
void refreshCloudComponents();
|
||||
}
|
||||
}, [openSections, componentTab, refreshCloudComponents]);
|
||||
|
||||
const handleInsertPrefab = (prefabId: string) => {
|
||||
const prefab = SNAPCAD_PREFABS.find((p) => p.id === prefabId);
|
||||
if (!prefab) return;
|
||||
const offset = shapes.length > 0 ? { x: (shapes.length % 4) * 30 - 30, z: 0, elevation: 0 } : { x: 0, z: 0, elevation: 0 };
|
||||
const built = instantiateComponentShapes(prefab.buildShapes(), {
|
||||
componentDefId: `prefab_${prefab.id}`,
|
||||
componentName: prefab.title,
|
||||
targetOffset: offset,
|
||||
});
|
||||
onInsertShapes(built, `"${prefab.title}" bileşeni eklendi (${built.length} parça)`);
|
||||
};
|
||||
|
||||
const handleInsertCloudComponent = async (item: CloudComponentSummary) => {
|
||||
setCloudLoading(true);
|
||||
const res = await getCloudComponent(item.component_uid);
|
||||
setCloudLoading(false);
|
||||
if (!res.ok || !res.component) {
|
||||
onNotice(res.error || "Bileşen sunucudan yüklenemedi.");
|
||||
return;
|
||||
}
|
||||
const inst = instantiateComponentShapes(res.component.shapes, {
|
||||
componentDefId: item.component_uid,
|
||||
componentName: item.title,
|
||||
targetOffset: { x: 0, z: 0, elevation: 0 },
|
||||
});
|
||||
onInsertShapes(inst, `YakNet Havuz: "${item.title}" sahneye eklendi (${inst.length} parça)`);
|
||||
};
|
||||
|
||||
const handlePublishSelected = async () => {
|
||||
const targets = selectedShapes.length > 0 ? selectedShapes : shapes;
|
||||
if (targets.length === 0) {
|
||||
onNotice("Paylaşmak için sahnede en az 1 nesne seçin.");
|
||||
return;
|
||||
}
|
||||
if (!publishTitle.trim()) {
|
||||
onNotice("Lütfen bileşen için bir ad girin.");
|
||||
return;
|
||||
}
|
||||
setPublishBusy(true);
|
||||
const res = await publishCloudComponent({
|
||||
title: publishTitle.trim(),
|
||||
category: publishCategory,
|
||||
description: publishDesc.trim(),
|
||||
is_public: true,
|
||||
shapes: targets,
|
||||
});
|
||||
setPublishBusy(false);
|
||||
if (!res.ok) {
|
||||
onNotice(res.error || "Bileşen paylaşılamadı (YakNet hesabınızla giriş yapın).");
|
||||
return;
|
||||
}
|
||||
setPublishOpen(false);
|
||||
setPublishTitle("");
|
||||
setPublishDesc("");
|
||||
onNotice(res.message || "Bileşen YakNet 3B Bileşen Havuzuna paylaşıldı.");
|
||||
setComponentTab("cloud");
|
||||
void refreshCloudComponents();
|
||||
};
|
||||
|
||||
const handleSolarHourChange = (hour: number) => {
|
||||
const next: SolarStudySettings = { ...solarSettings, enabled: true, hour };
|
||||
onChangeSolarSettings(next);
|
||||
const calc = calculateSunPosition(next);
|
||||
if (typeof window !== "undefined") {
|
||||
window.dispatchEvent(new CustomEvent("snapcad:solar-update", { detail: calc }));
|
||||
}
|
||||
};
|
||||
|
||||
const applyMaterialToSelection = (texture: ArchitecturalTextureId, color: string) => {
|
||||
if (selectedShapes.length === 0) {
|
||||
onNotice("Önce bir nesne seçin veya Boya Kovası (B) ile tıklayın.");
|
||||
return;
|
||||
}
|
||||
const texLabel = getTextureDefinition(texture).name;
|
||||
selectedShapes.forEach((s) => onUpdateShape(s.id, { texture, color }));
|
||||
onNotice(`${selectedShapes.length} nesneye "${texLabel}" malzemesi uygulandı.`);
|
||||
};
|
||||
|
||||
const toolMeta = SKETCHUP_TOOLS[activeTool];
|
||||
|
||||
return (
|
||||
<aside
|
||||
className="sketchup-default-tray"
|
||||
role="complementary"
|
||||
aria-label="Varsayılan Tepsi (Default Tray)"
|
||||
>
|
||||
<div className="tray-top-header">
|
||||
<span className="tray-top-title">Varsayılan Tepsi</span>
|
||||
<span className="tray-top-count">{shapes.length} nesne</span>
|
||||
</div>
|
||||
|
||||
<div className="tray-accordion-scroll">
|
||||
{SECTION_META.map(({ id, title, icon: Icon }) => {
|
||||
const isOpen = openSections.includes(id);
|
||||
return (
|
||||
<section key={id} className={`tray-section ${isOpen ? "open" : ""}`} aria-labelledby={`tray-hdr-${id}`}>
|
||||
<h2 id={`tray-hdr-${id}`} className="tray-section-heading">
|
||||
<button
|
||||
type="button"
|
||||
className="tray-section-trigger"
|
||||
aria-expanded={isOpen}
|
||||
aria-controls={`tray-body-${id}`}
|
||||
onClick={() => onToggleSection(id)}
|
||||
>
|
||||
<span className="tray-trigger-left">
|
||||
{isOpen ? <ChevronDown size={13} aria-hidden="true" /> : <ChevronRight size={13} aria-hidden="true" />}
|
||||
<Icon size={13} aria-hidden="true" />
|
||||
<span>{title}</span>
|
||||
</span>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
{isOpen ? (
|
||||
<div id={`tray-body-${id}`} className="tray-section-body">
|
||||
{/* 1. ÖĞE BİLGİSİ (ENTITY INFO) */}
|
||||
{id === "entity-info" ? (
|
||||
selectedShapes.length === 0 ? (
|
||||
<p className="tray-muted-note">
|
||||
Özelliklerini görmek için bir nesne seçin. Ekran okuyucuda <kbd>[</kbd> / <kbd>]</kbd> ile gezebilirsiniz.
|
||||
</p>
|
||||
) : primaryShape ? (
|
||||
<div className="tray-form-stack">
|
||||
<label className="tray-field">
|
||||
<span>Ad</span>
|
||||
<input
|
||||
type="text"
|
||||
value={primaryShape.name}
|
||||
onChange={(e) => onUpdateShape(primaryShape.id, { name: e.target.value })}
|
||||
/>
|
||||
</label>
|
||||
<label className="tray-field">
|
||||
<span>Etiket (Tag)</span>
|
||||
<input
|
||||
type="text"
|
||||
value={primaryShape.tag ?? ""}
|
||||
placeholder="Örn: Duvarlar, Çatı"
|
||||
onChange={(e) => onUpdateShape(primaryShape.id, { tag: e.target.value })}
|
||||
/>
|
||||
</label>
|
||||
<div className="tray-dim-row">
|
||||
<label className="tray-mini-field">
|
||||
<span>En (X)</span>
|
||||
<input
|
||||
type="number"
|
||||
step={1}
|
||||
value={Number(primaryShape.width.toFixed(2))}
|
||||
onChange={(e) => {
|
||||
const v = parseFloat(e.target.value);
|
||||
if (Number.isFinite(v) && v > 0.1) onUpdateShape(primaryShape.id, { width: v });
|
||||
}}
|
||||
/>
|
||||
</label>
|
||||
<label className="tray-mini-field">
|
||||
<span>Boy (Z)</span>
|
||||
<input
|
||||
type="number"
|
||||
step={1}
|
||||
value={Number(primaryShape.depth.toFixed(2))}
|
||||
onChange={(e) => {
|
||||
const v = parseFloat(e.target.value);
|
||||
if (Number.isFinite(v) && v > 0.1) onUpdateShape(primaryShape.id, { depth: v });
|
||||
}}
|
||||
/>
|
||||
</label>
|
||||
<label className="tray-mini-field">
|
||||
<span>Yüks (Y)</span>
|
||||
<input
|
||||
type="number"
|
||||
step={1}
|
||||
value={Number(primaryShape.height.toFixed(2))}
|
||||
onChange={(e) => {
|
||||
const v = parseFloat(e.target.value);
|
||||
if (Number.isFinite(v) && v > 0.1) onUpdateShape(primaryShape.id, { height: v });
|
||||
}}
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
<div className="tray-btn-row">
|
||||
<button
|
||||
type="button"
|
||||
className={`tray-pill-btn ${primaryShape.hole ? "active" : ""}`}
|
||||
onClick={() => onUpdateShape(primaryShape.id, { hole: !primaryShape.hole })}
|
||||
>
|
||||
{primaryShape.hole ? "Delik (Kesici)" : "Katı (Solid)"}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={`tray-pill-btn ${primaryShape.locked ? "active" : ""}`}
|
||||
onClick={() => onUpdateShape(primaryShape.id, { locked: !primaryShape.locked })}
|
||||
>
|
||||
{primaryShape.locked ? "Kilitli" : "Kilitle"}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="tray-pill-btn"
|
||||
onClick={onZoomSelection}
|
||||
title="Seçileni Çerçevele (Alt+Z)"
|
||||
>
|
||||
Odakla
|
||||
</button>
|
||||
</div>
|
||||
<div className="tray-comp-box">
|
||||
{primaryShape.componentDefId ? (
|
||||
<>
|
||||
<span className="tray-comp-badge">
|
||||
Bileşen: {primaryShape.componentName || primaryShape.name} ({componentSiblingsCount} kopya)
|
||||
</span>
|
||||
<button type="button" className="tray-action-btn" onClick={onMakeUnique}>
|
||||
Benzersiz Yap
|
||||
</button>
|
||||
</>
|
||||
) : (
|
||||
<button type="button" className="tray-action-btn" onClick={onMakeComponent}>
|
||||
Bileşen Oluştur (G)
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<div className="tray-form-stack">
|
||||
<p className="tray-muted-note">
|
||||
<strong>{selectedShapes.length} nesne</strong> seçili. Toplu işlem yapabilirsiniz:
|
||||
</p>
|
||||
<div className="tray-btn-row">
|
||||
<button type="button" className="tray-action-btn" onClick={onMakeComponent}>
|
||||
Bileşen Yap (G)
|
||||
</button>
|
||||
<button type="button" className="tray-pill-btn" onClick={onZoomSelection}>
|
||||
Odakla
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
) : null}
|
||||
|
||||
{/* 2. ANA HATLAR (OUTLINER) */}
|
||||
{id === "outliner" ? (
|
||||
<div className="tray-form-stack">
|
||||
<div className="tray-search-box">
|
||||
<Search size={12} aria-hidden="true" />
|
||||
<input
|
||||
type="search"
|
||||
placeholder="Nesne veya katman ara…"
|
||||
value={outlinerQuery}
|
||||
onChange={(e) => setOutlinerQuery(e.target.value)}
|
||||
aria-label="Ana Hatlar içinde nesne ara"
|
||||
/>
|
||||
</div>
|
||||
<ul className="tray-outliner-list" aria-label="Sahnedeki tüm 3B nesneler">
|
||||
{filteredOutlinerShapes.length === 0 ? (
|
||||
<li className="tray-muted-note">Eşleşen nesne yok.</li>
|
||||
) : (
|
||||
filteredOutlinerShapes.map((shape) => {
|
||||
const isSel = selectedIds.includes(shape.id);
|
||||
return (
|
||||
<li key={shape.id} className={`tray-outliner-item ${isSel ? "selected" : ""}`}>
|
||||
<button
|
||||
type="button"
|
||||
className="tray-outliner-select"
|
||||
onClick={(e) => {
|
||||
if (e.shiftKey) {
|
||||
const next = isSel
|
||||
? selectedIds.filter((i) => i !== shape.id)
|
||||
: [...selectedIds, shape.id];
|
||||
onSelectShapes(next);
|
||||
} else {
|
||||
onSelectShapes([shape.id]);
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Box size={12} aria-hidden="true" style={{ color: shape.color }} />
|
||||
<span className="truncate">{shape.name || shape.kind}</span>
|
||||
{shape.componentDefId ? <span className="tray-mini-badge">Bileşen</span> : null}
|
||||
</button>
|
||||
<div className="tray-outliner-actions">
|
||||
<button
|
||||
type="button"
|
||||
title={shape.hidden ? "Göster" : "Gizle"}
|
||||
aria-label={`${shape.name} ${shape.hidden ? "göster" : "gizle"}`}
|
||||
onClick={() => onUpdateShape(shape.id, { hidden: !shape.hidden })}
|
||||
>
|
||||
{shape.hidden ? <EyeOff size={12} /> : <Eye size={12} />}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
title={shape.locked ? "Kilidi Aç" : "Kilitle"}
|
||||
aria-label={`${shape.name} ${shape.locked ? "kilidini aç" : "kilitle"}`}
|
||||
onClick={() => onUpdateShape(shape.id, { locked: !shape.locked })}
|
||||
>
|
||||
{shape.locked ? <Lock size={12} /> : <Unlock size={12} />}
|
||||
</button>
|
||||
</div>
|
||||
</li>
|
||||
);
|
||||
})
|
||||
)}
|
||||
</ul>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{/* 3. BİLEŞENLER (YEREL & YAKNET 3B HAVUZ) */}
|
||||
{id === "components" ? (
|
||||
<div className="tray-form-stack">
|
||||
<div className="tray-seg-tabs" role="tablist">
|
||||
<button
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-selected={componentTab === "local"}
|
||||
className={`tray-seg-btn ${componentTab === "local" ? "active" : ""}`}
|
||||
onClick={() => setComponentTab("local")}
|
||||
>
|
||||
Hazır Kütüphane
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-selected={componentTab === "cloud"}
|
||||
className={`tray-seg-btn ${componentTab === "cloud" ? "active" : ""}`}
|
||||
onClick={() => setComponentTab("cloud")}
|
||||
>
|
||||
<Cloud size={11} aria-hidden="true" />
|
||||
<span>YakNet 3B Havuz</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{componentTab === "local" ? (
|
||||
<div className="tray-prefab-list">
|
||||
{SNAPCAD_PREFABS.slice(0, 12).map((prefab) => (
|
||||
<button
|
||||
key={prefab.id}
|
||||
type="button"
|
||||
className="tray-prefab-card"
|
||||
onClick={() => handleInsertPrefab(prefab.id)}
|
||||
title={prefab.description}
|
||||
>
|
||||
<span className="tray-prefab-dot" style={{ background: prefab.accentColor }} />
|
||||
<span className="tray-prefab-info">
|
||||
<strong>{prefab.title}</strong>
|
||||
<small>{prefab.categoryLabel} · {prefab.badge}</small>
|
||||
</span>
|
||||
<Plus size={13} aria-hidden="true" />
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
) : (
|
||||
<div className="tray-form-stack">
|
||||
<div className="tray-search-box">
|
||||
<Search size={12} aria-hidden="true" />
|
||||
<input
|
||||
type="search"
|
||||
placeholder="Topluluk bileşeni ara…"
|
||||
value={compSearch}
|
||||
onChange={(e) => setCompSearch(e.target.value)}
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
className="tray-icon-tiny"
|
||||
onClick={() => void refreshCloudComponents()}
|
||||
title="Yenile"
|
||||
aria-label="Bileşen havuzunu yenile"
|
||||
>
|
||||
<RefreshCw size={12} className={cloudLoading ? "animate-spin" : ""} />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<select
|
||||
className="tray-select"
|
||||
value={compCategory}
|
||||
onChange={(e) => setCompCategory(e.target.value)}
|
||||
aria-label="Bileşen kategorisi"
|
||||
>
|
||||
<option value="Tümü">Tüm Kategoriler</option>
|
||||
{CLOUD_COMPONENT_CATEGORIES.map((c) => (
|
||||
<option key={c} value={c}>{c}</option>
|
||||
))}
|
||||
</select>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
className="tray-action-btn"
|
||||
onClick={() => {
|
||||
if (selectedShapes.length === 1 && !publishTitle) {
|
||||
setPublishTitle(selectedShapes[0].componentName || selectedShapes[0].name || "");
|
||||
}
|
||||
setPublishOpen((p) => !p);
|
||||
}}
|
||||
>
|
||||
<CloudUpload size={13} aria-hidden="true" />
|
||||
<span>{selectedShapes.length > 0 ? "Seçiliyi 3B Havuza Yükle" : "Sahneyi 3B Havuza Yükle"}</span>
|
||||
</button>
|
||||
|
||||
{publishOpen ? (
|
||||
<div className="tray-publish-box">
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Bileşen adı (örn: Ahşap Pencere)"
|
||||
value={publishTitle}
|
||||
onChange={(e) => setPublishTitle(e.target.value)}
|
||||
/>
|
||||
<select
|
||||
className="tray-select"
|
||||
value={publishCategory}
|
||||
onChange={(e) => setPublishCategory(e.target.value)}
|
||||
>
|
||||
{CLOUD_COMPONENT_CATEGORIES.map((c) => (
|
||||
<option key={c} value={c}>{c}</option>
|
||||
))}
|
||||
</select>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Kısa açıklama (opsiyonel)"
|
||||
value={publishDesc}
|
||||
onChange={(e) => setPublishDesc(e.target.value)}
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
disabled={publishBusy}
|
||||
className="tray-action-btn primary"
|
||||
onClick={() => void handlePublishSelected()}
|
||||
>
|
||||
{publishBusy ? "Gönderiliyor…" : "Havuzda Yayınla"}
|
||||
</button>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{cloudError ? <p className="tray-error-note">{cloudError}</p> : null}
|
||||
|
||||
<div className="tray-prefab-list">
|
||||
{!cloudLoading && cloudComponents.length === 0 && !cloudError ? (
|
||||
<p className="tray-muted-note">
|
||||
Henüz paylaşılan bileşen yok. İlk bileşeni yukarıdan siz paylaşabilirsiniz!
|
||||
</p>
|
||||
) : null}
|
||||
{cloudComponents.map((item) => (
|
||||
<div key={item.component_uid} className="tray-cloud-row">
|
||||
<button
|
||||
type="button"
|
||||
className="tray-cloud-insert"
|
||||
onClick={() => void handleInsertCloudComponent(item)}
|
||||
title={item.description || item.title}
|
||||
>
|
||||
<strong>{item.title}</strong>
|
||||
<small>{item.category} · {item.author_name} ({item.shapes_count} parça)</small>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="tray-icon-tiny"
|
||||
onClick={() => void handleInsertCloudComponent(item)}
|
||||
title="Sahneye Ekle"
|
||||
aria-label={`${item.title} ekle`}
|
||||
>
|
||||
<Download size={12} />
|
||||
</button>
|
||||
{item.is_owner ? (
|
||||
<button
|
||||
type="button"
|
||||
className="tray-icon-tiny danger"
|
||||
onClick={async () => {
|
||||
await deleteCloudComponent(item.component_uid);
|
||||
void refreshCloudComponents();
|
||||
}}
|
||||
title="Bileşeni Sil"
|
||||
aria-label={`${item.title} sil`}
|
||||
>
|
||||
<Trash2 size={12} />
|
||||
</button>
|
||||
) : null}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{/* 4. MALZEMELER (MATERIALS) */}
|
||||
{id === "materials" ? (
|
||||
<div className="tray-form-stack">
|
||||
<div className="tray-color-row">
|
||||
{QUICK_COLORS.map((hex) => (
|
||||
<button
|
||||
key={hex}
|
||||
type="button"
|
||||
className={`tray-swatch ${activePaintColor.toLowerCase() === hex ? "active" : ""}`}
|
||||
style={{ backgroundColor: hex }}
|
||||
aria-label={`Renk ${hex}`}
|
||||
onClick={() => {
|
||||
onSelectPaintColor(hex);
|
||||
if (selectedShapes.length > 0 && !paintBucketMode) {
|
||||
selectedShapes.forEach((s) => onUpdateShape(s.id, { color: hex, hole: false }));
|
||||
}
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
<div className="tray-texture-grid">
|
||||
{ARCHITECTURAL_TEXTURES.map((tex) => (
|
||||
<button
|
||||
key={tex.id}
|
||||
type="button"
|
||||
className={`tray-texture-tile ${activePaintTexture === tex.id ? "active" : ""}`}
|
||||
onClick={() => {
|
||||
onSelectPaintTexture(tex.id);
|
||||
if (selectedShapes.length > 0) {
|
||||
applyMaterialToSelection(tex.id, activePaintColor);
|
||||
}
|
||||
}}
|
||||
title={tex.description}
|
||||
>
|
||||
<span
|
||||
className="tray-texture-swatch"
|
||||
style={
|
||||
tex.id === "brick"
|
||||
? { background: "repeating-linear-gradient(0deg, #b91c1c, #b91c1c 6px, #e2e8f0 6px, #e2e8f0 8px)" }
|
||||
: tex.id === "wood"
|
||||
? { background: "linear-gradient(90deg, #78350f, #b45309, #92400e)" }
|
||||
: tex.id === "tiles"
|
||||
? { background: "linear-gradient(45deg, #e2e8f0 25%, #cbd5e1 25%, #cbd5e1 50%, #e2e8f0 50%)" }
|
||||
: tex.id === "marble"
|
||||
? { background: "linear-gradient(135deg, #f8fafc, #cbd5e1)" }
|
||||
: tex.id === "metal"
|
||||
? { background: "linear-gradient(135deg, #475569, #cbd5e1, #475569)" }
|
||||
: tex.id === "glass"
|
||||
? { background: "rgba(56, 189, 248, 0.45)" }
|
||||
: tex.id === "grass"
|
||||
? { background: "#15803d" }
|
||||
: tex.id === "concrete"
|
||||
? { background: "#94a3b8" }
|
||||
: { background: activePaintColor }
|
||||
}
|
||||
/>
|
||||
<span>{tex.name}</span>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
<div className="tray-btn-row">
|
||||
<button
|
||||
type="button"
|
||||
className={`tray-action-btn ${paintBucketMode ? "primary" : ""}`}
|
||||
onClick={onTogglePaintBucket}
|
||||
>
|
||||
<PaintBucket size={12} aria-hidden="true" />
|
||||
<span>{paintBucketMode ? "Boya Kovası Aktif (B)" : "Boya Kovasını Aç (B)"}</span>
|
||||
</button>
|
||||
{selectedShapes.length > 0 ? (
|
||||
<button
|
||||
type="button"
|
||||
className="tray-pill-btn"
|
||||
onClick={() => applyMaterialToSelection(activePaintTexture, activePaintColor)}
|
||||
>
|
||||
Seçiliye Uygula
|
||||
</button>
|
||||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{/* 5. STİLLER (STYLES) */}
|
||||
{id === "styles" ? (
|
||||
<div className="tray-form-stack">
|
||||
<div className="tray-style-list">
|
||||
{VISUAL_STYLE_OPTIONS.map((style) => (
|
||||
<button
|
||||
key={style.id}
|
||||
type="button"
|
||||
className={`tray-style-item ${visualStyle === style.id ? "active" : ""}`}
|
||||
onClick={() => onSelectVisualStyle(style.id)}
|
||||
>
|
||||
<span className="tray-style-thumb" style={{ background: style.swatch }} aria-hidden="true" />
|
||||
<span className="tray-style-text">
|
||||
<strong>{style.label}</strong>
|
||||
<small>{style.description}</small>
|
||||
</span>
|
||||
{visualStyle === style.id ? <Check size={13} className="text-sky-400 shrink-0" /> : null}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
<div className="tray-btn-row">
|
||||
<button
|
||||
type="button"
|
||||
className={`tray-pill-btn ${xRayMode ? "active" : ""}`}
|
||||
onClick={onToggleXRay}
|
||||
>
|
||||
X-Ray (X)
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={`tray-pill-btn ${backEdgesEnabled ? "active" : ""}`}
|
||||
onClick={onToggleBackEdges}
|
||||
>
|
||||
Arka Kenar (K)
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={`tray-pill-btn ${skyGroundEnabled ? "active" : ""}`}
|
||||
onClick={onToggleSkyGround}
|
||||
>
|
||||
Gökyüzü
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{/* 6. ETİKETLER (TAGS / LAYERS) */}
|
||||
{id === "tags" ? (
|
||||
<div className="tray-form-stack">
|
||||
{tagSummary.length === 0 ? (
|
||||
<p className="tray-muted-note">Sahnede katman bulunmuyor.</p>
|
||||
) : (
|
||||
<ul className="tray-tag-list">
|
||||
{tagSummary.map((tag) => (
|
||||
<li key={tag.name} className="tray-tag-row">
|
||||
<button
|
||||
type="button"
|
||||
className="tray-tag-select"
|
||||
onClick={() => {
|
||||
const ids = shapes
|
||||
.filter((s) => ((s.tag && s.tag.trim()) || "Katman 0 (Genel)") === tag.name)
|
||||
.map((s) => s.id);
|
||||
onSelectShapes(ids);
|
||||
}}
|
||||
>
|
||||
<span className="truncate">{tag.name}</span>
|
||||
<small>({tag.count})</small>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="tray-icon-tiny"
|
||||
title={tag.allHidden ? "Katmanı Göster" : "Katmanı Gizle"}
|
||||
onClick={() => {
|
||||
const nextHidden = !tag.allHidden;
|
||||
const updated = shapes.map((s) =>
|
||||
((s.tag && s.tag.trim()) || "Katman 0 (Genel)") === tag.name
|
||||
? { ...s, hidden: nextHidden }
|
||||
: s,
|
||||
);
|
||||
onUpdateAllShapes(updated, `${tag.name} ${nextHidden ? "gizlendi" : "görünür yapıldı"}`);
|
||||
}}
|
||||
>
|
||||
{tag.allHidden ? <EyeOff size={12} /> : <Eye size={12} />}
|
||||
</button>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
<button type="button" className="tray-action-btn" onClick={onOpenLayersModal}>
|
||||
Detaylı Katman Yöneticisi…
|
||||
</button>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{/* 7. GÖLGELER & GÜNEŞ ETÜDÜ */}
|
||||
{id === "shadows" ? (
|
||||
<div className="tray-form-stack">
|
||||
<label className="tray-slider-field">
|
||||
<span>Saat: {Math.floor(solarSettings.hour)}:{Math.round((solarSettings.hour % 1) * 60) >= 30 ? "30" : "00"}</span>
|
||||
<input
|
||||
type="range"
|
||||
min={6}
|
||||
max={20}
|
||||
step={0.5}
|
||||
value={solarSettings.hour}
|
||||
onChange={(e) => handleSolarHourChange(parseFloat(e.target.value))}
|
||||
/>
|
||||
</label>
|
||||
<select
|
||||
className="tray-select"
|
||||
value={solarSettings.locationIndex}
|
||||
onChange={(e) => {
|
||||
const idx = parseInt(e.target.value, 10);
|
||||
const next = { ...solarSettings, enabled: true, locationIndex: idx };
|
||||
onChangeSolarSettings(next);
|
||||
if (typeof window !== "undefined") {
|
||||
window.dispatchEvent(new CustomEvent("snapcad:solar-update", { detail: calculateSunPosition(next) }));
|
||||
}
|
||||
}}
|
||||
aria-label="Güneş etüdü konumu"
|
||||
>
|
||||
{SOLAR_LOCATIONS.map((loc, idx) => (
|
||||
<option key={loc.name} value={idx}>{loc.name}</option>
|
||||
))}
|
||||
</select>
|
||||
<div className="tray-btn-row">
|
||||
<button
|
||||
type="button"
|
||||
className={`tray-pill-btn ${solarSettings.month === 5 ? "active" : ""}`}
|
||||
onClick={() => {
|
||||
const next = { ...solarSettings, enabled: true, month: 5, day: 21 };
|
||||
onChangeSolarSettings(next);
|
||||
if (typeof window !== "undefined") {
|
||||
window.dispatchEvent(new CustomEvent("snapcad:solar-update", { detail: calculateSunPosition(next) }));
|
||||
}
|
||||
}}
|
||||
>
|
||||
Yaz (21 Haz)
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={`tray-pill-btn ${solarSettings.month === 11 ? "active" : ""}`}
|
||||
onClick={() => {
|
||||
const next = { ...solarSettings, enabled: true, month: 11, day: 21 };
|
||||
onChangeSolarSettings(next);
|
||||
if (typeof window !== "undefined") {
|
||||
window.dispatchEvent(new CustomEvent("snapcad:solar-update", { detail: calculateSunPosition(next) }));
|
||||
}
|
||||
}}
|
||||
>
|
||||
Kış (21 Ara)
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{/* 8. SAHNELER (SCENES) */}
|
||||
{id === "scenes" ? (
|
||||
<div className="tray-form-stack">
|
||||
<button type="button" className="tray-action-btn" onClick={onAddScene}>
|
||||
<Plus size={12} aria-hidden="true" />
|
||||
<span>Yeni Sahne Ekle</span>
|
||||
</button>
|
||||
<ul className="tray-outliner-list">
|
||||
{scenes.map((sc) => (
|
||||
<li key={sc.id} className="tray-outliner-item">
|
||||
<button type="button" className="tray-outliner-select" onClick={() => onSelectScene(sc)}>
|
||||
<Compass size={12} className="text-sky-400" aria-hidden="true" />
|
||||
<span className="truncate">{sc.name}</span>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="tray-icon-tiny danger"
|
||||
onClick={() => onDeleteScene(sc.id)}
|
||||
title="Sahneyi Sil"
|
||||
aria-label={`${sc.name} sahnesini sil`}
|
||||
>
|
||||
<Trash2 size={12} />
|
||||
</button>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{/* 9. EĞİTMEN (INSTRUCTOR) */}
|
||||
{id === "instructor" ? (
|
||||
<div className="tray-instructor-card" aria-live="polite">
|
||||
<div className="tray-instructor-head">
|
||||
<strong>{toolMeta.name}</strong>
|
||||
{toolMeta.shortcut ? <kbd>{toolMeta.shortcut}</kbd> : null}
|
||||
</div>
|
||||
<p className="tray-instructor-hint">{toolMeta.hint}</p>
|
||||
<ul className="tray-instructor-steps">
|
||||
{toolMeta.instructorSteps.map((step, i) => (
|
||||
<li key={i}>{step}</li>
|
||||
))}
|
||||
</ul>
|
||||
<div className="tray-instructor-tip">
|
||||
<Sparkles size={11} aria-hidden="true" />
|
||||
<span>Ölçü Kutusuna (VCB) <code>100;50</code>, <code>*5</code> veya <code>/4</code> yazıp Enter'a basabilirsiniz.</span>
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
) : null}
|
||||
</section>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</aside>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,532 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useRef, useState, type KeyboardEvent as ReactKeyboardEvent } from "react";
|
||||
import { Check, ChevronRight, Keyboard, LayoutPanelLeft, LayoutPanelTop, PanelRight } from "lucide-react";
|
||||
import type {
|
||||
DefaultTraySectionId,
|
||||
SketchUpToolId,
|
||||
SketchUpWorkspacePrefs,
|
||||
VisualStyleMode,
|
||||
} from "@/lib/sketchupInterface";
|
||||
|
||||
export interface SketchUpMenuBarProps {
|
||||
prefs: SketchUpWorkspacePrefs;
|
||||
onUpdatePrefs: (patch: Partial<SketchUpWorkspacePrefs>) => void;
|
||||
onOpenTraySection: (section: DefaultTraySectionId) => void;
|
||||
activeTool: SketchUpToolId;
|
||||
onSelectTool: (tool: SketchUpToolId) => void;
|
||||
visualStyle: VisualStyleMode;
|
||||
onSelectVisualStyle: (style: VisualStyleMode) => void;
|
||||
xRayMode: boolean;
|
||||
onToggleXRay: () => void;
|
||||
isOrthographic: boolean;
|
||||
onToggleProjection: () => void;
|
||||
canUndo: boolean;
|
||||
canRedo: boolean;
|
||||
hasSelection: boolean;
|
||||
canGroup: boolean;
|
||||
canUngroup: boolean;
|
||||
hiddenCount: number;
|
||||
guidesCount: number;
|
||||
onUndo: () => void;
|
||||
onRedo: () => void;
|
||||
onCut: () => void;
|
||||
onCopy: () => void;
|
||||
onPaste: () => void;
|
||||
onDuplicate: () => void;
|
||||
onDelete: () => void;
|
||||
onSelectAll: () => void;
|
||||
onClearSelection: () => void;
|
||||
onMakeComponent: () => void;
|
||||
onMakeUnique: () => void;
|
||||
onGroup: () => void;
|
||||
onUngroup: () => void;
|
||||
onToggleHidden: () => void;
|
||||
onShowHidden: () => void;
|
||||
onClearGuides: () => void;
|
||||
onOpenImport: () => void;
|
||||
onOpenExport: () => void;
|
||||
onBackToDashboard?: () => void;
|
||||
onOpenLayers: () => void;
|
||||
onOpenSolar: () => void;
|
||||
onOpenFollowMe: () => void;
|
||||
onOpenTerrain: () => void;
|
||||
onOpenWallOpening: () => void;
|
||||
onRunStructuralTest: () => void;
|
||||
onOpenAudit: () => void;
|
||||
onOpenVoiceCad: () => void;
|
||||
onOpenTutorial: () => void;
|
||||
onOpenDailyChallenges: () => void;
|
||||
onOpenWorkspaceSettings: () => void;
|
||||
onOpenA11ySettings?: () => void;
|
||||
onReadShortcutHelp: () => void;
|
||||
onRadarScan: () => void;
|
||||
onCameraView: (view: "top" | "bottom" | "front" | "back" | "left" | "right" | "isometric" | "extents" | "selection" | "previous" | "two-point") => void;
|
||||
}
|
||||
|
||||
type MenuItemDef =
|
||||
| { kind: "separator" }
|
||||
| {
|
||||
kind: "action";
|
||||
id: string;
|
||||
label: string;
|
||||
shortcut?: string;
|
||||
checked?: boolean;
|
||||
disabled?: boolean;
|
||||
onSelect: () => void;
|
||||
};
|
||||
|
||||
type MenuDef = {
|
||||
id: string;
|
||||
label: string;
|
||||
items: MenuItemDef[];
|
||||
};
|
||||
|
||||
export function SketchUpMenuBar(props: SketchUpMenuBarProps) {
|
||||
const {
|
||||
prefs,
|
||||
onUpdatePrefs,
|
||||
onOpenTraySection,
|
||||
activeTool,
|
||||
onSelectTool,
|
||||
visualStyle,
|
||||
onSelectVisualStyle,
|
||||
xRayMode,
|
||||
onToggleXRay,
|
||||
isOrthographic,
|
||||
onToggleProjection,
|
||||
canUndo,
|
||||
canRedo,
|
||||
hasSelection,
|
||||
canGroup,
|
||||
canUngroup,
|
||||
hiddenCount,
|
||||
guidesCount,
|
||||
} = props;
|
||||
|
||||
const [openMenuId, setOpenMenuId] = useState<string | null>(null);
|
||||
const barRef = useRef<HTMLDivElement | null>(null);
|
||||
const triggerRefs = useRef<Record<string, HTMLButtonElement | null>>({});
|
||||
|
||||
useEffect(() => {
|
||||
if (!openMenuId) return;
|
||||
const handlePointerDown = (e: MouseEvent) => {
|
||||
if (barRef.current && !barRef.current.contains(e.target as Node)) {
|
||||
setOpenMenuId(null);
|
||||
}
|
||||
};
|
||||
const handleEsc = (e: KeyboardEvent) => {
|
||||
if (e.key === "Escape") {
|
||||
setOpenMenuId(null);
|
||||
}
|
||||
};
|
||||
window.addEventListener("mousedown", handlePointerDown);
|
||||
window.addEventListener("keydown", handleEsc);
|
||||
return () => {
|
||||
window.removeEventListener("mousedown", handlePointerDown);
|
||||
window.removeEventListener("keydown", handleEsc);
|
||||
};
|
||||
}, [openMenuId]);
|
||||
|
||||
const menus: MenuDef[] = [
|
||||
{
|
||||
id: "file",
|
||||
label: "Dosya",
|
||||
items: [
|
||||
...(props.onBackToDashboard
|
||||
? [
|
||||
{
|
||||
kind: "action" as const,
|
||||
id: "file-dashboard",
|
||||
label: "Projeler Paneli / Yeni Tasarım",
|
||||
onSelect: () => props.onBackToDashboard?.(),
|
||||
},
|
||||
{ kind: "separator" as const },
|
||||
]
|
||||
: []),
|
||||
{
|
||||
kind: "action",
|
||||
id: "file-import",
|
||||
label: "İçe Aktar (SKF, DWG, DXF, STEP, STL, OBJ, SVG)…",
|
||||
onSelect: props.onOpenImport,
|
||||
},
|
||||
{
|
||||
kind: "action",
|
||||
id: "file-export",
|
||||
label: "Dışa Aktar (STL, OBJ, STEP, DXF, 3MF, SKF)…",
|
||||
onSelect: props.onOpenExport,
|
||||
},
|
||||
{ kind: "separator" },
|
||||
{
|
||||
kind: "action",
|
||||
id: "file-ws-settings",
|
||||
label: "Model Bilgisi & Çalışma Alanı Birimleri…",
|
||||
onSelect: props.onOpenWorkspaceSettings,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "edit",
|
||||
label: "Düzenle",
|
||||
items: [
|
||||
{ kind: "action", id: "edit-undo", label: "Geri Al", shortcut: "Ctrl+Z", disabled: !canUndo, onSelect: props.onUndo },
|
||||
{ kind: "action", id: "edit-redo", label: "Yinele", shortcut: "Ctrl+Y", disabled: !canRedo, onSelect: props.onRedo },
|
||||
{ kind: "separator" },
|
||||
{ kind: "action", id: "edit-cut", label: "Kes", shortcut: "Ctrl+X", disabled: !hasSelection, onSelect: props.onCut },
|
||||
{ kind: "action", id: "edit-copy", label: "Kopyala", shortcut: "Ctrl+C", disabled: !hasSelection, onSelect: props.onCopy },
|
||||
{ kind: "action", id: "edit-paste", label: "Yapıştır", shortcut: "Ctrl+V", onSelect: props.onPaste },
|
||||
{ kind: "action", id: "edit-dup", label: "Çoğalt", shortcut: "Ctrl+D", disabled: !hasSelection, onSelect: props.onDuplicate },
|
||||
{ kind: "action", id: "edit-del", label: "Sil", shortcut: "Del", disabled: !hasSelection, onSelect: props.onDelete },
|
||||
{ kind: "separator" },
|
||||
{ kind: "action", id: "edit-all", label: "Tümünü Seç", shortcut: "Ctrl+A", onSelect: props.onSelectAll },
|
||||
{ kind: "action", id: "edit-none", label: "Seçimi Bırak", shortcut: "Esc", disabled: !hasSelection, onSelect: props.onClearSelection },
|
||||
{ kind: "separator" },
|
||||
{
|
||||
kind: "action",
|
||||
id: "edit-comp",
|
||||
label: "Bileşen Oluştur (Make Component)…",
|
||||
shortcut: prefs.keymapProfile === "classic-sketchup" ? "G" : "",
|
||||
disabled: !hasSelection,
|
||||
onSelect: props.onMakeComponent,
|
||||
},
|
||||
{
|
||||
kind: "action",
|
||||
id: "edit-unique",
|
||||
label: "Bileşeni Benzersiz Yap (Make Unique)",
|
||||
disabled: !hasSelection,
|
||||
onSelect: props.onMakeUnique,
|
||||
},
|
||||
{ kind: "action", id: "edit-group", label: "Grupla (Make Group)", shortcut: "Ctrl+G", disabled: !canGroup, onSelect: props.onGroup },
|
||||
{ kind: "action", id: "edit-ungroup", label: "Grubu Çöz (Explode)", shortcut: "Ctrl+Shift+G", disabled: !canUngroup, onSelect: props.onUngroup },
|
||||
{ kind: "separator" },
|
||||
{ kind: "action", id: "edit-hide", label: "Gizle / Göster", shortcut: "Ctrl+H", disabled: !hasSelection, onSelect: props.onToggleHidden },
|
||||
{ kind: "action", id: "edit-unhide-all", label: `Gizlileri Göster (${hiddenCount})`, shortcut: "Ctrl+Shift+H", disabled: hiddenCount === 0, onSelect: props.onShowHidden },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "view",
|
||||
label: "Görünüm",
|
||||
items: [
|
||||
{
|
||||
kind: "action",
|
||||
id: "view-toolset",
|
||||
label: "Büyük Araç Seti (Sol Panel)",
|
||||
checked: prefs.showLeftToolset,
|
||||
onSelect: () => onUpdatePrefs({ showLeftToolset: !prefs.showLeftToolset }),
|
||||
},
|
||||
{
|
||||
kind: "action",
|
||||
id: "view-tray",
|
||||
label: "Varsayılan Tepsi (Sağ Panel)",
|
||||
checked: prefs.showDefaultTray,
|
||||
onSelect: () => onUpdatePrefs({ showDefaultTray: !prefs.showDefaultTray }),
|
||||
},
|
||||
{
|
||||
kind: "action",
|
||||
id: "view-ribbon",
|
||||
label: "SnapCAD Üst Araç Şeridi",
|
||||
checked: prefs.showSecondaryRibbon,
|
||||
onSelect: () => onUpdatePrefs({ showSecondaryRibbon: !prefs.showSecondaryRibbon }),
|
||||
},
|
||||
{ kind: "separator" },
|
||||
{
|
||||
kind: "action",
|
||||
id: "view-sky",
|
||||
label: "Gökyüzü & Ufuk Zemini (Sky / Ground)",
|
||||
checked: prefs.skyGroundEnabled,
|
||||
onSelect: () => onUpdatePrefs({ skyGroundEnabled: !prefs.skyGroundEnabled }),
|
||||
},
|
||||
{
|
||||
kind: "action",
|
||||
id: "view-backedges",
|
||||
label: "Arka Kenarlar (Back Edges)",
|
||||
shortcut: prefs.keymapProfile === "classic-sketchup" ? "K" : "",
|
||||
checked: prefs.backEdgesEnabled,
|
||||
onSelect: () => onUpdatePrefs({ backEdgesEnabled: !prefs.backEdgesEnabled }),
|
||||
},
|
||||
{
|
||||
kind: "action",
|
||||
id: "view-xray",
|
||||
label: "X-Ray (Röntgen Modu)",
|
||||
shortcut: "X",
|
||||
checked: xRayMode,
|
||||
onSelect: props.onToggleXRay,
|
||||
},
|
||||
{ kind: "separator" },
|
||||
{ kind: "action", id: "style-shaded", label: "Yüz Stili: Dokulu & Gölgeli", checked: visualStyle === "shaded", onSelect: () => onSelectVisualStyle("shaded") },
|
||||
{ kind: "action", id: "style-mono", label: "Yüz Stili: Monokrom", checked: visualStyle === "monochrome", onSelect: () => onSelectVisualStyle("monochrome") },
|
||||
{ kind: "action", id: "style-hidden", label: "Yüz Stili: Gizli Çizgi (Hidden Line)", checked: visualStyle === "hidden-line", onSelect: () => onSelectVisualStyle("hidden-line") },
|
||||
{ kind: "action", id: "style-wire", label: "Yüz Stili: Tel Kafes (Wireframe)", checked: visualStyle === "wireframe", onSelect: () => onSelectVisualStyle("wireframe") },
|
||||
{ kind: "action", id: "style-blue", label: "Yüz Stili: Mimari Ozalit (Blueprint)", checked: visualStyle === "blueprint", onSelect: () => onSelectVisualStyle("blueprint") },
|
||||
{ kind: "action", id: "style-clay", label: "Yüz Stili: Sıcak Kil", checked: visualStyle === "clay", onSelect: () => onSelectVisualStyle("clay") },
|
||||
{ kind: "separator" },
|
||||
{ kind: "action", id: "view-layers", label: "Etiketler / Katmanlar…", onSelect: props.onOpenLayers },
|
||||
{ kind: "action", id: "view-solar", label: "Güneş & Gölgeler Etüdü…", onSelect: props.onOpenSolar },
|
||||
{ kind: "action", id: "view-clear-guides", label: `Kılavuzları Temizle (${guidesCount})`, disabled: guidesCount === 0, onSelect: props.onClearGuides },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "camera",
|
||||
label: "Kamera",
|
||||
items: [
|
||||
{ kind: "action", id: "cam-iso", label: "İzometrik Görünüm", shortcut: "Home", onSelect: () => props.onCameraView("isometric") },
|
||||
{ kind: "action", id: "cam-top", label: "Üst (Top)", shortcut: "5", onSelect: () => props.onCameraView("top") },
|
||||
{ kind: "action", id: "cam-front", label: "Ön (Front)", shortcut: "1", onSelect: () => props.onCameraView("front") },
|
||||
{ kind: "action", id: "cam-right", label: "Sağ (Right)", shortcut: "4", onSelect: () => props.onCameraView("right") },
|
||||
{ kind: "action", id: "cam-back", label: "Arka (Back)", shortcut: "2", onSelect: () => props.onCameraView("back") },
|
||||
{ kind: "action", id: "cam-left", label: "Sol (Left)", shortcut: "3", onSelect: () => props.onCameraView("left") },
|
||||
{ kind: "action", id: "cam-bottom", label: "Alt (Bottom)", shortcut: "6", onSelect: () => props.onCameraView("bottom") },
|
||||
{ kind: "separator" },
|
||||
{
|
||||
kind: "action",
|
||||
id: "cam-proj",
|
||||
label: isOrthographic ? "Perspektif Görünüme Geç" : "Paralel İzdüşüm (Parallel Projection)",
|
||||
shortcut: prefs.keymapProfile === "classic-sketchup" ? "Shift+V" : "O",
|
||||
checked: isOrthographic,
|
||||
onSelect: onToggleProjection,
|
||||
},
|
||||
{ kind: "action", id: "cam-2p", label: "İki Kaçışlı Perspektif (2-Point)", onSelect: () => props.onCameraView("two-point") },
|
||||
{ kind: "separator" },
|
||||
{ kind: "action", id: "cam-orbit", label: "Yörünge (Orbit)", shortcut: prefs.keymapProfile === "classic-sketchup" ? "O" : "", checked: activeTool === "orbit", onSelect: () => onSelectTool("orbit") },
|
||||
{ kind: "action", id: "cam-pan", label: "Kaydır (Pan)", shortcut: prefs.keymapProfile === "classic-sketchup" ? "H" : "", checked: activeTool === "pan", onSelect: () => onSelectTool("pan") },
|
||||
{ kind: "action", id: "cam-zoom", label: "Yakınlaştır (Zoom)", shortcut: "Z", checked: activeTool === "zoom", onSelect: () => onSelectTool("zoom") },
|
||||
{ kind: "action", id: "cam-extents", label: "Ekrana Sığdır (Zoom Extents)", shortcut: "Shift+Z", onSelect: () => props.onCameraView("extents") },
|
||||
{ kind: "action", id: "cam-sel", label: "Seçileni Çerçevele (Zoom Selection)", shortcut: "Alt+Z", onSelect: () => props.onCameraView("selection") },
|
||||
{ kind: "action", id: "cam-prev", label: "Önceki Görünüm (Previous)", shortcut: "Alt+P", onSelect: () => props.onCameraView("previous") },
|
||||
{ kind: "separator" },
|
||||
{ kind: "action", id: "cam-walk", label: "İçinde Yürü (Walk / WASD)", onSelect: () => onSelectTool("walk") },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "draw",
|
||||
label: "Çizim",
|
||||
items: [
|
||||
{ kind: "action", id: "draw-line", label: "Çizgi (Line)", shortcut: "L", checked: activeTool === "line", onSelect: () => onSelectTool("line") },
|
||||
{ kind: "action", id: "draw-free", label: "Serbest / Eğri (Freehand)", checked: activeTool === "freehand", onSelect: () => onSelectTool("freehand") },
|
||||
{ kind: "action", id: "draw-arc", label: "Yay (Arc)", shortcut: "A", checked: activeTool === "arc", onSelect: () => onSelectTool("arc") },
|
||||
{ kind: "separator" },
|
||||
{ kind: "action", id: "draw-rect", label: "Dikdörtgen (Rectangle)", shortcut: "R", checked: activeTool === "rectangle", onSelect: () => onSelectTool("rectangle") },
|
||||
{ kind: "action", id: "draw-circle", label: "Daire (Circle)", shortcut: "C", checked: activeTool === "circle", onSelect: () => onSelectTool("circle") },
|
||||
{ kind: "action", id: "draw-poly", label: "Çokgen (Polygon)", checked: activeTool === "polygon", onSelect: () => onSelectTool("polygon") },
|
||||
{ kind: "separator" },
|
||||
{ kind: "action", id: "draw-text", label: "3B Metin Ekle (3D Text)", onSelect: () => onSelectTool("3d-text") },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "tools",
|
||||
label: "Araçlar",
|
||||
items: [
|
||||
{ kind: "action", id: "tool-select", label: "Seçim (Select)", shortcut: "Space", checked: activeTool === "select", onSelect: () => onSelectTool("select") },
|
||||
{ kind: "action", id: "tool-eraser", label: "Silgi (Eraser)", shortcut: "E", checked: activeTool === "eraser", onSelect: () => onSelectTool("eraser") },
|
||||
{ kind: "action", id: "tool-paint", label: "Boya Kovası (Paint Bucket)", shortcut: "B", checked: activeTool === "paint", onSelect: () => onSelectTool("paint") },
|
||||
{ kind: "separator" },
|
||||
{ kind: "action", id: "tool-move", label: "Taşı (Move)", shortcut: "M", checked: activeTool === "move", onSelect: () => onSelectTool("move") },
|
||||
{ kind: "action", id: "tool-pp", label: "İt / Çek (Push/Pull)", shortcut: "P", checked: activeTool === "push-pull", onSelect: () => onSelectTool("push-pull") },
|
||||
{ kind: "action", id: "tool-rot", label: "Döndür (Rotate)", shortcut: prefs.keymapProfile === "classic-sketchup" ? "Q" : "", checked: activeTool === "rotate", onSelect: () => onSelectTool("rotate") },
|
||||
{ kind: "action", id: "tool-scale", label: "Ölçekle (Scale)", shortcut: "S", checked: activeTool === "scale", onSelect: () => onSelectTool("scale") },
|
||||
{ kind: "action", id: "tool-offset", label: "Ofset (Offset)", shortcut: prefs.keymapProfile === "classic-sketchup" ? "F" : "", checked: activeTool === "offset", onSelect: () => onSelectTool("offset") },
|
||||
{ kind: "action", id: "tool-follow", label: "Beni Takip Et (Follow Me)…", onSelect: props.onOpenFollowMe },
|
||||
{ kind: "separator" },
|
||||
{ kind: "action", id: "tool-tape", label: "Şerit Metre & Kılavuz (Tape Measure)", shortcut: "T", checked: activeTool === "tape", onSelect: () => onSelectTool("tape") },
|
||||
{ kind: "action", id: "tool-prot", label: "İletki / Açılı Kılavuz (Protractor)", onSelect: () => onSelectTool("protractor") },
|
||||
{ kind: "action", id: "tool-axes", label: "Eksenler / Çalışma Düzlemi (Axes)", shortcut: "W", checked: activeTool === "axes", onSelect: () => onSelectTool("axes") },
|
||||
{ kind: "action", id: "tool-sec", label: "Kesit Düzlemi (Section Plane)", onSelect: () => onSelectTool("section") },
|
||||
{ kind: "separator" },
|
||||
{ kind: "action", id: "tool-wall", label: "Duvar Kapı / Pencere Boşluğu Aç…", onSelect: props.onOpenWallOpening },
|
||||
{ kind: "action", id: "tool-terrain", label: "Arazi & Yükselti Üreticisi (Sandbox)…", onSelect: props.onOpenTerrain },
|
||||
{ kind: "action", id: "tool-static", label: "Statik & Deprem Dayanım Testi…", onSelect: props.onRunStructuralTest },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "window",
|
||||
label: "Pencere",
|
||||
items: [
|
||||
{ kind: "action", id: "win-entity", label: "Tepsi: Öğe Bilgisi (Entity Info)", checked: prefs.showDefaultTray && prefs.openTraySections.includes("entity-info"), onSelect: () => onOpenTraySection("entity-info") },
|
||||
{ kind: "action", id: "win-outliner", label: "Tepsi: Ana Hatlar (Outliner)", checked: prefs.showDefaultTray && prefs.openTraySections.includes("outliner"), onSelect: () => onOpenTraySection("outliner") },
|
||||
{ kind: "action", id: "win-comp", label: "Tepsi: Bileşenler (3B Havuz)", checked: prefs.showDefaultTray && prefs.openTraySections.includes("components"), onSelect: () => onOpenTraySection("components") },
|
||||
{ kind: "action", id: "win-mat", label: "Tepsi: Malzemeler (Materials)", checked: prefs.showDefaultTray && prefs.openTraySections.includes("materials"), onSelect: () => onOpenTraySection("materials") },
|
||||
{ kind: "action", id: "win-styles", label: "Tepsi: Stiller (Styles)", checked: prefs.showDefaultTray && prefs.openTraySections.includes("styles"), onSelect: () => onOpenTraySection("styles") },
|
||||
{ kind: "action", id: "win-tags", label: "Tepsi: Etiketler (Tags / Layers)", checked: prefs.showDefaultTray && prefs.openTraySections.includes("tags"), onSelect: () => onOpenTraySection("tags") },
|
||||
{ kind: "action", id: "win-shadows", label: "Tepsi: Gölgeler & Güneş (Shadows)", checked: prefs.showDefaultTray && prefs.openTraySections.includes("shadows"), onSelect: () => onOpenTraySection("shadows") },
|
||||
{ kind: "action", id: "win-scenes", label: "Tepsi: Sahneler (Scenes)", checked: prefs.showDefaultTray && prefs.openTraySections.includes("scenes"), onSelect: () => onOpenTraySection("scenes") },
|
||||
{ kind: "action", id: "win-inst", label: "Tepsi: Eğitmen (Instructor)", checked: prefs.showDefaultTray && prefs.openTraySections.includes("instructor"), onSelect: () => onOpenTraySection("instructor") },
|
||||
{ kind: "separator" },
|
||||
{
|
||||
kind: "action",
|
||||
id: "win-keymap-skp",
|
||||
label: "Kısayol Profili: SketchUp Klasik (L, R, C, P, M, Q, S, F, O, H, Z, E)",
|
||||
checked: prefs.keymapProfile === "classic-sketchup",
|
||||
onSelect: () => onUpdatePrefs({ keymapProfile: "classic-sketchup" }),
|
||||
},
|
||||
{
|
||||
kind: "action",
|
||||
id: "win-keymap-std",
|
||||
label: "Kısayol Profili: SnapCAD Erişilebilir Klasik (İ, V, K, Q Yardım, F Sıfırla)",
|
||||
checked: prefs.keymapProfile === "snapcad-standard",
|
||||
onSelect: () => onUpdatePrefs({ keymapProfile: "snapcad-standard" }),
|
||||
},
|
||||
{ kind: "separator" },
|
||||
{ kind: "action", id: "win-settings", label: "Tercihler & Birim Ayarları…", onSelect: props.onOpenWorkspaceSettings },
|
||||
...(props.onOpenA11ySettings
|
||||
? [{ kind: "action" as const, id: "win-a11y", label: "Erişilebilirlik & NVDA Sesli Asistan…", onSelect: () => props.onOpenA11ySettings?.() }]
|
||||
: []),
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "help",
|
||||
label: "Yardım",
|
||||
items: [
|
||||
{ kind: "action", id: "help-audit", label: "3B Sahne Denetçisi (Erişilebilir Rapor)", shortcut: "İ / F2", onSelect: props.onOpenAudit },
|
||||
{ kind: "action", id: "help-voice", label: "Sesli / Metin CAD Komut Konsolu", shortcut: "/ veya V", onSelect: props.onOpenVoiceCad },
|
||||
{ kind: "action", id: "help-radar", label: "Sesli 3B Radar Taraması", shortcut: prefs.keymapProfile === "classic-sketchup" ? "F8 / Alt+K" : "K / F8", onSelect: props.onRadarScan },
|
||||
{ kind: "action", id: "help-keys", label: "Kısayol Rehberini Seslendir & Göster", shortcut: "?", onSelect: props.onReadShortcutHelp },
|
||||
{ kind: "separator" },
|
||||
{ kind: "action", id: "help-tut", label: "SnapCAD Akademi İnteraktif Eğitimi…", onSelect: props.onOpenTutorial },
|
||||
{ kind: "action", id: "help-chal", label: "Günün Mimari Görevleri…", onSelect: props.onOpenDailyChallenges },
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
const handleMenuBarKeyDown = (e: ReactKeyboardEvent<HTMLButtonElement>, idx: number) => {
|
||||
if (e.key === "ArrowRight") {
|
||||
e.preventDefault();
|
||||
const next = menus[(idx + 1) % menus.length];
|
||||
triggerRefs.current[next.id]?.focus();
|
||||
if (openMenuId) setOpenMenuId(next.id);
|
||||
} else if (e.key === "ArrowLeft") {
|
||||
e.preventDefault();
|
||||
const prev = menus[(idx - 1 + menus.length) % menus.length];
|
||||
triggerRefs.current[prev.id]?.focus();
|
||||
if (openMenuId) setOpenMenuId(prev.id);
|
||||
} else if (e.key === "Escape") {
|
||||
e.preventDefault();
|
||||
setOpenMenuId(null);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div
|
||||
ref={barRef}
|
||||
className="sketchup-menubar"
|
||||
role="menubar"
|
||||
aria-label="SketchUp Klasik Menü Çubuğu"
|
||||
>
|
||||
<div className="sketchup-menubar-items">
|
||||
{menus.map((menu, idx) => {
|
||||
const isOpen = openMenuId === menu.id;
|
||||
return (
|
||||
<div
|
||||
key={menu.id}
|
||||
className="sketchup-menu-slot"
|
||||
onMouseEnter={() => {
|
||||
if (openMenuId && openMenuId !== menu.id) {
|
||||
setOpenMenuId(menu.id);
|
||||
}
|
||||
}}
|
||||
>
|
||||
<button
|
||||
ref={(el) => {
|
||||
triggerRefs.current[menu.id] = el;
|
||||
}}
|
||||
type="button"
|
||||
role="menuitem"
|
||||
aria-haspopup="menu"
|
||||
aria-expanded={isOpen}
|
||||
className={`sketchup-menu-trigger ${isOpen ? "open" : ""}`}
|
||||
onClick={() => setOpenMenuId((cur) => (cur === menu.id ? null : menu.id))}
|
||||
onKeyDown={(e) => handleMenuBarKeyDown(e, idx)}
|
||||
>
|
||||
{menu.label}
|
||||
</button>
|
||||
|
||||
{isOpen ? (
|
||||
<div className="sketchup-menu-dropdown" role="menu" aria-label={`${menu.label} alt menüsü`}>
|
||||
{menu.items.map((item, itemIdx) =>
|
||||
item.kind === "separator" ? (
|
||||
<div key={`${menu.id}-sep-${itemIdx}`} className="sketchup-menu-sep" role="separator" />
|
||||
) : (
|
||||
<button
|
||||
key={item.id}
|
||||
type="button"
|
||||
role="menuitemcheckbox"
|
||||
aria-checked={Boolean(item.checked)}
|
||||
disabled={item.disabled}
|
||||
className={`sketchup-menu-item ${item.checked ? "checked" : ""}`}
|
||||
onClick={() => {
|
||||
setOpenMenuId(null);
|
||||
item.onSelect();
|
||||
}}
|
||||
>
|
||||
<span className="sketchup-menu-check" aria-hidden="true">
|
||||
{item.checked ? <Check size={12} /> : null}
|
||||
</span>
|
||||
<span className="sketchup-menu-label">{item.label}</span>
|
||||
{item.shortcut ? (
|
||||
<kbd className="sketchup-menu-shortcut">{item.shortcut}</kbd>
|
||||
) : null}
|
||||
</button>
|
||||
),
|
||||
)}
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
|
||||
{/* Sağ taraf: hızlı görünüm & kısayol profili anahtarları */}
|
||||
<div className="sketchup-menubar-right">
|
||||
<button
|
||||
type="button"
|
||||
className={`sketchup-quick-chip ${prefs.showLeftToolset ? "active" : ""}`}
|
||||
onClick={() => onUpdatePrefs({ showLeftToolset: !prefs.showLeftToolset })}
|
||||
title="Sol Büyük Araç Setini Aç/Kapa"
|
||||
aria-pressed={prefs.showLeftToolset}
|
||||
>
|
||||
<LayoutPanelLeft size={12} aria-hidden="true" />
|
||||
<span className="hidden md:inline">Araç Seti</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
className={`sketchup-quick-chip ${prefs.showSecondaryRibbon ? "active" : ""}`}
|
||||
onClick={() => onUpdatePrefs({ showSecondaryRibbon: !prefs.showSecondaryRibbon })}
|
||||
title="SnapCAD Şekil Ekleme Şeridini Aç/Kapa"
|
||||
aria-pressed={prefs.showSecondaryRibbon}
|
||||
>
|
||||
<LayoutPanelTop size={12} aria-hidden="true" />
|
||||
<span className="hidden md:inline">Üst Şerit</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
className={`sketchup-quick-chip ${prefs.showDefaultTray ? "active" : ""}`}
|
||||
onClick={() => onUpdatePrefs({ showDefaultTray: !prefs.showDefaultTray })}
|
||||
title="Sağ Varsayılan Tepsiyi (Default Tray) Aç/Kapa"
|
||||
aria-pressed={prefs.showDefaultTray}
|
||||
>
|
||||
<PanelRight size={12} aria-hidden="true" />
|
||||
<span className="hidden md:inline">Varsayılan Tepsi</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
className="sketchup-quick-chip keymap-chip"
|
||||
onClick={() =>
|
||||
onUpdatePrefs({
|
||||
keymapProfile:
|
||||
prefs.keymapProfile === "classic-sketchup" ? "snapcad-standard" : "classic-sketchup",
|
||||
})
|
||||
}
|
||||
title="Kısayol Profilini Değiştir: SketchUp Klasik <-> SnapCAD Standart"
|
||||
>
|
||||
<Keyboard size={12} aria-hidden="true" />
|
||||
<span>
|
||||
{prefs.keymapProfile === "classic-sketchup" ? "SketchUp Klasik" : "SnapCAD Klasik"}
|
||||
</span>
|
||||
<ChevronRight size={11} aria-hidden="true" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,251 @@
|
||||
"use client";
|
||||
|
||||
import {
|
||||
ArrowUpDown,
|
||||
Axis3d,
|
||||
Box,
|
||||
Circle,
|
||||
Compass,
|
||||
Eraser,
|
||||
Eye,
|
||||
Focus,
|
||||
Hand,
|
||||
Hexagon,
|
||||
Highlighter,
|
||||
Layers,
|
||||
Maximize2,
|
||||
MousePointer2,
|
||||
Move,
|
||||
PaintBucket,
|
||||
PenTool,
|
||||
Pencil,
|
||||
RotateCcw,
|
||||
RotateCw,
|
||||
Ruler,
|
||||
Scaling,
|
||||
Scissors,
|
||||
Spline,
|
||||
Square,
|
||||
SplinePointer,
|
||||
Type,
|
||||
Waypoints,
|
||||
ZoomIn,
|
||||
Footprints,
|
||||
CopyPlus,
|
||||
} from "lucide-react";
|
||||
import { SKETCHUP_TOOLS, type SketchUpToolId, type VisualStyleMode } from "@/lib/sketchupInterface";
|
||||
|
||||
export interface SketchUpToolsetProps {
|
||||
activeTool: SketchUpToolId;
|
||||
onSelectTool: (tool: SketchUpToolId) => void;
|
||||
visualStyle: VisualStyleMode;
|
||||
onSelectVisualStyle: (style: VisualStyleMode) => void;
|
||||
xRayMode: boolean;
|
||||
onToggleXRay: () => void;
|
||||
backEdgesEnabled: boolean;
|
||||
onToggleBackEdges: () => void;
|
||||
onCameraPreset: (view: "isometric" | "top" | "front" | "right" | "back" | "left") => void;
|
||||
}
|
||||
|
||||
type ToolButtonSpec = {
|
||||
id: SketchUpToolId;
|
||||
icon: typeof MousePointer2;
|
||||
};
|
||||
|
||||
const TOOL_GROUPS: Array<{ label: string; items: ToolButtonSpec[] }> = [
|
||||
{
|
||||
label: "Temel",
|
||||
items: [
|
||||
{ id: "select", icon: MousePointer2 },
|
||||
{ id: "make-component", icon: Box },
|
||||
{ id: "paint", icon: PaintBucket },
|
||||
{ id: "eraser", icon: Eraser },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "Çizim",
|
||||
items: [
|
||||
{ id: "line", icon: PenTool },
|
||||
{ id: "freehand", icon: Pencil },
|
||||
{ id: "rectangle", icon: Square },
|
||||
{ id: "polygon", icon: Hexagon },
|
||||
{ id: "circle", icon: Circle },
|
||||
{ id: "arc", icon: Spline },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "Düzenle",
|
||||
items: [
|
||||
{ id: "move", icon: Move },
|
||||
{ id: "push-pull", icon: ArrowUpDown },
|
||||
{ id: "rotate", icon: RotateCw },
|
||||
{ id: "follow-me", icon: Waypoints },
|
||||
{ id: "scale", icon: Scaling },
|
||||
{ id: "offset", icon: CopyPlus },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "Ölçüm",
|
||||
items: [
|
||||
{ id: "tape", icon: Ruler },
|
||||
{ id: "protractor", icon: Compass },
|
||||
{ id: "axes", icon: Axis3d },
|
||||
{ id: "3d-text", icon: Type },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "Kamera",
|
||||
items: [
|
||||
{ id: "orbit", icon: RotateCcw },
|
||||
{ id: "pan", icon: Hand },
|
||||
{ id: "zoom", icon: ZoomIn },
|
||||
{ id: "zoom-extents", icon: Maximize2 },
|
||||
{ id: "zoom-selection", icon: Focus },
|
||||
{ id: "zoom-previous", icon: SplinePointer },
|
||||
{ id: "section", icon: Scissors },
|
||||
{ id: "walk", icon: Footprints },
|
||||
{ id: "xray", icon: Eye },
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
export function SketchUpToolset({
|
||||
activeTool,
|
||||
onSelectTool,
|
||||
visualStyle,
|
||||
onSelectVisualStyle,
|
||||
xRayMode,
|
||||
onToggleXRay,
|
||||
backEdgesEnabled,
|
||||
onToggleBackEdges,
|
||||
onCameraPreset,
|
||||
}: SketchUpToolsetProps) {
|
||||
return (
|
||||
<aside
|
||||
className="sketchup-large-toolset"
|
||||
role="toolbar"
|
||||
aria-label="SketchUp Büyük Araç Seti (Large Tool Set)"
|
||||
aria-orientation="vertical"
|
||||
>
|
||||
{TOOL_GROUPS.map((group) => (
|
||||
<div key={group.label} className="sketchup-tool-group">
|
||||
<div className="sketchup-tool-grid">
|
||||
{group.items.map(({ id, icon: Icon }) => {
|
||||
const meta = SKETCHUP_TOOLS[id];
|
||||
const isActive = activeTool === id || (id === "xray" && xRayMode);
|
||||
return (
|
||||
<button
|
||||
key={id}
|
||||
type="button"
|
||||
className={`sketchup-tool-btn ${isActive ? "active" : ""}`}
|
||||
aria-label={`${meta.name} (${meta.englishName})${meta.shortcut ? ` - Kısayol: ${meta.shortcut}` : ""}`}
|
||||
aria-pressed={isActive}
|
||||
title={`${meta.name} (${meta.englishName})${meta.shortcut ? ` [${meta.shortcut}]` : ""}`}
|
||||
onClick={() => {
|
||||
if (id === "xray") {
|
||||
onToggleXRay();
|
||||
} else {
|
||||
onSelectTool(id);
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Icon size={16} strokeWidth={2} aria-hidden="true" />
|
||||
{meta.shortcut ? (
|
||||
<span className="sketchup-tool-key" aria-hidden="true">
|
||||
{meta.shortcut === "Space" ? "␣" : meta.shortcut.replace("Shift+", "⇧").replace("Alt+", "⌥")}
|
||||
</span>
|
||||
) : null}
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
|
||||
{/* Hızlı Standart Görünümler (Standard Views - Iso/Top/Front/Right/Back/Left) */}
|
||||
<div className="sketchup-tool-group" role="group" aria-label="Hızlı Standart Kamera Görünümleri">
|
||||
<span className="sketchup-tool-sublabel">Bakış</span>
|
||||
<div className="sketchup-mini-view-grid">
|
||||
{(
|
||||
[
|
||||
{ id: "isometric", short: "ISO", label: "İzometrik Görünüm (Home)" },
|
||||
{ id: "top", short: "ÜST", label: "Üst Görünüm (5)" },
|
||||
{ id: "front", short: "ÖN", label: "Ön Görünüm (1)" },
|
||||
{ id: "right", short: "SAĞ", label: "Sağ Görünüm (4)" },
|
||||
{ id: "back", short: "ARK", label: "Arka Görünüm (2)" },
|
||||
{ id: "left", short: "SOL", label: "Sol Görünüm (3)" },
|
||||
] as const
|
||||
).map((v) => (
|
||||
<button
|
||||
key={v.id}
|
||||
type="button"
|
||||
className="sketchup-mini-pill"
|
||||
onClick={() => onCameraPreset(v.id)}
|
||||
title={v.label}
|
||||
aria-label={v.label}
|
||||
>
|
||||
{v.short}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Hızlı Yüz Stilleri (Face Styles) */}
|
||||
<div className="sketchup-tool-group" role="group" aria-label="Hızlı Yüz Stilleri">
|
||||
<span className="sketchup-tool-sublabel">Stil</span>
|
||||
<div className="sketchup-mini-view-grid">
|
||||
<button
|
||||
type="button"
|
||||
className={`sketchup-mini-pill ${visualStyle === "wireframe" ? "active" : ""}`}
|
||||
onClick={() => onSelectVisualStyle("wireframe")}
|
||||
title="Tel Kafes (Wireframe)"
|
||||
>
|
||||
TEL
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={`sketchup-mini-pill ${visualStyle === "hidden-line" ? "active" : ""}`}
|
||||
onClick={() => onSelectVisualStyle("hidden-line")}
|
||||
title="Gizli Çizgi (Hidden Line)"
|
||||
>
|
||||
GİZ
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={`sketchup-mini-pill ${visualStyle === "shaded" ? "active" : ""}`}
|
||||
onClick={() => onSelectVisualStyle("shaded")}
|
||||
title="Dokulu & Gölgeli (Shaded)"
|
||||
>
|
||||
GÖL
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={`sketchup-mini-pill ${visualStyle === "monochrome" ? "active" : ""}`}
|
||||
onClick={() => onSelectVisualStyle("monochrome")}
|
||||
title="Monokrom (Monochrome)"
|
||||
>
|
||||
MON
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={`sketchup-mini-pill ${backEdgesEnabled ? "active" : ""}`}
|
||||
onClick={onToggleBackEdges}
|
||||
title="Arka Kenarları Göster/Gizle (Back Edges - K)"
|
||||
aria-pressed={backEdgesEnabled}
|
||||
>
|
||||
<Highlighter size={11} aria-hidden="true" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={`sketchup-mini-pill ${xRayMode ? "active" : ""}`}
|
||||
onClick={onToggleXRay}
|
||||
title="X-Ray (Röntgen - X)"
|
||||
aria-pressed={xRayMode}
|
||||
>
|
||||
<Layers size={11} aria-hidden="true" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user