@uipath/apollo-react 4.23.0 → 4.23.2
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/LoopNode/LoopNode.cjs +37 -5
- package/dist/canvas/components/LoopNode/LoopNode.d.ts.map +1 -1
- package/dist/canvas/components/LoopNode/LoopNode.js +38 -6
- package/dist/canvas/styles/reactflow-reset.css +1 -1
- package/dist/canvas/utils/container.cjs +49 -0
- package/dist/canvas/utils/container.d.ts +11 -0
- package/dist/canvas/utils/container.d.ts.map +1 -1
- package/dist/canvas/utils/container.js +47 -1
- package/package.json +3 -3
|
@@ -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,21 @@ function useHasChildNodes(id, enabled) {
|
|
|
101
116
|
enabled
|
|
102
117
|
]));
|
|
103
118
|
}
|
|
119
|
+
function useContainerResizeMinimums(id, width, height, enabled) {
|
|
120
|
+
return (0, react_cjs_namespaceObject.useStore)((0, external_react_namespaceObject.useCallback)((state)=>{
|
|
121
|
+
if (!enabled) return DEFAULT_RESIZE_MINIMUMS;
|
|
122
|
+
return (0, container_cjs_namespaceObject.getContainerResizeMinimums)({
|
|
123
|
+
id,
|
|
124
|
+
width,
|
|
125
|
+
height
|
|
126
|
+
}, Array.from(state.parentLookup.get(id)?.values() ?? []));
|
|
127
|
+
}, [
|
|
128
|
+
enabled,
|
|
129
|
+
height,
|
|
130
|
+
id,
|
|
131
|
+
width
|
|
132
|
+
]), shallow_namespaceObject.shallow);
|
|
133
|
+
}
|
|
104
134
|
function useContainerNodeInternalsRefresh(id, handleGroups, width, height) {
|
|
105
135
|
const updateNodeInternals = (0, react_cjs_namespaceObject.useUpdateNodeInternals)();
|
|
106
136
|
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
@@ -170,6 +200,8 @@ function LoopNodeComponent(props) {
|
|
|
170
200
|
const isDropTarget = true === resolvedData.isDropTarget;
|
|
171
201
|
const containerWidth = width || container_cjs_namespaceObject.DEFAULT_CONTAINER_WIDTH;
|
|
172
202
|
const containerHeight = height || container_cjs_namespaceObject.DEFAULT_CONTAINER_HEIGHT;
|
|
203
|
+
const showResizeControls = selected && !dragging && isDesignMode;
|
|
204
|
+
const resizeMinimums = useContainerResizeMinimums(id, containerWidth, containerHeight, showResizeControls);
|
|
173
205
|
const nodeSizeStyle = {
|
|
174
206
|
width: containerWidth,
|
|
175
207
|
height: containerHeight,
|
|
@@ -220,7 +252,6 @@ function LoopNodeComponent(props) {
|
|
|
220
252
|
}, []);
|
|
221
253
|
const shouldShowHandles = (isConnecting || selected || isHovered) && !dragging;
|
|
222
254
|
const showHandleAddButtons = isDesignMode && !multipleNodesSelected && !isConnecting && !dragging;
|
|
223
|
-
const showResizeControls = selected && !dragging && isDesignMode;
|
|
224
255
|
const showEmptyStateButton = isDesignMode && !hasChildNodes && !!onAddFirstChild;
|
|
225
256
|
const interactionState = resolveInteractionState(dragging, selected, isHovered);
|
|
226
257
|
if (!manifest) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
@@ -262,6 +293,7 @@ function LoopNodeComponent(props) {
|
|
|
262
293
|
visible: showResizeControls
|
|
263
294
|
}),
|
|
264
295
|
showResizeControls ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ResizeControls, {
|
|
296
|
+
minimums: resizeMinimums,
|
|
265
297
|
onResize: handleResize
|
|
266
298
|
}) : null,
|
|
267
299
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Header, {
|
|
@@ -371,13 +403,13 @@ function BodyFrame({ isEmpty, isLoading }) {
|
|
|
371
403
|
}) : null
|
|
372
404
|
});
|
|
373
405
|
}
|
|
374
|
-
function ResizeControls({ onResize }) {
|
|
406
|
+
function ResizeControls({ minimums = DEFAULT_RESIZE_MINIMUMS, onResize }) {
|
|
375
407
|
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, {
|
|
408
|
+
children: RESIZE_CONTROLS.map(({ position, widthSide, heightSide, cursor })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_cjs_namespaceObject.NodeResizeControl, {
|
|
377
409
|
style: RESIZE_CONTROL_STYLE,
|
|
378
410
|
position: position,
|
|
379
|
-
minWidth:
|
|
380
|
-
minHeight:
|
|
411
|
+
minWidth: minimums[widthSide],
|
|
412
|
+
minHeight: minimums[heightSide],
|
|
381
413
|
onResize: onResize,
|
|
382
414
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
383
415
|
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;AAuHtD,iBAAS,iBAAiB,CAAC,KAAK,EAAE,aAAa,2CAwO9C;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,21 @@ function useHasChildNodes(id, enabled) {
|
|
|
73
88
|
enabled
|
|
74
89
|
]));
|
|
75
90
|
}
|
|
91
|
+
function useContainerResizeMinimums(id, width, height, enabled) {
|
|
92
|
+
return useStore(useCallback((state)=>{
|
|
93
|
+
if (!enabled) return DEFAULT_RESIZE_MINIMUMS;
|
|
94
|
+
return getContainerResizeMinimums({
|
|
95
|
+
id,
|
|
96
|
+
width,
|
|
97
|
+
height
|
|
98
|
+
}, Array.from(state.parentLookup.get(id)?.values() ?? []));
|
|
99
|
+
}, [
|
|
100
|
+
enabled,
|
|
101
|
+
height,
|
|
102
|
+
id,
|
|
103
|
+
width
|
|
104
|
+
]), shallow);
|
|
105
|
+
}
|
|
76
106
|
function useContainerNodeInternalsRefresh(id, handleGroups, width, height) {
|
|
77
107
|
const updateNodeInternals = useUpdateNodeInternals();
|
|
78
108
|
useEffect(()=>{
|
|
@@ -142,6 +172,8 @@ function LoopNodeComponent(props) {
|
|
|
142
172
|
const isDropTarget = true === resolvedData.isDropTarget;
|
|
143
173
|
const containerWidth = width || DEFAULT_CONTAINER_WIDTH;
|
|
144
174
|
const containerHeight = height || DEFAULT_CONTAINER_HEIGHT;
|
|
175
|
+
const showResizeControls = selected && !dragging && isDesignMode;
|
|
176
|
+
const resizeMinimums = useContainerResizeMinimums(id, containerWidth, containerHeight, showResizeControls);
|
|
145
177
|
const nodeSizeStyle = {
|
|
146
178
|
width: containerWidth,
|
|
147
179
|
height: containerHeight,
|
|
@@ -192,7 +224,6 @@ function LoopNodeComponent(props) {
|
|
|
192
224
|
}, []);
|
|
193
225
|
const shouldShowHandles = (isConnecting || selected || isHovered) && !dragging;
|
|
194
226
|
const showHandleAddButtons = isDesignMode && !multipleNodesSelected && !isConnecting && !dragging;
|
|
195
|
-
const showResizeControls = selected && !dragging && isDesignMode;
|
|
196
227
|
const showEmptyStateButton = isDesignMode && !hasChildNodes && !!onAddFirstChild;
|
|
197
228
|
const interactionState = resolveInteractionState(dragging, selected, isHovered);
|
|
198
229
|
if (!manifest) return /*#__PURE__*/ jsx("div", {
|
|
@@ -234,6 +265,7 @@ function LoopNodeComponent(props) {
|
|
|
234
265
|
visible: showResizeControls
|
|
235
266
|
}),
|
|
236
267
|
showResizeControls ? /*#__PURE__*/ jsx(ResizeControls, {
|
|
268
|
+
minimums: resizeMinimums,
|
|
237
269
|
onResize: handleResize
|
|
238
270
|
}) : null,
|
|
239
271
|
/*#__PURE__*/ jsx(Header, {
|
|
@@ -343,13 +375,13 @@ function BodyFrame({ isEmpty, isLoading }) {
|
|
|
343
375
|
}) : null
|
|
344
376
|
});
|
|
345
377
|
}
|
|
346
|
-
function ResizeControls({ onResize }) {
|
|
378
|
+
function ResizeControls({ minimums = DEFAULT_RESIZE_MINIMUMS, onResize }) {
|
|
347
379
|
return /*#__PURE__*/ jsx(Fragment, {
|
|
348
|
-
children: RESIZE_CONTROLS.map(({ position, cursor })=>/*#__PURE__*/ jsx(NodeResizeControl, {
|
|
380
|
+
children: RESIZE_CONTROLS.map(({ position, widthSide, heightSide, cursor })=>/*#__PURE__*/ jsx(NodeResizeControl, {
|
|
349
381
|
style: RESIZE_CONTROL_STYLE,
|
|
350
382
|
position: position,
|
|
351
|
-
minWidth:
|
|
352
|
-
minHeight:
|
|
383
|
+
minWidth: minimums[widthSide],
|
|
384
|
+
minHeight: minimums[heightSide],
|
|
353
385
|
onResize: onResize,
|
|
354
386
|
children: /*#__PURE__*/ jsx("div", {
|
|
355
387
|
className: "absolute bottom-0 right-0 h-5 w-5 pointer-events-auto",
|
|
@@ -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,52 @@ function container_getContainerFitGeometry() {
|
|
|
105
106
|
padding
|
|
106
107
|
};
|
|
107
108
|
}
|
|
109
|
+
function resolveResizeMinimum(minSize, currentSize, requiredSize) {
|
|
110
|
+
const requiredMinimum = Math.max(minSize, (0, external_NodeUtils_cjs_namespaceObject.snapUpToGrid)(requiredSize));
|
|
111
|
+
const currentResizeFloor = Math.max(minSize, currentSize);
|
|
112
|
+
return Math.min(currentResizeFloor, requiredMinimum);
|
|
113
|
+
}
|
|
114
|
+
function getContainerResizeMinimums(containerNode, nodes, { minWidth = DEFAULT_CONTAINER_MIN_WIDTH, minHeight = DEFAULT_CONTAINER_MIN_HEIGHT, ignoredNodeTypes = [] } = {}) {
|
|
115
|
+
const currentSize = container_getNodeDimensions(containerNode, {
|
|
116
|
+
width: DEFAULT_CONTAINER_WIDTH,
|
|
117
|
+
height: DEFAULT_CONTAINER_HEIGHT
|
|
118
|
+
});
|
|
119
|
+
const padding = container_getContainerSafeArea(containerNode, currentSize).padding ?? {};
|
|
120
|
+
const ignoredTypes = new Set(ignoredNodeTypes);
|
|
121
|
+
let childBounds;
|
|
122
|
+
for (const childNode of nodes){
|
|
123
|
+
if (childNode.id === external_constants_cjs_namespaceObject.PREVIEW_NODE_ID || childNode.hidden || childNode.parentId !== containerNode.id || ignoredTypes.has(childNode.type ?? '')) continue;
|
|
124
|
+
const childSize = container_getNodeDimensions(childNode);
|
|
125
|
+
const nextBounds = {
|
|
126
|
+
left: childNode.position.x,
|
|
127
|
+
right: childNode.position.x + childSize.width,
|
|
128
|
+
top: childNode.position.y,
|
|
129
|
+
bottom: childNode.position.y + childSize.height
|
|
130
|
+
};
|
|
131
|
+
childBounds = childBounds ? {
|
|
132
|
+
left: Math.min(childBounds.left, nextBounds.left),
|
|
133
|
+
right: Math.max(childBounds.right, nextBounds.right),
|
|
134
|
+
top: Math.min(childBounds.top, nextBounds.top),
|
|
135
|
+
bottom: Math.max(childBounds.bottom, nextBounds.bottom)
|
|
136
|
+
} : nextBounds;
|
|
137
|
+
}
|
|
138
|
+
if (!childBounds) return {
|
|
139
|
+
left: minWidth,
|
|
140
|
+
right: minWidth,
|
|
141
|
+
top: minHeight,
|
|
142
|
+
bottom: minHeight
|
|
143
|
+
};
|
|
144
|
+
const leftEdgeLimit = currentSize.width - childBounds.left + (padding.left ?? 0);
|
|
145
|
+
const topEdgeLimit = currentSize.height - childBounds.top + (padding.top ?? 0);
|
|
146
|
+
const rightEdgeLimit = childBounds.right + (padding.right ?? 0);
|
|
147
|
+
const bottomEdgeLimit = childBounds.bottom + (padding.bottom ?? 0);
|
|
148
|
+
return {
|
|
149
|
+
left: resolveResizeMinimum(minWidth, currentSize.width, leftEdgeLimit),
|
|
150
|
+
right: resolveResizeMinimum(minWidth, currentSize.width, rightEdgeLimit),
|
|
151
|
+
top: resolveResizeMinimum(minHeight, currentSize.height, topEdgeLimit),
|
|
152
|
+
bottom: resolveResizeMinimum(minHeight, currentSize.height, bottomEdgeLimit)
|
|
153
|
+
};
|
|
154
|
+
}
|
|
108
155
|
function isContainerNodeManifest(manifest) {
|
|
109
156
|
return manifest?.display.shape === 'container';
|
|
110
157
|
}
|
|
@@ -675,6 +722,7 @@ exports.fitContainersAndPushSiblings = __webpack_exports__.fitContainersAndPushS
|
|
|
675
722
|
exports.getContainerFitGeometry = __webpack_exports__.getContainerFitGeometry;
|
|
676
723
|
exports.getContainerNodeForEdge = __webpack_exports__.getContainerNodeForEdge;
|
|
677
724
|
exports.getContainerPlacement = __webpack_exports__.getContainerPlacement;
|
|
725
|
+
exports.getContainerResizeMinimums = __webpack_exports__.getContainerResizeMinimums;
|
|
678
726
|
exports.getContainerSafeArea = __webpack_exports__.getContainerSafeArea;
|
|
679
727
|
exports.getNodeDimensions = __webpack_exports__.getNodeDimensions;
|
|
680
728
|
exports.isContainerNodeManifest = __webpack_exports__.isContainerNodeManifest;
|
|
@@ -693,6 +741,7 @@ for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
|
693
741
|
"getContainerFitGeometry",
|
|
694
742
|
"getContainerNodeForEdge",
|
|
695
743
|
"getContainerPlacement",
|
|
744
|
+
"getContainerResizeMinimums",
|
|
696
745
|
"getContainerSafeArea",
|
|
697
746
|
"getNodeDimensions",
|
|
698
747
|
"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,11 @@ 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, ignoredNodeTypes, }?: {
|
|
89
|
+
minWidth?: number;
|
|
90
|
+
minHeight?: number;
|
|
91
|
+
ignoredNodeTypes?: string[];
|
|
92
|
+
}): ContainerResizeMinimums;
|
|
82
93
|
export declare function isContainerNodeManifest(manifest: Pick<NodeManifest, 'display'> | undefined): boolean;
|
|
83
94
|
export declare function ensureContainersFitChildren(nodes: Node[], { containerIds, getContainerFitGeometry: resolveContainerFitGeometry, getNodeDimensions: resolveNodeDimensions, ignoredNodeTypes, includeAncestors, }?: {
|
|
84
95
|
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,0CAA0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qD,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,52 @@ function container_getContainerFitGeometry() {
|
|
|
61
61
|
padding
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
|
+
function resolveResizeMinimum(minSize, currentSize, requiredSize) {
|
|
65
|
+
const requiredMinimum = Math.max(minSize, snapUpToGrid(requiredSize));
|
|
66
|
+
const currentResizeFloor = Math.max(minSize, currentSize);
|
|
67
|
+
return Math.min(currentResizeFloor, requiredMinimum);
|
|
68
|
+
}
|
|
69
|
+
function getContainerResizeMinimums(containerNode, nodes, { minWidth = DEFAULT_CONTAINER_MIN_WIDTH, minHeight = DEFAULT_CONTAINER_MIN_HEIGHT, ignoredNodeTypes = [] } = {}) {
|
|
70
|
+
const currentSize = container_getNodeDimensions(containerNode, {
|
|
71
|
+
width: DEFAULT_CONTAINER_WIDTH,
|
|
72
|
+
height: DEFAULT_CONTAINER_HEIGHT
|
|
73
|
+
});
|
|
74
|
+
const padding = container_getContainerSafeArea(containerNode, currentSize).padding ?? {};
|
|
75
|
+
const ignoredTypes = new Set(ignoredNodeTypes);
|
|
76
|
+
let childBounds;
|
|
77
|
+
for (const childNode of nodes){
|
|
78
|
+
if (childNode.id === PREVIEW_NODE_ID || childNode.hidden || childNode.parentId !== containerNode.id || ignoredTypes.has(childNode.type ?? '')) continue;
|
|
79
|
+
const childSize = container_getNodeDimensions(childNode);
|
|
80
|
+
const nextBounds = {
|
|
81
|
+
left: childNode.position.x,
|
|
82
|
+
right: childNode.position.x + childSize.width,
|
|
83
|
+
top: childNode.position.y,
|
|
84
|
+
bottom: childNode.position.y + childSize.height
|
|
85
|
+
};
|
|
86
|
+
childBounds = childBounds ? {
|
|
87
|
+
left: Math.min(childBounds.left, nextBounds.left),
|
|
88
|
+
right: Math.max(childBounds.right, nextBounds.right),
|
|
89
|
+
top: Math.min(childBounds.top, nextBounds.top),
|
|
90
|
+
bottom: Math.max(childBounds.bottom, nextBounds.bottom)
|
|
91
|
+
} : nextBounds;
|
|
92
|
+
}
|
|
93
|
+
if (!childBounds) return {
|
|
94
|
+
left: minWidth,
|
|
95
|
+
right: minWidth,
|
|
96
|
+
top: minHeight,
|
|
97
|
+
bottom: minHeight
|
|
98
|
+
};
|
|
99
|
+
const leftEdgeLimit = currentSize.width - childBounds.left + (padding.left ?? 0);
|
|
100
|
+
const topEdgeLimit = currentSize.height - childBounds.top + (padding.top ?? 0);
|
|
101
|
+
const rightEdgeLimit = childBounds.right + (padding.right ?? 0);
|
|
102
|
+
const bottomEdgeLimit = childBounds.bottom + (padding.bottom ?? 0);
|
|
103
|
+
return {
|
|
104
|
+
left: resolveResizeMinimum(minWidth, currentSize.width, leftEdgeLimit),
|
|
105
|
+
right: resolveResizeMinimum(minWidth, currentSize.width, rightEdgeLimit),
|
|
106
|
+
top: resolveResizeMinimum(minHeight, currentSize.height, topEdgeLimit),
|
|
107
|
+
bottom: resolveResizeMinimum(minHeight, currentSize.height, bottomEdgeLimit)
|
|
108
|
+
};
|
|
109
|
+
}
|
|
64
110
|
function isContainerNodeManifest(manifest) {
|
|
65
111
|
return manifest?.display.shape === 'container';
|
|
66
112
|
}
|
|
@@ -619,4 +665,4 @@ function placeContainerNode({ nodes, insertedNode, placement, safeArea, getConta
|
|
|
619
665
|
gap
|
|
620
666
|
});
|
|
621
667
|
}
|
|
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 };
|
|
668
|
+
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 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/apollo-react",
|
|
3
|
-
"version": "4.23.
|
|
3
|
+
"version": "4.23.2",
|
|
4
4
|
"description": "Apollo Design System - React component library with Material UI theming",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -201,8 +201,8 @@
|
|
|
201
201
|
"use-sync-external-store": "^1.2.0",
|
|
202
202
|
"zod": "^4.3.5",
|
|
203
203
|
"zustand": "^5.0.9",
|
|
204
|
-
"@uipath/apollo-
|
|
205
|
-
"@uipath/apollo-
|
|
204
|
+
"@uipath/apollo-core": "5.9.0",
|
|
205
|
+
"@uipath/apollo-wind": "2.14.0"
|
|
206
206
|
},
|
|
207
207
|
"devDependencies": {
|
|
208
208
|
"@lingui/cli": "^5.6.1",
|