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: SnapCAD Studio'yu YakHub deposuna taşı
- 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ı
This commit is contained in:
@@ -0,0 +1,423 @@
|
||||
"use client";
|
||||
|
||||
import {
|
||||
Activity,
|
||||
ArrowLeft,
|
||||
Blocks,
|
||||
Box,
|
||||
CheckCircle2,
|
||||
ChevronDown,
|
||||
Cpu,
|
||||
Download,
|
||||
FileCode,
|
||||
FileDown,
|
||||
FileUp,
|
||||
FolderOpen,
|
||||
GraduationCap,
|
||||
Layers,
|
||||
MoveRight,
|
||||
Pencil,
|
||||
Redo2,
|
||||
RotateCcw,
|
||||
Ruler,
|
||||
Settings,
|
||||
Smartphone,
|
||||
Sparkles,
|
||||
Trophy,
|
||||
Undo2,
|
||||
SlidersHorizontal,
|
||||
} from "lucide-react";
|
||||
import { useEffect, useRef, useState, type ChangeEvent, type KeyboardEvent, type ReactNode } from "react";
|
||||
import type { AppThemePreference } from "@/lib/appTheme";
|
||||
|
||||
export type EnterpriseStudioMode = "3d-solid" | "push-pull" | "drawing" | "circuits" | "codeblocks" | "challenges";
|
||||
|
||||
interface EnterpriseTopBarProps {
|
||||
projectName: string;
|
||||
onProjectNameChange?: (name: string) => void;
|
||||
activeStudio: EnterpriseStudioMode;
|
||||
onStudioChange: (studio: EnterpriseStudioMode) => void;
|
||||
onBackToDashboard?: () => void;
|
||||
canUndo?: boolean;
|
||||
canRedo?: boolean;
|
||||
onUndo?: () => void;
|
||||
onRedo?: () => void;
|
||||
onImport?: () => void;
|
||||
onExport?: () => void;
|
||||
onOpenAR?: () => void;
|
||||
onStructuralTest?: () => void;
|
||||
onCelebration?: () => void;
|
||||
onOpenTutorial?: () => void;
|
||||
onOpenDailyChallenges?: () => void;
|
||||
onOpenSettings?: () => void;
|
||||
onOpenA11y?: () => void;
|
||||
cloudBarSlot?: ReactNode;
|
||||
cloudSyncStatus?: "synced" | "syncing" | "offline" | "error";
|
||||
lastSyncedText?: string;
|
||||
isDashboard?: boolean;
|
||||
}
|
||||
|
||||
export function EnterpriseTopBar({
|
||||
projectName,
|
||||
onProjectNameChange,
|
||||
activeStudio,
|
||||
onStudioChange,
|
||||
onBackToDashboard,
|
||||
canUndo = false,
|
||||
canRedo = false,
|
||||
onUndo,
|
||||
onRedo,
|
||||
onImport,
|
||||
onExport,
|
||||
onOpenAR,
|
||||
onStructuralTest,
|
||||
onCelebration,
|
||||
onOpenTutorial,
|
||||
onOpenDailyChallenges,
|
||||
onOpenSettings,
|
||||
onOpenA11y,
|
||||
cloudBarSlot,
|
||||
cloudSyncStatus = "synced",
|
||||
lastSyncedText = "Az önce eşitlendi",
|
||||
isDashboard = false,
|
||||
}: EnterpriseTopBarProps) {
|
||||
const [editingTitle, setEditingTitle] = useState(false);
|
||||
const [titleDraft, setTitleDraft] = useState(projectName);
|
||||
const titleInputRef = useRef<HTMLInputElement | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
setTitleDraft(projectName);
|
||||
}, [projectName]);
|
||||
|
||||
const handleStartTitleEdit = () => {
|
||||
setEditingTitle(true);
|
||||
setTimeout(() => titleInputRef.current?.focus(), 50);
|
||||
};
|
||||
|
||||
const handleCommitTitle = () => {
|
||||
setEditingTitle(false);
|
||||
const trimmed = titleDraft.trim();
|
||||
if (trimmed && trimmed !== projectName) {
|
||||
onProjectNameChange?.(trimmed);
|
||||
} else {
|
||||
setTitleDraft(projectName);
|
||||
}
|
||||
};
|
||||
|
||||
const handleTitleKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {
|
||||
if (e.key === "Enter") {
|
||||
handleCommitTitle();
|
||||
} else if (e.key === "Escape") {
|
||||
setEditingTitle(false);
|
||||
setTitleDraft(projectName);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<header className="enterprise-topbar" role="banner" aria-label="SnapCAD Studio Başlık Çubuğu">
|
||||
{/* 1. Sol: Marka ve Proje Başlığı */}
|
||||
<div className="topbar-section left-section">
|
||||
{onBackToDashboard ? (
|
||||
<button
|
||||
type="button"
|
||||
className="topbar-icon-btn back-btn"
|
||||
onClick={onBackToDashboard}
|
||||
title="Ana Sayfaya Dön"
|
||||
aria-label="SnapCAD Studio Paneline Dön"
|
||||
>
|
||||
<ArrowLeft size={18} aria-hidden="true" />
|
||||
</button>
|
||||
) : null}
|
||||
|
||||
<a href="./" className="enterprise-brand" aria-label="SnapCAD Studio">
|
||||
<div className="brand-logo-gem" aria-hidden="true">
|
||||
<Box size={18} className="text-white" />
|
||||
</div>
|
||||
<div className="brand-text-col">
|
||||
<span className="brand-title">
|
||||
SnapCAD <span className="text-sky-400 font-bold">Studio</span>
|
||||
</span>
|
||||
<span className="brand-subtitle uppercase">YakHub Kurumsal Tasarım Platformu</span>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
{!isDashboard ? (
|
||||
<div className="project-title-cluster">
|
||||
<div className="divider-vert" />
|
||||
{editingTitle ? (
|
||||
<input
|
||||
ref={titleInputRef}
|
||||
type="text"
|
||||
className="project-title-input font-semibold"
|
||||
value={titleDraft}
|
||||
onChange={(e) => setTitleDraft(e.target.value)}
|
||||
onBlur={handleCommitTitle}
|
||||
onKeyDown={handleTitleKeyDown}
|
||||
maxLength={80}
|
||||
aria-label="Proje Adını Düzenle"
|
||||
/>
|
||||
) : (
|
||||
<button
|
||||
type="button"
|
||||
className="project-title-display-btn"
|
||||
onClick={handleStartTitleEdit}
|
||||
title="Proje Adını Değiştirmek İçin Tıklayın"
|
||||
aria-label={`Proje Adı: ${projectName}. Düzenlemek için tıklayın`}
|
||||
>
|
||||
<span className="title-text truncate max-w-[180px] sm:max-w-[260px]">{projectName}</span>
|
||||
<Pencil size={12} className="edit-icon text-slate-400 opacity-60" aria-hidden="true" />
|
||||
</button>
|
||||
)}
|
||||
|
||||
{/* Bulut Durumu İndikatörü */}
|
||||
<div
|
||||
className={`cloud-sync-badge ${cloudSyncStatus}`}
|
||||
title="Bulut Senkronizasyonu: Güncel"
|
||||
role="status"
|
||||
aria-label="Bulut Senkronizasyonu Güncel"
|
||||
>
|
||||
<span className="sync-pulse" aria-hidden="true" />
|
||||
<span className="sync-label hidden lg:inline">Eşitlendi</span>
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
{/* 2. Orta: Stüdyo Değiştirici Sekmeler (Studio Switcher Pills) */}
|
||||
<nav className="topbar-section center-section" aria-label="SnapCAD Studio Stüdyoları">
|
||||
<div className="studio-switcher-pills" role="tablist">
|
||||
<button
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-selected={activeStudio === "3d-solid"}
|
||||
className={`studio-pill ${activeStudio === "3d-solid" ? "active" : ""}`}
|
||||
onClick={() => onStudioChange("3d-solid")}
|
||||
title="3D Katı CAD"
|
||||
>
|
||||
<Box size={14} aria-hidden="true" />
|
||||
<span>3D Katı CAD</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-selected={activeStudio === "push-pull"}
|
||||
className={`studio-pill highlight-sketchup ${activeStudio === "push-pull" ? "active" : ""}`}
|
||||
onClick={() => onStudioChange("push-pull")}
|
||||
title="İt / Çek (Push/Pull)"
|
||||
>
|
||||
<MoveRight size={14} aria-hidden="true" />
|
||||
<span>İt / Çek</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-selected={activeStudio === "drawing"}
|
||||
className={`studio-pill ${activeStudio === "drawing" ? "active" : ""}`}
|
||||
onClick={() => onStudioChange("drawing")}
|
||||
title="Teknik Resim"
|
||||
>
|
||||
<Ruler size={14} aria-hidden="true" />
|
||||
<span>Teknik Resim</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-selected={activeStudio === "circuits"}
|
||||
className={`studio-pill ${activeStudio === "circuits" ? "active" : ""}`}
|
||||
onClick={() => onStudioChange("circuits")}
|
||||
title="Elektronik Devreler"
|
||||
>
|
||||
<Cpu size={14} aria-hidden="true" />
|
||||
<span>Devreler</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-selected={activeStudio === "codeblocks"}
|
||||
className={`studio-pill ${activeStudio === "codeblocks" ? "active" : ""}`}
|
||||
onClick={() => onStudioChange("codeblocks")}
|
||||
title="Kod Blokları"
|
||||
>
|
||||
<Blocks size={14} aria-hidden="true" />
|
||||
<span>Kod Blokları</span>
|
||||
</button>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
{/* 3. Sağ: Hızlı Eylemler, YakNet SSO Menüsü ve Erişilebilirlik */}
|
||||
<div className="topbar-section right-section">
|
||||
{!isDashboard ? (
|
||||
<div className="quick-actions-cluster">
|
||||
{/* Geri Al / İleri Al */}
|
||||
<div className="history-btn-group">
|
||||
<button
|
||||
type="button"
|
||||
className="topbar-icon-btn"
|
||||
disabled={!canUndo}
|
||||
onClick={onUndo}
|
||||
title="Geri Al (Ctrl+Z)"
|
||||
aria-label="Geri Al"
|
||||
>
|
||||
<Undo2 size={16} aria-hidden="true" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="topbar-icon-btn"
|
||||
disabled={!canRedo}
|
||||
onClick={onRedo}
|
||||
title="İleri Al (Ctrl+Y)"
|
||||
aria-label="İleri Al"
|
||||
>
|
||||
<Redo2 size={16} aria-hidden="true" />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div className="divider-vert" />
|
||||
|
||||
{/* İçe Aktar & Dışa Aktar */}
|
||||
<button
|
||||
type="button"
|
||||
className="topbar-action-btn import-btn"
|
||||
onClick={onImport}
|
||||
title="3B veya 2B Model İçe Aktar (STL, OBJ, STEP, SVG, DXF, GLB, SKF)"
|
||||
aria-label="Dosya İçe Aktar"
|
||||
>
|
||||
<FileUp size={14} aria-hidden="true" />
|
||||
<span className="hidden xl:inline">İçe Aktar</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
className="topbar-action-btn export-btn"
|
||||
onClick={onExport}
|
||||
title="Modeli Dışa Aktar (STL, OBJ, STEP, DXF, SVG, GLB, SKF)"
|
||||
aria-label="Dosyayı Dışa Aktar"
|
||||
>
|
||||
<FileDown size={14} aria-hidden="true" />
|
||||
<span>Dışa Aktar</span>
|
||||
</button>
|
||||
|
||||
{onOpenAR ? (
|
||||
<button
|
||||
type="button"
|
||||
className="topbar-action-btn ar-btn"
|
||||
onClick={onOpenAR}
|
||||
title="Masa Üstünde Gör (Mobil AR & WebXR Kamera Önizleme)"
|
||||
aria-label="Artırılmış Gerçeklik Masada Gör"
|
||||
style={{
|
||||
background: "linear-gradient(135deg, #0ea5e9, #0284c7)",
|
||||
color: "#ffffff",
|
||||
borderColor: "rgba(14, 165, 233, 0.4)",
|
||||
fontWeight: 600,
|
||||
boxShadow: "0 2px 6px rgba(14, 165, 233, 0.25)",
|
||||
}}
|
||||
>
|
||||
<Smartphone size={14} aria-hidden="true" />
|
||||
<span className="hidden lg:inline">Masamda Gör (AR)</span>
|
||||
</button>
|
||||
) : null}
|
||||
|
||||
{onStructuralTest ? (
|
||||
<button
|
||||
type="button"
|
||||
className="topbar-action-btn structural-test-btn"
|
||||
onClick={onStructuralTest}
|
||||
title="Bina Statik Dayanım & Deprem Simülasyonu (Yıkım & Güvenlik Analizi)"
|
||||
aria-label="Statik Dayanım ve Deprem Testi"
|
||||
style={{
|
||||
background: "linear-gradient(135deg, #0284c7, #4f46e5)",
|
||||
color: "#ffffff",
|
||||
borderColor: "rgba(56, 189, 248, 0.4)",
|
||||
fontWeight: 600,
|
||||
boxShadow: "0 2px 6px rgba(2, 132, 199, 0.25)",
|
||||
}}
|
||||
>
|
||||
<Activity size={14} aria-hidden="true" />
|
||||
<span className="hidden lg:inline">Statik & Deprem Testi</span>
|
||||
</button>
|
||||
) : null}
|
||||
|
||||
{onCelebration ? (
|
||||
<button
|
||||
type="button"
|
||||
className="topbar-action-btn celebration-btn"
|
||||
onClick={onCelebration}
|
||||
title="Tebrik & Başarı Konfetisi Patlat (🎉)"
|
||||
aria-label="Tebrik Konfetisi"
|
||||
style={{
|
||||
background: "linear-gradient(135deg, #10b981, #059669)",
|
||||
color: "#ffffff",
|
||||
borderColor: "rgba(52, 211, 153, 0.4)",
|
||||
fontWeight: 600,
|
||||
}}
|
||||
>
|
||||
<Sparkles size={14} aria-hidden="true" />
|
||||
<span className="hidden xl:inline">Tebrik</span>
|
||||
</button>
|
||||
) : null}
|
||||
|
||||
{onOpenDailyChallenges ? (
|
||||
<button
|
||||
type="button"
|
||||
className="topbar-action-btn daily-challenges-btn"
|
||||
onClick={onOpenDailyChallenges}
|
||||
title="Günün 3D Görevleri & XP Başarımları (Mimarlık & Bilişim)"
|
||||
aria-label="Günün Görevleri"
|
||||
style={{
|
||||
background: "linear-gradient(135deg, #f59e0b, #ef4444)",
|
||||
color: "#ffffff",
|
||||
borderColor: "rgba(245, 158, 11, 0.4)",
|
||||
fontWeight: 700,
|
||||
boxShadow: "0 2px 6px rgba(245, 158, 11, 0.25)",
|
||||
}}
|
||||
>
|
||||
<Trophy size={14} aria-hidden="true" />
|
||||
<span className="hidden sm:inline">Günün Görevleri</span>
|
||||
</button>
|
||||
) : null}
|
||||
|
||||
{onOpenTutorial ? (
|
||||
<button
|
||||
type="button"
|
||||
className="topbar-action-btn tutorial-btn"
|
||||
onClick={onOpenTutorial}
|
||||
title="SnapCAD Akademi — Detaylı ve Uygulamalı Mimari Eğitim Modülü"
|
||||
aria-label="Uygulamalı Eğitim Modülü"
|
||||
style={{
|
||||
background: "linear-gradient(135deg, #6366f1, #8b5cf6)",
|
||||
color: "#ffffff",
|
||||
borderColor: "rgba(168, 85, 247, 0.4)",
|
||||
fontWeight: 600,
|
||||
boxShadow: "0 2px 6px rgba(99, 102, 241, 0.25)",
|
||||
}}
|
||||
>
|
||||
<GraduationCap size={15} aria-hidden="true" />
|
||||
<span className="hidden sm:inline">Uygulamalı Eğitim</span>
|
||||
</button>
|
||||
) : null}
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{/* YakNet Account Widget & Cloud Bar */}
|
||||
<div className="yaknet-cloud-slot">{cloudBarSlot}</div>
|
||||
|
||||
{/* Erişilebilirlik ve Ayarlar Butonu */}
|
||||
{onOpenA11y ? (
|
||||
<button
|
||||
type="button"
|
||||
className="topbar-icon-btn a11y-trigger-btn"
|
||||
onClick={onOpenA11y}
|
||||
title="Erişilebilirlik, Tema ve Kılavuz Merkezi (Alt+A)"
|
||||
aria-label="Erişilebilirlik ve Kılavuz Merkezi"
|
||||
>
|
||||
<SlidersHorizontal size={16} aria-hidden="true" />
|
||||
</button>
|
||||
) : null}
|
||||
</div>
|
||||
</header>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user