@uipath/apollo-react 4.23.0-pr654.3fb62d6 → 4.23.0-pr658.2fe8368
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 +4 -32
- package/dist/canvas/components/LoopNode/LoopNode.d.ts.map +1 -1
- package/dist/canvas/components/LoopNode/LoopNode.js +5 -33
- package/dist/canvas/styles/reactflow-reset.css +1 -1
- package/dist/canvas/utils/container.cjs +0 -47
- package/dist/canvas/utils/container.d.ts +0 -12
- package/dist/canvas/utils/container.d.ts.map +1 -1
- package/dist/canvas/utils/container.js +1 -45
- package/package.json +1 -1
|
@@ -30,7 +30,6 @@ 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");
|
|
34
33
|
const index_cjs_namespaceObject = require("../../core/index.cjs");
|
|
35
34
|
const external_hooks_index_cjs_namespaceObject = require("../../hooks/index.cjs");
|
|
36
35
|
const adornment_resolver_cjs_namespaceObject = require("../../utils/adornment-resolver.cjs");
|
|
@@ -54,29 +53,21 @@ const EMPTY_DATA = {};
|
|
|
54
53
|
const RESIZE_CONTROLS = [
|
|
55
54
|
{
|
|
56
55
|
position: 'top-left',
|
|
57
|
-
widthSide: 'left',
|
|
58
|
-
heightSide: 'top',
|
|
59
56
|
cursor: 'nwse-resize',
|
|
60
57
|
indicatorClassName: 'top-[-4px] left-[-4px]'
|
|
61
58
|
},
|
|
62
59
|
{
|
|
63
60
|
position: 'top-right',
|
|
64
|
-
widthSide: 'right',
|
|
65
|
-
heightSide: 'top',
|
|
66
61
|
cursor: 'nesw-resize',
|
|
67
62
|
indicatorClassName: 'top-[-4px] right-[-4px]'
|
|
68
63
|
},
|
|
69
64
|
{
|
|
70
65
|
position: 'bottom-left',
|
|
71
|
-
widthSide: 'left',
|
|
72
|
-
heightSide: 'bottom',
|
|
73
66
|
cursor: 'nesw-resize',
|
|
74
67
|
indicatorClassName: 'bottom-[-4px] left-[-4px]'
|
|
75
68
|
},
|
|
76
69
|
{
|
|
77
70
|
position: 'bottom-right',
|
|
78
|
-
widthSide: 'right',
|
|
79
|
-
heightSide: 'bottom',
|
|
80
71
|
cursor: 'nwse-resize',
|
|
81
72
|
indicatorClassName: 'bottom-[-4px] right-[-4px]'
|
|
82
73
|
}
|
|
@@ -86,12 +77,6 @@ const RESIZE_CONTROL_STYLE = {
|
|
|
86
77
|
border: 'none',
|
|
87
78
|
zIndex: 100
|
|
88
79
|
};
|
|
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
|
-
};
|
|
95
80
|
const ADORNMENT_SLOT_POSITIONS = [
|
|
96
81
|
'topLeft',
|
|
97
82
|
'topRight',
|
|
@@ -116,17 +101,6 @@ function useHasChildNodes(id, enabled) {
|
|
|
116
101
|
enabled
|
|
117
102
|
]));
|
|
118
103
|
}
|
|
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
|
-
}
|
|
130
104
|
function useContainerNodeInternalsRefresh(id, handleGroups, width, height) {
|
|
131
105
|
const updateNodeInternals = (0, react_cjs_namespaceObject.useUpdateNodeInternals)();
|
|
132
106
|
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
@@ -196,7 +170,6 @@ function LoopNodeComponent(props) {
|
|
|
196
170
|
const isDropTarget = true === resolvedData.isDropTarget;
|
|
197
171
|
const containerWidth = width || container_cjs_namespaceObject.DEFAULT_CONTAINER_WIDTH;
|
|
198
172
|
const containerHeight = height || container_cjs_namespaceObject.DEFAULT_CONTAINER_HEIGHT;
|
|
199
|
-
const resizeMinimums = useContainerResizeMinimums(id, containerWidth, containerHeight);
|
|
200
173
|
const nodeSizeStyle = {
|
|
201
174
|
width: containerWidth,
|
|
202
175
|
height: containerHeight,
|
|
@@ -289,7 +262,6 @@ function LoopNodeComponent(props) {
|
|
|
289
262
|
visible: showResizeControls
|
|
290
263
|
}),
|
|
291
264
|
showResizeControls ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ResizeControls, {
|
|
292
|
-
minimums: resizeMinimums,
|
|
293
265
|
onResize: handleResize
|
|
294
266
|
}) : null,
|
|
295
267
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Header, {
|
|
@@ -399,13 +371,13 @@ function BodyFrame({ isEmpty, isLoading }) {
|
|
|
399
371
|
}) : null
|
|
400
372
|
});
|
|
401
373
|
}
|
|
402
|
-
function ResizeControls({
|
|
374
|
+
function ResizeControls({ onResize }) {
|
|
403
375
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(jsx_runtime_namespaceObject.Fragment, {
|
|
404
|
-
children: RESIZE_CONTROLS.map(({ position,
|
|
376
|
+
children: RESIZE_CONTROLS.map(({ position, cursor })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_cjs_namespaceObject.NodeResizeControl, {
|
|
405
377
|
style: RESIZE_CONTROL_STYLE,
|
|
406
378
|
position: position,
|
|
407
|
-
minWidth:
|
|
408
|
-
minHeight:
|
|
379
|
+
minWidth: container_cjs_namespaceObject.DEFAULT_CONTAINER_MIN_WIDTH,
|
|
380
|
+
minHeight: container_cjs_namespaceObject.DEFAULT_CONTAINER_MIN_HEIGHT,
|
|
409
381
|
onResize: onResize,
|
|
410
382
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
411
383
|
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":"AAkCA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAyEtD,iBAAS,iBAAiB,CAAC,KAAK,EAAE,aAAa,2CAgO9C;AAED,eAAO,MAAM,QAAQ,+DAA0B,CAAC"}
|
|
@@ -2,11 +2,10 @@ 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";
|
|
6
5
|
import { useOptionalNodeTypeRegistry } from "../../core/index.js";
|
|
7
6
|
import { useElementValidationStatus, useNodeExecutionState } from "../../hooks/index.js";
|
|
8
7
|
import { resolveAdornments } from "../../utils/adornment-resolver.js";
|
|
9
|
-
import { DEFAULT_CONTAINER_HEIGHT, DEFAULT_CONTAINER_MIN_HEIGHT, DEFAULT_CONTAINER_MIN_WIDTH, DEFAULT_CONTAINER_WIDTH
|
|
8
|
+
import { DEFAULT_CONTAINER_HEIGHT, DEFAULT_CONTAINER_MIN_HEIGHT, DEFAULT_CONTAINER_MIN_WIDTH, DEFAULT_CONTAINER_WIDTH } from "../../utils/container.js";
|
|
10
9
|
import { CanvasIcon } from "../../utils/icon-registry.js";
|
|
11
10
|
import { resolveDisplay, resolveHandles } from "../../utils/manifest-resolver.js";
|
|
12
11
|
import { selectIsConnecting, snapToGrid } from "../../utils/NodeUtils.js";
|
|
@@ -26,29 +25,21 @@ const EMPTY_DATA = {};
|
|
|
26
25
|
const RESIZE_CONTROLS = [
|
|
27
26
|
{
|
|
28
27
|
position: 'top-left',
|
|
29
|
-
widthSide: 'left',
|
|
30
|
-
heightSide: 'top',
|
|
31
28
|
cursor: 'nwse-resize',
|
|
32
29
|
indicatorClassName: 'top-[-4px] left-[-4px]'
|
|
33
30
|
},
|
|
34
31
|
{
|
|
35
32
|
position: 'top-right',
|
|
36
|
-
widthSide: 'right',
|
|
37
|
-
heightSide: 'top',
|
|
38
33
|
cursor: 'nesw-resize',
|
|
39
34
|
indicatorClassName: 'top-[-4px] right-[-4px]'
|
|
40
35
|
},
|
|
41
36
|
{
|
|
42
37
|
position: 'bottom-left',
|
|
43
|
-
widthSide: 'left',
|
|
44
|
-
heightSide: 'bottom',
|
|
45
38
|
cursor: 'nesw-resize',
|
|
46
39
|
indicatorClassName: 'bottom-[-4px] left-[-4px]'
|
|
47
40
|
},
|
|
48
41
|
{
|
|
49
42
|
position: 'bottom-right',
|
|
50
|
-
widthSide: 'right',
|
|
51
|
-
heightSide: 'bottom',
|
|
52
43
|
cursor: 'nwse-resize',
|
|
53
44
|
indicatorClassName: 'bottom-[-4px] right-[-4px]'
|
|
54
45
|
}
|
|
@@ -58,12 +49,6 @@ const RESIZE_CONTROL_STYLE = {
|
|
|
58
49
|
border: 'none',
|
|
59
50
|
zIndex: 100
|
|
60
51
|
};
|
|
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
|
-
};
|
|
67
52
|
const ADORNMENT_SLOT_POSITIONS = [
|
|
68
53
|
'topLeft',
|
|
69
54
|
'topRight',
|
|
@@ -88,17 +73,6 @@ function useHasChildNodes(id, enabled) {
|
|
|
88
73
|
enabled
|
|
89
74
|
]));
|
|
90
75
|
}
|
|
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
|
-
}
|
|
102
76
|
function useContainerNodeInternalsRefresh(id, handleGroups, width, height) {
|
|
103
77
|
const updateNodeInternals = useUpdateNodeInternals();
|
|
104
78
|
useEffect(()=>{
|
|
@@ -168,7 +142,6 @@ function LoopNodeComponent(props) {
|
|
|
168
142
|
const isDropTarget = true === resolvedData.isDropTarget;
|
|
169
143
|
const containerWidth = width || DEFAULT_CONTAINER_WIDTH;
|
|
170
144
|
const containerHeight = height || DEFAULT_CONTAINER_HEIGHT;
|
|
171
|
-
const resizeMinimums = useContainerResizeMinimums(id, containerWidth, containerHeight);
|
|
172
145
|
const nodeSizeStyle = {
|
|
173
146
|
width: containerWidth,
|
|
174
147
|
height: containerHeight,
|
|
@@ -261,7 +234,6 @@ function LoopNodeComponent(props) {
|
|
|
261
234
|
visible: showResizeControls
|
|
262
235
|
}),
|
|
263
236
|
showResizeControls ? /*#__PURE__*/ jsx(ResizeControls, {
|
|
264
|
-
minimums: resizeMinimums,
|
|
265
237
|
onResize: handleResize
|
|
266
238
|
}) : null,
|
|
267
239
|
/*#__PURE__*/ jsx(Header, {
|
|
@@ -371,13 +343,13 @@ function BodyFrame({ isEmpty, isLoading }) {
|
|
|
371
343
|
}) : null
|
|
372
344
|
});
|
|
373
345
|
}
|
|
374
|
-
function ResizeControls({
|
|
346
|
+
function ResizeControls({ onResize }) {
|
|
375
347
|
return /*#__PURE__*/ jsx(Fragment, {
|
|
376
|
-
children: RESIZE_CONTROLS.map(({ position,
|
|
348
|
+
children: RESIZE_CONTROLS.map(({ position, cursor })=>/*#__PURE__*/ jsx(NodeResizeControl, {
|
|
377
349
|
style: RESIZE_CONTROL_STYLE,
|
|
378
350
|
position: position,
|
|
379
|
-
minWidth:
|
|
380
|
-
minHeight:
|
|
351
|
+
minWidth: DEFAULT_CONTAINER_MIN_WIDTH,
|
|
352
|
+
minHeight: DEFAULT_CONTAINER_MIN_HEIGHT,
|
|
381
353
|
onResize: onResize,
|
|
382
354
|
children: /*#__PURE__*/ jsx("div", {
|
|
383
355
|
className: "absolute bottom-0 right-0 h-5 w-5 pointer-events-auto",
|
|
@@ -29,7 +29,6 @@ __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,
|
|
33
32
|
isContainerNodeManifest: ()=>isContainerNodeManifest,
|
|
34
33
|
fitContainersAndPushSiblings: ()=>fitContainersAndPushSiblings,
|
|
35
34
|
DEFAULT_CONTAINER_MIN_HEIGHT: ()=>DEFAULT_CONTAINER_MIN_HEIGHT,
|
|
@@ -106,50 +105,6 @@ function container_getContainerFitGeometry() {
|
|
|
106
105
|
padding
|
|
107
106
|
};
|
|
108
107
|
}
|
|
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
|
-
}
|
|
153
108
|
function isContainerNodeManifest(manifest) {
|
|
154
109
|
return manifest?.display.shape === 'container';
|
|
155
110
|
}
|
|
@@ -720,7 +675,6 @@ exports.fitContainersAndPushSiblings = __webpack_exports__.fitContainersAndPushS
|
|
|
720
675
|
exports.getContainerFitGeometry = __webpack_exports__.getContainerFitGeometry;
|
|
721
676
|
exports.getContainerNodeForEdge = __webpack_exports__.getContainerNodeForEdge;
|
|
722
677
|
exports.getContainerPlacement = __webpack_exports__.getContainerPlacement;
|
|
723
|
-
exports.getContainerResizeMinimums = __webpack_exports__.getContainerResizeMinimums;
|
|
724
678
|
exports.getContainerSafeArea = __webpack_exports__.getContainerSafeArea;
|
|
725
679
|
exports.getNodeDimensions = __webpack_exports__.getNodeDimensions;
|
|
726
680
|
exports.isContainerNodeManifest = __webpack_exports__.isContainerNodeManifest;
|
|
@@ -739,7 +693,6 @@ for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
|
739
693
|
"getContainerFitGeometry",
|
|
740
694
|
"getContainerNodeForEdge",
|
|
741
695
|
"getContainerPlacement",
|
|
742
|
-
"getContainerResizeMinimums",
|
|
743
696
|
"getContainerSafeArea",
|
|
744
697
|
"getNodeDimensions",
|
|
745
698
|
"isContainerNodeManifest",
|
|
@@ -32,12 +32,6 @@ 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
|
-
}
|
|
41
35
|
export interface EnsureContainersFitChildrenResult {
|
|
42
36
|
nodes: Node[];
|
|
43
37
|
changes: ContainerSizeChange[];
|
|
@@ -85,12 +79,6 @@ export declare const CONTAINER_SEQUENCE_GAP_PX: number;
|
|
|
85
79
|
export declare function getNodeDimensions(node: Pick<Node, 'width' | 'height' | 'measured' | 'style'>, fallback?: NodeDimensions): NodeDimensions;
|
|
86
80
|
export declare function getContainerSafeArea(containerNode: Pick<Node, 'width' | 'height' | 'measured' | 'style'>, fallback?: NodeDimensions): ContainerSafeArea;
|
|
87
81
|
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;
|
|
94
82
|
export declare function isContainerNodeManifest(manifest: Pick<NodeManifest, 'display'> | undefined): boolean;
|
|
95
83
|
export declare function ensureContainersFitChildren(nodes: Node[], { containerIds, getContainerFitGeometry: resolveContainerFitGeometry, getNodeDimensions: resolveNodeDimensions, ignoredNodeTypes, includeAncestors, }?: {
|
|
96
84
|
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;AAOl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AE,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,50 +61,6 @@ 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
|
-
}
|
|
108
64
|
function isContainerNodeManifest(manifest) {
|
|
109
65
|
return manifest?.display.shape === 'container';
|
|
110
66
|
}
|
|
@@ -663,4 +619,4 @@ function placeContainerNode({ nodes, insertedNode, placement, safeArea, getConta
|
|
|
663
619
|
gap
|
|
664
620
|
});
|
|
665
621
|
}
|
|
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,
|
|
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 };
|