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