@ultrst-armada/floks 1.5.5 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schema": 1,
3
3
  "packageName": "@ultrst-armada/floks",
4
- "version": "1.5.5",
5
- "sourceCommit": "af00b230359a30a4db9e36e7c63712ad445d4889",
4
+ "version": "1.6.0",
5
+ "sourceCommit": "be86bcf0677ee4f487cc807ad5eeab4b66ba5e27",
6
6
  "releaseWorkflow": "npm Release",
7
- "workflowRunId": "40319238976"
7
+ "workflowRunId": "40324788065"
8
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ultrst-armada/floks",
3
- "version": "1.5.5",
3
+ "version": "1.6.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -61,7 +61,7 @@
61
61
  "@dinilmusick/gutts": "^0.1.3"
62
62
  },
63
63
  "peerDependencies": {
64
- "@ultrst-armada/kloks": "^1.9.0",
64
+ "@ultrst-armada/kloks": "^1.11.0",
65
65
  "lucide-react": ">=0.300.0",
66
66
  "react": "^18.0.0 || ^19.0.0",
67
67
  "react-dom": "^18.0.0 || ^19.0.0"
@@ -72,7 +72,7 @@
72
72
  "@types/node": "^22.0.0",
73
73
  "@types/react": "^19.0.0",
74
74
  "@types/react-dom": "^19.0.0",
75
- "@ultrst-armada/kloks": "^1.10.3",
75
+ "@ultrst-armada/kloks": "^1.11.0",
76
76
  "@ultrst-armada/frnlts": "^0.2.7",
77
77
  "happy-dom": "^21.0.3",
78
78
  "lucide-react": "^1.55.0",
@@ -1,4 +1,5 @@
1
1
  import React__default from 'react';
2
+ import { UIAuthoringValidation } from '@ultrst-armada/kloks/contracts';
2
3
 
3
4
  type UIAuthoringContext = 'service' | 'general-component' | 'application';
4
5
  type UIAuthoringNodeKind = 'page' | 'section' | 'component';
@@ -53,6 +54,8 @@ interface UIAuthoringSession {
53
54
 
54
55
  declare function getAuthoringDepth(node: UIAuthoringNode, nodes: UIAuthoringNode[]): number;
55
56
  declare function getAuthoringChildren(nodeId: string, nodes: UIAuthoringNode[]): UIAuthoringNode[];
57
+ /** Returns a node and all descendants, even when the input tree is malformed. */
58
+ declare function getAuthoringSubtreeIds(nodeId: string, nodes: UIAuthoringNode[]): Set<string>;
56
59
 
57
60
  declare function UiAuthoringTree(props: {
58
61
  nodes: UIAuthoringNode[];
@@ -77,4 +80,18 @@ declare function UiAuthoringBindingEditor(props: {
77
80
  onChange: (session: UIAuthoringSession) => void;
78
81
  }): React__default.JSX.Element;
79
82
 
80
- export { type AuthoringAssetRef, type UIAuthoringContext, type UIAuthoringNode, type UIAuthoringNodeKind, type UIAuthoringSession, UiAuthoringBindingEditor, UiAuthoringInspector, UiAuthoringTree, UiAuthoringWorkspace, getAuthoringChildren, getAuthoringDepth };
83
+ declare function UiAuthoringValidationPanel(props: {
84
+ validation?: UIAuthoringValidation;
85
+ status?: string;
86
+ onValidate?: () => void;
87
+ onGenerate?: () => void;
88
+ }): React__default.JSX.Element;
89
+
90
+ type UiAuthoringComponentRenderer = (node: UIAuthoringNode, slots: Record<string, React__default.ReactNode[]>) => React__default.ReactNode;
91
+ declare function UiAuthoringPreview(props: {
92
+ session: UIAuthoringSession;
93
+ renderComponent: UiAuthoringComponentRenderer;
94
+ emptyMessage?: string;
95
+ }): React__default.JSX.Element;
96
+
97
+ export { type AuthoringAssetRef, type UIAuthoringContext, type UIAuthoringNode, type UIAuthoringNodeKind, type UIAuthoringSession, UiAuthoringBindingEditor, type UiAuthoringComponentRenderer, UiAuthoringInspector, UiAuthoringPreview, UiAuthoringTree, UiAuthoringValidationPanel, UiAuthoringWorkspace, getAuthoringChildren, getAuthoringDepth, getAuthoringSubtreeIds };
@@ -1,16 +1,22 @@
1
1
  import {
2
2
  UiAuthoringBindingEditor,
3
3
  UiAuthoringInspector,
4
+ UiAuthoringPreview,
4
5
  UiAuthoringTree,
6
+ UiAuthoringValidationPanel,
5
7
  UiAuthoringWorkspace,
6
8
  getAuthoringChildren,
7
- getAuthoringDepth
8
- } from "../chunk-GJ472MWX.js";
9
+ getAuthoringDepth,
10
+ getAuthoringSubtreeIds
11
+ } from "../chunk-TS7P3WWH.js";
9
12
  export {
10
13
  UiAuthoringBindingEditor,
11
14
  UiAuthoringInspector,
15
+ UiAuthoringPreview,
12
16
  UiAuthoringTree,
17
+ UiAuthoringValidationPanel,
13
18
  UiAuthoringWorkspace,
14
19
  getAuthoringChildren,
15
- getAuthoringDepth
20
+ getAuthoringDepth,
21
+ getAuthoringSubtreeIds
16
22
  };
@@ -13,6 +13,20 @@ function getAuthoringDepth(node, nodes) {
13
13
  function getAuthoringChildren(nodeId, nodes) {
14
14
  return nodes.filter((node) => node.parentId === nodeId);
15
15
  }
16
+ function getAuthoringSubtreeIds(nodeId, nodes) {
17
+ const ids = /* @__PURE__ */ new Set([nodeId]);
18
+ let changed = true;
19
+ while (changed) {
20
+ changed = false;
21
+ for (const node of nodes) {
22
+ if (node.parentId && ids.has(node.parentId) && !ids.has(node.id)) {
23
+ ids.add(node.id);
24
+ changed = true;
25
+ }
26
+ }
27
+ }
28
+ return ids;
29
+ }
16
30
 
17
31
  // src/authoring/UiAuthoringTree.tsx
18
32
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -227,9 +241,17 @@ function UiAuthoringWorkspace(props) {
227
241
  };
228
242
  const removeSelected = () => {
229
243
  if (!selectedNode) return;
244
+ const removedIds = getAuthoringSubtreeIds(selectedNode.id, props.session.nodes);
230
245
  props.onChange({
231
246
  ...props.session,
232
- nodes: props.session.nodes.filter((node) => node.id !== selectedNode.id && node.parentId !== selectedNode.id)
247
+ nodes: props.session.nodes.filter((node) => !removedIds.has(node.id)).map((node) => ({
248
+ ...node,
249
+ slots: node.slots ? Object.fromEntries(Object.entries(node.slots).map(([slot, children]) => [
250
+ slot,
251
+ children.filter((childId) => !removedIds.has(childId))
252
+ ])) : void 0
253
+ })),
254
+ bindings: props.session.bindings.filter((binding) => !removedIds.has(binding.componentId))
233
255
  });
234
256
  setSelectedNodeId(void 0);
235
257
  };
@@ -272,11 +294,63 @@ function UiAuthoringWorkspace(props) {
272
294
  ] });
273
295
  }
274
296
 
297
+ // src/authoring/UiAuthoringValidationPanel.tsx
298
+ import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
299
+ function UiAuthoringValidationPanel(props) {
300
+ return /* @__PURE__ */ jsxs5("aside", { className: "border-t border-black/10 p-3 text-xs", "aria-label": "Authoring validation", children: [
301
+ /* @__PURE__ */ jsxs5("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [
302
+ /* @__PURE__ */ jsx5("strong", { className: "uppercase tracking-wide", children: "Validation" }),
303
+ /* @__PURE__ */ jsxs5("div", { className: "flex gap-2", children: [
304
+ props.onValidate && /* @__PURE__ */ jsx5("button", { type: "button", className: "rounded border px-2 py-1", onClick: props.onValidate, children: "Validate" }),
305
+ props.onGenerate && /* @__PURE__ */ jsx5("button", { type: "button", className: "rounded border px-2 py-1", onClick: props.onGenerate, disabled: props.validation?.valid !== true, children: "Generate" })
306
+ ] })
307
+ ] }),
308
+ props.status && /* @__PURE__ */ jsx5("p", { className: "mt-2 text-[10px] opacity-70", children: props.status }),
309
+ props.validation && /* @__PURE__ */ jsxs5("div", { className: "mt-2", role: "status", "aria-live": "polite", children: [
310
+ /* @__PURE__ */ jsx5("p", { className: props.validation.valid ? "text-emerald-700" : "text-red-700", children: props.validation.valid ? "Validation passed" : `Validation failed \xB7 ${props.validation.errors.length} error(s)` }),
311
+ props.validation.errors.length > 0 && /* @__PURE__ */ jsx5("ul", { className: "mt-1 list-disc pl-5 text-red-700", children: props.validation.errors.map((error, index) => /* @__PURE__ */ jsx5("li", { children: error }, index)) }),
312
+ props.validation.warnings.length > 0 && /* @__PURE__ */ jsx5("ul", { className: "mt-1 list-disc pl-5 text-amber-700", children: props.validation.warnings.map((warning, index) => /* @__PURE__ */ jsx5("li", { children: warning }, index)) })
313
+ ] })
314
+ ] });
315
+ }
316
+
317
+ // src/authoring/UiAuthoringPreview.tsx
318
+ import React4 from "react";
319
+ import { jsx as jsx6 } from "react/jsx-runtime";
320
+ function UiAuthoringPreview(props) {
321
+ const nodesById = new Map(props.session.nodes.map((node) => [node.id, node]));
322
+ const structuralChildren = (parentId) => props.session.nodes.filter(
323
+ (node) => node.parentId === parentId && node.kind !== "component" || node.parentId === parentId && nodesById.get(parentId)?.kind === "section"
324
+ );
325
+ const renderNode = (node) => {
326
+ if (node.kind === "page") {
327
+ return /* @__PURE__ */ jsx6("main", { "data-authoring-page": node.id, children: structuralChildren(node.id).map(renderNode) }, node.id);
328
+ }
329
+ if (node.kind === "section") {
330
+ return /* @__PURE__ */ jsx6("section", { "data-authoring-section": node.id, children: structuralChildren(node.id).map(renderNode) }, node.id);
331
+ }
332
+ const slotIds = node.slots || {};
333
+ const slots = Object.fromEntries(Object.entries(slotIds).map(([slot, childIds]) => [
334
+ slot,
335
+ childIds.map((id) => nodesById.get(id)).filter((child) => Boolean(child)).map(renderNode)
336
+ ]));
337
+ return /* @__PURE__ */ jsx6(React4.Fragment, { children: props.renderComponent(node, slots) }, node.id);
338
+ };
339
+ const roots = props.session.nodes.filter(
340
+ (node) => !node.parentId || !nodesById.has(node.parentId)
341
+ );
342
+ if (!roots.length) return /* @__PURE__ */ jsx6("div", { className: "p-4 text-xs opacity-60", children: props.emptyMessage || "Add a page or component to preview." });
343
+ return /* @__PURE__ */ jsx6("div", { className: "min-h-0 w-full", children: roots.map(renderNode) });
344
+ }
345
+
275
346
  export {
276
347
  getAuthoringDepth,
277
348
  getAuthoringChildren,
349
+ getAuthoringSubtreeIds,
278
350
  UiAuthoringTree,
279
351
  UiAuthoringInspector,
280
352
  UiAuthoringBindingEditor,
281
- UiAuthoringWorkspace
353
+ UiAuthoringWorkspace,
354
+ UiAuthoringValidationPanel,
355
+ UiAuthoringPreview
282
356
  };
@@ -0,0 +1,239 @@
1
+ // src/editor/themes.ts
2
+ var skipoDarkTheme = {
3
+ base: "vs-dark",
4
+ inherit: true,
5
+ rules: [
6
+ { token: "keyword", foreground: "d4af37" },
7
+ // Gold
8
+ { token: "string", foreground: "98c379" },
9
+ // Olive
10
+ { token: "number", foreground: "d19a66" },
11
+ // Orange
12
+ { token: "comment", foreground: "5c6370", fontStyle: "italic" },
13
+ { token: "type", foreground: "56b6c2" }
14
+ // Cyan
15
+ ],
16
+ colors: {
17
+ "editor.background": "#16161e",
18
+ "editor.foreground": "#a9b1d6",
19
+ "editorLineNumber.foreground": "#363b54",
20
+ "editor.selectionBackground": "#28324a",
21
+ "editor.lineHighlightBackground": "#1c1c26",
22
+ "editorCursor.foreground": "#d4af37",
23
+ "editorIndentGuide.background": "#222222"
24
+ }
25
+ };
26
+
27
+ // src/editor/useMonaco.ts
28
+ import { useEffect, useState } from "react";
29
+ function useMonaco() {
30
+ const [monaco, setMonaco] = useState(null);
31
+ useEffect(() => {
32
+ let isMounted = true;
33
+ const monacoPkg = "monaco-editor";
34
+ import(
35
+ /* @vite-ignore */
36
+ monacoPkg
37
+ ).then((monacoModule) => {
38
+ if (!isMounted) return;
39
+ monacoModule.editor.defineTheme("skipo-dark", skipoDarkTheme);
40
+ setMonaco(monacoModule);
41
+ }).catch((err) => {
42
+ console.warn("Failed to load monaco-editor", err);
43
+ });
44
+ return () => {
45
+ isMounted = false;
46
+ };
47
+ }, []);
48
+ return monaco;
49
+ }
50
+
51
+ // src/editor/MonacoEditor.tsx
52
+ import { useEffect as useEffect2, useMemo, useRef, useState as useState2 } from "react";
53
+ import { MonacoIdeServiceFacade } from "@ultrst-armada/kloks/services";
54
+ import { jsx } from "react/jsx-runtime";
55
+ function MonacoEditor({
56
+ value,
57
+ language = "javascript",
58
+ readOnly = false,
59
+ minimap = false,
60
+ theme = "skipo-dark",
61
+ fontSize = 14,
62
+ sessionId,
63
+ uri,
64
+ ideService,
65
+ diagnostics = [],
66
+ completionProvider,
67
+ onValidate,
68
+ onServiceError,
69
+ onChange,
70
+ height = "100%",
71
+ width = "100%"
72
+ }) {
73
+ const containerRef = useRef(null);
74
+ const editorRef = useRef(null);
75
+ const sessionRef = useRef(sessionId);
76
+ const sessionReadyRef = useRef(Promise.resolve());
77
+ const monaco = useMonaco();
78
+ const service = ideService || MonacoIdeServiceFacade;
79
+ const [validationDiagnostics, setValidationDiagnostics] = useState2([]);
80
+ const validationRunRef = useRef(0);
81
+ const completionProviderRef = useRef(completionProvider);
82
+ const validateRef = useRef(onValidate);
83
+ const errorRef = useRef(onServiceError);
84
+ completionProviderRef.current = completionProvider;
85
+ validateRef.current = onValidate;
86
+ errorRef.current = onServiceError;
87
+ const activeDiagnostics = useMemo(() => [...diagnostics, ...validationDiagnostics], [diagnostics, validationDiagnostics]);
88
+ const executeForSession = (operation, input) => sessionReadyRef.current.then(() => service.execute(operation, input)).catch((error) => {
89
+ errorRef.current?.(error);
90
+ });
91
+ useEffect2(() => {
92
+ if (!sessionRef.current) sessionRef.current = sessionId || `editor-${Date.now().toString(36)}`;
93
+ sessionReadyRef.current = service.execute("createSession", {
94
+ sessionId: sessionRef.current,
95
+ uri: uri || `inmemory://${sessionRef.current}`,
96
+ language,
97
+ value,
98
+ options: { readOnly, minimap, fontSize }
99
+ });
100
+ void sessionReadyRef.current.catch((error) => errorRef.current?.(error));
101
+ return () => {
102
+ if (sessionRef.current) {
103
+ void sessionReadyRef.current.then(() => service.execute("disposeSession", { sessionId: sessionRef.current })).catch((error) => errorRef.current?.(error));
104
+ }
105
+ };
106
+ }, []);
107
+ useEffect2(() => {
108
+ if (!monaco || !containerRef.current) return;
109
+ if (!editorRef.current) {
110
+ editorRef.current = monaco.editor.create(containerRef.current, {
111
+ value,
112
+ language,
113
+ theme,
114
+ readOnly,
115
+ fontSize,
116
+ minimap: { enabled: minimap },
117
+ automaticLayout: true,
118
+ scrollBeyondLastLine: false,
119
+ padding: { top: 16, bottom: 16 }
120
+ });
121
+ editorRef.current.onDidChangeModelContent(() => {
122
+ const nextValue = editorRef.current.getValue();
123
+ const currentSessionId = sessionRef.current;
124
+ void executeForSession("updateDocument", {
125
+ sessionId: currentSessionId,
126
+ value: nextValue,
127
+ language
128
+ });
129
+ const validate = validateRef.current;
130
+ if (validate && currentSessionId) {
131
+ const sequence = ++validationRunRef.current;
132
+ const document = {
133
+ uri: uri || `inmemory://${currentSessionId}`,
134
+ language,
135
+ value: nextValue,
136
+ version: sequence,
137
+ diagnostics: []
138
+ };
139
+ void validate(document).then((nextDiagnostics) => {
140
+ if (sequence !== validationRunRef.current) return;
141
+ setValidationDiagnostics(nextDiagnostics);
142
+ return executeForSession("setDiagnostics", { sessionId: currentSessionId, diagnostics: nextDiagnostics });
143
+ }).catch((error) => errorRef.current?.(error));
144
+ }
145
+ onChange?.(nextValue);
146
+ });
147
+ }
148
+ return () => {
149
+ if (editorRef.current) {
150
+ editorRef.current.dispose();
151
+ editorRef.current = null;
152
+ }
153
+ };
154
+ }, [monaco]);
155
+ useEffect2(() => {
156
+ if (editorRef.current && value !== editorRef.current.getValue()) editorRef.current.setValue(value);
157
+ }, [value]);
158
+ useEffect2(() => {
159
+ if (!editorRef.current) return;
160
+ monaco?.editor.setModelLanguage(editorRef.current.getModel(), language);
161
+ editorRef.current.updateOptions({ readOnly, fontSize, minimap: { enabled: minimap } });
162
+ if (theme) monaco?.editor.setTheme(theme);
163
+ if (sessionRef.current) {
164
+ void executeForSession("setOptions", {
165
+ sessionId: sessionRef.current,
166
+ options: { readOnly, minimap, fontSize }
167
+ });
168
+ }
169
+ }, [language, readOnly, fontSize, minimap, theme, monaco]);
170
+ useEffect2(() => {
171
+ if (!monaco || !editorRef.current) return;
172
+ const model = editorRef.current.getModel();
173
+ if (!model) return;
174
+ const severity = monaco.MarkerSeverity || {};
175
+ monaco.editor.setModelMarkers(model, "kloks", activeDiagnostics.map((diagnostic) => ({
176
+ message: diagnostic.message,
177
+ severity: severity[diagnostic.severity === "error" ? "Error" : diagnostic.severity === "warning" ? "Warning" : diagnostic.severity === "info" ? "Info" : "Hint"] ?? severity.Error,
178
+ startLineNumber: diagnostic.startLineNumber,
179
+ startColumn: diagnostic.startColumn,
180
+ endLineNumber: diagnostic.endLineNumber,
181
+ endColumn: diagnostic.endColumn,
182
+ code: diagnostic.code,
183
+ source: "kloks"
184
+ })));
185
+ if (sessionRef.current) {
186
+ void executeForSession("setDiagnostics", {
187
+ sessionId: sessionRef.current,
188
+ diagnostics: activeDiagnostics
189
+ });
190
+ }
191
+ }, [monaco, activeDiagnostics, service]);
192
+ useEffect2(() => {
193
+ if (!monaco || !completionProviderRef.current || !monaco.languages?.registerCompletionItemProvider) return;
194
+ const disposable = monaco.languages.registerCompletionItemProvider(language, {
195
+ triggerCharacters: ["."],
196
+ provideCompletionItems: async (model, position) => {
197
+ const provider = completionProviderRef.current;
198
+ if (!provider) return { suggestions: [] };
199
+ const currentSessionId = sessionRef.current;
200
+ if (!currentSessionId) return { suggestions: [] };
201
+ const word = model.getWordUntilPosition(position);
202
+ const range = {
203
+ startLineNumber: position.lineNumber,
204
+ endLineNumber: position.lineNumber,
205
+ startColumn: word.startColumn,
206
+ endColumn: word.endColumn
207
+ };
208
+ const items = await provider({
209
+ sessionId: currentSessionId,
210
+ uri: model.uri?.toString?.() || uri || `inmemory://${currentSessionId}`,
211
+ language: model.getLanguageId(),
212
+ value: model.getValue(),
213
+ position: {
214
+ lineNumber: position.lineNumber,
215
+ column: position.column,
216
+ offset: model.getOffsetAt(position)
217
+ }
218
+ });
219
+ const kinds = monaco.languages.CompletionItemKind || {};
220
+ return {
221
+ suggestions: items.map((item) => ({
222
+ ...item,
223
+ kind: kinds[item.kind || "Text"] ?? kinds.Text,
224
+ insertText: item.insertText ?? item.label,
225
+ range
226
+ }))
227
+ };
228
+ }
229
+ });
230
+ return () => disposable?.dispose?.();
231
+ }, [monaco, language, uri]);
232
+ return /* @__PURE__ */ jsx("div", { ref: containerRef, style: { width, height, overflow: "hidden", borderRadius: "8px" } });
233
+ }
234
+
235
+ export {
236
+ skipoDarkTheme,
237
+ useMonaco,
238
+ MonacoEditor
239
+ };
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import { MonacoDiagnostic, MonacoCompletionProvider, MonacoDocument } from '@ultrst-armada/kloks/contracts';
2
3
 
3
4
  interface EditorConfig {
4
5
  value: string;
@@ -41,10 +42,14 @@ interface MonacoEditorProps extends EditorConfig {
41
42
  sessionId?: string;
42
43
  uri?: string;
43
44
  ideService?: MonacoIdeServicePort;
45
+ diagnostics?: MonacoDiagnostic[];
46
+ completionProvider?: MonacoCompletionProvider;
47
+ onValidate?: (document: MonacoDocument) => Promise<MonacoDiagnostic[]>;
48
+ onServiceError?: (error: unknown) => void;
44
49
  onChange?: (value: string) => void;
45
50
  height?: string | number;
46
51
  width?: string | number;
47
52
  }
48
- declare function MonacoEditor({ value, language, readOnly, minimap, theme, fontSize, sessionId, uri, ideService, onChange, height, width, }: MonacoEditorProps): React.JSX.Element;
53
+ declare function MonacoEditor({ value, language, readOnly, minimap, theme, fontSize, sessionId, uri, ideService, diagnostics, completionProvider, onValidate, onServiceError, onChange, height, width, }: MonacoEditorProps): React.JSX.Element;
49
54
 
50
55
  export { type EditorConfig, MonacoEditor, type MonacoEditorProps, type MonacoIdeServicePort, skipoDarkTheme, useMonaco };
@@ -2,7 +2,7 @@ import {
2
2
  MonacoEditor,
3
3
  skipoDarkTheme,
4
4
  useMonaco
5
- } from "../chunk-5I3TTHDX.js";
5
+ } from "../chunk-ZJXRL74D.js";
6
6
  export {
7
7
  MonacoEditor,
8
8
  skipoDarkTheme,
@@ -10,7 +10,8 @@ export { FrnlEditableNodeGraph, FrnlEditableNodeGraphProps, frnlEditableNodeGrap
10
10
  export { B as BIOME_CONFIGS, C as COORD_SCALE, a as CameraState, b as Canvas2DViewerProps, c as ConnectingWireState } from './types-D3RRfQUo.js';
11
11
  export { CanvasBackground2D, CanvasErrorBoundary, ContainerNode2D, EffectNode2D, MagneticTraces2D, ModuleNode2D, NODE_CARD_WIDTH, Node2DBase, Node2DBaseProps, NodeRenderer2D, NodeRenderer2DProps, RecorderWaveformDisplay, RecorderWaveformDisplayProps, RotaryKnob, RotaryKnobProps, SOCKET_ROW_HEIGHT, Socket2D, Socket2DProps, SocketScreenPosition, TriggerNode2D, Wire2D, Wire2DProps, getSocketLocalOffset, getSocketScreenPosition, renderSpriteIcon, useCanvas2DCoordinates, useCanvas2DMagnetic } from './graph-2d/index.js';
12
12
  export { PredictiveGhostNodeCard, PredictiveGhostNodeCardProps, PredictiveHudToolbar, PredictiveLayer2D, PredictiveLayer2DProps, UsePredictiveGraph2DProps, UseViewer2DPredictiveProps, usePredictiveGraph2D } from './predictive/index.js';
13
- export { AuthoringAssetRef, UIAuthoringContext, UIAuthoringNode, UIAuthoringNodeKind, UIAuthoringSession, UiAuthoringBindingEditor, UiAuthoringInspector, UiAuthoringTree, UiAuthoringWorkspace, getAuthoringChildren, getAuthoringDepth } from './authoring/index.js';
13
+ export { AuthoringAssetRef, UIAuthoringContext, UIAuthoringNode, UIAuthoringNodeKind, UIAuthoringSession, UiAuthoringBindingEditor, UiAuthoringComponentRenderer, UiAuthoringInspector, UiAuthoringPreview, UiAuthoringTree, UiAuthoringValidationPanel, UiAuthoringWorkspace, getAuthoringChildren, getAuthoringDepth, getAuthoringSubtreeIds } from './authoring/index.js';
14
+ import '@ultrst-armada/kloks/contracts';
14
15
 
15
16
  interface MidpointWidgetsProps {
16
17
  x: number;
@@ -1,17 +1,19 @@
1
1
  import {
2
- Tile,
3
- TileCreateButton,
4
- TileGrid,
5
- useTileMenu
6
- } from "./chunk-SA3JADUG.js";
2
+ PredictiveGhostNodeCard,
3
+ PredictiveHudToolbar,
4
+ PredictiveLayer2D
5
+ } from "./chunk-RH5NINIT.js";
7
6
  import {
8
7
  UiAuthoringBindingEditor,
9
8
  UiAuthoringInspector,
9
+ UiAuthoringPreview,
10
10
  UiAuthoringTree,
11
+ UiAuthoringValidationPanel,
11
12
  UiAuthoringWorkspace,
12
13
  getAuthoringChildren,
13
- getAuthoringDepth
14
- } from "./chunk-GJ472MWX.js";
14
+ getAuthoringDepth,
15
+ getAuthoringSubtreeIds
16
+ } from "./chunk-TS7P3WWH.js";
15
17
  import {
16
18
  CanvasViewport,
17
19
  InfiniteCanvas,
@@ -27,7 +29,7 @@ import {
27
29
  MonacoEditor,
28
30
  skipoDarkTheme,
29
31
  useMonaco
30
- } from "./chunk-5I3TTHDX.js";
32
+ } from "./chunk-ZJXRL74D.js";
31
33
  import {
32
34
  CanvasContextMenu,
33
35
  CompatibleNodePicker,
@@ -37,6 +39,9 @@ import {
37
39
  menuCategory,
38
40
  menuHidden
39
41
  } from "./chunk-VESG3VP3.js";
42
+ import {
43
+ usePredictiveGraph2D
44
+ } from "./chunk-QRYNQ36L.js";
40
45
  import {
41
46
  BIOME_CONFIGS,
42
47
  COORD_SCALE,
@@ -53,14 +58,6 @@ import {
53
58
  useCanvas2DCoordinates,
54
59
  useCanvas2DMagnetic
55
60
  } from "./chunk-XVAHT5WE.js";
56
- import {
57
- PredictiveGhostNodeCard,
58
- PredictiveHudToolbar,
59
- PredictiveLayer2D
60
- } from "./chunk-RH5NINIT.js";
61
- import {
62
- usePredictiveGraph2D
63
- } from "./chunk-QRYNQ36L.js";
64
61
  import {
65
62
  NODE_CARD_WIDTH,
66
63
  Node2DBase,
@@ -71,6 +68,12 @@ import {
71
68
  getSocketScreenPosition,
72
69
  renderSpriteIcon
73
70
  } from "./chunk-U2SC3RMJ.js";
71
+ import {
72
+ Tile,
73
+ TileCreateButton,
74
+ TileGrid,
75
+ useTileMenu
76
+ } from "./chunk-SA3JADUG.js";
74
77
 
75
78
  // src/node-graph-ui/widgets/MidpointWidgets.tsx
76
79
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -740,13 +743,16 @@ export {
740
743
  TriggerNode2D,
741
744
  UiAuthoringBindingEditor,
742
745
  UiAuthoringInspector,
746
+ UiAuthoringPreview,
743
747
  UiAuthoringTree,
748
+ UiAuthoringValidationPanel,
744
749
  UiAuthoringWorkspace,
745
750
  Viewer2DNodes,
746
751
  Wire2D,
747
752
  frnlEditableNodeGraphDefinition,
748
753
  getAuthoringChildren,
749
754
  getAuthoringDepth,
755
+ getAuthoringSubtreeIds,
750
756
  getSocketLocalOffset,
751
757
  getSocketScreenPosition,
752
758
  menuCategory,
@@ -65,7 +65,7 @@
65
65
  "dependencies": {
66
66
  "@floks/ui": "workspace:*",
67
67
  "@ultrst-armada/frnlts": "^0.2.7",
68
- "@ultrst-armada/kloks": "^1.10.3"
68
+ "@ultrst-armada/kloks": "^1.11.0"
69
69
  },
70
70
  "peerDependencies": {
71
71
  "@dnd-kit/core": "^6.0.0",
@@ -73,7 +73,7 @@
73
73
  "@dnd-kit/utilities": "^3.0.0",
74
74
  "monaco-editor": "^0.50.0",
75
75
  "react": "^18.0.0 || ^19.0.0",
76
- "@ultrst-armada/kloks": "^1.9.0"
76
+ "@ultrst-armada/kloks": "^1.11.0"
77
77
  },
78
78
  "peerDependenciesMeta": {
79
79
  "@dnd-kit/core": {
@@ -1,140 +0,0 @@
1
- // src/editor/themes.ts
2
- var skipoDarkTheme = {
3
- base: "vs-dark",
4
- inherit: true,
5
- rules: [
6
- { token: "keyword", foreground: "d4af37" },
7
- // Gold
8
- { token: "string", foreground: "98c379" },
9
- // Olive
10
- { token: "number", foreground: "d19a66" },
11
- // Orange
12
- { token: "comment", foreground: "5c6370", fontStyle: "italic" },
13
- { token: "type", foreground: "56b6c2" }
14
- // Cyan
15
- ],
16
- colors: {
17
- "editor.background": "#16161e",
18
- "editor.foreground": "#a9b1d6",
19
- "editorLineNumber.foreground": "#363b54",
20
- "editor.selectionBackground": "#28324a",
21
- "editor.lineHighlightBackground": "#1c1c26",
22
- "editorCursor.foreground": "#d4af37",
23
- "editorIndentGuide.background": "#222222"
24
- }
25
- };
26
-
27
- // src/editor/useMonaco.ts
28
- import { useEffect, useState } from "react";
29
- function useMonaco() {
30
- const [monaco, setMonaco] = useState(null);
31
- useEffect(() => {
32
- let isMounted = true;
33
- const monacoPkg = "monaco-editor";
34
- import(
35
- /* @vite-ignore */
36
- monacoPkg
37
- ).then((monacoModule) => {
38
- if (!isMounted) return;
39
- monacoModule.editor.defineTheme("skipo-dark", skipoDarkTheme);
40
- setMonaco(monacoModule);
41
- }).catch((err) => {
42
- console.warn("Failed to load monaco-editor", err);
43
- });
44
- return () => {
45
- isMounted = false;
46
- };
47
- }, []);
48
- return monaco;
49
- }
50
-
51
- // src/editor/MonacoEditor.tsx
52
- import { useEffect as useEffect2, useRef } from "react";
53
- import { MonacoIdeServiceFacade } from "@ultrst-armada/kloks/services";
54
- import { jsx } from "react/jsx-runtime";
55
- function MonacoEditor({
56
- value,
57
- language = "javascript",
58
- readOnly = false,
59
- minimap = false,
60
- theme = "skipo-dark",
61
- fontSize = 14,
62
- sessionId,
63
- uri,
64
- ideService,
65
- onChange,
66
- height = "100%",
67
- width = "100%"
68
- }) {
69
- const containerRef = useRef(null);
70
- const editorRef = useRef(null);
71
- const sessionRef = useRef(sessionId);
72
- const monaco = useMonaco();
73
- const service = ideService || MonacoIdeServiceFacade;
74
- useEffect2(() => {
75
- if (!sessionRef.current) sessionRef.current = sessionId || `editor-${Date.now().toString(36)}`;
76
- void service.execute("createSession", {
77
- sessionId: sessionRef.current,
78
- uri: uri || `inmemory://${sessionRef.current}`,
79
- language,
80
- value,
81
- options: { readOnly, minimap, fontSize }
82
- });
83
- return () => {
84
- if (sessionRef.current) void service.execute("disposeSession", { sessionId: sessionRef.current });
85
- };
86
- }, []);
87
- useEffect2(() => {
88
- if (!monaco || !containerRef.current) return;
89
- if (!editorRef.current) {
90
- editorRef.current = monaco.editor.create(containerRef.current, {
91
- value,
92
- language,
93
- theme,
94
- readOnly,
95
- fontSize,
96
- minimap: { enabled: minimap },
97
- automaticLayout: true,
98
- scrollBeyondLastLine: false,
99
- padding: { top: 16, bottom: 16 }
100
- });
101
- editorRef.current.onDidChangeModelContent(() => {
102
- const nextValue = editorRef.current.getValue();
103
- void service.execute("updateDocument", {
104
- sessionId: sessionRef.current,
105
- value: nextValue,
106
- language
107
- });
108
- onChange?.(nextValue);
109
- });
110
- }
111
- return () => {
112
- if (editorRef.current) {
113
- editorRef.current.dispose();
114
- editorRef.current = null;
115
- }
116
- };
117
- }, [monaco]);
118
- useEffect2(() => {
119
- if (editorRef.current && value !== editorRef.current.getValue()) editorRef.current.setValue(value);
120
- }, [value]);
121
- useEffect2(() => {
122
- if (!editorRef.current) return;
123
- monaco?.editor.setModelLanguage(editorRef.current.getModel(), language);
124
- editorRef.current.updateOptions({ readOnly, fontSize, minimap: { enabled: minimap } });
125
- if (theme) monaco?.editor.setTheme(theme);
126
- if (sessionRef.current) {
127
- void service.execute("setOptions", {
128
- sessionId: sessionRef.current,
129
- options: { readOnly, minimap, fontSize }
130
- });
131
- }
132
- }, [language, readOnly, fontSize, minimap, theme, monaco]);
133
- return /* @__PURE__ */ jsx("div", { ref: containerRef, style: { width, height, overflow: "hidden", borderRadius: "8px" } });
134
- }
135
-
136
- export {
137
- skipoDarkTheme,
138
- useMonaco,
139
- MonacoEditor
140
- };