react-cosmos-diagram 0.7.4 → 0.8.0

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 (55) hide show
  1. package/dist/esm/components/Node/NodeWrapper/index.d.ts +1 -1
  2. package/dist/esm/components/Node/NodeWrapper/index.d.ts.map +1 -1
  3. package/dist/esm/components/ReactDiagramProvider/type.d.ts +1 -2
  4. package/dist/esm/components/ReactDiagramProvider/type.d.ts.map +1 -1
  5. package/dist/esm/container/DiagramRenderer/index.d.ts +1 -1
  6. package/dist/esm/container/DiagramRenderer/index.d.ts.map +1 -1
  7. package/dist/esm/container/DragSelection/index.d.ts +2 -2
  8. package/dist/esm/container/DragSelection/index.d.ts.map +1 -1
  9. package/dist/esm/container/Pane/index.d.ts +2 -2
  10. package/dist/esm/container/Pane/index.d.ts.map +1 -1
  11. package/dist/esm/container/ReactDiagram/DiagramView.d.ts +1 -1
  12. package/dist/esm/container/ReactDiagram/DiagramView.d.ts.map +1 -1
  13. package/dist/esm/container/ReactDiagram/index.d.ts +7 -3
  14. package/dist/esm/container/ReactDiagram/index.d.ts.map +1 -1
  15. package/dist/esm/hooks/useNodesEdgesState/type.d.ts +5 -0
  16. package/dist/esm/hooks/useNodesEdgesState/type.d.ts.map +1 -1
  17. package/dist/esm/index.d.ts +1 -0
  18. package/dist/esm/index.d.ts.map +1 -1
  19. package/dist/esm/index.js +37 -134
  20. package/dist/esm/index.mjs +37 -134
  21. package/dist/esm/store/index.d.ts.map +1 -1
  22. package/dist/esm/types/core.d.ts +4 -0
  23. package/dist/esm/types/core.d.ts.map +1 -1
  24. package/dist/style.css +5 -1
  25. package/dist/umd/components/Node/NodeWrapper/index.d.ts +1 -1
  26. package/dist/umd/components/Node/NodeWrapper/index.d.ts.map +1 -1
  27. package/dist/umd/components/ReactDiagramProvider/type.d.ts +1 -2
  28. package/dist/umd/components/ReactDiagramProvider/type.d.ts.map +1 -1
  29. package/dist/umd/container/DiagramRenderer/index.d.ts +1 -1
  30. package/dist/umd/container/DiagramRenderer/index.d.ts.map +1 -1
  31. package/dist/umd/container/DragSelection/index.d.ts +2 -2
  32. package/dist/umd/container/DragSelection/index.d.ts.map +1 -1
  33. package/dist/umd/container/Pane/index.d.ts +2 -2
  34. package/dist/umd/container/Pane/index.d.ts.map +1 -1
  35. package/dist/umd/container/ReactDiagram/DiagramView.d.ts +1 -1
  36. package/dist/umd/container/ReactDiagram/DiagramView.d.ts.map +1 -1
  37. package/dist/umd/container/ReactDiagram/index.d.ts +7 -3
  38. package/dist/umd/container/ReactDiagram/index.d.ts.map +1 -1
  39. package/dist/umd/hooks/useNodesEdgesState/type.d.ts +5 -0
  40. package/dist/umd/hooks/useNodesEdgesState/type.d.ts.map +1 -1
  41. package/dist/umd/index.d.ts +1 -0
  42. package/dist/umd/index.d.ts.map +1 -1
  43. package/dist/umd/index.js +2 -2
  44. package/dist/umd/store/index.d.ts.map +1 -1
  45. package/dist/umd/types/core.d.ts +4 -0
  46. package/dist/umd/types/core.d.ts.map +1 -1
  47. package/package.json +2 -2
  48. package/dist/esm/store/type.d.ts +0 -6
  49. package/dist/esm/store/type.d.ts.map +0 -1
  50. package/dist/esm/store/utils.d.ts +0 -8
  51. package/dist/esm/store/utils.d.ts.map +0 -1
  52. package/dist/umd/store/type.d.ts +0 -6
  53. package/dist/umd/store/type.d.ts.map +0 -1
  54. package/dist/umd/store/utils.d.ts +0 -8
  55. package/dist/umd/store/utils.d.ts.map +0 -1
@@ -4,7 +4,7 @@ import { NodeProps } from '../type';
4
4
  import { NodeWrapperProps } from './type';
5
5
  export declare const arrowKeyDiffs: Record<string, XYPosition>;
6
6
  declare const wrapNode: (NodeComponent: ComponentType<NodeProps>) => import("react").MemoExoticComponent<{
7
- ({ id, type, data, positionX, positionY, sourcePosition, targetPosition, onClick, onMouseEnter, onMouseMove, onMouseLeave, onContextMenu, onDoubleClick, style, width, height, className, selected, isSelectable, isDraggable, intersected, nodeOrigin, nodeExtent, hidden, resizeObserver, dragHandle, zIndex, isParent, initialized, disableKeyboardA11y, ariaLabel, rfId, noDragClassName, noPanClassName, }: NodeWrapperProps): import("react/jsx-runtime").JSX.Element | null;
7
+ ({ id, type, data, positionX, positionY, sourcePosition, targetPosition, onClick, onMouseEnter, onMouseMove, onMouseLeave, onContextMenu, onDoubleClick, style, width, height, className, selected, isSelectable, isDraggable, intersected, hidden, resizeObserver, dragHandle, zIndex, isParent, initialized, disableKeyboardA11y, ariaLabel, rfId, noDragClassName, noPanClassName, }: NodeWrapperProps): import("react/jsx-runtime").JSX.Element | null;
8
8
  displayName: string;
9
9
  }>;
10
10
  export default wrapNode;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../react-diagram/packages/react/src/components/Node/NodeWrapper/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,aAAa,EAAc,MAAM,OAAO,CAAC;AAYtE,OAAO,EAGJ,UAAU,EACZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAE1C,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAKpD,CAAC;AAEF,QAAA,MAAM,QAAQ,kBAAmB,cAAc,SAAS,CAAC;qZA2CnD,gBAAgB;;EA6JrB,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../react-diagram/packages/react/src/components/Node/NodeWrapper/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,aAAa,EAAc,MAAM,OAAO,CAAC;AAYtE,OAAO,EAGJ,UAAU,EACZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAE1C,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAKpD,CAAC;AAEF,QAAA,MAAM,QAAQ,kBAAmB,cAAc,SAAS,CAAC;6XA2CnD,gBAAgB;;EA8JrB,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -2,8 +2,7 @@ import { MouseEvent as ReactMouseEvent } from 'react';
2
2
  import { ZoomBehavior, Selection as D3Selection } from 'd3';
3
3
  import type { Transform, CoordinateExtent, XYPosition, GridStep, OnConnectStart, OnConnect, OnConnectEnd, PanBy, NodeInternals, UpdateConnection, NodeDragItem, NodeOrigin, ConnectingPort } from 'cosmos-diagram';
4
4
  import { Node, Edge, DefaultEdgeOptions, OnError } from '../../types';
5
- import { NodeDimensionUpdate } from '../../store/type';
6
- import { NodeChange, OnNodesChange, OnEdgesChange } from '../../hooks/useNodesEdgesState/type';
5
+ import { NodeChange, OnNodesChange, OnEdgesChange, NodeDimensionUpdate } from '../../hooks/useNodesEdgesState/type';
7
6
  export type NodeDragHandler = (event: ReactMouseEvent, node: Node, nodes: Node[]) => void;
8
7
  export type UnSelectNodesParams = {
9
8
  nodes?: Node[];
@@ -1 +1 @@
1
- {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/components/ReactDiagramProvider/type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,eAAe,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,IAAI,CAAC;AAE5D,OAAO,KAAK,EACT,SAAS,EACT,gBAAgB,EAChB,UAAU,EAEV,QAAQ,EACR,cAAc,EACd,SAAS,EACT,YAAY,EACZ,KAAK,EACL,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,cAAc,EAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtE,OA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AM,IAAI,CAAC;IACpC,kBAAkB,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;IAEpD,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,gBAAgB,EAAE,gBAAgB,CAAC;IAEnC,KAAK,EAAE,KAAK,CAAC;IAEb,aAAa,EAAE,CAAC,UAAU,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACtD,kBAAkB,EAAE,CAAC,eAAe,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAChE,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,GAAG,mBAAmB,CAAC"}
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/components/ReactDiagramProvider/type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,eAAe,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,IAAI,CAAC;AAE5D,OAAO,KAAK,EACT,SAAS,EACT,gBAAgB,EAChB,UAAU,EACV,QAAQ,EACR,cAAc,EACd,SAAS,EACT,YAAY,EACZ,KAAK,EACL,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,cAAc,EAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAItE,OAAO,EACJ,UAAU,EACV,aAAa,EACb,aAAa,EACb,mBAAmB,EACrB,MAAM,qCAAqC,CAAC;AAE7C,MAAM,MAAM,eAAe,GAAG,CAC3B,KAAK,EAAE,eAAe,EACtB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,IAAI,EAAE,KACX,IAAI,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AAK,IAAI,CAAC;IACtD,kBAAkB,EAAE,CAAC,eAAe,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAChE,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,GAAG,mBAAmB,CAAC"}
@@ -5,7 +5,7 @@ export type DiagramRendererProps = Omit<PaneProps, 'translateExtent' | 'minZoom'
5
5
  multiSelectionKeyCode?: KeyCode;
6
6
  dragSelectionKeyCode?: KeyCode;
7
7
  };
8
- declare function DiagramRenderer({ children, multiSelectionKeyCode, dragSelectionKeyCode, noPanClassName, panning, defaultViewport, onMove, onMoveStart, onMoveEnd, }: DiagramRendererProps): import("react/jsx-runtime").JSX.Element;
8
+ declare function DiagramRenderer({ children, multiSelectionKeyCode, dragSelectionKeyCode, noPanClassName, panning, defaultViewport, onMove, onMoveStart, onMoveEnd, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, }: DiagramRendererProps): import("react/jsx-runtime").JSX.Element;
9
9
  declare namespace DiagramRenderer {
10
10
  var displayName: string;
11
11
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/container/DiagramRenderer/index.tsx"],"names":[],"mappings":";AAGA,OAA4B,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAK/E,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAKpC,MAAM,MAAM,oBAAoB,GAAG,IAAI,CACpC,SAAS,EACT,iBAAiB,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,CACzD,GAAG;IACD,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,oBAAoB,CAAC,EAAE,OAAO,CAAC;CACjC,CAAC;AAWF,iBAAS,eAAe,CAAC,EACtB,QAAQ,EACR,qBAAqB,EACrB,oBAAoB,EACpB,cAAc,EACd,OAAO,EACP,eAAe,EACf,MAAM,EACN,WAAW,EACX,SAAS,GACX,EAAE,oBAAoB,2CAgCtB;kBA1CQ,eAAe;;;;AA8CxB,wBAAqC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/container/DiagramRenderer/index.tsx"],"names":[],"mappings":";AAGA,OAA4B,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAK/E,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAKpC,MAAM,MAAM,oBAAoB,GAAG,IAAI,CACpC,SAAS,EACT,iBAAiB,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,CACzD,GAAG;IACD,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,oBAAoB,CAAC,EAAE,OAAO,CAAC;CACjC,CAAC;AAWF,iBAAS,eAAe,CAAC,EACtB,QAAQ,EACR,qBAAqB,EACrB,oBAAoB,EACpB,cAAc,EACd,OAAO,EACP,eAAe,EACf,MAAM,EACN,WAAW,EACX,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,gBAAgB,GAClB,EAAE,oBAAoB,2CAoCtB;kBAlDQ,eAAe;;;;AAsDxB,wBAAqC"}
@@ -1,8 +1,8 @@
1
1
  import type { ReactNode } from 'react';
2
2
  type DragSelectionProps = {
3
- dragSelectionKeyPressed?: boolean;
3
+ isSelecting?: boolean;
4
4
  children: ReactNode;
5
5
  };
6
- declare function DragSelection({ dragSelectionKeyPressed, children, }: DragSelectionProps): import("react/jsx-runtime").JSX.Element;
6
+ declare function DragSelection({ isSelecting, children }: DragSelectionProps): import("react/jsx-runtime").JSX.Element;
7
7
  export default DragSelection;
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/container/DragSelection/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiC,SAAS,EAAE,MAAM,OAAO,CAAC;AAsBtE,KAAK,kBAAkB,GAAG;IACvB,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,QAAQ,EAAE,SAAS,CAAC;CACtB,CAAC;AAcF,iBAAS,aAAa,CAAC,EACpB,uBAAuB,EACvB,QAAQ,GACV,EAAE,kBAAkB,2CA8LpB;AAED,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/container/DragSelection/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiC,SAAS,EAAE,MAAM,OAAO,CAAC;AAsBtE,KAAK,kBAAkB,GAAG;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,SAAS,CAAC;CACtB,CAAC;AAcF,iBAAS,aAAa,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,kBAAkB,2CAiMnE;AAED,eAAe,aAAa,CAAC"}
@@ -3,7 +3,7 @@ import { ReactDiagramProps } from '../../types';
3
3
  export type PaneProps = Required<Pick<ReactDiagramProps, 'noPanClassName' | 'panning' | 'minZoom' | 'maxZoom' | 'defaultViewport' | 'translateExtent'> & {
4
4
  children: ReactNode;
5
5
  selection: boolean;
6
- }> & Pick<ReactDiagramProps, 'onMove' | 'onMoveStart' | 'onMoveEnd'>;
7
- declare const Pane: ({ noPanClassName, panning, selection, minZoom, maxZoom, defaultViewport, translateExtent, children, onMove, onMoveStart, onMoveEnd, }: PaneProps) => import("react/jsx-runtime").JSX.Element;
6
+ }> & Pick<ReactDiagramProps, 'onMove' | 'onMoveStart' | 'onMoveEnd' | 'onPaneClick' | 'onPaneMouseEnter' | 'onPaneMouseMove' | 'onPaneMouseLeave'>;
7
+ declare const Pane: ({ noPanClassName, panning, selection, minZoom, maxZoom, defaultViewport, translateExtent, children, onMove, onMoveStart, onMoveEnd, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, }: PaneProps) => import("react/jsx-runtime").JSX.Element;
8
8
  export default Pane;
9
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/container/Pane/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGhD,MAAM,MAAM,SAAS,GAAG,QAAQ,CAC7B,IAAI,CACD,iBAAiB,EACf,gBAAgB,GAChB,SAAS,GACT,SAAS,GACT,SAAS,GACT,iBAAiB,GACjB,iBAAiB,CACrB,GAAG;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;CACrB,CACH,GACE,IAAI,CAAC,iBAAiB,EAAE,QAAQ,GAAG,aAAa,GAAG,WAAW,CAAC,CAAC;AAEnE,QAAA,MAAM,IAAI,0IAaP,SAAS,4CAsEX,CAAC;AAEF,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/container/Pane/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGhD,MAAM,MAAM,SAAS,GAAG,QAAQ,CAC7B,IAAI,CACD,iBAAiB,EACf,gBAAgB,GAChB,SAAS,GACT,SAAS,GACT,SAAS,GACT,iBAAiB,GACjB,iBAAiB,CACrB,GAAG;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;CACrB,CACH,GACE,IAAI,CACD,iBAAiB,EACf,QAAQ,GACR,aAAa,GACb,WAAW,GACX,aAAa,GACb,kBAAkB,GAClB,iBAAiB,GACjB,kBAAkB,CACtB,CAAC;AAEL,QAAA,MAAM,IAAI,4MAiBP,SAAS,4CA0DX,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -8,7 +8,7 @@ export type DiagramViewProps = ReactDiagramCommonProps & Required<Pick<ReactDiag
8
8
  edgeTypes: EdgeTypesWrapped;
9
9
  rfId: string;
10
10
  };
11
- declare function DiagramView({ rfId, noPanClassName, panning, defaultViewport, multiSelectionKeyCode, dragSelectionKeyCode, onMove, onMoveStart, onMoveEnd, onlyRenderVisibleElements, disableKeyboardA11y, noDragClassName, nodeOrigin, nodeExtent, nodeTypes, onNodeClick, onNodeDoubleClick, onNodeContextMenu, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave, edgeTypes, edgeUpdaterRadius, onEdgeClick, onEdgeDoubleClick, onEdgeContextMenu, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, onEdgeUpdate, onEdgeUpdateStart, onEdgeUpdateEnd, ConnectionLineContainerStyle, ConnectionLineComponent, }: DiagramViewProps): import("react/jsx-runtime").JSX.Element;
11
+ declare function DiagramView({ rfId, noPanClassName, panning, defaultViewport, multiSelectionKeyCode, dragSelectionKeyCode, onlyRenderVisibleElements, disableKeyboardA11y, noDragClassName, nodeOrigin, nodeExtent, nodeTypes, onNodeClick, onNodeDoubleClick, onNodeContextMenu, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave, edgeTypes, edgeUpdaterRadius, onEdgeClick, onEdgeDoubleClick, onEdgeContextMenu, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, onEdgeUpdate, onEdgeUpdateStart, onEdgeUpdateEnd, onMove, onMoveStart, onMoveEnd, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, ConnectionLineContainerStyle, ConnectionLineComponent, }: DiagramViewProps): import("react/jsx-runtime").JSX.Element;
12
12
  declare namespace DiagramView {
13
13
  var displayName: string;
14
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DiagramView.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/container/ReactDiagram/DiagramView.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,MAAM,MAAM,uBAAuB,GAAG,IAAI,CACvC,iBAAiB,EACjB,OAAO,GAAG,OAAO,GAAG,WAAW,GAAG,WAAW,CAC/C,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,uBAAuB,GACnD,QAAQ,CACL,IAAI,CACD,iBAAiB,EACf,SAAS,GACT,iBAAiB,GACjB,2BAA2B,GAC3B,qBAAqB,GACrB,iBAAiB,GACjB,gBAAgB,GAChB,YAAY,GACZ,YAAY,CAChB,CACH,GAAG;IACD,SAAS,EAAE,gBAAgB,CAAC;IAC5B,SAAS,EAAE,gBAAgB,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;CACf,CAAC;AAEL,iBAAS,WAAW,CAAC,EAClB,IAAI,EAIJ,cAAc,EACd,OAAO,EAEP,eAAe,EAEf,qBAAqB,EACrB,oBAAoB,EAEpB,MAAM,EACN,WAAW,EACX,SAAS,EAGT,yBAAyB,EACzB,mBAAmB,EACnB,eAAe,EACf,UAAU,EACV,UAAU,EACV,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAGhB,SAAS,EACT,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,eAAe,EAGf,4BAA4B,EAC5B,uBAAuB,GACzB,EAAE,gBAAgB,2CAkDlB;kBAjGQ,WAAW;;;;AAqGpB,wBAAiC"}
1
+ {"version":3,"file":"DiagramView.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/container/ReactDiagram/DiagramView.tsx"],"names":[],"mappings":";A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from 'cosmos-diagram';
2
+ import { NodeOrigin, Viewport } from 'cosmos-diagram';
3
3
  import { NodeTypes } from '../NodeRenderer/type';
4
4
  import { EdgeTypes } from '../EdgeRenderer/type';
5
5
  declare const ReactDiagram: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & {
6
6
  onlyRenderVisibleElements?: boolean | undefined;
7
7
  disableKeyboardA11y?: boolean | undefined;
8
- nodeExtent?: CoordinateExtent | undefined;
8
+ nodeExtent?: import("cosmos-diagram").CoordinateExtent | undefined;
9
9
  nodeOrigin?: NodeOrigin | undefined;
10
10
  smoothStep?: boolean | undefined;
11
11
  centerStep?: boolean | undefined;
@@ -45,11 +45,15 @@ declare const ReactDiagram: import("react").ForwardRefExoticComponent<import("re
45
45
  onMove?: import("cosmos-diagram").OnMove | undefined;
46
46
  onMoveStart?: import("cosmos-diagram").OnMove | undefined;
47
47
  onMoveEnd?: import("cosmos-diagram").OnMove | undefined;
48
+ onPaneClick?: import("cosmos-diagram").OnMove | undefined;
49
+ onPaneMouseEnter?: ((event: import("react").MouseEvent<Element, MouseEvent>) => void) | undefined;
50
+ onPaneMouseMove?: ((event: import("react").MouseEvent<Element, MouseEvent>) => void) | undefined;
51
+ onPaneMouseLeave?: ((event: import("react").MouseEvent<Element, MouseEvent>) => void) | undefined;
48
52
  onError?: import("../../types").OnError | undefined;
49
53
  minZoom?: number | undefined;
50
54
  maxZoom?: number | undefined;
51
55
  defaultViewport?: Viewport | undefined;
52
- translateExtent?: CoordinateExtent | undefined;
56
+ translateExtent?: import("cosmos-diagram").CoordinateExtent | undefined;
53
57
  multiSelectionKeyCode?: import("../../hooks/useGlobalKeyHandler").KeyCode | undefined;
54
58
  dragSelectionKeyCode?: import("../../hooks/useGlobalKeyHandler").KeyCode | undefined;
55
59
  nodesDraggable?: boolean | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/container/ReactDiagram/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAgBxE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAejD,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kDAsJjB,CAAC;AAIF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/container/ReactDiagram/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAgBtD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAcjD,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kDA8JjB,CAAC;AAIF,eAAe,YAAY,CAAC"}
@@ -1,6 +1,11 @@
1
1
  import { CoreEdge, Dimensions, XYPosition } from 'cosmos-diagram';
2
2
  import { Node } from '../../components/Node/type';
3
3
  import { Edge } from '../../components/Edges/type';
4
+ export type NodeDimensionUpdate = {
5
+ id: string;
6
+ nodeElement: HTMLDivElement;
7
+ forceUpdate?: boolean;
8
+ };
4
9
  export type NodeDimensionChange = {
5
10
  id: string;
6
11
  type: 'dimensions';
@@ -1 +1 @@
1
- {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../react-diagram/packages/react/src/hooks/useNodesEdgesState/type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE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AAO,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,UAAU,GACjB,mBAAmB,GACnB,kBAAkB,GAClB,mBAAmB,GACnB,sBAAsB,GACtB,gBAAgB,GAChB,aAAa,GACb,eAAe,CAAC;AAErB,MAAM,MAAM,mBAAmB,GAAG,mBAAmB,CAAC;AACtD,MAAM,MAAM,gBAAgB,GAAG,gBAAgB,CAAC;AAChD,MAAM,MAAM,aAAa,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAAI;IAC/D,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACrB,IAAI,EAAE,KAAK,CAAC;CACd,CAAC;AACF,MAAM,MAAM,eAAe,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAAI;IACjE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACrB,IAAI,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,UAAU,GACjB,mBAAmB,GACnB,gBAAgB,GAChB,aAAa,GACb,eAAe,CAAC;AAErB,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;AAC5D,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC"}
@@ -6,6 +6,7 @@ export { default as BaseEdge } from './components/Edges/BaseEdge';
6
6
  export { default as StepEdge } from './components/Edges/StepEdge';
7
7
  export { default as BezierEdge } from './components/Edges/BezierEdge';
8
8
  export * from './hooks/useNodesEdgesState';
9
+ export { useStore, useStoreApi } from './hooks/useStore';
9
10
  export { internalsSymbol } from './utils';
10
11
  export * from './types';
11
12
  export type { XYPosition, XYZPosition, Dimensions, CoordinateExtent, Connection, Transform, Rect, Box, GetStepPosition, GetStepPathParams, GetBezierPathParams, GetControlWithCurvatureParams, } from 'cosmos-diagram';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["react-diagram/packages/react/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACJ,KAAK,EACL,WAAW,EACX,eAAe,EACf,mBAAmB,EACnB,aAAa,EACb,SAAS,EACT,SAAS,EACT,UAAU,EACV,UAAU,EACV,OAAO,EACP,UAAU,GACZ,MAAM,gBAAgB,CAAC;AAExB,OAAO,YAAY,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEpF,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAElE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAEtE,cAAc,4BAA4B,CAAC;AAK3C,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAI1C,cAAc,SAAS,CAAC;AAGxB,YAAY,EACT,UAAU,EACV,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,SAAS,EACT,IAAI,EACJ,GAAG,EACH,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,6BAA6B,GAC/B,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAEhE,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["react-diagram/packages/react/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACJ,KAAK,EACL,WAAW,EACX,eAAe,EACf,mBAAmB,EACnB,aAAa,EACb,SAAS,EACT,SAAS,EACT,UAAU,EACV,UAAU,EACV,OAAO,EACP,UAAU,GACZ,MAAM,gBAAgB,CAAC;AAExB,OAAO,YAAY,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEpF,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAElE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAEtE,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAIzD,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAI1C,cAAc,SAAS,CAAC;AAGxB,YAAY,EACT,UAAU,EACV,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,SAAS,EACT,IAAI,EACJ,GAAG,EACH,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,6BAA6B,GAC/B,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAEhE,eAAe,YAAY,CAAC"}
package/dist/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client"
2
- import { errorMessages, CosmosPanZoom, CosmosDrag, getRectOfNodes, getEventPosition, getNodesInside, Position, internalsSymbol as internalsSymbol$1, MarkerType, getMarkerId, isNumeric, getStraightPath, getStepPath, getBezierPath, CosmosPort, devWarn, isMouseEvent, clampPosition, getNodePositionWithOrigin, getDimensions, getPortBounds } from 'cosmos-diagram';
2
+ import { errorMessages, CosmosPanZoom, CosmosDrag, getRectOfNodes, getEventPosition, getNodesInside, Position, internalsSymbol as internalsSymbol$1, MarkerType, getMarkerId, isNumeric, getStraightPath, getStepPath, getBezierPath, CosmosPort, devWarn, isMouseEvent, createNodeInternals, getDimensions, getPortBounds, updateAbsoluteNodePositions, clampPosition, isIntersected } from 'cosmos-diagram';
3
3
  export { MarkerType, Position, addEdge, boxToRect, clamp, getBezierEdgeCenter, getBezierPath, getStepPath, getStraightPath, isCoreEdge, isCoreNode, rectToBox, updateEdge } from 'cosmos-diagram';
4
4
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
5
5
  import { createContext, useContext, useMemo, useState, useEffect, useRef, memo, useCallback, forwardRef } from 'react';
@@ -60,7 +60,7 @@ const useGlobalKeyHandler = (multiSelectionKeyCode = 'Meta') => {
60
60
  }, [multiSelectionActivate]);
61
61
  };
62
62
 
63
- const Pane = ({ noPanClassName, panning, selection, minZoom, maxZoom, defaultViewport, translateExtent, children, onMove, onMoveStart, onMoveEnd, }) => {
63
+ const Pane = ({ noPanClassName, panning, selection, minZoom, maxZoom, defaultViewport, translateExtent, children, onMove, onMoveStart, onMoveEnd, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, }) => {
64
64
  const store = useStoreApi();
65
65
  const Pane = useRef(null);
66
66
  const cosmosPanZoom = useRef();
@@ -77,27 +77,13 @@ const Pane = ({ noPanClassName, panning, selection, minZoom, maxZoom, defaultVie
77
77
  onTransformChange: (transform) => {
78
78
  store.setState({ transform });
79
79
  },
80
- onPanningChange: (panning) => {
81
- console.log(panning);
82
- },
83
- onPanZoomStart: (event, viewport) => {
84
- onMoveStart?.(event, viewport);
85
- console.log('start', viewport);
86
- },
87
- onPanZoom: (event, viewport) => {
88
- onMove?.(event, viewport);
89
- },
90
- onPanZoomEnd: (event, viewport) => {
91
- console.log('end', viewport);
92
- onMoveEnd?.(event, viewport);
93
- },
80
+ onPaneClick,
81
+ onPanZoomStart: onMoveStart,
82
+ onPanZoom: onMove,
83
+ onPanZoomEnd: onMoveEnd,
94
84
  });
95
85
  const { x, y, zoom } = cosmosPanZoom.current.getViewport();
96
86
  store.setState({
97
- // 지워야할 목록
98
- // d3Zoom: d3ZoomInstance,
99
- // d3Selection: selection,
100
- // we need to pass transform because zoom handler is not registered when we set the initial transform
101
87
  transform: [x, y, zoom],
102
88
  domNode: Pane.current.closest('.react-diagram'),
103
89
  });
@@ -114,7 +100,7 @@ const Pane = ({ noPanClassName, panning, selection, minZoom, maxZoom, defaultVie
114
100
  return (jsx("div", { ref: Pane, className: cc([
115
101
  'react-diagram__pane react-diagram__container',
116
102
  { selection },
117
- ]), children: children }));
103
+ ]), onMouseEnter: onPaneMouseEnter, onMouseMove: onPaneMouseMove, onMouseLeave: onPaneMouseLeave, children: children }));
118
104
  };
119
105
 
120
106
  const selector$7 = (s) => `translate(${s.transform[0]}px,${s.transform[1]}px) scale(${s.transform[2]})`;
@@ -367,7 +353,7 @@ const selector$6 = (s) => {
367
353
  selectionBoxActive,
368
354
  };
369
355
  };
370
- function DragSelection({ dragSelectionKeyPressed, children, }) {
356
+ function DragSelection({ isSelecting, children }) {
371
357
  const store = useStoreApi();
372
358
  const dragSelection = useRef(null);
373
359
  const prevSelectedNodesCount = useRef(0);
@@ -416,7 +402,7 @@ function DragSelection({ dragSelectionKeyPressed, children, }) {
416
402
  event.button !== 0 ||
417
403
  event.target !== dragSelection.current ||
418
404
  !containerBounds.current ||
419
- !dragSelectionKeyPressed) {
405
+ !isSelecting) {
420
406
  return;
421
407
  }
422
408
  const { x, y } = getEventPosition(event.nativeEvent, containerBounds.current);
@@ -437,7 +423,7 @@ function DragSelection({ dragSelectionKeyPressed, children, }) {
437
423
  const hasDragBoxStartPosition = dragBoxStartPosition.x > 0 && dragBoxStartPosition.y > 0;
438
424
  if (
439
425
  // !hasDragBoxPosition ||
440
- // !dragSelectionKeyPressed ||
426
+ // !isSelecting ||
441
427
  !hasDragBoxStartPosition ||
442
428
  !containerBounds.current) {
443
429
  return;
@@ -476,9 +462,12 @@ function DragSelection({ dragSelectionKeyPressed, children, }) {
476
462
  const onMouseLeave = () => {
477
463
  resetDragBox();
478
464
  };
479
- const isPossibleDragSelection = elementsSelectable;
465
+ const isPossibleDragSelection = elementsSelectable && isSelecting;
480
466
  return (jsxs("div", { ref: dragSelection, className: cc([
481
467
  'react-diagram__container react-diagram__drag-selection',
468
+ {
469
+ active: isPossibleDragSelection || selectionBoxActive,
470
+ },
482
471
  ]), onClick: onClick, onMouseDown: isPossibleDragSelection ? onMouseDown : undefined, onMouseMove: isPossibleDragSelection ? onMouseMove : undefined, onMouseUp: elementsSelectable ? onMouseUp : undefined, onMouseLeave: isPossibleDragSelection ? onMouseLeave : undefined, children: [children, dragBoxActive && jsx(DragBox, { rect: dragBoxRect }), selectionBoxActive && (jsx(SelectionBox$1, { rect: selectionBoxRect, transform: transformString }))] }));
483
472
  }
484
473
 
@@ -512,14 +501,14 @@ const selector$5 = (s) => {
512
501
  translateExtent,
513
502
  };
514
503
  };
515
- function DiagramRenderer({ children, multiSelectionKeyCode, dragSelectionKeyCode, noPanClassName, panning, defaultViewport, onMove, onMoveStart, onMoveEnd, }) {
504
+ function DiagramRenderer({ children, multiSelectionKeyCode, dragSelectionKeyCode, noPanClassName, panning, defaultViewport, onMove, onMoveStart, onMoveEnd, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, }) {
516
505
  const { minZoom, maxZoom, translateExtent } = useStore(selector$5);
517
506
  useGlobalKeyHandler(multiSelectionKeyCode);
518
507
  const dragSelectionKeyPressed = useDragSelectionKeyPress(dragSelectionKeyCode);
519
508
  // useKeyPress
520
509
  const isSelecting = dragSelectionKeyPressed;
521
510
  const isPanning = panning && !isSelecting;
522
- return (jsx(Fragment, { children: jsx(Pane, { noPanClassName: noPanClassName, panning: isPanning, selection: isSelecting, minZoom: minZoom, maxZoom: maxZoom, translateExtent: translateExtent, defaultViewport: defaultViewport, onMove: onMove, onMoveStart: onMoveStart, onMoveEnd: onMoveEnd, children: jsx(DragSelection, { dragSelectionKeyPressed: dragSelectionKeyPressed, children: jsx(Viewport, { children: children }) }) }) }));
511
+ return (jsx(Fragment, { children: jsx(Pane, { noPanClassName: noPanClassName, panning: isPanning, selection: isSelecting, minZoom: minZoom, maxZoom: maxZoom, translateExtent: translateExtent, defaultViewport: defaultViewport, onMove: onMove, onMoveStart: onMoveStart, onMoveEnd: onMoveEnd, onPaneClick: onPaneClick, onPaneMouseEnter: onPaneMouseEnter, onPaneMouseMove: onPaneMouseMove, onPaneMouseLeave: onPaneMouseLeave, children: jsx(DragSelection, { isSelecting: isSelecting, children: jsx(Viewport, { children: children }) }) }) }));
523
512
  }
524
513
  DiagramRenderer.displayName = 'DiagramRenderer';
525
514
  var DiagramRenderer$1 = memo(DiagramRenderer);
@@ -1136,14 +1125,14 @@ function ConnectionLineRenderer({ containerStyle, edgeTypes, component, }) {
1136
1125
 
1137
1126
  function DiagramView({ rfId,
1138
1127
  // DiagramRenderer props
1139
- noPanClassName, panning, defaultViewport, multiSelectionKeyCode, dragSelectionKeyCode, onMove, onMoveStart, onMoveEnd,
1128
+ noPanClassName, panning, defaultViewport, multiSelectionKeyCode, dragSelectionKeyCode,
1140
1129
  // NodeRenderer props
1141
1130
  onlyRenderVisibleElements, disableKeyboardA11y, noDragClassName, nodeOrigin, nodeExtent, nodeTypes, onNodeClick, onNodeDoubleClick, onNodeContextMenu, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave,
1142
1131
  // EdgeRenderer props
1143
- edgeTypes, edgeUpdaterRadius, onEdgeClick, onEdgeDoubleClick, onEdgeContextMenu, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, onEdgeUpdate, onEdgeUpdateStart, onEdgeUpdateEnd,
1132
+ edgeTypes, edgeUpdaterRadius, onEdgeClick, onEdgeDoubleClick, onEdgeContextMenu, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, onEdgeUpdate, onEdgeUpdateStart, onEdgeUpdateEnd, onMove, onMoveStart, onMoveEnd, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave,
1144
1133
  // ConnectionLineWrapper
1145
1134
  ConnectionLineContainerStyle, ConnectionLineComponent, }) {
1146
- return (jsxs(DiagramRenderer$1, { multiSelectionKeyCode: multiSelectionKeyCode, dragSelectionKeyCode: dragSelectionKeyCode, noPanClassName: noPanClassName, panning: panning, defaultViewport: defaultViewport, onMove: onMove, onMoveStart: onMoveStart, onMoveEnd: onMoveEnd, children: [jsx(NodeRenderer$1, { rfId: rfId, nodeTypes: nodeTypes, onlyRenderVisibleElements: onlyRenderVisibleElements, disableKeyboardA11y: disableKeyboardA11y, nodeOrigin: nodeOrigin, nodeExtent: nodeExtent, noDragClassName: noDragClassName, noPanClassName: noPanClassName, onNodeClick: onNodeClick, onNodeDoubleClick: onNodeDoubleClick, onNodeContextMenu: onNodeContextMenu, onNodeMouseEnter: onNodeMouseEnter, onNodeMouseMove: onNodeMouseMove, onNodeMouseLeave: onNodeMouseLeave }), jsx(EdgeRenderer$1, { rfId: rfId, edgeTypes: edgeTypes, noPanClassName: noPanClassName, edgeUpdaterRadius: edgeUpdaterRadius, onEdgeClick: onEdgeClick, onEdgeDoubleClick: onEdgeDoubleClick, onEdgeContextMenu: onEdgeContextMenu, onEdgeMouseEnter: onEdgeMouseEnter, onEdgeMouseMove: onEdgeMouseMove, onEdgeMouseLeave: onEdgeMouseLeave, onEdgeUpdate: onEdgeUpdate, onEdgeUpdateStart: onEdgeUpdateStart, onEdgeUpdateEnd: onEdgeUpdateEnd }), jsx(ConnectionLineRenderer, { edgeTypes: edgeTypes, containerStyle: ConnectionLineContainerStyle, component: ConnectionLineComponent })] }));
1135
+ return (jsxs(DiagramRenderer$1, { multiSelectionKeyCode: multiSelectionKeyCode, dragSelectionKeyCode: dragSelectionKeyCode, noPanClassName: noPanClassName, panning: panning, defaultViewport: defaultViewport, onMove: onMove, onMoveStart: onMoveStart, onMoveEnd: onMoveEnd, onPaneClick: onPaneClick, onPaneMouseEnter: onPaneMouseEnter, onPaneMouseMove: onPaneMouseMove, onPaneMouseLeave: onPaneMouseLeave, children: [jsx(NodeRenderer$1, { rfId: rfId, nodeTypes: nodeTypes, onlyRenderVisibleElements: onlyRenderVisibleElements, disableKeyboardA11y: disableKeyboardA11y, nodeOrigin: nodeOrigin, nodeExtent: nodeExtent, noDragClassName: noDragClassName, noPanClassName: noPanClassName, onNodeClick: onNodeClick, onNodeDoubleClick: onNodeDoubleClick, onNodeContextMenu: onNodeContextMenu, onNodeMouseEnter: onNodeMouseEnter, onNodeMouseMove: onNodeMouseMove, onNodeMouseLeave: onNodeMouseLeave }), jsx(EdgeRenderer$1, { rfId: rfId, edgeTypes: edgeTypes, noPanClassName: noPanClassName, edgeUpdaterRadius: edgeUpdaterRadius, onEdgeClick: onEdgeClick, onEdgeDoubleClick: onEdgeDoubleClick, onEdgeContextMenu: onEdgeContextMenu, onEdgeMouseEnter: onEdgeMouseEnter, onEdgeMouseMove: onEdgeMouseMove, onEdgeMouseLeave: onEdgeMouseLeave, onEdgeUpdate: onEdgeUpdate, onEdgeUpdateStart: onEdgeUpdateStart, onEdgeUpdateEnd: onEdgeUpdateEnd }), jsx(ConnectionLineRenderer, { edgeTypes: edgeTypes, containerStyle: ConnectionLineContainerStyle, component: ConnectionLineComponent })] }));
1147
1136
  }
1148
1137
  DiagramView.displayName = 'DiagramView';
1149
1138
  var DiagramView$1 = memo(DiagramView);
@@ -1279,7 +1268,10 @@ function Nodes({ data }) {
1279
1268
  }
1280
1269
 
1281
1270
  const wrapNode = (NodeComponent) => {
1282
- function NodeWrapper({ id, type, data, positionX, positionY, sourcePosition, targetPosition, onClick, onMouseEnter, onMouseMove, onMouseLeave, onContextMenu, onDoubleClick, style, width, height, className, selected, isSelectable, isDraggable, intersected, nodeOrigin, nodeExtent, hidden, resizeObserver, dragHandle, zIndex, isParent, initialized, disableKeyboardA11y, ariaLabel, rfId, noDragClassName, noPanClassName, }) {
1271
+ function NodeWrapper({ id, type, data, positionX, positionY, sourcePosition, targetPosition, onClick, onMouseEnter, onMouseMove, onMouseLeave, onContextMenu, onDoubleClick, style, width, height, className, selected, isSelectable, isDraggable, intersected,
1272
+ // nodeOrigin,
1273
+ // nodeExtent,
1274
+ hidden, resizeObserver, dragHandle, zIndex, isParent, initialized, disableKeyboardA11y, ariaLabel, rfId, noDragClassName, noPanClassName, }) {
1283
1275
  const store = useStoreApi();
1284
1276
  const node = store.getState().nodeInternals.get(id);
1285
1277
  const nodeRef = useRef(null);
@@ -1330,10 +1322,13 @@ const wrapNode = (NodeComponent) => {
1330
1322
  ]);
1331
1323
  }
1332
1324
  }, [id, type, sourcePosition, targetPosition]);
1333
- const clampedPosition = nodeExtent
1334
- ? clampPosition(node.positionAbsolute, nodeExtent)
1335
- : node.positionAbsolute;
1336
- const positionWithOrigin = getNodePositionWithOrigin({ ...node, ...clampedPosition }, nodeOrigin);
1325
+ // const clampedPosition = nodeExtent
1326
+ // ? clampPosition(node.positionAbsolute, nodeExtent)
1327
+ // : node.positionAbsolute;
1328
+ // const positionWithOrigin = getNodePositionWithOrigin(
1329
+ // { ...node, ...clampedPosition },
1330
+ // nodeOrigin,
1331
+ // );
1337
1332
  const dragging = useDrag({
1338
1333
  nodeRef,
1339
1334
  nodeId: id,
@@ -1360,7 +1355,8 @@ const wrapNode = (NodeComponent) => {
1360
1355
  ]);
1361
1356
  const wrapperStyle = {
1362
1357
  zIndex,
1363
- transform: `translate(${positionWithOrigin.x}px,${positionWithOrigin.y}px)`,
1358
+ // transform: `translate(${positionWithOrigin.positionAbsolute.x}px,${positionWithOrigin.positionAbsolute.y}px)`,
1359
+ transform: `translate(${positionX}px,${positionY}px)`,
1364
1360
  pointerEvents: hasPointerEvents ? 'all' : 'none',
1365
1361
  visibility: initialized ? 'visible' : 'hidden',
1366
1362
  width,
@@ -1404,99 +1400,6 @@ const createNodeTypes = (nodeTypes) => {
1404
1400
  };
1405
1401
  };
1406
1402
 
1407
- function calculateXYZPosition(node, nodeInternals, result, nodeOrigin) {
1408
- if (!node.parentNode) {
1409
- return result;
1410
- }
1411
- const parentNode = nodeInternals.get(node.parentNode);
1412
- const parentNodePosition = getNodePositionWithOrigin(parentNode, nodeOrigin);
1413
- return calculateXYZPosition(parentNode, nodeInternals, {
1414
- x: (result.x ?? 0) + parentNodePosition.x,
1415
- y: (result.y ?? 0) + parentNodePosition.y,
1416
- z: (parentNode[internalsSymbol$1]?.z ?? 0) > (result.z ?? 0)
1417
- ? parentNode[internalsSymbol$1]?.z ?? 0
1418
- : result.z ?? 0,
1419
- }, nodeOrigin);
1420
- }
1421
- function updateAbsoluteNodePositions(nodeInternals, nodeOrigin, parentNodes) {
1422
- nodeInternals.forEach((node) => {
1423
- if (node.parentNode && !nodeInternals.has(node.parentNode)) {
1424
- throw new Error(`Parent node ${node.parentNode} not found`);
1425
- }
1426
- if (node.parentNode || parentNodes?.[node.id]) {
1427
- const { x, y, z } = calculateXYZPosition(node, nodeInternals, {
1428
- ...node.position,
1429
- z: node[internalsSymbol$1]?.z ?? 0,
1430
- }, nodeOrigin);
1431
- node.positionAbsolute = {
1432
- x,
1433
- y,
1434
- };
1435
- node[internalsSymbol$1].z = z;
1436
- if (parentNodes?.[node.id]) {
1437
- node[internalsSymbol$1].isParent = true;
1438
- }
1439
- }
1440
- });
1441
- }
1442
- function createNodeInternals(nodes, nodeInternals, nodeOrigin, elevateNodesOnSelect) {
1443
- const nextNodeInternals = new Map();
1444
- const parentNodes = {};
1445
- const selectedNodeZ = elevateNodesOnSelect ? 1000 : 0;
1446
- nodes.forEach((node) => {
1447
- const z = (isNumeric(node.zIndex) ? node.zIndex : 0) +
1448
- (node.selected ? selectedNodeZ : 0);
1449
- const currInternals = nodeInternals.get(node.id);
1450
- const internals = {
1451
- width: currInternals?.width,
1452
- height: currInternals?.height,
1453
- ...node,
1454
- positionAbsolute: {
1455
- x: node.position.x,
1456
- y: node.position.y,
1457
- },
1458
- };
1459
- if (node.parentNode) {
1460
- internals.parentNode = node.parentNode;
1461
- parentNodes[node.parentNode] = true;
1462
- }
1463
- Object.defineProperty(internals, internalsSymbol$1, {
1464
- enumerable: false,
1465
- value: {
1466
- portBounds: currInternals?.[internalsSymbol$1]?.portBounds,
1467
- z,
1468
- },
1469
- });
1470
- nextNodeInternals.set(node.id, internals);
1471
- });
1472
- updateAbsoluteNodePositions(nextNodeInternals, nodeOrigin, parentNodes);
1473
- return nextNodeInternals;
1474
- }
1475
- const isIntersected = (targetNode, nodeInternals) => {
1476
- const { id, width, height, positionAbsolute } = targetNode;
1477
- if (!width || !height)
1478
- return false;
1479
- let intersected = false;
1480
- for (const [key, sourceNode] of nodeInternals) {
1481
- if (id === key)
1482
- continue;
1483
- const { positionAbsolute: sPositionAbsolute, width: sWidth, height: sHeight, } = sourceNode;
1484
- if (!sWidth || !sHeight)
1485
- continue;
1486
- if (!sPositionAbsolute || !positionAbsolute)
1487
- continue;
1488
- // if (sourceNode.parentNode === targetNode.id) continue;
1489
- // if (targetNode.parentNode === sourceNode.id) continue;
1490
- const leftIn = sPositionAbsolute.x + sWidth >= positionAbsolute.x, rightIn = positionAbsolute.x + width >= sPositionAbsolute.x, topIn = sPositionAbsolute.y + sHeight >= positionAbsolute.y, bottomIn = positionAbsolute.y + height >= sPositionAbsolute.y;
1491
- const isIn = leftIn && rightIn && topIn && bottomIn;
1492
- if (isIn) {
1493
- intersected = true;
1494
- break;
1495
- }
1496
- }
1497
- return intersected;
1498
- };
1499
-
1500
1403
  const infiniteExtent = [
1501
1404
  [Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY],
1502
1405
  [Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY],
@@ -1706,7 +1609,7 @@ const createRCDStore = () => createStore((set, get) => ({
1706
1609
  setNodeExtent: (nodeExtent) => {
1707
1610
  const { nodeInternals } = get();
1708
1611
  nodeInternals.forEach((node) => {
1709
- node.positionAbsolute = clampPosition(node.position, nodeExtent);
1612
+ node.positionAbsolute = clampPosition(node.positionAbsolute, nodeExtent);
1710
1613
  });
1711
1614
  set({
1712
1615
  nodeExtent,
@@ -1757,13 +1660,13 @@ const defaultEdgeTypes = {
1757
1660
  };
1758
1661
  const ReactDiagram = forwardRef(({ children, id,
1759
1662
  // DiagramView props
1760
- panning = true, minZoom, maxZoom, translateExtent, nodeExtent = infiniteExtent, defaultViewport = initViewport, multiSelectionKeyCode = 'Meta', dragSelectionKeyCode = 'Shift', onlyRenderVisibleElements = false, disableKeyboardA11y = false, noDragClassName = 'nodrag', noPanClassName = 'nopan', nodeOrigin = initNodeOrigin, nodeTypes = defaultNodeTypes, onNodeClick, onNodeDoubleClick, onNodeContextMenu, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave, edgeTypes = defaultEdgeTypes, edgeUpdaterRadius, onEdgeClick, onEdgeDoubleClick, onEdgeContextMenu, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, onEdgeUpdate, onEdgeUpdateStart, onEdgeUpdateEnd, onMove, onMoveStart, onMoveEnd, ConnectionLineContainerStyle, ConnectionLineComponent,
1663
+ panning = true, minZoom, maxZoom, translateExtent, nodeExtent = infiniteExtent, defaultViewport = initViewport, multiSelectionKeyCode = 'Meta', dragSelectionKeyCode = 'Shift', onlyRenderVisibleElements = false, disableKeyboardA11y = false, noDragClassName = 'nodrag', noPanClassName = 'nopan', nodeOrigin = initNodeOrigin, nodeTypes = defaultNodeTypes, onNodeClick, onNodeDoubleClick, onNodeContextMenu, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave, edgeTypes = defaultEdgeTypes, edgeUpdaterRadius, onEdgeClick, onEdgeDoubleClick, onEdgeContextMenu, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, onEdgeUpdate, onEdgeUpdateStart, onEdgeUpdateEnd, ConnectionLineContainerStyle, ConnectionLineComponent,
1761
1664
  // StoreUpdater props
1762
- nodes, edges, nodesDraggable, elevateNodesOnSelect, autoPanOnNodeDrag, autoPanOnConnect, connectionRadius, smoothStep, centerStep, gridStep, onNodesChange, onNodeDrag, onNodeDragStart, onNodeDragEnd, onEdgesChange, onConnect, onConnectStart, onConnectEnd, onError, ...rest }, ref) => {
1665
+ nodes, edges, nodesDraggable, elevateNodesOnSelect, autoPanOnNodeDrag, autoPanOnConnect, connectionRadius, smoothStep, centerStep, gridStep, onNodesChange, onNodeDrag, onNodeDragStart, onNodeDragEnd, onEdgesChange, onConnect, onConnectStart, onConnectEnd, onMove, onMoveStart, onMoveEnd, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onError, ...rest }, ref) => {
1763
1666
  const rfId = id || '1';
1764
1667
  const nodeTypesWrapped = useNodeOrEdgeTypes(nodeTypes, createNodeTypes);
1765
1668
  const edgeTypesWrapped = useNodeOrEdgeTypes(edgeTypes, createEdgeTypes);
1766
- return (jsx("div", { ...rest, ref: ref, className: "react-diagram", children: jsxs(Wrapper, { children: [jsx(DiagramView$1, { rfId: rfId, panning: panning, defaultViewport: defaultViewport, multiSelectionKeyCode: multiSelectionKeyCode, dragSelectionKeyCode: dragSelectionKeyCode, onlyRenderVisibleElements: onlyRenderVisibleElements, disableKeyboardA11y: disableKeyboardA11y, noDragClassName: noDragClassName, noPanClassName: noPanClassName, nodeOrigin: nodeOrigin, nodeExtent: nodeExtent, nodeTypes: nodeTypesWrapped, edgeTypes: edgeTypesWrapped, edgeUpdaterRadius: edgeUpdaterRadius, ConnectionLineContainerStyle: ConnectionLineContainerStyle, ConnectionLineComponent: ConnectionLineComponent, onNodeClick: onNodeClick, onNodeDoubleClick: onNodeDoubleClick, onNodeContextMenu: onNodeContextMenu, onNodeMouseEnter: onNodeMouseEnter, onNodeMouseMove: onNodeMouseMove, onNodeMouseLeave: onNodeMouseLeave, onEdgeClick: onEdgeClick, onEdgeDoubleClick: onEdgeDoubleClick, onEdgeContextMenu: onEdgeContextMenu, onEdgeMouseEnter: onEdgeMouseEnter, onEdgeMouseMove: onEdgeMouseMove, onEdgeMouseLeave: onEdgeMouseLeave, onEdgeUpdate: onEdgeUpdate, onEdgeUpdateStart: onEdgeUpdateStart, onEdgeUpdateEnd: onEdgeUpdateEnd, onMove: onMove, onMoveStart: onMoveStart, onMoveEnd: onMoveEnd }), jsx(StoreUpdater, { rfId: rfId, nodes: nodes, edges: edges, nodesDraggable: nodesDraggable, elevateNodesOnSelect: elevateNodesOnSelect, autoPanOnNodeDrag: autoPanOnNodeDrag, autoPanOnConnect: autoPanOnConnect, connectionRadius: connectionRadius, nodeOrigin: nodeOrigin, nodeExtent: nodeExtent, translateExtent: translateExtent, minZoom: minZoom, maxZoom: maxZoom, smoothStep: smoothStep, centerStep: centerStep, gridStep: gridStep, onNodesChange: onNodesChange, onNodeDrag: onNodeDrag, onNodeDragStart: onNodeDragStart, onNodeDragEnd: onNodeDragEnd, onEdgesChange: onEdgesChange, onConnect: onConnect, onConnectStart: onConnectStart, onConnectEnd: onConnectEnd, onError: onError }), children] }) }));
1669
+ return (jsx("div", { ...rest, ref: ref, className: "react-diagram", children: jsxs(Wrapper, { children: [jsx(DiagramView$1, { rfId: rfId, panning: panning, defaultViewport: defaultViewport, multiSelectionKeyCode: multiSelectionKeyCode, dragSelectionKeyCode: dragSelectionKeyCode, onlyRenderVisibleElements: onlyRenderVisibleElements, disableKeyboardA11y: disableKeyboardA11y, noDragClassName: noDragClassName, noPanClassName: noPanClassName, nodeOrigin: nodeOrigin, nodeExtent: nodeExtent, nodeTypes: nodeTypesWrapped, edgeTypes: edgeTypesWrapped, edgeUpdaterRadius: edgeUpdaterRadius, ConnectionLineContainerStyle: ConnectionLineContainerStyle, ConnectionLineComponent: ConnectionLineComponent, onNodeClick: onNodeClick, onNodeDoubleClick: onNodeDoubleClick, onNodeContextMenu: onNodeContextMenu, onNodeMouseEnter: onNodeMouseEnter, onNodeMouseMove: onNodeMouseMove, onNodeMouseLeave: onNodeMouseLeave, onEdgeClick: onEdgeClick, onEdgeDoubleClick: onEdgeDoubleClick, onEdgeContextMenu: onEdgeContextMenu, onEdgeMouseEnter: onEdgeMouseEnter, onEdgeMouseMove: onEdgeMouseMove, onEdgeMouseLeave: onEdgeMouseLeave, onEdgeUpdate: onEdgeUpdate, onEdgeUpdateStart: onEdgeUpdateStart, onEdgeUpdateEnd: onEdgeUpdateEnd, onMove: onMove, onMoveStart: onMoveStart, onMoveEnd: onMoveEnd, onPaneClick: onPaneClick, onPaneMouseEnter: onPaneMouseEnter, onPaneMouseMove: onPaneMouseMove, onPaneMouseLeave: onPaneMouseLeave }), jsx(StoreUpdater, { rfId: rfId, nodes: nodes, edges: edges, nodesDraggable: nodesDraggable, elevateNodesOnSelect: elevateNodesOnSelect, autoPanOnNodeDrag: autoPanOnNodeDrag, autoPanOnConnect: autoPanOnConnect, connectionRadius: connectionRadius, nodeOrigin: nodeOrigin, nodeExtent: nodeExtent, translateExtent: translateExtent, minZoom: minZoom, maxZoom: maxZoom, smoothStep: smoothStep, centerStep: centerStep, gridStep: gridStep, onNodesChange: onNodesChange, onNodeDrag: onNodeDrag, onNodeDragStart: onNodeDragStart, onNodeDragEnd: onNodeDragEnd, onEdgesChange: onEdgesChange, onConnect: onConnect, onConnectStart: onConnectStart, onConnectEnd: onConnectEnd, onError: onError }), children] }) }));
1767
1670
  });
1768
1671
  ReactDiagram.displayName = 'ReactDiagram';
1769
1672
 
@@ -1808,4 +1711,4 @@ function Background({ gap, lineWidth = 1, color = '#000000', }) {
1808
1711
  Background.displayName = 'Background';
1809
1712
  var index = memo(Background);
1810
1713
 
1811
- export { index as Background, BaseEdge, BezierEdge, Port$1 as Port, ReactDiagramProvider, StepEdge, ReactDiagram as default, internalsSymbol, useEdgesState, useNodesState };
1714
+ export { index as Background, BaseEdge, BezierEdge, Port$1 as Port, ReactDiagramProvider, StepEdge, ReactDiagram as default, internalsSymbol, useEdgesState, useNodesState, useStore, useStoreApi };