@uipath/apollo-react 4.22.3 → 4.23.0-pr654.3fb62d6
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/AgentCanvas/agent-flow.manifest.d.ts +2 -2
- package/dist/canvas/components/BaseNode/BaseNode.cjs +11 -3
- package/dist/canvas/components/BaseNode/BaseNode.d.ts.map +1 -1
- package/dist/canvas/components/BaseNode/BaseNode.js +11 -3
- package/dist/canvas/components/LoopNode/LoopNode.cjs +32 -4
- package/dist/canvas/components/LoopNode/LoopNode.d.ts.map +1 -1
- package/dist/canvas/components/LoopNode/LoopNode.js +33 -5
- package/dist/canvas/components/Toolbox/ListView.cjs +6 -1
- package/dist/canvas/components/Toolbox/ListView.d.ts.map +1 -1
- package/dist/canvas/components/Toolbox/ListView.js +6 -1
- package/dist/canvas/components/index.cjs +19 -12
- package/dist/canvas/components/index.d.ts +1 -0
- package/dist/canvas/components/index.d.ts.map +1 -1
- package/dist/canvas/components/index.js +1 -0
- package/dist/canvas/components/shared/InitialsBadge.cjs +91 -0
- package/dist/canvas/components/shared/InitialsBadge.d.ts +10 -0
- package/dist/canvas/components/shared/InitialsBadge.d.ts.map +1 -0
- package/dist/canvas/components/shared/InitialsBadge.js +44 -0
- package/dist/canvas/components/shared/index.cjs +39 -0
- package/dist/canvas/components/shared/index.d.ts +3 -0
- package/dist/canvas/components/shared/index.d.ts.map +1 -0
- package/dist/canvas/components/shared/index.js +2 -0
- package/dist/canvas/core/CategoryTreeAdapter.cjs +10 -6
- package/dist/canvas/core/CategoryTreeAdapter.js +10 -6
- package/dist/canvas/schema/node-definition/category-manifest.cjs +1 -1
- package/dist/canvas/schema/node-definition/category-manifest.d.ts +1 -1
- package/dist/canvas/schema/node-definition/category-manifest.js +1 -1
- package/dist/canvas/schema/node-definition/node-manifest.cjs +1 -1
- package/dist/canvas/schema/node-definition/node-manifest.d.ts +2 -2
- package/dist/canvas/schema/node-definition/node-manifest.js +1 -1
- package/dist/canvas/storybook-utils/manifests/index.d.ts +2 -2
- package/dist/canvas/storybook-utils/manifests/node-definitions.d.ts.map +1 -1
- package/dist/canvas/utils/container.cjs +47 -0
- package/dist/canvas/utils/container.d.ts +12 -0
- package/dist/canvas/utils/container.d.ts.map +1 -1
- package/dist/canvas/utils/container.js +45 -1
- package/dist/canvas/utils/icon-registry.cjs +8 -0
- package/dist/canvas/utils/icon-registry.d.ts +1 -1
- package/dist/canvas/utils/icon-registry.d.ts.map +1 -1
- package/dist/canvas/utils/icon-registry.js +8 -0
- package/dist/canvas/utils/manifest-resolver.cjs +2 -1
- package/dist/canvas/utils/manifest-resolver.d.ts.map +1 -1
- package/dist/canvas/utils/manifest-resolver.js +2 -1
- package/package.json +1 -1
|
@@ -14,11 +14,11 @@ export declare const agentFlowManifest: {
|
|
|
14
14
|
id: string;
|
|
15
15
|
name: string;
|
|
16
16
|
sortOrder: number;
|
|
17
|
-
icon: string;
|
|
18
17
|
tags: string[];
|
|
19
18
|
parentId?: string | undefined;
|
|
20
19
|
color?: string | undefined;
|
|
21
20
|
colorDark?: string | undefined;
|
|
21
|
+
icon?: string | undefined;
|
|
22
22
|
}[];
|
|
23
23
|
nodes: {
|
|
24
24
|
nodeType: string;
|
|
@@ -27,9 +27,9 @@ export declare const agentFlowManifest: {
|
|
|
27
27
|
sortOrder: number;
|
|
28
28
|
display: {
|
|
29
29
|
label: string;
|
|
30
|
-
icon: string;
|
|
31
30
|
canvasLabel?: string | undefined;
|
|
32
31
|
description?: string | undefined;
|
|
32
|
+
icon?: string | undefined;
|
|
33
33
|
shape?: "square" | "circle" | "container" | "rectangle" | undefined;
|
|
34
34
|
color?: string | undefined;
|
|
35
35
|
background?: string | undefined;
|
|
@@ -43,6 +43,7 @@ const ConnectedHandlesContext_cjs_namespaceObject = require("../BaseCanvas/Conne
|
|
|
43
43
|
const SelectionStateContext_cjs_namespaceObject = require("../BaseCanvas/SelectionStateContext.cjs");
|
|
44
44
|
const SmartHandle_cjs_namespaceObject = require("../ButtonHandle/SmartHandle.cjs");
|
|
45
45
|
const useButtonHandles_cjs_namespaceObject = require("../ButtonHandle/useButtonHandles.cjs");
|
|
46
|
+
const InitialsBadge_cjs_namespaceObject = require("../shared/InitialsBadge.cjs");
|
|
46
47
|
const external_Toolbar_index_cjs_namespaceObject = require("../Toolbar/index.cjs");
|
|
47
48
|
const external_BaseNodeBadgeSlot_cjs_namespaceObject = require("./BaseNodeBadgeSlot.cjs");
|
|
48
49
|
const external_BaseNodeConfigContext_cjs_namespaceObject = require("./BaseNodeConfigContext.cjs");
|
|
@@ -124,11 +125,18 @@ const BaseNodeComponent = (props)=>{
|
|
|
124
125
|
const isStacked = Boolean(manifest?.drillable || data?.isCollapsed);
|
|
125
126
|
const Icon = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
126
127
|
if (void 0 !== iconComponent) return iconComponent;
|
|
127
|
-
|
|
128
|
-
|
|
128
|
+
if (display.icon) {
|
|
129
|
+
const IconComponent = (0, icon_registry_cjs_namespaceObject.getIcon)(display.icon);
|
|
130
|
+
return IconComponent ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(IconComponent, {}) : null;
|
|
131
|
+
}
|
|
132
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(InitialsBadge_cjs_namespaceObject.InitialsBadge, {
|
|
133
|
+
name: display.label,
|
|
134
|
+
size: "var(--icon-size)"
|
|
135
|
+
});
|
|
129
136
|
}, [
|
|
130
137
|
iconComponent,
|
|
131
|
-
display.icon
|
|
138
|
+
display.icon,
|
|
139
|
+
display.label
|
|
132
140
|
]);
|
|
133
141
|
const handleConfigurations = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
134
142
|
if (handleConfigurationsProp && Array.isArray(handleConfigurationsProp)) return handleConfigurationsProp;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseNode.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/BaseNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;
|
|
1
|
+
{"version":3,"file":"BaseNode.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/BaseNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AAwChF,OAAO,KAAK,EACV,YAAY,EAIb,MAAM,kBAAkB,CAAC;AAynB1B,eAAO,MAAM,QAAQ,8CAnlBa,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,6CAmlBhB,CAAC"}
|
|
@@ -15,6 +15,7 @@ import { useConnectedHandles } from "../BaseCanvas/ConnectedHandlesContext.js";
|
|
|
15
15
|
import { useSelectionState } from "../BaseCanvas/SelectionStateContext.js";
|
|
16
16
|
import { SmartHandle, SmartHandleProvider } from "../ButtonHandle/SmartHandle.js";
|
|
17
17
|
import { useButtonHandles } from "../ButtonHandle/useButtonHandles.js";
|
|
18
|
+
import { InitialsBadge } from "../shared/InitialsBadge.js";
|
|
18
19
|
import { NodeToolbar } from "../Toolbar/index.js";
|
|
19
20
|
import { BaseBadgeSlot } from "./BaseNodeBadgeSlot.js";
|
|
20
21
|
import { useBaseNodeOverrideConfig } from "./BaseNodeConfigContext.js";
|
|
@@ -96,11 +97,18 @@ const BaseNodeComponent = (props)=>{
|
|
|
96
97
|
const isStacked = Boolean(manifest?.drillable || data?.isCollapsed);
|
|
97
98
|
const Icon = useMemo(()=>{
|
|
98
99
|
if (void 0 !== iconComponent) return iconComponent;
|
|
99
|
-
|
|
100
|
-
|
|
100
|
+
if (display.icon) {
|
|
101
|
+
const IconComponent = getIcon(display.icon);
|
|
102
|
+
return IconComponent ? /*#__PURE__*/ jsx(IconComponent, {}) : null;
|
|
103
|
+
}
|
|
104
|
+
return /*#__PURE__*/ jsx(InitialsBadge, {
|
|
105
|
+
name: display.label,
|
|
106
|
+
size: "var(--icon-size)"
|
|
107
|
+
});
|
|
101
108
|
}, [
|
|
102
109
|
iconComponent,
|
|
103
|
-
display.icon
|
|
110
|
+
display.icon,
|
|
111
|
+
display.label
|
|
104
112
|
]);
|
|
105
113
|
const handleConfigurations = useMemo(()=>{
|
|
106
114
|
if (handleConfigurationsProp && Array.isArray(handleConfigurationsProp)) return handleConfigurationsProp;
|
|
@@ -30,6 +30,7 @@ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
|
30
30
|
const react_cjs_namespaceObject = require("../../xyflow/react.cjs");
|
|
31
31
|
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
32
32
|
const external_react_namespaceObject = require("react");
|
|
33
|
+
const shallow_namespaceObject = require("zustand/shallow");
|
|
33
34
|
const index_cjs_namespaceObject = require("../../core/index.cjs");
|
|
34
35
|
const external_hooks_index_cjs_namespaceObject = require("../../hooks/index.cjs");
|
|
35
36
|
const adornment_resolver_cjs_namespaceObject = require("../../utils/adornment-resolver.cjs");
|
|
@@ -53,21 +54,29 @@ const EMPTY_DATA = {};
|
|
|
53
54
|
const RESIZE_CONTROLS = [
|
|
54
55
|
{
|
|
55
56
|
position: 'top-left',
|
|
57
|
+
widthSide: 'left',
|
|
58
|
+
heightSide: 'top',
|
|
56
59
|
cursor: 'nwse-resize',
|
|
57
60
|
indicatorClassName: 'top-[-4px] left-[-4px]'
|
|
58
61
|
},
|
|
59
62
|
{
|
|
60
63
|
position: 'top-right',
|
|
64
|
+
widthSide: 'right',
|
|
65
|
+
heightSide: 'top',
|
|
61
66
|
cursor: 'nesw-resize',
|
|
62
67
|
indicatorClassName: 'top-[-4px] right-[-4px]'
|
|
63
68
|
},
|
|
64
69
|
{
|
|
65
70
|
position: 'bottom-left',
|
|
71
|
+
widthSide: 'left',
|
|
72
|
+
heightSide: 'bottom',
|
|
66
73
|
cursor: 'nesw-resize',
|
|
67
74
|
indicatorClassName: 'bottom-[-4px] left-[-4px]'
|
|
68
75
|
},
|
|
69
76
|
{
|
|
70
77
|
position: 'bottom-right',
|
|
78
|
+
widthSide: 'right',
|
|
79
|
+
heightSide: 'bottom',
|
|
71
80
|
cursor: 'nwse-resize',
|
|
72
81
|
indicatorClassName: 'bottom-[-4px] right-[-4px]'
|
|
73
82
|
}
|
|
@@ -77,6 +86,12 @@ const RESIZE_CONTROL_STYLE = {
|
|
|
77
86
|
border: 'none',
|
|
78
87
|
zIndex: 100
|
|
79
88
|
};
|
|
89
|
+
const DEFAULT_RESIZE_MINIMUMS = {
|
|
90
|
+
left: container_cjs_namespaceObject.DEFAULT_CONTAINER_MIN_WIDTH,
|
|
91
|
+
right: container_cjs_namespaceObject.DEFAULT_CONTAINER_MIN_WIDTH,
|
|
92
|
+
top: container_cjs_namespaceObject.DEFAULT_CONTAINER_MIN_HEIGHT,
|
|
93
|
+
bottom: container_cjs_namespaceObject.DEFAULT_CONTAINER_MIN_HEIGHT
|
|
94
|
+
};
|
|
80
95
|
const ADORNMENT_SLOT_POSITIONS = [
|
|
81
96
|
'topLeft',
|
|
82
97
|
'topRight',
|
|
@@ -101,6 +116,17 @@ function useHasChildNodes(id, enabled) {
|
|
|
101
116
|
enabled
|
|
102
117
|
]));
|
|
103
118
|
}
|
|
119
|
+
function useContainerResizeMinimums(id, width, height) {
|
|
120
|
+
return (0, react_cjs_namespaceObject.useStore)((0, external_react_namespaceObject.useCallback)((state)=>(0, container_cjs_namespaceObject.getContainerResizeMinimums)({
|
|
121
|
+
id,
|
|
122
|
+
width,
|
|
123
|
+
height
|
|
124
|
+
}, state.nodes), [
|
|
125
|
+
height,
|
|
126
|
+
id,
|
|
127
|
+
width
|
|
128
|
+
]), shallow_namespaceObject.shallow);
|
|
129
|
+
}
|
|
104
130
|
function useContainerNodeInternalsRefresh(id, handleGroups, width, height) {
|
|
105
131
|
const updateNodeInternals = (0, react_cjs_namespaceObject.useUpdateNodeInternals)();
|
|
106
132
|
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
@@ -170,6 +196,7 @@ function LoopNodeComponent(props) {
|
|
|
170
196
|
const isDropTarget = true === resolvedData.isDropTarget;
|
|
171
197
|
const containerWidth = width || container_cjs_namespaceObject.DEFAULT_CONTAINER_WIDTH;
|
|
172
198
|
const containerHeight = height || container_cjs_namespaceObject.DEFAULT_CONTAINER_HEIGHT;
|
|
199
|
+
const resizeMinimums = useContainerResizeMinimums(id, containerWidth, containerHeight);
|
|
173
200
|
const nodeSizeStyle = {
|
|
174
201
|
width: containerWidth,
|
|
175
202
|
height: containerHeight,
|
|
@@ -262,6 +289,7 @@ function LoopNodeComponent(props) {
|
|
|
262
289
|
visible: showResizeControls
|
|
263
290
|
}),
|
|
264
291
|
showResizeControls ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ResizeControls, {
|
|
292
|
+
minimums: resizeMinimums,
|
|
265
293
|
onResize: handleResize
|
|
266
294
|
}) : null,
|
|
267
295
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Header, {
|
|
@@ -371,13 +399,13 @@ function BodyFrame({ isEmpty, isLoading }) {
|
|
|
371
399
|
}) : null
|
|
372
400
|
});
|
|
373
401
|
}
|
|
374
|
-
function ResizeControls({ onResize }) {
|
|
402
|
+
function ResizeControls({ minimums = DEFAULT_RESIZE_MINIMUMS, onResize }) {
|
|
375
403
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(jsx_runtime_namespaceObject.Fragment, {
|
|
376
|
-
children: RESIZE_CONTROLS.map(({ position, cursor })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_cjs_namespaceObject.NodeResizeControl, {
|
|
404
|
+
children: RESIZE_CONTROLS.map(({ position, widthSide, heightSide, cursor })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_cjs_namespaceObject.NodeResizeControl, {
|
|
377
405
|
style: RESIZE_CONTROL_STYLE,
|
|
378
406
|
position: position,
|
|
379
|
-
minWidth:
|
|
380
|
-
minHeight:
|
|
407
|
+
minWidth: minimums[widthSide],
|
|
408
|
+
minHeight: minimums[heightSide],
|
|
381
409
|
onResize: onResize,
|
|
382
410
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
383
411
|
className: "absolute bottom-0 right-0 h-5 w-5 pointer-events-auto",
|
|
@@ -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":"AAqCA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AA8GtD,iBAAS,iBAAiB,CAAC,KAAK,EAAE,aAAa,2CAmO9C;AAED,eAAO,MAAM,QAAQ,+DAA0B,CAAC"}
|
|
@@ -2,10 +2,11 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { NodeResizeControl, useStore, useUpdateNodeInternals } from "../../xyflow/react.js";
|
|
3
3
|
import { cn } from "@uipath/apollo-wind";
|
|
4
4
|
import { memo, useCallback, useEffect, useMemo, useState } from "react";
|
|
5
|
+
import { shallow } from "zustand/shallow";
|
|
5
6
|
import { useOptionalNodeTypeRegistry } from "../../core/index.js";
|
|
6
7
|
import { useElementValidationStatus, useNodeExecutionState } from "../../hooks/index.js";
|
|
7
8
|
import { resolveAdornments } from "../../utils/adornment-resolver.js";
|
|
8
|
-
import { DEFAULT_CONTAINER_HEIGHT, DEFAULT_CONTAINER_MIN_HEIGHT, DEFAULT_CONTAINER_MIN_WIDTH, DEFAULT_CONTAINER_WIDTH } from "../../utils/container.js";
|
|
9
|
+
import { DEFAULT_CONTAINER_HEIGHT, DEFAULT_CONTAINER_MIN_HEIGHT, DEFAULT_CONTAINER_MIN_WIDTH, DEFAULT_CONTAINER_WIDTH, getContainerResizeMinimums } from "../../utils/container.js";
|
|
9
10
|
import { CanvasIcon } from "../../utils/icon-registry.js";
|
|
10
11
|
import { resolveDisplay, resolveHandles } from "../../utils/manifest-resolver.js";
|
|
11
12
|
import { selectIsConnecting, snapToGrid } from "../../utils/NodeUtils.js";
|
|
@@ -25,21 +26,29 @@ const EMPTY_DATA = {};
|
|
|
25
26
|
const RESIZE_CONTROLS = [
|
|
26
27
|
{
|
|
27
28
|
position: 'top-left',
|
|
29
|
+
widthSide: 'left',
|
|
30
|
+
heightSide: 'top',
|
|
28
31
|
cursor: 'nwse-resize',
|
|
29
32
|
indicatorClassName: 'top-[-4px] left-[-4px]'
|
|
30
33
|
},
|
|
31
34
|
{
|
|
32
35
|
position: 'top-right',
|
|
36
|
+
widthSide: 'right',
|
|
37
|
+
heightSide: 'top',
|
|
33
38
|
cursor: 'nesw-resize',
|
|
34
39
|
indicatorClassName: 'top-[-4px] right-[-4px]'
|
|
35
40
|
},
|
|
36
41
|
{
|
|
37
42
|
position: 'bottom-left',
|
|
43
|
+
widthSide: 'left',
|
|
44
|
+
heightSide: 'bottom',
|
|
38
45
|
cursor: 'nesw-resize',
|
|
39
46
|
indicatorClassName: 'bottom-[-4px] left-[-4px]'
|
|
40
47
|
},
|
|
41
48
|
{
|
|
42
49
|
position: 'bottom-right',
|
|
50
|
+
widthSide: 'right',
|
|
51
|
+
heightSide: 'bottom',
|
|
43
52
|
cursor: 'nwse-resize',
|
|
44
53
|
indicatorClassName: 'bottom-[-4px] right-[-4px]'
|
|
45
54
|
}
|
|
@@ -49,6 +58,12 @@ const RESIZE_CONTROL_STYLE = {
|
|
|
49
58
|
border: 'none',
|
|
50
59
|
zIndex: 100
|
|
51
60
|
};
|
|
61
|
+
const DEFAULT_RESIZE_MINIMUMS = {
|
|
62
|
+
left: DEFAULT_CONTAINER_MIN_WIDTH,
|
|
63
|
+
right: DEFAULT_CONTAINER_MIN_WIDTH,
|
|
64
|
+
top: DEFAULT_CONTAINER_MIN_HEIGHT,
|
|
65
|
+
bottom: DEFAULT_CONTAINER_MIN_HEIGHT
|
|
66
|
+
};
|
|
52
67
|
const ADORNMENT_SLOT_POSITIONS = [
|
|
53
68
|
'topLeft',
|
|
54
69
|
'topRight',
|
|
@@ -73,6 +88,17 @@ function useHasChildNodes(id, enabled) {
|
|
|
73
88
|
enabled
|
|
74
89
|
]));
|
|
75
90
|
}
|
|
91
|
+
function useContainerResizeMinimums(id, width, height) {
|
|
92
|
+
return useStore(useCallback((state)=>getContainerResizeMinimums({
|
|
93
|
+
id,
|
|
94
|
+
width,
|
|
95
|
+
height
|
|
96
|
+
}, state.nodes), [
|
|
97
|
+
height,
|
|
98
|
+
id,
|
|
99
|
+
width
|
|
100
|
+
]), shallow);
|
|
101
|
+
}
|
|
76
102
|
function useContainerNodeInternalsRefresh(id, handleGroups, width, height) {
|
|
77
103
|
const updateNodeInternals = useUpdateNodeInternals();
|
|
78
104
|
useEffect(()=>{
|
|
@@ -142,6 +168,7 @@ function LoopNodeComponent(props) {
|
|
|
142
168
|
const isDropTarget = true === resolvedData.isDropTarget;
|
|
143
169
|
const containerWidth = width || DEFAULT_CONTAINER_WIDTH;
|
|
144
170
|
const containerHeight = height || DEFAULT_CONTAINER_HEIGHT;
|
|
171
|
+
const resizeMinimums = useContainerResizeMinimums(id, containerWidth, containerHeight);
|
|
145
172
|
const nodeSizeStyle = {
|
|
146
173
|
width: containerWidth,
|
|
147
174
|
height: containerHeight,
|
|
@@ -234,6 +261,7 @@ function LoopNodeComponent(props) {
|
|
|
234
261
|
visible: showResizeControls
|
|
235
262
|
}),
|
|
236
263
|
showResizeControls ? /*#__PURE__*/ jsx(ResizeControls, {
|
|
264
|
+
minimums: resizeMinimums,
|
|
237
265
|
onResize: handleResize
|
|
238
266
|
}) : null,
|
|
239
267
|
/*#__PURE__*/ jsx(Header, {
|
|
@@ -343,13 +371,13 @@ function BodyFrame({ isEmpty, isLoading }) {
|
|
|
343
371
|
}) : null
|
|
344
372
|
});
|
|
345
373
|
}
|
|
346
|
-
function ResizeControls({ onResize }) {
|
|
374
|
+
function ResizeControls({ minimums = DEFAULT_RESIZE_MINIMUMS, onResize }) {
|
|
347
375
|
return /*#__PURE__*/ jsx(Fragment, {
|
|
348
|
-
children: RESIZE_CONTROLS.map(({ position, cursor })=>/*#__PURE__*/ jsx(NodeResizeControl, {
|
|
376
|
+
children: RESIZE_CONTROLS.map(({ position, widthSide, heightSide, cursor })=>/*#__PURE__*/ jsx(NodeResizeControl, {
|
|
349
377
|
style: RESIZE_CONTROL_STYLE,
|
|
350
378
|
position: position,
|
|
351
|
-
minWidth:
|
|
352
|
-
minHeight:
|
|
379
|
+
minWidth: minimums[widthSide],
|
|
380
|
+
minHeight: minimums[heightSide],
|
|
353
381
|
onResize: onResize,
|
|
354
382
|
children: /*#__PURE__*/ jsx("div", {
|
|
355
383
|
className: "absolute bottom-0 right-0 h-5 w-5 pointer-events-auto",
|
|
@@ -34,6 +34,7 @@ const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
|
34
34
|
const external_react_namespaceObject = require("react");
|
|
35
35
|
const CanvasThemeContext_cjs_namespaceObject = require("../BaseCanvas/CanvasThemeContext.cjs");
|
|
36
36
|
const external_CanvasTooltip_cjs_namespaceObject = require("../CanvasTooltip.cjs");
|
|
37
|
+
const InitialsBadge_cjs_namespaceObject = require("../shared/InitialsBadge.cjs");
|
|
37
38
|
const external_ListView_styles_cjs_namespaceObject = require("./ListView.styles.cjs");
|
|
38
39
|
const DEFAULT_SKELETON_COUNT = 3;
|
|
39
40
|
function buildRenderedItems(items, enableSections, loadingSkeleton) {
|
|
@@ -162,7 +163,11 @@ const ListViewRow = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({ in
|
|
|
162
163
|
icon: item.icon.name,
|
|
163
164
|
size: 24
|
|
164
165
|
}),
|
|
165
|
-
item.icon?.Component && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(item.icon.Component, {})
|
|
166
|
+
item.icon?.Component && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(item.icon.Component, {}),
|
|
167
|
+
!item.icon?.url && !item.icon?.name && !item.icon?.Component && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(InitialsBadge_cjs_namespaceObject.InitialsBadge, {
|
|
168
|
+
name: item.name,
|
|
169
|
+
"data-testid": "list-item-initials-badge"
|
|
170
|
+
})
|
|
166
171
|
]
|
|
167
172
|
}),
|
|
168
173
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(index_cjs_namespaceObject.Column, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListView.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Toolbox/ListView.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAqB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"ListView.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Toolbox/ListView.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAqB,MAAM,cAAc,CAAC;AAMzE,MAAM,WAAW,YAAY;IAI3B,IAAI,CAAC,EAAE,MAAM,CAAC;IAId,GAAG,CAAC,EAAE,MAAM,CAAC;IAIb,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CACjC;AAUD,MAAM,MAAM,mBAAmB,GAAG;IAKhC,KAAK,CAAC,EAAE,MAAM,CAAC;IAOf,QAAQ,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,QAAQ,CAAC,CAAC,GAAG,GAAG,IAAI;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,CAAC,CAAC;IACR,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,YAAY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,EAAE,CAAC;CAChC;AAED,UAAU,aAAa,CAAC,CAAC,SAAS,QAAQ;IACxC,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;IACpD,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;IAChC,QAAQ,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;IAChD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IAQxB,gBAAgB,CAAC,EAAE,MAAM,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;IACnD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IAOzB,eAAe,CAAC,EAAE,OAAO,GAAG,mBAAmB,CAAC;CACjD;AA0FD,eAAO,MAAM,QAAQ,EAA0B,CAAC,CAAC,SAAS,QAAQ,EAChE,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;CAAE,KAC7D,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC"}
|
|
@@ -5,6 +5,7 @@ import { Skeleton } from "@uipath/apollo-wind";
|
|
|
5
5
|
import { forwardRef, memo, useCallback, useImperativeHandle, useMemo } from "react";
|
|
6
6
|
import { useCanvasTheme } from "../BaseCanvas/CanvasThemeContext.js";
|
|
7
7
|
import { CanvasTooltip } from "../CanvasTooltip.js";
|
|
8
|
+
import { InitialsBadge } from "../shared/InitialsBadge.js";
|
|
8
9
|
import { IconContainer, ListItemButton, SectionHeader, StyledList } from "./ListView.styles.js";
|
|
9
10
|
const DEFAULT_SKELETON_COUNT = 3;
|
|
10
11
|
function buildRenderedItems(items, enableSections, loadingSkeleton) {
|
|
@@ -133,7 +134,11 @@ const ListViewRow = /*#__PURE__*/ memo(({ index, style, ariaAttributes, rendered
|
|
|
133
134
|
icon: item.icon.name,
|
|
134
135
|
size: 24
|
|
135
136
|
}),
|
|
136
|
-
item.icon?.Component && /*#__PURE__*/ jsx(item.icon.Component, {})
|
|
137
|
+
item.icon?.Component && /*#__PURE__*/ jsx(item.icon.Component, {}),
|
|
138
|
+
!item.icon?.url && !item.icon?.name && !item.icon?.Component && /*#__PURE__*/ jsx(InitialsBadge, {
|
|
139
|
+
name: item.name,
|
|
140
|
+
"data-testid": "list-item-initials-badge"
|
|
141
|
+
})
|
|
137
142
|
]
|
|
138
143
|
}),
|
|
139
144
|
/*#__PURE__*/ jsxs(Column, {
|
|
@@ -68,6 +68,9 @@ var __webpack_modules__ = {
|
|
|
68
68
|
},
|
|
69
69
|
"./TriggerNode" (module) {
|
|
70
70
|
module.exports = require("./TriggerNode/index.cjs");
|
|
71
|
+
},
|
|
72
|
+
"./shared" (module) {
|
|
73
|
+
module.exports = require("./shared/index.cjs");
|
|
71
74
|
}
|
|
72
75
|
};
|
|
73
76
|
var __webpack_module_cache__ = {};
|
|
@@ -181,29 +184,33 @@ var __webpack_exports__ = {};
|
|
|
181
184
|
var __rspack_reexport = {};
|
|
182
185
|
for(const __rspack_import_key in _NodePropertiesPanel__rspack_import_16)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_NodePropertiesPanel__rspack_import_16[__rspack_import_key];
|
|
183
186
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
184
|
-
var
|
|
187
|
+
var _shared__rspack_import_17 = __webpack_require__("./shared");
|
|
188
|
+
var __rspack_reexport = {};
|
|
189
|
+
for(const __rspack_import_key in _shared__rspack_import_17)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_shared__rspack_import_17[__rspack_import_key];
|
|
190
|
+
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
191
|
+
var _StageNode__rspack_import_18 = __webpack_require__("./StageNode");
|
|
185
192
|
var __rspack_reexport = {};
|
|
186
|
-
for(const __rspack_import_key in
|
|
193
|
+
for(const __rspack_import_key in _StageNode__rspack_import_18)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_StageNode__rspack_import_18[__rspack_import_key];
|
|
187
194
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
188
|
-
var
|
|
195
|
+
var _StickyNoteNode__rspack_import_19 = __webpack_require__("./StickyNoteNode?d2a3");
|
|
189
196
|
var __rspack_reexport = {};
|
|
190
|
-
for(const __rspack_import_key in
|
|
197
|
+
for(const __rspack_import_key in _StickyNoteNode__rspack_import_19)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_StickyNoteNode__rspack_import_19[__rspack_import_key];
|
|
191
198
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
192
|
-
var
|
|
199
|
+
var _TaskIcon__rspack_import_20 = __webpack_require__("./TaskIcon");
|
|
193
200
|
var __rspack_reexport = {};
|
|
194
|
-
for(const __rspack_import_key in
|
|
201
|
+
for(const __rspack_import_key in _TaskIcon__rspack_import_20)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_TaskIcon__rspack_import_20[__rspack_import_key];
|
|
195
202
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
196
|
-
var
|
|
203
|
+
var _Toolbar__rspack_import_21 = __webpack_require__("./Toolbar");
|
|
197
204
|
var __rspack_reexport = {};
|
|
198
|
-
for(const __rspack_import_key in
|
|
205
|
+
for(const __rspack_import_key in _Toolbar__rspack_import_21)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_Toolbar__rspack_import_21[__rspack_import_key];
|
|
199
206
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
200
|
-
var
|
|
207
|
+
var _Toolbox__rspack_import_22 = __webpack_require__("./Toolbox?2740");
|
|
201
208
|
var __rspack_reexport = {};
|
|
202
|
-
for(const __rspack_import_key in
|
|
209
|
+
for(const __rspack_import_key in _Toolbox__rspack_import_22)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_Toolbox__rspack_import_22[__rspack_import_key];
|
|
203
210
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
204
|
-
var
|
|
211
|
+
var _TriggerNode__rspack_import_23 = __webpack_require__("./TriggerNode");
|
|
205
212
|
var __rspack_reexport = {};
|
|
206
|
-
for(const __rspack_import_key in
|
|
213
|
+
for(const __rspack_import_key in _TriggerNode__rspack_import_23)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_TriggerNode__rspack_import_23[__rspack_import_key];
|
|
207
214
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
208
215
|
})();
|
|
209
216
|
for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
@@ -15,6 +15,7 @@ export * from './MiniCanvasNavigator';
|
|
|
15
15
|
export * from './NodeContextMenu';
|
|
16
16
|
export * from './NodeInspector';
|
|
17
17
|
export * from './NodePropertiesPanel';
|
|
18
|
+
export * from './shared';
|
|
18
19
|
export * from './StageNode';
|
|
19
20
|
export * from './StickyNoteNode';
|
|
20
21
|
export * from './TaskIcon';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/canvas/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/canvas/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC"}
|
|
@@ -15,6 +15,7 @@ export * from "./MiniCanvasNavigator/index.js";
|
|
|
15
15
|
export * from "./NodeContextMenu/index.js";
|
|
16
16
|
export * from "./NodeInspector.js";
|
|
17
17
|
export * from "./NodePropertiesPanel/index.js";
|
|
18
|
+
export * from "./shared/index.js";
|
|
18
19
|
export * from "./StageNode/index.js";
|
|
19
20
|
export * from "./StickyNoteNode/index.js";
|
|
20
21
|
export * from "./TaskIcon/index.js";
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.n = (module)=>{
|
|
5
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
+
__webpack_require__.d(getter, {
|
|
7
|
+
a: getter
|
|
8
|
+
});
|
|
9
|
+
return getter;
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
14
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: definition[key]
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
})();
|
|
20
|
+
(()=>{
|
|
21
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
22
|
+
})();
|
|
23
|
+
(()=>{
|
|
24
|
+
__webpack_require__.r = (exports1)=>{
|
|
25
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
26
|
+
value: 'Module'
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
29
|
+
value: true
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
})();
|
|
33
|
+
var __webpack_exports__ = {};
|
|
34
|
+
__webpack_require__.r(__webpack_exports__);
|
|
35
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
36
|
+
getInitial: ()=>getInitial,
|
|
37
|
+
InitialsBadge: ()=>InitialsBadge
|
|
38
|
+
});
|
|
39
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
40
|
+
const styled_namespaceObject = require("@emotion/styled");
|
|
41
|
+
var styled_default = /*#__PURE__*/ __webpack_require__.n(styled_namespaceObject);
|
|
42
|
+
const InitialsBadgeRoot = styled_default().span`
|
|
43
|
+
display: inline-flex;
|
|
44
|
+
width: var(--initials-badge-size, 24px);
|
|
45
|
+
height: var(--initials-badge-size, 24px);
|
|
46
|
+
align-items: center;
|
|
47
|
+
justify-content: center;
|
|
48
|
+
border-radius: 50%;
|
|
49
|
+
background: var(--canvas-primary);
|
|
50
|
+
color: var(--canvas-on-primary, #ffffff);
|
|
51
|
+
font-size: calc(var(--initials-badge-size, 24px) * 0.5);
|
|
52
|
+
font-weight: 800;
|
|
53
|
+
line-height: 1;
|
|
54
|
+
text-transform: uppercase;
|
|
55
|
+
user-select: none;
|
|
56
|
+
`;
|
|
57
|
+
function getInitial(name) {
|
|
58
|
+
const trimmed = name.trim();
|
|
59
|
+
if (!trimmed) return '?';
|
|
60
|
+
return [
|
|
61
|
+
...trimmed
|
|
62
|
+
][0] ?? '?';
|
|
63
|
+
}
|
|
64
|
+
function InitialsBadge({ name, size, className, style, 'data-testid': dataTestId }) {
|
|
65
|
+
const mergedStyle = (()=>{
|
|
66
|
+
const sizeStyle = size ? {
|
|
67
|
+
['--initials-badge-size']: size
|
|
68
|
+
} : void 0;
|
|
69
|
+
if (!sizeStyle && !style) return;
|
|
70
|
+
return {
|
|
71
|
+
...sizeStyle,
|
|
72
|
+
...style
|
|
73
|
+
};
|
|
74
|
+
})();
|
|
75
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(InitialsBadgeRoot, {
|
|
76
|
+
"aria-hidden": "true",
|
|
77
|
+
className: className,
|
|
78
|
+
"data-testid": dataTestId,
|
|
79
|
+
style: mergedStyle,
|
|
80
|
+
children: getInitial(name)
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
exports.InitialsBadge = __webpack_exports__.InitialsBadge;
|
|
84
|
+
exports.getInitial = __webpack_exports__.getInitial;
|
|
85
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
86
|
+
"InitialsBadge",
|
|
87
|
+
"getInitial"
|
|
88
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
89
|
+
Object.defineProperty(exports, '__esModule', {
|
|
90
|
+
value: true
|
|
91
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface InitialsBadgeProps {
|
|
2
|
+
name: string;
|
|
3
|
+
size?: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
style?: React.CSSProperties;
|
|
6
|
+
'data-testid'?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function getInitial(name: string): string;
|
|
9
|
+
export declare function InitialsBadge({ name, size, className, style, 'data-testid': dataTestId, }: InitialsBadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=InitialsBadge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InitialsBadge.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/shared/InitialsBadge.tsx"],"names":[],"mappings":"AAuBA,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IAEb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAOD,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAI/C;AAED,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,KAAK,EACL,aAAa,EAAE,UAAU,GAC1B,EAAE,kBAAkB,2CAmBpB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import styled from "@emotion/styled";
|
|
3
|
+
const InitialsBadgeRoot = styled.span`
|
|
4
|
+
display: inline-flex;
|
|
5
|
+
width: var(--initials-badge-size, 24px);
|
|
6
|
+
height: var(--initials-badge-size, 24px);
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
border-radius: 50%;
|
|
10
|
+
background: var(--canvas-primary);
|
|
11
|
+
color: var(--canvas-on-primary, #ffffff);
|
|
12
|
+
font-size: calc(var(--initials-badge-size, 24px) * 0.5);
|
|
13
|
+
font-weight: 800;
|
|
14
|
+
line-height: 1;
|
|
15
|
+
text-transform: uppercase;
|
|
16
|
+
user-select: none;
|
|
17
|
+
`;
|
|
18
|
+
function getInitial(name) {
|
|
19
|
+
const trimmed = name.trim();
|
|
20
|
+
if (!trimmed) return '?';
|
|
21
|
+
return [
|
|
22
|
+
...trimmed
|
|
23
|
+
][0] ?? '?';
|
|
24
|
+
}
|
|
25
|
+
function InitialsBadge({ name, size, className, style, 'data-testid': dataTestId }) {
|
|
26
|
+
const mergedStyle = (()=>{
|
|
27
|
+
const sizeStyle = size ? {
|
|
28
|
+
['--initials-badge-size']: size
|
|
29
|
+
} : void 0;
|
|
30
|
+
if (!sizeStyle && !style) return;
|
|
31
|
+
return {
|
|
32
|
+
...sizeStyle,
|
|
33
|
+
...style
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
return /*#__PURE__*/ jsx(InitialsBadgeRoot, {
|
|
37
|
+
"aria-hidden": "true",
|
|
38
|
+
className: className,
|
|
39
|
+
"data-testid": dataTestId,
|
|
40
|
+
style: mergedStyle,
|
|
41
|
+
children: getInitial(name)
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
export { InitialsBadge, getInitial };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
getInitial: ()=>external_InitialsBadge_cjs_namespaceObject.getInitial,
|
|
28
|
+
InitialsBadge: ()=>external_InitialsBadge_cjs_namespaceObject.InitialsBadge
|
|
29
|
+
});
|
|
30
|
+
const external_InitialsBadge_cjs_namespaceObject = require("./InitialsBadge.cjs");
|
|
31
|
+
exports.InitialsBadge = __webpack_exports__.InitialsBadge;
|
|
32
|
+
exports.getInitial = __webpack_exports__.getInitial;
|
|
33
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
34
|
+
"InitialsBadge",
|
|
35
|
+
"getInitial"
|
|
36
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
37
|
+
Object.defineProperty(exports, '__esModule', {
|
|
38
|
+
value: true
|
|
39
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/shared/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC5D,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -40,9 +40,11 @@ class CategoryTreeAdapter {
|
|
|
40
40
|
category: node.category,
|
|
41
41
|
version: node.version
|
|
42
42
|
},
|
|
43
|
-
icon
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
...node.display.icon ? {
|
|
44
|
+
icon: {
|
|
45
|
+
name: node.display.icon
|
|
46
|
+
}
|
|
47
|
+
} : {},
|
|
46
48
|
color: node.display.iconBackground,
|
|
47
49
|
colorDark: node.display.iconBackgroundDark
|
|
48
50
|
});
|
|
@@ -59,9 +61,11 @@ class CategoryTreeAdapter {
|
|
|
59
61
|
id: category.id,
|
|
60
62
|
name: category.name,
|
|
61
63
|
data: null,
|
|
62
|
-
icon
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
...category.icon ? {
|
|
65
|
+
icon: {
|
|
66
|
+
name: category.icon
|
|
67
|
+
}
|
|
68
|
+
} : {},
|
|
65
69
|
color: category.color,
|
|
66
70
|
colorDark: category.colorDark,
|
|
67
71
|
children
|
|
@@ -12,9 +12,11 @@ class CategoryTreeAdapter {
|
|
|
12
12
|
category: node.category,
|
|
13
13
|
version: node.version
|
|
14
14
|
},
|
|
15
|
-
icon
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
...node.display.icon ? {
|
|
16
|
+
icon: {
|
|
17
|
+
name: node.display.icon
|
|
18
|
+
}
|
|
19
|
+
} : {},
|
|
18
20
|
color: node.display.iconBackground,
|
|
19
21
|
colorDark: node.display.iconBackgroundDark
|
|
20
22
|
});
|
|
@@ -31,9 +33,11 @@ class CategoryTreeAdapter {
|
|
|
31
33
|
id: category.id,
|
|
32
34
|
name: category.name,
|
|
33
35
|
data: null,
|
|
34
|
-
icon
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
...category.icon ? {
|
|
37
|
+
icon: {
|
|
38
|
+
name: category.icon
|
|
39
|
+
}
|
|
40
|
+
} : {},
|
|
37
41
|
color: category.color,
|
|
38
42
|
colorDark: category.colorDark,
|
|
39
43
|
children
|
|
@@ -34,7 +34,7 @@ const categoryManifestSchema = external_zod_namespaceObject.z.object({
|
|
|
34
34
|
sortOrder: external_zod_namespaceObject.z.number().int().nonnegative(),
|
|
35
35
|
color: external_zod_namespaceObject.z.string().min(1).optional(),
|
|
36
36
|
colorDark: external_zod_namespaceObject.z.string().min(1).optional(),
|
|
37
|
-
icon: external_zod_namespaceObject.z.string().min(1),
|
|
37
|
+
icon: external_zod_namespaceObject.z.string().min(1).optional(),
|
|
38
38
|
tags: external_zod_namespaceObject.z.array(external_zod_namespaceObject.z.string())
|
|
39
39
|
});
|
|
40
40
|
exports.categoryManifestSchema = __webpack_exports__.categoryManifestSchema;
|
|
@@ -6,7 +6,7 @@ export declare const categoryManifestSchema: z.ZodObject<{
|
|
|
6
6
|
sortOrder: z.ZodNumber;
|
|
7
7
|
color: z.ZodOptional<z.ZodString>;
|
|
8
8
|
colorDark: z.ZodOptional<z.ZodString>;
|
|
9
|
-
icon: z.ZodString
|
|
9
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
10
10
|
tags: z.ZodArray<z.ZodString>;
|
|
11
11
|
}, z.core.$strip>;
|
|
12
12
|
export type CategoryManifest = z.infer<typeof categoryManifestSchema>;
|
|
@@ -6,7 +6,7 @@ const categoryManifestSchema = z.object({
|
|
|
6
6
|
sortOrder: z.number().int().nonnegative(),
|
|
7
7
|
color: z.string().min(1).optional(),
|
|
8
8
|
colorDark: z.string().min(1).optional(),
|
|
9
|
-
icon: z.string().min(1),
|
|
9
|
+
icon: z.string().min(1).optional(),
|
|
10
10
|
tags: z.array(z.string())
|
|
11
11
|
});
|
|
12
12
|
export { categoryManifestSchema };
|
|
@@ -46,7 +46,7 @@ const nodeDisplayManifestSchema = external_zod_namespaceObject.z.object({
|
|
|
46
46
|
label: external_zod_namespaceObject.z.string().min(1),
|
|
47
47
|
canvasLabel: external_zod_namespaceObject.z.string().min(1).optional(),
|
|
48
48
|
description: external_zod_namespaceObject.z.string().optional(),
|
|
49
|
-
icon: external_zod_namespaceObject.z.string().min(1),
|
|
49
|
+
icon: external_zod_namespaceObject.z.string().min(1).optional(),
|
|
50
50
|
shape: nodeShapeSchema.optional(),
|
|
51
51
|
color: external_zod_namespaceObject.z.string().optional(),
|
|
52
52
|
background: external_zod_namespaceObject.z.string().optional(),
|
|
@@ -13,7 +13,7 @@ export declare const nodeDisplayManifestSchema: z.ZodObject<{
|
|
|
13
13
|
label: z.ZodString;
|
|
14
14
|
canvasLabel: z.ZodOptional<z.ZodString>;
|
|
15
15
|
description: z.ZodOptional<z.ZodString>;
|
|
16
|
-
icon: z.ZodString
|
|
16
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
17
17
|
shape: z.ZodOptional<z.ZodEnum<{
|
|
18
18
|
square: "square";
|
|
19
19
|
circle: "circle";
|
|
@@ -42,7 +42,7 @@ export declare const nodeManifestSchema: z.ZodObject<{
|
|
|
42
42
|
label: z.ZodString;
|
|
43
43
|
canvasLabel: z.ZodOptional<z.ZodString>;
|
|
44
44
|
description: z.ZodOptional<z.ZodString>;
|
|
45
|
-
icon: z.ZodString
|
|
45
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
46
46
|
shape: z.ZodOptional<z.ZodEnum<{
|
|
47
47
|
square: "square";
|
|
48
48
|
circle: "circle";
|
|
@@ -14,7 +14,7 @@ const nodeDisplayManifestSchema = z.object({
|
|
|
14
14
|
label: z.string().min(1),
|
|
15
15
|
canvasLabel: z.string().min(1).optional(),
|
|
16
16
|
description: z.string().optional(),
|
|
17
|
-
icon: z.string().min(1),
|
|
17
|
+
icon: z.string().min(1).optional(),
|
|
18
18
|
shape: nodeShapeSchema.optional(),
|
|
19
19
|
color: z.string().optional(),
|
|
20
20
|
background: z.string().optional(),
|
|
@@ -6,11 +6,11 @@ export declare const defaultWorkflowManifest: {
|
|
|
6
6
|
id: string;
|
|
7
7
|
name: string;
|
|
8
8
|
sortOrder: number;
|
|
9
|
-
icon: string;
|
|
10
9
|
tags: string[];
|
|
11
10
|
parentId?: string | undefined;
|
|
12
11
|
color?: string | undefined;
|
|
13
12
|
colorDark?: string | undefined;
|
|
13
|
+
icon?: string | undefined;
|
|
14
14
|
}[];
|
|
15
15
|
nodes: {
|
|
16
16
|
nodeType: string;
|
|
@@ -19,9 +19,9 @@ export declare const defaultWorkflowManifest: {
|
|
|
19
19
|
sortOrder: number;
|
|
20
20
|
display: {
|
|
21
21
|
label: string;
|
|
22
|
-
icon: string;
|
|
23
22
|
canvasLabel?: string | undefined;
|
|
24
23
|
description?: string | undefined;
|
|
24
|
+
icon?: string | undefined;
|
|
25
25
|
shape?: "square" | "circle" | "container" | "rectangle" | undefined;
|
|
26
26
|
color?: string | undefined;
|
|
27
27
|
background?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-definitions.d.ts","sourceRoot":"","sources":["../../../../src/canvas/storybook-utils/manifests/node-definitions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAEjE,eAAO,MAAM,gBAAgB,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"node-definitions.d.ts","sourceRoot":"","sources":["../../../../src/canvas/storybook-utils/manifests/node-definitions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAEjE,eAAO,MAAM,gBAAgB,EAAE,YAAY,EA65B1C,CAAC"}
|
|
@@ -29,6 +29,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
29
29
|
DEFAULT_CONTAINER_HEIGHT: ()=>DEFAULT_CONTAINER_HEIGHT,
|
|
30
30
|
getContainerSafeArea: ()=>container_getContainerSafeArea,
|
|
31
31
|
DEFAULT_CONTAINER_WIDTH: ()=>DEFAULT_CONTAINER_WIDTH,
|
|
32
|
+
getContainerResizeMinimums: ()=>getContainerResizeMinimums,
|
|
32
33
|
isContainerNodeManifest: ()=>isContainerNodeManifest,
|
|
33
34
|
fitContainersAndPushSiblings: ()=>fitContainersAndPushSiblings,
|
|
34
35
|
DEFAULT_CONTAINER_MIN_HEIGHT: ()=>DEFAULT_CONTAINER_MIN_HEIGHT,
|
|
@@ -105,6 +106,50 @@ function container_getContainerFitGeometry() {
|
|
|
105
106
|
padding
|
|
106
107
|
};
|
|
107
108
|
}
|
|
109
|
+
function resolveResizeMinimum(minSize, requiredSize) {
|
|
110
|
+
return Math.max(minSize, (0, external_NodeUtils_cjs_namespaceObject.snapUpToGrid)(requiredSize));
|
|
111
|
+
}
|
|
112
|
+
function getContainerResizeMinimums(containerNode, nodes, { minWidth = DEFAULT_CONTAINER_MIN_WIDTH, minHeight = DEFAULT_CONTAINER_MIN_HEIGHT, getNodeDimensions: resolveNodeDimensions = container_getNodeDimensions, ignoredNodeTypes = [] } = {}) {
|
|
113
|
+
const currentSize = container_getNodeDimensions(containerNode, {
|
|
114
|
+
width: DEFAULT_CONTAINER_WIDTH,
|
|
115
|
+
height: DEFAULT_CONTAINER_HEIGHT
|
|
116
|
+
});
|
|
117
|
+
const padding = container_getContainerSafeArea(containerNode, currentSize).padding ?? {};
|
|
118
|
+
const ignoredTypes = new Set(ignoredNodeTypes);
|
|
119
|
+
let childBounds;
|
|
120
|
+
for (const childNode of nodes){
|
|
121
|
+
if (childNode.id === external_constants_cjs_namespaceObject.PREVIEW_NODE_ID || childNode.hidden || childNode.parentId !== containerNode.id || ignoredTypes.has(childNode.type ?? '')) continue;
|
|
122
|
+
const childSize = resolveNodeDimensions(childNode);
|
|
123
|
+
const nextBounds = {
|
|
124
|
+
left: childNode.position.x,
|
|
125
|
+
right: childNode.position.x + childSize.width,
|
|
126
|
+
top: childNode.position.y,
|
|
127
|
+
bottom: childNode.position.y + childSize.height
|
|
128
|
+
};
|
|
129
|
+
childBounds = childBounds ? {
|
|
130
|
+
left: Math.min(childBounds.left, nextBounds.left),
|
|
131
|
+
right: Math.max(childBounds.right, nextBounds.right),
|
|
132
|
+
top: Math.min(childBounds.top, nextBounds.top),
|
|
133
|
+
bottom: Math.max(childBounds.bottom, nextBounds.bottom)
|
|
134
|
+
} : nextBounds;
|
|
135
|
+
}
|
|
136
|
+
if (!childBounds) return {
|
|
137
|
+
left: minWidth,
|
|
138
|
+
right: minWidth,
|
|
139
|
+
top: minHeight,
|
|
140
|
+
bottom: minHeight
|
|
141
|
+
};
|
|
142
|
+
const leftEdgeLimit = currentSize.width - childBounds.left + (padding.left ?? 0);
|
|
143
|
+
const topEdgeLimit = currentSize.height - childBounds.top + (padding.top ?? 0);
|
|
144
|
+
const rightEdgeLimit = childBounds.right + (padding.right ?? 0);
|
|
145
|
+
const bottomEdgeLimit = childBounds.bottom + (padding.bottom ?? 0);
|
|
146
|
+
return {
|
|
147
|
+
left: resolveResizeMinimum(minWidth, leftEdgeLimit),
|
|
148
|
+
right: resolveResizeMinimum(minWidth, rightEdgeLimit),
|
|
149
|
+
top: resolveResizeMinimum(minHeight, topEdgeLimit),
|
|
150
|
+
bottom: resolveResizeMinimum(minHeight, bottomEdgeLimit)
|
|
151
|
+
};
|
|
152
|
+
}
|
|
108
153
|
function isContainerNodeManifest(manifest) {
|
|
109
154
|
return manifest?.display.shape === 'container';
|
|
110
155
|
}
|
|
@@ -675,6 +720,7 @@ exports.fitContainersAndPushSiblings = __webpack_exports__.fitContainersAndPushS
|
|
|
675
720
|
exports.getContainerFitGeometry = __webpack_exports__.getContainerFitGeometry;
|
|
676
721
|
exports.getContainerNodeForEdge = __webpack_exports__.getContainerNodeForEdge;
|
|
677
722
|
exports.getContainerPlacement = __webpack_exports__.getContainerPlacement;
|
|
723
|
+
exports.getContainerResizeMinimums = __webpack_exports__.getContainerResizeMinimums;
|
|
678
724
|
exports.getContainerSafeArea = __webpack_exports__.getContainerSafeArea;
|
|
679
725
|
exports.getNodeDimensions = __webpack_exports__.getNodeDimensions;
|
|
680
726
|
exports.isContainerNodeManifest = __webpack_exports__.isContainerNodeManifest;
|
|
@@ -693,6 +739,7 @@ for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
|
693
739
|
"getContainerFitGeometry",
|
|
694
740
|
"getContainerNodeForEdge",
|
|
695
741
|
"getContainerPlacement",
|
|
742
|
+
"getContainerResizeMinimums",
|
|
696
743
|
"getContainerSafeArea",
|
|
697
744
|
"getNodeDimensions",
|
|
698
745
|
"isContainerNodeManifest",
|
|
@@ -32,6 +32,12 @@ export interface ContainerSizeChange {
|
|
|
32
32
|
previousSize: NodeDimensions;
|
|
33
33
|
nextSize: NodeDimensions;
|
|
34
34
|
}
|
|
35
|
+
export interface ContainerResizeMinimums {
|
|
36
|
+
left: number;
|
|
37
|
+
right: number;
|
|
38
|
+
top: number;
|
|
39
|
+
bottom: number;
|
|
40
|
+
}
|
|
35
41
|
export interface EnsureContainersFitChildrenResult {
|
|
36
42
|
nodes: Node[];
|
|
37
43
|
changes: ContainerSizeChange[];
|
|
@@ -79,6 +85,12 @@ export declare const CONTAINER_SEQUENCE_GAP_PX: number;
|
|
|
79
85
|
export declare function getNodeDimensions(node: Pick<Node, 'width' | 'height' | 'measured' | 'style'>, fallback?: NodeDimensions): NodeDimensions;
|
|
80
86
|
export declare function getContainerSafeArea(containerNode: Pick<Node, 'width' | 'height' | 'measured' | 'style'>, fallback?: NodeDimensions): ContainerSafeArea;
|
|
81
87
|
export declare function getContainerFitGeometry(): ContainerFitGeometry;
|
|
88
|
+
export declare function getContainerResizeMinimums(containerNode: Pick<Node, 'id' | 'width' | 'height' | 'measured' | 'style'>, nodes: Node[], { minWidth, minHeight, getNodeDimensions: resolveNodeDimensions, ignoredNodeTypes, }?: {
|
|
89
|
+
minWidth?: number;
|
|
90
|
+
minHeight?: number;
|
|
91
|
+
getNodeDimensions?: (node: Node) => NodeDimensions;
|
|
92
|
+
ignoredNodeTypes?: string[];
|
|
93
|
+
}): ContainerResizeMinimums;
|
|
82
94
|
export declare function isContainerNodeManifest(manifest: Pick<NodeManifest, 'display'> | undefined): boolean;
|
|
83
95
|
export declare function ensureContainersFitChildren(nodes: Node[], { containerIds, getContainerFitGeometry: resolveContainerFitGeometry, getNodeDimensions: resolveNodeDimensions, ignoredNodeTypes, includeAncestors, }?: {
|
|
84
96
|
containerIds?: Iterable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../../src/canvas/utils/container.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACJ,IAAI,EACJ,iBAAiB,EAElB,MAAM,0CAA0C,CAAC;AAOlD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAanF,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAOD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE;QACR,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;CACH;AAMD,MAAM,WAAW,iBAAiB;IAChC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE;QACR,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;CACH;AAGD,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAA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C,aAAa,EAAE,IAAI,KAAK,oBAAoB,GAAG,IAAI,GAAG,SAAS,CAAC;IAC1F,iBAAiB,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,cAAc,CAAC;IAClD,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,GAAG,EAAE,MAAM,CAAC;CACb,GAAG,IAAI,EAAE,CAkCT;AAMD,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC,GAC3C,kBAAkB,GAAG,IAAI,CAS3B;AAOD,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,uBAAuB,EAAE,2BAAqD,EAC9E,iBAAiB,EAAE,qBAAyC,EAC5D,GAA+B,EAC/B,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,GACN,EAAE;IACD,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,YAAY,EAAE,IAAI,CAAC;IACnB,SAAS,EAAE,kBAAkB,CAAC;IAC9B,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,uBAAuB,CAAC,EAAE,CAAC,aAAa,EAAE,IAAI,KAAK,oBAAoB,GAAG,IAAI,GAAG,SAAS,CAAC;IAC3F,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,cAAc,CAAC;IACnD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iBAAiB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACrC,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;CAChB,GAAG,IAAI,EAAE,CA+FT"}
|
|
@@ -61,6 +61,50 @@ function container_getContainerFitGeometry() {
|
|
|
61
61
|
padding
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
|
+
function resolveResizeMinimum(minSize, requiredSize) {
|
|
65
|
+
return Math.max(minSize, snapUpToGrid(requiredSize));
|
|
66
|
+
}
|
|
67
|
+
function getContainerResizeMinimums(containerNode, nodes, { minWidth = DEFAULT_CONTAINER_MIN_WIDTH, minHeight = DEFAULT_CONTAINER_MIN_HEIGHT, getNodeDimensions: resolveNodeDimensions = container_getNodeDimensions, ignoredNodeTypes = [] } = {}) {
|
|
68
|
+
const currentSize = container_getNodeDimensions(containerNode, {
|
|
69
|
+
width: DEFAULT_CONTAINER_WIDTH,
|
|
70
|
+
height: DEFAULT_CONTAINER_HEIGHT
|
|
71
|
+
});
|
|
72
|
+
const padding = container_getContainerSafeArea(containerNode, currentSize).padding ?? {};
|
|
73
|
+
const ignoredTypes = new Set(ignoredNodeTypes);
|
|
74
|
+
let childBounds;
|
|
75
|
+
for (const childNode of nodes){
|
|
76
|
+
if (childNode.id === PREVIEW_NODE_ID || childNode.hidden || childNode.parentId !== containerNode.id || ignoredTypes.has(childNode.type ?? '')) continue;
|
|
77
|
+
const childSize = resolveNodeDimensions(childNode);
|
|
78
|
+
const nextBounds = {
|
|
79
|
+
left: childNode.position.x,
|
|
80
|
+
right: childNode.position.x + childSize.width,
|
|
81
|
+
top: childNode.position.y,
|
|
82
|
+
bottom: childNode.position.y + childSize.height
|
|
83
|
+
};
|
|
84
|
+
childBounds = childBounds ? {
|
|
85
|
+
left: Math.min(childBounds.left, nextBounds.left),
|
|
86
|
+
right: Math.max(childBounds.right, nextBounds.right),
|
|
87
|
+
top: Math.min(childBounds.top, nextBounds.top),
|
|
88
|
+
bottom: Math.max(childBounds.bottom, nextBounds.bottom)
|
|
89
|
+
} : nextBounds;
|
|
90
|
+
}
|
|
91
|
+
if (!childBounds) return {
|
|
92
|
+
left: minWidth,
|
|
93
|
+
right: minWidth,
|
|
94
|
+
top: minHeight,
|
|
95
|
+
bottom: minHeight
|
|
96
|
+
};
|
|
97
|
+
const leftEdgeLimit = currentSize.width - childBounds.left + (padding.left ?? 0);
|
|
98
|
+
const topEdgeLimit = currentSize.height - childBounds.top + (padding.top ?? 0);
|
|
99
|
+
const rightEdgeLimit = childBounds.right + (padding.right ?? 0);
|
|
100
|
+
const bottomEdgeLimit = childBounds.bottom + (padding.bottom ?? 0);
|
|
101
|
+
return {
|
|
102
|
+
left: resolveResizeMinimum(minWidth, leftEdgeLimit),
|
|
103
|
+
right: resolveResizeMinimum(minWidth, rightEdgeLimit),
|
|
104
|
+
top: resolveResizeMinimum(minHeight, topEdgeLimit),
|
|
105
|
+
bottom: resolveResizeMinimum(minHeight, bottomEdgeLimit)
|
|
106
|
+
};
|
|
107
|
+
}
|
|
64
108
|
function isContainerNodeManifest(manifest) {
|
|
65
109
|
return manifest?.display.shape === 'container';
|
|
66
110
|
}
|
|
@@ -619,4 +663,4 @@ function placeContainerNode({ nodes, insertedNode, placement, safeArea, getConta
|
|
|
619
663
|
gap
|
|
620
664
|
});
|
|
621
665
|
}
|
|
622
|
-
export { CONTAINER_FRAME_INSET_PX, CONTAINER_SEQUENCE_GAP_PX, DEFAULT_CONTAINER_HEIGHT, DEFAULT_CONTAINER_MIN_HEIGHT, DEFAULT_CONTAINER_MIN_WIDTH, DEFAULT_CONTAINER_WIDTH, collectLinearDownstreamSiblings, ensureContainersFitChildren, fitContainersAndPushSiblings, container_getContainerFitGeometry as getContainerFitGeometry, getContainerNodeForEdge, getContainerPlacement, container_getContainerSafeArea as getContainerSafeArea, container_getNodeDimensions as getNodeDimensions, isContainerNodeManifest, placeContainerNode, resolveContainerPreview };
|
|
666
|
+
export { CONTAINER_FRAME_INSET_PX, CONTAINER_SEQUENCE_GAP_PX, DEFAULT_CONTAINER_HEIGHT, DEFAULT_CONTAINER_MIN_HEIGHT, DEFAULT_CONTAINER_MIN_WIDTH, DEFAULT_CONTAINER_WIDTH, collectLinearDownstreamSiblings, ensureContainersFitChildren, fitContainersAndPushSiblings, container_getContainerFitGeometry as getContainerFitGeometry, getContainerNodeForEdge, getContainerPlacement, getContainerResizeMinimums, container_getContainerSafeArea as getContainerSafeArea, container_getNodeDimensions as getNodeDimensions, isContainerNodeManifest, placeContainerNode, resolveContainerPreview };
|
|
@@ -111,6 +111,14 @@ function isValidUrl(input) {
|
|
|
111
111
|
return 'http:' === url.protocol || 'https:' === url.protocol;
|
|
112
112
|
}
|
|
113
113
|
function getIcon(iconId) {
|
|
114
|
+
if (!iconId) {
|
|
115
|
+
const BoxIcon = external_lucide_react_namespaceObject.icons.Box;
|
|
116
|
+
return ({ w, h, color })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(BoxIcon, {
|
|
117
|
+
width: w ?? 24,
|
|
118
|
+
height: h ?? 24,
|
|
119
|
+
color: color
|
|
120
|
+
});
|
|
121
|
+
}
|
|
114
122
|
if (isValidUrl(iconId)) return ({ w, h })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("img", {
|
|
115
123
|
src: iconId,
|
|
116
124
|
alt: "icon",
|
|
@@ -4,7 +4,7 @@ export type IconComponent = (props: {
|
|
|
4
4
|
h?: number;
|
|
5
5
|
color?: string;
|
|
6
6
|
}) => JSX.Element;
|
|
7
|
-
export declare function getIcon(iconId
|
|
7
|
+
export declare function getIcon(iconId?: string): IconComponent;
|
|
8
8
|
export interface CanvasIconProps {
|
|
9
9
|
icon?: string;
|
|
10
10
|
size?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-registry.d.ts","sourceRoot":"","sources":["../../../src/canvas/utils/icon-registry.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,GAAG,EAAiB,MAAM,OAAO,CAAC;AAGhD,MAAM,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE;IAAE,CAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,KAAK,GAAG,CAAC,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"icon-registry.d.ts","sourceRoot":"","sources":["../../../src/canvas/utils/icon-registry.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,GAAG,EAAiB,MAAM,OAAO,CAAC;AAGhD,MAAM,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE;IAAE,CAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,KAAK,GAAG,CAAC,OAAO,CAAC;AAsD/F,wBAAgB,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,aAAa,CAuCtD;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAMD,eAAO,MAAM,UAAU,uDAIrB,CAAC;AAGH,eAAO,MAAM,QAAQ,uDAAa,CAAC"}
|
|
@@ -81,6 +81,14 @@ function isValidUrl(input) {
|
|
|
81
81
|
return 'http:' === url.protocol || 'https:' === url.protocol;
|
|
82
82
|
}
|
|
83
83
|
function getIcon(iconId) {
|
|
84
|
+
if (!iconId) {
|
|
85
|
+
const BoxIcon = icons.Box;
|
|
86
|
+
return ({ w, h, color })=>/*#__PURE__*/ jsx(BoxIcon, {
|
|
87
|
+
width: w ?? 24,
|
|
88
|
+
height: h ?? 24,
|
|
89
|
+
color: color
|
|
90
|
+
});
|
|
91
|
+
}
|
|
84
92
|
if (isValidUrl(iconId)) return ({ w, h })=>/*#__PURE__*/ jsx("img", {
|
|
85
93
|
src: iconId,
|
|
86
94
|
alt: "icon",
|
|
@@ -32,7 +32,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
32
32
|
const external_collapse_cjs_namespaceObject = require("./collapse.cjs");
|
|
33
33
|
function resolveDisplay(manifestDisplay, context) {
|
|
34
34
|
if (!manifestDisplay) return {
|
|
35
|
-
icon: '
|
|
35
|
+
icon: '',
|
|
36
36
|
shape: 'square',
|
|
37
37
|
label: context?.display?.label || 'Unknown Node'
|
|
38
38
|
};
|
|
@@ -46,6 +46,7 @@ function resolveDisplay(manifestDisplay, context) {
|
|
|
46
46
|
...context?.display,
|
|
47
47
|
label: resolvedLabel,
|
|
48
48
|
canvasLabel: context?.display?.canvasLabel ?? manifestDisplay.canvasLabel,
|
|
49
|
+
icon: context?.display?.icon ?? manifestDisplay.icon ?? '',
|
|
49
50
|
shape: isCollapsed ? collapsedShape : expandedShape
|
|
50
51
|
};
|
|
51
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-resolver.d.ts","sourceRoot":"","sources":["../../../src/canvas/utils/manifest-resolver.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAMrE,MAAM,WAAW,iBAAkB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAEhE,OAAO,CAAC,EAAE,qBAAqB,CAAC;IAEhC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;
|
|
1
|
+
{"version":3,"file":"manifest-resolver.d.ts","sourceRoot":"","sources":["../../../src/canvas/utils/manifest-resolver.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,KAAK,EAAE,q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e,CAyCjB;AA6BD,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,EACrC,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAmBT;AAiCD,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,MAAM,CAKhF;AAuCD,wBAAgB,cAAc,CAC5B,YAAY,EAAE,mBAAmB,EAAE,EACnC,OAAO,EAAE,iBAAiB,GACzB,mBAAmB,EAAE,CAmEvB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getCollapsedShape } from "./collapse.js";
|
|
2
2
|
function resolveDisplay(manifestDisplay, context) {
|
|
3
3
|
if (!manifestDisplay) return {
|
|
4
|
-
icon: '
|
|
4
|
+
icon: '',
|
|
5
5
|
shape: 'square',
|
|
6
6
|
label: context?.display?.label || 'Unknown Node'
|
|
7
7
|
};
|
|
@@ -15,6 +15,7 @@ function resolveDisplay(manifestDisplay, context) {
|
|
|
15
15
|
...context?.display,
|
|
16
16
|
label: resolvedLabel,
|
|
17
17
|
canvasLabel: context?.display?.canvasLabel ?? manifestDisplay.canvasLabel,
|
|
18
|
+
icon: context?.display?.icon ?? manifestDisplay.icon ?? '',
|
|
18
19
|
shape: isCollapsed ? collapsedShape : expandedShape
|
|
19
20
|
};
|
|
20
21
|
}
|