feat: remove asccii preview
This commit is contained in:
@@ -2,12 +2,11 @@ import { useEditorStore } from "@/stores/editorStore";
|
|||||||
import { renderMicron } from "./micronRenderer";
|
import { renderMicron } from "./micronRenderer";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
|
|
||||||
type PreviewMode = "ascii" | "micron" | "raw" | "script";
|
type PreviewMode = "micron" | "raw" | "script";
|
||||||
|
|
||||||
export default function PreviewPane() {
|
export default function PreviewPane() {
|
||||||
const previewMode = useEditorStore((s) => s.previewMode);
|
const previewMode = useEditorStore((s) => s.previewMode);
|
||||||
const setPreviewMode = useEditorStore((s) => s.setPreviewMode);
|
const setPreviewMode = useEditorStore((s) => s.setPreviewMode);
|
||||||
const compiledAscii = useEditorStore((s) => s.compiledAscii);
|
|
||||||
const compiledMicron = useEditorStore((s) => s.compiledMicron);
|
const compiledMicron = useEditorStore((s) => s.compiledMicron);
|
||||||
const compiledScript = useEditorStore((s) => s.compiledScript);
|
const compiledScript = useEditorStore((s) => s.compiledScript);
|
||||||
const isDynamic = useEditorStore((s) => s.isDynamic);
|
const isDynamic = useEditorStore((s) => s.isDynamic);
|
||||||
@@ -15,7 +14,6 @@ export default function PreviewPane() {
|
|||||||
const compileError = useEditorStore((s) => s.compileError);
|
const compileError = useEditorStore((s) => s.compileError);
|
||||||
|
|
||||||
const tabs: { value: PreviewMode; label: string; show: boolean }[] = [
|
const tabs: { value: PreviewMode; label: string; show: boolean }[] = [
|
||||||
{ value: "ascii", label: "ASCII", show: true },
|
|
||||||
{ value: "micron", label: "Micron", show: true },
|
{ value: "micron", label: "Micron", show: true },
|
||||||
{ value: "raw", label: "Raw", show: true },
|
{ value: "raw", label: "Raw", show: true },
|
||||||
{ value: "script", label: "Script", show: isDynamic },
|
{ value: "script", label: "Script", show: isDynamic },
|
||||||
@@ -60,15 +58,7 @@ export default function PreviewPane() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex-1 bg-background overflow-auto min-h-0">
|
<div className="flex-1 bg-background overflow-auto min-h-0">
|
||||||
{previewMode === "ascii" ? (
|
{previewMode === "micron" ? (
|
||||||
<pre className="p-2 font-mono text-[11px] whitespace-pre leading-tight text-green-100/90">
|
|
||||||
{compiledAscii || (
|
|
||||||
<span className="text-muted-foreground">
|
|
||||||
ASCII preview will appear here…
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
</pre>
|
|
||||||
) : previewMode === "micron" ? (
|
|
||||||
compiledMicron ? (
|
compiledMicron ? (
|
||||||
<div
|
<div
|
||||||
className="p-2 font-mono text-[11px] whitespace-pre leading-tight"
|
className="p-2 font-mono text-[11px] whitespace-pre leading-tight"
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ interface EditorStore {
|
|||||||
compileError: string | null;
|
compileError: string | null;
|
||||||
|
|
||||||
// Preview
|
// Preview
|
||||||
previewMode: "ascii" | "micron" | "raw" | "script";
|
previewMode: "micron" | "raw" | "script";
|
||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
setSource: (s: string) => void;
|
setSource: (s: string) => void;
|
||||||
@@ -26,7 +26,7 @@ interface EditorStore {
|
|||||||
setCompileResult: (ascii: string, micron: string, script: string, isDynamic: boolean, warnings: string[]) => void;
|
setCompileResult: (ascii: string, micron: string, script: string, isDynamic: boolean, warnings: string[]) => void;
|
||||||
setCompiling: (v: boolean) => void;
|
setCompiling: (v: boolean) => void;
|
||||||
setCompileError: (e: string | null) => void;
|
setCompileError: (e: string | null) => void;
|
||||||
setPreviewMode: (mode: "ascii" | "micron" | "raw" | "script") => void;
|
setPreviewMode: (mode: "micron" | "raw" | "script") => void;
|
||||||
reset: () => void;
|
reset: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ export const useEditorStore = create<EditorStore>((set) => ({
|
|||||||
isCompiling: false,
|
isCompiling: false,
|
||||||
compileError: null,
|
compileError: null,
|
||||||
|
|
||||||
previewMode: "ascii",
|
previewMode: "micron",
|
||||||
|
|
||||||
setSource: (s) => set({ ufSource: s, isDirty: true }),
|
setSource: (s) => set({ ufSource: s, isDirty: true }),
|
||||||
setCurrentPage: (p) => set({ currentPage: p }),
|
setCurrentPage: (p) => set({ currentPage: p }),
|
||||||
@@ -73,6 +73,6 @@ export const useEditorStore = create<EditorStore>((set) => ({
|
|||||||
compileWarnings: [],
|
compileWarnings: [],
|
||||||
isCompiling: false,
|
isCompiling: false,
|
||||||
compileError: null,
|
compileError: null,
|
||||||
previewMode: "ascii",
|
previewMode: "micron",
|
||||||
}),
|
}),
|
||||||
}));
|
}));
|
||||||
|
|||||||
Reference in New Issue
Block a user