@xyflow/system 0.0.1

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.
Files changed (141) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +10 -0
  3. package/dist/esm/constants.d.ts +22 -0
  4. package/dist/esm/constants.d.ts.map +1 -0
  5. package/dist/esm/index.d.ts +8 -0
  6. package/dist/esm/index.d.ts.map +1 -0
  7. package/dist/esm/index.js +1741 -0
  8. package/dist/esm/types/edges.d.ts +62 -0
  9. package/dist/esm/types/edges.d.ts.map +1 -0
  10. package/dist/esm/types/general.d.ts +106 -0
  11. package/dist/esm/types/general.d.ts.map +1 -0
  12. package/dist/esm/types/handles.d.ts +29 -0
  13. package/dist/esm/types/handles.d.ts.map +1 -0
  14. package/dist/esm/types/index.d.ts +7 -0
  15. package/dist/esm/types/index.d.ts.map +1 -0
  16. package/dist/esm/types/nodes.d.ts +76 -0
  17. package/dist/esm/types/nodes.d.ts.map +1 -0
  18. package/dist/esm/types/panzoom.d.ts +48 -0
  19. package/dist/esm/types/panzoom.d.ts.map +1 -0
  20. package/dist/esm/types/utils.d.ts +25 -0
  21. package/dist/esm/types/utils.d.ts.map +1 -0
  22. package/dist/esm/utils/dom.d.ts +20 -0
  23. package/dist/esm/utils/dom.d.ts.map +1 -0
  24. package/dist/esm/utils/edges/bezier-edge.d.ts +30 -0
  25. package/dist/esm/utils/edges/bezier-edge.d.ts.map +1 -0
  26. package/dist/esm/utils/edges/general.d.ts +29 -0
  27. package/dist/esm/utils/edges/general.d.ts.map +1 -0
  28. package/dist/esm/utils/edges/index.d.ts +6 -0
  29. package/dist/esm/utils/edges/index.d.ts.map +1 -0
  30. package/dist/esm/utils/edges/positions.d.ts +14 -0
  31. package/dist/esm/utils/edges/positions.d.ts.map +1 -0
  32. package/dist/esm/utils/edges/smoothstep-edge.d.ts +15 -0
  33. package/dist/esm/utils/edges/smoothstep-edge.d.ts.map +1 -0
  34. package/dist/esm/utils/edges/straight-edge.d.ts +8 -0
  35. package/dist/esm/utils/edges/straight-edge.d.ts.map +1 -0
  36. package/dist/esm/utils/general.d.ts +29 -0
  37. package/dist/esm/utils/general.d.ts.map +1 -0
  38. package/dist/esm/utils/graph.d.ts +26 -0
  39. package/dist/esm/utils/graph.d.ts.map +1 -0
  40. package/dist/esm/utils/index.d.ts +7 -0
  41. package/dist/esm/utils/index.d.ts.map +1 -0
  42. package/dist/esm/utils/marker.d.ts +7 -0
  43. package/dist/esm/utils/marker.d.ts.map +1 -0
  44. package/dist/esm/utils/store.d.ts +20 -0
  45. package/dist/esm/utils/store.d.ts.map +1 -0
  46. package/dist/esm/utils/utils.d.ts +29 -0
  47. package/dist/esm/utils/utils.d.ts.map +1 -0
  48. package/dist/esm/xydrag/XYDrag.d.ts +48 -0
  49. package/dist/esm/xydrag/XYDrag.d.ts.map +1 -0
  50. package/dist/esm/xydrag/index.d.ts +2 -0
  51. package/dist/esm/xydrag/index.d.ts.map +1 -0
  52. package/dist/esm/xydrag/utils.d.ts +11 -0
  53. package/dist/esm/xydrag/utils.d.ts.map +1 -0
  54. package/dist/esm/xyhandle/XYHandle.d.ts +45 -0
  55. package/dist/esm/xyhandle/XYHandle.d.ts.map +1 -0
  56. package/dist/esm/xyhandle/index.d.ts +2 -0
  57. package/dist/esm/xyhandle/index.d.ts.map +1 -0
  58. package/dist/esm/xyhandle/utils.d.ts +15 -0
  59. package/dist/esm/xyhandle/utils.d.ts.map +1 -0
  60. package/dist/esm/xyminimap/index.d.ts +28 -0
  61. package/dist/esm/xyminimap/index.d.ts.map +1 -0
  62. package/dist/esm/xypanzoom/XYPanZoom.d.ts +10 -0
  63. package/dist/esm/xypanzoom/XYPanZoom.d.ts.map +1 -0
  64. package/dist/esm/xypanzoom/eventhandler.d.ts +48 -0
  65. package/dist/esm/xypanzoom/eventhandler.d.ts.map +1 -0
  66. package/dist/esm/xypanzoom/filter.d.ts +14 -0
  67. package/dist/esm/xypanzoom/filter.d.ts.map +1 -0
  68. package/dist/esm/xypanzoom/index.d.ts +2 -0
  69. package/dist/esm/xypanzoom/index.d.ts.map +1 -0
  70. package/dist/esm/xypanzoom/utils.d.ts +9 -0
  71. package/dist/esm/xypanzoom/utils.d.ts.map +1 -0
  72. package/dist/umd/constants.d.ts +22 -0
  73. package/dist/umd/constants.d.ts.map +1 -0
  74. package/dist/umd/index.d.ts +8 -0
  75. package/dist/umd/index.d.ts.map +1 -0
  76. package/dist/umd/index.js +1 -0
  77. package/dist/umd/types/edges.d.ts +62 -0
  78. package/dist/umd/types/edges.d.ts.map +1 -0
  79. package/dist/umd/types/general.d.ts +106 -0
  80. package/dist/umd/types/general.d.ts.map +1 -0
  81. package/dist/umd/types/handles.d.ts +29 -0
  82. package/dist/umd/types/handles.d.ts.map +1 -0
  83. package/dist/umd/types/index.d.ts +7 -0
  84. package/dist/umd/types/index.d.ts.map +1 -0
  85. package/dist/umd/types/nodes.d.ts +76 -0
  86. package/dist/umd/types/nodes.d.ts.map +1 -0
  87. package/dist/umd/types/panzoom.d.ts +48 -0
  88. package/dist/umd/types/panzoom.d.ts.map +1 -0
  89. package/dist/umd/types/utils.d.ts +25 -0
  90. package/dist/umd/types/utils.d.ts.map +1 -0
  91. package/dist/umd/utils/dom.d.ts +20 -0
  92. package/dist/umd/utils/dom.d.ts.map +1 -0
  93. package/dist/umd/utils/edges/bezier-edge.d.ts +30 -0
  94. package/dist/umd/utils/edges/bezier-edge.d.ts.map +1 -0
  95. package/dist/umd/utils/edges/general.d.ts +29 -0
  96. package/dist/umd/utils/edges/general.d.ts.map +1 -0
  97. package/dist/umd/utils/edges/index.d.ts +6 -0
  98. package/dist/umd/utils/edges/index.d.ts.map +1 -0
  99. package/dist/umd/utils/edges/positions.d.ts +14 -0
  100. package/dist/umd/utils/edges/positions.d.ts.map +1 -0
  101. package/dist/umd/utils/edges/smoothstep-edge.d.ts +15 -0
  102. package/dist/umd/utils/edges/smoothstep-edge.d.ts.map +1 -0
  103. package/dist/umd/utils/edges/straight-edge.d.ts +8 -0
  104. package/dist/umd/utils/edges/straight-edge.d.ts.map +1 -0
  105. package/dist/umd/utils/general.d.ts +29 -0
  106. package/dist/umd/utils/general.d.ts.map +1 -0
  107. package/dist/umd/utils/graph.d.ts +26 -0
  108. package/dist/umd/utils/graph.d.ts.map +1 -0
  109. package/dist/umd/utils/index.d.ts +7 -0
  110. package/dist/umd/utils/index.d.ts.map +1 -0
  111. package/dist/umd/utils/marker.d.ts +7 -0
  112. package/dist/umd/utils/marker.d.ts.map +1 -0
  113. package/dist/umd/utils/store.d.ts +20 -0
  114. package/dist/umd/utils/store.d.ts.map +1 -0
  115. package/dist/umd/utils/utils.d.ts +45 -0
  116. package/dist/umd/utils/utils.d.ts.map +1 -0
  117. package/dist/umd/xydrag/XYDrag.d.ts +48 -0
  118. package/dist/umd/xydrag/XYDrag.d.ts.map +1 -0
  119. package/dist/umd/xydrag/index.d.ts +2 -0
  120. package/dist/umd/xydrag/index.d.ts.map +1 -0
  121. package/dist/umd/xydrag/utils.d.ts +11 -0
  122. package/dist/umd/xydrag/utils.d.ts.map +1 -0
  123. package/dist/umd/xyhandle/XYHandle.d.ts +45 -0
  124. package/dist/umd/xyhandle/XYHandle.d.ts.map +1 -0
  125. package/dist/umd/xyhandle/index.d.ts +2 -0
  126. package/dist/umd/xyhandle/index.d.ts.map +1 -0
  127. package/dist/umd/xyhandle/utils.d.ts +15 -0
  128. package/dist/umd/xyhandle/utils.d.ts.map +1 -0
  129. package/dist/umd/xyminimap/index.d.ts +28 -0
  130. package/dist/umd/xyminimap/index.d.ts.map +1 -0
  131. package/dist/umd/xypanzoom/XYPanZoom.d.ts +10 -0
  132. package/dist/umd/xypanzoom/XYPanZoom.d.ts.map +1 -0
  133. package/dist/umd/xypanzoom/eventhandler.d.ts +48 -0
  134. package/dist/umd/xypanzoom/eventhandler.d.ts.map +1 -0
  135. package/dist/umd/xypanzoom/filter.d.ts +14 -0
  136. package/dist/umd/xypanzoom/filter.d.ts.map +1 -0
  137. package/dist/umd/xypanzoom/index.d.ts +2 -0
  138. package/dist/umd/xypanzoom/index.d.ts.map +1 -0
  139. package/dist/umd/xypanzoom/utils.d.ts +9 -0
  140. package/dist/umd/xypanzoom/utils.d.ts.map +1 -0
  141. package/package.json +62 -0
@@ -0,0 +1,30 @@
1
+ import { Position } from '../../types';
2
+ export type GetBezierPathParams = {
3
+ sourceX: number;
4
+ sourceY: number;
5
+ sourcePosition?: Position;
6
+ targetX: number;
7
+ targetY: number;
8
+ targetPosition?: Position;
9
+ curvature?: number;
10
+ };
11
+ export type GetControlWithCurvatureParams = {
12
+ pos: Position;
13
+ x1: number;
14
+ y1: number;
15
+ x2: number;
16
+ y2: number;
17
+ c: number;
18
+ };
19
+ export declare function getBezierEdgeCenter({ sourceX, sourceY, targetX, targetY, sourceControlX, sourceControlY, targetControlX, targetControlY, }: {
20
+ sourceX: number;
21
+ sourceY: number;
22
+ targetX: number;
23
+ targetY: number;
24
+ sourceControlX: number;
25
+ sourceControlY: number;
26
+ targetControlX: number;
27
+ targetControlY: number;
28
+ }): [number, number, number, number];
29
+ export declare function getBezierPath({ sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition, curvature, }: GetBezierPathParams): [path: string, labelX: number, labelY: number, offsetX: number, offsetY: number];
30
+ //# sourceMappingURL=bezier-edge.d.ts.map
@@ -0,0 +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,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"}
@@ -0,0 +1,29 @@
1
+ import { Connection, Transform } from '../..';
2
+ import { EdgeBase, NodeBase } from '../../types';
3
+ export declare function getEdgeCenter({ sourceX, sourceY, targetX, targetY, }: {
4
+ sourceX: number;
5
+ sourceY: number;
6
+ targetX: number;
7
+ targetY: number;
8
+ }): [number, number, number, number];
9
+ export type GroupedEdges<EdgeType extends EdgeBase> = {
10
+ edges: EdgeType[];
11
+ level: number;
12
+ isMaxLevel: boolean;
13
+ };
14
+ export declare function groupEdgesByZLevel<EdgeType extends EdgeBase>(edges: EdgeType[], nodes: NodeBase[], elevateEdgesOnSelect?: boolean): GroupedEdges<EdgeType>[];
15
+ type IsEdgeVisibleParams = {
16
+ sourceNode: NodeBase;
17
+ targetNode: NodeBase;
18
+ width: number;
19
+ height: number;
20
+ transform: Transform;
21
+ };
22
+ export declare function isEdgeVisible({ sourceNode, targetNode, width, height, transform }: IsEdgeVisibleParams): boolean;
23
+ export declare const addEdgeBase: <EdgeType extends EdgeBase<any>>(edgeParams: Connection | EdgeType, edges: EdgeType[]) => EdgeType[];
24
+ export type UpdateEdgeOptions = {
25
+ shouldReplaceId?: boolean;
26
+ };
27
+ export declare const updateEdgeBase: <EdgeType extends EdgeBase<any>>(oldEdge: EdgeType, newConnection: Connection, edges: EdgeType[], options?: UpdateEdgeOptions) => EdgeType[];
28
+ export {};
29
+ //# sourceMappingURL=general.d.ts.map
@@ -0,0 +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;AAID,MAAM,MAAM,YAAY,CAAC,QAAQ,SAAS,QAAQ,IAAI;IACpD,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,QAAQ,SAAS,QAAQ,EAC1D,KAAK,EAAE,QAAQ,EAAE,EACjB,KAAK,EAAE,QAAQ,EAAE,EACjB,oBAAoB,UAAQ,GAC3B,YAAY,CAAC,QAAQ,CAAC,EAAE,CA0C1B;AAED,KAAK,mBAAmB,GAAG;IACzB,UAAU,EAAE,QAAQ,CAAC;IACrB,UAAU,EAAE,QAAQ,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,mBAAmB,GAAG,OAAO,CAmBhH;AAeD,eAAO,MAAM,WAAW,sGAyBvB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,cAAc,qEAEV,UAAU,+BAEhB,iBAAiB,eA6B3B,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * from './bezier-edge';
2
+ export * from './straight-edge';
3
+ export * from './smoothstep-edge';
4
+ export * from './general';
5
+ export * from './positions';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/edges/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { EdgePosition } from '../../types/edges';
2
+ import { ConnectionMode, OnError } from '../../types/general';
3
+ import { NodeBase } from '../../types/nodes';
4
+ export type GetEdgePositionParams = {
5
+ id: string;
6
+ sourceNode: NodeBase;
7
+ sourceHandle: string | null;
8
+ targetNode: NodeBase;
9
+ targetHandle: string | null;
10
+ connectionMode: ConnectionMode;
11
+ onError?: OnError;
12
+ };
13
+ export declare function getEdgePosition(params: GetEdgePositionParams): EdgePosition | null;
14
+ //# sourceMappingURL=positions.d.ts.map
@@ -0,0 +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,EAAoB,MAAM,mBAAmB,CAAC;AAK/D,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;AAEF,wBAAgB,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,YAAY,GAAG,IAAI,CA0ClF"}
@@ -0,0 +1,15 @@
1
+ import { Position } from '../../types';
2
+ export interface GetSmoothStepPathParams {
3
+ sourceX: number;
4
+ sourceY: number;
5
+ sourcePosition?: Position;
6
+ targetX: number;
7
+ targetY: number;
8
+ targetPosition?: Position;
9
+ borderRadius?: number;
10
+ centerX?: number;
11
+ centerY?: number;
12
+ offset?: number;
13
+ }
14
+ 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
+ //# sourceMappingURL=smoothstep-edge.d.ts.map
@@ -0,0 +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;AAgJD,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"}
@@ -0,0 +1,8 @@
1
+ export type GetStraightPathParams = {
2
+ sourceX: number;
3
+ sourceY: number;
4
+ targetX: number;
5
+ targetY: number;
6
+ };
7
+ export declare function getStraightPath({ sourceX, sourceY, targetX, targetY, }: GetStraightPathParams): [path: string, labelX: number, labelY: number, offsetX: number, offsetY: number];
8
+ //# sourceMappingURL=straight-edge.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,29 @@
1
+ import type { Dimensions, XYPosition, CoordinateExtent, Box, Rect, NodeBase, 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: NodeBase, nodeOrigin?: NodeOrigin) => Rect;
12
+ export declare const nodeToBox: (node: NodeBase, 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=general.d.ts.map
@@ -0,0 +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,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"}
@@ -0,0 +1,26 @@
1
+ import { type Connection, type Transform, type XYPosition, type Rect, type NodeOrigin, type NodeBase, type EdgeBase, type FitViewParamsBase, type FitViewOptionsBase, NodeDragItem, CoordinateExtent, OnError } from '../types';
2
+ export declare const isEdgeBase: <NodeType extends NodeBase<any, string | undefined> = NodeBase<any, string | undefined>, EdgeType extends EdgeBase<any> = EdgeBase<any>>(element: NodeType | EdgeType | Connection) => element is EdgeType;
3
+ export declare const isNodeBase: <NodeType extends NodeBase<any, string | undefined> = NodeBase<any, string | undefined>, EdgeType extends EdgeBase<any> = EdgeBase<any>>(element: Connection | NodeType | EdgeType) => element is NodeType;
4
+ export declare const getOutgoersBase: <NodeType extends NodeBase<any, string | undefined> = NodeBase<any, string | undefined>, EdgeType extends EdgeBase<any> = EdgeBase<any>>(node: NodeType, nodes: NodeType[], edges: EdgeType[]) => NodeType[];
5
+ export declare const getIncomersBase: <NodeType extends NodeBase<any, string | undefined> = NodeBase<any, string | undefined>, EdgeType extends EdgeBase<any> = EdgeBase<any>>(node: NodeType, nodes: NodeType[], edges: EdgeType[]) => NodeType[];
6
+ export declare const getNodePositionWithOrigin: (node: NodeBase | undefined, nodeOrigin?: NodeOrigin) => XYPosition & {
7
+ positionAbsolute: XYPosition;
8
+ };
9
+ export declare const getRectOfNodes: (nodes: NodeBase[], nodeOrigin?: NodeOrigin) => Rect;
10
+ 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[];
11
+ 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[];
12
+ export declare function fitView<Params extends FitViewParamsBase<NodeBase>, Options extends FitViewOptionsBase<NodeBase>>({ nodes, width, height, panZoom, minZoom, maxZoom, nodeOrigin }: Params, options?: Options): boolean;
13
+ export declare function calcNextPosition<NodeType extends NodeBase>(node: NodeDragItem | NodeType, nextPosition: XYPosition, nodes: NodeType[], nodeExtent?: CoordinateExtent, nodeOrigin?: NodeOrigin, onError?: OnError): {
14
+ position: XYPosition;
15
+ positionAbsolute: XYPosition;
16
+ };
17
+ export declare function getElementsToRemove<NodeType extends NodeBase = NodeBase, EdgeType extends EdgeBase = EdgeBase>({ nodesToRemove, edgesToRemove, nodes, edges, }: {
18
+ nodesToRemove: Partial<NodeType>[];
19
+ edgesToRemove: Partial<EdgeType>[];
20
+ nodes: NodeType[];
21
+ edges: EdgeType[];
22
+ }): {
23
+ matchingNodes: NodeType[];
24
+ matchingEdges: EdgeType[];
25
+ };
26
+ //# sourceMappingURL=graph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../src/utils/graph.ts"],"names":[],"mappings":"AAaA,OAAO,EACL,KAAK,UAAU,EACf,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,EACR,MAAM,UAAU,CAAC;AAGlB,eAAO,MAAM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OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;IACnC,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB,GAAG;IACF,aAAa,EAAE,QAAQ,EAAE,CAAC;IAC1B,aAAa,EAAE,QAAQ,EAAE,CAAC;CAC3B,CAsBA"}
@@ -0,0 +1,7 @@
1
+ export * from './dom';
2
+ export * from './edges';
3
+ export * from './graph';
4
+ export * from './general';
5
+ export * from './marker';
6
+ export * from './store';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { EdgeBase, EdgeMarkerType, MarkerProps } from '../types';
2
+ export declare function getMarkerId(marker: EdgeMarkerType | undefined, id?: string | null): string;
3
+ export declare function createMarkerIds(edges: EdgeBase[], { id, defaultColor }: {
4
+ id?: string | null;
5
+ defaultColor?: string;
6
+ }): MarkerProps[];
7
+ //# sourceMappingURL=marker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"marker.d.ts","sourceRoot":"","sources":["../../src/utils/marker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAc,cAAc,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAElF,wBAAgB,WAAW,CAAC,MAAM,EAAE,cAAc,GAAG,SAAS,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAe1F;AAED,wBAAgB,eAAe,CAC7B,KAAK,EAAE,QAAQ,EAAE,EACjB,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE;IAAE,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,iBAkBpE"}
@@ -0,0 +1,20 @@
1
+ import { NodeBase, CoordinateExtent, Dimensions, NodeDimensionUpdate, NodeOrigin, PanZoomInstance, Transform, XYPosition } from '../types';
2
+ type ParentNodes = Record<string, boolean>;
3
+ export declare function updateAbsolutePositions<NodeType extends NodeBase>(nodes: NodeType[], nodeOrigin?: NodeOrigin, parentNodes?: ParentNodes): NodeType[];
4
+ type UpdateNodesOptions<NodeType extends NodeBase> = {
5
+ nodeOrigin?: NodeOrigin;
6
+ elevateNodesOnSelect?: boolean;
7
+ defaults?: Partial<NodeType>;
8
+ };
9
+ export declare function updateNodes<NodeType extends NodeBase>(nodes: NodeType[], storeNodes: NodeType[], options?: UpdateNodesOptions<NodeType>): NodeType[];
10
+ export declare function updateNodeDimensions(updates: NodeDimensionUpdate[], nodes: NodeBase[], domNode: HTMLElement | null, nodeOrigin?: NodeOrigin, onUpdate?: (id: string, dimensions: Dimensions) => void): NodeBase[] | null;
11
+ export declare function panBy({ delta, panZoom, transform, translateExtent, width, height, }: {
12
+ delta: XYPosition;
13
+ panZoom: PanZoomInstance | null;
14
+ transform: Transform;
15
+ translateExtent: CoordinateExtent;
16
+ width: number;
17
+ height: number;
18
+ }): boolean;
19
+ export {};
20
+ //# sourceMappingURL=store.d.ts.map
@@ -0,0 +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,EAEX,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,GAAE,UAAmB,EAC/B,WAAW,CAAC,EAAE,WAAW,cAiC1B;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,WAAW,CAAC,QAAQ,SAAS,QAAQ,EACnD,KAAK,EAAE,QAAQ,EAAE,EACjB,UAAU,EAAE,QAAQ,EAAE,EACtB,OAAO,GAAE,kBAAkB,CAAC,QAAQ,CAInC,GACA,QAAQ,EAAE,CAkCZ;AA2BD,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,mBAAmB,EAAE,EAC9B,KAAK,EAAE,QAAQ,EAAE,EACjB,OAAO,EAAE,WAAW,GAAG,IAAI,EAC3B,UAAU,CAAC,EAAE,UAAU,EACvB,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,KAAK,IAAI,GACtD,QAAQ,EAAE,GAAG,IAAI,CAyCnB;AAED,wBAAgB,KAAK,CAAC,EACpB,KAAK,EACL,OAAO,EACP,SAAS,EACT,eAAe,EACf,KAAK,EACL,MAAM,GACP,EAAE;IACD,KAAK,EAAE,UAAU,CAAC;IAClB,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC;IAChC,SAAS,EAAE,SAAS,CAAC;IACrB,eAAe,EAAE,gBAAgB,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,WAuBA"}
@@ -0,0 +1,45 @@
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
@@ -0,0 +1 @@
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,EACV,aAAa,EAEd,MAAM,UAAU,CAAC;AAGlB,eAAO,MAAM,aAAa,SAAU,cAAc,KAAG,UAGnD,CAAC;AAEH,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,iBAAiB,YAAa,WAAW,KAAG,QAAQ,GAAG,UACI,CAAC;AAEzE,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;AAG3E,eAAO,MAAM,oBAAoB,UAA2B,CAAC;AAE7D,eAAO,MAAM,OAAO,OAAQ,MAAM,WAAW,MAAM,SAIlD,CAAC;AAEF,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAU5D;AAED,eAAO,MAAM,YAAY,UAAW,UAAU,GAAG,UAAU,wBAA4C,CAAC;AAExG,eAAO,MAAM,gBAAgB,UAAW,UAAU,GAAG,UAAU,WAAW,OAAO;;;CAShF,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,gBAG5B,CAAC;AAKF,wBAAgB,mBAAmB,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,EAAE,QAAQ,SAAS,QAAQ,GAAG,QAAQ,EAAE,EAC9G,aAAa,EACb,aAAa,EACb,KAAK,EACL,KAAK,GACN,EAAE;IACD,aAAa,EAAE,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;IACnC,aAAa,EAAE,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;IACnC,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB,GAAG;IACF,aAAa,EAAE,QAAQ,EAAE,CAAC;IAC1B,aAAa,EAAE,QAAQ,EAAE,CAAC;CAC3B,CAsBA;AAED,eAAO,MAAM,qBAAqB;OAO7B,MAAM;OACN,MAAM;WACF,MAAM;YACL,MAAM;;MAEZ,UASH,CAAC;AAEF,eAAO,MAAM,eAAe,aAChB,MAAM,eACH,cAAc,QACrB,MAAM,8BAEX,aAAa,EAAE,GAAG,IAyBpB,CAAC"}
@@ -0,0 +1,48 @@
1
+ import type { NodeBase, NodeDragItem, EdgeBase, CoordinateExtent, NodeOrigin, OnError, SnapGrid, Transform, PanBy, OnNodeDrag, OnSelectionDrag, UpdateNodePositions } from '../types';
2
+ export type OnDrag = (event: MouseEvent, dragItems: NodeDragItem[], node: NodeBase, nodes: NodeBase[]) => void;
3
+ type StoreItems = {
4
+ nodes: NodeBase[];
5
+ edges: EdgeBase[];
6
+ nodeExtent: CoordinateExtent;
7
+ snapGrid: SnapGrid;
8
+ snapToGrid: boolean;
9
+ nodeOrigin: NodeOrigin;
10
+ multiSelectionActive: boolean;
11
+ domNode?: Element | null;
12
+ transform: Transform;
13
+ autoPanOnNodeDrag: boolean;
14
+ nodesDraggable: boolean;
15
+ selectNodesOnDrag: boolean;
16
+ panBy: PanBy;
17
+ unselectNodesAndEdges: () => void;
18
+ onError?: OnError;
19
+ onNodeDragStart?: OnNodeDrag;
20
+ onNodeDrag?: OnNodeDrag;
21
+ onNodeDragStop?: OnNodeDrag;
22
+ onSelectionDragStart?: OnSelectionDrag;
23
+ onSelectionDrag?: OnSelectionDrag;
24
+ onSelectionDragStop?: OnSelectionDrag;
25
+ updateNodePositions: UpdateNodePositions;
26
+ };
27
+ export type XYDragParams = {
28
+ domNode: Element;
29
+ getStoreItems: () => StoreItems;
30
+ onDragStart?: OnDrag;
31
+ onDrag?: OnDrag;
32
+ onDragStop?: OnDrag;
33
+ onNodeClick?: () => void;
34
+ };
35
+ export type XYDragInstance = {
36
+ update: (params: DragUpdateParams) => void;
37
+ destroy: () => void;
38
+ };
39
+ export type DragUpdateParams = {
40
+ noDragClassName?: string;
41
+ handleSelector?: string;
42
+ isSelectable?: boolean;
43
+ nodeId?: string;
44
+ domNode: Element;
45
+ };
46
+ export declare function XYDrag({ domNode, onNodeClick, getStoreItems, onDragStart, onDrag, onDragStop, }: XYDragParams): XYDragInstance;
47
+ export {};
48
+ //# sourceMappingURL=XYDrag.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"XYDrag.d.ts","sourceRoot":"","sources":["../../src/xydrag/XYDrag.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,QAAQ,EACR,YAAY,EAGZ,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,OAAO,EACP,QAAQ,EACR,SAAS,EACT,KAAK,EACL,UAAU,EACV,eAAe,EACf,mBAAmB,EACpB,MAAM,UAAU,CAAC;AAElB,MAAM,MAAM,MAAM,GAAG,CAAC,KAA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,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC3C,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,wBAAgB,MAAM,CAAC,EACrB,OAAO,EACP,WAAW,EACX,aAAa,EACb,WAAW,EACX,MAAM,EACN,UAAU,GACX,EAAE,YAAY,GAAG,cAAc,CA6L/B"}
@@ -0,0 +1,2 @@
1
+ export * from './XYDrag';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/xydrag/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { type NodeDragItem, type XYPosition, NodeBase } from '../types';
2
+ export declare function wrapSelectionDragFunc(selectionFunc?: (event: MouseEvent, nodes: NodeBase[]) => void): (event: MouseEvent, _: NodeBase, nodes: NodeBase[]) => void | undefined;
3
+ export declare function isParentSelected<NodeType extends NodeBase>(node: NodeType, nodes: NodeType[]): boolean;
4
+ export declare function hasSelector(target: Element, selector: string, domNode: Element): boolean;
5
+ export declare function getDragItems<NodeType extends NodeBase>(nodes: NodeType[], nodesDraggable: boolean, mousePos: XYPosition, nodeId?: string): NodeDragItem[];
6
+ export declare function getEventHandlerParams<NodeType extends NodeBase>({ nodeId, dragItems, nodes, }: {
7
+ nodeId?: string;
8
+ dragItems: NodeDragItem[];
9
+ nodes: NodeType[];
10
+ }): [NodeType, NodeType[]];
11
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/xydrag/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,UAAU,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAExE,wBAAgB,qBAAqB,CAAC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,WACnF,UAAU,KAAK,QAAQ,SAAS,QAAQ,EAAE,sBAC1D;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,SAAS,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,OAAO,CAgBtG;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAUxF;AAGD,wBAAgB,YAAY,CAAC,QAAQ,SAAS,QAAQ,EACpD,KAAK,EAAE,QAAQ,EAAE,EACjB,cAAc,EAAE,OAAO,EACvB,QAAQ,EAAE,UAAU,EACpB,MAAM,CAAC,EAAE,MAAM,GACd,YAAY,EAAE,CA0BhB;AAKD,wBAAgB,qBAAqB,CAAC,QAAQ,SAAS,QAAQ,EAAE,EAC/D,MAAM,EACN,SAAS,EACT,KAAK,GACN,EAAE;IACD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,YAAY,EAAE,CAAC;IAC1B,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAYzB"}
@@ -0,0 +1,45 @@
1
+ import { ConnectionMode, type OnConnect, type OnConnectStart, type HandleType, type Connection, type PanBy, type NodeBase, type Transform, type ConnectingHandle, type OnConnectEnd, type UpdateConnection, type IsValidConnection, type ConnectionHandle } from '../types';
2
+ export type OnPointerDownParams = {
3
+ autoPanOnConnect: boolean;
4
+ connectionMode: ConnectionMode;
5
+ connectionRadius: number;
6
+ domNode: HTMLDivElement | null;
7
+ handleId: string | null;
8
+ nodeId: string;
9
+ isTarget: boolean;
10
+ nodes: NodeBase[];
11
+ lib: string;
12
+ edgeUpdaterType?: HandleType;
13
+ updateConnection: UpdateConnection;
14
+ panBy: PanBy;
15
+ cancelConnection: () => void;
16
+ onConnectStart?: OnConnectStart;
17
+ onConnect?: OnConnect;
18
+ onConnectEnd?: OnConnectEnd;
19
+ isValidConnection?: IsValidConnection;
20
+ onEdgeUpdateEnd?: (evt: MouseEvent | TouchEvent) => void;
21
+ getTransform: () => Transform;
22
+ };
23
+ export type IsValidParams = {
24
+ handle: Pick<ConnectionHandle, 'nodeId' | 'id' | 'type'> | null;
25
+ connectionMode: ConnectionMode;
26
+ fromNodeId: string;
27
+ fromHandleId: string | null;
28
+ fromType: HandleType;
29
+ isValidConnection?: IsValidConnection;
30
+ doc: Document | ShadowRoot;
31
+ lib: string;
32
+ };
33
+ export type XYHandleInstance = {
34
+ onPointerDown: (event: MouseEvent | TouchEvent, params: OnPointerDownParams) => void;
35
+ isValid: (event: MouseEvent | TouchEvent, params: IsValidParams) => Result;
36
+ };
37
+ type Result = {
38
+ handleDomNode: Element | null;
39
+ isValid: boolean;
40
+ connection: Connection;
41
+ endHandle: ConnectingHandle | null;
42
+ };
43
+ export declare const XYHandle: XYHandleInstance;
44
+ export {};
45
+ //# sourceMappingURL=XYHandle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"XYHandle.d.ts","sourceRoot":"","sources":["../../src/xyhandle/XYHandle.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,KAAK,EACV,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACtB,MAAM,UAAU,CAAC;AAIlB,MAAM,MA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AE,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACrF,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,EAAE,MAAM,EAAE,aAAa,KAAK,MAAM,CAAC;CAC5E,CAAC;AAEF,KAAK,MAAM,GAAG;IACZ,aAAa,EAAE,OAAO,GAAG,IAAI,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,UAAU,CAAC;IACvB,SAAS,EAAE,gBAAgB,GAAG,IAAI,CAAC;CACpC,CAAC;AAoPF,eAAO,MAAM,QAAQ,EAAE,gBAGtB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './XYHandle';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/xyhandle/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { ConnectionStatus, type HandleType, type NodeHandleBounds, type XYPosition, type NodeBase, type ConnectionHandle } from '../types';
2
+ export declare function getHandles(node: NodeBase, handleBounds: NodeHandleBounds, type: HandleType, currentHandle: string): ConnectionHandle[];
3
+ export declare function getClosestHandle(pos: XYPosition, connectionRadius: number, handles: ConnectionHandle[]): ConnectionHandle | null;
4
+ type GetHandleLookupParams = {
5
+ nodes: NodeBase[];
6
+ nodeId: string;
7
+ handleId: string | null;
8
+ handleType: string;
9
+ };
10
+ export declare function getHandleLookup({ nodes, nodeId, handleId, handleType }: GetHandleLookupParams): ConnectionHandle[];
11
+ export declare function getHandleType(edgeUpdaterType: HandleType | undefined, handleDomNode: Element | null): HandleType | null;
12
+ export declare function resetRecentHandle(handleDomNode: Element, lib: string): void;
13
+ export declare function getConnectionStatus(isInsideConnectionRadius: boolean, isHandleValid: boolean): ConnectionStatus;
14
+ export {};
15
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/xyhandle/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACtB,MAAM,UAAU,CAAC;AAKlB,wBAAgB,UAAU,CACxB,IAAI,EAAE,QAAQ,EACd,YAAY,EAAE,gBAAgB,EAC9B,IAAI,EAAE,UAAU,EAChB,aAAa,EAAE,MAAM,GACpB,gBAAgB,EAAE,CAapB;AAED,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,UAAU,EACf,gBAAgB,EAAE,MAAM,EACxB,OAAO,EAAE,gBAAgB,EAAE,GAC1B,gBAAgB,GAAG,IAAI,CAyBzB;AAED,KAAK,qBAAqB,GAAG;IAC3B,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,qBAAqB,sBAgB7F;AAED,wBAAgB,aAAa,CAC3B,eAAe,EAAE,UAAU,GAAG,SAAS,EACvC,aAAa,EAAE,OAAO,GAAG,IAAI,GAC5B,UAAU,GAAG,IAAI,CAUnB;AAED,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAE3E;AAED,wBAAgB,mBAAmB,CAAC,wBAAwB,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,oBAU5F"}
@@ -0,0 +1,28 @@
1
+ import { pointer } from 'd3-selection';
2
+ import type { CoordinateExtent, PanZoomInstance, Transform } from '../types';
3
+ export type XYMinimapInstance = {
4
+ update: (params: XYMinimapUpdate) => void;
5
+ destroy: () => void;
6
+ pointer: typeof pointer;
7
+ };
8
+ export type XYMinimapParams = {
9
+ panZoom: PanZoomInstance;
10
+ domNode: Element;
11
+ getTransform: () => Transform;
12
+ getViewScale: () => number;
13
+ };
14
+ export type XYMinimapUpdate = {
15
+ translateExtent: CoordinateExtent;
16
+ width: number;
17
+ height: number;
18
+ inversePan?: boolean;
19
+ zoomStep?: number;
20
+ pannable?: boolean;
21
+ zoomable?: boolean;
22
+ };
23
+ export declare function XYMinimap({ domNode, panZoom, getTransform, getViewScale }: XYMinimapParams): {
24
+ update: ({ translateExtent, width, height, zoomStep, pannable, zoomable, inversePan, }: XYMinimapUpdate) => void;
25
+ destroy: () => void;
26
+ pointer: typeof pointer;
27
+ };
28
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/xyminimap/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,OAAO,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE7E,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;IAC1C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,EAAE,OAAO,OAAO,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,eAAe,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,SAAS,CAAC;IAC9B,YAAY,EAAE,MAAM,MAAM,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,eAAe,EAAE,gBAAgB,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,wBAAgB,SAAS,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,EAAE,eAAe;4FAWtF,eAAe;;;EAgEnB"}
@@ -0,0 +1,10 @@
1
+ import { type Viewport, PanZoomParams, PanZoomInstance } from '../types';
2
+ export type ZoomPanValues = {
3
+ isZoomingOrPanning: boolean;
4
+ usedRightMouseButton: boolean;
5
+ prevViewport: Viewport;
6
+ mouseButton: number;
7
+ timerId: ReturnType<typeof setTimeout> | undefined;
8
+ };
9
+ export declare function XYPanZoom({ domNode, minZoom, maxZoom, translateExtent, viewport, onPanZoom, onPanZoomStart, onPanZoomEnd, onTransformChange, onDraggingChange, }: PanZoomParams): PanZoomInstance;
10
+ //# sourceMappingURL=XYPanZoom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"XYPanZoom.d.ts","sourceRoot":"","sources":["../../src/xypanzoom/XYPanZoom.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,QAAQ,EAGb,aAAa,EACb,eAAe,EAChB,MAAM,UAAU,CAAC;AAYlB,MAAM,MAAM,aAAa,GAAG;IAC1B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,YAAY,EAAE,QAAQ,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,GAAG,SAAS,CAAC;CACpD,CAAC;AAEF,wBAAgB,SAAS,CAAC,EACxB,OAAO,EACP,OAAO,EACP,OAAO,EACP,eAAe,EACf,QAAQ,EACR,SAAS,EACT,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,GACjB,EAAE,aAAa,GAAG,eAAe,CAsLjC"}
@@ -0,0 +1,48 @@
1
+ import type { D3ZoomEvent } from 'd3-zoom';
2
+ import { PanOnScrollMode, type D3SelectionInstance, type D3ZoomHandler, type D3ZoomInstance, type OnPanZoom, type Viewport, type OnDraggingChange, type OnTransformChange } from '../types';
3
+ export type ZoomPanValues = {
4
+ isZoomingOrPanning: boolean;
5
+ usedRightMouseButton: boolean;
6
+ prevViewport: Viewport;
7
+ mouseButton: number;
8
+ timerId: ReturnType<typeof setTimeout> | undefined;
9
+ };
10
+ export type PanOnScrollParams = {
11
+ noWheelClassName: string;
12
+ d3Selection: D3SelectionInstance;
13
+ d3Zoom: D3ZoomInstance;
14
+ panOnScrollMode: PanOnScrollMode;
15
+ panOnScrollSpeed: number;
16
+ zoomOnPinch: boolean;
17
+ };
18
+ export type ZoomOnScrollParams = {
19
+ noWheelClassName: string;
20
+ preventScrolling: boolean;
21
+ d3ZoomHandler: D3ZoomHandler;
22
+ };
23
+ export type PanZoomStartParams = {
24
+ zoomPanValues: ZoomPanValues;
25
+ onDraggingChange: OnDraggingChange;
26
+ onPanZoomStart?: OnPanZoom;
27
+ };
28
+ export type PanZoomParams = {
29
+ zoomPanValues: ZoomPanValues;
30
+ panOnDrag: boolean | number[];
31
+ onPaneContextMenu: boolean;
32
+ onTransformChange: OnTransformChange;
33
+ onPanZoom?: OnPanZoom;
34
+ };
35
+ export type PanZoomEndParams = {
36
+ zoomPanValues: ZoomPanValues;
37
+ panOnDrag: boolean | number[];
38
+ panOnScroll: boolean;
39
+ onDraggingChange: (isDragging: boolean) => void;
40
+ onPanZoomEnd?: OnPanZoom;
41
+ onPaneContextMenu?: (event: any) => void;
42
+ };
43
+ export declare function createPanOnScrollHandler({ noWheelClassName, d3Selection, d3Zoom, panOnScrollMode, panOnScrollSpeed, zoomOnPinch, }: PanOnScrollParams): (event: any) => false | undefined;
44
+ export declare function createZoomOnScrollHandler({ noWheelClassName, preventScrolling, d3ZoomHandler }: ZoomOnScrollParams): (this: Element, event: any, d: unknown) => null | undefined;
45
+ export declare function createPanZoomStartHandler({ zoomPanValues, onDraggingChange, onPanZoomStart }: PanZoomStartParams): (event: D3ZoomEvent<HTMLDivElement, any>) => void;
46
+ export declare function createPanZoomHandler({ zoomPanValues, panOnDrag, onPaneContextMenu, onTransformChange, onPanZoom, }: PanZoomParams): (event: D3ZoomEvent<HTMLDivElement, any>) => void;
47
+ export declare function createPanZoomEndHandler({ zoomPanValues, panOnDrag, panOnScroll, onDraggingChange, onPanZoomEnd, onPaneContextMenu, }: PanZoomEndParams): (event: D3ZoomEvent<HTMLDivElement, any>) => void;
48
+ //# sourceMappingURL=eventhandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eventhandler.d.ts","sourceRoot":"","sources":["../../src/xypanzoom/eventhandler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAG3C,OAAO,EACL,eAAe,EACf,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACvB,MAAM,UAAU,CAAC;AAGlB,MAAM,MAAM,aAAa,GAAG;IAC1B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,YAAY,EAAE,QAAQ,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,GAAG,SAAS,CAAC;CACpD,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,mBAAmB,CAAC;IACjC,MAAM,EAAE,cAAc,CAAC;IACvB,eAAe,EAAE,eAAe,CAAC;IACjC,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,OAAO,CAAC;IA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ACjB,SAAS,GACV,EAAE,aAAa,WACC,YAAY,cAAc,EAAE,GAAG,CAAC,UAWhD;AAED,wBAAgB,uBAAuB,CAAC,EACtC,aAAa,EACb,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,GAClB,EAAE,gBAAgB,WACF,YAAY,cAAc,EAAE,GAAG,CAAC,UA6BhD"}
@@ -0,0 +1,14 @@
1
+ export type FilterParams = {
2
+ zoomActivationKeyPressed: boolean;
3
+ zoomOnScroll: boolean;
4
+ zoomOnPinch: boolean;
5
+ panOnDrag: boolean | number[];
6
+ panOnScroll: boolean;
7
+ zoomOnDoubleClick: boolean;
8
+ userSelectionActive: boolean;
9
+ noWheelClassName: string;
10
+ noPanClassName: string;
11
+ lib: string;
12
+ };
13
+ export declare function createFilter({ zoomActivationKeyPressed, zoomOnScroll, zoomOnPinch, panOnDrag, panOnScroll, zoomOnDoubleClick, userSelectionActive, noWheelClassName, noPanClassName, lib, }: FilterParams): (event: any) => boolean;
14
+ //# sourceMappingURL=filter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../src/xypanzoom/filter.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,YAAY,GAAG;IACzB,wBAAwB,EAAE,OAAO,CAAC;IAClC,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,GAAG,MAAM,EAAE,CAAC;IAC9B,WAAW,EAAE,OAAO,CAAC;IACrB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,wBAAgB,YAAY,CAAC,EAC3B,wBAAwB,EACxB,YAAY,EACZ,WAAW,EACX,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,GAAG,GACJ,EAAE,YAAY,WACE,GAAG,KAAG,OAAO,CAmE7B"}
@@ -0,0 +1,2 @@
1
+ export * from './XYPanZoom';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/xypanzoom/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}