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