feat: registry
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user