@xyflow/system 0.0.37 → 0.0.39

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.
@@ -1,4 +1,4 @@
1
- import { ConnectionMode, type Connection, type OnConnect, type OnConnectStart, type HandleType, type PanBy, type Transform, type Handle, type OnConnectEnd, type UpdateConnection, type IsValidConnection, NodeLookup } from '../types';
1
+ import { ConnectionMode, type Connection, type OnConnect, type OnConnectStart, type HandleType, type PanBy, type Transform, type Handle, type OnConnectEnd, type UpdateConnection, type IsValidConnection, NodeLookup, FinalConnectionState } from '../types';
2
2
  export type OnPointerDownParams = {
3
3
  autoPanOnConnect: boolean;
4
4
  connectionMode: ConnectionMode;
@@ -18,7 +18,7 @@ export type OnPointerDownParams = {
18
18
  onConnect?: OnConnect;
19
19
  onConnectEnd?: OnConnectEnd;
20
20
  isValidConnection?: IsValidConnection;
21
- onReconnectEnd?: (evt: MouseEvent | TouchEvent) => void;
21
+ onReconnectEnd?: (evt: MouseEvent | TouchEvent, connectionState: FinalConnectionState) => void;
22
22
  getTransform: () => Transform;
23
23
  getFromHandle: () => Handle | null;
24
24
  autoPanSpeed?: number;
@@ -33,7 +33,7 @@ export type IsValidParams = {
33
33
  doc: Document | ShadowRoot;
34
34
  lib: string;
35
35
  flowId: string | null;
36
- handleLookup?: Map<string, Handle>;
36
+ nodeLookup: NodeLookup;
37
37
  };
38
38
  export type XYHandleInstance = {
39
39
  onPointerDown: (event: MouseEvent | TouchEvent, params: OnPointerDownParams) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/xyhandle/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,KAAK,EACV,KAAK,SAAS,EACd,KAAK,MAAM,EACX,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB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ACrF,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,EAAE,MAAM,EAAE,aAAa,KAAK,MAAM,CAAC;CAC5E,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IACnB,aAAa,EAAE,OAAO,GAAG,IAAI,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;IAC9B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC"}
@@ -1,13 +1,10 @@
1
- import { type HandleType, type XYPosition, type Handle, NodeLookup } from '../types';
2
- export declare function getClosestHandle(pos: XYPosition, connectionRadius: number, handleLookup: Map<string, Handle>): Handle | null;
3
- type GetHandleLookupParams = {
4
- nodeLookup: NodeLookup;
1
+ import type { HandleType, XYPosition, Handle, NodeLookup } from '../types';
2
+ export declare function getClosestHandle(position: XYPosition, connectionRadius: number, nodeLookup: NodeLookup, fromHandle: {
5
3
  nodeId: string;
6
- handleId: string | null;
7
- handleType: HandleType;
8
- };
9
- export declare function getHandleLookup({ nodeLookup, nodeId, handleId, handleType, }: GetHandleLookupParams): [Map<string, Handle>, Handle];
4
+ type: HandleType;
5
+ id?: string | null;
6
+ }): Handle | null;
7
+ export declare function getHandle(nodeId: string, handleType: HandleType, handleId: string | null, nodeLookup: NodeLookup, withAbsolutePosition?: boolean): Handle | null;
10
8
  export declare function getHandleType(edgeUpdaterType: HandleType | undefined, handleDomNode: Element | null): HandleType | null;
11
9
  export declare function isConnectionValid(isInsideConnectionRadius: boolean, isHandleValid: boolean): boolean | null;
12
- export {};
13
10
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/xyhandle/utils.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,UAAU,EAEf,KAAK,UAAU,EACf,KAAK,MAAM,EAEX,UAAU,EACX,MAAM,UAAU,CAAC;AAuBlB,wBAAgB,gBAAgB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EAAE,UAAU,EACtB,oBAAoB,UAAQ,GAC3B,MAAM,GAAG,IAAI,CAYf;AAED,wBAAgB,aAAa,CAC3B,eAAe,EAAE,UAAU,GAAG,SAAS,EACvC,aAAa,EAAE,OAAO,GAAG,IAAI,GAC5B,UAAU,GAAG,IAAI,CAUnB;AAED,wBAAgB,iBAAiB,CAAC,wBAAwB,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,kBAU1F"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyflow/system",
3
- "version": "0.0.37",
3
+ "version": "0.0.39",
4
4
  "description": "xyflow core system that powers React Flow and Svelte Flow.",
5
5
  "keywords": [
6
6
  "node-based UI",
@@ -47,9 +47,9 @@
47
47
  "devDependencies": {
48
48
  "@types/node": "^18.7.16",
49
49
  "typescript": "5.1.3",
50
+ "@xyflow/eslint-config": "0.0.0",
50
51
  "@xyflow/rollup-config": "0.0.0",
51
- "@xyflow/tsconfig": "0.0.0",
52
- "@xyflow/eslint-config": "0.0.0"
52
+ "@xyflow/tsconfig": "0.0.0"
53
53
  },
54
54
  "rollup": {
55
55
  "globals": {