@ultrst-armada/floks 1.13.21 → 1.14.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.
- package/.krusbl-release-attestation.json +3 -3
- package/package.json +8 -7
- package/packages/canvas-ui/dist/MovableSocketView.d.ts +1 -1
- package/packages/canvas-ui/dist/NodeCard.d.ts +1 -1
- package/packages/canvas-ui/dist/NodeDetailsPanel.d.ts +1 -1
- package/packages/canvas-ui/dist/NodeGraphCanvas.d.ts +1 -1
- package/packages/canvas-ui/dist/Viewer2DNodes.d.ts +1 -1
- package/packages/canvas-ui/dist/WireRenderer.d.ts +1 -1
- package/packages/canvas-ui/dist/authoring/UiAuthoringValidationPanel.d.ts +1 -1
- package/packages/canvas-ui/dist/{chunk-RH5NINIT.js → chunk-A7BSZ5QO.js} +28 -103
- package/packages/canvas-ui/dist/chunk-FPRATI44.js +45 -0
- package/packages/canvas-ui/dist/{chunk-ZJXRL74D.js → chunk-KAKAFGVH.js} +22 -16
- package/packages/canvas-ui/dist/{chunk-YHEIL67R.js → chunk-SRGVIYC5.js} +6 -6
- package/packages/canvas-ui/dist/{chunk-7CYX3B6O.js → chunk-TKOMIUCU.js} +1 -1
- package/packages/canvas-ui/dist/{chunk-XVAHT5WE.js → chunk-ZDADZVQ2.js} +363 -59
- package/packages/canvas-ui/dist/{chunk-QRYNQ36L.js → chunk-ZSVXR3HU.js} +1 -1
- package/packages/canvas-ui/dist/editor/MonacoEditor.d.ts +1 -1
- package/packages/canvas-ui/dist/editor/index.js +1 -1
- package/packages/canvas-ui/dist/fod/index.js +3 -3
- package/packages/canvas-ui/dist/frnl-editable-node-graph/FrnlEditableNodeGraph.d.ts +1 -1
- package/packages/canvas-ui/dist/frnl-editable-node-graph/index.js +2 -2
- package/packages/canvas-ui/dist/graph-2d/CanvasBackground2D.d.ts +1 -1
- package/packages/canvas-ui/dist/graph-2d/MagneticTraces2D.d.ts +2 -2
- package/packages/canvas-ui/dist/graph-2d/Node2DBase.d.ts +3 -3
- package/packages/canvas-ui/dist/graph-2d/NodeRenderer2D.d.ts +3 -3
- package/packages/canvas-ui/dist/graph-2d/RecorderWaveformDisplay.d.ts +1 -1
- package/packages/canvas-ui/dist/graph-2d/Socket2D.d.ts +1 -1
- package/packages/canvas-ui/dist/graph-2d/Wire2D.d.ts +1 -1
- package/packages/canvas-ui/dist/graph-2d/index.js +9 -9
- package/packages/canvas-ui/dist/graph-2d/socketCoordinates.d.ts +1 -1
- package/packages/canvas-ui/dist/graph-2d/types.d.ts +1 -1
- package/packages/canvas-ui/dist/graph-2d/useCanvas2DMagnetic.d.ts +4 -4
- package/packages/canvas-ui/dist/index.js +38 -38
- package/packages/canvas-ui/dist/node-graph-ui/ghost/GhostNodeCard.d.ts +1 -1
- package/packages/canvas-ui/dist/node-graph-ui/ghost/GhostSolidifyBar.d.ts +1 -1
- package/packages/canvas-ui/dist/node-graph-ui/ghost/GhostTraceLayer.d.ts +1 -1
- package/packages/canvas-ui/dist/node-graph-ui/react-flow/ReactFlowAdapter.d.ts +4 -4
- package/packages/canvas-ui/dist/node-graph-ui/toolbar/GraphToolbar.d.ts +1 -1
- package/packages/canvas-ui/dist/node-graph-ui/widgets/CanvasContextMenu.d.ts +1 -1
- package/packages/canvas-ui/dist/node-graph-ui/widgets/CompatibleNodePicker.d.ts +1 -1
- package/packages/canvas-ui/dist/node-graph-ui/widgets/MagneticTraceLayer.d.ts +1 -1
- package/packages/canvas-ui/dist/node-graph-ui/widgets/NodeSearchPalette.d.ts +1 -1
- package/packages/canvas-ui/dist/predictive/PredictiveGhostNodeCard/PredictiveGhostNodeCard.d.ts +2 -2
- package/packages/canvas-ui/dist/predictive/PredictiveGhostNodeCard/types.d.ts +1 -1
- package/packages/canvas-ui/dist/predictive/PredictiveLayer2D.d.ts +1 -2
- package/packages/canvas-ui/dist/predictive/index.js +3 -3
- package/packages/canvas-ui/dist/predictive/usePredictiveGraph2D.d.ts +4 -5
- package/packages/canvas-ui/dist/useGhostRouting.d.ts +1 -1
- package/packages/canvas-ui/dist/useNodeGraph.d.ts +1 -1
- package/packages/canvas-ui/package.json +5 -6
- package/packages/contracts/dist/index.d.ts +396 -1
- package/packages/contracts/dist/index.js +201 -1
- package/packages/contracts/dist/state-graph.d.ts +456 -0
- package/packages/contracts/dist/state-graph.js +282 -0
- package/packages/contracts/package.json +6 -1
- package/packages/ui/dist/{chunk-3YYPBZS2.js → chunk-W6ENIFEW.js} +3 -3
- package/packages/ui/dist/components/auth/LuthAuthClient.d.ts +4 -4
- package/packages/ui/dist/components/auth/index.js +1 -1
- package/packages/ui/dist/components/auth/luthAuthTypes.d.ts +2 -2
- package/packages/ui/dist/index.js +1 -1
- package/packages/ui/package.json +3 -3
- package/packages/canvas-ui/dist/chunk-U2SC3RMJ.js +0 -391
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": 1,
|
|
3
3
|
"packageName": "@ultrst-armada/floks",
|
|
4
|
-
"version": "1.
|
|
5
|
-
"sourceCommit": "
|
|
4
|
+
"version": "1.14.0",
|
|
5
|
+
"sourceCommit": "6645f259f2a8c2710df1fc5c60f21ad718c34581",
|
|
6
6
|
"releaseWorkflow": "npm Release",
|
|
7
|
-
"workflowRunId": "
|
|
7
|
+
"workflowRunId": "42669473376"
|
|
8
8
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultrst-armada/floks",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.14.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -86,17 +86,18 @@
|
|
|
86
86
|
"postbuild": "node -e \"import('fs').then(fs => { for (const pkg of fs.readdirSync('packages')) { const d = 'packages/' + pkg + '/dist'; if (!fs.existsSync(d)) continue; for (const f of fs.readdirSync(d, { recursive: true })) { const p = d + '/' + f; if (fs.statSync(p).isFile() && (p.endsWith('.js') || p.endsWith('.d.ts'))) { const c = fs.readFileSync(p, 'utf8'); const n = c.replaceAll('@kloks/', '@ultrst-armada/kloks/').replaceAll('@floks/', '@ultrst-armada/floks/').replaceAll('@ultrst/kloks/', '@ultrst-armada/kloks/').replaceAll('@ultrst/floks/', '@ultrst-armada/floks/').replaceAll('\\\"kloks/', '\\\"@ultrst-armada/kloks/').replaceAll('\\'kloks/', '\\'@ultrst-armada/kloks/').replaceAll('\\\"floks/', '\\\"@ultrst-armada/floks/').replaceAll('\\'floks/', '\\'@ultrst-armada/floks/'); if (c !== n) fs.writeFileSync(p, n); } } } })\"",
|
|
87
87
|
"test": "vitest run",
|
|
88
88
|
"typecheck": "pnpm -r run typecheck",
|
|
89
|
-
"clean": "pnpm -r run clean"
|
|
89
|
+
"clean": "pnpm -r run clean",
|
|
90
|
+
"boundary": "node scripts/architecture-boundary.mjs",
|
|
91
|
+
"boundary:clean-room": "node scripts/clean-room-boundary.mjs",
|
|
92
|
+
"boundary:relative": "node scripts/relative-package-boundary.mjs"
|
|
90
93
|
},
|
|
91
94
|
"dependencies": {
|
|
92
|
-
"@ultrst-armada/frnlts": "^0.5.
|
|
95
|
+
"@ultrst-armada/frnlts": "^0.5.7",
|
|
93
96
|
"@xyflow/react": "^12.8.6",
|
|
94
97
|
"d3-force": "^3.0.0",
|
|
95
98
|
"zod": "^3.24.1",
|
|
96
99
|
"zustand": "^5.0.3",
|
|
97
|
-
"@
|
|
98
|
-
"@ultrst-armada/krnl": "^1.0.13",
|
|
99
|
-
"@dinilmusick/gutts": "^1.6.0"
|
|
100
|
+
"@dinilmusick/gutts": "^2.0.2"
|
|
100
101
|
},
|
|
101
102
|
"peerDependencies": {
|
|
102
103
|
"lucide-react": ">=0.300.0",
|
|
@@ -109,7 +110,7 @@
|
|
|
109
110
|
"@types/node": "^22.0.0",
|
|
110
111
|
"@types/react": "^19.0.0",
|
|
111
112
|
"@types/react-dom": "^19.0.0",
|
|
112
|
-
"@ultrst-armada/frnlts": "^0.5.
|
|
113
|
+
"@ultrst-armada/frnlts": "^0.5.7",
|
|
113
114
|
"happy-dom": "^21.0.3",
|
|
114
115
|
"lucide-react": "^1.55.0",
|
|
115
116
|
"react": "^19.0.1",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import type { GraphNode, GraphEdge, NodeGraphConfig, ViewportState, NodeDefinition } from '@ultrst-armada/
|
|
2
|
+
import type { GraphNode, GraphEdge, NodeGraphConfig, ViewportState, NodeDefinition } from '@ultrst-armada/floks/contracts';
|
|
3
3
|
export interface NodeGraphCanvasProps {
|
|
4
4
|
nodes: GraphNode[];
|
|
5
5
|
edges: GraphEdge[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { UIAuthoringValidation } from '@ultrst-armada/
|
|
2
|
+
import type { UIAuthoringValidation } from '@ultrst-armada/floks/contracts';
|
|
3
3
|
export declare function UiAuthoringValidationPanel(props: {
|
|
4
4
|
validation?: UIAuthoringValidation;
|
|
5
5
|
status?: string;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
renderSpriteIcon
|
|
5
|
-
} from "./chunk-U2SC3RMJ.js";
|
|
2
|
+
getSocketScreenPosition
|
|
3
|
+
} from "./chunk-FPRATI44.js";
|
|
6
4
|
|
|
7
5
|
// src/predictive/PredictiveGhostNodeCard/PredictiveGhostNodeCard.tsx
|
|
8
6
|
import { Zap } from "lucide-react";
|
|
9
|
-
import { getNodeSockets } from "@ultrst-armada/kloks/state-graph";
|
|
10
|
-
import { NodeAssetRegistry } from "@ultrst-armada/kloks/state-graph";
|
|
11
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
8
|
var PredictiveGhostNodeCard = ({
|
|
13
9
|
ghost,
|
|
@@ -18,118 +14,49 @@ var PredictiveGhostNodeCard = ({
|
|
|
18
14
|
onHoverChange
|
|
19
15
|
}) => {
|
|
20
16
|
const node = ghost.prototypeNode;
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const isStandardRecorder = node.type === "recorder" && !isRetroRecorder;
|
|
25
|
-
const isContainer = node.type === "container";
|
|
26
|
-
const isButton = node.type === "button";
|
|
27
|
-
const isTrigger = node.type === "trigger";
|
|
28
|
-
const isTriggerFractions = isTrigger && node.triggerType === "beat_fractions";
|
|
29
|
-
const isStringNode = node.type === "primitive_string";
|
|
30
|
-
const isNumberNode = node.type === "primitive_number";
|
|
31
|
-
const isBooleanNode = node.type === "primitive_boolean";
|
|
32
|
-
const isObjectNode = node.type === "primitive_object";
|
|
33
|
-
const isFolderPathNode = node.type === "folder_path";
|
|
34
|
-
const triggerWidth = isTriggerFractions ? "w-[260px]" : "w-[170px]";
|
|
35
|
-
const cardWidthClass = isTrigger ? triggerWidth : isRetroRecorder ? "w-[200px]" : isStandardRecorder ? "w-[165px]" : isContainer ? "w-[190px]" : isFolderPathNode || isObjectNode ? "w-[180px]" : isStringNode ? "w-[165px]" : isNumberNode ? "w-[145px]" : isBooleanNode ? "w-[130px]" : isButton ? "w-[100px] h-[100px]" : "w-[130px]";
|
|
36
|
-
const maxSockets = Math.max(inputs.length, outputs.length);
|
|
37
|
-
const dynamicMinHeight = isButton ? "100px" : maxSockets > 1 ? `${Math.max(64, maxSockets * 32 + 10)}px` : "64px";
|
|
17
|
+
const inputs = Array.isArray(node.inputs) ? node.inputs : [];
|
|
18
|
+
const outputs = Array.isArray(node.outputs) ? node.outputs : [];
|
|
19
|
+
const scale = Math.max(0.65, Math.min(1.15, zoom));
|
|
38
20
|
return /* @__PURE__ */ jsx(
|
|
39
21
|
"div",
|
|
40
22
|
{
|
|
41
23
|
style: {
|
|
42
24
|
position: "absolute",
|
|
43
|
-
left:
|
|
44
|
-
top:
|
|
45
|
-
transform: `translate(-50%, -50%) scale(${
|
|
46
|
-
transformOrigin: "center center"
|
|
25
|
+
left: screenPos.x,
|
|
26
|
+
top: screenPos.y,
|
|
27
|
+
transform: `translate(-50%, -50%) scale(${scale})`
|
|
47
28
|
},
|
|
48
|
-
className: "pointer-events-auto z-30 select-none
|
|
29
|
+
className: "pointer-events-auto z-30 select-none",
|
|
49
30
|
onMouseEnter: () => onHoverChange?.(true),
|
|
50
31
|
onMouseLeave: () => onHoverChange?.(false),
|
|
51
32
|
children: /* @__PURE__ */ jsxs(
|
|
52
33
|
"div",
|
|
53
34
|
{
|
|
54
|
-
className: `relative
|
|
55
|
-
style: { minHeight: dynamicMinHeight },
|
|
35
|
+
className: `relative w-[170px] min-h-[76px] rounded-lg bg-slate-950/70 backdrop-blur-md border-2 border-dashed border-cyan-400/70 p-2 flex flex-col items-center justify-center ${isHovered ? "border-cyan-200 shadow-[0_0_30px_rgba(56,189,248,0.5)]" : "shadow-[0_0_18px_rgba(56,189,248,0.25)]"}`,
|
|
56
36
|
children: [
|
|
57
|
-
/* @__PURE__ */ jsxs("div", { className: "w-full flex items-center justify-between pb-1 border-b border-cyan-500/20 text-[8px] font-mono
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
] }),
|
|
62
|
-
/* @__PURE__ */ jsxs("span", { className: "text-cyan-400/60 font-bold", children: [
|
|
63
|
-
"[",
|
|
37
|
+
/* @__PURE__ */ jsxs("div", { className: "w-full flex items-center justify-between pb-1 border-b border-cyan-500/20 text-[8px] font-mono text-cyan-300/80", children: [
|
|
38
|
+
/* @__PURE__ */ jsx("span", { className: "font-extrabold uppercase truncate max-w-[120px]", children: node.name || ghost.label }),
|
|
39
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
40
|
+
"[$",
|
|
64
41
|
ghost.candidateIndex + 1,
|
|
65
|
-
"
|
|
42
|
+
"/$",
|
|
66
43
|
ghost.totalCandidates,
|
|
67
44
|
"]"
|
|
68
45
|
] })
|
|
69
46
|
] }),
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
" CONTAINER"
|
|
76
|
-
] })
|
|
77
|
-
] }),
|
|
78
|
-
/* @__PURE__ */ jsx("div", { className: "w-full h-4 rounded bg-cyan-950/40 border border-cyan-500/20 flex items-center justify-around px-1", children: [...Array(6)].map((_, i) => /* @__PURE__ */ jsx("div", { className: "w-1.5 rounded-sm bg-cyan-400/40", style: { height: `${30 + i % 3 * 30}%` } }, i)) })
|
|
79
|
-
] }) : isStandardRecorder || isRetroRecorder ? /* @__PURE__ */ jsxs("div", { className: "w-full py-1.5 flex flex-col items-center gap-1", children: [
|
|
80
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
81
|
-
renderSpriteIcon(sprite.iconName, "#f43f5e", "w-4 h-4"),
|
|
82
|
-
/* @__PURE__ */ jsx("span", { className: "text-[9px] font-mono font-bold text-rose-300", children: isRetroRecorder ? "RETRO RECORDER" : "LIVE RECORDER" })
|
|
83
|
-
] }),
|
|
84
|
-
/* @__PURE__ */ jsx("div", { className: "w-full h-3 rounded bg-rose-950/30 border border-rose-500/20 flex items-center px-1", children: /* @__PURE__ */ jsx("div", { className: "w-2/3 h-1.5 rounded-sm bg-rose-500/50 animate-pulse" }) })
|
|
85
|
-
] }) : isTrigger ? /* @__PURE__ */ jsxs("div", { className: "w-full py-1 flex flex-col items-center gap-1", children: [
|
|
86
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
87
|
-
renderSpriteIcon(sprite.iconName, "#eab308", "w-3.5 h-3.5"),
|
|
88
|
-
/* @__PURE__ */ jsx("span", { className: "text-[9px] font-mono font-bold text-amber-300", children: "STEP SEQUENCER" })
|
|
89
|
-
] }),
|
|
90
|
-
/* @__PURE__ */ jsx("div", { className: "flex gap-1", children: [...Array(8)].map((_, i) => /* @__PURE__ */ jsx("div", { className: `w-2 h-2 rounded-sm border ${i % 2 === 0 ? "bg-amber-400/60 border-amber-300" : "bg-slate-900 border-amber-500/30"}` }, i)) })
|
|
91
|
-
] }) : isButton ? /* @__PURE__ */ jsx("div", { className: "flex flex-col items-center justify-center my-auto", children: /* @__PURE__ */ jsx("div", { className: "w-8 h-8 rounded-full border border-emerald-400/60 bg-emerald-950/30 flex items-center justify-center", children: /* @__PURE__ */ jsx("div", { className: "w-3 h-3 rounded-full bg-emerald-400/80 animate-pulse" }) }) }) : isStringNode || isNumberNode || isBooleanNode || isObjectNode || isFolderPathNode ? /* @__PURE__ */ jsxs("div", { className: "w-full py-1 flex flex-col items-center gap-0.5 text-center", children: [
|
|
92
|
-
/* @__PURE__ */ jsx("span", { className: "text-[10px] font-mono font-bold text-cyan-200 truncate", children: ghost.label }),
|
|
93
|
-
/* @__PURE__ */ jsx("span", { className: "text-[8px] font-mono text-cyan-400/60", children: ghost.badge })
|
|
94
|
-
] }) : /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center py-1.5 text-center", children: [
|
|
95
|
-
renderSpriteIcon(sprite.iconName, sprite.accentColor || "#38bdf8", "w-6 h-6"),
|
|
96
|
-
/* @__PURE__ */ jsx("span", { className: "text-[9px] font-mono font-bold text-cyan-200 mt-1 truncate max-w-[110px]", children: node.name || ghost.label })
|
|
47
|
+
/* @__PURE__ */ jsx("span", { className: "text-[10px] font-mono font-bold text-cyan-200 mt-2 truncate max-w-[140px]", children: ghost.label }),
|
|
48
|
+
/* @__PURE__ */ jsxs("span", { className: "text-[8px] font-mono text-cyan-400/60", children: [
|
|
49
|
+
ghost.badge,
|
|
50
|
+
" \xB7 ",
|
|
51
|
+
node.type
|
|
97
52
|
] }),
|
|
98
53
|
inputs.map((socket, idx) => {
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
return /* @__PURE__ */ jsx(
|
|
102
|
-
"div",
|
|
103
|
-
{
|
|
104
|
-
style: {
|
|
105
|
-
position: "absolute",
|
|
106
|
-
left: `calc(50% + ${localPos.x}px)`,
|
|
107
|
-
top: `calc(50% + ${localPos.y}px)`,
|
|
108
|
-
transform: "translate(-50%, -50%)"
|
|
109
|
-
},
|
|
110
|
-
className: `w-2.5 h-2.5 rounded-full border ${isTargetMatching ? "bg-cyan-400 border-white shadow-[0_0_10px_#38bdf8] scale-125" : "bg-cyan-950 border-cyan-500/60"}`,
|
|
111
|
-
title: `Input: ${socket.label}`
|
|
112
|
-
},
|
|
113
|
-
socket.socketId
|
|
114
|
-
);
|
|
54
|
+
const local = { x: -82, y: (idx + 1) * 56 / (inputs.length + 1) - 28 };
|
|
55
|
+
return /* @__PURE__ */ jsx("span", { style: { left: `calc(50% + ${local.x}px)`, top: `calc(50% + ${local.y}px)` }, className: "absolute w-2.5 h-2.5 rounded-full border bg-cyan-950 border-cyan-500/60", title: `Input: ${socket.label}` }, socket.id);
|
|
115
56
|
}),
|
|
116
57
|
outputs.map((socket, idx) => {
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
return /* @__PURE__ */ jsx(
|
|
120
|
-
"div",
|
|
121
|
-
{
|
|
122
|
-
style: {
|
|
123
|
-
position: "absolute",
|
|
124
|
-
left: `calc(50% + ${localPos.x}px)`,
|
|
125
|
-
top: `calc(50% + ${localPos.y}px)`,
|
|
126
|
-
transform: "translate(-50%, -50%)"
|
|
127
|
-
},
|
|
128
|
-
className: `w-2.5 h-2.5 rounded-full border ${isTargetMatching ? "bg-cyan-400 border-white shadow-[0_0_10px_#38bdf8] scale-125" : "bg-cyan-950 border-cyan-500/60"}`,
|
|
129
|
-
title: `Output: ${socket.label}`
|
|
130
|
-
},
|
|
131
|
-
socket.socketId
|
|
132
|
-
);
|
|
58
|
+
const local = { x: 82, y: (idx + 1) * 56 / (outputs.length + 1) - 28 };
|
|
59
|
+
return /* @__PURE__ */ jsx("span", { style: { left: `calc(50% + ${local.x}px)`, top: `calc(50% + ${local.y}px)` }, className: "absolute w-2.5 h-2.5 rounded-full border bg-cyan-950 border-cyan-500/60", title: `Output: ${socket.label}` }, socket.id);
|
|
133
60
|
}),
|
|
134
61
|
/* @__PURE__ */ jsx(
|
|
135
62
|
"button",
|
|
@@ -138,17 +65,15 @@ var PredictiveGhostNodeCard = ({
|
|
|
138
65
|
e.stopPropagation();
|
|
139
66
|
e.preventDefault();
|
|
140
67
|
},
|
|
141
|
-
onPointerDown: (e) =>
|
|
142
|
-
e.stopPropagation();
|
|
143
|
-
},
|
|
68
|
+
onPointerDown: (e) => e.stopPropagation(),
|
|
144
69
|
onClick: (e) => {
|
|
145
70
|
e.stopPropagation();
|
|
146
71
|
e.preventDefault();
|
|
147
72
|
onSolidify(ghost);
|
|
148
73
|
},
|
|
149
|
-
className: "absolute -top-3 -right-3 z-40 w-7 h-7 rounded-full bg-slate-950/95 border-2 border-cyan-400 text-cyan-300 hover:bg-cyan-900 hover:text-white hover:border-cyan-200 hover:scale-125 shadow-[0_0_15px_rgba(6,182,212,0.8)] flex items-center justify-center transition-all cursor-pointer
|
|
150
|
-
title: `Solidify ${
|
|
151
|
-
children: /* @__PURE__ */ jsx(Zap, { className: "w-3.5 h-3.5
|
|
74
|
+
className: "absolute -top-3 -right-3 z-40 w-7 h-7 rounded-full bg-slate-950/95 border-2 border-cyan-400 text-cyan-300 hover:bg-cyan-900 hover:text-white hover:border-cyan-200 hover:scale-125 shadow-[0_0_15px_rgba(6,182,212,0.8)] flex items-center justify-center transition-all cursor-pointer",
|
|
75
|
+
title: `Solidify ${ghost.label}`,
|
|
76
|
+
children: /* @__PURE__ */ jsx(Zap, { className: "w-3.5 h-3.5" })
|
|
152
77
|
}
|
|
153
78
|
)
|
|
154
79
|
]
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// src/graph-2d/socketCoordinates.ts
|
|
2
|
+
import { getNodeSockets } from "@ultrst-armada/floks/contracts";
|
|
3
|
+
import { GraphNodeParent } from "@ultrst-armada/floks/contracts";
|
|
4
|
+
function getSocketLocalOffset(node, socketId, isOutput, index, totalSockets) {
|
|
5
|
+
const isCustomBox = node.type === "arrangement" || node.type === "code";
|
|
6
|
+
const clearance = isCustomBox ? 16 : 14;
|
|
7
|
+
return GraphNodeParent.calculateConstrainedSocketOffset(
|
|
8
|
+
node,
|
|
9
|
+
socketId,
|
|
10
|
+
isOutput,
|
|
11
|
+
index,
|
|
12
|
+
totalSockets,
|
|
13
|
+
clearance
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
function getSocketScreenPosition(node, socketId, isOutput, worldToScreen, camera) {
|
|
17
|
+
const center = worldToScreen(node.position[0], node.position[2]);
|
|
18
|
+
const { inputs, outputs } = getNodeSockets(node);
|
|
19
|
+
const sockets = isOutput ? outputs : inputs;
|
|
20
|
+
if (sockets.length === 0) {
|
|
21
|
+
return center;
|
|
22
|
+
}
|
|
23
|
+
let idx = -1;
|
|
24
|
+
if (socketId) {
|
|
25
|
+
idx = sockets.findIndex((s) => s.socketId === socketId);
|
|
26
|
+
}
|
|
27
|
+
const validIdx = idx >= 0 ? idx : 0;
|
|
28
|
+
const targetSocket = sockets[validIdx];
|
|
29
|
+
const localOffset = getSocketLocalOffset(
|
|
30
|
+
node,
|
|
31
|
+
targetSocket.socketId,
|
|
32
|
+
isOutput,
|
|
33
|
+
validIdx,
|
|
34
|
+
sockets.length
|
|
35
|
+
);
|
|
36
|
+
return {
|
|
37
|
+
x: center.x + localOffset.x * camera.zoom,
|
|
38
|
+
y: center.y + localOffset.y * camera.zoom
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export {
|
|
43
|
+
getSocketLocalOffset,
|
|
44
|
+
getSocketScreenPosition
|
|
45
|
+
};
|
|
@@ -50,7 +50,6 @@ function useMonaco() {
|
|
|
50
50
|
|
|
51
51
|
// src/editor/MonacoEditor.tsx
|
|
52
52
|
import { useEffect as useEffect2, useMemo, useRef, useState as useState2 } from "react";
|
|
53
|
-
import { MonacoIdeServiceFacade } from "@ultrst-armada/kloks/services";
|
|
54
53
|
import { jsx } from "react/jsx-runtime";
|
|
55
54
|
function MonacoEditor({
|
|
56
55
|
value,
|
|
@@ -75,7 +74,7 @@ function MonacoEditor({
|
|
|
75
74
|
const sessionRef = useRef(sessionId);
|
|
76
75
|
const sessionReadyRef = useRef(Promise.resolve());
|
|
77
76
|
const monaco = useMonaco();
|
|
78
|
-
const service = ideService
|
|
77
|
+
const service = ideService;
|
|
79
78
|
const [validationDiagnostics, setValidationDiagnostics] = useState2([]);
|
|
80
79
|
const validationRunRef = useRef(0);
|
|
81
80
|
const completionProviderRef = useRef(completionProvider);
|
|
@@ -85,21 +84,28 @@ function MonacoEditor({
|
|
|
85
84
|
validateRef.current = onValidate;
|
|
86
85
|
errorRef.current = onServiceError;
|
|
87
86
|
const activeDiagnostics = useMemo(() => [...diagnostics, ...validationDiagnostics], [diagnostics, validationDiagnostics]);
|
|
88
|
-
const executeForSession = (operation, input) =>
|
|
89
|
-
|
|
90
|
-
|
|
87
|
+
const executeForSession = (operation, input) => {
|
|
88
|
+
if (!service) return Promise.resolve();
|
|
89
|
+
return sessionReadyRef.current.then(() => service.execute(operation, input)).catch((error) => {
|
|
90
|
+
errorRef.current?.(error);
|
|
91
|
+
});
|
|
92
|
+
};
|
|
91
93
|
useEffect2(() => {
|
|
92
94
|
if (!sessionRef.current) sessionRef.current = sessionId || `editor-${Date.now().toString(36)}`;
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
95
|
+
if (service) {
|
|
96
|
+
sessionReadyRef.current = service.execute("createSession", {
|
|
97
|
+
sessionId: sessionRef.current,
|
|
98
|
+
uri: uri || `inmemory://${sessionRef.current}`,
|
|
99
|
+
language,
|
|
100
|
+
value,
|
|
101
|
+
options: { readOnly, minimap, fontSize }
|
|
102
|
+
});
|
|
103
|
+
void sessionReadyRef.current.catch((error) => errorRef.current?.(error));
|
|
104
|
+
} else {
|
|
105
|
+
sessionReadyRef.current = Promise.resolve();
|
|
106
|
+
}
|
|
101
107
|
return () => {
|
|
102
|
-
if (sessionRef.current) {
|
|
108
|
+
if (service && sessionRef.current) {
|
|
103
109
|
void sessionReadyRef.current.then(() => service.execute("disposeSession", { sessionId: sessionRef.current })).catch((error) => errorRef.current?.(error));
|
|
104
110
|
}
|
|
105
111
|
};
|
|
@@ -172,7 +178,7 @@ function MonacoEditor({
|
|
|
172
178
|
const model = editorRef.current.getModel();
|
|
173
179
|
if (!model) return;
|
|
174
180
|
const severity = monaco.MarkerSeverity || {};
|
|
175
|
-
monaco.editor.setModelMarkers(model, "
|
|
181
|
+
monaco.editor.setModelMarkers(model, "floks", activeDiagnostics.map((diagnostic) => ({
|
|
176
182
|
message: diagnostic.message,
|
|
177
183
|
severity: severity[diagnostic.severity === "error" ? "Error" : diagnostic.severity === "warning" ? "Warning" : diagnostic.severity === "info" ? "Info" : "Hint"] ?? severity.Error,
|
|
178
184
|
startLineNumber: diagnostic.startLineNumber,
|
|
@@ -180,7 +186,7 @@ function MonacoEditor({
|
|
|
180
186
|
endLineNumber: diagnostic.endLineNumber,
|
|
181
187
|
endColumn: diagnostic.endColumn,
|
|
182
188
|
code: diagnostic.code,
|
|
183
|
-
source: "
|
|
189
|
+
source: "floks"
|
|
184
190
|
})));
|
|
185
191
|
if (sessionRef.current) {
|
|
186
192
|
void executeForSession("setDiagnostics", {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
usePredictiveGraph2D
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZSVXR3HU.js";
|
|
4
4
|
|
|
5
5
|
// src/frnl-editable-node-graph/FrnlEditableNodeGraph.tsx
|
|
6
6
|
import { useEffect as useEffect2, useMemo as useMemo3, useState as useState5 } from "react";
|
|
7
|
-
import { ConnectionRuleStore as ConnectionRuleStore4, MagneticGraphManager } from "@ultrst-armada/
|
|
7
|
+
import { ConnectionRuleStore as ConnectionRuleStore4, MagneticGraphManager } from "@ultrst-armada/floks/contracts";
|
|
8
8
|
import { defineFrnlComponent } from "@ultrst-armada/frnlts";
|
|
9
9
|
import { useFrnlComponent } from "@ultrst-armada/frnlts/react";
|
|
10
10
|
import { useFloksFrnlStore } from "@ultrst-armada/floks/ui";
|
|
@@ -14,7 +14,7 @@ import { useRef as useRef2, useState as useState4, useEffect, useCallback } from
|
|
|
14
14
|
|
|
15
15
|
// src/MovableSocketView.tsx
|
|
16
16
|
import { useState, useRef } from "react";
|
|
17
|
-
import { getBeamPoints } from "@ultrst-armada/
|
|
17
|
+
import { getBeamPoints } from "@ultrst-armada/floks/contracts";
|
|
18
18
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
19
|
function MovableSocketView({
|
|
20
20
|
nodeId,
|
|
@@ -438,11 +438,11 @@ function WireRenderer({ edges, nodesData, config: _config, onDeleteEdge, connect
|
|
|
438
438
|
}
|
|
439
439
|
|
|
440
440
|
// src/NodeGraphCanvas.tsx
|
|
441
|
-
import { canvasToScreen, isNodeInCenterDeadZone, getCenterPanForNode, getNodesInSelection, ConnectionRuleStore as ConnectionRuleStore3 } from "@ultrst-armada/
|
|
441
|
+
import { canvasToScreen, isNodeInCenterDeadZone, getCenterPanForNode, getNodesInSelection, ConnectionRuleStore as ConnectionRuleStore3 } from "@ultrst-armada/floks/contracts";
|
|
442
442
|
|
|
443
443
|
// src/node-graph-ui/widgets/CompatibleNodePicker.tsx
|
|
444
444
|
import { useState as useState2, useMemo } from "react";
|
|
445
|
-
import { ConnectionRuleStore } from "@ultrst-armada/
|
|
445
|
+
import { ConnectionRuleStore } from "@ultrst-armada/floks/contracts";
|
|
446
446
|
import { useSearchKeyboardNavigation, BaseButton, BaseInput } from "@ultrst-armada/floks/ui";
|
|
447
447
|
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
448
448
|
function CompatibleNodePicker({
|
|
@@ -579,7 +579,7 @@ function CompatibleNodePicker({
|
|
|
579
579
|
|
|
580
580
|
// src/node-graph-ui/widgets/NodeSearchPalette.tsx
|
|
581
581
|
import { useState as useState3, useMemo as useMemo2 } from "react";
|
|
582
|
-
import { ConnectionRuleStore as ConnectionRuleStore2 } from "@ultrst-armada/
|
|
582
|
+
import { ConnectionRuleStore as ConnectionRuleStore2 } from "@ultrst-armada/floks/contracts";
|
|
583
583
|
import { useSearchKeyboardNavigation as useSearchKeyboardNavigation2, BaseButton as BaseButton2, BaseInput as BaseInput2 } from "@ultrst-armada/floks/ui";
|
|
584
584
|
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
585
585
|
function menuCategory(node) {
|