@zoneflow/core 0.0.6 → 0.0.8
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/layout.d.ts +1 -0
- package/dist/layout.js +7 -2
- package/dist/types.d.ts +2 -0
- package/package.json +1 -1
package/dist/layout.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export declare function createZoneLayout(input: {
|
|
|
12
12
|
y: number;
|
|
13
13
|
width: number;
|
|
14
14
|
height: number;
|
|
15
|
+
zOrder?: number;
|
|
15
16
|
}): ZoneLayout;
|
|
16
17
|
export declare function getZoneLayout(layoutModel: UniverseLayoutModel, zoneId: ZoneId): ZoneLayout | undefined;
|
|
17
18
|
export declare function setZoneLayout(layoutModel: UniverseLayoutModel, zoneId: ZoneId, layout: ZoneLayout | undefined): UniverseLayoutModel;
|
package/dist/layout.js
CHANGED
|
@@ -54,12 +54,13 @@ export function createUniverseLayoutModel(input) {
|
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
export function createZoneLayout(input) {
|
|
57
|
-
const { x, y, width, height } = input;
|
|
57
|
+
const { x, y, width, height, zOrder } = input;
|
|
58
58
|
return {
|
|
59
59
|
x,
|
|
60
60
|
y,
|
|
61
61
|
width,
|
|
62
62
|
height,
|
|
63
|
+
zOrder,
|
|
63
64
|
anchors: {
|
|
64
65
|
inlet: {
|
|
65
66
|
point: {
|
|
@@ -99,6 +100,7 @@ export function updateZoneLayout(layoutModel, zoneId, patch) {
|
|
|
99
100
|
y: patch.y ?? currentLayout?.y ?? 0,
|
|
100
101
|
width: patch.width ?? currentLayout?.width,
|
|
101
102
|
height: patch.height ?? currentLayout?.height,
|
|
103
|
+
zOrder: patch.zOrder ?? currentLayout?.zOrder,
|
|
102
104
|
anchors: mergeAnchors(currentLayout?.anchors, patch.anchors),
|
|
103
105
|
});
|
|
104
106
|
}
|
|
@@ -123,6 +125,7 @@ export function updatePathLayout(layoutModel, pathId, patch) {
|
|
|
123
125
|
return setPathLayout(layoutModel, pathId, {
|
|
124
126
|
...currentLayout,
|
|
125
127
|
...patch,
|
|
128
|
+
zOrder: patch.zOrder ?? currentLayout?.zOrder,
|
|
126
129
|
componentLayoutsById: patch.componentLayoutsById ??
|
|
127
130
|
currentLayout?.componentLayoutsById,
|
|
128
131
|
});
|
|
@@ -148,7 +151,9 @@ export function setPathComponentLayout(layoutModel, pathId, componentId, layout)
|
|
|
148
151
|
? nextComponentLayoutsById
|
|
149
152
|
: undefined,
|
|
150
153
|
};
|
|
151
|
-
if (
|
|
154
|
+
if (nextPathLayout.zOrder === undefined &&
|
|
155
|
+
!nextPathLayout.routeOffset &&
|
|
156
|
+
!nextPathLayout.componentLayoutsById) {
|
|
152
157
|
return setPathLayout(layoutModel, pathId, undefined);
|
|
153
158
|
}
|
|
154
159
|
return setPathLayout(layoutModel, pathId, nextPathLayout);
|
package/dist/types.d.ts
CHANGED
|
@@ -18,12 +18,14 @@ export type AnchorLayout = {
|
|
|
18
18
|
rect?: AnchorRect;
|
|
19
19
|
};
|
|
20
20
|
export type ZoneLayout = Layout & {
|
|
21
|
+
zOrder?: number;
|
|
21
22
|
anchors: {
|
|
22
23
|
inlet: AnchorLayout;
|
|
23
24
|
outlet: AnchorLayout;
|
|
24
25
|
};
|
|
25
26
|
};
|
|
26
27
|
export type PathLayout = {
|
|
28
|
+
zOrder?: number;
|
|
27
29
|
routeOffset?: Point;
|
|
28
30
|
componentLayoutsById?: Record<string, Layout>;
|
|
29
31
|
};
|