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
- DWG/DXF içe aktarma ve .skf yeniden açma düzeltmeleri - YakNet Bulut eşitlemede boş/eski kopya koruması ve yerel-only proje bildirimi - Panelden içe aktarma duyuruları ve erişilebilir Türkçe hata mesajları - AGPL-3.0 lisansı, README ve YakHub bağlantıları
662 lines
25 KiB
TypeScript
662 lines
25 KiB
TypeScript
"use client";
|
||
|
||
import {
|
||
Accessibility,
|
||
Command,
|
||
Contrast,
|
||
Eye,
|
||
Keyboard,
|
||
MousePointerClick,
|
||
RotateCcw,
|
||
Search,
|
||
Sparkles,
|
||
Type,
|
||
Volume2,
|
||
VolumeX,
|
||
X,
|
||
} from "lucide-react";
|
||
import { useEffect, useMemo, useState } from "react";
|
||
import {
|
||
applyA11ySettingsToDom,
|
||
DEFAULT_A11Y_SETTINGS,
|
||
installGlobalModalAccessibilityGuard,
|
||
readA11ySettings,
|
||
saveA11ySettings,
|
||
speakTurkish,
|
||
type A11yColorblindMode,
|
||
type A11yScale,
|
||
type SnapCadA11ySettings,
|
||
} from "@/lib/accessibility";
|
||
import { SNAPCAD_PREFABS } from "@/lib/snapcadPrefabs";
|
||
import type { WorkplaneShape } from "@/types/sketchforge";
|
||
|
||
export const SNAPCAD_SHORTCUTS = [
|
||
{ keys: "Ctrl + K", label: "Hızlı Komut Paleti & Arama", category: "Genel & Erişilebilirlik" },
|
||
{ keys: "Alt + A", label: "Erişilebilirlik & Görünüm Menüsünü Aç/Kapat", category: "Genel & Erişilebilirlik" },
|
||
{ keys: "W", label: "Çalışma Düzlemi (Workplane) Aracı", category: "3D Tasarım" },
|
||
{ keys: "R", label: "Cetvel (Ruler) Aracı", category: "3D Tasarım" },
|
||
{ keys: "Ctrl + G", label: "Seçili Nesneleri Grupla (Boolean CSG)", category: "3D Tasarım" },
|
||
{ keys: "Ctrl + Shift + G", label: "Grubu Çöz (Ungroup)", category: "3D Tasarım" },
|
||
{ keys: "L", label: "Hizala (Align) Aracı", category: "3D Tasarım" },
|
||
{ keys: "M", label: "Aynala / Çevir (Mirror / Flip)", category: "3D Tasarım" },
|
||
{ keys: "D", label: "Çalışma Düzlemine Oturt (Drop to Workplane)", category: "3D Tasarım" },
|
||
{ keys: "F", label: "Seçili Nesneye Odaklan (Fit View)", category: "3D Tasarım" },
|
||
{ keys: "Ctrl + D", label: "Çoğalt ve Tekrarla (Duplicate & Repeat)", category: "3D Tasarım" },
|
||
{ keys: "Ok Tuşları", label: "Seçili Şekli X/Z Düzleminde 1 Adım Taşı", category: "Klavye ile Modelleme" },
|
||
{ keys: "Shift + Ok Tuşları", label: "Seçili Şekli 10 kat Hızlı Taşı", category: "Klavye ile Modelleme" },
|
||
{ keys: "Delete / Backspace", label: "Seçili Nesneyi Sil", category: "Klavye ile Modelleme" },
|
||
{ keys: "Ctrl + Z / Ctrl + Y", label: "Geri Al / İleri Al", category: "Genel & Erişilebilirlik" },
|
||
];
|
||
|
||
export function CustomizationAndA11yStudio({
|
||
onLaunchPrefab,
|
||
}: {
|
||
onLaunchPrefab?: (name: string, shapes: WorkplaneShape[]) => void;
|
||
}) {
|
||
const [settings, setSettings] = useState<SnapCadA11ySettings>(DEFAULT_A11Y_SETTINGS);
|
||
|
||
useEffect(() => {
|
||
const loaded = readA11ySettings();
|
||
setSettings(loaded);
|
||
applyA11ySettingsToDom(loaded);
|
||
}, []);
|
||
|
||
const update = (patch: Partial<SnapCadA11ySettings>, announceText?: string) => {
|
||
const next = { ...settings, ...patch };
|
||
setSettings(next);
|
||
saveA11ySettings(next);
|
||
if (announceText) {
|
||
speakTurkish(announceText, Boolean(next.voiceFeedback));
|
||
}
|
||
};
|
||
|
||
const resetAll = () => {
|
||
setSettings(DEFAULT_A11Y_SETTINGS);
|
||
saveA11ySettings(DEFAULT_A11Y_SETTINGS);
|
||
speakTurkish("Erişilebilirlik ayarları varsayılana sıfırlandı.", true);
|
||
};
|
||
|
||
return (
|
||
<div className="snapcad-studio-wrap" role="region" aria-label="Erişilebilirlik ve Özelleştirme Merkezi">
|
||
{/* SVG Colorblind Filters */}
|
||
<div className="snapcad-studio-header">
|
||
<div>
|
||
<span className="snapcad-pill-badge">WCAG 2.2 AAA · Evrensel Tasarım</span>
|
||
<h2>SnapCAD Erişilebilirlik, Kısayol & Hazır Parça Merkezi</h2>
|
||
<p>
|
||
Görme, işitme ve motor erişilebilirlik seçeneklerini kişiselleştirin; Türkçe sesli ekran rehberini
|
||
etkinleştirin veya hazır SnapCAD mekanik/mimari bileşenleriyle tasarıma hemen başlayın.
|
||
</p>
|
||
</div>
|
||
<div className="snapcad-studio-actions">
|
||
<button
|
||
type="button"
|
||
className="snapcad-btn-secondary"
|
||
onClick={() => speakTurkish("SnapCAD Türkçe sesli ekran rehberi aktif ve hazır.", true)}
|
||
>
|
||
<Volume2 size={17} />
|
||
<span>Sesli Rehberi Test Et</span>
|
||
</button>
|
||
<button type="button" className="snapcad-btn-secondary" onClick={resetAll}>
|
||
<RotateCcw size={17} />
|
||
<span>Varsayılana Sıfırla</span>
|
||
</button>
|
||
</div>
|
||
</div>
|
||
|
||
{/* Erişilebilirlik Ayar Kartları */}
|
||
<div className="snapcad-a11y-grid">
|
||
<article className="snapcad-a11y-card">
|
||
<div className="snapcad-a11y-card-head">
|
||
<Contrast size={20} />
|
||
<div>
|
||
<h3>Görsel Kontrast & Renk Körlüğü Desteği</h3>
|
||
<span>Az gören veya renk körlüğü olan kullanıcılar için net sınırlar</span>
|
||
</div>
|
||
</div>
|
||
|
||
<label className="snapcad-a11y-toggle">
|
||
<div>
|
||
<strong>Yüksek Kontrast Modu (WCAG AAA)</strong>
|
||
<small>Tüm butonlara, panellere ve 3D araçlarına belirgin kontrast kenarlıklar ekler.</small>
|
||
</div>
|
||
<input
|
||
type="checkbox"
|
||
checked={settings.highContrast}
|
||
onChange={(e) =>
|
||
update(
|
||
{ highContrast: e.target.checked },
|
||
e.target.checked ? "Yüksek kontrast modu açıldı" : "Yüksek kontrast modu kapatıldı",
|
||
)
|
||
}
|
||
/>
|
||
</label>
|
||
|
||
<label className="snapcad-a11y-select-row">
|
||
<span>Renk Körlüğü Telafi Filtresi</span>
|
||
<select
|
||
value={settings.colorblindMode}
|
||
onChange={(e) =>
|
||
update(
|
||
{ colorblindMode: e.target.value as A11yColorblindMode },
|
||
`Renk körlüğü modu ${e.target.value} olarak ayarlandı`,
|
||
)
|
||
}
|
||
>
|
||
<option value="none">Standart Renkler (Kapalı)</option>
|
||
<option value="deuteranopia">Deuteranopia (Yeşil-Kırmızı Hassasiyeti)</option>
|
||
<option value="protanopia">Protanopia (Kırmızı Hassasiyeti)</option>
|
||
<option value="tritanopia">Tritanopia (Mavi-Sarı Hassasiyeti)</option>
|
||
</select>
|
||
</label>
|
||
</article>
|
||
|
||
<article className="snapcad-a11y-card">
|
||
<div className="snapcad-a11y-card-head">
|
||
<Type size={20} />
|
||
<div>
|
||
<h3>Okunabilirlik, Ölçekleme & Motor Kolaylık</h3>
|
||
<span>Yazı boyutunu, tıklama hedeflerini ve font okunabilirliğini büyütün</span>
|
||
</div>
|
||
</div>
|
||
|
||
<div className="snapcad-a11y-scale-group" role="group" aria-label="Arayüz Ölçeği">
|
||
<span>Arayüz & Metin Ölçeği:</span>
|
||
<div className="snapcad-a11y-scale-buttons">
|
||
{(["100", "115", "130"] as A11yScale[]).map((sc) => (
|
||
<button
|
||
key={sc}
|
||
type="button"
|
||
className={settings.uiScale === sc ? "active" : ""}
|
||
onClick={() => update({ uiScale: sc }, `Arayüz ölçeği yüzde ${sc} yapıldı`)}
|
||
>
|
||
%{sc} {sc === "100" ? "(Normal)" : sc === "115" ? "(Büyük)" : "(Çok Büyük)"}
|
||
</button>
|
||
))}
|
||
</div>
|
||
</div>
|
||
|
||
<label className="snapcad-a11y-toggle">
|
||
<div>
|
||
<strong>Disleksi Dostu Okunabilir Yazı Tipi</strong>
|
||
<small>Harf ve kelime aralıklarını genişleterek okuma güçlüğünü azaltır.</small>
|
||
</div>
|
||
<input
|
||
type="checkbox"
|
||
checked={settings.dyslexicFont}
|
||
onChange={(e) =>
|
||
update(
|
||
{ dyslexicFont: e.target.checked },
|
||
e.target.checked ? "Okunabilir yazı tipi açıldı" : "Varsayılan yazı tipine dönüldü",
|
||
)
|
||
}
|
||
/>
|
||
</label>
|
||
|
||
<label className="snapcad-a11y-toggle">
|
||
<div>
|
||
<strong>Geniş Tıklama Hedefleri (Motor Erişilebilirlik)</strong>
|
||
<small>3D araç çubuğu butonlarını, pin noktalarını ve kontrolleri büyütür.</small>
|
||
</div>
|
||
<input
|
||
type="checkbox"
|
||
checked={settings.largeTargets}
|
||
onChange={(e) =>
|
||
update(
|
||
{ largeTargets: e.target.checked },
|
||
e.target.checked ? "Geniş tıklama hedefleri açıldı" : "Geniş tıklama hedefleri kapatıldı",
|
||
)
|
||
}
|
||
/>
|
||
</label>
|
||
</article>
|
||
|
||
<article className="snapcad-a11y-card">
|
||
<div className="snapcad-a11y-card-head">
|
||
<Volume2 size={20} />
|
||
<div>
|
||
<h3>Türkçe Sesli Rehber & Odak Desteği</h3>
|
||
<span>Ekran okuyucu ipuçları ve Web Speech API sesli bildirimler</span>
|
||
</div>
|
||
</div>
|
||
|
||
<label className="snapcad-a11y-toggle">
|
||
<div>
|
||
<strong>Türkçe Sesli Geri Bildirim (TTS)</strong>
|
||
<small>Seçilen araçları, eklenen 3D şekilleri ve simülasyon durumunu sesli okur.</small>
|
||
</div>
|
||
<input
|
||
type="checkbox"
|
||
checked={settings.voiceFeedback}
|
||
onChange={(e) =>
|
||
update(
|
||
{ voiceFeedback: e.target.checked },
|
||
e.target.checked ? "Türkçe sesli geri bildirim etkinleştirildi" : "Sesli geri bildirim kapatıldı",
|
||
)
|
||
}
|
||
/>
|
||
</label>
|
||
|
||
<label className="snapcad-a11y-toggle">
|
||
<div>
|
||
<strong>Animasyonları ve Hareketi Azalt (Reduced Motion)</strong>
|
||
<small>Baş dönmesi veya odak dağınıklığını önlemek için geçiş efektlerini sadeleştirir.</small>
|
||
</div>
|
||
<input
|
||
type="checkbox"
|
||
checked={settings.reducedMotion}
|
||
onChange={(e) =>
|
||
update(
|
||
{ reducedMotion: e.target.checked },
|
||
e.target.checked ? "Hareket azaltma modu açıldı" : "Hareket azaltma modu kapatıldı",
|
||
)
|
||
}
|
||
/>
|
||
</label>
|
||
</article>
|
||
</div>
|
||
|
||
{/* SnapCAD Hazır 3D Modeller & Başlatıcılar (Prefab Kütüphanesi) */}
|
||
{onLaunchPrefab ? (
|
||
<section className="snapcad-prefab-section" aria-label="Hazır 3D Modeller ve Tasarım Başlatıcılar">
|
||
<div className="snapcad-section-title-row">
|
||
<div>
|
||
<h3>
|
||
<Sparkles size={18} /> SnapCAD Hazır 3D Bileşen & Şablon Kütüphanesi
|
||
</h3>
|
||
<span>
|
||
Tek tıkla çok parçalı (Katı + Delik) mekanik, elektronik veya mimari modelleri 3D çalışma düzleminde açın.
|
||
</span>
|
||
</div>
|
||
</div>
|
||
<div className="snapcad-prefab-grid">
|
||
{SNAPCAD_PREFABS.map((item) => (
|
||
<article key={item.id} className="snapcad-prefab-card">
|
||
<div className="snapcad-prefab-top">
|
||
<span className="snapcad-prefab-cat" style={{ color: item.accentColor }}>
|
||
{item.categoryLabel}
|
||
</span>
|
||
<span className="snapcad-prefab-badge">{item.badge}</span>
|
||
</div>
|
||
<h4>{item.title}</h4>
|
||
<p>{item.description}</p>
|
||
<button
|
||
type="button"
|
||
className="snapcad-btn-primary full"
|
||
onClick={() => {
|
||
speakTurkish(`${item.title} 3D sahnede açılıyor`);
|
||
onLaunchPrefab(item.title, item.buildShapes());
|
||
}}
|
||
>
|
||
<span>3D Editörde Aç ve Düzenle</span>
|
||
</button>
|
||
</article>
|
||
))}
|
||
</div>
|
||
</section>
|
||
) : null}
|
||
|
||
{/* Klavye Kısayolları Tablosu */}
|
||
<section className="snapcad-shortcuts-section" aria-label="Klavye Kısayolları">
|
||
<h3>
|
||
<Keyboard size={18} /> Klavye ile Tam Kontrol & Kısayol Rehberi
|
||
</h3>
|
||
<div className="snapcad-shortcuts-grid">
|
||
{SNAPCAD_SHORTCUTS.map((sc) => (
|
||
<div key={sc.keys} className="snapcad-shortcut-item">
|
||
<kbd>{sc.keys}</kbd>
|
||
<div>
|
||
<strong>{sc.label}</strong>
|
||
<small>{sc.category}</small>
|
||
</div>
|
||
</div>
|
||
))}
|
||
</div>
|
||
</section>
|
||
</div>
|
||
);
|
||
}
|
||
|
||
export function GlobalAccessibilityToolbar({
|
||
onQuickNavigate,
|
||
onLaunchPrefab,
|
||
}: {
|
||
onQuickNavigate?: (section: "home" | "drawing" | "circuits" | "codeblocks" | "challenges" | "customization" | "create3d") => void;
|
||
onLaunchPrefab?: (name: string, shapes: WorkplaneShape[]) => void;
|
||
}) {
|
||
const [settings, setSettings] = useState<SnapCadA11ySettings>(DEFAULT_A11Y_SETTINGS);
|
||
const [drawerOpen, setDrawerOpen] = useState(false);
|
||
const [paletteOpen, setPaletteOpen] = useState(false);
|
||
const [searchQuery, setSearchQuery] = useState("");
|
||
|
||
useEffect(() => {
|
||
const loaded = readA11ySettings();
|
||
setSettings(loaded);
|
||
applyA11ySettingsToDom(loaded);
|
||
installGlobalModalAccessibilityGuard();
|
||
}, []);
|
||
|
||
useEffect(() => {
|
||
const onKeyDown = (event: KeyboardEvent) => {
|
||
if ((event.ctrlKey || event.metaKey) && event.key.toLowerCase() === "k") {
|
||
event.preventDefault();
|
||
setPaletteOpen((v) => !v);
|
||
setDrawerOpen(false);
|
||
} else if (event.altKey && event.key.toLowerCase() === "a") {
|
||
event.preventDefault();
|
||
setDrawerOpen((v) => !v);
|
||
setPaletteOpen(false);
|
||
} else if (event.key === "Escape") {
|
||
setPaletteOpen(false);
|
||
setDrawerOpen(false);
|
||
}
|
||
};
|
||
window.addEventListener("keydown", onKeyDown);
|
||
return () => window.removeEventListener("keydown", onKeyDown);
|
||
}, []);
|
||
|
||
const update = (patch: Partial<SnapCadA11ySettings>, msg?: string) => {
|
||
const next = { ...settings, ...patch };
|
||
setSettings(next);
|
||
saveA11ySettings(next);
|
||
if (msg) speakTurkish(msg, Boolean(next.voiceFeedback));
|
||
};
|
||
|
||
const quickActions = useMemo(
|
||
() => [
|
||
{
|
||
id: "new-3d",
|
||
title: "Yeni 3D Tasarım Oluştur (3D CAD Editörü)",
|
||
category: "Stüdyolar",
|
||
run: () => onQuickNavigate?.("create3d"),
|
||
},
|
||
{
|
||
id: "open-drawing",
|
||
title: "Teknik Resim & Mühendislik Paftası (ISO-E 3 Görünüş, Kesit, .DXF & .PDF)",
|
||
category: "Stüdyolar",
|
||
run: () => onQuickNavigate?.("drawing"),
|
||
},
|
||
{
|
||
id: "open-circuits",
|
||
title: "Elektronik Devreler (Arduino & Breadboard Simülatörü)",
|
||
category: "Stüdyolar",
|
||
run: () => onQuickNavigate?.("circuits"),
|
||
},
|
||
{
|
||
id: "open-codeblocks",
|
||
title: "Kod Blokları (Parametrik Bloklarla 3D Modelleme)",
|
||
category: "Stüdyolar",
|
||
run: () => onQuickNavigate?.("codeblocks"),
|
||
},
|
||
{
|
||
id: "open-challenges",
|
||
title: "Eğitim Görevleri ve Rehberler",
|
||
category: "Eğitim",
|
||
run: () => onQuickNavigate?.("challenges"),
|
||
},
|
||
{
|
||
id: "toggle-contrast",
|
||
title: `Yüksek Kontrast Modunu ${settings.highContrast ? "Kapat" : "Aç"}`,
|
||
category: "Erişilebilirlik",
|
||
run: () => update({ highContrast: !settings.highContrast }, "Yüksek kontrast değiştirildi"),
|
||
},
|
||
{
|
||
id: "toggle-voice",
|
||
title: `Türkçe Sesli Ekran Rehberini ${settings.voiceFeedback ? "Kapat" : "Aç"}`,
|
||
category: "Erişilebilirlik",
|
||
run: () => update({ voiceFeedback: !settings.voiceFeedback }, "Türkçe sesli rehber değiştirildi"),
|
||
},
|
||
{
|
||
id: "scale-115",
|
||
title: "Arayüz Boyutunu Büyüt (%115)",
|
||
category: "Erişilebilirlik",
|
||
run: () => update({ uiScale: "115" }, "Arayüz yüzde 115 büyütüldü"),
|
||
},
|
||
{
|
||
id: "scale-100",
|
||
title: "Arayüz Boyutunu Normale Döndür (%100)",
|
||
category: "Erişilebilirlik",
|
||
run: () => update({ uiScale: "100" }, "Arayüz normal boyuta döndü"),
|
||
},
|
||
...SNAPCAD_PREFABS.map((prefab) => ({
|
||
id: `prefab-${prefab.id}`,
|
||
title: `Hazır 3D Model Aç: ${prefab.title} (${prefab.categoryLabel})`,
|
||
category: "Hazır 3D Modeller",
|
||
run: () => onLaunchPrefab?.(prefab.title, prefab.buildShapes()),
|
||
})),
|
||
],
|
||
[onLaunchPrefab, onQuickNavigate, settings],
|
||
);
|
||
|
||
const filteredActions = useMemo(() => {
|
||
const q = searchQuery.trim().toLowerCase();
|
||
if (!q) return quickActions;
|
||
return quickActions.filter(
|
||
(a) => a.title.toLowerCase().includes(q) || a.category.toLowerCase().includes(q),
|
||
);
|
||
}, [quickActions, searchQuery]);
|
||
|
||
return (
|
||
<>
|
||
{/* Global SVG Filters for Colorblindness */}
|
||
<svg className="snapcad-sr-svg-filters" aria-hidden="true">
|
||
<defs>
|
||
<filter id="snapcad-deuteranopia">
|
||
<feColorMatrix
|
||
type="matrix"
|
||
values="0.625 0.375 0 0 0 0.7 0.3 0 0 0 0 0.3 0.7 0 0 0 0 0 1 0"
|
||
/>
|
||
</filter>
|
||
<filter id="snapcad-protanopia">
|
||
<feColorMatrix
|
||
type="matrix"
|
||
values="0.567 0.433 0 0 0 0.558 0.442 0 0 0 0 0.242 0.758 0 0 0 0 0 1 0"
|
||
/>
|
||
</filter>
|
||
<filter id="snapcad-tritanopia">
|
||
<feColorMatrix
|
||
type="matrix"
|
||
values="0.95 0.05 0 0 0 0 0.433 0.567 0 0 0 0.475 0.525 0 0 0 0 0 1 0"
|
||
/>
|
||
</filter>
|
||
</defs>
|
||
</svg>
|
||
|
||
{/* Sağ Alt Yüzen Erişilebilirlik & Komut Paleti Çubuğu */}
|
||
<div className="snapcad-floating-a11y-dock" role="region" aria-label="Hızlı Erişilebilirlik ve Komut Çubuğu">
|
||
<button
|
||
type="button"
|
||
className="snapcad-dock-btn command"
|
||
onClick={() => {
|
||
setPaletteOpen((v) => !v);
|
||
setDrawerOpen(false);
|
||
}}
|
||
title="Hızlı Komut Paleti (Ctrl+K)"
|
||
aria-label="Hızlı Komut Paleti (Ctrl+K)"
|
||
>
|
||
<Command size={16} />
|
||
<span>Komutlar (Ctrl+K)</span>
|
||
</button>
|
||
<button
|
||
type="button"
|
||
className={`snapcad-dock-btn a11y ${
|
||
settings.highContrast || settings.voiceFeedback || settings.uiScale !== "100" ? "active" : ""
|
||
}`}
|
||
onClick={() => {
|
||
setDrawerOpen((v) => !v);
|
||
setPaletteOpen(false);
|
||
}}
|
||
title="Erişilebilirlik Ayarları (Alt+A)"
|
||
aria-label="Erişilebilirlik Ayarları (Alt+A)"
|
||
aria-expanded={drawerOpen}
|
||
>
|
||
<Accessibility size={17} />
|
||
<span>Erişilebilirlik</span>
|
||
</button>
|
||
</div>
|
||
|
||
{/* Hızlı Erişilebilirlik Çekmecesi */}
|
||
{drawerOpen ? (
|
||
<aside
|
||
className="snapcad-a11y-popover"
|
||
role="dialog"
|
||
aria-modal="true"
|
||
aria-labelledby="snapcad-a11y-popover-title"
|
||
tabIndex={-1}
|
||
>
|
||
<header className="snapcad-a11y-popover-head">
|
||
<strong id="snapcad-a11y-popover-title">
|
||
<Accessibility size={17} /> Erişilebilirlik Kontrolleri
|
||
</strong>
|
||
<button
|
||
type="button"
|
||
data-modal-close="true"
|
||
data-modal-focus-key="a11y-close"
|
||
onClick={() => setDrawerOpen(false)}
|
||
aria-label="Erişilebilirlik penceresini kapat"
|
||
>
|
||
<X size={16} />
|
||
</button>
|
||
</header>
|
||
|
||
<div className="snapcad-a11y-popover-body">
|
||
<button
|
||
type="button"
|
||
data-modal-initial-focus="true"
|
||
data-modal-focus-key="a11y-contrast"
|
||
aria-pressed={settings.highContrast}
|
||
className={`snapcad-a11y-quick-btn ${settings.highContrast ? "on" : ""}`}
|
||
onClick={() => update({ highContrast: !settings.highContrast }, "Yüksek kontrast değiştirildi")}
|
||
>
|
||
<Contrast size={16} />
|
||
<span>Yüksek Kontrast: {settings.highContrast ? "AÇIK" : "KAPALI"}</span>
|
||
</button>
|
||
|
||
<button
|
||
type="button"
|
||
data-modal-focus-key="a11y-voice"
|
||
aria-pressed={settings.voiceFeedback}
|
||
className={`snapcad-a11y-quick-btn ${settings.voiceFeedback ? "on" : ""}`}
|
||
onClick={() => update({ voiceFeedback: !settings.voiceFeedback }, "Türkçe sesli rehber aktif")}
|
||
>
|
||
{settings.voiceFeedback ? <Volume2 size={16} /> : <VolumeX size={16} />}
|
||
<span>Sesli Rehber (TTS): {settings.voiceFeedback ? "AÇIK" : "KAPALI"}</span>
|
||
</button>
|
||
|
||
<button
|
||
type="button"
|
||
data-modal-focus-key="a11y-font"
|
||
aria-pressed={settings.dyslexicFont}
|
||
className={`snapcad-a11y-quick-btn ${settings.dyslexicFont ? "on" : ""}`}
|
||
onClick={() => update({ dyslexicFont: !settings.dyslexicFont }, "Okunabilir font değiştirildi")}
|
||
>
|
||
<Type size={16} />
|
||
<span>Okunabilir Font: {settings.dyslexicFont ? "AÇIK" : "KAPALI"}</span>
|
||
</button>
|
||
|
||
<button
|
||
type="button"
|
||
data-modal-focus-key="a11y-targets"
|
||
aria-pressed={settings.largeTargets}
|
||
className={`snapcad-a11y-quick-btn ${settings.largeTargets ? "on" : ""}`}
|
||
onClick={() => update({ largeTargets: !settings.largeTargets }, "Geniş buton hedefleri değiştirildi")}
|
||
>
|
||
<MousePointerClick size={16} />
|
||
<span>Büyük Butonlar: {settings.largeTargets ? "AÇIK" : "KAPALI"}</span>
|
||
</button>
|
||
|
||
<div className="snapcad-a11y-popover-scale" role="group" aria-label="Arayüz Boyutu">
|
||
<span>Boyut:</span>
|
||
{(["100", "115", "130"] as A11yScale[]).map((sc) => (
|
||
<button
|
||
key={sc}
|
||
type="button"
|
||
data-modal-focus-key={`a11y-scale-${sc}`}
|
||
aria-pressed={settings.uiScale === sc}
|
||
className={settings.uiScale === sc ? "active" : ""}
|
||
onClick={() => update({ uiScale: sc }, `Ölçek yüzde ${sc}`)}
|
||
>
|
||
%{sc}
|
||
</button>
|
||
))}
|
||
</div>
|
||
|
||
<label className="snapcad-a11y-popover-select">
|
||
<span>
|
||
<Eye size={14} /> Renk Körlüğü:
|
||
</span>
|
||
<select
|
||
data-modal-focus-key="a11y-colorblind"
|
||
value={settings.colorblindMode}
|
||
onChange={(e) => update({ colorblindMode: e.target.value as A11yColorblindMode })}
|
||
>
|
||
<option value="none">Normal</option>
|
||
<option value="deuteranopia">Deuteranopia</option>
|
||
<option value="protanopia">Protanopia</option>
|
||
<option value="tritanopia">Tritanopia</option>
|
||
</select>
|
||
</label>
|
||
</div>
|
||
</aside>
|
||
) : null}
|
||
|
||
{/* Ctrl+K Hızlı Komut Paleti */}
|
||
{paletteOpen ? (
|
||
<div
|
||
className="snapcad-command-overlay"
|
||
onClick={(e) => {
|
||
if (e.target === e.currentTarget) setPaletteOpen(false);
|
||
}}
|
||
>
|
||
<div
|
||
className="snapcad-command-modal"
|
||
role="dialog"
|
||
aria-modal="true"
|
||
aria-label="SnapCAD Hızlı Komut Paleti"
|
||
tabIndex={-1}
|
||
>
|
||
<div className="snapcad-command-search">
|
||
<Search size={18} />
|
||
<input
|
||
autoFocus
|
||
data-modal-initial-focus="true"
|
||
data-modal-focus-key="command-search-input"
|
||
type="text"
|
||
value={searchQuery}
|
||
onChange={(e) => setSearchQuery(e.target.value)}
|
||
placeholder="Komut, 3D hazır model veya erişilebilirlik özelliği ara..."
|
||
aria-label="Komut ara"
|
||
/>
|
||
<button
|
||
type="button"
|
||
data-modal-close="true"
|
||
onClick={() => setPaletteOpen(false)}
|
||
aria-label="Komut paletini kapat"
|
||
>
|
||
<X size={17} />
|
||
</button>
|
||
</div>
|
||
<div className="snapcad-command-list" role="listbox" aria-label="Komut Sonuçları">
|
||
{filteredActions.map((act) => (
|
||
<button
|
||
key={act.id}
|
||
type="button"
|
||
className="snapcad-command-item"
|
||
onClick={() => {
|
||
act.run();
|
||
setPaletteOpen(false);
|
||
setSearchQuery("");
|
||
}}
|
||
>
|
||
<span>{act.title}</span>
|
||
<small>{act.category}</small>
|
||
</button>
|
||
))}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
) : null}
|
||
</>
|
||
);
|
||
}
|