feat: registry

This commit is contained in:
2026-04-01 12:16:05 +02:00
parent 01a3e0095c
commit 8d3245b7b1
7 changed files with 475 additions and 13 deletions

View File

@@ -6,8 +6,9 @@ import { useEditorStore } from "@/stores/editorStore";
import { usePagesStore } from "@/stores/pagesStore";
import { useUnsavedGuard } from "@/hooks/useUnsavedGuard";
import { useCompile } from "@/hooks/useCompile";
import { uframeHighlight } from "@/components/editor/uframeHighlight";
import { uframeCommandSource } from "@/components/editor/uframeCommands";
import { useDslMeta } from "@/hooks/useDslMeta";
import { uframeHighlight, setDslKeywords } from "@/components/editor/uframeHighlight";
import { uframeCommandSource, setDslCommands } from "@/components/editor/uframeCommands";
import EditorPane from "@/components/editor/EditorPane";
import PreviewPane from "@/components/editor/PreviewPane";
import ToolBar from "@/components/editor/ToolBar";
@@ -47,6 +48,15 @@ export default function EditorView() {
[],
);
// Load DSL metadata (keywords, values, commands) from backend
const dslMeta = useDslMeta();
useEffect(() => {
if (dslMeta.keywords.length > 0) {
setDslKeywords(dslMeta.keywords, dslMeta.values);
setDslCommands(dslMeta.commands);
}
}, [dslMeta]);
// Auto-compile on source changes
useCompile();
useUnsavedGuard();