@reeve-iot/workflow-mui 0.0.0-stage → 1.0.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.
Files changed (147) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +54 -2
  3. package/dist/canvas/BlockNode.d.ts +31 -0
  4. package/dist/canvas/BlockNode.d.ts.map +1 -0
  5. package/dist/canvas/BlockNode.js +212 -0
  6. package/dist/canvas/BlockNode.js.map +1 -0
  7. package/dist/canvas/Connection.d.ts +11 -0
  8. package/dist/canvas/Connection.d.ts.map +1 -0
  9. package/dist/canvas/Connection.js +23 -0
  10. package/dist/canvas/Connection.js.map +1 -0
  11. package/dist/canvas/WorkflowCanvas.d.ts +17 -0
  12. package/dist/canvas/WorkflowCanvas.d.ts.map +1 -0
  13. package/dist/canvas/WorkflowCanvas.js +259 -0
  14. package/dist/canvas/WorkflowCanvas.js.map +1 -0
  15. package/dist/canvas/analysedPortTerm.d.ts +7 -0
  16. package/dist/canvas/analysedPortTerm.d.ts.map +1 -0
  17. package/dist/canvas/analysedPortTerm.js +18 -0
  18. package/dist/canvas/analysedPortTerm.js.map +1 -0
  19. package/dist/canvas/geometry.d.ts +15 -0
  20. package/dist/canvas/geometry.d.ts.map +1 -0
  21. package/dist/canvas/geometry.js +17 -0
  22. package/dist/canvas/geometry.js.map +1 -0
  23. package/dist/canvas/graphTopology.d.ts +13 -0
  24. package/dist/canvas/graphTopology.d.ts.map +1 -0
  25. package/dist/canvas/graphTopology.js +33 -0
  26. package/dist/canvas/graphTopology.js.map +1 -0
  27. package/dist/canvas/highlights.d.ts +13 -0
  28. package/dist/canvas/highlights.d.ts.map +1 -0
  29. package/dist/canvas/highlights.js +2 -0
  30. package/dist/canvas/highlights.js.map +1 -0
  31. package/dist/canvas/nodePorts.d.ts +20 -0
  32. package/dist/canvas/nodePorts.d.ts.map +1 -0
  33. package/dist/canvas/nodePorts.js +29 -0
  34. package/dist/canvas/nodePorts.js.map +1 -0
  35. package/dist/canvas/portCustomization.d.ts +22 -0
  36. package/dist/canvas/portCustomization.d.ts.map +1 -0
  37. package/dist/canvas/portCustomization.js +7 -0
  38. package/dist/canvas/portCustomization.js.map +1 -0
  39. package/dist/canvas/portGeometry.d.ts +4 -0
  40. package/dist/canvas/portGeometry.d.ts.map +1 -0
  41. package/dist/canvas/portGeometry.js +4 -0
  42. package/dist/canvas/portGeometry.js.map +1 -0
  43. package/dist/canvas/portLabelLayout.d.ts +10 -0
  44. package/dist/canvas/portLabelLayout.d.ts.map +1 -0
  45. package/dist/canvas/portLabelLayout.js +48 -0
  46. package/dist/canvas/portLabelLayout.js.map +1 -0
  47. package/dist/canvas/unavailableBlock.d.ts +16 -0
  48. package/dist/canvas/unavailableBlock.d.ts.map +1 -0
  49. package/dist/canvas/unavailableBlock.js +10 -0
  50. package/dist/canvas/unavailableBlock.js.map +1 -0
  51. package/dist/config/ErrorHandlingSection.d.ts +13 -0
  52. package/dist/config/ErrorHandlingSection.d.ts.map +1 -0
  53. package/dist/config/ErrorHandlingSection.js +56 -0
  54. package/dist/config/ErrorHandlingSection.js.map +1 -0
  55. package/dist/config/NodeConfigPanel.d.ts +20 -0
  56. package/dist/config/NodeConfigPanel.d.ts.map +1 -0
  57. package/dist/config/NodeConfigPanel.js +247 -0
  58. package/dist/config/NodeConfigPanel.js.map +1 -0
  59. package/dist/config/PassthroughSection.d.ts +19 -0
  60. package/dist/config/PassthroughSection.d.ts.map +1 -0
  61. package/dist/config/PassthroughSection.js +38 -0
  62. package/dist/config/PassthroughSection.js.map +1 -0
  63. package/dist/config/ResiliencySection.d.ts +18 -0
  64. package/dist/config/ResiliencySection.d.ts.map +1 -0
  65. package/dist/config/ResiliencySection.js +157 -0
  66. package/dist/config/ResiliencySection.js.map +1 -0
  67. package/dist/config/TypeArgumentPicker.d.ts +7 -0
  68. package/dist/config/TypeArgumentPicker.d.ts.map +1 -0
  69. package/dist/config/TypeArgumentPicker.js +32 -0
  70. package/dist/config/TypeArgumentPicker.js.map +1 -0
  71. package/dist/config/nodeConfigCustomization.d.ts +101 -0
  72. package/dist/config/nodeConfigCustomization.d.ts.map +1 -0
  73. package/dist/config/nodeConfigCustomization.js +7 -0
  74. package/dist/config/nodeConfigCustomization.js.map +1 -0
  75. package/dist/index.d.ts +27 -0
  76. package/dist/index.d.ts.map +1 -0
  77. package/dist/index.js +27 -0
  78. package/dist/index.js.map +1 -0
  79. package/dist/mapping/MappingDialog.d.ts +11 -0
  80. package/dist/mapping/MappingDialog.d.ts.map +1 -0
  81. package/dist/mapping/MappingDialog.js +283 -0
  82. package/dist/mapping/MappingDialog.js.map +1 -0
  83. package/dist/mapping/mappingCustomization.d.ts +51 -0
  84. package/dist/mapping/mappingCustomization.d.ts.map +1 -0
  85. package/dist/mapping/mappingCustomization.js +9 -0
  86. package/dist/mapping/mappingCustomization.js.map +1 -0
  87. package/dist/mapping/wireSourceOutputs.d.ts +30 -0
  88. package/dist/mapping/wireSourceOutputs.d.ts.map +1 -0
  89. package/dist/mapping/wireSourceOutputs.js +68 -0
  90. package/dist/mapping/wireSourceOutputs.js.map +1 -0
  91. package/dist/nameDraft.d.ts +24 -0
  92. package/dist/nameDraft.d.ts.map +1 -0
  93. package/dist/nameDraft.js +20 -0
  94. package/dist/nameDraft.js.map +1 -0
  95. package/dist/navigation/SubCanvasBreadcrumb.d.ts +8 -0
  96. package/dist/navigation/SubCanvasBreadcrumb.d.ts.map +1 -0
  97. package/dist/navigation/SubCanvasBreadcrumb.js +31 -0
  98. package/dist/navigation/SubCanvasBreadcrumb.js.map +1 -0
  99. package/dist/palette/BlockPalette.d.ts +18 -0
  100. package/dist/palette/BlockPalette.d.ts.map +1 -0
  101. package/dist/palette/BlockPalette.js +56 -0
  102. package/dist/palette/BlockPalette.js.map +1 -0
  103. package/dist/ports/KeyValueRowsField.d.ts +35 -0
  104. package/dist/ports/KeyValueRowsField.d.ts.map +1 -0
  105. package/dist/ports/KeyValueRowsField.js +112 -0
  106. package/dist/ports/KeyValueRowsField.js.map +1 -0
  107. package/dist/ports/PortDeclarationTable.d.ts +19 -0
  108. package/dist/ports/PortDeclarationTable.d.ts.map +1 -0
  109. package/dist/ports/PortDeclarationTable.js +112 -0
  110. package/dist/ports/PortDeclarationTable.js.map +1 -0
  111. package/dist/ports/PortValueEditor.d.ts +70 -0
  112. package/dist/ports/PortValueEditor.d.ts.map +1 -0
  113. package/dist/ports/PortValueEditor.js +169 -0
  114. package/dist/ports/PortValueEditor.js.map +1 -0
  115. package/dist/ports/collectionComposer.d.ts +27 -0
  116. package/dist/ports/collectionComposer.d.ts.map +1 -0
  117. package/dist/ports/collectionComposer.js +38 -0
  118. package/dist/ports/collectionComposer.js.map +1 -0
  119. package/dist/ports/refusedLiteral.d.ts +10 -0
  120. package/dist/ports/refusedLiteral.d.ts.map +1 -0
  121. package/dist/ports/refusedLiteral.js +11 -0
  122. package/dist/ports/refusedLiteral.js.map +1 -0
  123. package/dist/ports/writeTerm.d.ts +6 -0
  124. package/dist/ports/writeTerm.d.ts.map +1 -0
  125. package/dist/ports/writeTerm.js +11 -0
  126. package/dist/ports/writeTerm.js.map +1 -0
  127. package/dist/settings/ConcurrencySection.d.ts +9 -0
  128. package/dist/settings/ConcurrencySection.d.ts.map +1 -0
  129. package/dist/settings/ConcurrencySection.js +32 -0
  130. package/dist/settings/ConcurrencySection.js.map +1 -0
  131. package/dist/settings/ParameterDeclarationDialog.d.ts +36 -0
  132. package/dist/settings/ParameterDeclarationDialog.d.ts.map +1 -0
  133. package/dist/settings/ParameterDeclarationDialog.js +82 -0
  134. package/dist/settings/ParameterDeclarationDialog.js.map +1 -0
  135. package/dist/settings/WorkflowExecutionSection.d.ts +15 -0
  136. package/dist/settings/WorkflowExecutionSection.d.ts.map +1 -0
  137. package/dist/settings/WorkflowExecutionSection.js +223 -0
  138. package/dist/settings/WorkflowExecutionSection.js.map +1 -0
  139. package/dist/theme/editorColors.d.ts +30 -0
  140. package/dist/theme/editorColors.d.ts.map +1 -0
  141. package/dist/theme/editorColors.js +31 -0
  142. package/dist/theme/editorColors.js.map +1 -0
  143. package/dist/validation/ValidationFindings.d.ts +28 -0
  144. package/dist/validation/ValidationFindings.d.ts.map +1 -0
  145. package/dist/validation/ValidationFindings.js +40 -0
  146. package/dist/validation/ValidationFindings.js.map +1 -0
  147. package/package.json +51 -4
@@ -0,0 +1,259 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useCallback, useEffect, useId, useRef, useState } from 'react';
3
+ import { Box } from '@mui/material';
4
+ import { computeCenteringPan, describeStoredDocumentFault, useWorkflowEditorStore, useWorkflowEditorStoreApi } from '@reeve-iot/workflow-core';
5
+ import { useEditorColors } from '../theme/editorColors.js';
6
+ import { BLOCK_DRAG_MIME } from '../palette/BlockPalette.js';
7
+ import { Connection } from './Connection.js';
8
+ import { BlockNode } from './BlockNode.js';
9
+ import { GraphTopologyContext, useGraphTopology } from './graphTopology.js';
10
+ import { MIN_CENTRING_WIDTH, NODE_CONFIG_PANEL_WIDTH, NODE_HEIGHT, NODE_WIDTH } from './geometry.js';
11
+ import { NODE_RIGHT_OVERHANG } from './portGeometry.js';
12
+ const PLACEMENT_STACK_STEP = NODE_HEIGHT + 40;
13
+ function usableCanvasWidth(width, panelWillOpen) {
14
+ return Math.max(width - (panelWillOpen ? NODE_CONFIG_PANEL_WIDTH : 0), MIN_CENTRING_WIDTH);
15
+ }
16
+ export function WorkflowCanvas({ onCanvasClick, highlights, diffHighlights, readOnly, breakpointNodeIds, pausedNodeId, describeUnavailableBlock, }) {
17
+ const colors = useEditorColors();
18
+ const containerRef = useRef(null);
19
+ const svgRef = useRef(null);
20
+ const storeApi = useWorkflowEditorStoreApi();
21
+ const gridPatternId = `reeve-workflow-grid-${useId().replace(/[^A-Za-z0-9_-]/g, '')}`;
22
+ const nodes = useWorkflowEditorStore((s) => s.nodes);
23
+ const edges = useWorkflowEditorStore((s) => s.edges);
24
+ const pan = useWorkflowEditorStore((s) => s.pan);
25
+ const zoom = useWorkflowEditorStore((s) => s.zoom);
26
+ const setPan = useWorkflowEditorStore((s) => s.setPan);
27
+ const addNode = useWorkflowEditorStore((s) => s.addNode);
28
+ const updateNodePosition = useWorkflowEditorStore((s) => s.updateNodePosition);
29
+ const setSelectedNode = useWorkflowEditorStore((s) => s.setSelectedNode);
30
+ const setSelectedEdge = useWorkflowEditorStore((s) => s.setSelectedEdge);
31
+ const addEdge = useWorkflowEditorStore((s) => s.addEdge);
32
+ const setPaletteDragActive = useWorkflowEditorStore((s) => s.setPaletteDragActive);
33
+ const removeNode = useWorkflowEditorStore((s) => s.removeNode);
34
+ const removeEdge = useWorkflowEditorStore((s) => s.removeEdge);
35
+ const selectedNodeId = useWorkflowEditorStore((s) => s.selectedNodeId);
36
+ const selectedEdgeId = useWorkflowEditorStore((s) => s.selectedEdgeId);
37
+ const quickAddBlockTypeId = useWorkflowEditorStore((s) => s.quickAddBlockTypeId);
38
+ const clearQuickAddBlock = useWorkflowEditorStore((s) => s.clearQuickAddBlock);
39
+ const flashSeq = useWorkflowEditorStore((s) => s.flashSeq);
40
+ const loadedDocumentFault = useWorkflowEditorStore((s) => s.loadedDocumentFault);
41
+ const flashNodeId = useWorkflowEditorStore((s) => s.flashNodeId);
42
+ const topology = useGraphTopology();
43
+ const frameRef = useRef(null);
44
+ const frameWorkRef = useRef(null);
45
+ const pendingMoveRef = useRef({ dx: 0, dy: 0 });
46
+ const [isPanning, setIsPanning] = useState(false);
47
+ const [dragNodeId, setDragNodeId] = useState(null);
48
+ const [dragOffset, setDragOffset] = useState({ x: 0, y: 0 });
49
+ const [pendingConnection, setPendingConnection] = useState(null);
50
+ const findPlacement = useCallback((baseX, baseY, stepX = 36, stepY = 36) => {
51
+ const padding = 20;
52
+ const collides = (x, y) => nodes.some((node) => x - padding < node.position.x + NODE_WIDTH &&
53
+ x + NODE_WIDTH + padding > node.position.x &&
54
+ y - padding < node.position.y + NODE_HEIGHT &&
55
+ y + NODE_HEIGHT + padding > node.position.y);
56
+ if (!collides(baseX, baseY))
57
+ return { x: baseX, y: baseY };
58
+ for (let i = 1; i <= 20; i += 1) {
59
+ const x = baseX + i * stepX;
60
+ const y = baseY + i * stepY;
61
+ if (!collides(x, y))
62
+ return { x, y };
63
+ }
64
+ return { x: baseX + stepX, y: baseY + stepY };
65
+ }, [nodes]);
66
+ const toSvgLocalPoint = useCallback((clientX, clientY) => {
67
+ const svg = svgRef.current;
68
+ if (typeof svg?.getScreenCTM !== 'function' || typeof svg.createSVGPoint !== 'function')
69
+ return { x: 0, y: 0 };
70
+ const ctm = svg.getScreenCTM();
71
+ if (!ctm)
72
+ return { x: 0, y: 0 };
73
+ const point = svg.createSVGPoint();
74
+ point.x = clientX;
75
+ point.y = clientY;
76
+ const { x, y } = point.matrixTransform(ctm.inverse());
77
+ return { x, y };
78
+ }, []);
79
+ const toWorldPoint = useCallback((clientX, clientY) => {
80
+ const local = toSvgLocalPoint(clientX, clientY);
81
+ const { pan: currentPan, zoom: currentZoom } = storeApi.getState();
82
+ return { x: (local.x - currentPan.x) / currentZoom, y: (local.y - currentPan.y) / currentZoom };
83
+ }, [storeApi, toSvgLocalPoint]);
84
+ const pendingSourceNodeId = pendingConnection?.sourceNodeId ?? null;
85
+ const onNodeDragStart = useCallback((event, nodeId) => {
86
+ if (readOnly)
87
+ return;
88
+ const node = storeApi.getState().nodes.find((n) => n.id === nodeId);
89
+ if (!node)
90
+ return;
91
+ const point = toWorldPoint(event.clientX, event.clientY);
92
+ setDragOffset({ x: point.x - node.position.x, y: point.y - node.position.y });
93
+ setDragNodeId(nodeId);
94
+ setSelectedNode(nodeId);
95
+ }, [readOnly, storeApi, toWorldPoint, setSelectedNode]);
96
+ const onConnectionStart = useCallback((sourceNodeId, x, y) => setPendingConnection({ sourceNodeId, sourceX: x, sourceY: y, currentX: x, currentY: y }), []);
97
+ const onConnectionEnd = useCallback((targetNodeId) => {
98
+ if (pendingSourceNodeId && pendingSourceNodeId !== targetNodeId)
99
+ addEdge(pendingSourceNodeId, targetNodeId);
100
+ setPendingConnection(null);
101
+ }, [pendingSourceNodeId, addEdge]);
102
+ const endGesture = useCallback(() => {
103
+ if (frameRef.current !== null) {
104
+ cancelAnimationFrame(frameRef.current);
105
+ frameRef.current = null;
106
+ }
107
+ const unrun = frameWorkRef.current;
108
+ frameWorkRef.current = null;
109
+ unrun?.();
110
+ pendingMoveRef.current = { dx: 0, dy: 0 };
111
+ setIsPanning(false);
112
+ setDragNodeId(null);
113
+ setPendingConnection(null);
114
+ }, []);
115
+ const onMouseDown = (event) => {
116
+ event.preventDefault();
117
+ if (event.button === 0) {
118
+ if (event.target === svgRef.current)
119
+ onCanvasClick();
120
+ }
121
+ else if (event.button === 1 || event.button === 2) {
122
+ setIsPanning(true);
123
+ }
124
+ };
125
+ const onMouseMove = (event) => {
126
+ if (frameRef.current !== null)
127
+ cancelAnimationFrame(frameRef.current);
128
+ const pending = pendingMoveRef.current;
129
+ pending.dx += event.movementX;
130
+ pending.dy += event.movementY;
131
+ const { clientX, clientY } = event;
132
+ const apply = () => {
133
+ const { dx, dy } = pending;
134
+ pending.dx = 0;
135
+ pending.dy = 0;
136
+ if (isPanning) {
137
+ const current = storeApi.getState().pan;
138
+ setPan({ x: current.x + dx, y: current.y + dy });
139
+ return;
140
+ }
141
+ if (dragNodeId) {
142
+ const point = toWorldPoint(clientX, clientY);
143
+ updateNodePosition(dragNodeId, { x: point.x - dragOffset.x, y: point.y - dragOffset.y });
144
+ return;
145
+ }
146
+ if (pendingConnection) {
147
+ const point = toWorldPoint(clientX, clientY);
148
+ setPendingConnection((prev) => (prev ? { ...prev, currentX: point.x, currentY: point.y } : null));
149
+ }
150
+ };
151
+ frameWorkRef.current = apply;
152
+ frameRef.current = requestAnimationFrame(() => {
153
+ frameRef.current = null;
154
+ frameWorkRef.current = null;
155
+ apply();
156
+ });
157
+ };
158
+ useEffect(() => {
159
+ const container = containerRef.current;
160
+ if (!container)
161
+ return;
162
+ const onWheel = (event) => {
163
+ event.preventDefault();
164
+ const { zoom: current, pan: currentPan } = storeApi.getState();
165
+ const next = Math.max(0.1, Math.min(event.deltaY > 0 ? current / 1.1 : current * 1.1, 5));
166
+ if (next === current)
167
+ return;
168
+ const rect = container.getBoundingClientRect();
169
+ const cursorX = event.clientX - rect.left;
170
+ const cursorY = event.clientY - rect.top;
171
+ const ratio = next / current;
172
+ storeApi.setState({
173
+ zoom: next,
174
+ pan: { x: cursorX - (cursorX - currentPan.x) * ratio, y: cursorY - (cursorY - currentPan.y) * ratio },
175
+ });
176
+ };
177
+ container.addEventListener('wheel', onWheel, { passive: false });
178
+ return () => container.removeEventListener('wheel', onWheel);
179
+ }, [storeApi]);
180
+ const onDrop = (event) => {
181
+ event.preventDefault();
182
+ if (readOnly)
183
+ return;
184
+ const blockTypeId = event.dataTransfer.getData(BLOCK_DRAG_MIME);
185
+ if (blockTypeId) {
186
+ const local = toSvgLocalPoint(event.clientX, event.clientY);
187
+ const { pan: currentPan, zoom: currentZoom, selectedNodeId: currentSelectedNodeId } = storeApi.getState();
188
+ const rect = containerRef.current?.getBoundingClientRect();
189
+ const remainingWidth = (rect?.width ?? 0) - (currentSelectedNodeId === null ? NODE_CONFIG_PANEL_WIDTH : 0);
190
+ const screenLeft = Math.max(NODE_RIGHT_OVERHANG * currentZoom, Math.min(local.x - NODE_WIDTH * currentZoom / 2, remainingWidth - (NODE_WIDTH + NODE_RIGHT_OVERHANG) * currentZoom));
191
+ const x = (screenLeft - currentPan.x) / currentZoom;
192
+ const y = (local.y - currentPan.y) / currentZoom - 40;
193
+ addNode(blockTypeId, findPlacement(x, y, 0, PLACEMENT_STACK_STEP));
194
+ }
195
+ setPaletteDragActive(false);
196
+ };
197
+ useEffect(() => () => {
198
+ if (frameRef.current !== null)
199
+ cancelAnimationFrame(frameRef.current);
200
+ }, []);
201
+ useEffect(() => {
202
+ if (!quickAddBlockTypeId || !containerRef.current)
203
+ return;
204
+ const rect = containerRef.current.getBoundingClientRect();
205
+ const panelOpen = storeApi.getState().selectedNodeId !== null;
206
+ const usableWidth = usableCanvasWidth(rect.width, !panelOpen);
207
+ const local = toSvgLocalPoint(rect.left + usableWidth / 2, rect.top + rect.height / 2);
208
+ const { pan: currentPan, zoom: currentZoom } = storeApi.getState();
209
+ addNode(quickAddBlockTypeId, findPlacement((local.x - currentPan.x) / currentZoom - NODE_WIDTH / 2, (local.y - currentPan.y) / currentZoom - 40, 0, PLACEMENT_STACK_STEP));
210
+ clearQuickAddBlock();
211
+ }, [quickAddBlockTypeId, addNode, clearQuickAddBlock, findPlacement, toSvgLocalPoint, storeApi]);
212
+ useEffect(() => {
213
+ if (flashSeq === 0)
214
+ return;
215
+ const state = storeApi.getState();
216
+ const node = state.nodes.find((n) => n.id === state.flashNodeId);
217
+ const rect = containerRef.current?.getBoundingClientRect();
218
+ if (!node || !rect || rect.width === 0 || rect.height === 0)
219
+ return;
220
+ const usableWidth = usableCanvasWidth(rect.width, state.selectedNodeId === null);
221
+ setPan(computeCenteringPan(node.position, { width: NODE_WIDTH, height: NODE_HEIGHT }, { width: usableWidth, height: rect.height }, state.zoom));
222
+ // eslint-disable-next-line react-hooks/exhaustive-deps
223
+ }, [flashSeq]);
224
+ useEffect(() => {
225
+ if (!pendingConnection && !isPanning && !dragNodeId)
226
+ return;
227
+ window.addEventListener('mouseup', endGesture);
228
+ return () => window.removeEventListener('mouseup', endGesture);
229
+ }, [pendingConnection, isPanning, dragNodeId, endGesture]);
230
+ const onKeyDown = (event) => {
231
+ const target = event.target;
232
+ if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable)
233
+ return;
234
+ if (event.key !== 'Delete' && event.key !== 'Backspace')
235
+ return;
236
+ if (readOnly)
237
+ return;
238
+ if (selectedNodeId)
239
+ removeNode(selectedNodeId);
240
+ if (selectedEdgeId)
241
+ removeEdge(selectedEdgeId);
242
+ };
243
+ return (_jsxs(Box, { ref: containerRef, "data-testid": "workflow-canvas", tabIndex: 0, sx: {
244
+ position: 'relative', width: '100%', height: '100%', overflow: 'hidden', cursor: isPanning ? 'grabbing' : 'crosshair', userSelect: 'none',
245
+ outline: 'none', '&:focus-visible': { boxShadow: `inset 0 0 0 2px ${colors.selected}` },
246
+ }, onMouseDownCapture: () => containerRef.current?.focus({ preventScroll: true }), onMouseDown: onMouseDown, onMouseMove: onMouseMove, onMouseUp: endGesture, onKeyDown: onKeyDown, onDrop: onDrop, onDragOver: (event) => {
247
+ event.preventDefault();
248
+ event.dataTransfer.dropEffect = 'move';
249
+ }, onContextMenu: (event) => event.preventDefault(), children: [loadedDocumentFault && (_jsx(Box, { role: "alert", sx: { position: 'absolute', top: 8, left: 8, right: 8, p: 1, bgcolor: 'error.main', color: 'error.contrastText', borderRadius: 1 }, children: `${loadedDocumentFault.rule === 'undrawable' ? 'The editor cannot draw this workflow' : 'The stored workflow cannot be read'}, so it is shown empty and cannot be saved: ${describeStoredDocumentFault(loadedDocumentFault)}.` })), _jsx(GraphTopologyContext.Provider, { value: topology, children: _jsxs("svg", { ref: svgRef, width: "100%", height: "100%", style: { pointerEvents: 'all', background: colors.canvasBg, userSelect: 'none' }, children: [_jsx("defs", { children: _jsx("pattern", { id: gridPatternId, width: "40", height: "40", patternUnits: "userSpaceOnUse", children: _jsx("path", { d: "M 40 0 L 0 0 0 40", fill: "none", stroke: colors.grid, strokeWidth: "0.5" }) }) }), _jsxs("g", { transform: `translate(${pan.x}, ${pan.y}) scale(${zoom})`, children: [_jsx("rect", { x: -10000, y: -10000, width: 20000, height: 20000, fill: `url(#${gridPatternId})`, style: { pointerEvents: 'none' } }), edges.map((edge) => (_jsx(Connection, { edge: edge, nodes: nodes, isSelected: selectedEdgeId === edge.id, onClick: (event) => {
250
+ event.stopPropagation();
251
+ setSelectedEdge(edge.id);
252
+ } }, edge.id))), pendingConnection && (_jsx("line", { x1: pendingConnection.sourceX, y1: pendingConnection.sourceY, x2: pendingConnection.currentX, y2: pendingConnection.currentY, stroke: colors.selected, strokeWidth: "2", strokeDasharray: "5,5", style: { pointerEvents: 'none' } })), [...nodes]
253
+ .sort((a, b) => (a.id === selectedNodeId ? 1 : b.id === selectedNodeId ? -1 : 0))
254
+ .map((node) => {
255
+ const highlight = highlights?.find((h) => h.nodeId === node.id);
256
+ return (_jsx(BlockNode, { node: node, isSelected: selectedNodeId === node.id, isConnecting: !!pendingConnection, highlight: highlight, diffHighlight: diffHighlights?.[node.id], readOnly: readOnly, isBreakpoint: breakpointNodeIds?.includes(node.id), isPausedHere: pausedNodeId === node.id, isFlashing: flashNodeId === node.id, flashKey: flashSeq, onDragStart: onNodeDragStart, onConnectionStart: onConnectionStart, onConnectionEnd: onConnectionEnd, onSelect: setSelectedNode, describeUnavailableBlock: describeUnavailableBlock }, node.id));
257
+ })] })] }) })] }));
258
+ }
259
+ //# sourceMappingURL=WorkflowCanvas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkflowCanvas.js","sourceRoot":"","sources":["../../src/canvas/WorkflowCanvas.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvE,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;AACnC,OAAO,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAA;AAC9I,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAE3E,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AACpG,OAAO,EAAE,mBA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EAAE,IAAI,EACV,UAAU,EAAE,cAAc,KAAK,IAAI,CAAC,EAAE,EACtC,YAAY,EAAE,CAAC,CAAC,iBAAiB,EACjC,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,cAAc,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EACxC,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,iBAAiB,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,EAClD,YAAY,EAAE,YAAY,KAAK,IAAI,CAAC,EAAE,EACtC,UAAU,EAAE,WAAW,KAAK,IAAI,CAAC,EAAE,EACnC,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,eAAe,EAC5B,iBAAiB,EAAE,iBAAiB,EACpC,eAAe,EAAE,eAAe,EAChC,QAAQ,EAAE,eAAe,EACzB,wBAAwB,EAAE,wBAAwB,IAf7C,IAAI,CAAC,EAAE,CAgBZ,CACH,CAAA;gCACH,CAAC,CAAC,IACF,IACA,GAC0B,IAC5B,CACP,CAAA;AACH,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { PortTermDisplay } from '@reeve-iot/workflow-core';
2
+ /** The term the server's draft analysis gives a port of a node on the open canvas, for a name only a passthrough entry gives:
3
+ * nothing before an answer, the last answer marked stale once the draft has moved on. */
4
+ export declare function useAnalysedPortTerm(): (nodeId: string, side: 'inputs' | 'outputs', name: string) => PortTermDisplay | undefined;
5
+ /** A term as text for a place that cannot style it: an answer older than the draft says so. */
6
+ export declare const termText: (display: PortTermDisplay) => string;
7
+ //# sourceMappingURL=analysedPortTerm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analysedPortTerm.d.ts","sourceRoot":"","sources":["../../src/canvas/analysedPortTerm.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAG/D;yFACyF;AACzF,wBAAgB,mBAAmB,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,KAAK,eAAe,GAAG,SAAS,CAW/H;AAED,+FAA+F;AAC/F,eAAO,MAAM,QAAQ,GAAI,SAAS,eAAe,KAAG,MAAkE,CAAA"}
@@ -0,0 +1,18 @@
1
+ import { useMemo } from 'react';
2
+ import { displayPortTerm, draftAnalysisFreshness, indexDraftAnalysis, useWorkflowEditorStore } from '@reeve-iot/workflow-core';
3
+ /** The term the server's draft analysis gives a port of a node on the open canvas, for a name only a passthrough entry gives:
4
+ * nothing before an answer, the last answer marked stale once the draft has moved on. */
5
+ export function useAnalysedPortTerm() {
6
+ const analysis = useWorkflowEditorStore((s) => s.analysis);
7
+ const revision = useWorkflowEditorStore((s) => s.revision);
8
+ const canvasStack = useWorkflowEditorStore((s) => s.canvasStack);
9
+ return useMemo(() => {
10
+ const index = indexDraftAnalysis(analysis);
11
+ const freshness = draftAnalysisFreshness(analysis, revision);
12
+ const canvasPath = canvasStack.map((f) => ({ nodeId: f.parentNodeId, branchName: f.subCanvasName }));
13
+ return (nodeId, side, name) => displayPortTerm(undefined, index.port(canvasPath, nodeId, side, name), freshness, index.findings(canvasPath, nodeId, name));
14
+ }, [analysis, revision, canvasStack]);
15
+ }
16
+ /** A term as text for a place that cannot style it: an answer older than the draft says so. */
17
+ export const termText = (display) => display.stale ? `${display.text} (stale)` : display.text;
18
+ //# sourceMappingURL=analysedPortTerm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analysedPortTerm.js","sourceRoot":"","sources":["../../src/canvas/analysedPortTerm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAE/B,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AAE9H;yFACyF;AACzF,MAAM,UAAU,mBAAmB;IACjC,MAAM,QAAQ,GAAG,sBAAsB,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;IAC1D,MAAM,QAAQ,GAAG,sBAAsB,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;IAC1D,MAAM,WAAW,GAAG,sBAAsB,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,CAAA;IAChE,OAAO,OAAO,CAAC,GAAG,EAAE;QAClB,MAAM,KAAK,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAA;QAC1C,MAAM,SAAS,GAAG,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;QAC5D,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,YAAY,EAAE,UAAU,EAAE,CAAC,CAAC,aAAa,EAAE,CAAC,CAAC,CAAA;QACpG,OAAO,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAC5B,eAAe,CAAC,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAA;IAC/H,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAA;AACvC,CAAC;AAED,+FAA+F;AAC/F,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,OAAwB,EAAU,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAA"}
@@ -0,0 +1,15 @@
1
+ /** Node box metrics the canvas, the nodes and the wires must all agree on. They live in one module
2
+ * because they drifted apart in the code this was extracted from: the node rendered 220 wide while the
3
+ * wire left from 200, so every wire started twenty pixels INSIDE its own node. */
4
+ export declare const NODE_WIDTH = 220;
5
+ export declare const NODE_HEIGHT = 120;
6
+ export declare const NODE_HEADER_HEIGHT = 40;
7
+ export declare const NODE_ITEM_HEIGHT = 24;
8
+ /** Width the node configuration panel occupies. The canvas reserves it when centring a node, or the
9
+ * node lands underneath the panel that is about to open and cannot be dragged out. */
10
+ export declare const NODE_CONFIG_PANEL_WIDTH = 300;
11
+ /** Below this the reserved panel space would push a centred node under the palette instead. */
12
+ export declare const MIN_CENTRING_WIDTH = 320;
13
+ /** Vertical centre of a node's first port row, in canvas coordinates. */
14
+ export declare function portAnchorY(nodeY: number): number;
15
+ //# sourceMappingURL=geometry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../../src/canvas/geometry.ts"],"names":[],"mappings":"AAAA;;kFAEkF;AAClF,eAAO,MAAM,UAAU,MAAM,CAAA;AAC7B,eAAO,MAAM,WAAW,MAAM,CAAA;AAC9B,eAAO,MAAM,kBAAkB,KAAK,CAAA;AACpC,eAAO,MAAM,gBAAgB,KAAK,CAAA;AAElC;sFACsF;AACtF,eAAO,MAAM,uBAAuB,MAAM,CAAA;AAE1C,+FAA+F;AAC/F,eAAO,MAAM,kBAAkB,MAAM,CAAA;AAErC,yEAAyE;AACzE,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjD"}
@@ -0,0 +1,17 @@
1
+ /** Node box metrics the canvas, the nodes and the wires must all agree on. They live in one module
2
+ * because they drifted apart in the code this was extracted from: the node rendered 220 wide while the
3
+ * wire left from 200, so every wire started twenty pixels INSIDE its own node. */
4
+ export const NODE_WIDTH = 220;
5
+ export const NODE_HEIGHT = 120;
6
+ export const NODE_HEADER_HEIGHT = 40;
7
+ export const NODE_ITEM_HEIGHT = 24;
8
+ /** Width the node configuration panel occupies. The canvas reserves it when centring a node, or the
9
+ * node lands underneath the panel that is about to open and cannot be dragged out. */
10
+ export const NODE_CONFIG_PANEL_WIDTH = 300;
11
+ /** Below this the reserved panel space would push a centred node under the palette instead. */
12
+ export const MIN_CENTRING_WIDTH = 320;
13
+ /** Vertical centre of a node's first port row, in canvas coordinates. */
14
+ export function portAnchorY(nodeY) {
15
+ return nodeY + NODE_HEADER_HEIGHT + 0.5 * NODE_ITEM_HEIGHT + 4;
16
+ }
17
+ //# sourceMappingURL=geometry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geometry.js","sourceRoot":"","sources":["../../src/canvas/geometry.ts"],"names":[],"mappings":"AAAA;;kFAEkF;AAClF,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAA;AAC7B,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAA;AAC9B,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAA;AACpC,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAA;AAElC;sFACsF;AACtF,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAA;AAE1C,+FAA+F;AAC/F,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAA;AAErC,yEAAyE;AACzE,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,OAAO,KAAK,GAAG,kBAAkB,GAAG,GAAG,GAAG,gBAAgB,GAAG,CAAC,CAAA;AAChE,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { CanvasFrame, WorkflowEdge, WorkflowNode } from '@reeve-iot/workflow-core';
2
+ /** The canvas's nodes, edges and frame stack with position churn filtered out: the object keeps its
3
+ * identity across a drag frame, so a node's `position` in here may be stale — read that from props. */
4
+ export interface GraphTopology {
5
+ readonly nodes: WorkflowNode[];
6
+ readonly edges: WorkflowEdge[];
7
+ readonly canvasStack: CanvasFrame[];
8
+ }
9
+ export declare const GraphTopologyContext: import("react").Context<GraphTopology | null>;
10
+ /** What a node needs of the graph without re-rendering on every drag frame. Inside a WorkflowCanvas the
11
+ * canvas derives it once and provides it; anywhere else the hook derives it from the store itself. */
12
+ export declare function useGraphTopology(): GraphTopology;
13
+ //# sourceMappingURL=graphTopology.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphTopology.d.ts","sourceRoot":"","sources":["../../src/canvas/graphTopology.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAuB,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAG5G;uGACuG;AACvG,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,EAAE,YAAY,EAAE,CAAA;IAC9B,QAAQ,CAAC,KAAK,EAAE,YAAY,EAAE,CAAA;IAC9B,QAAQ,CAAC,WAAW,EAAE,WAAW,EAAE,CAAA;CACpC;AAED,eAAO,MAAM,oBAAoB,+CAA4C,CAAA;AAgB7E;sGACsG;AACtG,wBAAgB,gBAAgB,IAAI,aAAa,CAgBhD"}
@@ -0,0 +1,33 @@
1
+ import { createContext, useCallback, useContext, useSyncExternalStore } from 'react';
2
+ import { useWorkflowEditorStoreApi } from '@reeve-iot/workflow-core';
3
+ export const GraphTopologyContext = createContext(null);
4
+ const sameButForPositions = (previous, next) => previous.length === next.length &&
5
+ previous.every((p, index) => {
6
+ const n = next[index];
7
+ return (p === n ||
8
+ (p.id === n.id && p.blockTypeId === n.blockTypeId && p.configuration === n.configuration &&
9
+ p.passthrough === n.passthrough && p.outputPorts === n.outputPorts && p.subCanvases === n.subCanvases));
10
+ });
11
+ const snapshots = new WeakMap();
12
+ const NONE = { nodes: [], edges: [], canvasStack: [] };
13
+ /** What a node needs of the graph without re-rendering on every drag frame. Inside a WorkflowCanvas the
14
+ * canvas derives it once and provides it; anywhere else the hook derives it from the store itself. */
15
+ export function useGraphTopology() {
16
+ const provided = useContext(GraphTopologyContext);
17
+ const store = useWorkflowEditorStoreApi();
18
+ const getSnapshot = useCallback(() => {
19
+ if (provided)
20
+ return NONE;
21
+ const { nodes, edges, canvasStack } = store.getState();
22
+ const previous = snapshots.get(store);
23
+ if (previous && previous.edges === edges && previous.canvasStack === canvasStack && sameButForPositions(previous.nodes, nodes)) {
24
+ return previous;
25
+ }
26
+ const next = { nodes, edges, canvasStack };
27
+ snapshots.set(store, next);
28
+ return next;
29
+ }, [provided, store]);
30
+ const own = useSyncExternalStore(store.subscribe, getSnapshot, getSnapshot);
31
+ return provided ?? own;
32
+ }
33
+ //# sourceMappingURL=graphTopology.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphTopology.js","sourceRoot":"","sources":["../../src/canvas/graphTopology.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAA;AAEpF,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAA;AAUpE,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAAuB,IAAI,CAAC,CAAA;AAE7E,MAAM,mBAAmB,GAAG,CAAC,QAAwB,EAAE,IAAoB,EAAW,EAAE,CACtF,QAAQ,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM;IAC/B,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE;QAC1B,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAE,CAAA;QACtB,OAAO,CACL,CAAC,KAAK,CAAC;YACP,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,WAAW,KAAK,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,aAAa,KAAK,CAAC,CAAC,aAAa;gBACtF,CAAC,CAAC,WAAW,KAAK,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,WAAW,KAAK,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,WAAW,KAAK,CAAC,CAAC,WAAW,CAAC,CACzG,CAAA;IACH,CAAC,CAAC,CAAA;AAEJ,MAAM,SAAS,GAAG,IAAI,OAAO,EAAsC,CAAA;AACnE,MAAM,IAAI,GAAkB,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,CAAA;AAErE;sGACsG;AACtG,MAAM,UAAU,gBAAgB;IAC9B,MAAM,QAAQ,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAA;IACjD,MAAM,KAAK,GAAG,yBAAyB,EAAE,CAAA;IACzC,MAAM,WAAW,GAAG,WAAW,CAAC,GAAkB,EAAE;QAClD,IAAI,QAAQ;YAAE,OAAO,IAAI,CAAA;QACzB,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAA;QACtD,MAAM,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;QACrC,IAAI,QAAQ,IAAI,QAAQ,CAAC,KAAK,KAAK,KAAK,IAAI,QAAQ,CAAC,WAAW,KAAK,WAAW,IAAI,mBAAmB,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC;YAC/H,OAAO,QAAQ,CAAA;QACjB,CAAC;QACD,MAAM,IAAI,GAAkB,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,CAAA;QACzD,SAAS,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;QAC1B,OAAO,IAAI,CAAA;IACb,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAA;IACrB,MAAM,GAAG,GAAG,oBAAoB,CAAC,KAAK,CAAC,SAAS,EAAE,WAAW,EAAE,WAAW,CAAC,CAAA;IAC3E,OAAO,QAAQ,IAAI,GAAG,CAAA;AACxB,CAAC"}
@@ -0,0 +1,13 @@
1
+ /** How a host asks the canvas to tint a node. The library assigns no meaning to `status` beyond
2
+ * choosing a colour; a host that streams run state maps its own vocabulary onto these. */
3
+ export type NodeRunStatus = 'running' | 'success' | 'error';
4
+ export interface NodeHighlight {
5
+ nodeId: string;
6
+ status?: NodeRunStatus;
7
+ /** Serialised values to reveal on the node, when the host has them. */
8
+ inputsJson?: string | null;
9
+ outputsJson?: string | null;
10
+ }
11
+ /** Structural diff tint, for a host comparing two versions of a graph. */
12
+ export type NodeDiffKind = 'added' | 'removed' | 'modified';
13
+ //# sourceMappingURL=highlights.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"highlights.d.ts","sourceRoot":"","sources":["../../src/canvas/highlights.ts"],"names":[],"mappings":"AAAA;0FAC0F;AAC1F,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAA;AAE3D,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,aAAa,CAAA;IACtB,uEAAuE;IACvE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC5B;AAED,0EAA0E;AAC1E,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,SAAS,GAAG,UAAU,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=highlights.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"highlights.js","sourceRoot":"","sources":["../../src/canvas/highlights.ts"],"names":[],"mappings":""}
@@ -0,0 +1,20 @@
1
+ import type { BlockTypeDescriptor, PortInfo, PortTypeName, WorkflowNode } from '@reeve-iot/workflow-core';
2
+ export interface NodePorts {
3
+ /** Ports contributed from outside the descriptor: the host's discovery seam, plus the parameters of a
4
+ * workflow this node runs. */
5
+ hostInputs: PortInfo[];
6
+ hostOutputs: PortInfo[];
7
+ /** True for an input the descriptor declares but nothing may wire: filled from the node's own
8
+ * configuration instead. */
9
+ isInputHidden: (portName: string) => boolean;
10
+ /** The type an input really has once the node's configuration is taken into account. */
11
+ inputType: (port: PortInfo) => PortTypeName;
12
+ }
13
+ /** One answer to "what ports does this node actually have", shared by everything that draws or offers
14
+ * them. Two components deriving this separately is how a canvas ends up drawing a port the mapping dialog
15
+ * refuses to wire.
16
+ *
17
+ * Calls both seams unconditionally — they are hooks, and each decides per node whether it has anything to
18
+ * say. `node` may be null for a caller that has no node yet but must keep its hook order stable. */
19
+ export declare function useNodePorts(node: WorkflowNode | null, blockType: BlockTypeDescriptor | undefined): NodePorts;
20
+ //# sourceMappingURL=nodePorts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nodePorts.d.ts","sourceRoot":"","sources":["../../src/canvas/nodePorts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIzG,MAAM,WAAW,SAAS;IACxB;kCAC8B;IAC9B,UAAU,EAAE,QAAQ,EAAE,CAAA;IACtB,WAAW,EAAE,QAAQ,EAAE,CAAA;IACvB;gCAC4B;IAC5B,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAA;IAC5C,wFAAwF;IACxF,SAAS,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,YAAY,CAAA;CAC5C;AAED;;;;;oGAKoG;AACpG,wBAAgB,YAAY,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,EAAE,SAAS,EAAE,mBAAmB,GAAG,SAAS,GAAG,SAAS,CAuB7G"}
@@ -0,0 +1,29 @@
1
+ import { readWorkflowReference, usePortTypes, useWorkflowReferenceResolver } from '@reeve-iot/workflow-core';
2
+ import { useNodePortCustomization } from './portCustomization.js';
3
+ /** One answer to "what ports does this node actually have", shared by everything that draws or offers
4
+ * them. Two components deriving this separately is how a canvas ends up drawing a port the mapping dialog
5
+ * refuses to wire.
6
+ *
7
+ * Calls both seams unconditionally — they are hooks, and each decides per node whether it has anything to
8
+ * say. `node` may be null for a caller that has no node yet but must keep its hook order stable. */
9
+ export function useNodePorts(node, blockType) {
10
+ const custom = useNodePortCustomization();
11
+ const portTypes = usePortTypes();
12
+ const resolveWorkflow = useWorkflowReferenceResolver();
13
+ const discovered = custom.useDiscoveredPorts?.(node) ?? {};
14
+ const referenced = resolveWorkflow(node ? readWorkflowReference(node.configuration, blockType?.runsWorkflowFrom) : null);
15
+ const merge = (first, second) => {
16
+ const base = first ?? [];
17
+ return [...base, ...second.filter((p) => !base.some((existing) => existing.name === p.name))];
18
+ };
19
+ return {
20
+ hostInputs: merge(discovered.inputs, referenced.inputs),
21
+ hostOutputs: merge(discovered.outputs, referenced.outputs),
22
+ isInputHidden: (portName) => portName === blockType?.runsWorkflowFrom || (node ? (custom.isInputPortHidden?.(node, portName) ?? false) : false),
23
+ inputType: (port) => {
24
+ const overridden = node ? custom.overrideInputPortType?.(node, port) : null;
25
+ return overridden === null || overridden === undefined ? port.type : portTypes.normalize(overridden);
26
+ },
27
+ };
28
+ }
29
+ //# sourceMappingURL=nodePorts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nodePorts.js","sourceRoot":"","sources":["../../src/canvas/nodePorts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAA;AAC5G,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAA;AAcjE;;;;;oGAKoG;AACpG,MAAM,UAAU,YAAY,CAAC,IAAyB,EAAE,SAA0C;IAChG,MAAM,MAAM,GAAG,wBAAwB,EAAE,CAAA;IACzC,MAAM,SAAS,GAAG,YAAY,EAAE,CAAA;IAChC,MAAM,eAAe,GAAG,4BAA4B,EAAE,CAAA;IAEtD,MAAM,UAAU,GAAG,MAAM,CAAC,kBAAkB,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAA;IAC1D,MAAM,UAAU,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,CAAC,aAAa,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,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of them a node shows exactly the
3
+ * ports its descriptor declares, which is all the library can know by itself. */
4
+ export interface NodePortCustomization {
5
+ /** Ports the host owns somewhere else — a side panel writes them into the node's configuration — so
6
+ * drawing them as connectable would offer a wire that the host would then ignore. */
7
+ isInputPortHidden?: (node: WorkflowNode, portName: string) => boolean;
8
+ /** A declared port whose real type depends on the node's own configuration. Return null to keep the
9
+ * declared type. */
10
+ overrideInputPortType?: (node: WorkflowNode, port: PortInfo) => PortTypeName | null;
11
+ /** Ports the host discovers at runtime, typically by following a reference the node configuration
12
+ * holds. **Called as a React hook, once per node**, so it may use hooks itself — which also means the
13
+ * function identity must stay stable for the editor's lifetime. The node is null where the caller has
14
+ * no node to ask about, which still has to call the hook to keep its own hook order stable. */
15
+ useDiscoveredPorts?: (node: WorkflowNode | null) => {
16
+ inputs?: PortInfo[];
17
+ outputs?: PortInfo[];
18
+ };
19
+ }
20
+ export declare const NodePortCustomizationContext: import("react").Context<NodePortCustomization>;
21
+ export declare function useNodePortCustomization(): NodePortCustomization;
22
+ //# sourceMappingURL=portCustomization.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"portCustomization.d.ts","sourceRoot":"","sources":["../../src/canvas/portCustomization.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEpF;iFACiF;AACjF,MAAM,WAAW,qBAAqB;IACpC;yFACqF;IACrF,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAA;IACrE;wBACoB;IACpB,qBAAqB,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,KAAK,YAAY,GAAG,IAAI,CAAA;IACnF;;;mGAG+F;IAC/F,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,KAAK;QAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC;QAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,CAAA;KAAE,CAAA;CAClG;AAID,eAAO,MAAM,4BAA4B,gDAA6C,CAAA;AAEtF,wBAAgB,wBAAwB,IAAI,qBAAqB,CAEhE"}
@@ -0,0 +1,7 @@
1
+ import { createContext, useContext } from 'react';
2
+ const NONE = {};
3
+ export const NodePortCustomizationContext = createContext(NONE);
4
+ export function useNodePortCustomization() {
5
+ return useContext(NodePortCustomizationContext);
6
+ }
7
+ //# sourceMappingURL=portCustomization.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"portCustomization.js","sourceRoot":"","sources":["../../src/canvas/portCustomization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAmBjD,MAAM,IAAI,GAA0B,EAAE,CAAA;AAEtC,MAAM,CAAC,MAAM,4BAA4B,GAAG,aAAa,CAAwB,IAAI,CAAC,CAAA;AAEtF,MAAM,UAAU,wBAAwB;IACtC,OAAO,UAAU,CAAC,4BAA4B,CAAC,CAAA;AACjD,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const PORT_RADIUS = 6;
2
+ export declare const PORT_STROKE_WIDTH = 2;
3
+ export declare const NODE_RIGHT_OVERHANG: number;
4
+ //# sourceMappingURL=portGeometry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"portGeometry.d.ts","sourceRoot":"","sources":["../../src/canvas/portGeometry.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,IAAI,CAAA;AAC5B,eAAO,MAAM,iBAAiB,IAAI,CAAA;AAClC,eAAO,MAAM,mBAAmB,QAAsC,CAAA"}
@@ -0,0 +1,4 @@
1
+ export const PORT_RADIUS = 6;
2
+ export const PORT_STROKE_WIDTH = 2;
3
+ export const NODE_RIGHT_OVERHANG = PORT_RADIUS + PORT_STROKE_WIDTH / 2;
4
+ //# sourceMappingURL=portGeometry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"portGeometry.js","sourceRoot":"","sources":["../../src/canvas/portGeometry.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAA;AAC5B,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAA;AAClC,MAAM,CAAC,MAAM,mBAAmB,GAAG,WAAW,GAAG,iBAAiB,GAAG,CAAC,CAAA"}
@@ -0,0 +1,10 @@
1
+ export declare const PORT_LABEL_FONT_SIZE = 11;
2
+ export declare const PORT_LABEL_INSET = 12;
3
+ export declare const PORT_LABEL_GAP = 12;
4
+ export declare function estimatePortLabelWidth(text: string, fontSize?: number): number;
5
+ export interface PortLabelRowLayout {
6
+ inputEnd: number;
7
+ outputStart: number;
8
+ }
9
+ export declare function layoutPortLabelRow(input: string | undefined, output: string | undefined, nodeWidth: number): PortLabelRowLayout;
10
+ //# sourceMappingURL=portLabelLayout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"portLabelLayout.d.ts","sourceRoot":"","sources":["../../src/canvas/portLabelLayout.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,KAAK,CAAA;AACtC,eAAO,MAAM,gBAAgB,KAAK,CAAA;AAClC,eAAO,MAAM,cAAc,KAAK,CAAA;AAwBhC,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,SAAuB,GAAG,MAAM,CAI5F;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,kBAAkB,CAgB/H"}