@uipath/apollo-react 4.15.1-pr556.f7e5934 → 4.16.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/dist/canvas/components/AddNodePanel/AddNodeManager.cjs +5 -2
- package/dist/canvas/components/AddNodePanel/AddNodeManager.d.ts.map +1 -1
- package/dist/canvas/components/AddNodePanel/AddNodeManager.js +5 -2
- package/dist/canvas/components/ButtonHandle/ButtonHandle.cjs +5 -119
- package/dist/canvas/components/ButtonHandle/ButtonHandle.d.ts.map +1 -1
- package/dist/canvas/components/ButtonHandle/ButtonHandle.js +4 -118
- package/dist/canvas/components/ButtonHandle/ButtonHandleLayoutUtils.cjs +159 -0
- package/dist/canvas/components/ButtonHandle/ButtonHandleLayoutUtils.d.ts +21 -0
- package/dist/canvas/components/ButtonHandle/ButtonHandleLayoutUtils.d.ts.map +1 -0
- package/dist/canvas/components/ButtonHandle/ButtonHandleLayoutUtils.js +122 -0
- package/dist/canvas/components/LoopNode/LoopNode.cjs +41 -26
- package/dist/canvas/components/LoopNode/LoopNode.constants.cjs +7 -24
- package/dist/canvas/components/LoopNode/LoopNode.constants.d.ts +3 -7
- package/dist/canvas/components/LoopNode/LoopNode.constants.d.ts.map +1 -1
- package/dist/canvas/components/LoopNode/LoopNode.constants.js +4 -9
- package/dist/canvas/components/LoopNode/LoopNode.d.ts.map +1 -1
- package/dist/canvas/components/LoopNode/LoopNode.helpers.cjs +1 -1
- package/dist/canvas/components/LoopNode/LoopNode.helpers.js +1 -1
- package/dist/canvas/components/LoopNode/LoopNode.js +42 -27
- package/dist/canvas/constants.cjs +2 -2
- package/dist/canvas/constants.js +2 -2
- package/dist/canvas/styles/tailwind.canvas.css +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { Position } from "../../xyflow/react.js";
|
|
2
|
+
import { GRID_SPACING } from "../../constants.js";
|
|
3
|
+
import { HANDLE_CROSS_AXIS_SIZE_PX, HANDLE_EDGE_COVERAGE_RATIO } from "./ButtonHandleStyleUtils.js";
|
|
4
|
+
const INWARD_HANDLE_ANCHOR_SIZE_PX = GRID_SPACING;
|
|
5
|
+
const INWARD_HANDLE_ANCHOR_RADIUS_PX = INWARD_HANDLE_ANCHOR_SIZE_PX / 2;
|
|
6
|
+
const INWARD_NOTCH_OVERLAP_PX = {
|
|
7
|
+
artifact: 5,
|
|
8
|
+
input: 4,
|
|
9
|
+
output: 6
|
|
10
|
+
};
|
|
11
|
+
function getHandleActionPortal({ nodeId, position, positionPercent, total, nodeWidth, nodeHeight }) {
|
|
12
|
+
if (!nodeWidth || !nodeHeight) return;
|
|
13
|
+
const edgeCoverageRatio = HANDLE_EDGE_COVERAGE_RATIO / total;
|
|
14
|
+
const horizontalWidth = nodeWidth * edgeCoverageRatio;
|
|
15
|
+
const verticalHeight = nodeHeight * edgeCoverageRatio;
|
|
16
|
+
const x = positionPercent / 100 * nodeWidth;
|
|
17
|
+
const y = positionPercent / 100 * nodeHeight;
|
|
18
|
+
switch(position){
|
|
19
|
+
case Position.Top:
|
|
20
|
+
return {
|
|
21
|
+
nodeId,
|
|
22
|
+
left: x,
|
|
23
|
+
top: 0,
|
|
24
|
+
width: horizontalWidth,
|
|
25
|
+
height: HANDLE_CROSS_AXIS_SIZE_PX,
|
|
26
|
+
transform: 'translate(-50%, -50%)'
|
|
27
|
+
};
|
|
28
|
+
case Position.Bottom:
|
|
29
|
+
return {
|
|
30
|
+
nodeId,
|
|
31
|
+
left: x,
|
|
32
|
+
top: nodeHeight - HANDLE_CROSS_AXIS_SIZE_PX,
|
|
33
|
+
width: horizontalWidth,
|
|
34
|
+
height: HANDLE_CROSS_AXIS_SIZE_PX,
|
|
35
|
+
transform: 'translate(-50%, 50%)'
|
|
36
|
+
};
|
|
37
|
+
case Position.Left:
|
|
38
|
+
return {
|
|
39
|
+
nodeId,
|
|
40
|
+
left: 0,
|
|
41
|
+
top: y,
|
|
42
|
+
width: HANDLE_CROSS_AXIS_SIZE_PX,
|
|
43
|
+
height: verticalHeight,
|
|
44
|
+
transform: 'translate(-50%, -50%)'
|
|
45
|
+
};
|
|
46
|
+
case Position.Right:
|
|
47
|
+
return {
|
|
48
|
+
nodeId,
|
|
49
|
+
left: nodeWidth - HANDLE_CROSS_AXIS_SIZE_PX,
|
|
50
|
+
top: y,
|
|
51
|
+
width: HANDLE_CROSS_AXIS_SIZE_PX,
|
|
52
|
+
height: verticalHeight,
|
|
53
|
+
transform: 'translate(50%, -50%)'
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function getInwardHandleLayout(position, handleType) {
|
|
58
|
+
const notchOverlap = -INWARD_NOTCH_OVERLAP_PX[handleType];
|
|
59
|
+
const anchorSize = {
|
|
60
|
+
width: INWARD_HANDLE_ANCHOR_SIZE_PX,
|
|
61
|
+
height: INWARD_HANDLE_ANCHOR_SIZE_PX
|
|
62
|
+
};
|
|
63
|
+
switch(position){
|
|
64
|
+
case Position.Left:
|
|
65
|
+
return {
|
|
66
|
+
rootTransform: 'translate(0, -50%)',
|
|
67
|
+
contentDirectionClassName: 'flex-row',
|
|
68
|
+
notchStyle: {
|
|
69
|
+
marginLeft: notchOverlap
|
|
70
|
+
},
|
|
71
|
+
anchorStyle: {
|
|
72
|
+
...anchorSize,
|
|
73
|
+
left: `calc(100% - ${INWARD_HANDLE_ANCHOR_RADIUS_PX}px)`,
|
|
74
|
+
top: '50%',
|
|
75
|
+
transform: 'translateY(-50%)'
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
case Position.Right:
|
|
79
|
+
return {
|
|
80
|
+
rootTransform: 'translate(0, -50%)',
|
|
81
|
+
contentDirectionClassName: 'flex-row-reverse',
|
|
82
|
+
notchStyle: {
|
|
83
|
+
marginRight: notchOverlap
|
|
84
|
+
},
|
|
85
|
+
anchorStyle: {
|
|
86
|
+
...anchorSize,
|
|
87
|
+
left: -INWARD_HANDLE_ANCHOR_RADIUS_PX,
|
|
88
|
+
top: '50%',
|
|
89
|
+
transform: 'translateY(-50%)'
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
case Position.Top:
|
|
93
|
+
return {
|
|
94
|
+
rootTransform: 'translate(-50%, 0)',
|
|
95
|
+
contentDirectionClassName: 'flex-col',
|
|
96
|
+
notchStyle: {
|
|
97
|
+
marginTop: notchOverlap
|
|
98
|
+
},
|
|
99
|
+
anchorStyle: {
|
|
100
|
+
...anchorSize,
|
|
101
|
+
left: '50%',
|
|
102
|
+
top: `calc(100% - ${INWARD_HANDLE_ANCHOR_RADIUS_PX}px)`,
|
|
103
|
+
transform: 'translateX(-50%)'
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
case Position.Bottom:
|
|
107
|
+
return {
|
|
108
|
+
rootTransform: 'translate(-50%, 0)',
|
|
109
|
+
contentDirectionClassName: 'flex-col-reverse',
|
|
110
|
+
notchStyle: {
|
|
111
|
+
marginBottom: notchOverlap
|
|
112
|
+
},
|
|
113
|
+
anchorStyle: {
|
|
114
|
+
...anchorSize,
|
|
115
|
+
left: '50%',
|
|
116
|
+
top: -INWARD_HANDLE_ANCHOR_RADIUS_PX,
|
|
117
|
+
transform: 'translateX(-50%)'
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
export { getHandleActionPortal, getInwardHandleLayout };
|
|
@@ -53,22 +53,22 @@ const RESIZE_CONTROLS = [
|
|
|
53
53
|
{
|
|
54
54
|
position: 'top-left',
|
|
55
55
|
cursor: 'nwse-resize',
|
|
56
|
-
indicatorClassName: 'top-[-
|
|
56
|
+
indicatorClassName: 'top-[-4px] left-[-4px]'
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
59
|
position: 'top-right',
|
|
60
60
|
cursor: 'nesw-resize',
|
|
61
|
-
indicatorClassName: 'top-[-
|
|
61
|
+
indicatorClassName: 'top-[-4px] right-[-4px]'
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
64
|
position: 'bottom-left',
|
|
65
65
|
cursor: 'nesw-resize',
|
|
66
|
-
indicatorClassName: 'bottom-[-
|
|
66
|
+
indicatorClassName: 'bottom-[-4px] left-[-4px]'
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
69
|
position: 'bottom-right',
|
|
70
70
|
cursor: 'nwse-resize',
|
|
71
|
-
indicatorClassName: 'bottom-[-
|
|
71
|
+
indicatorClassName: 'bottom-[-4px] right-[-4px]'
|
|
72
72
|
}
|
|
73
73
|
];
|
|
74
74
|
const RESIZE_CONTROL_STYLE = {
|
|
@@ -165,6 +165,8 @@ function LoopNodeComponent(props) {
|
|
|
165
165
|
]);
|
|
166
166
|
const displayTitle = display.label ?? external_LoopNode_constants_cjs_namespaceObject.DEFAULT_LOOP_TITLE;
|
|
167
167
|
const displayIcon = display.icon ?? external_LoopNode_constants_cjs_namespaceObject.DEFAULT_LOOP_ICON;
|
|
168
|
+
const isParallel = true === resolvedData.parallel;
|
|
169
|
+
const isDropTarget = true === resolvedData.isDropTarget;
|
|
168
170
|
const containerWidth = width || external_constants_cjs_namespaceObject.DEFAULT_CONTAINER_WIDTH;
|
|
169
171
|
const containerHeight = height || external_constants_cjs_namespaceObject.DEFAULT_CONTAINER_HEIGHT;
|
|
170
172
|
const nodeSizeStyle = {
|
|
@@ -240,11 +242,12 @@ function LoopNodeComponent(props) {
|
|
|
240
242
|
"data-suggestion-type": suggestionType,
|
|
241
243
|
"data-validation-status": validationState?.validationStatus,
|
|
242
244
|
"aria-busy": resolvedData.loading || void 0,
|
|
243
|
-
className: (0, apollo_wind_namespaceObject.cn)('group/loop-shell relative flex h-full w-full flex-col overflow-visible border bg-
|
|
245
|
+
className: (0, apollo_wind_namespaceObject.cn)('group/loop-shell relative box-border flex h-full w-full flex-col overflow-visible rounded-[20px] border bg-transparent', 'transition-[border-color,box-shadow,opacity] shadow-(--canvas-node-shadow-rest)', 'border-border-subtle', (0, BaseNodeContainer_cjs_namespaceObject.getStatusBorder)(suggestionType ?? validationState?.validationStatus ?? executionStatus), isHovered && 'shadow-(--canvas-node-shadow-hover) border-border-hover', selected && 'outline outline-2 outline-foreground-accent-muted', isDropTarget && 'bg-surface-hover outline outline-2 outline-brand', 'drag' === interactionState && 'cursor-grabbing shadow-(--canvas-node-shadow-lifted)'),
|
|
244
246
|
style: {
|
|
245
247
|
...nodeSizeStyle,
|
|
246
|
-
|
|
247
|
-
|
|
248
|
+
...display.background ? {
|
|
249
|
+
background: display.background
|
|
250
|
+
} : {}
|
|
248
251
|
},
|
|
249
252
|
onMouseEnter: handleMouseEnter,
|
|
250
253
|
onMouseLeave: handleMouseLeave,
|
|
@@ -263,7 +266,8 @@ function LoopNodeComponent(props) {
|
|
|
263
266
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Header, {
|
|
264
267
|
title: displayTitle,
|
|
265
268
|
icon: displayIcon,
|
|
266
|
-
loading: isLoading
|
|
269
|
+
loading: isLoading,
|
|
270
|
+
isParallel: isParallel
|
|
267
271
|
}),
|
|
268
272
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(BodyFrame, {
|
|
269
273
|
isEmpty: showEmptyStateButton,
|
|
@@ -294,11 +298,11 @@ function LoopNodeComponent(props) {
|
|
|
294
298
|
});
|
|
295
299
|
}
|
|
296
300
|
const LoopNode = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(LoopNodeComponent);
|
|
297
|
-
function Header({ title, icon, loading }) {
|
|
301
|
+
function Header({ title, icon, loading, isParallel }) {
|
|
298
302
|
const titleContent = loading ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
299
303
|
className: "h-5 w-28 animate-pulse rounded bg-(--canvas-background-overlay)"
|
|
300
304
|
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
301
|
-
className: "truncate text-[
|
|
305
|
+
className: "truncate text-[15px] font-semibold leading-5 tracking-normal",
|
|
302
306
|
children: title
|
|
303
307
|
});
|
|
304
308
|
const iconContent = loading ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
@@ -311,16 +315,32 @@ function Header({ title, icon, loading }) {
|
|
|
311
315
|
size: 16
|
|
312
316
|
})
|
|
313
317
|
}) : null;
|
|
314
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.
|
|
315
|
-
className: "flex shrink-0 items-center justify-between gap-2.5
|
|
318
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
319
|
+
className: "flex shrink-0 cursor-grab items-center justify-between gap-2.5 px-3.5 pt-2.5 text-foreground active:cursor-grabbing",
|
|
316
320
|
"data-testid": "loop-node-header",
|
|
317
|
-
children:
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
321
|
+
children: [
|
|
322
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
323
|
+
className: "flex min-w-0 items-center gap-2.5",
|
|
324
|
+
children: [
|
|
325
|
+
iconContent,
|
|
326
|
+
titleContent
|
|
327
|
+
]
|
|
328
|
+
}),
|
|
329
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("span", {
|
|
330
|
+
className: "flex shrink-0 items-center gap-1 rounded-full border border-border-subtle bg-transparent px-2.5 py-0.5 text-[11px] font-semibold leading-4 text-foreground",
|
|
331
|
+
children: [
|
|
332
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
333
|
+
className: (0, apollo_wind_namespaceObject.cn)('flex shrink-0', isParallel && 'rotate-90'),
|
|
334
|
+
"aria-hidden": true,
|
|
335
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icon_registry_cjs_namespaceObject.CanvasIcon, {
|
|
336
|
+
icon: "align-justify",
|
|
337
|
+
size: 11
|
|
338
|
+
})
|
|
339
|
+
}),
|
|
340
|
+
isParallel ? 'Parallel' : 'Sequential'
|
|
341
|
+
]
|
|
342
|
+
})
|
|
343
|
+
]
|
|
324
344
|
});
|
|
325
345
|
}
|
|
326
346
|
function EmptyState({ onAddFirstChild }) {
|
|
@@ -339,12 +359,7 @@ function BodyFrame({ isEmpty, isLoading, onAddFirstChild }) {
|
|
|
339
359
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
340
360
|
"data-testid": "loop-body-frame",
|
|
341
361
|
"data-empty": isEmpty ? 'true' : 'false',
|
|
342
|
-
className: (0, apollo_wind_namespaceObject.cn)('relative flex flex-1 rounded-[
|
|
343
|
-
style: {
|
|
344
|
-
margin: external_LoopNode_constants_cjs_namespaceObject.CONTAINER_FRAME_INSET_PX,
|
|
345
|
-
background: external_LoopNode_constants_cjs_namespaceObject.DEFAULT_CONTAINER_FRAME_BACKGROUND,
|
|
346
|
-
borderColor: external_LoopNode_constants_cjs_namespaceObject.DEFAULT_CONTAINER_FRAME_BORDER
|
|
347
|
-
},
|
|
362
|
+
className: (0, apollo_wind_namespaceObject.cn)('relative m-2.5 flex flex-1 rounded-xl border-[1.5px] border-dashed border-border-subtle bg-transparent', 'pointer-events-none', isEmpty && 'items-center justify-center'),
|
|
348
363
|
children: [
|
|
349
364
|
isLoading ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
350
365
|
className: "m-6 h-14 w-full animate-pulse rounded-[18px] bg-(--canvas-background-overlay)"
|
|
@@ -376,7 +391,7 @@ function ResizeCornerIndicators({ visible }) {
|
|
|
376
391
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(jsx_runtime_namespaceObject.Fragment, {
|
|
377
392
|
children: RESIZE_CONTROLS.map(({ position, indicatorClassName })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
378
393
|
"aria-hidden": true,
|
|
379
|
-
className: (0, apollo_wind_namespaceObject.cn)('pointer-events-none absolute h-
|
|
394
|
+
className: (0, apollo_wind_namespaceObject.cn)('pointer-events-none absolute h-2 w-2 rounded-full bg-brand transition-opacity', indicatorClassName, visible ? 'opacity-100' : 'opacity-0')
|
|
380
395
|
}, position))
|
|
381
396
|
});
|
|
382
397
|
}
|
|
@@ -24,47 +24,30 @@ var __webpack_require__ = {};
|
|
|
24
24
|
var __webpack_exports__ = {};
|
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
DEFAULT_CONTAINER_HEADER_HEIGHT_PX: ()=>DEFAULT_CONTAINER_HEADER_HEIGHT_PX,
|
|
28
|
-
DEFAULT_CONTAINER_FRAME_BACKGROUND: ()=>DEFAULT_CONTAINER_FRAME_BACKGROUND,
|
|
29
|
-
DEFAULT_LOOP_ICON: ()=>DEFAULT_LOOP_ICON,
|
|
30
|
-
DEFAULT_LOOP_TITLE: ()=>DEFAULT_LOOP_TITLE,
|
|
31
27
|
CONTAINER_FRAME_INSET_PX: ()=>CONTAINER_FRAME_INSET_PX,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
DEFAULT_CONTAINER_SHELL_BACKGROUND: ()=>DEFAULT_CONTAINER_SHELL_BACKGROUND,
|
|
28
|
+
DEFAULT_CONTAINER_HEADER_HEIGHT_PX: ()=>DEFAULT_CONTAINER_HEADER_HEIGHT_PX,
|
|
29
|
+
DEFAULT_CONTAINER_MIN_HEIGHT: ()=>DEFAULT_CONTAINER_MIN_HEIGHT,
|
|
35
30
|
DEFAULT_CONTAINER_MIN_WIDTH: ()=>DEFAULT_CONTAINER_MIN_WIDTH,
|
|
36
|
-
|
|
31
|
+
DEFAULT_LOOP_ICON: ()=>DEFAULT_LOOP_ICON,
|
|
32
|
+
DEFAULT_LOOP_TITLE: ()=>DEFAULT_LOOP_TITLE
|
|
37
33
|
});
|
|
38
|
-
const external_constants_cjs_namespaceObject = require("../../constants.cjs");
|
|
39
34
|
const DEFAULT_LOOP_ICON = 'repeat';
|
|
40
35
|
const DEFAULT_LOOP_TITLE = 'Loop';
|
|
41
36
|
const DEFAULT_CONTAINER_HEADER_HEIGHT_PX = 40;
|
|
42
|
-
const DEFAULT_CONTAINER_MIN_WIDTH =
|
|
43
|
-
const DEFAULT_CONTAINER_MIN_HEIGHT =
|
|
44
|
-
const
|
|
45
|
-
const CONTAINER_FRAME_INSET_PX = 12;
|
|
46
|
-
const DEFAULT_CONTAINER_SHELL_BACKGROUND = 'var(--canvas-background)';
|
|
47
|
-
const DEFAULT_CONTAINER_FRAME_BACKGROUND = 'var(--canvas-background)';
|
|
48
|
-
const DEFAULT_CONTAINER_FRAME_BORDER = 'var(--canvas-border)';
|
|
37
|
+
const DEFAULT_CONTAINER_MIN_WIDTH = 400;
|
|
38
|
+
const DEFAULT_CONTAINER_MIN_HEIGHT = 220;
|
|
39
|
+
const CONTAINER_FRAME_INSET_PX = 10;
|
|
49
40
|
exports.CONTAINER_FRAME_INSET_PX = __webpack_exports__.CONTAINER_FRAME_INSET_PX;
|
|
50
|
-
exports.CONTAINER_SHELL_RADIUS_PX = __webpack_exports__.CONTAINER_SHELL_RADIUS_PX;
|
|
51
|
-
exports.DEFAULT_CONTAINER_FRAME_BACKGROUND = __webpack_exports__.DEFAULT_CONTAINER_FRAME_BACKGROUND;
|
|
52
|
-
exports.DEFAULT_CONTAINER_FRAME_BORDER = __webpack_exports__.DEFAULT_CONTAINER_FRAME_BORDER;
|
|
53
41
|
exports.DEFAULT_CONTAINER_HEADER_HEIGHT_PX = __webpack_exports__.DEFAULT_CONTAINER_HEADER_HEIGHT_PX;
|
|
54
42
|
exports.DEFAULT_CONTAINER_MIN_HEIGHT = __webpack_exports__.DEFAULT_CONTAINER_MIN_HEIGHT;
|
|
55
43
|
exports.DEFAULT_CONTAINER_MIN_WIDTH = __webpack_exports__.DEFAULT_CONTAINER_MIN_WIDTH;
|
|
56
|
-
exports.DEFAULT_CONTAINER_SHELL_BACKGROUND = __webpack_exports__.DEFAULT_CONTAINER_SHELL_BACKGROUND;
|
|
57
44
|
exports.DEFAULT_LOOP_ICON = __webpack_exports__.DEFAULT_LOOP_ICON;
|
|
58
45
|
exports.DEFAULT_LOOP_TITLE = __webpack_exports__.DEFAULT_LOOP_TITLE;
|
|
59
46
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
60
47
|
"CONTAINER_FRAME_INSET_PX",
|
|
61
|
-
"CONTAINER_SHELL_RADIUS_PX",
|
|
62
|
-
"DEFAULT_CONTAINER_FRAME_BACKGROUND",
|
|
63
|
-
"DEFAULT_CONTAINER_FRAME_BORDER",
|
|
64
48
|
"DEFAULT_CONTAINER_HEADER_HEIGHT_PX",
|
|
65
49
|
"DEFAULT_CONTAINER_MIN_HEIGHT",
|
|
66
50
|
"DEFAULT_CONTAINER_MIN_WIDTH",
|
|
67
|
-
"DEFAULT_CONTAINER_SHELL_BACKGROUND",
|
|
68
51
|
"DEFAULT_LOOP_ICON",
|
|
69
52
|
"DEFAULT_LOOP_TITLE"
|
|
70
53
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
export declare const DEFAULT_LOOP_ICON = "repeat";
|
|
2
2
|
export declare const DEFAULT_LOOP_TITLE = "Loop";
|
|
3
3
|
export declare const DEFAULT_CONTAINER_HEADER_HEIGHT_PX = 40;
|
|
4
|
-
export declare const DEFAULT_CONTAINER_MIN_WIDTH
|
|
5
|
-
export declare const DEFAULT_CONTAINER_MIN_HEIGHT
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const CONTAINER_FRAME_INSET_PX = 12;
|
|
8
|
-
export declare const DEFAULT_CONTAINER_SHELL_BACKGROUND = "var(--canvas-background)";
|
|
9
|
-
export declare const DEFAULT_CONTAINER_FRAME_BACKGROUND = "var(--canvas-background)";
|
|
10
|
-
export declare const DEFAULT_CONTAINER_FRAME_BORDER = "var(--canvas-border)";
|
|
4
|
+
export declare const DEFAULT_CONTAINER_MIN_WIDTH = 400;
|
|
5
|
+
export declare const DEFAULT_CONTAINER_MIN_HEIGHT = 220;
|
|
6
|
+
export declare const CONTAINER_FRAME_INSET_PX = 10;
|
|
11
7
|
//# sourceMappingURL=LoopNode.constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoopNode.constants.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/LoopNode/LoopNode.constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LoopNode.constants.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/LoopNode/LoopNode.constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAC1C,eAAO,MAAM,kBAAkB,SAAS,CAAC;AACzC,eAAO,MAAM,kCAAkC,KAAK,CAAC;AAErD,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAC/C,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAChD,eAAO,MAAM,wBAAwB,KAAK,CAAC"}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import { GRID_SPACING } from "../../constants.js";
|
|
2
1
|
const DEFAULT_LOOP_ICON = 'repeat';
|
|
3
2
|
const DEFAULT_LOOP_TITLE = 'Loop';
|
|
4
3
|
const DEFAULT_CONTAINER_HEADER_HEIGHT_PX = 40;
|
|
5
|
-
const DEFAULT_CONTAINER_MIN_WIDTH =
|
|
6
|
-
const DEFAULT_CONTAINER_MIN_HEIGHT =
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
const DEFAULT_CONTAINER_SHELL_BACKGROUND = 'var(--canvas-background)';
|
|
10
|
-
const DEFAULT_CONTAINER_FRAME_BACKGROUND = 'var(--canvas-background)';
|
|
11
|
-
const DEFAULT_CONTAINER_FRAME_BORDER = 'var(--canvas-border)';
|
|
12
|
-
export { CONTAINER_FRAME_INSET_PX, CONTAINER_SHELL_RADIUS_PX, DEFAULT_CONTAINER_FRAME_BACKGROUND, DEFAULT_CONTAINER_FRAME_BORDER, DEFAULT_CONTAINER_HEADER_HEIGHT_PX, DEFAULT_CONTAINER_MIN_HEIGHT, DEFAULT_CONTAINER_MIN_WIDTH, DEFAULT_CONTAINER_SHELL_BACKGROUND, DEFAULT_LOOP_ICON, DEFAULT_LOOP_TITLE };
|
|
4
|
+
const DEFAULT_CONTAINER_MIN_WIDTH = 400;
|
|
5
|
+
const DEFAULT_CONTAINER_MIN_HEIGHT = 220;
|
|
6
|
+
const CONTAINER_FRAME_INSET_PX = 10;
|
|
7
|
+
export { CONTAINER_FRAME_INSET_PX, DEFAULT_CONTAINER_HEADER_HEIGHT_PX, DEFAULT_CONTAINER_MIN_HEIGHT, DEFAULT_CONTAINER_MIN_WIDTH, DEFAULT_LOOP_ICON, DEFAULT_LOOP_TITLE };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoopNode.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/LoopNode/LoopNode.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LoopNode.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/LoopNode/LoopNode.tsx"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAuEtD,iBAAS,iBAAiB,CAAC,KAAK,EAAE,aAAa,2CA0N9C;AAED,eAAO,MAAM,QAAQ,+DAA0B,CAAC"}
|
|
@@ -44,7 +44,7 @@ function isContainerNodeManifest(manifest) {
|
|
|
44
44
|
}
|
|
45
45
|
function resolveContainerHandleGroups(groups) {
|
|
46
46
|
return groups.map((group)=>{
|
|
47
|
-
const boundary =
|
|
47
|
+
const boundary = group.boundary ?? 'outer';
|
|
48
48
|
const position = group.position;
|
|
49
49
|
return {
|
|
50
50
|
...group,
|
|
@@ -12,7 +12,7 @@ function isContainerNodeManifest(manifest) {
|
|
|
12
12
|
}
|
|
13
13
|
function resolveContainerHandleGroups(groups) {
|
|
14
14
|
return groups.map((group)=>{
|
|
15
|
-
const boundary =
|
|
15
|
+
const boundary = group.boundary ?? 'outer';
|
|
16
16
|
const position = group.position;
|
|
17
17
|
return {
|
|
18
18
|
...group,
|
|
@@ -18,29 +18,29 @@ import { getStatusBorder } from "../BaseNode/BaseNodeContainer.js";
|
|
|
18
18
|
import { MissingManifestNode } from "../BaseNode/BaseNodeMissingManifest.js";
|
|
19
19
|
import { ButtonHandles } from "../ButtonHandle/index.js";
|
|
20
20
|
import { NodeToolbar } from "../Toolbar/index.js";
|
|
21
|
-
import {
|
|
21
|
+
import { DEFAULT_CONTAINER_MIN_HEIGHT, DEFAULT_CONTAINER_MIN_WIDTH, DEFAULT_LOOP_ICON, DEFAULT_LOOP_TITLE } from "./LoopNode.constants.js";
|
|
22
22
|
import { resolveContainerHandleGroups } from "./LoopNode.helpers.js";
|
|
23
23
|
const EMPTY_DATA = {};
|
|
24
24
|
const RESIZE_CONTROLS = [
|
|
25
25
|
{
|
|
26
26
|
position: 'top-left',
|
|
27
27
|
cursor: 'nwse-resize',
|
|
28
|
-
indicatorClassName: 'top-[-
|
|
28
|
+
indicatorClassName: 'top-[-4px] left-[-4px]'
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
31
|
position: 'top-right',
|
|
32
32
|
cursor: 'nesw-resize',
|
|
33
|
-
indicatorClassName: 'top-[-
|
|
33
|
+
indicatorClassName: 'top-[-4px] right-[-4px]'
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
36
|
position: 'bottom-left',
|
|
37
37
|
cursor: 'nesw-resize',
|
|
38
|
-
indicatorClassName: 'bottom-[-
|
|
38
|
+
indicatorClassName: 'bottom-[-4px] left-[-4px]'
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
position: 'bottom-right',
|
|
42
42
|
cursor: 'nwse-resize',
|
|
43
|
-
indicatorClassName: 'bottom-[-
|
|
43
|
+
indicatorClassName: 'bottom-[-4px] right-[-4px]'
|
|
44
44
|
}
|
|
45
45
|
];
|
|
46
46
|
const RESIZE_CONTROL_STYLE = {
|
|
@@ -137,6 +137,8 @@ function LoopNodeComponent(props) {
|
|
|
137
137
|
]);
|
|
138
138
|
const displayTitle = display.label ?? DEFAULT_LOOP_TITLE;
|
|
139
139
|
const displayIcon = display.icon ?? DEFAULT_LOOP_ICON;
|
|
140
|
+
const isParallel = true === resolvedData.parallel;
|
|
141
|
+
const isDropTarget = true === resolvedData.isDropTarget;
|
|
140
142
|
const containerWidth = width || DEFAULT_CONTAINER_WIDTH;
|
|
141
143
|
const containerHeight = height || DEFAULT_CONTAINER_HEIGHT;
|
|
142
144
|
const nodeSizeStyle = {
|
|
@@ -212,11 +214,12 @@ function LoopNodeComponent(props) {
|
|
|
212
214
|
"data-suggestion-type": suggestionType,
|
|
213
215
|
"data-validation-status": validationState?.validationStatus,
|
|
214
216
|
"aria-busy": resolvedData.loading || void 0,
|
|
215
|
-
className: cn('group/loop-shell relative flex h-full w-full flex-col overflow-visible border bg-
|
|
217
|
+
className: cn('group/loop-shell relative box-border flex h-full w-full flex-col overflow-visible rounded-[20px] border bg-transparent', 'transition-[border-color,box-shadow,opacity] shadow-(--canvas-node-shadow-rest)', 'border-border-subtle', getStatusBorder(suggestionType ?? validationState?.validationStatus ?? executionStatus), isHovered && 'shadow-(--canvas-node-shadow-hover) border-border-hover', selected && 'outline outline-2 outline-foreground-accent-muted', isDropTarget && 'bg-surface-hover outline outline-2 outline-brand', 'drag' === interactionState && 'cursor-grabbing shadow-(--canvas-node-shadow-lifted)'),
|
|
216
218
|
style: {
|
|
217
219
|
...nodeSizeStyle,
|
|
218
|
-
|
|
219
|
-
|
|
220
|
+
...display.background ? {
|
|
221
|
+
background: display.background
|
|
222
|
+
} : {}
|
|
220
223
|
},
|
|
221
224
|
onMouseEnter: handleMouseEnter,
|
|
222
225
|
onMouseLeave: handleMouseLeave,
|
|
@@ -235,7 +238,8 @@ function LoopNodeComponent(props) {
|
|
|
235
238
|
/*#__PURE__*/ jsx(Header, {
|
|
236
239
|
title: displayTitle,
|
|
237
240
|
icon: displayIcon,
|
|
238
|
-
loading: isLoading
|
|
241
|
+
loading: isLoading,
|
|
242
|
+
isParallel: isParallel
|
|
239
243
|
}),
|
|
240
244
|
/*#__PURE__*/ jsx(BodyFrame, {
|
|
241
245
|
isEmpty: showEmptyStateButton,
|
|
@@ -266,11 +270,11 @@ function LoopNodeComponent(props) {
|
|
|
266
270
|
});
|
|
267
271
|
}
|
|
268
272
|
const LoopNode = /*#__PURE__*/ memo(LoopNodeComponent);
|
|
269
|
-
function Header({ title, icon, loading }) {
|
|
273
|
+
function Header({ title, icon, loading, isParallel }) {
|
|
270
274
|
const titleContent = loading ? /*#__PURE__*/ jsx("div", {
|
|
271
275
|
className: "h-5 w-28 animate-pulse rounded bg-(--canvas-background-overlay)"
|
|
272
276
|
}) : /*#__PURE__*/ jsx("span", {
|
|
273
|
-
className: "truncate text-[
|
|
277
|
+
className: "truncate text-[15px] font-semibold leading-5 tracking-normal",
|
|
274
278
|
children: title
|
|
275
279
|
});
|
|
276
280
|
const iconContent = loading ? /*#__PURE__*/ jsx("div", {
|
|
@@ -283,16 +287,32 @@ function Header({ title, icon, loading }) {
|
|
|
283
287
|
size: 16
|
|
284
288
|
})
|
|
285
289
|
}) : null;
|
|
286
|
-
return /*#__PURE__*/
|
|
287
|
-
className: "flex shrink-0 items-center justify-between gap-2.5
|
|
290
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
291
|
+
className: "flex shrink-0 cursor-grab items-center justify-between gap-2.5 px-3.5 pt-2.5 text-foreground active:cursor-grabbing",
|
|
288
292
|
"data-testid": "loop-node-header",
|
|
289
|
-
children:
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
293
|
+
children: [
|
|
294
|
+
/*#__PURE__*/ jsxs("div", {
|
|
295
|
+
className: "flex min-w-0 items-center gap-2.5",
|
|
296
|
+
children: [
|
|
297
|
+
iconContent,
|
|
298
|
+
titleContent
|
|
299
|
+
]
|
|
300
|
+
}),
|
|
301
|
+
/*#__PURE__*/ jsxs("span", {
|
|
302
|
+
className: "flex shrink-0 items-center gap-1 rounded-full border border-border-subtle bg-transparent px-2.5 py-0.5 text-[11px] font-semibold leading-4 text-foreground",
|
|
303
|
+
children: [
|
|
304
|
+
/*#__PURE__*/ jsx("span", {
|
|
305
|
+
className: cn('flex shrink-0', isParallel && 'rotate-90'),
|
|
306
|
+
"aria-hidden": true,
|
|
307
|
+
children: /*#__PURE__*/ jsx(CanvasIcon, {
|
|
308
|
+
icon: "align-justify",
|
|
309
|
+
size: 11
|
|
310
|
+
})
|
|
311
|
+
}),
|
|
312
|
+
isParallel ? 'Parallel' : 'Sequential'
|
|
313
|
+
]
|
|
314
|
+
})
|
|
315
|
+
]
|
|
296
316
|
});
|
|
297
317
|
}
|
|
298
318
|
function EmptyState({ onAddFirstChild }) {
|
|
@@ -311,12 +331,7 @@ function BodyFrame({ isEmpty, isLoading, onAddFirstChild }) {
|
|
|
311
331
|
return /*#__PURE__*/ jsxs("div", {
|
|
312
332
|
"data-testid": "loop-body-frame",
|
|
313
333
|
"data-empty": isEmpty ? 'true' : 'false',
|
|
314
|
-
className: cn('relative flex flex-1 rounded-[
|
|
315
|
-
style: {
|
|
316
|
-
margin: CONTAINER_FRAME_INSET_PX,
|
|
317
|
-
background: DEFAULT_CONTAINER_FRAME_BACKGROUND,
|
|
318
|
-
borderColor: DEFAULT_CONTAINER_FRAME_BORDER
|
|
319
|
-
},
|
|
334
|
+
className: cn('relative m-2.5 flex flex-1 rounded-xl border-[1.5px] border-dashed border-border-subtle bg-transparent', 'pointer-events-none', isEmpty && 'items-center justify-center'),
|
|
320
335
|
children: [
|
|
321
336
|
isLoading ? /*#__PURE__*/ jsx("div", {
|
|
322
337
|
className: "m-6 h-14 w-full animate-pulse rounded-[18px] bg-(--canvas-background-overlay)"
|
|
@@ -348,7 +363,7 @@ function ResizeCornerIndicators({ visible }) {
|
|
|
348
363
|
return /*#__PURE__*/ jsx(Fragment, {
|
|
349
364
|
children: RESIZE_CONTROLS.map(({ position, indicatorClassName })=>/*#__PURE__*/ jsx("div", {
|
|
350
365
|
"aria-hidden": true,
|
|
351
|
-
className: cn('pointer-events-none absolute h-
|
|
366
|
+
className: cn('pointer-events-none absolute h-2 w-2 rounded-full bg-brand transition-opacity', indicatorClassName, visible ? 'opacity-100' : 'opacity-0')
|
|
352
367
|
}, position))
|
|
353
368
|
});
|
|
354
369
|
}
|
|
@@ -60,8 +60,8 @@ const PREVIEW_EDGE_ID = 'preview-edge-id';
|
|
|
60
60
|
const DEFAULT_SOURCE_HANDLE_ID = 'output';
|
|
61
61
|
const DEFAULT_NODE_SIZE = 96;
|
|
62
62
|
const GRID_SPACING = 16;
|
|
63
|
-
const DEFAULT_CONTAINER_WIDTH =
|
|
64
|
-
const DEFAULT_CONTAINER_HEIGHT =
|
|
63
|
+
const DEFAULT_CONTAINER_WIDTH = 35 * GRID_SPACING;
|
|
64
|
+
const DEFAULT_CONTAINER_HEIGHT = 20 * GRID_SPACING;
|
|
65
65
|
const CANVAS_COMPACT_BREAKPOINT = 600;
|
|
66
66
|
const TOOLBOX_WIDTH = 320;
|
|
67
67
|
const TOOLBOX_HEIGHT = 440;
|
package/dist/canvas/constants.js
CHANGED
|
@@ -3,8 +3,8 @@ const PREVIEW_EDGE_ID = 'preview-edge-id';
|
|
|
3
3
|
const DEFAULT_SOURCE_HANDLE_ID = 'output';
|
|
4
4
|
const DEFAULT_NODE_SIZE = 96;
|
|
5
5
|
const GRID_SPACING = 16;
|
|
6
|
-
const DEFAULT_CONTAINER_WIDTH =
|
|
7
|
-
const DEFAULT_CONTAINER_HEIGHT =
|
|
6
|
+
const DEFAULT_CONTAINER_WIDTH = 35 * GRID_SPACING;
|
|
7
|
+
const DEFAULT_CONTAINER_HEIGHT = 20 * GRID_SPACING;
|
|
8
8
|
const CANVAS_COMPACT_BREAKPOINT = 600;
|
|
9
9
|
const TOOLBOX_WIDTH = 320;
|
|
10
10
|
const TOOLBOX_HEIGHT = 440;
|