@xyflow/system 0.0.12 → 0.0.13
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/esm/index.js +2176 -0
- package/dist/esm/index.mjs +266 -146
- package/dist/esm/types/edges.d.ts +2 -2
- package/dist/esm/types/edges.d.ts.map +1 -1
- package/dist/esm/types/general.d.ts +7 -0
- package/dist/esm/types/general.d.ts.map +1 -1
- package/dist/esm/types/nodes.d.ts +7 -2
- package/dist/esm/types/nodes.d.ts.map +1 -1
- package/dist/esm/utils/edges/bezier-edge.d.ts +23 -0
- package/dist/esm/utils/edges/bezier-edge.d.ts.map +1 -1
- package/dist/esm/utils/edges/general.d.ts +23 -5
- package/dist/esm/utils/edges/general.d.ts.map +1 -1
- package/dist/esm/utils/edges/positions.d.ts.map +1 -1
- package/dist/esm/utils/edges/smoothstep-edge.d.ts +22 -0
- package/dist/esm/utils/edges/smoothstep-edge.d.ts.map +1 -1
- package/dist/esm/utils/edges/straight-edge.d.ts +20 -0
- package/dist/esm/utils/edges/straight-edge.d.ts.map +1 -1
- package/dist/esm/utils/general.d.ts +19 -2
- package/dist/esm/utils/general.d.ts.map +1 -1
- package/dist/esm/utils/graph.d.ts +61 -6
- package/dist/esm/utils/graph.d.ts.map +1 -1
- package/dist/esm/utils/store.d.ts +4 -4
- package/dist/esm/utils/store.d.ts.map +1 -1
- package/dist/esm/xyminimap/index.d.ts.map +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/types/edges.d.ts +2 -2
- package/dist/umd/types/edges.d.ts.map +1 -1
- package/dist/umd/types/general.d.ts +7 -0
- package/dist/umd/types/general.d.ts.map +1 -1
- package/dist/umd/types/nodes.d.ts +7 -2
- package/dist/umd/types/nodes.d.ts.map +1 -1
- package/dist/umd/utils/edges/bezier-edge.d.ts +23 -0
- package/dist/umd/utils/edges/bezier-edge.d.ts.map +1 -1
- package/dist/umd/utils/edges/general.d.ts +23 -5
- package/dist/umd/utils/edges/general.d.ts.map +1 -1
- package/dist/umd/utils/edges/positions.d.ts.map +1 -1
- package/dist/umd/utils/edges/smoothstep-edge.d.ts +22 -0
- package/dist/umd/utils/edges/smoothstep-edge.d.ts.map +1 -1
- package/dist/umd/utils/edges/straight-edge.d.ts +20 -0
- package/dist/umd/utils/edges/straight-edge.d.ts.map +1 -1
- package/dist/umd/utils/general.d.ts +19 -2
- package/dist/umd/utils/general.d.ts.map +1 -1
- package/dist/umd/utils/graph.d.ts +61 -6
- package/dist/umd/utils/graph.d.ts.map +1 -1
- package/dist/umd/utils/store.d.ts +4 -4
- package/dist/umd/utils/store.d.ts.map +1 -1
- package/dist/umd/xyminimap/index.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../src/types/general.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,IAAI,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAE/F,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAE9B,MAAM,MAAM,OAAO,GAAG,CAAC,QAAQ,EAAE,UAAU,KAAK,UAAU,CAAC;AAE3D,MAAM,MAAM,MAAM,GAAG,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI,EAAE,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;AACzF,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AACjC,MAAM,MAAM,SAAS,GAAG,MAAM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,EAAE,EACxG,KAAK,EACL,KAAK,GACN,EAAE;IACD,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB,KAAK,OAAO,CAAC,OAAO,GAAG;IAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;IAAC,KAAK,EAAE,QAAQ,EAAE,CAAA;CAAE,CAAC,CAAC"}
|
|
@@ -23,7 +23,6 @@ export type NodeBase<T = any, U extends string | undefined = string | undefined>
|
|
|
23
23
|
extent?: 'parent' | CoordinateExtent;
|
|
24
24
|
expandParent?: boolean;
|
|
25
25
|
ariaLabel?: string;
|
|
26
|
-
focusable?: boolean;
|
|
27
26
|
origin?: NodeOrigin;
|
|
28
27
|
handles?: NodeHandle[];
|
|
29
28
|
computed?: {
|
|
@@ -35,6 +34,10 @@ export type NodeBase<T = any, U extends string | undefined = string | undefined>
|
|
|
35
34
|
z?: number;
|
|
36
35
|
handleBounds?: NodeHandleBounds;
|
|
37
36
|
isParent?: boolean;
|
|
37
|
+
/** Holds a reference to the original node object provided by the user
|
|
38
|
+
* (which may lack some fields, like `computed` or `[internalSymbol]`. Used
|
|
39
|
+
* as an optimization to avoid certain operations. */
|
|
40
|
+
userProvidedNode: NodeBase<T, U>;
|
|
38
41
|
};
|
|
39
42
|
};
|
|
40
43
|
export type NodeProps<T = any> = {
|
|
@@ -45,7 +48,8 @@ export type NodeProps<T = any> = {
|
|
|
45
48
|
selected: NodeBase['selected'];
|
|
46
49
|
isConnectable: NodeBase['connectable'];
|
|
47
50
|
zIndex: NodeBase['zIndex'];
|
|
48
|
-
|
|
51
|
+
positionAbsoluteX: number;
|
|
52
|
+
positionAbsoluteY: number;
|
|
49
53
|
width?: number;
|
|
50
54
|
height?: number;
|
|
51
55
|
dragging: boolean;
|
|
@@ -85,4 +89,5 @@ export type OnNodeDrag = (event: MouseEvent, node: NodeBase, nodes: NodeBase[])
|
|
|
85
89
|
export type OnSelectionDrag = (event: MouseEvent, nodes: NodeBase[]) => void;
|
|
86
90
|
export type NodeHandle = Optional<HandleElement, 'width' | 'height'>;
|
|
87
91
|
export type Align = 'center' | 'start' | 'end';
|
|
92
|
+
export type NodeLookup<NodeType extends NodeBase = NodeBase> = Map<string, NodeType>;
|
|
88
93
|
//# sourceMappingURL=nodes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../src/types/nodes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,GAAG,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG1C,MAAM,MAAM,QAAQ,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,IAAI;IACjF,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,UAAU,CAAC;IACrB,IAAI,EAAE,CAAC,CAAC;IACR,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC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AQ,CAAC,aAAa,EAAE,OAAO,GAAG,QAAQ,CAAC,CAAC;AAErE,MAAM,MAAM,KAAK,GAAG,QAAQ,GAAG,OAAO,GAAG,KAAK,CAAC;AAE/C,MAAM,MAAM,UAAU,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAAI,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC"}
|
|
@@ -26,5 +26,28 @@ export declare function getBezierEdgeCenter({ sourceX, sourceY, targetX, targetY
|
|
|
26
26
|
targetControlX: number;
|
|
27
27
|
targetControlY: number;
|
|
28
28
|
}): [number, number, number, number];
|
|
29
|
+
/**
|
|
30
|
+
* Get a bezier path from source to target handle
|
|
31
|
+
* @param params.sourceX - The x position of the source handle
|
|
32
|
+
* @param params.sourceY - The y position of the source handle
|
|
33
|
+
* @param params.sourcePosition - The position of the source handle (default: Position.Bottom)
|
|
34
|
+
* @param params.targetX - The x position of the target handle
|
|
35
|
+
* @param params.targetY - The y position of the target handle
|
|
36
|
+
* @param params.targetPosition - The position of the target handle (default: Position.Top)
|
|
37
|
+
* @param params.curvature - The curvature of the bezier edge
|
|
38
|
+
* @returns A path string you can use in an SVG, the labelX and labelY position (center of path) and offsetX, offsetY between source handle and label
|
|
39
|
+
* @example
|
|
40
|
+
* const source = { x: 0, y: 20 };
|
|
41
|
+
const target = { x: 150, y: 100 };
|
|
42
|
+
|
|
43
|
+
const [path, labelX, labelY, offsetX, offsetY] = getBezierPath({
|
|
44
|
+
sourceX: source.x,
|
|
45
|
+
sourceY: source.y,
|
|
46
|
+
sourcePosition: Position.Right,
|
|
47
|
+
targetX: target.x,
|
|
48
|
+
targetY: target.y,
|
|
49
|
+
targetPosition: Position.Left,
|
|
50
|
+
});
|
|
51
|
+
*/
|
|
29
52
|
export declare function getBezierPath({ sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition, curvature, }: GetBezierPathParams): [path: string, labelX: number, labelY: number, offsetX: number, offsetY: number];
|
|
30
53
|
//# sourceMappingURL=bezier-edge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bezier-edge.d.ts","sourceRoot":"","sources":["../../../src/utils/edges/bezier-edge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IAC1C,GAAG,EAAE,QAAQ,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,EAClC,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,cAAc,EACd,cAAc,EACd,cAAc,EACd,cAAc,GACf,EAAE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CACxB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CASnC;AAuBD,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,OAAO,EACP,cAAgC,EAChC,OAAO,EACP,OAAO,EACP,cAA6B,EAC7B,SAAgB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M,CAAC,CASnC;AAuBD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,OAAO,EACP,cAAgC,EAChC,OAAO,EACP,OAAO,EACP,cAA6B,EAC7B,SAAgB,GACjB,EAAE,mBAAmB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAmCxG"}
|
|
@@ -6,12 +6,14 @@ export declare function getEdgeCenter({ sourceX, sourceY, targetX, targetY, }: {
|
|
|
6
6
|
targetX: number;
|
|
7
7
|
targetY: number;
|
|
8
8
|
}): [number, number, number, number];
|
|
9
|
-
export type
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
export type GetEdgeZIndexParams = {
|
|
10
|
+
sourceNode: NodeBase;
|
|
11
|
+
targetNode: NodeBase;
|
|
12
|
+
selected?: boolean;
|
|
13
|
+
zIndex?: number;
|
|
14
|
+
elevateOnSelect?: boolean;
|
|
13
15
|
};
|
|
14
|
-
export declare function
|
|
16
|
+
export declare function getElevatedEdgeZIndex({ sourceNode, targetNode, selected, zIndex, elevateOnSelect, }: GetEdgeZIndexParams): number;
|
|
15
17
|
type IsEdgeVisibleParams = {
|
|
16
18
|
sourceNode: NodeBase;
|
|
17
19
|
targetNode: NodeBase;
|
|
@@ -20,10 +22,26 @@ type IsEdgeVisibleParams = {
|
|
|
20
22
|
transform: Transform;
|
|
21
23
|
};
|
|
22
24
|
export declare function isEdgeVisible({ sourceNode, targetNode, width, height, transform }: IsEdgeVisibleParams): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* This util is a convenience function to add a new Edge to an array of edges
|
|
27
|
+
* @remarks It also performs some validation to make sure you don't add an invalid edge or duplicate an existing one.
|
|
28
|
+
* @public
|
|
29
|
+
* @param edgeParams - Either an Edge or a Connection you want to add
|
|
30
|
+
* @param edges - The array of all current edges
|
|
31
|
+
* @returns A new array of edges with the new edge added
|
|
32
|
+
*/
|
|
23
33
|
export declare const addEdgeBase: <EdgeType extends EdgeBase<any>>(edgeParams: Connection | EdgeType, edges: EdgeType[]) => EdgeType[];
|
|
24
34
|
export type UpdateEdgeOptions = {
|
|
25
35
|
shouldReplaceId?: boolean;
|
|
26
36
|
};
|
|
37
|
+
/**
|
|
38
|
+
* A handy utility to update an existing Edge with new properties
|
|
39
|
+
* @param oldEdge - The edge you want to update
|
|
40
|
+
* @param newConnection - The new connection you want to update the edge with
|
|
41
|
+
* @param edges - The array of all current edges
|
|
42
|
+
* @param options.shouldReplaceId - should the id of the old edge be replaced with the new connection id
|
|
43
|
+
* @returns the updated edges array
|
|
44
|
+
*/
|
|
27
45
|
export declare const updateEdgeBase: <EdgeType extends EdgeBase<any>>(oldEdge: EdgeType, newConnection: Connection, edges: EdgeType[], options?: UpdateEdgeOptions) => EdgeType[];
|
|
28
46
|
export {};
|
|
29
47
|
//# sourceMappingURL=general.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../../src/utils/edges/general.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAA8C,MAAM,OAAO,CAAC;AAC1F,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAIjD,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,GACR,EAAE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAQnC;
|
|
1
|
+
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../../src/utils/edges/general.ts"],"names":[],"mappings":"AAAA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,cAAc,qEAEV,UAAU,+BAEhB,iBAAiB,eA6B3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"positions.d.ts","sourceRoot":"","sources":["../../../src/utils/edges/positions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"positions.d.ts","sourceRoot":"","sources":["../../../src/utils/edges/positions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAc,MAAM,mBAAmB,CAAC;AAKzD,MAAM,MAAM,qBAAqB,GAAG;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,QAAQ,CAAC;IACrB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,EAAE,QAAQ,CAAC;IACrB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,cAAc,EAAE,cAAc,CAAC;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAMF,wBAAgB,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,YAAY,GAAG,IAAI,CA6ClF"}
|
|
@@ -11,5 +11,27 @@ export interface GetSmoothStepPathParams {
|
|
|
11
11
|
centerY?: number;
|
|
12
12
|
offset?: number;
|
|
13
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Get a smooth step path from source to target handle
|
|
16
|
+
* @param params.sourceX - The x position of the source handle
|
|
17
|
+
* @param params.sourceY - The y position of the source handle
|
|
18
|
+
* @param params.sourcePosition - The position of the source handle (default: Position.Bottom)
|
|
19
|
+
* @param params.targetX - The x position of the target handle
|
|
20
|
+
* @param params.targetY - The y position of the target handle
|
|
21
|
+
* @param params.targetPosition - The position of the target handle (default: Position.Top)
|
|
22
|
+
* @returns A path string you can use in an SVG, the labelX and labelY position (center of path) and offsetX, offsetY between source handle and label
|
|
23
|
+
* @example
|
|
24
|
+
* const source = { x: 0, y: 20 };
|
|
25
|
+
const target = { x: 150, y: 100 };
|
|
26
|
+
|
|
27
|
+
const [path, labelX, labelY, offsetX, offsetY] = getSmoothStepPath({
|
|
28
|
+
sourceX: source.x,
|
|
29
|
+
sourceY: source.y,
|
|
30
|
+
sourcePosition: Position.Right,
|
|
31
|
+
targetX: target.x,
|
|
32
|
+
targetY: target.y,
|
|
33
|
+
targetPosition: Position.Left,
|
|
34
|
+
});
|
|
35
|
+
*/
|
|
14
36
|
export declare function getSmoothStepPath({ sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition, borderRadius, centerX, centerY, offset, }: GetSmoothStepPathParams): [path: string, labelX: number, labelY: number, offsetX: number, offsetY: number];
|
|
15
37
|
//# sourceMappingURL=smoothstep-edge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smoothstep-edge.d.ts","sourceRoot":"","sources":["../../../src/utils/edges/smoothstep-edge.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAmB,MAAM,aAAa,CAAC;AAExD,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAkLD,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,OAAO,EACP,cAAgC,EAChC,OAAO,EACP,OAAO,EACP,cAA6B,EAC7B,YAAgB,EAChB,OAAO,EACP,OAAO,EACP,MAAW,GACZ,EAAE,uBAAuB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAyB5G"}
|
|
1
|
+
{"version":3,"file":"smoothstep-edge.d.ts","sourceRoot":"","sources":["../../../src/utils/edges/smoothstep-edge.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAmB,MAAM,aAAa,CAAC;AAExD,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAkLD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,OAAO,EACP,cAAgC,EAChC,OAAO,EACP,OAAO,EACP,cAA6B,EAC7B,YAAgB,EAChB,OAAO,EACP,OAAO,EACP,MAAW,GACZ,EAAE,uBAAuB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAyB5G"}
|
|
@@ -4,5 +4,25 @@ export type GetStraightPathParams = {
|
|
|
4
4
|
targetX: number;
|
|
5
5
|
targetY: number;
|
|
6
6
|
};
|
|
7
|
+
/**
|
|
8
|
+
* Get a straight path from source to target handle
|
|
9
|
+
* @param params.sourceX - The x position of the source handle
|
|
10
|
+
* @param params.sourceY - The y position of the source handle
|
|
11
|
+
* @param params.targetX - The x position of the target handle
|
|
12
|
+
* @param params.targetY - The y position of the target handle
|
|
13
|
+
* @returns A path string you can use in an SVG, the labelX and labelY position (center of path) and offsetX, offsetY between source handle and label
|
|
14
|
+
* @example
|
|
15
|
+
* const source = { x: 0, y: 20 };
|
|
16
|
+
const target = { x: 150, y: 100 };
|
|
17
|
+
|
|
18
|
+
const [path, labelX, labelY, offsetX, offsetY] = getStraightPath({
|
|
19
|
+
sourceX: source.x,
|
|
20
|
+
sourceY: source.y,
|
|
21
|
+
sourcePosition: Position.Right,
|
|
22
|
+
targetX: target.x,
|
|
23
|
+
targetY: target.y,
|
|
24
|
+
targetPosition: Position.Left,
|
|
25
|
+
});
|
|
26
|
+
*/
|
|
7
27
|
export declare function getStraightPath({ sourceX, sourceY, targetX, targetY, }: GetStraightPathParams): [path: string, labelX: number, labelY: number, offsetX: number, offsetY: number];
|
|
8
28
|
//# sourceMappingURL=straight-edge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"straight-edge.d.ts","sourceRoot":"","sources":["../../../src/utils/edges/straight-edge.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,wBAAgB,eAAe,CAAC,EAC9B,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,GACR,EAAE,qBAAqB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAS1G"}
|
|
1
|
+
{"version":3,"file":"straight-edge.d.ts","sourceRoot":"","sources":["../../../src/utils/edges/straight-edge.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,eAAe,CAAC,EAC9B,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,GACR,EAAE,qBAAqB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAS1G"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { Dimensions, XYPosition, CoordinateExtent, Box, Rect, NodeBase, NodeOrigin, SnapGrid, Transform
|
|
1
|
+
import type { Dimensions, XYPosition, CoordinateExtent, Box, Rect, NodeBase, NodeOrigin, SnapGrid, Transform } from '../types';
|
|
2
|
+
import { type Viewport } from '../types';
|
|
2
3
|
export declare const clamp: (val: number, min?: number, max?: number) => number;
|
|
3
4
|
export declare const clampPosition: (position: XYPosition | undefined, extent: CoordinateExtent) => {
|
|
4
5
|
x: number;
|
|
@@ -22,9 +23,25 @@ export declare const getPositionWithOrigin: ({ x, y, width, height, origin, }: {
|
|
|
22
23
|
height: number;
|
|
23
24
|
origin?: NodeOrigin | undefined;
|
|
24
25
|
}) => XYPosition;
|
|
25
|
-
export declare
|
|
26
|
+
export declare const snapPosition: (position: XYPosition, snapGrid?: SnapGrid) => XYPosition;
|
|
26
27
|
export declare const pointToRendererPoint: ({ x, y }: XYPosition, [tx, ty, tScale]: Transform, snapToGrid?: boolean, snapGrid?: SnapGrid) => XYPosition;
|
|
27
28
|
export declare const rendererPointToPoint: ({ x, y }: XYPosition, [tx, ty, tScale]: Transform) => XYPosition;
|
|
29
|
+
/**
|
|
30
|
+
* Returns a viewport that encloses the given bounds with optional padding.
|
|
31
|
+
* @public
|
|
32
|
+
* @remarks You can determine bounds of nodes with {@link getNodesBounds} and {@link getBoundsOfRects}
|
|
33
|
+
* @param bounds - Bounds to fit inside viewport
|
|
34
|
+
* @param width - Width of the viewport
|
|
35
|
+
* @param height - Height of the viewport
|
|
36
|
+
* @param minZoom - Minimum zoom level of the resulting viewport
|
|
37
|
+
* @param maxZoom - Maximum zoom level of the resulting viewport
|
|
38
|
+
* @param padding - Optional padding around the bounds
|
|
39
|
+
* @returns A transforned {@link Viewport} that encloses the given bounds which you can pass to e.g. {@link setViewport}
|
|
40
|
+
* @example
|
|
41
|
+
* const { x, y, zoom } = getViewportForBounds(
|
|
42
|
+
{ x: 0, y: 0, width: 100, height: 100},
|
|
43
|
+
1200, 800, 0.5, 2);
|
|
44
|
+
*/
|
|
28
45
|
export declare const getViewportForBounds: (bounds: Rect, width: number, height: number, minZoom: number, maxZoom: number, padding: number) => Viewport;
|
|
29
46
|
export declare const isMacOs: () => boolean;
|
|
30
47
|
//# sourceMappingURL=general.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../src/utils/general.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,GAAG,EACH,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,SAAS,
|
|
1
|
+
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../src/utils/general.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,GAAG,EACH,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,SAAS,EACV,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,KAAK,QAAQ,EAAE,MAA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CAAC"}
|
|
@@ -1,30 +1,85 @@
|
|
|
1
|
-
import { type Transform, type XYPosition, type Rect, type NodeOrigin, type NodeBase, type EdgeBase, type FitViewParamsBase, type FitViewOptionsBase, NodeDragItem, CoordinateExtent, OnError } from '../types';
|
|
1
|
+
import { type Transform, type XYPosition, type Rect, type NodeOrigin, type NodeBase, type EdgeBase, type FitViewParamsBase, type FitViewOptionsBase, NodeDragItem, CoordinateExtent, OnError, OnBeforeDelete } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Test whether an object is useable as an Edge
|
|
4
|
+
* @public
|
|
5
|
+
* @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Edge if it returns true
|
|
6
|
+
* @param element - The element to test
|
|
7
|
+
* @returns A boolean indicating whether the element is an Edge
|
|
8
|
+
*/
|
|
2
9
|
export declare const isEdgeBase: <EdgeType extends EdgeBase<any> = EdgeBase<any>>(element: any) => element is EdgeType;
|
|
10
|
+
/**
|
|
11
|
+
* Test whether an object is useable as a Node
|
|
12
|
+
* @public
|
|
13
|
+
* @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Node if it returns true
|
|
14
|
+
* @param element - The element to test
|
|
15
|
+
* @returns A boolean indicating whether the element is an Node
|
|
16
|
+
*/
|
|
3
17
|
export declare const isNodeBase: <NodeType extends NodeBase<any, string | undefined> = NodeBase<any, string | undefined>>(element: any) => element is NodeType;
|
|
18
|
+
/**
|
|
19
|
+
* Pass in a node, and get connected nodes where edge.source === node.id
|
|
20
|
+
* @public
|
|
21
|
+
* @param node - The node to get the connected nodes from
|
|
22
|
+
* @param nodes - The array of all nodes
|
|
23
|
+
* @param edges - The array of all edges
|
|
24
|
+
* @returns An array of nodes that are connected over eges where the source is the given node
|
|
25
|
+
*/
|
|
4
26
|
export declare const getOutgoersBase: <NodeType extends NodeBase<any, string | undefined> = NodeBase<any, string | undefined>, EdgeType extends EdgeBase<any> = EdgeBase<any>>(node: NodeType | {
|
|
5
27
|
id: string;
|
|
6
28
|
}, nodes: NodeType[], edges: EdgeType[]) => NodeType[];
|
|
29
|
+
/**
|
|
30
|
+
* Pass in a node, and get connected nodes where edge.target === node.id
|
|
31
|
+
* @public
|
|
32
|
+
* @param node - The node to get the connected nodes from
|
|
33
|
+
* @param nodes - The array of all nodes
|
|
34
|
+
* @param edges - The array of all edges
|
|
35
|
+
* @returns An array of nodes that are connected over eges where the target is the given node
|
|
36
|
+
*/
|
|
7
37
|
export declare const getIncomersBase: <NodeType extends NodeBase<any, string | undefined> = NodeBase<any, string | undefined>, EdgeType extends EdgeBase<any> = EdgeBase<any>>(node: NodeType | {
|
|
8
38
|
id: string;
|
|
9
39
|
}, nodes: NodeType[], edges: EdgeType[]) => NodeType[];
|
|
10
40
|
export declare const getNodePositionWithOrigin: (node: NodeBase | undefined, nodeOrigin?: NodeOrigin) => XYPosition & {
|
|
11
41
|
positionAbsolute: XYPosition;
|
|
12
42
|
};
|
|
43
|
+
/**
|
|
44
|
+
* Determines a bounding box that contains all given nodes in an array
|
|
45
|
+
* @public
|
|
46
|
+
* @remarks Useful when combined with {@link getViewportForBounds} to calculate the correct transform to fit the given nodes in a viewport.
|
|
47
|
+
* @param nodes - Nodes to calculate the bounds for
|
|
48
|
+
* @param nodeOrigin - Origin of the nodes: [0, 0] - top left, [0.5, 0.5] - center
|
|
49
|
+
* @returns Bounding box enclosing all nodes
|
|
50
|
+
*/
|
|
13
51
|
export declare const getNodesBounds: (nodes: NodeBase[], nodeOrigin?: NodeOrigin) => Rect;
|
|
14
52
|
export declare const getNodesInside: <NodeType extends NodeBase<any, string | undefined>>(nodes: NodeType[], rect: Rect, [tx, ty, tScale]?: Transform, partially?: boolean, excludeNonSelectableNodes?: boolean, nodeOrigin?: NodeOrigin) => NodeType[];
|
|
53
|
+
/**
|
|
54
|
+
* Get all connecting edges for a given set of nodes
|
|
55
|
+
* @param nodes - Nodes you want to get the connected edges for
|
|
56
|
+
* @param edges - All edges
|
|
57
|
+
* @returns Array of edges that connect any of the given nodes with each other
|
|
58
|
+
*/
|
|
15
59
|
export declare const getConnectedEdgesBase: <NodeType extends NodeBase<any, string | undefined> = NodeBase<any, string | undefined>, EdgeType extends EdgeBase<any> = EdgeBase<any>>(nodes: NodeType[], edges: EdgeType[]) => EdgeType[];
|
|
16
60
|
export declare function fitView<Params extends FitViewParamsBase<NodeBase>, Options extends FitViewOptionsBase<NodeBase>>({ nodes, width, height, panZoom, minZoom, maxZoom, nodeOrigin }: Params, options?: Options): boolean;
|
|
17
61
|
export declare function calcNextPosition<NodeType extends NodeBase>(node: NodeDragItem | NodeType, nextPosition: XYPosition, nodes: NodeType[], nodeExtent?: CoordinateExtent, nodeOrigin?: NodeOrigin, onError?: OnError): {
|
|
18
62
|
position: XYPosition;
|
|
19
63
|
positionAbsolute: XYPosition;
|
|
20
64
|
};
|
|
21
|
-
|
|
65
|
+
/**
|
|
66
|
+
* Pass in nodes & edges to delete, get arrays of nodes and edges that actually can be deleted
|
|
67
|
+
* @internal
|
|
68
|
+
* @param param.nodesToRemove - The nodes to remove
|
|
69
|
+
* @param param.edgesToRemove - The edges to remove
|
|
70
|
+
* @param param.nodes - All nodes
|
|
71
|
+
* @param param.edges - All edges
|
|
72
|
+
* @param param.onBeforeDelete - Callback to check which nodes and edges can be deleted
|
|
73
|
+
* @returns nodes: nodes that can be deleted, edges: edges that can be deleted
|
|
74
|
+
*/
|
|
75
|
+
export declare function getElementsToRemove<NodeType extends NodeBase = NodeBase, EdgeType extends EdgeBase = EdgeBase>({ nodesToRemove, edgesToRemove, nodes, edges, onBeforeDelete, }: {
|
|
22
76
|
nodesToRemove: Partial<NodeType>[];
|
|
23
77
|
edgesToRemove: Partial<EdgeType>[];
|
|
24
78
|
nodes: NodeType[];
|
|
25
79
|
edges: EdgeType[];
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
80
|
+
onBeforeDelete?: OnBeforeDelete;
|
|
81
|
+
}): Promise<{
|
|
82
|
+
nodes: NodeType[];
|
|
83
|
+
edges: EdgeType[];
|
|
84
|
+
}>;
|
|
30
85
|
//# sourceMappingURL=graph.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../src/utils/graph.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,IAAI,EACT,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,YAAY,EACZ,gBAAgB,EAChB,OAAO,
|
|
1
|
+
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../src/utils/graph.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,IAAI,EACT,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,YAAY,EACZ,gBAAgB,EAChB,OAAO,EACP,cAAc,EACf,MAAM,UAAU,CAAC;AAGlB;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,4DAAmD,GAAG,wBACd,CAAC;AAEhE;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,oGAAmD,GAAG,wBACR,CAAC;AAEtE;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe;QACH,MAAM;sDAgB9B,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe;QACH,MAAM;sDAe9B,CAAC;AAEF,eAAO,MAAM,yBAAyB,SAC9B,QAAQ,GAAG,SAAS,8BAEzB,UAAU,GAAG;IAAE,gBAAgB,EAAE,UAAU,CAAA;CA6B7C,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,UAAW,QAAQ,EAAE,8BAAoC,IAsBnF,CAAC;AAEF,eAAO,MAAM,cAAc,gFAEnB,IAAI,gIAqCX,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MA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anZoomInstance, Transform, XYPosition, ConnectionLookup, EdgeBase } from '../types';
|
|
1
|
+
import { NodeBase, CoordinateExtent, Dimensions, NodeDimensionUpdate, NodeOrigin, PanZoomInstance, Transform, XYPosition, ConnectionLookup, EdgeBase, EdgeLookup } from '../types';
|
|
2
2
|
type ParentNodes = Record<string, boolean>;
|
|
3
3
|
export declare function updateAbsolutePositions<NodeType extends NodeBase>(nodes: NodeType[], nodeLookup: Map<string, NodeType>, nodeOrigin?: NodeOrigin, parentNodes?: ParentNodes): NodeType[];
|
|
4
4
|
type UpdateNodesOptions<NodeType extends NodeBase> = {
|
|
@@ -6,8 +6,8 @@ type UpdateNodesOptions<NodeType extends NodeBase> = {
|
|
|
6
6
|
elevateNodesOnSelect?: boolean;
|
|
7
7
|
defaults?: Partial<NodeType>;
|
|
8
8
|
};
|
|
9
|
-
export declare function
|
|
10
|
-
export declare function updateNodeDimensions(updates: Map<string, NodeDimensionUpdate>, nodes:
|
|
9
|
+
export declare function adoptUserProvidedNodes<NodeType extends NodeBase>(nodes: NodeType[], nodeLookup: Map<string, NodeType>, options?: UpdateNodesOptions<NodeType>): NodeType[];
|
|
10
|
+
export declare function updateNodeDimensions<NodeType extends NodeBase>(updates: Map<string, NodeDimensionUpdate>, nodes: NodeType[], nodeLookup: Map<string, NodeType>, domNode: HTMLElement | null, nodeOrigin?: NodeOrigin, onUpdate?: (id: string, dimensions: Dimensions) => void): NodeType[] | null;
|
|
11
11
|
export declare function panBy({ delta, panZoom, transform, translateExtent, width, height, }: {
|
|
12
12
|
delta: XYPosition;
|
|
13
13
|
panZoom: PanZoomInstance | null;
|
|
@@ -16,6 +16,6 @@ export declare function panBy({ delta, panZoom, transform, translateExtent, widt
|
|
|
16
16
|
width: number;
|
|
17
17
|
height: number;
|
|
18
18
|
}): boolean;
|
|
19
|
-
export declare function updateConnectionLookup(
|
|
19
|
+
export declare function updateConnectionLookup(connectionLookup: ConnectionLookup, edgeLookup: EdgeLookup, edges: EdgeBase[]): void;
|
|
20
20
|
export {};
|
|
21
21
|
//# sourceMappingURL=store.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/utils/store.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,mBAAmB,EACnB,UAAU,EACV,eAAe,EACf,SAAS,EACT,UAAU,EAEV,gBAAgB,EAChB,QAAQ,
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/utils/store.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,mBAAmB,EACnB,UAAU,EACV,eAAe,EACf,SAAS,EACT,UAAU,EAEV,gBAAgB,EAChB,QAAQ,EACR,UAAU,EACX,MAAM,UAAU,CAAC;AAKlB,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE3C,wBAAgB,uBAAuB,CAAC,QAAQ,SAAS,QAAQ,EAC/D,KAAK,EAAE,QAAQ,EAAE,EACjB,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,EACjC,UAAU,GAAE,UAAmB,EAC/B,WAAW,CAAC,EAAE,WAAW,cAqC1B;AAED,KAAK,kBAAkB,CAAC,QAAQ,SAAS,QAAQ,IAAI;IACnD,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC9B,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,QAAQ,SAAS,QAAQ,EAC9D,KAAK,EAAE,QAAQ,EAAE,EACjB,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,EACjC,OAAO,GAAE,kBAAkB,CAAC,QAAQ,CAInC,GACA,QAAQ,EAAE,CA8CZ;AA6BD,wBAAgB,oBAAoB,C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