@uipath/maestro-builder-sdk 6.112.0 → 6.113.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-index.md +14 -14
- package/dist/api-members.md +67 -67
- package/dist/auto-layout.d.ts +59 -0
- package/dist/auto-layout.js +271 -0
- package/dist/core/elk-layout.d.ts +117 -0
- package/dist/core/elk-layout.js +564 -0
- package/dist/core/elk-module.d.ts +40 -0
- package/dist/core/elk-module.js +72 -0
- package/dist/core/refusals.d.ts +2 -0
- package/dist/core/refusals.js +2 -0
- package/dist/decompile.js +14 -1
- package/dist/flow-sdk.d.ts +22 -17
- package/dist/flow-sdk.js +21 -16
- package/dist/merge.js +8 -1
- package/dist/node-placement.d.ts +28 -3
- package/dist/node-placement.js +39 -4
- package/dist/serialize.js +14 -4
- package/package.json +3 -2
package/dist/core/refusals.d.ts
CHANGED
|
@@ -310,6 +310,7 @@ export declare const REFUSALS: {
|
|
|
310
310
|
readonly DUP_STAGE: "lowering";
|
|
311
311
|
readonly DUP_STEP: "lowering";
|
|
312
312
|
readonly DUP_TASK: "lowering";
|
|
313
|
+
readonly ELK_UNAVAILABLE: "lowering";
|
|
313
314
|
readonly EMPTY_ARM: "lint";
|
|
314
315
|
readonly EMPTY_LOOP: "lint";
|
|
315
316
|
readonly EMPTY_REQUIRED_FIELD: "lint";
|
|
@@ -566,6 +567,7 @@ export declare const REFUSALS: {
|
|
|
566
567
|
readonly JSON_REF_UNREADABLE: "lowering";
|
|
567
568
|
readonly JS_ESCAPE_COOKED: "lint";
|
|
568
569
|
readonly JS_ESCAPE_INVALID: "lint";
|
|
570
|
+
readonly LAYOUT_AUTO_FAILED: "lowering";
|
|
569
571
|
readonly LAYOUT_EDGE_AMBIGUOUS: "lowering";
|
|
570
572
|
readonly LAYOUT_EDGE_KEY_FORM: "lowering";
|
|
571
573
|
readonly LAYOUT_UNKNOWN_KEY: "lowering";
|
package/dist/core/refusals.js
CHANGED
|
@@ -384,6 +384,7 @@ export const REFUSALS = {
|
|
|
384
384
|
DUP_STAGE: 'lowering',
|
|
385
385
|
DUP_STEP: 'lowering',
|
|
386
386
|
DUP_TASK: 'lowering',
|
|
387
|
+
ELK_UNAVAILABLE: 'lowering',
|
|
387
388
|
EMPTY_ARM: 'lint',
|
|
388
389
|
EMPTY_LOOP: 'lint',
|
|
389
390
|
EMPTY_REQUIRED_FIELD: 'lint',
|
|
@@ -642,6 +643,7 @@ export const REFUSALS = {
|
|
|
642
643
|
JSON_REF_UNREADABLE: 'lowering',
|
|
643
644
|
JS_ESCAPE_COOKED: 'lint',
|
|
644
645
|
JS_ESCAPE_INVALID: 'lint',
|
|
646
|
+
LAYOUT_AUTO_FAILED: 'lowering',
|
|
645
647
|
LAYOUT_EDGE_AMBIGUOUS: 'lowering',
|
|
646
648
|
LAYOUT_EDGE_KEY_FORM: 'lowering',
|
|
647
649
|
LAYOUT_UNKNOWN_KEY: 'lowering',
|
package/dist/decompile.js
CHANGED
|
@@ -48,6 +48,7 @@ import { contributionPort, forwardFanOut } from './core/definition-handles.js';
|
|
|
48
48
|
import { STICKY_NOTE_TYPE } from './core/definitionless-node-types.js';
|
|
49
49
|
import { bindingValueRows, referencedBindingNames } from './core/contribution-bindings.js';
|
|
50
50
|
import { builtChainSource, chainStatements } from './core/builder-chain.js';
|
|
51
|
+
import { isMarkedPlaceholder } from './node-placement.js';
|
|
51
52
|
/**
|
|
52
53
|
* The trigger id of the flow currently being decompiled, so a reference through a
|
|
53
54
|
* RENAMED trigger is still recognized as `input('x')` rather than falling back to
|
|
@@ -2801,6 +2802,16 @@ function layoutSeg(flow, nodes, edges) {
|
|
|
2801
2802
|
return ins.length > 0 && !runAbsorbed.has(id) && ins.every((e) => ARTIFACT_PORTS.has(e.sourcePort));
|
|
2802
2803
|
};
|
|
2803
2804
|
const nodeEntries = [];
|
|
2805
|
+
const uiOf = (n) => ({ ...(n.ui ?? {}), ...(hoisted[n.id] ?? {}) });
|
|
2806
|
+
const placed = nodes.filter((n) => n.type !== STICKY_NOTE_TYPE && !renamed(n.id) && !unspelled(n.id) && uiOf(n).position !== undefined);
|
|
2807
|
+
// Compile lays a scope out only when its `.layout()` names none of its nodes. So
|
|
2808
|
+
// the marks may stand in for positions only while EVERY node is where compile put
|
|
2809
|
+
// it: then the source has no entries and compile lays the scope out the same way
|
|
2810
|
+
// again. Once any node is someone's (dragged or added on the canvas), the scope is
|
|
2811
|
+
// authored, compile would put every node with no entry on its placeholder row,
|
|
2812
|
+
// and so every node gets its entry. Example: drag one node of a laid-out flow in
|
|
2813
|
+
// Studio Web; the decompiled `.layout()` then names all of them, at their positions.
|
|
2814
|
+
const compilePlacedScope = placed.every((n) => isMarkedPlaceholder(uiOf(n)));
|
|
2804
2815
|
for (const n of nodes) {
|
|
2805
2816
|
// A sticky note carries its own geometry in `.stickyNotes()`; a layout entry
|
|
2806
2817
|
// for it would be a second, competing source for the same coordinates.
|
|
@@ -2808,7 +2819,9 @@ function layoutSeg(flow, nodes, edges) {
|
|
|
2808
2819
|
continue;
|
|
2809
2820
|
if (renamed(n.id) || unspelled(n.id))
|
|
2810
2821
|
continue;
|
|
2811
|
-
const ui =
|
|
2822
|
+
const ui = uiOf(n);
|
|
2823
|
+
if (compilePlacedScope && isMarkedPlaceholder(ui))
|
|
2824
|
+
continue;
|
|
2812
2825
|
const pos = ui.position;
|
|
2813
2826
|
if (!pos || typeof pos.x !== 'number' || typeof pos.y !== 'number')
|
|
2814
2827
|
continue;
|
package/dist/flow-sdk.d.ts
CHANGED
|
@@ -586,7 +586,7 @@ export interface NodeLayout {
|
|
|
586
586
|
x: number;
|
|
587
587
|
y: number;
|
|
588
588
|
};
|
|
589
|
-
/** Node size; omit
|
|
589
|
+
/** Node size; omit for the size of the node's canvas shape (a container 560 × 320, an inline agent 288 × 96, anything else 96 × 96). */
|
|
590
590
|
size?: {
|
|
591
591
|
width: number;
|
|
592
592
|
height: number;
|
|
@@ -601,8 +601,9 @@ export interface NodeLayout {
|
|
|
601
601
|
* @remarks
|
|
602
602
|
* Positions are canvas pixels. A child's position inside a container is relative
|
|
603
603
|
* to that container, as the designer stores it; the body of a loop starts inside
|
|
604
|
-
* the container's padding, at `at(144, 96)`.
|
|
605
|
-
*
|
|
604
|
+
* the container's padding, at `at(144, 96)`. Without a size, {@link dim}, compile
|
|
605
|
+
* writes the size of the node's canvas shape: 560 × 320 for a container, 288 × 96
|
|
606
|
+
* for an inline agent, 96 × 96 for anything else.
|
|
606
607
|
*
|
|
607
608
|
* @example
|
|
608
609
|
* **Lay out a main path on one row, with a side path below it**
|
|
@@ -619,7 +620,7 @@ export interface NodeLayout {
|
|
|
619
620
|
*
|
|
620
621
|
* @param x - The node's left edge on the canvas.
|
|
621
622
|
* @param y - The node's top edge on the canvas.
|
|
622
|
-
* @param size - The node's size; omit
|
|
623
|
+
* @param size - The node's size; omit for its canvas shape's size.
|
|
623
624
|
* @returns A {@link NodeLayout} to put in `.layout({ nodes })`.
|
|
624
625
|
*/
|
|
625
626
|
export declare function at(x: number, y: number, size?: NodeLayout['size']): NodeLayout;
|
|
@@ -627,11 +628,12 @@ export declare function at(x: number, y: number, size?: NodeLayout['size']): Nod
|
|
|
627
628
|
* A node's size on the canvas, in pixels — the third argument of {@link at}.
|
|
628
629
|
*
|
|
629
630
|
* @remarks
|
|
630
|
-
*
|
|
631
|
-
* size
|
|
632
|
-
*
|
|
633
|
-
*
|
|
634
|
-
*
|
|
631
|
+
* Needed only for a size other than the node's canvas shape's. Compile writes
|
|
632
|
+
* that size on every node {@link at} places without one, as
|
|
633
|
+
* `uip maestro flow format` does: 560 × 320 for a container (a loop or a
|
|
634
|
+
* do-while body, drawn as a box around its children), 288 × 96 for an inline
|
|
635
|
+
* agent, 96 × 96 for anything else. A container whose body is wider or taller
|
|
636
|
+
* than 560 × 320 needs its `dim()`.
|
|
635
637
|
*
|
|
636
638
|
* @example
|
|
637
639
|
* **A loop wide enough for a three-step body, then an inline agent**
|
|
@@ -1329,14 +1331,17 @@ declare class FlowBuilder extends StepList {
|
|
|
1329
1331
|
/**
|
|
1330
1332
|
* Set designer layout — node positions/sizes and edge routes — keyed by the
|
|
1331
1333
|
* flow's own logical ids (step names, the trigger id, `end`). Optional pure
|
|
1332
|
-
* metadata: nothing here changes what the flow does
|
|
1333
|
-
*
|
|
1334
|
-
*
|
|
1335
|
-
*
|
|
1336
|
-
*
|
|
1337
|
-
*
|
|
1338
|
-
*
|
|
1339
|
-
* a
|
|
1334
|
+
* metadata: nothing here changes what the flow does. Unknown keys fail
|
|
1335
|
+
* compilation rather than being dropped.
|
|
1336
|
+
*
|
|
1337
|
+
* Without a layout (no node entries), compile lays the flow out the way
|
|
1338
|
+
* `uip maestro flow format` does: left to right, branches on their own rows,
|
|
1339
|
+
* loop bodies inside their container, each node at its canvas shape's size, the
|
|
1340
|
+
* trigger at (256, 144). Each subflow is laid out on its own. With a layout,
|
|
1341
|
+
* every node it names goes where it says, and a node it leaves out stays on
|
|
1342
|
+
* compile's one-row placeholder (`x = 256 + 288 × index`), for `merge` to place.
|
|
1343
|
+
* {@link at} writes a node's entry from two numbers, and {@link dim} a size other
|
|
1344
|
+
* than its shape's from two more.
|
|
1340
1345
|
*
|
|
1341
1346
|
* @example
|
|
1342
1347
|
* **Main path on one row, the error handler on the row below**
|
package/dist/flow-sdk.js
CHANGED
|
@@ -163,8 +163,9 @@ export function parallelFork(options) {
|
|
|
163
163
|
* @remarks
|
|
164
164
|
* Positions are canvas pixels. A child's position inside a container is relative
|
|
165
165
|
* to that container, as the designer stores it; the body of a loop starts inside
|
|
166
|
-
* the container's padding, at `at(144, 96)`.
|
|
167
|
-
*
|
|
166
|
+
* the container's padding, at `at(144, 96)`. Without a size, {@link dim}, compile
|
|
167
|
+
* writes the size of the node's canvas shape: 560 × 320 for a container, 288 × 96
|
|
168
|
+
* for an inline agent, 96 × 96 for anything else.
|
|
168
169
|
*
|
|
169
170
|
* @example
|
|
170
171
|
* **Lay out a main path on one row, with a side path below it**
|
|
@@ -181,7 +182,7 @@ export function parallelFork(options) {
|
|
|
181
182
|
*
|
|
182
183
|
* @param x - The node's left edge on the canvas.
|
|
183
184
|
* @param y - The node's top edge on the canvas.
|
|
184
|
-
* @param size - The node's size; omit
|
|
185
|
+
* @param size - The node's size; omit for its canvas shape's size.
|
|
185
186
|
* @returns A {@link NodeLayout} to put in `.layout({ nodes })`.
|
|
186
187
|
*/
|
|
187
188
|
export function at(x, y, size) {
|
|
@@ -191,11 +192,12 @@ export function at(x, y, size) {
|
|
|
191
192
|
* A node's size on the canvas, in pixels — the third argument of {@link at}.
|
|
192
193
|
*
|
|
193
194
|
* @remarks
|
|
194
|
-
*
|
|
195
|
-
* size
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
*
|
|
195
|
+
* Needed only for a size other than the node's canvas shape's. Compile writes
|
|
196
|
+
* that size on every node {@link at} places without one, as
|
|
197
|
+
* `uip maestro flow format` does: 560 × 320 for a container (a loop or a
|
|
198
|
+
* do-while body, drawn as a box around its children), 288 × 96 for an inline
|
|
199
|
+
* agent, 96 × 96 for anything else. A container whose body is wider or taller
|
|
200
|
+
* than 560 × 320 needs its `dim()`.
|
|
199
201
|
*
|
|
200
202
|
* @example
|
|
201
203
|
* **A loop wide enough for a three-step body, then an inline agent**
|
|
@@ -909,14 +911,17 @@ class FlowBuilder extends StepList {
|
|
|
909
911
|
/**
|
|
910
912
|
* Set designer layout — node positions/sizes and edge routes — keyed by the
|
|
911
913
|
* flow's own logical ids (step names, the trigger id, `end`). Optional pure
|
|
912
|
-
* metadata: nothing here changes what the flow does
|
|
913
|
-
*
|
|
914
|
-
*
|
|
915
|
-
*
|
|
916
|
-
*
|
|
917
|
-
*
|
|
918
|
-
*
|
|
919
|
-
* a
|
|
914
|
+
* metadata: nothing here changes what the flow does. Unknown keys fail
|
|
915
|
+
* compilation rather than being dropped.
|
|
916
|
+
*
|
|
917
|
+
* Without a layout (no node entries), compile lays the flow out the way
|
|
918
|
+
* `uip maestro flow format` does: left to right, branches on their own rows,
|
|
919
|
+
* loop bodies inside their container, each node at its canvas shape's size, the
|
|
920
|
+
* trigger at (256, 144). Each subflow is laid out on its own. With a layout,
|
|
921
|
+
* every node it names goes where it says, and a node it leaves out stays on
|
|
922
|
+
* compile's one-row placeholder (`x = 256 + 288 × index`), for `merge` to place.
|
|
923
|
+
* {@link at} writes a node's entry from two numbers, and {@link dim} a size other
|
|
924
|
+
* than its shape's from two more.
|
|
920
925
|
*
|
|
921
926
|
* @example
|
|
922
927
|
* **Main path on one row, the error handler on the row below**
|
package/dist/merge.js
CHANGED
|
@@ -93,7 +93,7 @@ import { jsonClone } from './core/json-clone.js';
|
|
|
93
93
|
import { isRecord } from './core/node-envelope.js';
|
|
94
94
|
import { DEFINITIONLESS_NODE_TYPES } from './core/definitionless-node-types.js';
|
|
95
95
|
import { MergeRefusedError, mergedFileFindings, roundTripFindings } from './merge-roundtrip.js';
|
|
96
|
-
import { placeAddedNodes } from './node-placement.js';
|
|
96
|
+
import { placeAddedNodes, stripPlaceholderFlag } from './node-placement.js';
|
|
97
97
|
import { mergeAgentSidecars } from './merge-sidecars.js';
|
|
98
98
|
import { embeddedAgentFindings, isEmbeddedAgent, mergeEmbeddedAgentNode } from './merge-embedded-agent.js';
|
|
99
99
|
import { mergeObject, mergeVariables, stableJson } from './merge-variables.js';
|
|
@@ -478,6 +478,13 @@ function mergeFlowFindings(original, edited, options) {
|
|
|
478
478
|
// positions — see node-placement.ts. Root scope only: a
|
|
479
479
|
// subflow is taken from `edited` whole, layout included. ──
|
|
480
480
|
placeAddedNodes(finalNodes, result.edges, positionStoreOf(original) && layoutNodesOf(result), (id) => !origNodes.has(id));
|
|
481
|
+
// An added root node is where merge put it now, not where compile did: drop its
|
|
482
|
+
// mark. A subflow taken whole keeps compile's layout and its marks, so a later
|
|
483
|
+
// decompile still leaves it to compile; an original node keeps the original's ui.
|
|
484
|
+
for (const n of finalNodes.filter((n) => !origNodes.has(n.id))) {
|
|
485
|
+
stripPlaceholderFlag(n.ui);
|
|
486
|
+
stripPlaceholderFlag(layoutNodesOf(result)?.[n.id]);
|
|
487
|
+
}
|
|
481
488
|
// ── Definitions: the (type, version) pairs used by EVERY node in the file —
|
|
482
489
|
// root and subflows — original winning on conflict (its defs are the
|
|
483
490
|
// tenant-resolved authority). Selecting by root nodes only dropped the
|
package/dist/node-placement.d.ts
CHANGED
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
* node-placement — where compile puts a node it has no position for, and where
|
|
3
3
|
* merge moves one the edit added.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* In a flow or subflow whose `.layout()` names nodes (every decompiled source
|
|
6
|
+
* with positions), compile gives each node it leaves out a placeholder from its
|
|
7
|
+
* emission index, `x = 256 + 288 × index, y = 144` (`+160` inside a container).
|
|
8
|
+
* A scope with no `.layout()` node entries is laid out whole instead
|
|
9
|
+
* (`auto-layout.ts`). Merge replaces the placeholder on each node the edit added:
|
|
8
10
|
*
|
|
9
11
|
* - right of its rightmost positioned predecessor in the same container, past
|
|
10
12
|
* its width, on that predecessor's row; when the node leads into another
|
|
@@ -67,6 +69,29 @@ export declare function placeholderPosition(index: number, nested: boolean): Poi
|
|
|
67
69
|
* a placeholder; that is the one ambiguity.
|
|
68
70
|
*/
|
|
69
71
|
export declare function isPlaceholderPosition(p: Point | undefined): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* The `ui` key compile writes on a node whose position it chose itself: every node of a
|
|
74
|
+
* flow or subflow it laid out (no `.layout()` node entries, `auto-layout.ts`). Its value
|
|
75
|
+
* is the position compile chose, so the mark holds only while the node is still there:
|
|
76
|
+
* Studio Web keeps unknown `ui` keys on save (flow-schema `extractLayout` persists "the
|
|
77
|
+
* full ui object (including unknown keys like zoom)"), and a drag changes `position` but
|
|
78
|
+
* not this key. Merge places an added node whose mark holds, and decompile writes no
|
|
79
|
+
* `.layout()` entry for it. The `.flow` schema's node `ui` takes extra keys
|
|
80
|
+
* (flow-schema `workflow-file`, `$catchall`).
|
|
81
|
+
*
|
|
82
|
+
* Example: `flow compile` of a source with no `.layout()` writes
|
|
83
|
+
* `{ position: { x: 448, y: 144 }, size: …, collapsed: false, placeholder: { x: 448, y: 144 } }`.
|
|
84
|
+
* Drag the node to (448, 304) in the designer and the mark no longer holds.
|
|
85
|
+
*/
|
|
86
|
+
export declare const PLACEHOLDER_FLAG = "placeholder";
|
|
87
|
+
/** `ui` with {@link PLACEHOLDER_FLAG} set to its current position. */
|
|
88
|
+
export declare function markCompilePlaced<T extends {
|
|
89
|
+
position?: Point;
|
|
90
|
+
}>(ui: T): T;
|
|
91
|
+
/** Whether a node's `ui` (layout entry over `node.ui`) still sits where compile put it. */
|
|
92
|
+
export declare function isMarkedPlaceholder(ui: unknown): boolean;
|
|
93
|
+
/** Remove {@link PLACEHOLDER_FLAG} from a node's `ui`, or a `layout.nodes` entry, in place. */
|
|
94
|
+
export declare function stripPlaceholderFlag(ui: unknown): void;
|
|
70
95
|
/** A node's `ui` (or its `layout.nodes` entry): the fields placement reads. */
|
|
71
96
|
interface Ui {
|
|
72
97
|
position?: Point;
|
package/dist/node-placement.js
CHANGED
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
* node-placement — where compile puts a node it has no position for, and where
|
|
3
3
|
* merge moves one the edit added.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* In a flow or subflow whose `.layout()` names nodes (every decompiled source
|
|
6
|
+
* with positions), compile gives each node it leaves out a placeholder from its
|
|
7
|
+
* emission index, `x = 256 + 288 × index, y = 144` (`+160` inside a container).
|
|
8
|
+
* A scope with no `.layout()` node entries is laid out whole instead
|
|
9
|
+
* (`auto-layout.ts`). Merge replaces the placeholder on each node the edit added:
|
|
8
10
|
*
|
|
9
11
|
* - right of its rightmost positioned predecessor in the same container, past
|
|
10
12
|
* its width, on that predecessor's row; when the node leads into another
|
|
@@ -90,6 +92,38 @@ export function isPlaceholderPosition(p) {
|
|
|
90
92
|
const k = (p.x - PLACEHOLDER.x0) / PLACEHOLDER.dx;
|
|
91
93
|
return Number.isInteger(k) && k >= 0 && (p.y === PLACEHOLDER.y0 || p.y === PLACEHOLDER.y0 + PLACEHOLDER.nestedDy);
|
|
92
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* The `ui` key compile writes on a node whose position it chose itself: every node of a
|
|
97
|
+
* flow or subflow it laid out (no `.layout()` node entries, `auto-layout.ts`). Its value
|
|
98
|
+
* is the position compile chose, so the mark holds only while the node is still there:
|
|
99
|
+
* Studio Web keeps unknown `ui` keys on save (flow-schema `extractLayout` persists "the
|
|
100
|
+
* full ui object (including unknown keys like zoom)"), and a drag changes `position` but
|
|
101
|
+
* not this key. Merge places an added node whose mark holds, and decompile writes no
|
|
102
|
+
* `.layout()` entry for it. The `.flow` schema's node `ui` takes extra keys
|
|
103
|
+
* (flow-schema `workflow-file`, `$catchall`).
|
|
104
|
+
*
|
|
105
|
+
* Example: `flow compile` of a source with no `.layout()` writes
|
|
106
|
+
* `{ position: { x: 448, y: 144 }, size: …, collapsed: false, placeholder: { x: 448, y: 144 } }`.
|
|
107
|
+
* Drag the node to (448, 304) in the designer and the mark no longer holds.
|
|
108
|
+
*/
|
|
109
|
+
export const PLACEHOLDER_FLAG = 'placeholder';
|
|
110
|
+
/** `ui` with {@link PLACEHOLDER_FLAG} set to its current position. */
|
|
111
|
+
export function markCompilePlaced(ui) {
|
|
112
|
+
return ui.position ? { ...ui, [PLACEHOLDER_FLAG]: { x: ui.position.x, y: ui.position.y } } : ui;
|
|
113
|
+
}
|
|
114
|
+
/** Whether a node's `ui` (layout entry over `node.ui`) still sits where compile put it. */
|
|
115
|
+
export function isMarkedPlaceholder(ui) {
|
|
116
|
+
if (!ui || typeof ui !== 'object')
|
|
117
|
+
return false;
|
|
118
|
+
const { position, [PLACEHOLDER_FLAG]: mark } = ui;
|
|
119
|
+
const at = mark;
|
|
120
|
+
return !!position && !!at && typeof at === 'object' && at.x === position.x && at.y === position.y;
|
|
121
|
+
}
|
|
122
|
+
/** Remove {@link PLACEHOLDER_FLAG} from a node's `ui`, or a `layout.nodes` entry, in place. */
|
|
123
|
+
export function stripPlaceholderFlag(ui) {
|
|
124
|
+
if (ui && typeof ui === 'object')
|
|
125
|
+
delete ui[PLACEHOLDER_FLAG];
|
|
126
|
+
}
|
|
93
127
|
const overlaps = (a, b) => !(a.x + a.width + PADDING <= b.x || b.x + b.width + PADDING <= a.x
|
|
94
128
|
|| a.y + a.height + PADDING <= b.y || b.y + b.height + PADDING <= a.y);
|
|
95
129
|
/** Whether two boxes share a row: their vertical extents meet, padding included. */
|
|
@@ -199,7 +233,8 @@ function sceneOf(nodes, edges, layoutNodes, isAdded) {
|
|
|
199
233
|
notesOf: new Map(),
|
|
200
234
|
};
|
|
201
235
|
for (const n of nodes) {
|
|
202
|
-
|
|
236
|
+
const ui = uiOf(s, n);
|
|
237
|
+
if (isAdded(n.id) && n.type !== STICKY_NOTE_TYPE && (isMarkedPlaceholder(ui) || isPlaceholderPosition(ui?.position)))
|
|
203
238
|
s.pending.add(n.id);
|
|
204
239
|
}
|
|
205
240
|
// A pending node no edge path links to a positioned one in its container
|
package/dist/serialize.js
CHANGED
|
@@ -33,6 +33,7 @@ import { BindingRefusal, bindingLabelRefusal, bindingPairRefusal, connectionStub
|
|
|
33
33
|
import { OUTCOME_HANDLE_NODE_TYPES, assertHitlExitInvariant, hitlExitViolation } from './core/hitl-routing.js';
|
|
34
34
|
import { STICKY_NOTE_TYPE, STICKY_NOTE_TYPE_VERSION } from './core/definitionless-node-types.js';
|
|
35
35
|
import { placeholderPosition } from './node-placement.js';
|
|
36
|
+
import { applyCompiledGeometry } from './auto-layout.js';
|
|
36
37
|
import { hasExits } from './core/step-ports.js';
|
|
37
38
|
import { stopsAtEnd } from './flow-step-tree.js';
|
|
38
39
|
import { assertNodeEnvelope } from './core/node-envelope.js';
|
|
@@ -332,7 +333,7 @@ function emitStickyNotes(built, scope, claimNoteId) {
|
|
|
332
333
|
* as the persisted `layout.edges` section. Unknown keys are compile errors —
|
|
333
334
|
* a silently dropped layout entry would read as "the designer moved my node".
|
|
334
335
|
*/
|
|
335
|
-
function applyAuthorLayout(layout, scope, where) {
|
|
336
|
+
function applyAuthorLayout(layout, scope, where, author) {
|
|
336
337
|
if (!layout)
|
|
337
338
|
return undefined;
|
|
338
339
|
const resolveId = (key) => {
|
|
@@ -348,8 +349,11 @@ function applyAuthorLayout(layout, scope, where) {
|
|
|
348
349
|
const node = scope.nodes.find((n) => n.id === resolveId(key));
|
|
349
350
|
node.ui = node.ui ?? {};
|
|
350
351
|
node.ui.position = { x: nl.position.x, y: nl.position.y };
|
|
351
|
-
|
|
352
|
+
author.placed.add(node.id);
|
|
353
|
+
if (nl.size !== undefined) {
|
|
352
354
|
node.ui.size = { width: nl.size.width, height: nl.size.height };
|
|
355
|
+
author.sized.add(node.id);
|
|
356
|
+
}
|
|
353
357
|
if (nl.collapsed !== undefined)
|
|
354
358
|
node.ui.collapsed = nl.collapsed;
|
|
355
359
|
}
|
|
@@ -1788,6 +1792,8 @@ function serializeFlow(built, opts) {
|
|
|
1788
1792
|
emittedDefs.set(key, shared ?? def);
|
|
1789
1793
|
}
|
|
1790
1794
|
let col = 0;
|
|
1795
|
+
/** The nodes `.layout()` placed or sized; `applyCompiledGeometry` places and sizes the rest. */
|
|
1796
|
+
const authorGeometry = { placed: new Set(), sized: new Set() };
|
|
1791
1797
|
/**
|
|
1792
1798
|
* Create a node from a definition (core def by type, or a supplied connector
|
|
1793
1799
|
* v1def). `requestedVersion` is the author's exact `{ version }` node option
|
|
@@ -2011,7 +2017,7 @@ function serializeFlow(built, opts) {
|
|
|
2011
2017
|
assertHitlExitInvariant(scope.nodes, scope.edges, legacyCompletedNodes);
|
|
2012
2018
|
typeAgentInputSchemas(scope, globals);
|
|
2013
2019
|
emitStickyNotes(child, scope, claimNoteId);
|
|
2014
|
-
const layoutEdges = applyAuthorLayout(child.layout, scope, `subflow "${nodeId}"
|
|
2020
|
+
const layoutEdges = applyAuthorLayout(child.layout, scope, `subflow "${nodeId}"`, authorGeometry);
|
|
2015
2021
|
assertNodeEnvelope(scope.nodes, `subflow "${nodeId}"`);
|
|
2016
2022
|
return {
|
|
2017
2023
|
nodes: scope.nodes,
|
|
@@ -3661,7 +3667,7 @@ function serializeFlow(built, opts) {
|
|
|
3661
3667
|
assertHitlExitInvariant(root.nodes, root.edges, legacyCompletedNodes);
|
|
3662
3668
|
typeAgentInputSchemas(root, globals);
|
|
3663
3669
|
emitStickyNotes(built, root, claimNoteId);
|
|
3664
|
-
const rootLayoutEdges = applyAuthorLayout(built.layout, root, `flow "${built.id}"
|
|
3670
|
+
const rootLayoutEdges = applyAuthorLayout(built.layout, root, `flow "${built.id}"`, authorGeometry);
|
|
3665
3671
|
assertNodeEnvelope(root.nodes, `flow "${built.id}"`);
|
|
3666
3672
|
// The FILE-FORMAT version this document declares: the author's
|
|
3667
3673
|
// `.schemaVersion()` when they set one, else the profile's write floor. It is
|
|
@@ -3691,6 +3697,10 @@ function serializeFlow(built, opts) {
|
|
|
3691
3697
|
// Passing the target is what lets a version-conditional step exist at all —
|
|
3692
3698
|
// see migrate.ts's VERSION_CONDITIONAL ladder.
|
|
3693
3699
|
migrateToSchemaVersion(flow, schemaVersion);
|
|
3700
|
+
// Sizes from each node's canvas shape, and `uip maestro flow format`'s layout for a
|
|
3701
|
+
// flow or subflow with no `.layout()` node entries (#1992). After migration, so the
|
|
3702
|
+
// layout reads the file `format` would read.
|
|
3703
|
+
applyCompiledGeometry(flow, authorGeometry);
|
|
3694
3704
|
// Emitted-document invariants over connections, checked on the FINISHED file
|
|
3695
3705
|
// so every family and every emission order is covered by one rule, not by
|
|
3696
3706
|
// each call site remembering it (flow-builder-sdk#865/#866).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/maestro-builder-sdk",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.113.0",
|
|
4
4
|
"description": "Build UiPath Flow, Case, and BPMN artifacts by writing TypeScript.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://docs.uipath.com/maestro",
|
|
@@ -117,11 +117,12 @@
|
|
|
117
117
|
"acorn": "^8.17.0",
|
|
118
118
|
"bpmn-moddle": "^9.0.4",
|
|
119
119
|
"commander": "^14.0.0",
|
|
120
|
+
"elkjs": "0.11.1",
|
|
120
121
|
"typescript": "^5.9.3"
|
|
121
122
|
},
|
|
122
123
|
"devDependencies": {
|
|
123
124
|
"@types/node": "^22.7.0",
|
|
124
125
|
"esbuild": "^0.28.1"
|
|
125
126
|
},
|
|
126
|
-
"gitref": "
|
|
127
|
+
"gitref": "846b52878024374f366bd0ffc6a472b5678140fe"
|
|
127
128
|
}
|