@ultrst-armada/floks 1.5.1 → 1.5.3
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.
- package/.krusbl-release-attestation.json +3 -3
- package/package.json +6 -5
- package/packages/canvas-ui/dist/authoring/index.d.ts +17 -1
- package/packages/canvas-ui/dist/authoring/index.js +3 -1
- package/packages/canvas-ui/dist/{chunk-WUNEXPZP.js → chunk-5I3TTHDX.js} +2 -1
- package/packages/canvas-ui/dist/chunk-GJ472MWX.js +282 -0
- package/packages/canvas-ui/dist/editor/index.js +1 -1
- package/packages/canvas-ui/dist/index.d.ts +1 -1
- package/packages/canvas-ui/dist/index.js +16 -14
- package/packages/canvas-ui/dist/predictive/index.js +1 -1
- package/packages/canvas-ui/package.json +2 -2
- package/packages/ui/dist/components/layout/index.js +2 -2
- package/packages/ui/dist/index.js +15 -15
- package/packages/ui/package.json +1 -1
- package/packages/canvas-ui/dist/chunk-MFZKZ76J.js +0 -136
- package/packages/ui/dist/{chunk-MYXPGPI3.js → chunk-GWW3BGOB.js} +3 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": 1,
|
|
3
3
|
"packageName": "@ultrst-armada/floks",
|
|
4
|
-
"version": "1.5.
|
|
5
|
-
"sourceCommit": "
|
|
4
|
+
"version": "1.5.3",
|
|
5
|
+
"sourceCommit": "0404fca4a44793f1b233eb9378bfea0461c6252c",
|
|
6
6
|
"releaseWorkflow": "npm Release",
|
|
7
|
-
"workflowRunId": "
|
|
7
|
+
"workflowRunId": "40318674653"
|
|
8
8
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultrst-armada/floks",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -53,11 +53,12 @@
|
|
|
53
53
|
"clean": "pnpm -r run clean"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@ultrst-armada/frnlts": "^0.2.
|
|
56
|
+
"@ultrst-armada/frnlts": "^0.2.7",
|
|
57
57
|
"@xyflow/react": "^12.8.6",
|
|
58
58
|
"d3-force": "^3.0.0",
|
|
59
59
|
"zod": "^3.24.1",
|
|
60
|
-
"zustand": "^5.0.3"
|
|
60
|
+
"zustand": "^5.0.3",
|
|
61
|
+
"@dinilmusick/gutts": "^0.1.3"
|
|
61
62
|
},
|
|
62
63
|
"peerDependencies": {
|
|
63
64
|
"@ultrst-armada/kloks": "^1.0.2 || ^1.4.0",
|
|
@@ -71,8 +72,8 @@
|
|
|
71
72
|
"@types/node": "^22.0.0",
|
|
72
73
|
"@types/react": "^19.0.0",
|
|
73
74
|
"@types/react-dom": "^19.0.0",
|
|
74
|
-
"@ultrst-armada/kloks": "^1.
|
|
75
|
-
"@ultrst-armada/frnlts": "^0.2.
|
|
75
|
+
"@ultrst-armada/kloks": "^1.10.2",
|
|
76
|
+
"@ultrst-armada/frnlts": "^0.2.7",
|
|
76
77
|
"happy-dom": "^21.0.3",
|
|
77
78
|
"lucide-react": "^1.55.0",
|
|
78
79
|
"react": "^19.0.1",
|
|
@@ -17,6 +17,9 @@ interface UIAuthoringNode {
|
|
|
17
17
|
assetRef?: AuthoringAssetRef;
|
|
18
18
|
parentId?: string;
|
|
19
19
|
props: Record<string, string | number | boolean>;
|
|
20
|
+
slots?: Record<string, string[]>;
|
|
21
|
+
states?: Record<string, Record<string, string | number | boolean>>;
|
|
22
|
+
events?: Record<string, string>;
|
|
20
23
|
}
|
|
21
24
|
interface UIAuthoringSession {
|
|
22
25
|
sessionId: string;
|
|
@@ -36,6 +39,14 @@ interface UIAuthoringSession {
|
|
|
36
39
|
operationId: string;
|
|
37
40
|
name: string;
|
|
38
41
|
description?: string;
|
|
42
|
+
inputFields?: Array<{
|
|
43
|
+
name: string;
|
|
44
|
+
type: string;
|
|
45
|
+
}>;
|
|
46
|
+
outputFields?: Array<{
|
|
47
|
+
name: string;
|
|
48
|
+
type: string;
|
|
49
|
+
}>;
|
|
39
50
|
}>;
|
|
40
51
|
metadata: Record<string, string>;
|
|
41
52
|
}
|
|
@@ -61,4 +72,9 @@ declare function UiAuthoringWorkspace(props: {
|
|
|
61
72
|
onValidate?: () => void;
|
|
62
73
|
}): React__default.JSX.Element;
|
|
63
74
|
|
|
64
|
-
|
|
75
|
+
declare function UiAuthoringBindingEditor(props: {
|
|
76
|
+
session: UIAuthoringSession;
|
|
77
|
+
onChange: (session: UIAuthoringSession) => void;
|
|
78
|
+
}): React__default.JSX.Element;
|
|
79
|
+
|
|
80
|
+
export { type AuthoringAssetRef, type UIAuthoringContext, type UIAuthoringNode, type UIAuthoringNodeKind, type UIAuthoringSession, UiAuthoringBindingEditor, UiAuthoringInspector, UiAuthoringTree, UiAuthoringWorkspace, getAuthoringChildren, getAuthoringDepth };
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
+
UiAuthoringBindingEditor,
|
|
2
3
|
UiAuthoringInspector,
|
|
3
4
|
UiAuthoringTree,
|
|
4
5
|
UiAuthoringWorkspace,
|
|
5
6
|
getAuthoringChildren,
|
|
6
7
|
getAuthoringDepth
|
|
7
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-GJ472MWX.js";
|
|
8
9
|
export {
|
|
10
|
+
UiAuthoringBindingEditor,
|
|
9
11
|
UiAuthoringInspector,
|
|
10
12
|
UiAuthoringTree,
|
|
11
13
|
UiAuthoringWorkspace,
|
|
@@ -50,6 +50,7 @@ function useMonaco() {
|
|
|
50
50
|
|
|
51
51
|
// src/editor/MonacoEditor.tsx
|
|
52
52
|
import { useEffect as useEffect2, useRef } from "react";
|
|
53
|
+
import { MonacoIdeServiceFacade } from "@ultrst-armada/kloks/services";
|
|
53
54
|
import { jsx } from "react/jsx-runtime";
|
|
54
55
|
function MonacoEditor({
|
|
55
56
|
value,
|
|
@@ -69,7 +70,7 @@ function MonacoEditor({
|
|
|
69
70
|
const editorRef = useRef(null);
|
|
70
71
|
const sessionRef = useRef(sessionId);
|
|
71
72
|
const monaco = useMonaco();
|
|
72
|
-
const service = ideService ||
|
|
73
|
+
const service = ideService || MonacoIdeServiceFacade;
|
|
73
74
|
useEffect2(() => {
|
|
74
75
|
if (!sessionRef.current) sessionRef.current = sessionId || `editor-${Date.now().toString(36)}`;
|
|
75
76
|
void service.execute("createSession", {
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
// src/authoring/authoringModel.ts
|
|
2
|
+
function getAuthoringDepth(node, nodes) {
|
|
3
|
+
let depth = 0;
|
|
4
|
+
let parentId = node.parentId;
|
|
5
|
+
while (parentId) {
|
|
6
|
+
const parent = nodes.find((item) => item.id === parentId);
|
|
7
|
+
if (!parent) break;
|
|
8
|
+
depth += 1;
|
|
9
|
+
parentId = parent.parentId;
|
|
10
|
+
}
|
|
11
|
+
return depth;
|
|
12
|
+
}
|
|
13
|
+
function getAuthoringChildren(nodeId, nodes) {
|
|
14
|
+
return nodes.filter((node) => node.parentId === nodeId);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// src/authoring/UiAuthoringTree.tsx
|
|
18
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
|
+
function UiAuthoringTree(props) {
|
|
20
|
+
return /* @__PURE__ */ jsxs("div", { className: "min-h-0 flex-1 overflow-auto", children: [
|
|
21
|
+
props.nodes.map((node) => /* @__PURE__ */ jsxs(
|
|
22
|
+
"button",
|
|
23
|
+
{
|
|
24
|
+
type: "button",
|
|
25
|
+
onClick: () => props.onSelect(node.id),
|
|
26
|
+
className: `flex w-full items-center gap-2 border-b border-black/10 px-2 py-1.5 text-left text-xs ${props.selectedNodeId === node.id ? "bg-black/10" : ""}`,
|
|
27
|
+
style: { paddingLeft: 8 + getAuthoringDepth(node, props.nodes) * 14 },
|
|
28
|
+
children: [
|
|
29
|
+
/* @__PURE__ */ jsx("span", { className: "font-semibold", children: node.name }),
|
|
30
|
+
/* @__PURE__ */ jsx("span", { className: "ml-auto opacity-50", children: node.kind })
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
node.id
|
|
34
|
+
)),
|
|
35
|
+
!props.nodes.length && /* @__PURE__ */ jsx("div", { className: "p-4 text-xs opacity-60", children: "No authored nodes." })
|
|
36
|
+
] });
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// src/authoring/UiAuthoringInspector.tsx
|
|
40
|
+
import React from "react";
|
|
41
|
+
import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
42
|
+
function readJsonObject(raw) {
|
|
43
|
+
try {
|
|
44
|
+
const value = JSON.parse(raw);
|
|
45
|
+
if (value && typeof value === "object" && !Array.isArray(value)) return value;
|
|
46
|
+
} catch {
|
|
47
|
+
return void 0;
|
|
48
|
+
}
|
|
49
|
+
return void 0;
|
|
50
|
+
}
|
|
51
|
+
function JsonEditor(props) {
|
|
52
|
+
const [invalid, setInvalid] = React.useState(false);
|
|
53
|
+
return /* @__PURE__ */ jsxs2("label", { className: "mt-3 block text-xs", children: [
|
|
54
|
+
props.label,
|
|
55
|
+
" (JSON)",
|
|
56
|
+
/* @__PURE__ */ jsx2(
|
|
57
|
+
"textarea",
|
|
58
|
+
{
|
|
59
|
+
className: `mt-1 min-h-20 w-full rounded border px-2 py-1.5 font-mono text-[10px] ${invalid ? "border-red-500" : ""}`,
|
|
60
|
+
defaultValue: JSON.stringify(props.value || {}, null, 2),
|
|
61
|
+
spellCheck: false,
|
|
62
|
+
onBlur: (event) => {
|
|
63
|
+
const parsed = readJsonObject(event.currentTarget.value);
|
|
64
|
+
setInvalid(!parsed);
|
|
65
|
+
if (parsed) props.onCommit(parsed);
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
props.nodeId + props.label
|
|
69
|
+
),
|
|
70
|
+
invalid && /* @__PURE__ */ jsx2("span", { className: "text-[10px] text-red-600", children: "Enter a valid JSON object, then blur to apply." })
|
|
71
|
+
] });
|
|
72
|
+
}
|
|
73
|
+
function UiAuthoringInspector(props) {
|
|
74
|
+
if (!props.node) return /* @__PURE__ */ jsx2("aside", { className: "w-72 border-l border-black/10 p-3 text-xs opacity-60", children: "Select a node." });
|
|
75
|
+
const node = props.node;
|
|
76
|
+
const description = String(node.props.description || "");
|
|
77
|
+
return /* @__PURE__ */ jsxs2("aside", { className: "w-72 overflow-auto border-l border-black/10 p-3", children: [
|
|
78
|
+
/* @__PURE__ */ jsx2("div", { className: "mb-3 text-xs font-bold uppercase tracking-wide", children: node.kind }),
|
|
79
|
+
/* @__PURE__ */ jsxs2("label", { className: "block text-xs", children: [
|
|
80
|
+
"Name",
|
|
81
|
+
/* @__PURE__ */ jsx2("input", { className: "mt-1 w-full rounded border px-2 py-1.5", value: node.name, onChange: (e) => props.onChange({ name: e.target.value }) })
|
|
82
|
+
] }),
|
|
83
|
+
/* @__PURE__ */ jsxs2("label", { className: "mt-3 block text-xs", children: [
|
|
84
|
+
"Description",
|
|
85
|
+
/* @__PURE__ */ jsx2("textarea", { className: "mt-1 min-h-20 w-full rounded border px-2 py-1.5", value: description, onChange: (e) => props.onChange({ props: { ...node.props, description: e.target.value } }) })
|
|
86
|
+
] }),
|
|
87
|
+
/* @__PURE__ */ jsx2(
|
|
88
|
+
JsonEditor,
|
|
89
|
+
{
|
|
90
|
+
label: "Properties",
|
|
91
|
+
value: node.props,
|
|
92
|
+
nodeId: node.id,
|
|
93
|
+
onCommit: (value) => props.onChange({ props: value })
|
|
94
|
+
}
|
|
95
|
+
),
|
|
96
|
+
node.kind === "component" && /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
97
|
+
/* @__PURE__ */ jsx2(
|
|
98
|
+
JsonEditor,
|
|
99
|
+
{
|
|
100
|
+
label: "Slots",
|
|
101
|
+
value: node.slots,
|
|
102
|
+
nodeId: node.id,
|
|
103
|
+
onCommit: (slots) => props.onChange({ slots })
|
|
104
|
+
}
|
|
105
|
+
),
|
|
106
|
+
/* @__PURE__ */ jsx2(
|
|
107
|
+
JsonEditor,
|
|
108
|
+
{
|
|
109
|
+
label: "Visual states",
|
|
110
|
+
value: node.states,
|
|
111
|
+
nodeId: node.id,
|
|
112
|
+
onCommit: (states) => props.onChange({ states })
|
|
113
|
+
}
|
|
114
|
+
),
|
|
115
|
+
/* @__PURE__ */ jsx2(
|
|
116
|
+
JsonEditor,
|
|
117
|
+
{
|
|
118
|
+
label: "Event \u2192 operation bindings",
|
|
119
|
+
value: node.events,
|
|
120
|
+
nodeId: node.id,
|
|
121
|
+
onCommit: (events) => props.onChange({ events })
|
|
122
|
+
}
|
|
123
|
+
)
|
|
124
|
+
] })
|
|
125
|
+
] });
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// src/authoring/UiAuthoringWorkspace.tsx
|
|
129
|
+
import React3 from "react";
|
|
130
|
+
|
|
131
|
+
// src/authoring/UiAuthoringBindingEditor.tsx
|
|
132
|
+
import React2 from "react";
|
|
133
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
134
|
+
function UiAuthoringBindingEditor(props) {
|
|
135
|
+
const components = props.session.nodes.filter((node) => node.kind === "component");
|
|
136
|
+
const [componentId, setComponentId] = React2.useState("");
|
|
137
|
+
const [property, setProperty] = React2.useState("value");
|
|
138
|
+
const [operationId, setOperationId] = React2.useState("");
|
|
139
|
+
const [targetKind, setTargetKind] = React2.useState("api-input");
|
|
140
|
+
const [fieldName, setFieldName] = React2.useState("");
|
|
141
|
+
const operation = props.session.operations.find((item) => item.operationId === operationId);
|
|
142
|
+
const fields = targetKind === "api-input" ? operation?.inputFields || [] : operation?.outputFields || [];
|
|
143
|
+
const addBinding = () => {
|
|
144
|
+
if (!componentId || !property.trim() || !operationId || !fields.length) return;
|
|
145
|
+
const field = fields.find((item) => item.name === fieldName) || fields[0];
|
|
146
|
+
const binding = { componentId, property: property.trim(), target: {
|
|
147
|
+
kind: targetKind,
|
|
148
|
+
apiId: operationId,
|
|
149
|
+
field: field.name,
|
|
150
|
+
fieldType: field.type
|
|
151
|
+
} };
|
|
152
|
+
props.onChange({
|
|
153
|
+
...props.session,
|
|
154
|
+
bindings: [...props.session.bindings.filter((item) => item.componentId !== componentId || item.property !== property.trim()), binding]
|
|
155
|
+
});
|
|
156
|
+
};
|
|
157
|
+
const removeBinding = (component, prop) => props.onChange({
|
|
158
|
+
...props.session,
|
|
159
|
+
bindings: props.session.bindings.filter((item) => item.componentId !== component || item.property !== prop)
|
|
160
|
+
});
|
|
161
|
+
return /* @__PURE__ */ jsxs3("section", { className: "shrink-0 border-t border-black/10 p-3 text-xs", children: [
|
|
162
|
+
/* @__PURE__ */ jsx3("div", { className: "mb-2 font-bold uppercase tracking-wide", children: "Data bindings" }),
|
|
163
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
164
|
+
/* @__PURE__ */ jsxs3("select", { className: "max-w-48 rounded border px-2 py-1.5", value: componentId, onChange: (event) => setComponentId(event.target.value), children: [
|
|
165
|
+
/* @__PURE__ */ jsx3("option", { value: "", children: "Component\u2026" }),
|
|
166
|
+
components.map((node) => /* @__PURE__ */ jsx3("option", { value: node.id, children: node.name }, node.id))
|
|
167
|
+
] }),
|
|
168
|
+
/* @__PURE__ */ jsx3("input", { className: "w-28 rounded border px-2 py-1.5", "aria-label": "Bound property", value: property, onChange: (event) => setProperty(event.target.value) }),
|
|
169
|
+
/* @__PURE__ */ jsxs3("select", { className: "rounded border px-2 py-1.5", value: operationId, onChange: (event) => setOperationId(event.target.value), children: [
|
|
170
|
+
/* @__PURE__ */ jsx3("option", { value: "", children: "Operation\u2026" }),
|
|
171
|
+
props.session.operations.map((item) => /* @__PURE__ */ jsx3("option", { value: item.operationId, children: item.name }, item.operationId))
|
|
172
|
+
] }),
|
|
173
|
+
/* @__PURE__ */ jsxs3("select", { className: "rounded border px-2 py-1.5", value: targetKind, onChange: (event) => setTargetKind(event.target.value), children: [
|
|
174
|
+
/* @__PURE__ */ jsx3("option", { value: "api-input", children: "Operation input" }),
|
|
175
|
+
/* @__PURE__ */ jsx3("option", { value: "api-output", children: "Operation output" })
|
|
176
|
+
] }),
|
|
177
|
+
/* @__PURE__ */ jsx3("select", { className: "max-w-40 rounded border px-2 py-1.5", "aria-label": "Bound field", value: fields.some((field) => field.name === fieldName) ? fieldName : fields[0]?.name || "", disabled: !fields.length, onChange: (event) => setFieldName(event.target.value), children: fields.length ? fields.map((field) => /* @__PURE__ */ jsxs3("option", { value: field.name, children: [
|
|
178
|
+
field.name,
|
|
179
|
+
" \xB7 ",
|
|
180
|
+
field.type
|
|
181
|
+
] }, field.name)) : /* @__PURE__ */ jsx3("option", { value: "", children: "No fields" }) }),
|
|
182
|
+
/* @__PURE__ */ jsx3("button", { type: "button", className: "rounded border px-2 py-1.5 disabled:opacity-40", disabled: !componentId || !operationId || !fields.length, onClick: addBinding, children: "Add / replace" })
|
|
183
|
+
] }),
|
|
184
|
+
/* @__PURE__ */ jsxs3("ul", { className: "mt-2 flex flex-wrap gap-2", children: [
|
|
185
|
+
props.session.bindings.map((binding) => /* @__PURE__ */ jsxs3("li", { className: "flex items-center gap-2 rounded bg-black/5 px-2 py-1", children: [
|
|
186
|
+
/* @__PURE__ */ jsxs3("span", { children: [
|
|
187
|
+
components.find((node) => node.id === binding.componentId)?.name || binding.componentId,
|
|
188
|
+
".",
|
|
189
|
+
binding.property,
|
|
190
|
+
" \u2190 ",
|
|
191
|
+
binding.target.apiId,
|
|
192
|
+
".",
|
|
193
|
+
binding.target.field
|
|
194
|
+
] }),
|
|
195
|
+
/* @__PURE__ */ jsx3("button", { type: "button", "aria-label": `Remove binding ${binding.property}`, onClick: () => removeBinding(binding.componentId, binding.property), children: "\xD7" })
|
|
196
|
+
] }, binding.componentId + ":" + binding.property)),
|
|
197
|
+
!props.session.bindings.length && /* @__PURE__ */ jsx3("li", { className: "opacity-60", children: "No bindings configured." })
|
|
198
|
+
] })
|
|
199
|
+
] });
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// src/authoring/UiAuthoringWorkspace.tsx
|
|
203
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
204
|
+
function UiAuthoringWorkspace(props) {
|
|
205
|
+
const [selectedNodeId, setSelectedNodeId] = React3.useState();
|
|
206
|
+
const selectedNode = props.session.nodes.find((node) => node.id === selectedNodeId);
|
|
207
|
+
const addNode = (kind, assetRef) => {
|
|
208
|
+
const parent = kind === "section" ? props.session.nodes.find((node2) => node2.kind === "page") : kind === "component" ? props.session.nodes.find((node2) => node2.kind === "section") : void 0;
|
|
209
|
+
const node = {
|
|
210
|
+
id: `authoring-${kind}-${Date.now().toString(36)}`,
|
|
211
|
+
kind,
|
|
212
|
+
name: kind === "component" ? assetRef?.assetId || "Component" : kind[0].toUpperCase() + kind.slice(1),
|
|
213
|
+
componentId: kind === "component" ? assetRef?.assetId : void 0,
|
|
214
|
+
assetRef,
|
|
215
|
+
parentId: parent?.id,
|
|
216
|
+
props: {}
|
|
217
|
+
};
|
|
218
|
+
props.onChange({ ...props.session, nodes: [...props.session.nodes, node] });
|
|
219
|
+
setSelectedNodeId(node.id);
|
|
220
|
+
};
|
|
221
|
+
const updateSelected = (patch) => {
|
|
222
|
+
if (!selectedNode) return;
|
|
223
|
+
props.onChange({
|
|
224
|
+
...props.session,
|
|
225
|
+
nodes: props.session.nodes.map((node) => node.id === selectedNode.id ? { ...node, ...patch } : node)
|
|
226
|
+
});
|
|
227
|
+
};
|
|
228
|
+
const removeSelected = () => {
|
|
229
|
+
if (!selectedNode) return;
|
|
230
|
+
props.onChange({
|
|
231
|
+
...props.session,
|
|
232
|
+
nodes: props.session.nodes.filter((node) => node.id !== selectedNode.id && node.parentId !== selectedNode.id)
|
|
233
|
+
});
|
|
234
|
+
setSelectedNodeId(void 0);
|
|
235
|
+
};
|
|
236
|
+
const contextLabel = {
|
|
237
|
+
service: "Service UI",
|
|
238
|
+
"general-component": "General Component",
|
|
239
|
+
application: "Application UI"
|
|
240
|
+
};
|
|
241
|
+
return /* @__PURE__ */ jsxs4("section", { className: "flex h-full min-h-0 flex-col overflow-hidden border border-black/10 bg-white", children: [
|
|
242
|
+
/* @__PURE__ */ jsxs4("header", { className: "flex shrink-0 items-center gap-2 border-b border-black/10 px-3 py-2", children: [
|
|
243
|
+
/* @__PURE__ */ jsxs4("strong", { className: "text-xs", children: [
|
|
244
|
+
contextLabel[props.session.context],
|
|
245
|
+
" Authoring"
|
|
246
|
+
] }),
|
|
247
|
+
/* @__PURE__ */ jsx4("button", { type: "button", onClick: () => addNode("page"), className: "rounded border px-2 py-1 text-xs", children: "Page" }),
|
|
248
|
+
/* @__PURE__ */ jsx4("button", { type: "button", onClick: () => addNode("section"), className: "rounded border px-2 py-1 text-xs", children: "Section" }),
|
|
249
|
+
/* @__PURE__ */ jsxs4(
|
|
250
|
+
"select",
|
|
251
|
+
{
|
|
252
|
+
className: "rounded border px-2 py-1 text-xs",
|
|
253
|
+
value: "",
|
|
254
|
+
onChange: (e) => {
|
|
255
|
+
const asset = props.availableAssets.find((item) => item.assetId === e.target.value);
|
|
256
|
+
if (asset) addNode("component", asset);
|
|
257
|
+
},
|
|
258
|
+
children: [
|
|
259
|
+
/* @__PURE__ */ jsx4("option", { value: "", children: "Add component\u2026" }),
|
|
260
|
+
props.availableAssets.map((asset) => /* @__PURE__ */ jsx4("option", { value: asset.assetId, children: asset.assetId }, asset.assetId))
|
|
261
|
+
]
|
|
262
|
+
}
|
|
263
|
+
),
|
|
264
|
+
/* @__PURE__ */ jsx4("button", { type: "button", disabled: !selectedNode, onClick: removeSelected, className: "ml-auto rounded border px-2 py-1 text-xs disabled:opacity-40", children: "Remove" }),
|
|
265
|
+
/* @__PURE__ */ jsx4("button", { type: "button", onClick: props.onValidate, className: "rounded border px-2 py-1 text-xs", children: "Validate" })
|
|
266
|
+
] }),
|
|
267
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex min-h-0 flex-1", children: [
|
|
268
|
+
/* @__PURE__ */ jsx4(UiAuthoringTree, { nodes: props.session.nodes, selectedNodeId, onSelect: setSelectedNodeId }),
|
|
269
|
+
/* @__PURE__ */ jsx4(UiAuthoringInspector, { node: selectedNode, onChange: updateSelected })
|
|
270
|
+
] }),
|
|
271
|
+
/* @__PURE__ */ jsx4(UiAuthoringBindingEditor, { session: props.session, onChange: props.onChange })
|
|
272
|
+
] });
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
export {
|
|
276
|
+
getAuthoringDepth,
|
|
277
|
+
getAuthoringChildren,
|
|
278
|
+
UiAuthoringTree,
|
|
279
|
+
UiAuthoringInspector,
|
|
280
|
+
UiAuthoringBindingEditor,
|
|
281
|
+
UiAuthoringWorkspace
|
|
282
|
+
};
|
|
@@ -10,7 +10,7 @@ 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, UiAuthoringInspector, UiAuthoringTree, UiAuthoringWorkspace, getAuthoringChildren, getAuthoringDepth } from './authoring/index.js';
|
|
13
|
+
export { AuthoringAssetRef, UIAuthoringContext, UIAuthoringNode, UIAuthoringNodeKind, UIAuthoringSession, UiAuthoringBindingEditor, UiAuthoringInspector, UiAuthoringTree, UiAuthoringWorkspace, getAuthoringChildren, getAuthoringDepth } from './authoring/index.js';
|
|
14
14
|
|
|
15
15
|
interface MidpointWidgetsProps {
|
|
16
16
|
x: number;
|
|
@@ -5,12 +5,13 @@ import {
|
|
|
5
5
|
useTileMenu
|
|
6
6
|
} from "./chunk-SA3JADUG.js";
|
|
7
7
|
import {
|
|
8
|
+
UiAuthoringBindingEditor,
|
|
8
9
|
UiAuthoringInspector,
|
|
9
10
|
UiAuthoringTree,
|
|
10
11
|
UiAuthoringWorkspace,
|
|
11
12
|
getAuthoringChildren,
|
|
12
13
|
getAuthoringDepth
|
|
13
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-GJ472MWX.js";
|
|
14
15
|
import {
|
|
15
16
|
CanvasViewport,
|
|
16
17
|
InfiniteCanvas,
|
|
@@ -26,7 +27,16 @@ import {
|
|
|
26
27
|
MonacoEditor,
|
|
27
28
|
skipoDarkTheme,
|
|
28
29
|
useMonaco
|
|
29
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-5I3TTHDX.js";
|
|
31
|
+
import {
|
|
32
|
+
CanvasContextMenu,
|
|
33
|
+
CompatibleNodePicker,
|
|
34
|
+
FrnlEditableNodeGraph,
|
|
35
|
+
NodeSearchPalette,
|
|
36
|
+
frnlEditableNodeGraphDefinition,
|
|
37
|
+
menuCategory,
|
|
38
|
+
menuHidden
|
|
39
|
+
} from "./chunk-VESG3VP3.js";
|
|
30
40
|
import {
|
|
31
41
|
BIOME_CONFIGS,
|
|
32
42
|
COORD_SCALE,
|
|
@@ -43,20 +53,14 @@ import {
|
|
|
43
53
|
useCanvas2DCoordinates,
|
|
44
54
|
useCanvas2DMagnetic
|
|
45
55
|
} from "./chunk-XVAHT5WE.js";
|
|
46
|
-
import {
|
|
47
|
-
CanvasContextMenu,
|
|
48
|
-
CompatibleNodePicker,
|
|
49
|
-
FrnlEditableNodeGraph,
|
|
50
|
-
NodeSearchPalette,
|
|
51
|
-
frnlEditableNodeGraphDefinition,
|
|
52
|
-
menuCategory,
|
|
53
|
-
menuHidden
|
|
54
|
-
} from "./chunk-VESG3VP3.js";
|
|
55
56
|
import {
|
|
56
57
|
PredictiveGhostNodeCard,
|
|
57
58
|
PredictiveHudToolbar,
|
|
58
59
|
PredictiveLayer2D
|
|
59
60
|
} from "./chunk-RH5NINIT.js";
|
|
61
|
+
import {
|
|
62
|
+
usePredictiveGraph2D
|
|
63
|
+
} from "./chunk-QRYNQ36L.js";
|
|
60
64
|
import {
|
|
61
65
|
NODE_CARD_WIDTH,
|
|
62
66
|
Node2DBase,
|
|
@@ -67,9 +71,6 @@ import {
|
|
|
67
71
|
getSocketScreenPosition,
|
|
68
72
|
renderSpriteIcon
|
|
69
73
|
} from "./chunk-U2SC3RMJ.js";
|
|
70
|
-
import {
|
|
71
|
-
usePredictiveGraph2D
|
|
72
|
-
} from "./chunk-QRYNQ36L.js";
|
|
73
74
|
|
|
74
75
|
// src/node-graph-ui/widgets/MidpointWidgets.tsx
|
|
75
76
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -737,6 +738,7 @@ export {
|
|
|
737
738
|
TileCreateButton,
|
|
738
739
|
TileGrid,
|
|
739
740
|
TriggerNode2D,
|
|
741
|
+
UiAuthoringBindingEditor,
|
|
740
742
|
UiAuthoringInspector,
|
|
741
743
|
UiAuthoringTree,
|
|
742
744
|
UiAuthoringWorkspace,
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
PredictiveHudToolbar,
|
|
4
4
|
PredictiveLayer2D
|
|
5
5
|
} from "../chunk-RH5NINIT.js";
|
|
6
|
-
import "../chunk-U2SC3RMJ.js";
|
|
7
6
|
import {
|
|
8
7
|
usePredictiveGraph2D
|
|
9
8
|
} from "../chunk-QRYNQ36L.js";
|
|
9
|
+
import "../chunk-U2SC3RMJ.js";
|
|
10
10
|
export {
|
|
11
11
|
PredictiveGhostNodeCard,
|
|
12
12
|
PredictiveHudToolbar,
|
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
66
|
"@floks/ui": "workspace:*",
|
|
67
|
-
"@ultrst-armada/frnlts": "^0.2.
|
|
68
|
-
"@ultrst-armada/kloks": "^1.
|
|
67
|
+
"@ultrst-armada/frnlts": "^0.2.7",
|
|
68
|
+
"@ultrst-armada/kloks": "^1.10.2"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"@dnd-kit/core": "^6.0.0",
|
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
BreadcrumbNav,
|
|
4
4
|
HeaderBar,
|
|
5
5
|
TopToolbar
|
|
6
|
-
} from "../../chunk-
|
|
7
|
-
import "../../chunk-GKP6KHTI.js";
|
|
6
|
+
} from "../../chunk-GWW3BGOB.js";
|
|
8
7
|
import "../../chunk-C3L53YN4.js";
|
|
8
|
+
import "../../chunk-GKP6KHTI.js";
|
|
9
9
|
import "../../chunk-62ITRDJX.js";
|
|
10
10
|
import "../../chunk-A2CDQISJ.js";
|
|
11
11
|
export {
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
BreadcrumbNav,
|
|
36
36
|
HeaderBar,
|
|
37
37
|
TopToolbar
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-GWW3BGOB.js";
|
|
39
39
|
import {
|
|
40
40
|
AccountsSettingsSection,
|
|
41
41
|
SettingsTab,
|
|
@@ -165,20 +165,6 @@ import {
|
|
|
165
165
|
import {
|
|
166
166
|
BUILTIN_PALETTES
|
|
167
167
|
} from "./chunk-XXIH2HWI.js";
|
|
168
|
-
import {
|
|
169
|
-
BaseSelect,
|
|
170
|
-
BaseTextarea,
|
|
171
|
-
BaseToggle,
|
|
172
|
-
CredentialField,
|
|
173
|
-
KNOWN_CREDENTIAL_URLS
|
|
174
|
-
} from "./chunk-KIFQA7L6.js";
|
|
175
|
-
import {
|
|
176
|
-
BaseTooltip
|
|
177
|
-
} from "./chunk-GKP6KHTI.js";
|
|
178
|
-
import {
|
|
179
|
-
BaseBadge,
|
|
180
|
-
BaseCard
|
|
181
|
-
} from "./chunk-UOR4P6PO.js";
|
|
182
168
|
import {
|
|
183
169
|
AUTH_PAGE_REQUIRED_SERVICES,
|
|
184
170
|
AuthPage,
|
|
@@ -206,6 +192,20 @@ import {
|
|
|
206
192
|
getFloksFrnlStore,
|
|
207
193
|
useFloksFrnlStore
|
|
208
194
|
} from "./chunk-X4B3EBMY.js";
|
|
195
|
+
import {
|
|
196
|
+
BaseSelect,
|
|
197
|
+
BaseTextarea,
|
|
198
|
+
BaseToggle,
|
|
199
|
+
CredentialField,
|
|
200
|
+
KNOWN_CREDENTIAL_URLS
|
|
201
|
+
} from "./chunk-KIFQA7L6.js";
|
|
202
|
+
import {
|
|
203
|
+
BaseTooltip
|
|
204
|
+
} from "./chunk-GKP6KHTI.js";
|
|
205
|
+
import {
|
|
206
|
+
BaseBadge,
|
|
207
|
+
BaseCard
|
|
208
|
+
} from "./chunk-UOR4P6PO.js";
|
|
209
209
|
import {
|
|
210
210
|
BaseInput
|
|
211
211
|
} from "./chunk-W42SJGOJ.js";
|
package/packages/ui/package.json
CHANGED
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
// src/authoring/authoringModel.ts
|
|
2
|
-
function getAuthoringDepth(node, nodes) {
|
|
3
|
-
let depth = 0;
|
|
4
|
-
let parentId = node.parentId;
|
|
5
|
-
while (parentId) {
|
|
6
|
-
const parent = nodes.find((item) => item.id === parentId);
|
|
7
|
-
if (!parent) break;
|
|
8
|
-
depth += 1;
|
|
9
|
-
parentId = parent.parentId;
|
|
10
|
-
}
|
|
11
|
-
return depth;
|
|
12
|
-
}
|
|
13
|
-
function getAuthoringChildren(nodeId, nodes) {
|
|
14
|
-
return nodes.filter((node) => node.parentId === nodeId);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// src/authoring/UiAuthoringTree.tsx
|
|
18
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
|
-
function UiAuthoringTree(props) {
|
|
20
|
-
return /* @__PURE__ */ jsxs("div", { className: "min-h-0 flex-1 overflow-auto", children: [
|
|
21
|
-
props.nodes.map((node) => /* @__PURE__ */ jsxs(
|
|
22
|
-
"button",
|
|
23
|
-
{
|
|
24
|
-
type: "button",
|
|
25
|
-
onClick: () => props.onSelect(node.id),
|
|
26
|
-
className: `flex w-full items-center gap-2 border-b border-black/10 px-2 py-1.5 text-left text-xs ${props.selectedNodeId === node.id ? "bg-black/10" : ""}`,
|
|
27
|
-
style: { paddingLeft: 8 + getAuthoringDepth(node, props.nodes) * 14 },
|
|
28
|
-
children: [
|
|
29
|
-
/* @__PURE__ */ jsx("span", { className: "font-semibold", children: node.name }),
|
|
30
|
-
/* @__PURE__ */ jsx("span", { className: "ml-auto opacity-50", children: node.kind })
|
|
31
|
-
]
|
|
32
|
-
},
|
|
33
|
-
node.id
|
|
34
|
-
)),
|
|
35
|
-
!props.nodes.length && /* @__PURE__ */ jsx("div", { className: "p-4 text-xs opacity-60", children: "No authored nodes." })
|
|
36
|
-
] });
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// src/authoring/UiAuthoringInspector.tsx
|
|
40
|
-
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
41
|
-
function UiAuthoringInspector(props) {
|
|
42
|
-
if (!props.node) return /* @__PURE__ */ jsx2("aside", { className: "w-72 border-l border-black/10 p-3 text-xs opacity-60", children: "Select a node." });
|
|
43
|
-
const description = String(props.node.props.description || "");
|
|
44
|
-
return /* @__PURE__ */ jsxs2("aside", { className: "w-72 border-l border-black/10 p-3", children: [
|
|
45
|
-
/* @__PURE__ */ jsx2("div", { className: "mb-3 text-xs font-bold uppercase tracking-wide", children: props.node.kind }),
|
|
46
|
-
/* @__PURE__ */ jsxs2("label", { className: "block text-xs", children: [
|
|
47
|
-
"Name",
|
|
48
|
-
/* @__PURE__ */ jsx2("input", { className: "mt-1 w-full rounded border px-2 py-1.5", value: props.node.name, onChange: (e) => props.onChange({ name: e.target.value }) })
|
|
49
|
-
] }),
|
|
50
|
-
/* @__PURE__ */ jsxs2("label", { className: "mt-3 block text-xs", children: [
|
|
51
|
-
"Description",
|
|
52
|
-
/* @__PURE__ */ jsx2("textarea", { className: "mt-1 min-h-20 w-full rounded border px-2 py-1.5", value: description, onChange: (e) => props.onChange({ props: { ...props.node?.props, description: e.target.value } }) })
|
|
53
|
-
] })
|
|
54
|
-
] });
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// src/authoring/UiAuthoringWorkspace.tsx
|
|
58
|
-
import React from "react";
|
|
59
|
-
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
60
|
-
function UiAuthoringWorkspace(props) {
|
|
61
|
-
const [selectedNodeId, setSelectedNodeId] = React.useState();
|
|
62
|
-
const selectedNode = props.session.nodes.find((node) => node.id === selectedNodeId);
|
|
63
|
-
const addNode = (kind, assetRef) => {
|
|
64
|
-
const parent = kind === "section" ? props.session.nodes.find((node2) => node2.kind === "page") : kind === "component" ? props.session.nodes.find((node2) => node2.kind === "section") : void 0;
|
|
65
|
-
const node = {
|
|
66
|
-
id: `authoring-${kind}-${Date.now().toString(36)}`,
|
|
67
|
-
kind,
|
|
68
|
-
name: kind === "component" ? assetRef?.assetId || "Component" : kind[0].toUpperCase() + kind.slice(1),
|
|
69
|
-
componentId: kind === "component" ? assetRef?.assetId : void 0,
|
|
70
|
-
assetRef,
|
|
71
|
-
parentId: parent?.id,
|
|
72
|
-
props: {}
|
|
73
|
-
};
|
|
74
|
-
props.onChange({ ...props.session, nodes: [...props.session.nodes, node] });
|
|
75
|
-
setSelectedNodeId(node.id);
|
|
76
|
-
};
|
|
77
|
-
const updateSelected = (patch) => {
|
|
78
|
-
if (!selectedNode) return;
|
|
79
|
-
props.onChange({
|
|
80
|
-
...props.session,
|
|
81
|
-
nodes: props.session.nodes.map((node) => node.id === selectedNode.id ? { ...node, ...patch } : node)
|
|
82
|
-
});
|
|
83
|
-
};
|
|
84
|
-
const removeSelected = () => {
|
|
85
|
-
if (!selectedNode) return;
|
|
86
|
-
props.onChange({
|
|
87
|
-
...props.session,
|
|
88
|
-
nodes: props.session.nodes.filter((node) => node.id !== selectedNode.id && node.parentId !== selectedNode.id)
|
|
89
|
-
});
|
|
90
|
-
setSelectedNodeId(void 0);
|
|
91
|
-
};
|
|
92
|
-
const contextLabel = {
|
|
93
|
-
service: "Service UI",
|
|
94
|
-
"general-component": "General Component",
|
|
95
|
-
application: "Application UI"
|
|
96
|
-
};
|
|
97
|
-
return /* @__PURE__ */ jsxs3("section", { className: "flex h-full min-h-0 flex-col overflow-hidden border border-black/10 bg-white", children: [
|
|
98
|
-
/* @__PURE__ */ jsxs3("header", { className: "flex shrink-0 items-center gap-2 border-b border-black/10 px-3 py-2", children: [
|
|
99
|
-
/* @__PURE__ */ jsxs3("strong", { className: "text-xs", children: [
|
|
100
|
-
contextLabel[props.session.context],
|
|
101
|
-
" Authoring"
|
|
102
|
-
] }),
|
|
103
|
-
/* @__PURE__ */ jsx3("button", { type: "button", onClick: () => addNode("page"), className: "rounded border px-2 py-1 text-xs", children: "Page" }),
|
|
104
|
-
/* @__PURE__ */ jsx3("button", { type: "button", onClick: () => addNode("section"), className: "rounded border px-2 py-1 text-xs", children: "Section" }),
|
|
105
|
-
/* @__PURE__ */ jsxs3(
|
|
106
|
-
"select",
|
|
107
|
-
{
|
|
108
|
-
className: "rounded border px-2 py-1 text-xs",
|
|
109
|
-
value: "",
|
|
110
|
-
onChange: (e) => {
|
|
111
|
-
const asset = props.availableAssets.find((item) => item.assetId === e.target.value);
|
|
112
|
-
if (asset) addNode("component", asset);
|
|
113
|
-
},
|
|
114
|
-
children: [
|
|
115
|
-
/* @__PURE__ */ jsx3("option", { value: "", children: "Add component\u2026" }),
|
|
116
|
-
props.availableAssets.map((asset) => /* @__PURE__ */ jsx3("option", { value: asset.assetId, children: asset.assetId }, asset.assetId))
|
|
117
|
-
]
|
|
118
|
-
}
|
|
119
|
-
),
|
|
120
|
-
/* @__PURE__ */ jsx3("button", { type: "button", disabled: !selectedNode, onClick: removeSelected, className: "ml-auto rounded border px-2 py-1 text-xs disabled:opacity-40", children: "Remove" }),
|
|
121
|
-
/* @__PURE__ */ jsx3("button", { type: "button", onClick: props.onValidate, className: "rounded border px-2 py-1 text-xs", children: "Validate" })
|
|
122
|
-
] }),
|
|
123
|
-
/* @__PURE__ */ jsxs3("div", { className: "flex min-h-0 flex-1", children: [
|
|
124
|
-
/* @__PURE__ */ jsx3(UiAuthoringTree, { nodes: props.session.nodes, selectedNodeId, onSelect: setSelectedNodeId }),
|
|
125
|
-
/* @__PURE__ */ jsx3(UiAuthoringInspector, { node: selectedNode, onChange: updateSelected })
|
|
126
|
-
] })
|
|
127
|
-
] });
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
export {
|
|
131
|
-
getAuthoringDepth,
|
|
132
|
-
getAuthoringChildren,
|
|
133
|
-
UiAuthoringTree,
|
|
134
|
-
UiAuthoringInspector,
|
|
135
|
-
UiAuthoringWorkspace
|
|
136
|
-
};
|