@xyflow/system 0.0.1 → 0.0.3
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/README.md +37 -0
- package/dist/esm/constants.d.ts +1 -0
- package/dist/esm/constants.d.ts.map +1 -1
- package/dist/esm/{index.js → index.mjs} +126 -23
- package/dist/esm/types/general.d.ts +2 -2
- package/dist/esm/types/general.d.ts.map +1 -1
- package/dist/esm/utils/edges/general.d.ts.map +1 -1
- package/dist/esm/utils/edges/smoothstep-edge.d.ts.map +1 -1
- package/dist/esm/utils/general.d.ts +1 -0
- package/dist/esm/utils/general.d.ts.map +1 -1
- package/dist/esm/utils/graph.d.ts.map +1 -1
- package/dist/esm/xydrag/XYDrag.d.ts.map +1 -1
- package/dist/esm/xypanzoom/XYPanZoom.d.ts +2 -0
- package/dist/esm/xypanzoom/XYPanZoom.d.ts.map +1 -1
- package/dist/esm/xypanzoom/eventhandler.d.ts +7 -9
- package/dist/esm/xypanzoom/eventhandler.d.ts.map +1 -1
- package/dist/esm/xypanzoom/filter.d.ts.map +1 -1
- package/dist/esm/xypanzoom/utils.d.ts +1 -0
- package/dist/esm/xypanzoom/utils.d.ts.map +1 -1
- package/dist/umd/constants.d.ts +1 -0
- package/dist/umd/constants.d.ts.map +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/types/general.d.ts +2 -2
- package/dist/umd/types/general.d.ts.map +1 -1
- package/dist/umd/utils/edges/general.d.ts.map +1 -1
- package/dist/umd/utils/edges/smoothstep-edge.d.ts.map +1 -1
- package/dist/umd/utils/general.d.ts +1 -0
- package/dist/umd/utils/general.d.ts.map +1 -1
- package/dist/umd/utils/graph.d.ts.map +1 -1
- package/dist/umd/xydrag/XYDrag.d.ts.map +1 -1
- package/dist/umd/xypanzoom/XYPanZoom.d.ts +2 -0
- package/dist/umd/xypanzoom/XYPanZoom.d.ts.map +1 -1
- package/dist/umd/xypanzoom/eventhandler.d.ts +7 -9
- package/dist/umd/xypanzoom/eventhandler.d.ts.map +1 -1
- package/dist/umd/xypanzoom/filter.d.ts.map +1 -1
- package/dist/umd/xypanzoom/utils.d.ts +1 -0
- package/dist/umd/xypanzoom/utils.d.ts.map +1 -1
- package/package.json +11 -4
- package/dist/esm/utils/utils.d.ts +0 -29
- package/dist/esm/utils/utils.d.ts.map +0 -1
- package/dist/umd/utils/utils.d.ts +0 -45
- package/dist/umd/utils/utils.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyflow/system",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "xyflow core system that powers React Flow and Svelte Flow.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"node-based UI",
|
|
@@ -16,8 +16,15 @@
|
|
|
16
16
|
],
|
|
17
17
|
"source": "src/index.ts",
|
|
18
18
|
"main": "dist/umd/index.js",
|
|
19
|
-
"module": "dist/esm/index.
|
|
19
|
+
"module": "dist/esm/index.mjs",
|
|
20
20
|
"types": "dist/esm/index.d.ts",
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./dist/esm/index.d.ts",
|
|
24
|
+
"import": "./dist/esm/index.mjs",
|
|
25
|
+
"require": "./dist/umd/index.js"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
21
28
|
"sideEffects": false,
|
|
22
29
|
"license": "MIT",
|
|
23
30
|
"publishConfig": {
|
|
@@ -39,10 +46,10 @@
|
|
|
39
46
|
},
|
|
40
47
|
"devDependencies": {
|
|
41
48
|
"@types/node": "^18.7.16",
|
|
49
|
+
"typescript": "5.1.3",
|
|
42
50
|
"@xyflow/eslint-config": "0.0.0",
|
|
43
51
|
"@xyflow/rollup-config": "0.0.0",
|
|
44
|
-
"@xyflow/tsconfig": "0.0.0"
|
|
45
|
-
"typescript": "5.1.3"
|
|
52
|
+
"@xyflow/tsconfig": "0.0.0"
|
|
46
53
|
},
|
|
47
54
|
"rollup": {
|
|
48
55
|
"globals": {
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { Dimensions, XYPosition, CoordinateExtent, Box, Rect, BaseNode, NodeOrigin, SnapGrid, Transform } from '../types';
|
|
2
|
-
export declare const clamp: (val: number, min?: number, max?: number) => number;
|
|
3
|
-
export declare const clampPosition: (position: XYPosition | undefined, extent: CoordinateExtent) => {
|
|
4
|
-
x: number;
|
|
5
|
-
y: number;
|
|
6
|
-
};
|
|
7
|
-
export declare const calcAutoPan: (pos: XYPosition, bounds: Dimensions) => number[];
|
|
8
|
-
export declare const getBoundsOfBoxes: (box1: Box, box2: Box) => Box;
|
|
9
|
-
export declare const rectToBox: ({ x, y, width, height }: Rect) => Box;
|
|
10
|
-
export declare const boxToRect: ({ x, y, x2, y2 }: Box) => Rect;
|
|
11
|
-
export declare const nodeToRect: (node: BaseNode, nodeOrigin?: NodeOrigin) => Rect;
|
|
12
|
-
export declare const nodeToBox: (node: BaseNode, nodeOrigin?: NodeOrigin) => Box;
|
|
13
|
-
export declare const getBoundsOfRects: (rect1: Rect, rect2: Rect) => Rect;
|
|
14
|
-
export declare const getOverlappingArea: (rectA: Rect, rectB: Rect) => number;
|
|
15
|
-
export declare const isRectObject: (obj: any) => obj is Rect;
|
|
16
|
-
export declare const isNumeric: (n: any) => n is number;
|
|
17
|
-
export declare const devWarn: (id: string, message: string) => void;
|
|
18
|
-
export declare const getPositionWithOrigin: ({ x, y, width, height, origin, }: {
|
|
19
|
-
x: number;
|
|
20
|
-
y: number;
|
|
21
|
-
width: number;
|
|
22
|
-
height: number;
|
|
23
|
-
origin?: NodeOrigin | undefined;
|
|
24
|
-
}) => XYPosition;
|
|
25
|
-
export declare function snapPosition(position: XYPosition, snapGrid?: SnapGrid): XYPosition;
|
|
26
|
-
export declare const pointToRendererPoint: ({ x, y }: XYPosition, [tx, ty, tScale]: Transform, snapToGrid?: boolean, snapGrid?: SnapGrid) => XYPosition;
|
|
27
|
-
export declare const rendererPointToPoint: ({ x, y }: XYPosition, [tx, ty, tScale]: Transform) => XYPosition;
|
|
28
|
-
export declare const getTransformForBounds: (bounds: Rect, width: number, height: number, minZoom: number, maxZoom: number, padding?: number) => Transform;
|
|
29
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../packages/system/src/utils/utils.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;AAGlB,eAAO,MAAM,KAAK,QAAS,MAAM,iCAAqB,MAA2C,CAAC;AAElG,eAAO,MAAM,aAAa;;;CAGxB,CAAC;AAcH,eAAO,MAAM,WAAW,QAAS,UAAU,UAAU,UAAU,KAAG,MAAM,EAKvE,CAAC;AAEF,eAAO,MAAM,gBAAgB,SAAU,GAAG,QAAQ,GAAG,KAAG,GAKtD,CAAC;AAEH,eAAO,MAAM,SAAS,4BAA6B,IAAI,KAAG,GAKxD,CAAC;AAEH,eAAO,MAAM,SAAS,qBAAsB,GAAG,KAAG,IAKhD,CAAC;AAEH,eAAO,MAAM,UAAU,SAAU,QAAQ,8BAAoC,IAQ5E,CAAC;AAEF,eAAO,MAAM,SAAS,SAAU,QAAQ,8BAAoC,GAQ3E,CAAC;AAEF,eAAO,MAAM,gBAAgB,UAAW,IAAI,SAAS,IAAI,KAAG,IACK,CAAC;AAElE,eAAO,MAAM,kBAAkB,UAAW,IAAI,SAAS,IAAI,KAAG,MAK7D,CAAC;AAGF,eAAO,MAAM,YAAY,QAAS,GAAG,gBACkD,CAAC;AAGxF,eAAO,MAAM,SAAS,MAAO,GAAG,gBAA0C,CAAC;AAI3E,eAAO,MAAM,OAAO,OAAQ,MAAM,WAAW,MAAM,SAIlD,CAAC;AAEF,eAAO,MAAM,qBAAqB;OAO7B,MAAM;OACN,MAAM;WACF,MAAM;YACL,MAAM;;MAEZ,UASH,CAAC;AAEF,wBAAgB,YAAY,CAAC,QAAQ,EAAE,UAAU,EAAE,QAAQ,GAAE,QAAiB,GAAG,UAAU,CAK1F;AAED,eAAO,MAAM,oBAAoB,aACrB,UAAU,6EAInB,UAOF,CAAC;AAEF,eAAO,MAAM,oBAAoB,aAAc,UAAU,kCAAgC,UAKxF,CAAC;AAEF,eAAO,MAAM,qBAAqB,WACxB,IAAI,SACL,MAAM,UACL,MAAM,WACL,MAAM,WACN,MAAM,gCAahB,CAAC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { Dimensions, XYPosition, CoordinateExtent, Box, Rect, BaseNode, BaseEdge, NodeOrigin, HandleElement } from '../types';
|
|
2
|
-
export declare const getDimensions: (node: HTMLDivElement) => Dimensions;
|
|
3
|
-
export declare const clamp: (val: number, min?: number, max?: number) => number;
|
|
4
|
-
export declare const clampPosition: (position: XYPosition | undefined, extent: CoordinateExtent) => {
|
|
5
|
-
x: number;
|
|
6
|
-
y: number;
|
|
7
|
-
};
|
|
8
|
-
export declare const calcAutoPan: (pos: XYPosition, bounds: Dimensions) => number[];
|
|
9
|
-
export declare const getHostForElement: (element: HTMLElement) => Document | ShadowRoot;
|
|
10
|
-
export declare const getBoundsOfBoxes: (box1: Box, box2: Box) => Box;
|
|
11
|
-
export declare const rectToBox: ({ x, y, width, height }: Rect) => Box;
|
|
12
|
-
export declare const boxToRect: ({ x, y, x2, y2 }: Box) => Rect;
|
|
13
|
-
export declare const nodeToRect: (node: BaseNode, nodeOrigin?: NodeOrigin) => Rect;
|
|
14
|
-
export declare const nodeToBox: (node: BaseNode, nodeOrigin?: NodeOrigin) => Box;
|
|
15
|
-
export declare const getBoundsOfRects: (rect1: Rect, rect2: Rect) => Rect;
|
|
16
|
-
export declare const getOverlappingArea: (rectA: Rect, rectB: Rect) => number;
|
|
17
|
-
export declare const isRectObject: (obj: any) => obj is Rect;
|
|
18
|
-
export declare const isNumeric: (n: any) => n is number;
|
|
19
|
-
export declare const elementSelectionKeys: string[];
|
|
20
|
-
export declare const devWarn: (id: string, message: string) => void;
|
|
21
|
-
export declare function isInputDOMNode(event: KeyboardEvent): boolean;
|
|
22
|
-
export declare const isMouseEvent: (event: MouseEvent | TouchEvent) => event is MouseEvent;
|
|
23
|
-
export declare const getEventPosition: (event: MouseEvent | TouchEvent, bounds?: DOMRect) => {
|
|
24
|
-
x: number;
|
|
25
|
-
y: number;
|
|
26
|
-
};
|
|
27
|
-
export declare const infiniteExtent: CoordinateExtent;
|
|
28
|
-
export declare function getElementsToRemove<NodeType extends BaseNode = BaseNode, EdgeType extends BaseEdge = BaseEdge>({ nodesToRemove, edgesToRemove, nodes, edges, }: {
|
|
29
|
-
nodesToRemove: Partial<NodeType>[];
|
|
30
|
-
edgesToRemove: Partial<EdgeType>[];
|
|
31
|
-
nodes: NodeType[];
|
|
32
|
-
edges: EdgeType[];
|
|
33
|
-
}): {
|
|
34
|
-
matchingNodes: NodeType[];
|
|
35
|
-
matchingEdges: EdgeType[];
|
|
36
|
-
};
|
|
37
|
-
export declare const getPositionWithOrigin: ({ x, y, width, height, origin, }: {
|
|
38
|
-
x: number;
|
|
39
|
-
y: number;
|
|
40
|
-
width: number;
|
|
41
|
-
height: number;
|
|
42
|
-
origin?: NodeOrigin | undefined;
|
|
43
|
-
}) => XYPosition;
|
|
44
|
-
export declare const getHandleBounds: (selector: string, nodeElement: HTMLDivElement, zoom: number, nodeOrigin?: NodeOrigin) => HandleElement[] | null;
|
|
45
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../packages/system/src/utils/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,GAAG,EACH,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,UAAU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