feat: sync registry with suggestions

This commit is contained in:
2026-04-01 12:48:46 +02:00
parent 528d2d8519
commit 0642d0f894
5 changed files with 173 additions and 231 deletions

View File

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