From 5e5655f1881a3724070d44eb09327e29cb9f99ad Mon Sep 17 00:00:00 2001 From: Khwaja Date: Wed, 11 Jun 2025 10:45:24 -0500 Subject: [PATCH 01/24] Added CircularData interface under casebuilder to add a sense organization for the new circular model --- web/src/components/CaseBuilder/CircularData.ts | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 web/src/components/CaseBuilder/CircularData.ts diff --git a/web/src/components/CaseBuilder/CircularData.ts b/web/src/components/CaseBuilder/CircularData.ts new file mode 100644 index 0000000..e69de29 From eb2003a05952b109ed157aa811aa5f022f14a350 Mon Sep 17 00:00:00 2001 From: Khwaja Date: Wed, 11 Jun 2025 11:53:59 -0500 Subject: [PATCH 02/24] Re-adding the CircularData.ts file --- RELOG | 1 + .../components/CaseBuilder/CircularData.ts | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 160000 RELOG diff --git a/RELOG b/RELOG new file mode 160000 index 0000000..5ea3e10 --- /dev/null +++ b/RELOG @@ -0,0 +1 @@ +Subproject commit 5ea3e10139afdf0fc6e721a000dc5bc29a975ac4 diff --git a/web/src/components/CaseBuilder/CircularData.ts b/web/src/components/CaseBuilder/CircularData.ts index e69de29..ad569d7 100644 --- a/web/src/components/CaseBuilder/CircularData.ts +++ b/web/src/components/CaseBuilder/CircularData.ts @@ -0,0 +1,23 @@ +export interface CircularPlant { + id: string; + x: number; + y: number; + + input?: string; // optional product name + +} + +export interface CircularProduct { + id: string; + x: number; + y: number; +} + +export interface CircularData { + plants: Record; + + products: Record; + + parameters: Record; // Any parameters, ex: simulation years, costs + +} \ No newline at end of file From 936d9e820da08bfbb5764643fbd414fe42c01ac1 Mon Sep 17 00:00:00 2001 From: Khwaja Date: Wed, 11 Jun 2025 14:15:48 -0500 Subject: [PATCH 03/24] removed RELOG submodule --- RELOG | 1 - 1 file changed, 1 deletion(-) delete mode 160000 RELOG diff --git a/RELOG b/RELOG deleted file mode 160000 index 5ea3e10..0000000 --- a/RELOG +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5ea3e10139afdf0fc6e721a000dc5bc29a975ac4 From 6d75a6039bb73ac1e26ef30e500fa147d63c6a7c Mon Sep 17 00:00:00 2001 From: Khwaja Date: Mon, 16 Jun 2025 11:20:13 -0500 Subject: [PATCH 04/24] Added functions for circular UI --- .../components/CaseBuilder/CaseBuilder.tsx | 55 +++++++++++++++++++ .../components/CaseBuilder/CircularData.ts | 2 - 2 files changed, 55 insertions(+), 2 deletions(-) diff --git a/web/src/components/CaseBuilder/CaseBuilder.tsx b/web/src/components/CaseBuilder/CaseBuilder.tsx index 214ffdf..be7b1d4 100644 --- a/web/src/components/CaseBuilder/CaseBuilder.tsx +++ b/web/src/components/CaseBuilder/CaseBuilder.tsx @@ -9,12 +9,67 @@ import Header from "./Header"; import "tabulator-tables/dist/css/tabulator.min.css"; import "../Common/Forms/Tables.css"; import Footer from "./Footer"; +import React, { useState } from "react"; +import {CircularData} from "./CircularData.ts"; + +declare global { + interface Window { + nextX: number; + nextY: number; + } + } const CaseBuilder = () => { + const [circularData, setCircularData] = useState ( { + plants: {}, + products: {} + +}); const onClear = () => {}; const onSave = () => {}; const onLoad = () => {}; + + + const randomPosition = (): [number,number] => { + if (window.nextX === undefined) window.nextX = 15; + if (window.nextY === undefined) window.nextY = 15; + + window.nextY +=60; + if (window.nextY >=500) { + window.nextY = 15; + window.nextX += 150; + + } + return [window.nextX, window.nextY] + + } + + const promptName = (prevData:CircularData): string | undefined => { + const name = prompt("Name"); + if (!name || name.length ===0) return; + if (name in prevData.products || name in prevData.plants) return; + return name; + + }; + + const onAddPlant = () => { + setCircularData((prevData) => { + const id = promptName(prevData); + if (id ==undefined) return prevData; + const newData = { ...prevData}; + const [x,y] = randomPosition(); + newData.plants[id] = { + ...defaultPlant, + x: x, + y: y, + + }; + onSave(newData); + return newData; + }); + } + return (
diff --git a/web/src/components/CaseBuilder/CircularData.ts b/web/src/components/CaseBuilder/CircularData.ts index ad569d7..785f933 100644 --- a/web/src/components/CaseBuilder/CircularData.ts +++ b/web/src/components/CaseBuilder/CircularData.ts @@ -3,7 +3,6 @@ export interface CircularPlant { x: number; y: number; - input?: string; // optional product name } @@ -18,6 +17,5 @@ export interface CircularData { products: Record; - parameters: Record; // Any parameters, ex: simulation years, costs } \ No newline at end of file From 357e3129b11c2f19b930eb802edddd3906619e6c Mon Sep 17 00:00:00 2001 From: Khwaja Date: Tue, 17 Jun 2025 11:15:41 -0500 Subject: [PATCH 05/24] Refactored the onAddPlant and onAddProduct setup, created typesafe interfaces for defaultPlant and defaultProduct, imported idex.css as well --- package-lock.json | 6 + .../components/CaseBuilder/CaseBuilder.tsx | 59 +++++++--- web/src/components/CaseBuilder/defaults.ts | 72 ++++++++++++ web/src/index.css | 109 ++++++++++++++++++ web/tsconfig.json | 3 +- 5 files changed, 233 insertions(+), 16 deletions(-) create mode 100644 package-lock.json create mode 100644 web/src/components/CaseBuilder/defaults.ts create mode 100644 web/src/index.css diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..9737715 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "RELOG", + "lockfileVersion": 3, + "requires": true, + "packages": {} +} diff --git a/web/src/components/CaseBuilder/CaseBuilder.tsx b/web/src/components/CaseBuilder/CaseBuilder.tsx index be7b1d4..9183a74 100644 --- a/web/src/components/CaseBuilder/CaseBuilder.tsx +++ b/web/src/components/CaseBuilder/CaseBuilder.tsx @@ -10,8 +10,9 @@ import "tabulator-tables/dist/css/tabulator.min.css"; import "../Common/Forms/Tables.css"; import Footer from "./Footer"; import React, { useState } from "react"; -import {CircularData} from "./CircularData.ts"; - +import {CircularData} from "./CircularData"; +import { defaultPlant, defaultProduct } from "./defaults"; +import "../../index.css"; declare global { interface Window { nextX: number; @@ -41,9 +42,9 @@ const CaseBuilder = () => { window.nextX += 150; } - return [window.nextX, window.nextY] + return [window.nextX, window.nextY]; - } + }; const promptName = (prevData:CircularData): string | undefined => { const name = prompt("Name"); @@ -57,23 +58,51 @@ const CaseBuilder = () => { setCircularData((prevData) => { const id = promptName(prevData); if (id ==undefined) return prevData; - const newData = { ...prevData}; const [x,y] = randomPosition(); - newData.plants[id] = { - ...defaultPlant, - x: x, - y: y, - - }; - onSave(newData); - return newData; + const newData: CircularData = { + ...prevData, + plants: { + ...prevData.plants, + [id]: { + ...defaultPlant, + x, + y, + } + } + }; + return newData; }); - } + }; + + const onAddProduct = () => { + setCircularData((prevData) => { + const id = promptName(prevData); + if (id ==undefined) return prevData; + const [x,y] = randomPosition(); + const newData: CircularData = { + ...prevData, + products: { + ...prevData.products, + [id]: { + ...defaultProduct, + x, + y, + } + } + }; + return newData; + }); + + }; return (
-
+
+
+
+
+
); diff --git a/web/src/components/CaseBuilder/defaults.ts b/web/src/components/CaseBuilder/defaults.ts new file mode 100644 index 0000000..183cc7b --- /dev/null +++ b/web/src/components/CaseBuilder/defaults.ts @@ -0,0 +1,72 @@ +import { CircularPlant, CircularProduct } from "./CircularData"; + +export interface DefaultProduct extends CircularProduct{ + "initial amounts": Record; + "acquisition cost ($/tonne)": string; + "disposal cost ($/tonne)": string; + "disposal limit (tonne)": string; + "disposal limit (%)": string; + "transportation cost ($/km/tonne)": string; + "transportation energy (J/km/tonne)": string; + "transportation emissions (tonne/km/tonne)": Record; + x: number; + y: number; +} + +export interface DefaultPlant extends CircularPlant{ + locations: Record; + "outputs (tonne/tonne)": Record; + "disposal cost ($/tonne)": Record; + "disposal limit (tonne)": Record; + "emissions (tonne/tonne)": Record; + storage: { + "cost ($/tonne)": string; + "limit (tonne)": string; + }; + "maximum capacity (tonne)": string; + "minimum capacity (tonne)": string; + "opening cost (max capacity) ($)": string; + "opening cost (min capacity) ($)": string; + "fixed operating cost (max capacity) ($)": string; + "fixed operating cost (min capacity) ($)": string; + "variable operating cost ($/tonne)": string; + "energy (GJ/tonne)": string; + x: number; + y: number; +} + +export const defaultProduct: DefaultProduct = { +"initial amounts": {}, + "acquisition cost ($/tonne)": "0", + "disposal cost ($/tonne)": "0", + "disposal limit (tonne)": "0", + "disposal limit (%)": "", + "transportation cost ($/km/tonne)": "0", + "transportation energy (J/km/tonne)": "0", + "transportation emissions (tonne/km/tonne)": {}, + x: 0, + y: 0, + +}; + +export const defaultPlant: DefaultPlant = { + locations: {}, + "outputs (tonne/tonne)": {}, + "disposal cost ($/tonne)": {}, + "disposal limit (tonne)": {}, + "emissions (tonne/tonne)": {}, + storage: { + "cost ($/tonne)": "0", + "limit (tonne)": "0", + }, + "maximum capacity (tonne)": "0", + "minimum capacity (tonne)": "0", + "opening cost (max capacity) ($)": "0", + "opening cost (min capacity) ($)": "0", + "fixed operating cost (max capacity) ($)": "0", + "fixed operating cost (min capacity) ($)": "0", + "variable operating cost ($/tonne)": "0", + "energy (GJ/tonne)": "0", + x: 0, + y: 0, +}; \ No newline at end of file diff --git a/web/src/index.css b/web/src/index.css new file mode 100644 index 0000000..b55e2ed --- /dev/null +++ b/web/src/index.css @@ -0,0 +1,109 @@ +:root { + --site-width: 1200px; + --box-border: 1px solid rgba(0, 0, 0, 0.2); + --box-shadow: 0px 2px 4px -3px rgba(0, 0, 0, 0.2); + --border-radius: 4px; + --primary: #0d6efd; +} + +html, +body { + margin: 0; + padding: 0; + border: 0; + font-family: sans-serif; +} + +body { + background-color: #333; + color: rgba(0, 0, 0, 0.95); +} + +#contentBackground { + background-color: #f6f6f6; +} + +#content { + max-width: var(--site-width); + min-width: 900px; + margin: 0 auto; + padding: 1px 6px 32px 6px; +} + +.react-flow__node.selected { + box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2) !important; + border-width: 2px !important; + margin-top: -1px !important; + margin-left: -1px !important; + border-radius: 8px !important; +} + +.react-flow__handle { + width: 6px !important; + height: 6px !important; + background-color: white !important; + border: 1px solid black !important; +} + +.react-flow__handle:hover { + background-color: black !important; +} + +.react-flow__handle-right { + right: -4px !important; +} + +.react-flow__handle-left { + left: -4px !important; +} + +#messageTray { + max-width: var(--site-width); + margin: 0 auto; + position: fixed; + bottom: 12px; + left: 0; + right: 0; + z-index: 100; +} + +#messageTray .message { + background-color: rgb(221, 69, 69); + color: #eee; + padding: 12px; + border-radius: var(--border-radius); + box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.4); + display: flex; + margin-top: 12px; +} + +#messageTray .message p { + flex: 1; + margin: 0; + padding: 12px 0; +} + +#messageTray .message button { + margin: 0; + background: transparent; + border: 1px solid #eee; + color: #eee; + float: right; + padding: 0 24px; + line-height: 6px; +} + +#messageTray .message button:hover { + background: rgba(255, 255, 255, 0.05); +} + +#messageTray .message button:active { + background: rgba(255, 255, 255, 0.1); +} + +.nodata { + text-align: center; + padding: 24px 0; + color: #888; + margin: 0; +} \ No newline at end of file diff --git a/web/tsconfig.json b/web/tsconfig.json index a5a6cae..13cc76e 100644 --- a/web/tsconfig.json +++ b/web/tsconfig.json @@ -29,7 +29,8 @@ "noUncheckedIndexedAccess": true, "noUnusedLocals": false, "noUnusedParameters": false, - "checkJs": true + "checkJs": false, + "allowImportingTsExtensions": true }, "include": ["src"] } From fc5280d2f6db85ef2871e3bfa50b424e5e21bc8a Mon Sep 17 00:00:00 2001 From: Khwaja Date: Mon, 23 Jun 2025 09:48:33 -0500 Subject: [PATCH 06/24] Added PipelineBlock as well as necessary helper files --- node_modules/.bin/nanoid | 16 + node_modules/.bin/nanoid.cmd | 17 + node_modules/.bin/nanoid.ps1 | 28 + node_modules/.package-lock.json | 292 + node_modules/@types/d3-color/LICENSE | 21 + node_modules/@types/d3-color/README.md | 15 + node_modules/@types/d3-color/index.d.ts | 669 + node_modules/@types/d3-color/package.json | 55 + node_modules/@types/d3-drag/LICENSE | 21 + node_modules/@types/d3-drag/README.md | 15 + node_modules/@types/d3-drag/index.d.ts | 395 + node_modules/@types/d3-drag/package.json | 42 + node_modules/@types/d3-interpolate/LICENSE | 21 + node_modules/@types/d3-interpolate/README.md | 15 + node_modules/@types/d3-interpolate/index.d.ts | 387 + .../@types/d3-interpolate/package.json | 47 + node_modules/@types/d3-selection/LICENSE | 21 + node_modules/@types/d3-selection/README.md | 15 + node_modules/@types/d3-selection/index.d.ts | 1173 + node_modules/@types/d3-selection/package.json | 50 + node_modules/@types/d3-transition/LICENSE | 21 + node_modules/@types/d3-transition/README.md | 15 + node_modules/@types/d3-transition/index.d.ts | 664 + .../@types/d3-transition/package.json | 47 + node_modules/@types/d3-zoom/LICENSE | 21 + node_modules/@types/d3-zoom/README.md | 15 + node_modules/@types/d3-zoom/index.d.ts | 611 + node_modules/@types/d3-zoom/package.json | 48 + node_modules/@xyflow/react/LICENSE | 21 + node_modules/@xyflow/react/README.md | 135 + node_modules/@xyflow/react/dist/base.css | 494 + .../Background/Background.d.ts | 61 + .../Background/Background.d.ts.map | 1 + .../Background/Patterns.d.ts | 15 + .../Background/Patterns.d.ts.map | 1 + .../Background/index.d.ts | 3 + .../Background/index.d.ts.map | 1 + .../Background/types.d.ts | 59 + .../Background/types.d.ts.map | 1 + .../Controls/ControlButton.d.ts | 26 + .../Controls/ControlButton.d.ts.map | 1 + .../Controls/Controls.d.ts | 29 + .../Controls/Controls.d.ts.map | 1 + .../Controls/Icons/FitView.d.ts | 2 + .../Controls/Icons/FitView.d.ts.map | 1 + .../Controls/Icons/Lock.d.ts | 2 + .../Controls/Icons/Lock.d.ts.map | 1 + .../Controls/Icons/Minus.d.ts | 2 + .../Controls/Icons/Minus.d.ts.map | 1 + .../Controls/Icons/Plus.d.ts | 2 + .../Controls/Icons/Plus.d.ts.map | 1 + .../Controls/Icons/Unlock.d.ts | 2 + .../Controls/Icons/Unlock.d.ts.map | 1 + .../additional-components/Controls/index.d.ts | 4 + .../Controls/index.d.ts.map | 1 + .../additional-components/Controls/types.d.ts | 66 + .../Controls/types.d.ts.map | 1 + .../MiniMap/MiniMap.d.ts | 29 + .../MiniMap/MiniMap.d.ts.map | 1 + .../MiniMap/MiniMapNode.d.ts | 5 + .../MiniMap/MiniMapNode.d.ts.map | 1 + .../MiniMap/MiniMapNodes.d.ts | 6 + .../MiniMap/MiniMapNodes.d.ts.map | 1 + .../additional-components/MiniMap/index.d.ts | 3 + .../MiniMap/index.d.ts.map | 1 + .../additional-components/MiniMap/types.d.ts | 123 + .../MiniMap/types.d.ts.map | 1 + .../NodeResizer/NodeResizeControl.d.ts | 11 + .../NodeResizer/NodeResizeControl.d.ts.map | 1 + .../NodeResizer/NodeResizer.d.ts | 27 + .../NodeResizer/NodeResizer.d.ts.map | 1 + .../NodeResizer/index.d.ts | 4 + .../NodeResizer/index.d.ts.map | 1 + .../NodeResizer/types.d.ts | 97 + .../NodeResizer/types.d.ts.map | 1 + .../NodeToolbar/NodeToolbar.d.ts | 38 + .../NodeToolbar/NodeToolbar.d.ts.map | 1 + .../NodeToolbar/NodeToolbarPortal.d.ts | 5 + .../NodeToolbar/NodeToolbarPortal.d.ts.map | 1 + .../NodeToolbar/index.d.ts | 3 + .../NodeToolbar/index.d.ts.map | 1 + .../NodeToolbar/types.d.ts | 32 + .../NodeToolbar/types.d.ts.map | 1 + .../dist/esm/additional-components/index.d.ts | 6 + .../esm/additional-components/index.d.ts.map | 1 + .../components/A11yDescriptions/index.d.ts | 8 + .../A11yDescriptions/index.d.ts.map | 1 + .../esm/components/Attribution/index.d.ts | 8 + .../esm/components/Attribution/index.d.ts.map | 1 + .../esm/components/BatchProvider/index.d.ts | 17 + .../components/BatchProvider/index.d.ts.map | 1 + .../esm/components/BatchProvider/types.d.ts | 7 + .../components/BatchProvider/types.d.ts.map | 1 + .../components/BatchProvider/useQueue.d.ts | 11 + .../BatchProvider/useQueue.d.ts.map | 1 + .../esm/components/ConnectionLine/index.d.ts | 12 + .../components/ConnectionLine/index.d.ts.map | 1 + .../components/EdgeLabelRenderer/index.d.ts | 47 + .../EdgeLabelRenderer/index.d.ts.map | 1 + .../EdgeWrapper/EdgeUpdateAnchors.d.ts | 15 + .../EdgeWrapper/EdgeUpdateAnchors.d.ts.map | 1 + .../esm/components/EdgeWrapper/index.d.ts | 4 + .../esm/components/EdgeWrapper/index.d.ts.map | 1 + .../esm/components/EdgeWrapper/utils.d.ts | 11 + .../esm/components/EdgeWrapper/utils.d.ts.map | 1 + .../dist/esm/components/Edges/BaseEdge.d.ts | 30 + .../esm/components/Edges/BaseEdge.d.ts.map | 1 + .../dist/esm/components/Edges/BezierEdge.d.ts | 31 + .../esm/components/Edges/BezierEdge.d.ts.map | 1 + .../dist/esm/components/Edges/EdgeAnchor.d.ts | 17 + .../esm/components/Edges/EdgeAnchor.d.ts.map | 1 + .../dist/esm/components/Edges/EdgeText.d.ts | 34 + .../esm/components/Edges/EdgeText.d.ts.map | 1 + .../components/Edges/SimpleBezierEdge.d.ts | 30 + .../Edges/SimpleBezierEdge.d.ts.map | 1 + .../esm/components/Edges/SmoothStepEdge.d.ts | 31 + .../components/Edges/SmoothStepEdge.d.ts.map | 1 + .../dist/esm/components/Edges/StepEdge.d.ts | 31 + .../esm/components/Edges/StepEdge.d.ts.map | 1 + .../esm/components/Edges/StraightEdge.d.ts | 29 + .../components/Edges/StraightEdge.d.ts.map | 1 + .../dist/esm/components/Edges/index.d.ts | 6 + .../dist/esm/components/Edges/index.d.ts.map | 1 + .../dist/esm/components/Handle/index.d.ts | 39 + .../dist/esm/components/Handle/index.d.ts.map | 1 + .../esm/components/NodeWrapper/index.d.ts | 3 + .../esm/components/NodeWrapper/index.d.ts.map | 1 + .../NodeWrapper/useNodeObserver.d.ts | 14 + .../NodeWrapper/useNodeObserver.d.ts.map | 1 + .../esm/components/NodeWrapper/utils.d.ts | 9 + .../esm/components/NodeWrapper/utils.d.ts.map | 1 + .../esm/components/Nodes/DefaultNode.d.ts | 3 + .../esm/components/Nodes/DefaultNode.d.ts.map | 1 + .../dist/esm/components/Nodes/GroupNode.d.ts | 2 + .../esm/components/Nodes/GroupNode.d.ts.map | 1 + .../dist/esm/components/Nodes/InputNode.d.ts | 3 + .../esm/components/Nodes/InputNode.d.ts.map | 1 + .../dist/esm/components/Nodes/OutputNode.d.ts | 3 + .../esm/components/Nodes/OutputNode.d.ts.map | 1 + .../dist/esm/components/Nodes/utils.d.ts | 13 + .../dist/esm/components/Nodes/utils.d.ts.map | 1 + .../esm/components/NodesSelection/index.d.ts | 13 + .../components/NodesSelection/index.d.ts.map | 1 + .../dist/esm/components/Panel/index.d.ts | 45 + .../dist/esm/components/Panel/index.d.ts.map | 1 + .../components/ReactFlowProvider/index.d.ts | 82 + .../ReactFlowProvider/index.d.ts.map | 1 + .../components/SelectionListener/index.d.ts | 7 + .../SelectionListener/index.d.ts.map | 1 + .../esm/components/StoreUpdater/index.d.ts | 9 + .../components/StoreUpdater/index.d.ts.map | 1 + .../esm/components/UserSelection/index.d.ts | 2 + .../components/UserSelection/index.d.ts.map | 1 + .../esm/components/ViewportPortal/index.d.ts | 30 + .../components/ViewportPortal/index.d.ts.map | 1 + .../EdgeRenderer/MarkerDefinitions.d.ts | 10 + .../EdgeRenderer/MarkerDefinitions.d.ts.map | 1 + .../container/EdgeRenderer/MarkerSymbols.d.ts | 9 + .../EdgeRenderer/MarkerSymbols.d.ts.map | 1 + .../esm/container/EdgeRenderer/index.d.ts | 13 + .../esm/container/EdgeRenderer/index.d.ts.map | 1 + .../esm/container/FlowRenderer/index.d.ts | 14 + .../esm/container/FlowRenderer/index.d.ts.map | 1 + .../dist/esm/container/GraphView/index.d.ts | 11 + .../esm/container/GraphView/index.d.ts.map | 1 + .../GraphView/useNodeOrEdgeTypesWarning.d.ts | 10 + .../useNodeOrEdgeTypesWarning.d.ts.map | 1 + .../GraphView/useStylesLoadedWarning.d.ts | 2 + .../GraphView/useStylesLoadedWarning.d.ts.map | 1 + .../esm/container/NodeRenderer/index.d.ts | 10 + .../esm/container/NodeRenderer/index.d.ts.map | 1 + .../NodeRenderer/useResizeObserver.d.ts | 2 + .../NodeRenderer/useResizeObserver.d.ts.map | 1 + .../react/dist/esm/container/Pane/index.d.ts | 13 + .../dist/esm/container/Pane/index.d.ts.map | 1 + .../dist/esm/container/ReactFlow/Wrapper.d.ts | 19 + .../esm/container/ReactFlow/Wrapper.d.ts.map | 1 + .../dist/esm/container/ReactFlow/index.d.ts | 24 + .../esm/container/ReactFlow/index.d.ts.map | 1 + .../esm/container/ReactFlow/init-values.d.ts | 4 + .../container/ReactFlow/init-values.d.ts.map | 1 + .../dist/esm/container/Viewport/index.d.ts | 7 + .../esm/container/Viewport/index.d.ts.map | 1 + .../dist/esm/container/ZoomPane/index.d.ts | 7 + .../esm/container/ZoomPane/index.d.ts.map | 1 + .../dist/esm/contexts/NodeIdContext.d.ts | 34 + .../dist/esm/contexts/NodeIdContext.d.ts.map | 1 + .../react/dist/esm/contexts/StoreContext.d.ts | 4 + .../dist/esm/contexts/StoreContext.d.ts.map | 1 + .../dist/esm/hooks/useColorModeClass.d.ts | 9 + .../dist/esm/hooks/useColorModeClass.d.ts.map | 1 + .../react/dist/esm/hooks/useConnection.d.ts | 33 + .../dist/esm/hooks/useConnection.d.ts.map | 1 + .../@xyflow/react/dist/esm/hooks/useDrag.d.ts | 18 + .../react/dist/esm/hooks/useDrag.d.ts.map | 1 + .../react/dist/esm/hooks/useEdges.d.ts | 21 + .../react/dist/esm/hooks/useEdges.d.ts.map | 1 + .../dist/esm/hooks/useGlobalKeyHandler.d.ts | 11 + .../esm/hooks/useGlobalKeyHandler.d.ts.map | 1 + .../dist/esm/hooks/useHandleConnections.d.ts | 23 + .../esm/hooks/useHandleConnections.d.ts.map | 1 + .../react/dist/esm/hooks/useInternalNode.d.ts | 30 + .../dist/esm/hooks/useInternalNode.d.ts.map | 1 + .../esm/hooks/useIsomorphicLayoutEffect.d.ts | 3 + .../hooks/useIsomorphicLayoutEffect.d.ts.map | 1 + .../react/dist/esm/hooks/useKeyPress.d.ts | 53 + .../react/dist/esm/hooks/useKeyPress.d.ts.map | 1 + .../dist/esm/hooks/useMoveSelectedNodes.d.ts | 12 + .../esm/hooks/useMoveSelectedNodes.d.ts.map | 1 + .../dist/esm/hooks/useNodeConnections.d.ts | 38 + .../esm/hooks/useNodeConnections.d.ts.map | 1 + .../react/dist/esm/hooks/useNodes.d.ts | 22 + .../react/dist/esm/hooks/useNodes.d.ts.map | 1 + .../react/dist/esm/hooks/useNodesData.d.ts | 26 + .../dist/esm/hooks/useNodesData.d.ts.map | 1 + .../dist/esm/hooks/useNodesEdgesState.d.ts | 105 + .../esm/hooks/useNodesEdgesState.d.ts.map | 1 + .../dist/esm/hooks/useNodesInitialized.d.ts | 39 + .../esm/hooks/useNodesInitialized.d.ts.map | 1 + .../dist/esm/hooks/useOnInitHandler.d.ts | 8 + .../dist/esm/hooks/useOnInitHandler.d.ts.map | 1 + .../dist/esm/hooks/useOnSelectionChange.d.ts | 43 + .../esm/hooks/useOnSelectionChange.d.ts.map | 1 + .../dist/esm/hooks/useOnViewportChange.d.ts | 33 + .../esm/hooks/useOnViewportChange.d.ts.map | 1 + .../react/dist/esm/hooks/useReactFlow.d.ts | 30 + .../dist/esm/hooks/useReactFlow.d.ts.map | 1 + .../dist/esm/hooks/useResizeHandler.d.ts | 8 + .../dist/esm/hooks/useResizeHandler.d.ts.map | 1 + .../react/dist/esm/hooks/useStore.d.ts | 45 + .../react/dist/esm/hooks/useStore.d.ts.map | 1 + .../esm/hooks/useUpdateNodeInternals.d.ts | 48 + .../esm/hooks/useUpdateNodeInternals.d.ts.map | 1 + .../react/dist/esm/hooks/useViewport.d.ts | 32 + .../react/dist/esm/hooks/useViewport.d.ts.map | 1 + .../dist/esm/hooks/useViewportHelper.d.ts | 10 + .../dist/esm/hooks/useViewportHelper.d.ts.map | 1 + .../react/dist/esm/hooks/useViewportSync.d.ts | 9 + .../dist/esm/hooks/useViewportSync.d.ts.map | 1 + .../dist/esm/hooks/useVisibleEdgeIds.d.ts | 9 + .../dist/esm/hooks/useVisibleEdgeIds.d.ts.map | 1 + .../dist/esm/hooks/useVisibleNodeIds.d.ts | 9 + .../dist/esm/hooks/useVisibleNodeIds.d.ts.map | 1 + .../@xyflow/react/dist/esm/index.d.ts | 39 + .../@xyflow/react/dist/esm/index.d.ts.map | 1 + node_modules/@xyflow/react/dist/esm/index.js | 4826 +++ node_modules/@xyflow/react/dist/esm/index.mjs | 4826 +++ .../@xyflow/react/dist/esm/store/index.d.ts | 18 + .../react/dist/esm/store/index.d.ts.map | 1 + .../react/dist/esm/store/initialState.d.ts | 18 + .../dist/esm/store/initialState.d.ts.map | 1 + .../@xyflow/react/dist/esm/styles/utils.d.ts | 3 + .../react/dist/esm/styles/utils.d.ts.map | 1 + .../react/dist/esm/types/component-props.d.ts | 634 + .../dist/esm/types/component-props.d.ts.map | 1 + .../@xyflow/react/dist/esm/types/edges.d.ts | 216 + .../react/dist/esm/types/edges.d.ts.map | 1 + .../@xyflow/react/dist/esm/types/general.d.ts | 164 + .../react/dist/esm/types/general.d.ts.map | 1 + .../@xyflow/react/dist/esm/types/index.d.ts | 7 + .../react/dist/esm/types/index.d.ts.map | 1 + .../react/dist/esm/types/instance.d.ts | 232 + .../react/dist/esm/types/instance.d.ts.map | 1 + .../@xyflow/react/dist/esm/types/nodes.d.ts | 101 + .../react/dist/esm/types/nodes.d.ts.map | 1 + .../@xyflow/react/dist/esm/types/store.d.ts | 112 + .../react/dist/esm/types/store.d.ts.map | 1 + .../@xyflow/react/dist/esm/utils/changes.d.ts | 87 + .../react/dist/esm/utils/changes.d.ts.map | 1 + .../@xyflow/react/dist/esm/utils/general.d.ts | 48 + .../react/dist/esm/utils/general.d.ts.map | 1 + .../@xyflow/react/dist/esm/utils/index.d.ts | 3 + .../react/dist/esm/utils/index.d.ts.map | 1 + node_modules/@xyflow/react/dist/style.css | 614 + .../Background/Background.d.ts | 61 + .../Background/Background.d.ts.map | 1 + .../Background/Patterns.d.ts | 15 + .../Background/Patterns.d.ts.map | 1 + .../Background/index.d.ts | 3 + .../Background/index.d.ts.map | 1 + .../Background/types.d.ts | 59 + .../Background/types.d.ts.map | 1 + .../Controls/ControlButton.d.ts | 26 + .../Controls/ControlButton.d.ts.map | 1 + .../Controls/Controls.d.ts | 29 + .../Controls/Controls.d.ts.map | 1 + .../Controls/Icons/FitView.d.ts | 2 + .../Controls/Icons/FitView.d.ts.map | 1 + .../Controls/Icons/Lock.d.ts | 2 + .../Controls/Icons/Lock.d.ts.map | 1 + .../Controls/Icons/Minus.d.ts | 2 + .../Controls/Icons/Minus.d.ts.map | 1 + .../Controls/Icons/Plus.d.ts | 2 + .../Controls/Icons/Plus.d.ts.map | 1 + .../Controls/Icons/Unlock.d.ts | 2 + .../Controls/Icons/Unlock.d.ts.map | 1 + .../additional-components/Controls/index.d.ts | 4 + .../Controls/index.d.ts.map | 1 + .../additional-components/Controls/types.d.ts | 66 + .../Controls/types.d.ts.map | 1 + .../MiniMap/MiniMap.d.ts | 29 + .../MiniMap/MiniMap.d.ts.map | 1 + .../MiniMap/MiniMapNode.d.ts | 5 + .../MiniMap/MiniMapNode.d.ts.map | 1 + .../MiniMap/MiniMapNodes.d.ts | 6 + .../MiniMap/MiniMapNodes.d.ts.map | 1 + .../additional-components/MiniMap/index.d.ts | 3 + .../MiniMap/index.d.ts.map | 1 + .../additional-components/MiniMap/types.d.ts | 123 + .../MiniMap/types.d.ts.map | 1 + .../NodeResizer/NodeResizeControl.d.ts | 11 + .../NodeResizer/NodeResizeControl.d.ts.map | 1 + .../NodeResizer/NodeResizer.d.ts | 27 + .../NodeResizer/NodeResizer.d.ts.map | 1 + .../NodeResizer/index.d.ts | 4 + .../NodeResizer/index.d.ts.map | 1 + .../NodeResizer/types.d.ts | 97 + .../NodeResizer/types.d.ts.map | 1 + .../NodeToolbar/NodeToolbar.d.ts | 38 + .../NodeToolbar/NodeToolbar.d.ts.map | 1 + .../NodeToolbar/NodeToolbarPortal.d.ts | 5 + .../NodeToolbar/NodeToolbarPortal.d.ts.map | 1 + .../NodeToolbar/index.d.ts | 3 + .../NodeToolbar/index.d.ts.map | 1 + .../NodeToolbar/types.d.ts | 32 + .../NodeToolbar/types.d.ts.map | 1 + .../dist/umd/additional-components/index.d.ts | 6 + .../umd/additional-components/index.d.ts.map | 1 + .../components/A11yDescriptions/index.d.ts | 8 + .../A11yDescriptions/index.d.ts.map | 1 + .../umd/components/Attribution/index.d.ts | 8 + .../umd/components/Attribution/index.d.ts.map | 1 + .../umd/components/BatchProvider/index.d.ts | 17 + .../components/BatchProvider/index.d.ts.map | 1 + .../umd/components/BatchProvider/types.d.ts | 7 + .../components/BatchProvider/types.d.ts.map | 1 + .../components/BatchProvider/useQueue.d.ts | 11 + .../BatchProvider/useQueue.d.ts.map | 1 + .../umd/components/ConnectionLine/index.d.ts | 12 + .../components/ConnectionLine/index.d.ts.map | 1 + .../components/EdgeLabelRenderer/index.d.ts | 47 + .../EdgeLabelRenderer/index.d.ts.map | 1 + .../EdgeWrapper/EdgeUpdateAnchors.d.ts | 15 + .../EdgeWrapper/EdgeUpdateAnchors.d.ts.map | 1 + .../umd/components/EdgeWrapper/index.d.ts | 4 + .../umd/components/EdgeWrapper/index.d.ts.map | 1 + .../umd/components/EdgeWrapper/utils.d.ts | 11 + .../umd/components/EdgeWrapper/utils.d.ts.map | 1 + .../dist/umd/components/Edges/BaseEdge.d.ts | 30 + .../umd/components/Edges/BaseEdge.d.ts.map | 1 + .../dist/umd/components/Edges/BezierEdge.d.ts | 31 + .../umd/components/Edges/BezierEdge.d.ts.map | 1 + .../dist/umd/components/Edges/EdgeAnchor.d.ts | 17 + .../umd/components/Edges/EdgeAnchor.d.ts.map | 1 + .../dist/umd/components/Edges/EdgeText.d.ts | 34 + .../umd/components/Edges/EdgeText.d.ts.map | 1 + .../components/Edges/SimpleBezierEdge.d.ts | 30 + .../Edges/SimpleBezierEdge.d.ts.map | 1 + .../umd/components/Edges/SmoothStepEdge.d.ts | 31 + .../components/Edges/SmoothStepEdge.d.ts.map | 1 + .../dist/umd/components/Edges/StepEdge.d.ts | 31 + .../umd/components/Edges/StepEdge.d.ts.map | 1 + .../umd/components/Edges/StraightEdge.d.ts | 29 + .../components/Edges/StraightEdge.d.ts.map | 1 + .../dist/umd/components/Edges/index.d.ts | 6 + .../dist/umd/components/Edges/index.d.ts.map | 1 + .../dist/umd/components/Handle/index.d.ts | 39 + .../dist/umd/components/Handle/index.d.ts.map | 1 + .../umd/components/NodeWrapper/index.d.ts | 3 + .../umd/components/NodeWrapper/index.d.ts.map | 1 + .../NodeWrapper/useNodeObserver.d.ts | 14 + .../NodeWrapper/useNodeObserver.d.ts.map | 1 + .../umd/components/NodeWrapper/utils.d.ts | 9 + .../umd/components/NodeWrapper/utils.d.ts.map | 1 + .../umd/components/Nodes/DefaultNode.d.ts | 3 + .../umd/components/Nodes/DefaultNode.d.ts.map | 1 + .../dist/umd/components/Nodes/GroupNode.d.ts | 2 + .../umd/components/Nodes/GroupNode.d.ts.map | 1 + .../dist/umd/components/Nodes/InputNode.d.ts | 3 + .../umd/components/Nodes/InputNode.d.ts.map | 1 + .../dist/umd/components/Nodes/OutputNode.d.ts | 3 + .../umd/components/Nodes/OutputNode.d.ts.map | 1 + .../dist/umd/components/Nodes/utils.d.ts | 13 + .../dist/umd/components/Nodes/utils.d.ts.map | 1 + .../umd/components/NodesSelection/index.d.ts | 13 + .../components/NodesSelection/index.d.ts.map | 1 + .../dist/umd/components/Panel/index.d.ts | 45 + .../dist/umd/components/Panel/index.d.ts.map | 1 + .../components/ReactFlowProvider/index.d.ts | 82 + .../ReactFlowProvider/index.d.ts.map | 1 + .../components/SelectionListener/index.d.ts | 7 + .../SelectionListener/index.d.ts.map | 1 + .../umd/components/StoreUpdater/index.d.ts | 9 + .../components/StoreUpdater/index.d.ts.map | 1 + .../umd/components/UserSelection/index.d.ts | 2 + .../components/UserSelection/index.d.ts.map | 1 + .../umd/components/ViewportPortal/index.d.ts | 30 + .../components/ViewportPortal/index.d.ts.map | 1 + .../EdgeRenderer/MarkerDefinitions.d.ts | 10 + .../EdgeRenderer/MarkerDefinitions.d.ts.map | 1 + .../container/EdgeRenderer/MarkerSymbols.d.ts | 9 + .../EdgeRenderer/MarkerSymbols.d.ts.map | 1 + .../umd/container/EdgeRenderer/index.d.ts | 13 + .../umd/container/EdgeRenderer/index.d.ts.map | 1 + .../umd/container/FlowRenderer/index.d.ts | 14 + .../umd/container/FlowRenderer/index.d.ts.map | 1 + .../dist/umd/container/GraphView/index.d.ts | 11 + .../umd/container/GraphView/index.d.ts.map | 1 + .../GraphView/useNodeOrEdgeTypesWarning.d.ts | 10 + .../useNodeOrEdgeTypesWarning.d.ts.map | 1 + .../GraphView/useStylesLoadedWarning.d.ts | 2 + .../GraphView/useStylesLoadedWarning.d.ts.map | 1 + .../umd/container/NodeRenderer/index.d.ts | 10 + .../umd/container/NodeRenderer/index.d.ts.map | 1 + .../NodeRenderer/useResizeObserver.d.ts | 2 + .../NodeRenderer/useResizeObserver.d.ts.map | 1 + .../react/dist/umd/container/Pane/index.d.ts | 13 + .../dist/umd/container/Pane/index.d.ts.map | 1 + .../dist/umd/container/ReactFlow/Wrapper.d.ts | 19 + .../umd/container/ReactFlow/Wrapper.d.ts.map | 1 + .../dist/umd/container/ReactFlow/index.d.ts | 24 + .../umd/container/ReactFlow/index.d.ts.map | 1 + .../umd/container/ReactFlow/init-values.d.ts | 4 + .../container/ReactFlow/init-values.d.ts.map | 1 + .../dist/umd/container/Viewport/index.d.ts | 7 + .../umd/container/Viewport/index.d.ts.map | 1 + .../dist/umd/container/ZoomPane/index.d.ts | 7 + .../umd/container/ZoomPane/index.d.ts.map | 1 + .../dist/umd/contexts/NodeIdContext.d.ts | 34 + .../dist/umd/contexts/NodeIdContext.d.ts.map | 1 + .../react/dist/umd/contexts/StoreContext.d.ts | 4 + .../dist/umd/contexts/StoreContext.d.ts.map | 1 + .../dist/umd/hooks/useColorModeClass.d.ts | 9 + .../dist/umd/hooks/useColorModeClass.d.ts.map | 1 + .../react/dist/umd/hooks/useConnection.d.ts | 33 + .../dist/umd/hooks/useConnection.d.ts.map | 1 + .../@xyflow/react/dist/umd/hooks/useDrag.d.ts | 18 + .../react/dist/umd/hooks/useDrag.d.ts.map | 1 + .../react/dist/umd/hooks/useEdges.d.ts | 21 + .../react/dist/umd/hooks/useEdges.d.ts.map | 1 + .../dist/umd/hooks/useGlobalKeyHandler.d.ts | 11 + .../umd/hooks/useGlobalKeyHandler.d.ts.map | 1 + .../dist/umd/hooks/useHandleConnections.d.ts | 23 + .../umd/hooks/useHandleConnections.d.ts.map | 1 + .../react/dist/umd/hooks/useInternalNode.d.ts | 30 + .../dist/umd/hooks/useInternalNode.d.ts.map | 1 + .../umd/hooks/useIsomorphicLayoutEffect.d.ts | 3 + .../hooks/useIsomorphicLayoutEffect.d.ts.map | 1 + .../react/dist/umd/hooks/useKeyPress.d.ts | 53 + .../react/dist/umd/hooks/useKeyPress.d.ts.map | 1 + .../dist/umd/hooks/useMoveSelectedNodes.d.ts | 12 + .../umd/hooks/useMoveSelectedNodes.d.ts.map | 1 + .../dist/umd/hooks/useNodeConnections.d.ts | 38 + .../umd/hooks/useNodeConnections.d.ts.map | 1 + .../react/dist/umd/hooks/useNodes.d.ts | 22 + .../react/dist/umd/hooks/useNodes.d.ts.map | 1 + .../react/dist/umd/hooks/useNodesData.d.ts | 26 + .../dist/umd/hooks/useNodesData.d.ts.map | 1 + .../dist/umd/hooks/useNodesEdgesState.d.ts | 105 + .../umd/hooks/useNodesEdgesState.d.ts.map | 1 + .../dist/umd/hooks/useNodesInitialized.d.ts | 39 + .../umd/hooks/useNodesInitialized.d.ts.map | 1 + .../dist/umd/hooks/useOnInitHandler.d.ts | 8 + .../dist/umd/hooks/useOnInitHandler.d.ts.map | 1 + .../dist/umd/hooks/useOnSelectionChange.d.ts | 43 + .../umd/hooks/useOnSelectionChange.d.ts.map | 1 + .../dist/umd/hooks/useOnViewportChange.d.ts | 33 + .../umd/hooks/useOnViewportChange.d.ts.map | 1 + .../react/dist/umd/hooks/useReactFlow.d.ts | 30 + .../dist/umd/hooks/useReactFlow.d.ts.map | 1 + .../dist/umd/hooks/useResizeHandler.d.ts | 8 + .../dist/umd/hooks/useResizeHandler.d.ts.map | 1 + .../react/dist/umd/hooks/useStore.d.ts | 45 + .../react/dist/umd/hooks/useStore.d.ts.map | 1 + .../umd/hooks/useUpdateNodeInternals.d.ts | 48 + .../umd/hooks/useUpdateNodeInternals.d.ts.map | 1 + .../react/dist/umd/hooks/useViewport.d.ts | 32 + .../react/dist/umd/hooks/useViewport.d.ts.map | 1 + .../dist/umd/hooks/useViewportHelper.d.ts | 10 + .../dist/umd/hooks/useViewportHelper.d.ts.map | 1 + .../react/dist/umd/hooks/useViewportSync.d.ts | 9 + .../dist/umd/hooks/useViewportSync.d.ts.map | 1 + .../dist/umd/hooks/useVisibleEdgeIds.d.ts | 9 + .../dist/umd/hooks/useVisibleEdgeIds.d.ts.map | 1 + .../dist/umd/hooks/useVisibleNodeIds.d.ts | 9 + .../dist/umd/hooks/useVisibleNodeIds.d.ts.map | 1 + .../@xyflow/react/dist/umd/index.d.ts | 39 + .../@xyflow/react/dist/umd/index.d.ts.map | 1 + node_modules/@xyflow/react/dist/umd/index.js | 10 + .../@xyflow/react/dist/umd/store/index.d.ts | 18 + .../react/dist/umd/store/index.d.ts.map | 1 + .../react/dist/umd/store/initialState.d.ts | 18 + .../dist/umd/store/initialState.d.ts.map | 1 + .../@xyflow/react/dist/umd/styles/utils.d.ts | 3 + .../react/dist/umd/styles/utils.d.ts.map | 1 + .../react/dist/umd/types/component-props.d.ts | 634 + .../dist/umd/types/component-props.d.ts.map | 1 + .../@xyflow/react/dist/umd/types/edges.d.ts | 216 + .../react/dist/umd/types/edges.d.ts.map | 1 + .../@xyflow/react/dist/umd/types/general.d.ts | 164 + .../react/dist/umd/types/general.d.ts.map | 1 + .../@xyflow/react/dist/umd/types/index.d.ts | 7 + .../react/dist/umd/types/index.d.ts.map | 1 + .../react/dist/umd/types/instance.d.ts | 232 + .../react/dist/umd/types/instance.d.ts.map | 1 + .../@xyflow/react/dist/umd/types/nodes.d.ts | 101 + .../react/dist/umd/types/nodes.d.ts.map | 1 + .../@xyflow/react/dist/umd/types/store.d.ts | 112 + .../react/dist/umd/types/store.d.ts.map | 1 + .../@xyflow/react/dist/umd/utils/changes.d.ts | 87 + .../react/dist/umd/utils/changes.d.ts.map | 1 + .../@xyflow/react/dist/umd/utils/general.d.ts | 48 + .../react/dist/umd/utils/general.d.ts.map | 1 + .../@xyflow/react/dist/umd/utils/index.d.ts | 3 + .../react/dist/umd/utils/index.d.ts.map | 1 + node_modules/@xyflow/react/package.json | 98 + node_modules/@xyflow/system/LICENSE | 21 + node_modules/@xyflow/system/README.md | 47 + .../@xyflow/system/dist/esm/constants.d.ts | 43 + .../system/dist/esm/constants.d.ts.map | 1 + .../@xyflow/system/dist/esm/index.d.ts | 9 + .../@xyflow/system/dist/esm/index.d.ts.map | 1 + node_modules/@xyflow/system/dist/esm/index.js | 3347 ++ .../@xyflow/system/dist/esm/index.mjs | 3347 ++ .../system/dist/esm/types/changes.d.ts | 64 + .../system/dist/esm/types/changes.d.ts.map | 1 + .../@xyflow/system/dist/esm/types/edges.d.ts | 113 + .../system/dist/esm/types/edges.d.ts.map | 1 + .../system/dist/esm/types/general.d.ts | 241 + .../system/dist/esm/types/general.d.ts.map | 1 + .../system/dist/esm/types/handles.d.ts | 56 + .../system/dist/esm/types/handles.d.ts.map | 1 + .../@xyflow/system/dist/esm/types/index.d.ts | 8 + .../system/dist/esm/types/index.d.ts.map | 1 + .../@xyflow/system/dist/esm/types/nodes.d.ts | 161 + .../system/dist/esm/types/nodes.d.ts.map | 1 + .../system/dist/esm/types/panzoom.d.ts | 53 + .../system/dist/esm/types/panzoom.d.ts.map | 1 + .../@xyflow/system/dist/esm/types/utils.d.ts | 53 + .../system/dist/esm/types/utils.d.ts.map | 1 + .../system/dist/esm/utils/connections.d.ts | 13 + .../dist/esm/utils/connections.d.ts.map | 1 + .../@xyflow/system/dist/esm/utils/dom.d.ts | 21 + .../system/dist/esm/utils/dom.d.ts.map | 1 + .../dist/esm/utils/edges/bezier-edge.d.ts | 77 + .../dist/esm/utils/edges/bezier-edge.d.ts.map | 1 + .../system/dist/esm/utils/edges/general.d.ts | 62 + .../dist/esm/utils/edges/general.d.ts.map | 1 + .../system/dist/esm/utils/edges/index.d.ts | 6 + .../dist/esm/utils/edges/index.d.ts.map | 1 + .../dist/esm/utils/edges/positions.d.ts | 17 + .../dist/esm/utils/edges/positions.d.ts.map | 1 + .../dist/esm/utils/edges/smoothstep-edge.d.ts | 60 + .../esm/utils/edges/smoothstep-edge.d.ts.map | 1 + .../dist/esm/utils/edges/straight-edge.d.ts | 41 + .../esm/utils/edges/straight-edge.d.ts.map | 1 + .../system/dist/esm/utils/general.d.ts | 85 + .../system/dist/esm/utils/general.d.ts.map | 1 + .../@xyflow/system/dist/esm/utils/graph.d.ts | 191 + .../system/dist/esm/utils/graph.d.ts.map | 1 + .../@xyflow/system/dist/esm/utils/index.d.ts | 11 + .../system/dist/esm/utils/index.d.ts.map | 1 + .../@xyflow/system/dist/esm/utils/marker.d.ts | 9 + .../system/dist/esm/utils/marker.d.ts.map | 1 + .../system/dist/esm/utils/node-toolbar.d.ts | 3 + .../dist/esm/utils/node-toolbar.d.ts.map | 1 + .../dist/esm/utils/shallow-node-data.d.ts | 5 + .../dist/esm/utils/shallow-node-data.d.ts.map | 1 + .../@xyflow/system/dist/esm/utils/store.d.ts | 27 + .../system/dist/esm/utils/store.d.ts.map | 1 + .../@xyflow/system/dist/esm/utils/types.d.ts | 8 + .../system/dist/esm/utils/types.d.ts.map | 1 + .../system/dist/esm/xydrag/XYDrag.d.ts | 55 + .../system/dist/esm/xydrag/XYDrag.d.ts.map | 1 + .../@xyflow/system/dist/esm/xydrag/index.d.ts | 2 + .../system/dist/esm/xydrag/index.d.ts.map | 1 + .../@xyflow/system/dist/esm/xydrag/utils.d.ts | 11 + .../system/dist/esm/xydrag/utils.d.ts.map | 1 + .../system/dist/esm/xyhandle/XYHandle.d.ts | 3 + .../dist/esm/xyhandle/XYHandle.d.ts.map | 1 + .../system/dist/esm/xyhandle/index.d.ts | 2 + .../system/dist/esm/xyhandle/index.d.ts.map | 1 + .../system/dist/esm/xyhandle/types.d.ts | 48 + .../system/dist/esm/xyhandle/types.d.ts.map | 1 + .../system/dist/esm/xyhandle/utils.d.ts | 10 + .../system/dist/esm/xyhandle/utils.d.ts.map | 1 + .../system/dist/esm/xyminimap/index.d.ts | 28 + .../system/dist/esm/xyminimap/index.d.ts.map | 1 + .../system/dist/esm/xypanzoom/XYPanZoom.d.ts | 12 + .../dist/esm/xypanzoom/XYPanZoom.d.ts.map | 1 + .../dist/esm/xypanzoom/eventhandler.d.ts | 46 + .../dist/esm/xypanzoom/eventhandler.d.ts.map | 1 + .../system/dist/esm/xypanzoom/filter.d.ts | 14 + .../system/dist/esm/xypanzoom/filter.d.ts.map | 1 + .../system/dist/esm/xypanzoom/index.d.ts | 2 + .../system/dist/esm/xypanzoom/index.d.ts.map | 1 + .../system/dist/esm/xypanzoom/utils.d.ts | 10 + .../system/dist/esm/xypanzoom/utils.d.ts.map | 1 + .../system/dist/esm/xyresizer/XYResizer.d.ts | 49 + .../dist/esm/xyresizer/XYResizer.d.ts.map | 1 + .../system/dist/esm/xyresizer/index.d.ts | 3 + .../system/dist/esm/xyresizer/index.d.ts.map | 1 + .../system/dist/esm/xyresizer/types.d.ts | 46 + .../system/dist/esm/xyresizer/types.d.ts.map | 1 + .../system/dist/esm/xyresizer/utils.d.ts | 76 + .../system/dist/esm/xyresizer/utils.d.ts.map | 1 + .../@xyflow/system/dist/umd/constants.d.ts | 43 + .../system/dist/umd/constants.d.ts.map | 1 + .../@xyflow/system/dist/umd/index.d.ts | 9 + .../@xyflow/system/dist/umd/index.d.ts.map | 1 + node_modules/@xyflow/system/dist/umd/index.js | 1 + .../system/dist/umd/types/changes.d.ts | 64 + .../system/dist/umd/types/changes.d.ts.map | 1 + .../@xyflow/system/dist/umd/types/edges.d.ts | 113 + .../system/dist/umd/types/edges.d.ts.map | 1 + .../system/dist/umd/types/general.d.ts | 241 + .../system/dist/umd/types/general.d.ts.map | 1 + .../system/dist/umd/types/handles.d.ts | 56 + .../system/dist/umd/types/handles.d.ts.map | 1 + .../@xyflow/system/dist/umd/types/index.d.ts | 8 + .../system/dist/umd/types/index.d.ts.map | 1 + .../@xyflow/system/dist/umd/types/nodes.d.ts | 161 + .../system/dist/umd/types/nodes.d.ts.map | 1 + .../system/dist/umd/types/panzoom.d.ts | 53 + .../system/dist/umd/types/panzoom.d.ts.map | 1 + .../@xyflow/system/dist/umd/types/utils.d.ts | 53 + .../system/dist/umd/types/utils.d.ts.map | 1 + .../system/dist/umd/utils/connections.d.ts | 13 + .../dist/umd/utils/connections.d.ts.map | 1 + .../@xyflow/system/dist/umd/utils/dom.d.ts | 21 + .../system/dist/umd/utils/dom.d.ts.map | 1 + .../dist/umd/utils/edges/bezier-edge.d.ts | 77 + .../dist/umd/utils/edges/bezier-edge.d.ts.map | 1 + .../system/dist/umd/utils/edges/general.d.ts | 62 + .../dist/umd/utils/edges/general.d.ts.map | 1 + .../system/dist/umd/utils/edges/index.d.ts | 6 + .../dist/umd/utils/edges/index.d.ts.map | 1 + .../dist/umd/utils/edges/positions.d.ts | 17 + .../dist/umd/utils/edges/positions.d.ts.map | 1 + .../dist/umd/utils/edges/smoothstep-edge.d.ts | 60 + .../umd/utils/edges/smoothstep-edge.d.ts.map | 1 + .../dist/umd/utils/edges/straight-edge.d.ts | 41 + .../umd/utils/edges/straight-edge.d.ts.map | 1 + .../system/dist/umd/utils/general.d.ts | 85 + .../system/dist/umd/utils/general.d.ts.map | 1 + .../@xyflow/system/dist/umd/utils/graph.d.ts | 191 + .../system/dist/umd/utils/graph.d.ts.map | 1 + .../@xyflow/system/dist/umd/utils/index.d.ts | 11 + .../system/dist/umd/utils/index.d.ts.map | 1 + .../@xyflow/system/dist/umd/utils/marker.d.ts | 9 + .../system/dist/umd/utils/marker.d.ts.map | 1 + .../system/dist/umd/utils/node-toolbar.d.ts | 3 + .../dist/umd/utils/node-toolbar.d.ts.map | 1 + .../dist/umd/utils/shallow-node-data.d.ts | 5 + .../dist/umd/utils/shallow-node-data.d.ts.map | 1 + .../@xyflow/system/dist/umd/utils/store.d.ts | 27 + .../system/dist/umd/utils/store.d.ts.map | 1 + .../@xyflow/system/dist/umd/utils/types.d.ts | 8 + .../system/dist/umd/utils/types.d.ts.map | 1 + .../system/dist/umd/xydrag/XYDrag.d.ts | 55 + .../system/dist/umd/xydrag/XYDrag.d.ts.map | 1 + .../@xyflow/system/dist/umd/xydrag/index.d.ts | 2 + .../system/dist/umd/xydrag/index.d.ts.map | 1 + .../@xyflow/system/dist/umd/xydrag/utils.d.ts | 11 + .../system/dist/umd/xydrag/utils.d.ts.map | 1 + .../system/dist/umd/xyhandle/XYHandle.d.ts | 3 + .../dist/umd/xyhandle/XYHandle.d.ts.map | 1 + .../system/dist/umd/xyhandle/index.d.ts | 2 + .../system/dist/umd/xyhandle/index.d.ts.map | 1 + .../system/dist/umd/xyhandle/types.d.ts | 48 + .../system/dist/umd/xyhandle/types.d.ts.map | 1 + .../system/dist/umd/xyhandle/utils.d.ts | 10 + .../system/dist/umd/xyhandle/utils.d.ts.map | 1 + .../system/dist/umd/xyminimap/index.d.ts | 28 + .../system/dist/umd/xyminimap/index.d.ts.map | 1 + .../system/dist/umd/xypanzoom/XYPanZoom.d.ts | 12 + .../dist/umd/xypanzoom/XYPanZoom.d.ts.map | 1 + .../dist/umd/xypanzoom/eventhandler.d.ts | 46 + .../dist/umd/xypanzoom/eventhandler.d.ts.map | 1 + .../system/dist/umd/xypanzoom/filter.d.ts | 14 + .../system/dist/umd/xypanzoom/filter.d.ts.map | 1 + .../system/dist/umd/xypanzoom/index.d.ts | 2 + .../system/dist/umd/xypanzoom/index.d.ts.map | 1 + .../system/dist/umd/xypanzoom/utils.d.ts | 10 + .../system/dist/umd/xypanzoom/utils.d.ts.map | 1 + .../system/dist/umd/xyresizer/XYResizer.d.ts | 49 + .../dist/umd/xyresizer/XYResizer.d.ts.map | 1 + .../system/dist/umd/xyresizer/index.d.ts | 3 + .../system/dist/umd/xyresizer/index.d.ts.map | 1 + .../system/dist/umd/xyresizer/types.d.ts | 46 + .../system/dist/umd/xyresizer/types.d.ts.map | 1 + .../system/dist/umd/xyresizer/utils.d.ts | 76 + .../system/dist/umd/xyresizer/utils.d.ts.map | 1 + node_modules/@xyflow/system/package.json | 79 + node_modules/classcat/LICENSE.md | 7 + node_modules/classcat/README.md | 88 + node_modules/classcat/index.cjs | 19 + node_modules/classcat/index.d.ts | 15 + node_modules/classcat/index.js | 19 + node_modules/classcat/package.json | 38 + node_modules/d3-color/LICENSE | 13 + node_modules/d3-color/README.md | 203 + node_modules/d3-color/dist/d3-color.js | 606 + node_modules/d3-color/dist/d3-color.min.js | 2 + node_modules/d3-color/package.json | 54 + node_modules/d3-color/src/color.js | 396 + node_modules/d3-color/src/cubehelix.js | 61 + node_modules/d3-color/src/define.js | 10 + node_modules/d3-color/src/index.js | 3 + node_modules/d3-color/src/lab.js | 123 + node_modules/d3-color/src/math.js | 2 + node_modules/d3-dispatch/LICENSE | 13 + node_modules/d3-dispatch/README.md | 94 + node_modules/d3-dispatch/dist/d3-dispatch.js | 95 + .../d3-dispatch/dist/d3-dispatch.min.js | 2 + node_modules/d3-dispatch/package.json | 50 + node_modules/d3-dispatch/src/dispatch.js | 84 + node_modules/d3-dispatch/src/index.js | 1 + node_modules/d3-drag/LICENSE | 13 + node_modules/d3-drag/README.md | 248 + node_modules/d3-drag/dist/d3-drag.js | 273 + node_modules/d3-drag/dist/d3-drag.min.js | 2 + node_modules/d3-drag/package.json | 54 + node_modules/d3-drag/src/constant.js | 1 + node_modules/d3-drag/src/drag.js | 194 + node_modules/d3-drag/src/event.js | 28 + node_modules/d3-drag/src/index.js | 2 + node_modules/d3-drag/src/nodrag.js | 28 + node_modules/d3-drag/src/noevent.js | 13 + node_modules/d3-ease/LICENSE | 28 + node_modules/d3-ease/README.md | 253 + node_modules/d3-ease/dist/d3-ease.js | 262 + node_modules/d3-ease/dist/d3-ease.min.js | 2 + node_modules/d3-ease/package.json | 51 + node_modules/d3-ease/src/back.js | 37 + node_modules/d3-ease/src/bounce.js | 22 + node_modules/d3-ease/src/circle.js | 11 + node_modules/d3-ease/src/cubic.js | 11 + node_modules/d3-ease/src/elastic.js | 46 + node_modules/d3-ease/src/exp.js | 13 + node_modules/d3-ease/src/index.js | 66 + node_modules/d3-ease/src/linear.js | 1 + node_modules/d3-ease/src/math.js | 4 + node_modules/d3-ease/src/poly.js | 37 + node_modules/d3-ease/src/quad.js | 11 + node_modules/d3-ease/src/sin.js | 14 + node_modules/d3-interpolate/LICENSE | 13 + node_modules/d3-interpolate/README.md | 268 + .../d3-interpolate/dist/d3-interpolate.js | 590 + .../d3-interpolate/dist/d3-interpolate.min.js | 2 + node_modules/d3-interpolate/package.json | 53 + node_modules/d3-interpolate/src/array.js | 22 + node_modules/d3-interpolate/src/basis.js | 19 + .../d3-interpolate/src/basisClosed.js | 13 + node_modules/d3-interpolate/src/color.js | 29 + node_modules/d3-interpolate/src/constant.js | 1 + node_modules/d3-interpolate/src/cubehelix.js | 29 + node_modules/d3-interpolate/src/date.js | 6 + node_modules/d3-interpolate/src/discrete.js | 6 + node_modules/d3-interpolate/src/hcl.js | 21 + node_modules/d3-interpolate/src/hsl.js | 21 + node_modules/d3-interpolate/src/hue.js | 9 + node_modules/d3-interpolate/src/index.js | 21 + node_modules/d3-interpolate/src/lab.js | 16 + node_modules/d3-interpolate/src/number.js | 5 + .../d3-interpolate/src/numberArray.js | 14 + node_modules/d3-interpolate/src/object.js | 23 + node_modules/d3-interpolate/src/piecewise.js | 11 + node_modules/d3-interpolate/src/quantize.js | 5 + node_modules/d3-interpolate/src/rgb.js | 55 + node_modules/d3-interpolate/src/round.js | 5 + node_modules/d3-interpolate/src/string.js | 64 + .../d3-interpolate/src/transform/decompose.js | 26 + .../d3-interpolate/src/transform/index.js | 63 + .../d3-interpolate/src/transform/parse.js | 18 + node_modules/d3-interpolate/src/value.js | 22 + node_modules/d3-interpolate/src/zoom.js | 71 + node_modules/d3-selection/LICENSE | 13 + node_modules/d3-selection/README.md | 863 + .../d3-selection/dist/d3-selection.js | 1022 + .../d3-selection/dist/d3-selection.min.js | 2 + node_modules/d3-selection/package.json | 51 + node_modules/d3-selection/src/array.js | 9 + node_modules/d3-selection/src/constant.js | 5 + node_modules/d3-selection/src/create.js | 6 + node_modules/d3-selection/src/creator.js | 25 + node_modules/d3-selection/src/identity.js | 3 + node_modules/d3-selection/src/index.js | 15 + node_modules/d3-selection/src/local.js | 27 + node_modules/d3-selection/src/matcher.js | 12 + node_modules/d3-selection/src/namespace.js | 7 + node_modules/d3-selection/src/namespaces.js | 9 + node_modules/d3-selection/src/pointer.js | 20 + node_modules/d3-selection/src/pointers.js | 11 + node_modules/d3-selection/src/select.js | 7 + node_modules/d3-selection/src/selectAll.js | 8 + .../d3-selection/src/selection/append.js | 8 + .../d3-selection/src/selection/attr.js | 57 + .../d3-selection/src/selection/call.js | 6 + .../d3-selection/src/selection/classed.js | 75 + .../d3-selection/src/selection/clone.js | 13 + .../d3-selection/src/selection/data.js | 128 + .../d3-selection/src/selection/datum.js | 5 + .../d3-selection/src/selection/dispatch.js | 34 + .../d3-selection/src/selection/each.js | 10 + .../d3-selection/src/selection/empty.js | 3 + .../d3-selection/src/selection/enter.js | 22 + .../d3-selection/src/selection/exit.js | 6 + .../d3-selection/src/selection/filter.js | 16 + .../d3-selection/src/selection/html.js | 25 + .../d3-selection/src/selection/index.js | 90 + .../d3-selection/src/selection/insert.js | 14 + .../d3-selection/src/selection/iterator.js | 7 + .../d3-selection/src/selection/join.js | 15 + .../d3-selection/src/selection/lower.js | 7 + .../d3-selection/src/selection/merge.js | 19 + .../d3-selection/src/selection/node.js | 11 + .../d3-selection/src/selection/nodes.js | 3 + node_modules/d3-selection/src/selection/on.js | 67 + .../d3-selection/src/selection/order.js | 13 + .../d3-selection/src/selection/property.js | 28 + .../d3-selection/src/selection/raise.js | 7 + .../d3-selection/src/selection/remove.js | 8 + .../d3-selection/src/selection/select.js | 17 + .../d3-selection/src/selection/selectAll.js | 25 + .../d3-selection/src/selection/selectChild.js | 18 + .../src/selection/selectChildren.js | 18 + .../d3-selection/src/selection/size.js | 5 + .../d3-selection/src/selection/sort.js | 24 + .../d3-selection/src/selection/sparse.js | 3 + .../d3-selection/src/selection/style.js | 35 + .../d3-selection/src/selection/text.js | 25 + node_modules/d3-selection/src/selector.js | 7 + node_modules/d3-selection/src/selectorAll.js | 9 + node_modules/d3-selection/src/sourceEvent.js | 5 + node_modules/d3-selection/src/window.js | 5 + node_modules/d3-timer/LICENSE | 13 + node_modules/d3-timer/README.md | 87 + node_modules/d3-timer/dist/d3-timer.js | 153 + node_modules/d3-timer/dist/d3-timer.min.js | 2 + node_modules/d3-timer/package.json | 53 + node_modules/d3-timer/src/index.js | 13 + node_modules/d3-timer/src/interval.js | 17 + node_modules/d3-timer/src/timeout.js | 11 + node_modules/d3-timer/src/timer.js | 110 + node_modules/d3-transition/LICENSE | 13 + node_modules/d3-transition/README.md | 490 + .../d3-transition/dist/d3-transition.js | 900 + .../d3-transition/dist/d3-transition.min.js | 2 + node_modules/d3-transition/package.json | 65 + node_modules/d3-transition/src/active.js | 21 + node_modules/d3-transition/src/index.js | 4 + node_modules/d3-transition/src/interrupt.js | 24 + .../d3-transition/src/selection/index.js | 6 + .../d3-transition/src/selection/interrupt.js | 7 + .../d3-transition/src/selection/transition.js | 42 + .../d3-transition/src/transition/attr.js | 78 + .../d3-transition/src/transition/attrTween.js | 44 + .../d3-transition/src/transition/delay.js | 23 + .../d3-transition/src/transition/duration.js | 23 + .../d3-transition/src/transition/ease.js | 16 + .../src/transition/easeVarying.js | 14 + .../d3-transition/src/transition/end.js | 29 + .../d3-transition/src/transition/filter.js | 16 + .../d3-transition/src/transition/index.js | 73 + .../src/transition/interpolate.js | 10 + .../d3-transition/src/transition/merge.js | 19 + .../d3-transition/src/transition/on.js | 32 + .../d3-transition/src/transition/remove.js | 11 + .../d3-transition/src/transition/schedule.js | 153 + .../d3-transition/src/transition/select.js | 22 + .../d3-transition/src/transition/selectAll.js | 26 + .../d3-transition/src/transition/selection.js | 7 + .../d3-transition/src/transition/style.js | 80 + .../src/transition/styleTween.js | 24 + .../d3-transition/src/transition/text.js | 20 + .../d3-transition/src/transition/textTween.js | 24 + .../src/transition/transition.js | 24 + .../d3-transition/src/transition/tween.js | 81 + node_modules/d3-zoom/LICENSE | 13 + node_modules/d3-zoom/README.md | 414 + node_modules/d3-zoom/dist/d3-zoom.js | 531 + node_modules/d3-zoom/dist/d3-zoom.min.js | 2 + node_modules/d3-zoom/package.json | 57 + node_modules/d3-zoom/src/constant.js | 1 + node_modules/d3-zoom/src/event.js | 14 + node_modules/d3-zoom/src/index.js | 2 + node_modules/d3-zoom/src/noevent.js | 8 + node_modules/d3-zoom/src/transform.js | 51 + node_modules/d3-zoom/src/zoom.js | 447 + node_modules/i/.github/dependabot.yml | 8 + node_modules/i/.github/workflows/ci.yml | 26 + node_modules/i/LICENSE | 20 + node_modules/i/README.md | 176 + node_modules/i/lib/defaults.js | 78 + node_modules/i/lib/inflect.js | 11 + node_modules/i/lib/inflections.js | 138 + node_modules/i/lib/methods.js | 234 + node_modules/i/lib/native.js | 51 + node_modules/i/lib/util.js | 147 + node_modules/i/package.json | 53 + node_modules/i/test/inflector/cases.js | 230 + .../i/test/inflector/inflections-test.js | 87 + node_modules/i/test/inflector/methods-test.js | 348 + node_modules/i/test/utils/array-test.js | 39 + node_modules/i/test/utils/string-test.js | 88 + node_modules/nanoid/LICENSE | 20 + node_modules/nanoid/README.md | 38 + node_modules/nanoid/bin/nanoid.js | 45 + node_modules/nanoid/index.browser.js | 29 + node_modules/nanoid/index.d.ts | 106 + node_modules/nanoid/index.js | 46 + node_modules/nanoid/nanoid.js | 1 + node_modules/nanoid/non-secure/index.d.ts | 48 + node_modules/nanoid/non-secure/index.js | 21 + node_modules/nanoid/package.json | 42 + node_modules/nanoid/url-alphabet/index.js | 2 + node_modules/react-dom/LICENSE | 21 + node_modules/react-dom/README.md | 60 + .../cjs/react-dom-client.development.js | 24990 +++++++++++++++ .../cjs/react-dom-client.production.js | 15393 ++++++++++ .../cjs/react-dom-profiling.development.js | 25377 ++++++++++++++++ .../cjs/react-dom-profiling.profiling.js | 16218 ++++++++++ ...t-dom-server-legacy.browser.development.js | 9035 ++++++ ...ct-dom-server-legacy.browser.production.js | 5892 ++++ ...eact-dom-server-legacy.node.development.js | 9035 ++++++ ...react-dom-server-legacy.node.production.js | 5972 ++++ .../react-dom-server.browser.development.js | 9424 ++++++ .../react-dom-server.browser.production.js | 6384 ++++ .../cjs/react-dom-server.bun.development.js | 8739 ++++++ .../cjs/react-dom-server.bun.production.js | 5967 ++++ .../cjs/react-dom-server.edge.development.js | 9443 ++++++ .../cjs/react-dom-server.edge.production.js | 6477 ++++ .../cjs/react-dom-server.node.development.js | 9317 ++++++ .../cjs/react-dom-server.node.production.js | 6372 ++++ .../cjs/react-dom-test-utils.development.js | 24 + .../cjs/react-dom-test-utils.production.js | 21 + .../react-dom/cjs/react-dom.development.js | 424 + .../react-dom/cjs/react-dom.production.js | 210 + .../cjs/react-dom.react-server.development.js | 340 + .../cjs/react-dom.react-server.production.js | 152 + node_modules/react-dom/client.js | 38 + node_modules/react-dom/client.react-server.js | 5 + node_modules/react-dom/index.js | 38 + node_modules/react-dom/package.json | 117 + node_modules/react-dom/profiling.js | 38 + .../react-dom/profiling.react-server.js | 5 + .../react-dom/react-dom.react-server.js | 7 + node_modules/react-dom/server.browser.js | 18 + node_modules/react-dom/server.bun.js | 19 + node_modules/react-dom/server.edge.js | 19 + node_modules/react-dom/server.js | 3 + node_modules/react-dom/server.node.js | 18 + node_modules/react-dom/server.react-server.js | 5 + node_modules/react-dom/static.browser.js | 12 + node_modules/react-dom/static.edge.js | 12 + node_modules/react-dom/static.js | 3 + node_modules/react-dom/static.node.js | 12 + node_modules/react-dom/static.react-server.js | 5 + node_modules/react-dom/test-utils.js | 7 + node_modules/react/LICENSE | 21 + node_modules/react/README.md | 37 + .../cjs/react-compiler-runtime.development.js | 24 + .../cjs/react-compiler-runtime.production.js | 16 + .../cjs/react-compiler-runtime.profiling.js | 16 + .../cjs/react-jsx-dev-runtime.development.js | 349 + .../cjs/react-jsx-dev-runtime.production.js | 14 + .../cjs/react-jsx-dev-runtime.profiling.js | 14 + ...sx-dev-runtime.react-server.development.js | 385 + ...jsx-dev-runtime.react-server.production.js | 40 + .../cjs/react-jsx-runtime.development.js | 358 + .../react/cjs/react-jsx-runtime.production.js | 34 + .../react/cjs/react-jsx-runtime.profiling.js | 34 + ...ct-jsx-runtime.react-server.development.js | 385 + ...act-jsx-runtime.react-server.production.js | 40 + node_modules/react/cjs/react.development.js | 1242 + node_modules/react/cjs/react.production.js | 546 + .../cjs/react.react-server.development.js | 815 + .../cjs/react.react-server.production.js | 429 + node_modules/react/compiler-runtime.js | 14 + node_modules/react/index.js | 7 + node_modules/react/jsx-dev-runtime.js | 7 + .../react/jsx-dev-runtime.react-server.js | 7 + node_modules/react/jsx-runtime.js | 7 + .../react/jsx-runtime.react-server.js | 7 + node_modules/react/package.json | 51 + node_modules/react/react.react-server.js | 7 + node_modules/scheduler/LICENSE | 21 + node_modules/scheduler/README.md | 9 + .../scheduler-unstable_mock.development.js | 414 + .../cjs/scheduler-unstable_mock.production.js | 406 + ...cheduler-unstable_post_task.development.js | 150 + ...scheduler-unstable_post_task.production.js | 140 + .../scheduler/cjs/scheduler.development.js | 364 + .../cjs/scheduler.native.development.js | 350 + .../cjs/scheduler.native.production.js | 330 + .../scheduler/cjs/scheduler.production.js | 340 + node_modules/scheduler/index.js | 7 + node_modules/scheduler/index.native.js | 7 + node_modules/scheduler/package.json | 27 + node_modules/scheduler/unstable_mock.js | 7 + node_modules/scheduler/unstable_post_task.js | 7 + node_modules/use-sync-external-store/LICENSE | 21 + .../use-sync-external-store/README.md | 5 + ...se-sync-external-store-shim.development.js | 95 + ...-external-store-shim.native.development.js | 88 + ...c-external-store-shim.native.production.js | 59 + ...use-sync-external-store-shim.production.js | 66 + .../with-selector.development.js | 97 + .../with-selector.production.js | 85 + ...xternal-store-with-selector.development.js | 96 + ...external-store-with-selector.production.js | 84 + .../use-sync-external-store.development.js | 27 + .../cjs/use-sync-external-store.production.js | 13 + node_modules/use-sync-external-store/index.js | 7 + .../use-sync-external-store/package.json | 43 + .../use-sync-external-store/shim/index.js | 7 + .../shim/index.native.js | 7 + .../shim/with-selector.js | 7 + .../use-sync-external-store/with-selector.js | 7 + node_modules/zustand/LICENSE | 21 + node_modules/zustand/context.d.ts | 25 + node_modules/zustand/context.js | 60 + node_modules/zustand/esm/context.d.mts | 25 + node_modules/zustand/esm/context.d.ts | 25 + node_modules/zustand/esm/context.js | 61 + node_modules/zustand/esm/context.mjs | 61 + node_modules/zustand/esm/index.d.mts | 3 + node_modules/zustand/esm/index.d.ts | 3 + node_modules/zustand/esm/index.js | 48 + node_modules/zustand/esm/index.mjs | 48 + node_modules/zustand/esm/middleware.d.mts | 5 + node_modules/zustand/esm/middleware.d.ts | 5 + node_modules/zustand/esm/middleware.js | 583 + node_modules/zustand/esm/middleware.mjs | 583 + .../zustand/esm/middleware/combine.d.mts | 5 + .../zustand/esm/middleware/combine.d.ts | 5 + .../zustand/esm/middleware/devtools.d.mts | 49 + .../zustand/esm/middleware/devtools.d.ts | 49 + .../zustand/esm/middleware/immer.d.mts | 25 + .../zustand/esm/middleware/immer.d.ts | 25 + node_modules/zustand/esm/middleware/immer.js | 12 + node_modules/zustand/esm/middleware/immer.mjs | 12 + .../zustand/esm/middleware/persist.d.mts | 119 + .../zustand/esm/middleware/persist.d.ts | 119 + .../zustand/esm/middleware/redux.d.mts | 21 + .../zustand/esm/middleware/redux.d.ts | 21 + .../middleware/subscribeWithSelector.d.mts | 25 + .../esm/middleware/subscribeWithSelector.d.ts | 25 + node_modules/zustand/esm/react.d.mts | 38 + node_modules/zustand/esm/react.d.ts | 38 + node_modules/zustand/esm/react/shallow.d.mts | 1 + node_modules/zustand/esm/react/shallow.d.ts | 1 + node_modules/zustand/esm/react/shallow.js | 49 + node_modules/zustand/esm/react/shallow.mjs | 49 + node_modules/zustand/esm/shallow.d.mts | 7 + node_modules/zustand/esm/shallow.d.ts | 7 + node_modules/zustand/esm/shallow.js | 47 + node_modules/zustand/esm/shallow.mjs | 47 + node_modules/zustand/esm/traditional.d.mts | 21 + node_modules/zustand/esm/traditional.d.ts | 21 + node_modules/zustand/esm/traditional.js | 27 + node_modules/zustand/esm/traditional.mjs | 27 + node_modules/zustand/esm/vanilla.d.mts | 81 + node_modules/zustand/esm/vanilla.d.ts | 81 + node_modules/zustand/esm/vanilla.js | 40 + node_modules/zustand/esm/vanilla.mjs | 40 + .../zustand/esm/vanilla/shallow.d.mts | 1 + node_modules/zustand/esm/vanilla/shallow.d.ts | 1 + node_modules/zustand/esm/vanilla/shallow.js | 38 + node_modules/zustand/esm/vanilla/shallow.mjs | 38 + node_modules/zustand/index.d.ts | 3 + node_modules/zustand/index.js | 60 + node_modules/zustand/middleware.d.ts | 5 + node_modules/zustand/middleware.js | 609 + node_modules/zustand/middleware/combine.d.ts | 5 + node_modules/zustand/middleware/devtools.d.ts | 49 + node_modules/zustand/middleware/immer.d.ts | 25 + node_modules/zustand/middleware/immer.js | 19 + node_modules/zustand/middleware/persist.d.ts | 119 + node_modules/zustand/middleware/redux.d.ts | 21 + .../middleware/subscribeWithSelector.d.ts | 25 + node_modules/zustand/package.json | 232 + node_modules/zustand/react.d.ts | 38 + node_modules/zustand/react/shallow.d.ts | 1 + node_modules/zustand/react/shallow.js | 86 + node_modules/zustand/readme.md | 505 + node_modules/zustand/shallow.d.ts | 7 + node_modules/zustand/shallow.js | 87 + .../zustand/system/context.development.js | 73 + .../zustand/system/context.production.js | 1 + .../zustand/system/index.development.js | 71 + .../zustand/system/index.production.js | 1 + .../zustand/system/middleware.development.js | 592 + .../zustand/system/middleware.production.js | 5 + .../system/middleware/immer.development.js | 21 + .../system/middleware/immer.production.js | 1 + .../system/react/shallow.development.js | 60 + .../system/react/shallow.production.js | 1 + .../zustand/system/shallow.development.js | 56 + .../zustand/system/shallow.production.js | 1 + .../zustand/system/traditional.development.js | 40 + .../zustand/system/traditional.production.js | 1 + .../zustand/system/vanilla.development.js | 47 + .../zustand/system/vanilla.production.js | 1 + .../system/vanilla/shallow.development.js | 47 + .../system/vanilla/shallow.production.js | 1 + node_modules/zustand/traditional.d.ts | 21 + node_modules/zustand/traditional.js | 36 + node_modules/zustand/ts3.4/context.d.ts | 25 + node_modules/zustand/ts3.4/esm/context.d.ts | 25 + node_modules/zustand/ts3.4/esm/index.d.ts | 3 + .../zustand/ts3.4/esm/middleware.d.ts | 5 + .../zustand/ts3.4/esm/middleware/combine.d.ts | 13 + .../ts3.4/esm/middleware/devtools.d.ts | 102 + .../zustand/ts3.4/esm/middleware/immer.d.ts | 60 + .../zustand/ts3.4/esm/middleware/persist.d.ts | 139 + .../zustand/ts3.4/esm/middleware/redux.d.ts | 30 + .../esm/middleware/subscribeWithSelector.d.ts | 42 + node_modules/zustand/ts3.4/esm/react.d.ts | 48 + .../zustand/ts3.4/esm/react/shallow.d.ts | 1 + node_modules/zustand/ts3.4/esm/shallow.d.ts | 7 + .../zustand/ts3.4/esm/traditional.d.ts | 31 + node_modules/zustand/ts3.4/esm/vanilla.d.ts | 106 + .../zustand/ts3.4/esm/vanilla/shallow.d.ts | 1 + node_modules/zustand/ts3.4/index.d.ts | 3 + node_modules/zustand/ts3.4/middleware.d.ts | 5 + .../zustand/ts3.4/middleware/combine.d.ts | 13 + .../zustand/ts3.4/middleware/devtools.d.ts | 102 + .../zustand/ts3.4/middleware/immer.d.ts | 60 + .../zustand/ts3.4/middleware/persist.d.ts | 139 + .../zustand/ts3.4/middleware/redux.d.ts | 30 + .../middleware/subscribeWithSelector.d.ts | 42 + node_modules/zustand/ts3.4/react.d.ts | 48 + node_modules/zustand/ts3.4/react/shallow.d.ts | 1 + node_modules/zustand/ts3.4/shallow.d.ts | 7 + node_modules/zustand/ts3.4/traditional.d.ts | 31 + node_modules/zustand/ts3.4/vanilla.d.ts | 106 + .../zustand/ts3.4/vanilla/shallow.d.ts | 1 + .../zustand/umd/context.development.js | 63 + .../zustand/umd/context.production.js | 1 + node_modules/zustand/umd/index.development.js | 58 + node_modules/zustand/umd/index.production.js | 1 + .../zustand/umd/middleware.development.js | 615 + .../zustand/umd/middleware.production.js | 1 + .../umd/middleware/immer.development.js | 23 + .../umd/middleware/immer.production.js | 1 + .../zustand/umd/react/shallow.development.js | 90 + .../zustand/umd/react/shallow.production.js | 1 + .../zustand/umd/shallow.development.js | 91 + .../zustand/umd/shallow.production.js | 1 + .../zustand/umd/traditional.development.js | 38 + .../zustand/umd/traditional.production.js | 1 + .../zustand/umd/vanilla.development.js | 63 + .../zustand/umd/vanilla.production.js | 1 + .../umd/vanilla/shallow.development.js | 81 + .../zustand/umd/vanilla/shallow.production.js | 1 + node_modules/zustand/vanilla.d.ts | 81 + node_modules/zustand/vanilla.js | 59 + node_modules/zustand/vanilla/shallow.d.ts | 1 + node_modules/zustand/vanilla/shallow.js | 75 + package-lock.json | 295 +- package.json | 7 + .../components/CaseBuilder/CaseBuilder.tsx | 26 +- .../CaseBuilder/PipelineBlock.module.css | 25 + .../components/CaseBuilder/PipelineBlock.tsx | 124 + web/src/components/Common/Card.module.css | 22 + web/src/components/Common/Card.tsx | 13 + web/src/components/Common/Section.module.css | 6 + web/src/components/Common/Section.tsx | 11 + 1170 files changed, 242108 insertions(+), 5 deletions(-) create mode 100644 node_modules/.bin/nanoid create mode 100644 node_modules/.bin/nanoid.cmd create mode 100644 node_modules/.bin/nanoid.ps1 create mode 100644 node_modules/.package-lock.json create mode 100644 node_modules/@types/d3-color/LICENSE create mode 100644 node_modules/@types/d3-color/README.md create mode 100644 node_modules/@types/d3-color/index.d.ts create mode 100644 node_modules/@types/d3-color/package.json create mode 100644 node_modules/@types/d3-drag/LICENSE create mode 100644 node_modules/@types/d3-drag/README.md create mode 100644 node_modules/@types/d3-drag/index.d.ts create mode 100644 node_modules/@types/d3-drag/package.json create mode 100644 node_modules/@types/d3-interpolate/LICENSE create mode 100644 node_modules/@types/d3-interpolate/README.md create mode 100644 node_modules/@types/d3-interpolate/index.d.ts create mode 100644 node_modules/@types/d3-interpolate/package.json create mode 100644 node_modules/@types/d3-selection/LICENSE create mode 100644 node_modules/@types/d3-selection/README.md create mode 100644 node_modules/@types/d3-selection/index.d.ts create mode 100644 node_modules/@types/d3-selection/package.json create mode 100644 node_modules/@types/d3-transition/LICENSE create mode 100644 node_modules/@types/d3-transition/README.md create mode 100644 node_modules/@types/d3-transition/index.d.ts create mode 100644 node_modules/@types/d3-transition/package.json create mode 100644 node_modules/@types/d3-zoom/LICENSE create mode 100644 node_modules/@types/d3-zoom/README.md create mode 100644 node_modules/@types/d3-zoom/index.d.ts create mode 100644 node_modules/@types/d3-zoom/package.json create mode 100644 node_modules/@xyflow/react/LICENSE create mode 100644 node_modules/@xyflow/react/README.md create mode 100644 node_modules/@xyflow/react/dist/base.css create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/Background/Background.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/Background/Background.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/Background/Patterns.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/Background/Patterns.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/Background/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/Background/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/Background/types.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/Background/types.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/Controls/ControlButton.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/Controls/ControlButton.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/Controls/Controls.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/Controls/Controls.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/FitView.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/FitView.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Lock.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Lock.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Minus.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Minus.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Plus.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Plus.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Unlock.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Unlock.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/Controls/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/Controls/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/Controls/types.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/Controls/types.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/MiniMap.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/MiniMap.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/MiniMapNode.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/MiniMapNode.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/MiniMapNodes.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/MiniMapNodes.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/types.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/types.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/NodeResizeControl.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/NodeResizeControl.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/NodeResizer.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/NodeResizer.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/types.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/types.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/NodeToolbar.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/NodeToolbar.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/NodeToolbarPortal.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/NodeToolbarPortal.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/types.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/types.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/additional-components/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/components/A11yDescriptions/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/components/A11yDescriptions/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/components/Attribution/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/components/Attribution/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/components/BatchProvider/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/components/BatchProvider/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/components/BatchProvider/types.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/components/BatchProvider/types.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/components/BatchProvider/useQueue.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/components/BatchProvider/useQueue.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/components/ConnectionLine/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/components/ConnectionLine/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/components/EdgeLabelRenderer/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/components/EdgeLabelRenderer/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/components/EdgeWrapper/EdgeUpdateAnchors.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/components/EdgeWrapper/EdgeUpdateAnchors.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/components/EdgeWrapper/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/components/EdgeWrapper/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/components/EdgeWrapper/utils.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/components/EdgeWrapper/utils.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/components/Edges/BaseEdge.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/components/Edges/BaseEdge.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/components/Edges/BezierEdge.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/components/Edges/BezierEdge.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/components/Edges/EdgeAnchor.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/components/Edges/EdgeAnchor.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/components/Edges/EdgeText.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/components/Edges/EdgeText.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/components/Edges/SimpleBezierEdge.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/components/Edges/SimpleBezierEdge.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/components/Edges/SmoothStepEdge.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/components/Edges/SmoothStepEdge.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/components/Edges/StepEdge.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/components/Edges/StepEdge.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/components/Edges/StraightEdge.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/components/Edges/StraightEdge.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/components/Edges/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/components/Edges/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/components/Handle/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/components/Handle/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/components/NodeWrapper/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/components/NodeWrapper/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/components/NodeWrapper/useNodeObserver.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/components/NodeWrapper/useNodeObserver.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/components/NodeWrapper/utils.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/components/NodeWrapper/utils.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/components/Nodes/DefaultNode.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/components/Nodes/DefaultNode.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/components/Nodes/GroupNode.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/components/Nodes/GroupNode.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/components/Nodes/InputNode.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/components/Nodes/InputNode.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/components/Nodes/OutputNode.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/components/Nodes/OutputNode.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/components/Nodes/utils.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/components/Nodes/utils.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/components/NodesSelection/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/components/NodesSelection/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/components/Panel/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/components/Panel/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/components/ReactFlowProvider/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/components/ReactFlowProvider/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/components/SelectionListener/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/components/SelectionListener/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/components/StoreUpdater/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/components/StoreUpdater/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/components/UserSelection/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/components/UserSelection/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/components/ViewportPortal/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/components/ViewportPortal/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/container/EdgeRenderer/MarkerDefinitions.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/container/EdgeRenderer/MarkerDefinitions.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/container/EdgeRenderer/MarkerSymbols.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/container/EdgeRenderer/MarkerSymbols.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/container/EdgeRenderer/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/container/EdgeRenderer/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/container/FlowRenderer/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/container/FlowRenderer/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/container/GraphView/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/container/GraphView/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/container/GraphView/useNodeOrEdgeTypesWarning.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/container/GraphView/useNodeOrEdgeTypesWarning.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/container/GraphView/useStylesLoadedWarning.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/container/GraphView/useStylesLoadedWarning.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/container/NodeRenderer/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/container/NodeRenderer/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/container/NodeRenderer/useResizeObserver.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/container/NodeRenderer/useResizeObserver.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/container/Pane/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/container/Pane/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/container/ReactFlow/Wrapper.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/container/ReactFlow/Wrapper.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/container/ReactFlow/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/container/ReactFlow/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/container/ReactFlow/init-values.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/container/ReactFlow/init-values.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/container/Viewport/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/container/Viewport/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/container/ZoomPane/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/container/ZoomPane/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/contexts/NodeIdContext.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/contexts/NodeIdContext.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/contexts/StoreContext.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/contexts/StoreContext.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useColorModeClass.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useColorModeClass.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useConnection.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useConnection.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useDrag.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useDrag.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useEdges.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useEdges.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useGlobalKeyHandler.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useGlobalKeyHandler.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useHandleConnections.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useHandleConnections.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useInternalNode.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useInternalNode.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useIsomorphicLayoutEffect.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useIsomorphicLayoutEffect.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useKeyPress.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useKeyPress.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useMoveSelectedNodes.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useMoveSelectedNodes.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useNodeConnections.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useNodeConnections.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useNodes.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useNodes.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useNodesData.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useNodesData.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useNodesEdgesState.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useNodesEdgesState.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useNodesInitialized.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useNodesInitialized.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useOnInitHandler.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useOnInitHandler.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useOnSelectionChange.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useOnSelectionChange.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useOnViewportChange.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useOnViewportChange.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useReactFlow.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useReactFlow.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useResizeHandler.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useResizeHandler.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useStore.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useStore.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useUpdateNodeInternals.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useUpdateNodeInternals.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useViewport.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useViewport.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useViewportHelper.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useViewportHelper.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useViewportSync.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useViewportSync.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useVisibleEdgeIds.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useVisibleEdgeIds.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useVisibleNodeIds.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/hooks/useVisibleNodeIds.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/index.js create mode 100644 node_modules/@xyflow/react/dist/esm/index.mjs create mode 100644 node_modules/@xyflow/react/dist/esm/store/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/store/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/store/initialState.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/store/initialState.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/styles/utils.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/styles/utils.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/types/component-props.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/types/component-props.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/types/edges.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/types/edges.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/types/general.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/types/general.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/types/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/types/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/types/instance.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/types/instance.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/types/nodes.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/types/nodes.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/types/store.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/types/store.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/utils/changes.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/utils/changes.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/utils/general.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/utils/general.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/esm/utils/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/esm/utils/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/style.css create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/Background/Background.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/Background/Background.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/Background/Patterns.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/Background/Patterns.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/Background/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/Background/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/Background/types.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/Background/types.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/Controls/ControlButton.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/Controls/ControlButton.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/Controls/Controls.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/Controls/Controls.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/FitView.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/FitView.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Lock.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Lock.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Minus.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Minus.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Plus.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Plus.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Unlock.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Unlock.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/Controls/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/Controls/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/Controls/types.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/Controls/types.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/MiniMap.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/MiniMap.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/MiniMapNode.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/MiniMapNode.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/MiniMapNodes.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/MiniMapNodes.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/types.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/types.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/NodeResizeControl.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/NodeResizeControl.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/NodeResizer.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/NodeResizer.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/types.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/types.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/NodeToolbar.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/NodeToolbar.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/NodeToolbarPortal.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/NodeToolbarPortal.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/types.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/types.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/additional-components/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/components/A11yDescriptions/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/components/A11yDescriptions/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/components/Attribution/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/components/Attribution/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/components/BatchProvider/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/components/BatchProvider/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/components/BatchProvider/types.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/components/BatchProvider/types.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/components/BatchProvider/useQueue.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/components/BatchProvider/useQueue.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/components/ConnectionLine/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/components/ConnectionLine/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/components/EdgeLabelRenderer/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/components/EdgeLabelRenderer/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/components/EdgeWrapper/EdgeUpdateAnchors.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/components/EdgeWrapper/EdgeUpdateAnchors.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/components/EdgeWrapper/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/components/EdgeWrapper/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/components/EdgeWrapper/utils.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/components/EdgeWrapper/utils.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/components/Edges/BaseEdge.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/components/Edges/BaseEdge.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/components/Edges/BezierEdge.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/components/Edges/BezierEdge.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/components/Edges/EdgeAnchor.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/components/Edges/EdgeAnchor.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/components/Edges/EdgeText.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/components/Edges/EdgeText.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/components/Edges/SimpleBezierEdge.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/components/Edges/SimpleBezierEdge.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/components/Edges/SmoothStepEdge.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/components/Edges/SmoothStepEdge.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/components/Edges/StepEdge.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/components/Edges/StepEdge.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/components/Edges/StraightEdge.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/components/Edges/StraightEdge.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/components/Edges/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/components/Edges/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/components/Handle/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/components/Handle/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/components/NodeWrapper/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/components/NodeWrapper/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/components/NodeWrapper/useNodeObserver.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/components/NodeWrapper/useNodeObserver.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/components/NodeWrapper/utils.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/components/NodeWrapper/utils.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/components/Nodes/DefaultNode.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/components/Nodes/DefaultNode.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/components/Nodes/GroupNode.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/components/Nodes/GroupNode.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/components/Nodes/InputNode.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/components/Nodes/InputNode.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/components/Nodes/OutputNode.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/components/Nodes/OutputNode.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/components/Nodes/utils.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/components/Nodes/utils.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/components/NodesSelection/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/components/NodesSelection/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/components/Panel/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/components/Panel/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/components/ReactFlowProvider/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/components/ReactFlowProvider/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/components/SelectionListener/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/components/SelectionListener/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/components/StoreUpdater/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/components/StoreUpdater/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/components/UserSelection/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/components/UserSelection/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/components/ViewportPortal/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/components/ViewportPortal/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/container/EdgeRenderer/MarkerDefinitions.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/container/EdgeRenderer/MarkerDefinitions.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/container/EdgeRenderer/MarkerSymbols.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/container/EdgeRenderer/MarkerSymbols.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/container/EdgeRenderer/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/container/EdgeRenderer/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/container/FlowRenderer/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/container/FlowRenderer/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/container/GraphView/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/container/GraphView/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/container/GraphView/useNodeOrEdgeTypesWarning.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/container/GraphView/useNodeOrEdgeTypesWarning.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/container/GraphView/useStylesLoadedWarning.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/container/GraphView/useStylesLoadedWarning.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/container/NodeRenderer/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/container/NodeRenderer/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/container/NodeRenderer/useResizeObserver.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/container/NodeRenderer/useResizeObserver.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/container/Pane/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/container/Pane/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/container/ReactFlow/Wrapper.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/container/ReactFlow/Wrapper.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/container/ReactFlow/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/container/ReactFlow/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/container/ReactFlow/init-values.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/container/ReactFlow/init-values.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/container/Viewport/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/container/Viewport/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/container/ZoomPane/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/container/ZoomPane/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/contexts/NodeIdContext.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/contexts/NodeIdContext.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/contexts/StoreContext.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/contexts/StoreContext.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useColorModeClass.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useColorModeClass.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useConnection.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useConnection.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useDrag.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useDrag.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useEdges.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useEdges.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useGlobalKeyHandler.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useGlobalKeyHandler.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useHandleConnections.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useHandleConnections.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useInternalNode.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useInternalNode.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useIsomorphicLayoutEffect.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useIsomorphicLayoutEffect.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useKeyPress.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useKeyPress.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useMoveSelectedNodes.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useMoveSelectedNodes.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useNodeConnections.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useNodeConnections.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useNodes.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useNodes.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useNodesData.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useNodesData.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useNodesEdgesState.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useNodesEdgesState.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useNodesInitialized.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useNodesInitialized.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useOnInitHandler.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useOnInitHandler.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useOnSelectionChange.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useOnSelectionChange.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useOnViewportChange.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useOnViewportChange.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useReactFlow.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useReactFlow.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useResizeHandler.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useResizeHandler.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useStore.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useStore.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useUpdateNodeInternals.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useUpdateNodeInternals.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useViewport.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useViewport.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useViewportHelper.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useViewportHelper.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useViewportSync.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useViewportSync.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useVisibleEdgeIds.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useVisibleEdgeIds.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useVisibleNodeIds.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/hooks/useVisibleNodeIds.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/index.js create mode 100644 node_modules/@xyflow/react/dist/umd/store/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/store/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/store/initialState.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/store/initialState.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/styles/utils.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/styles/utils.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/types/component-props.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/types/component-props.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/types/edges.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/types/edges.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/types/general.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/types/general.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/types/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/types/index.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/types/instance.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/types/instance.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/types/nodes.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/types/nodes.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/types/store.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/types/store.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/utils/changes.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/utils/changes.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/utils/general.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/utils/general.d.ts.map create mode 100644 node_modules/@xyflow/react/dist/umd/utils/index.d.ts create mode 100644 node_modules/@xyflow/react/dist/umd/utils/index.d.ts.map create mode 100644 node_modules/@xyflow/react/package.json create mode 100644 node_modules/@xyflow/system/LICENSE create mode 100644 node_modules/@xyflow/system/README.md create mode 100644 node_modules/@xyflow/system/dist/esm/constants.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/constants.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/index.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/index.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/index.js create mode 100644 node_modules/@xyflow/system/dist/esm/index.mjs create mode 100644 node_modules/@xyflow/system/dist/esm/types/changes.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/types/changes.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/types/edges.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/types/edges.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/types/general.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/types/general.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/types/handles.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/types/handles.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/types/index.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/types/index.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/types/nodes.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/types/nodes.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/types/panzoom.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/types/panzoom.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/types/utils.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/types/utils.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/utils/connections.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/utils/connections.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/utils/dom.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/utils/dom.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/utils/edges/bezier-edge.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/utils/edges/bezier-edge.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/utils/edges/general.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/utils/edges/general.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/utils/edges/index.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/utils/edges/index.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/utils/edges/positions.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/utils/edges/positions.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/utils/edges/smoothstep-edge.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/utils/edges/smoothstep-edge.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/utils/edges/straight-edge.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/utils/edges/straight-edge.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/utils/general.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/utils/general.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/utils/graph.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/utils/graph.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/utils/index.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/utils/index.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/utils/marker.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/utils/marker.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/utils/node-toolbar.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/utils/node-toolbar.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/utils/shallow-node-data.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/utils/shallow-node-data.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/utils/store.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/utils/store.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/utils/types.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/utils/types.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/xydrag/XYDrag.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/xydrag/XYDrag.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/xydrag/index.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/xydrag/index.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/xydrag/utils.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/xydrag/utils.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/xyhandle/XYHandle.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/xyhandle/XYHandle.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/xyhandle/index.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/xyhandle/index.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/xyhandle/types.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/xyhandle/types.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/xyhandle/utils.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/xyhandle/utils.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/xyminimap/index.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/xyminimap/index.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/xypanzoom/XYPanZoom.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/xypanzoom/XYPanZoom.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/xypanzoom/eventhandler.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/xypanzoom/eventhandler.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/xypanzoom/filter.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/xypanzoom/filter.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/xypanzoom/index.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/xypanzoom/index.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/xypanzoom/utils.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/xypanzoom/utils.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/xyresizer/XYResizer.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/xyresizer/XYResizer.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/xyresizer/index.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/xyresizer/index.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/xyresizer/types.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/xyresizer/types.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/esm/xyresizer/utils.d.ts create mode 100644 node_modules/@xyflow/system/dist/esm/xyresizer/utils.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/constants.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/constants.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/index.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/index.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/index.js create mode 100644 node_modules/@xyflow/system/dist/umd/types/changes.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/types/changes.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/types/edges.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/types/edges.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/types/general.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/types/general.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/types/handles.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/types/handles.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/types/index.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/types/index.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/types/nodes.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/types/nodes.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/types/panzoom.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/types/panzoom.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/types/utils.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/types/utils.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/utils/connections.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/utils/connections.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/utils/dom.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/utils/dom.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/utils/edges/bezier-edge.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/utils/edges/bezier-edge.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/utils/edges/general.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/utils/edges/general.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/utils/edges/index.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/utils/edges/index.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/utils/edges/positions.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/utils/edges/positions.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/utils/edges/smoothstep-edge.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/utils/edges/smoothstep-edge.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/utils/edges/straight-edge.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/utils/edges/straight-edge.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/utils/general.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/utils/general.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/utils/graph.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/utils/graph.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/utils/index.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/utils/index.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/utils/marker.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/utils/marker.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/utils/node-toolbar.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/utils/node-toolbar.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/utils/shallow-node-data.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/utils/shallow-node-data.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/utils/store.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/utils/store.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/utils/types.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/utils/types.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/xydrag/XYDrag.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/xydrag/XYDrag.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/xydrag/index.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/xydrag/index.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/xydrag/utils.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/xydrag/utils.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/xyhandle/XYHandle.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/xyhandle/XYHandle.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/xyhandle/index.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/xyhandle/index.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/xyhandle/types.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/xyhandle/types.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/xyhandle/utils.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/xyhandle/utils.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/xyminimap/index.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/xyminimap/index.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/xypanzoom/XYPanZoom.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/xypanzoom/XYPanZoom.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/xypanzoom/eventhandler.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/xypanzoom/eventhandler.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/xypanzoom/filter.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/xypanzoom/filter.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/xypanzoom/index.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/xypanzoom/index.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/xypanzoom/utils.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/xypanzoom/utils.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/xyresizer/XYResizer.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/xyresizer/XYResizer.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/xyresizer/index.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/xyresizer/index.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/xyresizer/types.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/xyresizer/types.d.ts.map create mode 100644 node_modules/@xyflow/system/dist/umd/xyresizer/utils.d.ts create mode 100644 node_modules/@xyflow/system/dist/umd/xyresizer/utils.d.ts.map create mode 100644 node_modules/@xyflow/system/package.json create mode 100644 node_modules/classcat/LICENSE.md create mode 100644 node_modules/classcat/README.md create mode 100644 node_modules/classcat/index.cjs create mode 100644 node_modules/classcat/index.d.ts create mode 100644 node_modules/classcat/index.js create mode 100644 node_modules/classcat/package.json create mode 100644 node_modules/d3-color/LICENSE create mode 100644 node_modules/d3-color/README.md create mode 100644 node_modules/d3-color/dist/d3-color.js create mode 100644 node_modules/d3-color/dist/d3-color.min.js create mode 100644 node_modules/d3-color/package.json create mode 100644 node_modules/d3-color/src/color.js create mode 100644 node_modules/d3-color/src/cubehelix.js create mode 100644 node_modules/d3-color/src/define.js create mode 100644 node_modules/d3-color/src/index.js create mode 100644 node_modules/d3-color/src/lab.js create mode 100644 node_modules/d3-color/src/math.js create mode 100644 node_modules/d3-dispatch/LICENSE create mode 100644 node_modules/d3-dispatch/README.md create mode 100644 node_modules/d3-dispatch/dist/d3-dispatch.js create mode 100644 node_modules/d3-dispatch/dist/d3-dispatch.min.js create mode 100644 node_modules/d3-dispatch/package.json create mode 100644 node_modules/d3-dispatch/src/dispatch.js create mode 100644 node_modules/d3-dispatch/src/index.js create mode 100644 node_modules/d3-drag/LICENSE create mode 100644 node_modules/d3-drag/README.md create mode 100644 node_modules/d3-drag/dist/d3-drag.js create mode 100644 node_modules/d3-drag/dist/d3-drag.min.js create mode 100644 node_modules/d3-drag/package.json create mode 100644 node_modules/d3-drag/src/constant.js create mode 100644 node_modules/d3-drag/src/drag.js create mode 100644 node_modules/d3-drag/src/event.js create mode 100644 node_modules/d3-drag/src/index.js create mode 100644 node_modules/d3-drag/src/nodrag.js create mode 100644 node_modules/d3-drag/src/noevent.js create mode 100644 node_modules/d3-ease/LICENSE create mode 100644 node_modules/d3-ease/README.md create mode 100644 node_modules/d3-ease/dist/d3-ease.js create mode 100644 node_modules/d3-ease/dist/d3-ease.min.js create mode 100644 node_modules/d3-ease/package.json create mode 100644 node_modules/d3-ease/src/back.js create mode 100644 node_modules/d3-ease/src/bounce.js create mode 100644 node_modules/d3-ease/src/circle.js create mode 100644 node_modules/d3-ease/src/cubic.js create mode 100644 node_modules/d3-ease/src/elastic.js create mode 100644 node_modules/d3-ease/src/exp.js create mode 100644 node_modules/d3-ease/src/index.js create mode 100644 node_modules/d3-ease/src/linear.js create mode 100644 node_modules/d3-ease/src/math.js create mode 100644 node_modules/d3-ease/src/poly.js create mode 100644 node_modules/d3-ease/src/quad.js create mode 100644 node_modules/d3-ease/src/sin.js create mode 100644 node_modules/d3-interpolate/LICENSE create mode 100644 node_modules/d3-interpolate/README.md create mode 100644 node_modules/d3-interpolate/dist/d3-interpolate.js create mode 100644 node_modules/d3-interpolate/dist/d3-interpolate.min.js create mode 100644 node_modules/d3-interpolate/package.json create mode 100644 node_modules/d3-interpolate/src/array.js create mode 100644 node_modules/d3-interpolate/src/basis.js create mode 100644 node_modules/d3-interpolate/src/basisClosed.js create mode 100644 node_modules/d3-interpolate/src/color.js create mode 100644 node_modules/d3-interpolate/src/constant.js create mode 100644 node_modules/d3-interpolate/src/cubehelix.js create mode 100644 node_modules/d3-interpolate/src/date.js create mode 100644 node_modules/d3-interpolate/src/discrete.js create mode 100644 node_modules/d3-interpolate/src/hcl.js create mode 100644 node_modules/d3-interpolate/src/hsl.js create mode 100644 node_modules/d3-interpolate/src/hue.js create mode 100644 node_modules/d3-interpolate/src/index.js create mode 100644 node_modules/d3-interpolate/src/lab.js create mode 100644 node_modules/d3-interpolate/src/number.js create mode 100644 node_modules/d3-interpolate/src/numberArray.js create mode 100644 node_modules/d3-interpolate/src/object.js create mode 100644 node_modules/d3-interpolate/src/piecewise.js create mode 100644 node_modules/d3-interpolate/src/quantize.js create mode 100644 node_modules/d3-interpolate/src/rgb.js create mode 100644 node_modules/d3-interpolate/src/round.js create mode 100644 node_modules/d3-interpolate/src/string.js create mode 100644 node_modules/d3-interpolate/src/transform/decompose.js create mode 100644 node_modules/d3-interpolate/src/transform/index.js create mode 100644 node_modules/d3-interpolate/src/transform/parse.js create mode 100644 node_modules/d3-interpolate/src/value.js create mode 100644 node_modules/d3-interpolate/src/zoom.js create mode 100644 node_modules/d3-selection/LICENSE create mode 100644 node_modules/d3-selection/README.md create mode 100644 node_modules/d3-selection/dist/d3-selection.js create mode 100644 node_modules/d3-selection/dist/d3-selection.min.js create mode 100644 node_modules/d3-selection/package.json create mode 100644 node_modules/d3-selection/src/array.js create mode 100644 node_modules/d3-selection/src/constant.js create mode 100644 node_modules/d3-selection/src/create.js create mode 100644 node_modules/d3-selection/src/creator.js create mode 100644 node_modules/d3-selection/src/identity.js create mode 100644 node_modules/d3-selection/src/index.js create mode 100644 node_modules/d3-selection/src/local.js create mode 100644 node_modules/d3-selection/src/matcher.js create mode 100644 node_modules/d3-selection/src/namespace.js create mode 100644 node_modules/d3-selection/src/namespaces.js create mode 100644 node_modules/d3-selection/src/pointer.js create mode 100644 node_modules/d3-selection/src/pointers.js create mode 100644 node_modules/d3-selection/src/select.js create mode 100644 node_modules/d3-selection/src/selectAll.js create mode 100644 node_modules/d3-selection/src/selection/append.js create mode 100644 node_modules/d3-selection/src/selection/attr.js create mode 100644 node_modules/d3-selection/src/selection/call.js create mode 100644 node_modules/d3-selection/src/selection/classed.js create mode 100644 node_modules/d3-selection/src/selection/clone.js create mode 100644 node_modules/d3-selection/src/selection/data.js create mode 100644 node_modules/d3-selection/src/selection/datum.js create mode 100644 node_modules/d3-selection/src/selection/dispatch.js create mode 100644 node_modules/d3-selection/src/selection/each.js create mode 100644 node_modules/d3-selection/src/selection/empty.js create mode 100644 node_modules/d3-selection/src/selection/enter.js create mode 100644 node_modules/d3-selection/src/selection/exit.js create mode 100644 node_modules/d3-selection/src/selection/filter.js create mode 100644 node_modules/d3-selection/src/selection/html.js create mode 100644 node_modules/d3-selection/src/selection/index.js create mode 100644 node_modules/d3-selection/src/selection/insert.js create mode 100644 node_modules/d3-selection/src/selection/iterator.js create mode 100644 node_modules/d3-selection/src/selection/join.js create mode 100644 node_modules/d3-selection/src/selection/lower.js create mode 100644 node_modules/d3-selection/src/selection/merge.js create mode 100644 node_modules/d3-selection/src/selection/node.js create mode 100644 node_modules/d3-selection/src/selection/nodes.js create mode 100644 node_modules/d3-selection/src/selection/on.js create mode 100644 node_modules/d3-selection/src/selection/order.js create mode 100644 node_modules/d3-selection/src/selection/property.js create mode 100644 node_modules/d3-selection/src/selection/raise.js create mode 100644 node_modules/d3-selection/src/selection/remove.js create mode 100644 node_modules/d3-selection/src/selection/select.js create mode 100644 node_modules/d3-selection/src/selection/selectAll.js create mode 100644 node_modules/d3-selection/src/selection/selectChild.js create mode 100644 node_modules/d3-selection/src/selection/selectChildren.js create mode 100644 node_modules/d3-selection/src/selection/size.js create mode 100644 node_modules/d3-selection/src/selection/sort.js create mode 100644 node_modules/d3-selection/src/selection/sparse.js create mode 100644 node_modules/d3-selection/src/selection/style.js create mode 100644 node_modules/d3-selection/src/selection/text.js create mode 100644 node_modules/d3-selection/src/selector.js create mode 100644 node_modules/d3-selection/src/selectorAll.js create mode 100644 node_modules/d3-selection/src/sourceEvent.js create mode 100644 node_modules/d3-selection/src/window.js create mode 100644 node_modules/d3-timer/LICENSE create mode 100644 node_modules/d3-timer/README.md create mode 100644 node_modules/d3-timer/dist/d3-timer.js create mode 100644 node_modules/d3-timer/dist/d3-timer.min.js create mode 100644 node_modules/d3-timer/package.json create mode 100644 node_modules/d3-timer/src/index.js create mode 100644 node_modules/d3-timer/src/interval.js create mode 100644 node_modules/d3-timer/src/timeout.js create mode 100644 node_modules/d3-timer/src/timer.js create mode 100644 node_modules/d3-transition/LICENSE create mode 100644 node_modules/d3-transition/README.md create mode 100644 node_modules/d3-transition/dist/d3-transition.js create mode 100644 node_modules/d3-transition/dist/d3-transition.min.js create mode 100644 node_modules/d3-transition/package.json create mode 100644 node_modules/d3-transition/src/active.js create mode 100644 node_modules/d3-transition/src/index.js create mode 100644 node_modules/d3-transition/src/interrupt.js create mode 100644 node_modules/d3-transition/src/selection/index.js create mode 100644 node_modules/d3-transition/src/selection/interrupt.js create mode 100644 node_modules/d3-transition/src/selection/transition.js create mode 100644 node_modules/d3-transition/src/transition/attr.js create mode 100644 node_modules/d3-transition/src/transition/attrTween.js create mode 100644 node_modules/d3-transition/src/transition/delay.js create mode 100644 node_modules/d3-transition/src/transition/duration.js create mode 100644 node_modules/d3-transition/src/transition/ease.js create mode 100644 node_modules/d3-transition/src/transition/easeVarying.js create mode 100644 node_modules/d3-transition/src/transition/end.js create mode 100644 node_modules/d3-transition/src/transition/filter.js create mode 100644 node_modules/d3-transition/src/transition/index.js create mode 100644 node_modules/d3-transition/src/transition/interpolate.js create mode 100644 node_modules/d3-transition/src/transition/merge.js create mode 100644 node_modules/d3-transition/src/transition/on.js create mode 100644 node_modules/d3-transition/src/transition/remove.js create mode 100644 node_modules/d3-transition/src/transition/schedule.js create mode 100644 node_modules/d3-transition/src/transition/select.js create mode 100644 node_modules/d3-transition/src/transition/selectAll.js create mode 100644 node_modules/d3-transition/src/transition/selection.js create mode 100644 node_modules/d3-transition/src/transition/style.js create mode 100644 node_modules/d3-transition/src/transition/styleTween.js create mode 100644 node_modules/d3-transition/src/transition/text.js create mode 100644 node_modules/d3-transition/src/transition/textTween.js create mode 100644 node_modules/d3-transition/src/transition/transition.js create mode 100644 node_modules/d3-transition/src/transition/tween.js create mode 100644 node_modules/d3-zoom/LICENSE create mode 100644 node_modules/d3-zoom/README.md create mode 100644 node_modules/d3-zoom/dist/d3-zoom.js create mode 100644 node_modules/d3-zoom/dist/d3-zoom.min.js create mode 100644 node_modules/d3-zoom/package.json create mode 100644 node_modules/d3-zoom/src/constant.js create mode 100644 node_modules/d3-zoom/src/event.js create mode 100644 node_modules/d3-zoom/src/index.js create mode 100644 node_modules/d3-zoom/src/noevent.js create mode 100644 node_modules/d3-zoom/src/transform.js create mode 100644 node_modules/d3-zoom/src/zoom.js create mode 100644 node_modules/i/.github/dependabot.yml create mode 100644 node_modules/i/.github/workflows/ci.yml create mode 100644 node_modules/i/LICENSE create mode 100644 node_modules/i/README.md create mode 100644 node_modules/i/lib/defaults.js create mode 100644 node_modules/i/lib/inflect.js create mode 100644 node_modules/i/lib/inflections.js create mode 100644 node_modules/i/lib/methods.js create mode 100644 node_modules/i/lib/native.js create mode 100644 node_modules/i/lib/util.js create mode 100644 node_modules/i/package.json create mode 100644 node_modules/i/test/inflector/cases.js create mode 100644 node_modules/i/test/inflector/inflections-test.js create mode 100644 node_modules/i/test/inflector/methods-test.js create mode 100644 node_modules/i/test/utils/array-test.js create mode 100644 node_modules/i/test/utils/string-test.js create mode 100644 node_modules/nanoid/LICENSE create mode 100644 node_modules/nanoid/README.md create mode 100644 node_modules/nanoid/bin/nanoid.js create mode 100644 node_modules/nanoid/index.browser.js create mode 100644 node_modules/nanoid/index.d.ts create mode 100644 node_modules/nanoid/index.js create mode 100644 node_modules/nanoid/nanoid.js create mode 100644 node_modules/nanoid/non-secure/index.d.ts create mode 100644 node_modules/nanoid/non-secure/index.js create mode 100644 node_modules/nanoid/package.json create mode 100644 node_modules/nanoid/url-alphabet/index.js create mode 100644 node_modules/react-dom/LICENSE create mode 100644 node_modules/react-dom/README.md create mode 100644 node_modules/react-dom/cjs/react-dom-client.development.js create mode 100644 node_modules/react-dom/cjs/react-dom-client.production.js create mode 100644 node_modules/react-dom/cjs/react-dom-profiling.development.js create mode 100644 node_modules/react-dom/cjs/react-dom-profiling.profiling.js create mode 100644 node_modules/react-dom/cjs/react-dom-server-legacy.browser.development.js create mode 100644 node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.js create mode 100644 node_modules/react-dom/cjs/react-dom-server-legacy.node.development.js create mode 100644 node_modules/react-dom/cjs/react-dom-server-legacy.node.production.js create mode 100644 node_modules/react-dom/cjs/react-dom-server.browser.development.js create mode 100644 node_modules/react-dom/cjs/react-dom-server.browser.production.js create mode 100644 node_modules/react-dom/cjs/react-dom-server.bun.development.js create mode 100644 node_modules/react-dom/cjs/react-dom-server.bun.production.js create mode 100644 node_modules/react-dom/cjs/react-dom-server.edge.development.js create mode 100644 node_modules/react-dom/cjs/react-dom-server.edge.production.js create mode 100644 node_modules/react-dom/cjs/react-dom-server.node.development.js create mode 100644 node_modules/react-dom/cjs/react-dom-server.node.production.js create mode 100644 node_modules/react-dom/cjs/react-dom-test-utils.development.js create mode 100644 node_modules/react-dom/cjs/react-dom-test-utils.production.js create mode 100644 node_modules/react-dom/cjs/react-dom.development.js create mode 100644 node_modules/react-dom/cjs/react-dom.production.js create mode 100644 node_modules/react-dom/cjs/react-dom.react-server.development.js create mode 100644 node_modules/react-dom/cjs/react-dom.react-server.production.js create mode 100644 node_modules/react-dom/client.js create mode 100644 node_modules/react-dom/client.react-server.js create mode 100644 node_modules/react-dom/index.js create mode 100644 node_modules/react-dom/package.json create mode 100644 node_modules/react-dom/profiling.js create mode 100644 node_modules/react-dom/profiling.react-server.js create mode 100644 node_modules/react-dom/react-dom.react-server.js create mode 100644 node_modules/react-dom/server.browser.js create mode 100644 node_modules/react-dom/server.bun.js create mode 100644 node_modules/react-dom/server.edge.js create mode 100644 node_modules/react-dom/server.js create mode 100644 node_modules/react-dom/server.node.js create mode 100644 node_modules/react-dom/server.react-server.js create mode 100644 node_modules/react-dom/static.browser.js create mode 100644 node_modules/react-dom/static.edge.js create mode 100644 node_modules/react-dom/static.js create mode 100644 node_modules/react-dom/static.node.js create mode 100644 node_modules/react-dom/static.react-server.js create mode 100644 node_modules/react-dom/test-utils.js create mode 100644 node_modules/react/LICENSE create mode 100644 node_modules/react/README.md create mode 100644 node_modules/react/cjs/react-compiler-runtime.development.js create mode 100644 node_modules/react/cjs/react-compiler-runtime.production.js create mode 100644 node_modules/react/cjs/react-compiler-runtime.profiling.js create mode 100644 node_modules/react/cjs/react-jsx-dev-runtime.development.js create mode 100644 node_modules/react/cjs/react-jsx-dev-runtime.production.js create mode 100644 node_modules/react/cjs/react-jsx-dev-runtime.profiling.js create mode 100644 node_modules/react/cjs/react-jsx-dev-runtime.react-server.development.js create mode 100644 node_modules/react/cjs/react-jsx-dev-runtime.react-server.production.js create mode 100644 node_modules/react/cjs/react-jsx-runtime.development.js create mode 100644 node_modules/react/cjs/react-jsx-runtime.production.js create mode 100644 node_modules/react/cjs/react-jsx-runtime.profiling.js create mode 100644 node_modules/react/cjs/react-jsx-runtime.react-server.development.js create mode 100644 node_modules/react/cjs/react-jsx-runtime.react-server.production.js create mode 100644 node_modules/react/cjs/react.development.js create mode 100644 node_modules/react/cjs/react.production.js create mode 100644 node_modules/react/cjs/react.react-server.development.js create mode 100644 node_modules/react/cjs/react.react-server.production.js create mode 100644 node_modules/react/compiler-runtime.js create mode 100644 node_modules/react/index.js create mode 100644 node_modules/react/jsx-dev-runtime.js create mode 100644 node_modules/react/jsx-dev-runtime.react-server.js create mode 100644 node_modules/react/jsx-runtime.js create mode 100644 node_modules/react/jsx-runtime.react-server.js create mode 100644 node_modules/react/package.json create mode 100644 node_modules/react/react.react-server.js create mode 100644 node_modules/scheduler/LICENSE create mode 100644 node_modules/scheduler/README.md create mode 100644 node_modules/scheduler/cjs/scheduler-unstable_mock.development.js create mode 100644 node_modules/scheduler/cjs/scheduler-unstable_mock.production.js create mode 100644 node_modules/scheduler/cjs/scheduler-unstable_post_task.development.js create mode 100644 node_modules/scheduler/cjs/scheduler-unstable_post_task.production.js create mode 100644 node_modules/scheduler/cjs/scheduler.development.js create mode 100644 node_modules/scheduler/cjs/scheduler.native.development.js create mode 100644 node_modules/scheduler/cjs/scheduler.native.production.js create mode 100644 node_modules/scheduler/cjs/scheduler.production.js create mode 100644 node_modules/scheduler/index.js create mode 100644 node_modules/scheduler/index.native.js create mode 100644 node_modules/scheduler/package.json create mode 100644 node_modules/scheduler/unstable_mock.js create mode 100644 node_modules/scheduler/unstable_post_task.js create mode 100644 node_modules/use-sync-external-store/LICENSE create mode 100644 node_modules/use-sync-external-store/README.md create mode 100644 node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js create mode 100644 node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.native.development.js create mode 100644 node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.native.production.js create mode 100644 node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js create mode 100644 node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js create mode 100644 node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js create mode 100644 node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js create mode 100644 node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.js create mode 100644 node_modules/use-sync-external-store/cjs/use-sync-external-store.development.js create mode 100644 node_modules/use-sync-external-store/cjs/use-sync-external-store.production.js create mode 100644 node_modules/use-sync-external-store/index.js create mode 100644 node_modules/use-sync-external-store/package.json create mode 100644 node_modules/use-sync-external-store/shim/index.js create mode 100644 node_modules/use-sync-external-store/shim/index.native.js create mode 100644 node_modules/use-sync-external-store/shim/with-selector.js create mode 100644 node_modules/use-sync-external-store/with-selector.js create mode 100644 node_modules/zustand/LICENSE create mode 100644 node_modules/zustand/context.d.ts create mode 100644 node_modules/zustand/context.js create mode 100644 node_modules/zustand/esm/context.d.mts create mode 100644 node_modules/zustand/esm/context.d.ts create mode 100644 node_modules/zustand/esm/context.js create mode 100644 node_modules/zustand/esm/context.mjs create mode 100644 node_modules/zustand/esm/index.d.mts create mode 100644 node_modules/zustand/esm/index.d.ts create mode 100644 node_modules/zustand/esm/index.js create mode 100644 node_modules/zustand/esm/index.mjs create mode 100644 node_modules/zustand/esm/middleware.d.mts create mode 100644 node_modules/zustand/esm/middleware.d.ts create mode 100644 node_modules/zustand/esm/middleware.js create mode 100644 node_modules/zustand/esm/middleware.mjs create mode 100644 node_modules/zustand/esm/middleware/combine.d.mts create mode 100644 node_modules/zustand/esm/middleware/combine.d.ts create mode 100644 node_modules/zustand/esm/middleware/devtools.d.mts create mode 100644 node_modules/zustand/esm/middleware/devtools.d.ts create mode 100644 node_modules/zustand/esm/middleware/immer.d.mts create mode 100644 node_modules/zustand/esm/middleware/immer.d.ts create mode 100644 node_modules/zustand/esm/middleware/immer.js create mode 100644 node_modules/zustand/esm/middleware/immer.mjs create mode 100644 node_modules/zustand/esm/middleware/persist.d.mts create mode 100644 node_modules/zustand/esm/middleware/persist.d.ts create mode 100644 node_modules/zustand/esm/middleware/redux.d.mts create mode 100644 node_modules/zustand/esm/middleware/redux.d.ts create mode 100644 node_modules/zustand/esm/middleware/subscribeWithSelector.d.mts create mode 100644 node_modules/zustand/esm/middleware/subscribeWithSelector.d.ts create mode 100644 node_modules/zustand/esm/react.d.mts create mode 100644 node_modules/zustand/esm/react.d.ts create mode 100644 node_modules/zustand/esm/react/shallow.d.mts create mode 100644 node_modules/zustand/esm/react/shallow.d.ts create mode 100644 node_modules/zustand/esm/react/shallow.js create mode 100644 node_modules/zustand/esm/react/shallow.mjs create mode 100644 node_modules/zustand/esm/shallow.d.mts create mode 100644 node_modules/zustand/esm/shallow.d.ts create mode 100644 node_modules/zustand/esm/shallow.js create mode 100644 node_modules/zustand/esm/shallow.mjs create mode 100644 node_modules/zustand/esm/traditional.d.mts create mode 100644 node_modules/zustand/esm/traditional.d.ts create mode 100644 node_modules/zustand/esm/traditional.js create mode 100644 node_modules/zustand/esm/traditional.mjs create mode 100644 node_modules/zustand/esm/vanilla.d.mts create mode 100644 node_modules/zustand/esm/vanilla.d.ts create mode 100644 node_modules/zustand/esm/vanilla.js create mode 100644 node_modules/zustand/esm/vanilla.mjs create mode 100644 node_modules/zustand/esm/vanilla/shallow.d.mts create mode 100644 node_modules/zustand/esm/vanilla/shallow.d.ts create mode 100644 node_modules/zustand/esm/vanilla/shallow.js create mode 100644 node_modules/zustand/esm/vanilla/shallow.mjs create mode 100644 node_modules/zustand/index.d.ts create mode 100644 node_modules/zustand/index.js create mode 100644 node_modules/zustand/middleware.d.ts create mode 100644 node_modules/zustand/middleware.js create mode 100644 node_modules/zustand/middleware/combine.d.ts create mode 100644 node_modules/zustand/middleware/devtools.d.ts create mode 100644 node_modules/zustand/middleware/immer.d.ts create mode 100644 node_modules/zustand/middleware/immer.js create mode 100644 node_modules/zustand/middleware/persist.d.ts create mode 100644 node_modules/zustand/middleware/redux.d.ts create mode 100644 node_modules/zustand/middleware/subscribeWithSelector.d.ts create mode 100644 node_modules/zustand/package.json create mode 100644 node_modules/zustand/react.d.ts create mode 100644 node_modules/zustand/react/shallow.d.ts create mode 100644 node_modules/zustand/react/shallow.js create mode 100644 node_modules/zustand/readme.md create mode 100644 node_modules/zustand/shallow.d.ts create mode 100644 node_modules/zustand/shallow.js create mode 100644 node_modules/zustand/system/context.development.js create mode 100644 node_modules/zustand/system/context.production.js create mode 100644 node_modules/zustand/system/index.development.js create mode 100644 node_modules/zustand/system/index.production.js create mode 100644 node_modules/zustand/system/middleware.development.js create mode 100644 node_modules/zustand/system/middleware.production.js create mode 100644 node_modules/zustand/system/middleware/immer.development.js create mode 100644 node_modules/zustand/system/middleware/immer.production.js create mode 100644 node_modules/zustand/system/react/shallow.development.js create mode 100644 node_modules/zustand/system/react/shallow.production.js create mode 100644 node_modules/zustand/system/shallow.development.js create mode 100644 node_modules/zustand/system/shallow.production.js create mode 100644 node_modules/zustand/system/traditional.development.js create mode 100644 node_modules/zustand/system/traditional.production.js create mode 100644 node_modules/zustand/system/vanilla.development.js create mode 100644 node_modules/zustand/system/vanilla.production.js create mode 100644 node_modules/zustand/system/vanilla/shallow.development.js create mode 100644 node_modules/zustand/system/vanilla/shallow.production.js create mode 100644 node_modules/zustand/traditional.d.ts create mode 100644 node_modules/zustand/traditional.js create mode 100644 node_modules/zustand/ts3.4/context.d.ts create mode 100644 node_modules/zustand/ts3.4/esm/context.d.ts create mode 100644 node_modules/zustand/ts3.4/esm/index.d.ts create mode 100644 node_modules/zustand/ts3.4/esm/middleware.d.ts create mode 100644 node_modules/zustand/ts3.4/esm/middleware/combine.d.ts create mode 100644 node_modules/zustand/ts3.4/esm/middleware/devtools.d.ts create mode 100644 node_modules/zustand/ts3.4/esm/middleware/immer.d.ts create mode 100644 node_modules/zustand/ts3.4/esm/middleware/persist.d.ts create mode 100644 node_modules/zustand/ts3.4/esm/middleware/redux.d.ts create mode 100644 node_modules/zustand/ts3.4/esm/middleware/subscribeWithSelector.d.ts create mode 100644 node_modules/zustand/ts3.4/esm/react.d.ts create mode 100644 node_modules/zustand/ts3.4/esm/react/shallow.d.ts create mode 100644 node_modules/zustand/ts3.4/esm/shallow.d.ts create mode 100644 node_modules/zustand/ts3.4/esm/traditional.d.ts create mode 100644 node_modules/zustand/ts3.4/esm/vanilla.d.ts create mode 100644 node_modules/zustand/ts3.4/esm/vanilla/shallow.d.ts create mode 100644 node_modules/zustand/ts3.4/index.d.ts create mode 100644 node_modules/zustand/ts3.4/middleware.d.ts create mode 100644 node_modules/zustand/ts3.4/middleware/combine.d.ts create mode 100644 node_modules/zustand/ts3.4/middleware/devtools.d.ts create mode 100644 node_modules/zustand/ts3.4/middleware/immer.d.ts create mode 100644 node_modules/zustand/ts3.4/middleware/persist.d.ts create mode 100644 node_modules/zustand/ts3.4/middleware/redux.d.ts create mode 100644 node_modules/zustand/ts3.4/middleware/subscribeWithSelector.d.ts create mode 100644 node_modules/zustand/ts3.4/react.d.ts create mode 100644 node_modules/zustand/ts3.4/react/shallow.d.ts create mode 100644 node_modules/zustand/ts3.4/shallow.d.ts create mode 100644 node_modules/zustand/ts3.4/traditional.d.ts create mode 100644 node_modules/zustand/ts3.4/vanilla.d.ts create mode 100644 node_modules/zustand/ts3.4/vanilla/shallow.d.ts create mode 100644 node_modules/zustand/umd/context.development.js create mode 100644 node_modules/zustand/umd/context.production.js create mode 100644 node_modules/zustand/umd/index.development.js create mode 100644 node_modules/zustand/umd/index.production.js create mode 100644 node_modules/zustand/umd/middleware.development.js create mode 100644 node_modules/zustand/umd/middleware.production.js create mode 100644 node_modules/zustand/umd/middleware/immer.development.js create mode 100644 node_modules/zustand/umd/middleware/immer.production.js create mode 100644 node_modules/zustand/umd/react/shallow.development.js create mode 100644 node_modules/zustand/umd/react/shallow.production.js create mode 100644 node_modules/zustand/umd/shallow.development.js create mode 100644 node_modules/zustand/umd/shallow.production.js create mode 100644 node_modules/zustand/umd/traditional.development.js create mode 100644 node_modules/zustand/umd/traditional.production.js create mode 100644 node_modules/zustand/umd/vanilla.development.js create mode 100644 node_modules/zustand/umd/vanilla.production.js create mode 100644 node_modules/zustand/umd/vanilla/shallow.development.js create mode 100644 node_modules/zustand/umd/vanilla/shallow.production.js create mode 100644 node_modules/zustand/vanilla.d.ts create mode 100644 node_modules/zustand/vanilla.js create mode 100644 node_modules/zustand/vanilla/shallow.d.ts create mode 100644 node_modules/zustand/vanilla/shallow.js create mode 100644 package.json create mode 100644 web/src/components/CaseBuilder/PipelineBlock.module.css create mode 100644 web/src/components/CaseBuilder/PipelineBlock.tsx create mode 100644 web/src/components/Common/Card.module.css create mode 100644 web/src/components/Common/Card.tsx create mode 100644 web/src/components/Common/Section.module.css create mode 100644 web/src/components/Common/Section.tsx diff --git a/node_modules/.bin/nanoid b/node_modules/.bin/nanoid new file mode 100644 index 0000000..fd093c0 --- /dev/null +++ b/node_modules/.bin/nanoid @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../nanoid/bin/nanoid.js" "$@" +else + exec node "$basedir/../nanoid/bin/nanoid.js" "$@" +fi diff --git a/node_modules/.bin/nanoid.cmd b/node_modules/.bin/nanoid.cmd new file mode 100644 index 0000000..87f0842 --- /dev/null +++ b/node_modules/.bin/nanoid.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\nanoid\bin\nanoid.js" %* diff --git a/node_modules/.bin/nanoid.ps1 b/node_modules/.bin/nanoid.ps1 new file mode 100644 index 0000000..954cf93 --- /dev/null +++ b/node_modules/.bin/nanoid.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../nanoid/bin/nanoid.js" $args + } else { + & "$basedir/node$exe" "$basedir/../nanoid/bin/nanoid.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../nanoid/bin/nanoid.js" $args + } else { + & "node$exe" "$basedir/../nanoid/bin/nanoid.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json new file mode 100644 index 0000000..b9cbfc6 --- /dev/null +++ b/node_modules/.package-lock.json @@ -0,0 +1,292 @@ +{ + "name": "RELOG", + "lockfileVersion": 3, + "requires": true, + "packages": { + "node_modules/@types/d3-color": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/@types/d3-color/-/d3-color-3.1.3.tgz", + "integrity": "sha512-iO90scth9WAbmgv7ogoq57O9YpKmFBbmoEoCHDB2xMBY0+/KVrqAaCDyCE16dUspeOvIxFFRI+0sEtqDqy2b4A==", + "license": "MIT" + }, + "node_modules/@types/d3-drag": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@types/d3-drag/-/d3-drag-3.0.7.tgz", + "integrity": "sha512-HE3jVKlzU9AaMazNufooRJ5ZpWmLIoc90A37WU2JMmeq28w1FQqCZswHZ3xR+SuxYftzHq6WU6KJHvqxKzTxxQ==", + "license": "MIT", + "dependencies": { + "@types/d3-selection": "*" + } + }, + "node_modules/@types/d3-interpolate": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/d3-interpolate/-/d3-interpolate-3.0.4.tgz", + "integrity": "sha512-mgLPETlrpVV1YRJIglr4Ez47g7Yxjl1lj7YKsiMCb27VJH9W8NVM6Bb9d8kkpG/uAQS5AmbA48q2IAolKKo1MA==", + "license": "MIT", + "dependencies": { + "@types/d3-color": "*" + } + }, + "node_modules/@types/d3-selection": { + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/@types/d3-selection/-/d3-selection-3.0.11.tgz", + "integrity": "sha512-bhAXu23DJWsrI45xafYpkQ4NtcKMwWnAC/vKrd2l+nxMFuvOT3XMYTIj2opv8vq8AO5Yh7Qac/nSeP/3zjTK0w==", + "license": "MIT" + }, + "node_modules/@types/d3-transition": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/@types/d3-transition/-/d3-transition-3.0.9.tgz", + "integrity": "sha512-uZS5shfxzO3rGlu0cC3bjmMFKsXv+SmZZcgp0KD22ts4uGXp5EVYGzu/0YdwZeKmddhcAccYtREJKkPfXkZuCg==", + "license": "MIT", + "dependencies": { + "@types/d3-selection": "*" + } + }, + "node_modules/@types/d3-zoom": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/@types/d3-zoom/-/d3-zoom-3.0.8.tgz", + "integrity": "sha512-iqMC4/YlFCSlO8+2Ii1GGGliCAY4XdeG748w5vQUbevlbDu0zSjH/+jojorQVBK/se0j6DUFNPBGSqD3YWYnDw==", + "license": "MIT", + "dependencies": { + "@types/d3-interpolate": "*", + "@types/d3-selection": "*" + } + }, + "node_modules/@xyflow/react": { + "version": "12.7.0", + "resolved": "https://registry.npmjs.org/@xyflow/react/-/react-12.7.0.tgz", + "integrity": "sha512-U6VMEbYjiCg1byHrR7S+b5ZdHTjgCFX4KpBc634G/WtEBUvBLoMQdlCD6uJHqodnOAxpt3+G2wiDeTmXAFJzgQ==", + "license": "MIT", + "dependencies": { + "@xyflow/system": "0.0.62", + "classcat": "^5.0.3", + "zustand": "^4.4.0" + }, + "peerDependencies": { + "react": ">=17", + "react-dom": ">=17" + } + }, + "node_modules/@xyflow/system": { + "version": "0.0.62", + "resolved": "https://registry.npmjs.org/@xyflow/system/-/system-0.0.62.tgz", + "integrity": "sha512-Z2ufbnvuYxIOCGyzE/8eX8TAEM8Lpzc/JafjD1Tzy6ZJs/E7KGVU17Q1F5WDHVW+dbztJAdyXMG0ejR9bwSUAA==", + "license": "MIT", + "dependencies": { + "@types/d3-drag": "^3.0.7", + "@types/d3-interpolate": "^3.0.4", + "@types/d3-selection": "^3.0.10", + "@types/d3-transition": "^3.0.8", + "@types/d3-zoom": "^3.0.8", + "d3-drag": "^3.0.0", + "d3-interpolate": "^3.0.1", + "d3-selection": "^3.0.0", + "d3-zoom": "^3.0.0" + } + }, + "node_modules/classcat": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/classcat/-/classcat-5.0.5.tgz", + "integrity": "sha512-JhZUT7JFcQy/EzW605k/ktHtncoo9vnyW/2GspNYwFlN1C/WmjuV/xtS04e9SOkL2sTdw0VAZ2UGCcQ9lR6p6w==", + "license": "MIT" + }, + "node_modules/d3-color": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz", + "integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-dispatch": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-3.0.1.tgz", + "integrity": "sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-drag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-3.0.0.tgz", + "integrity": "sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg==", + "license": "ISC", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-selection": "3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-ease": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz", + "integrity": "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-interpolate": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz", + "integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==", + "license": "ISC", + "dependencies": { + "d3-color": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-selection": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz", + "integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-timer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-3.0.1.tgz", + "integrity": "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-transition": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-3.0.1.tgz", + "integrity": "sha512-ApKvfjsSR6tg06xrL434C0WydLr7JewBB3V+/39RMHsaXTOG0zmt/OAXeng5M5LBm0ojmxJrpomQVZ1aPvBL4w==", + "license": "ISC", + "dependencies": { + "d3-color": "1 - 3", + "d3-dispatch": "1 - 3", + "d3-ease": "1 - 3", + "d3-interpolate": "1 - 3", + "d3-timer": "1 - 3" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "d3-selection": "2 - 3" + } + }, + "node_modules/d3-zoom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-zoom/-/d3-zoom-3.0.0.tgz", + "integrity": "sha512-b8AmV3kfQaqWAuacbPuNbL6vahnOJflOhexLzMMNLga62+/nh0JzvJ0aO/5a5MVgUFGS7Hu1P9P03o3fJkDCyw==", + "license": "ISC", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-drag": "2 - 3", + "d3-interpolate": "1 - 3", + "d3-selection": "2 - 3", + "d3-transition": "2 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/i": { + "version": "0.3.7", + "resolved": "https://registry.npmjs.org/i/-/i-0.3.7.tgz", + "integrity": "sha512-FYz4wlXgkQwIPqhzC5TdNMLSE5+GS1IIDJZY/1ZiEPCT2S3COUVZeT5OW4BmW4r5LHLQuOosSwsvnroG9GR59Q==", + "engines": { + "node": ">=0.4" + } + }, + "node_modules/nanoid": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.1.5.tgz", + "integrity": "sha512-Ir/+ZpE9fDsNH0hQ3C68uyThDXzYcim2EqcZ8zn8Chtt1iylPT9xXJB0kPCnqzgcEGikO9RxSrh63MsmVCU7Fw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.js" + }, + "engines": { + "node": "^18 || >=20" + } + }, + "node_modules/react": { + "version": "19.1.0", + "resolved": "https://registry.npmjs.org/react/-/react-19.1.0.tgz", + "integrity": "sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "19.1.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.1.0.tgz", + "integrity": "sha512-Xs1hdnE+DyKgeHJeJznQmYMIBG3TKIHJJT95Q58nHLSrElKlGQqDTR2HQ9fx5CN/Gk6Vh/kupBTDLU11/nDk/g==", + "license": "MIT", + "peer": true, + "dependencies": { + "scheduler": "^0.26.0" + }, + "peerDependencies": { + "react": "^19.1.0" + } + }, + "node_modules/scheduler": { + "version": "0.26.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.26.0.tgz", + "integrity": "sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA==", + "license": "MIT", + "peer": true + }, + "node_modules/use-sync-external-store": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.5.0.tgz", + "integrity": "sha512-Rb46I4cGGVBmjamjphe8L/UnvJD+uPPtTkNvX5mZgqdbavhI4EbgIWJiIHXJ8bc/i9EQGPRh4DwEURJ552Do0A==", + "license": "MIT", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/zustand": { + "version": "4.5.7", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-4.5.7.tgz", + "integrity": "sha512-CHOUy7mu3lbD6o6LJLfllpjkzhHXSBlX8B9+qPddUsIfeF5S/UZ5q0kmCsnRqT1UHFQZchNFDDzMbQsuesHWlw==", + "license": "MIT", + "dependencies": { + "use-sync-external-store": "^1.2.2" + }, + "engines": { + "node": ">=12.7.0" + }, + "peerDependencies": { + "@types/react": ">=16.8", + "immer": ">=9.0.6", + "react": ">=16.8" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "immer": { + "optional": true + }, + "react": { + "optional": true + } + } + } + } +} diff --git a/node_modules/@types/d3-color/LICENSE b/node_modules/@types/d3-color/LICENSE new file mode 100644 index 0000000..9e841e7 --- /dev/null +++ b/node_modules/@types/d3-color/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/node_modules/@types/d3-color/README.md b/node_modules/@types/d3-color/README.md new file mode 100644 index 0000000..9db4a8d --- /dev/null +++ b/node_modules/@types/d3-color/README.md @@ -0,0 +1,15 @@ +# Installation +> `npm install --save @types/d3-color` + +# Summary +This package contains type definitions for d3-color (https://github.com/d3/d3-color/). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-color. + +### Additional Details + * Last updated: Tue, 07 Nov 2023 15:11:36 GMT + * Dependencies: none + +# Credits +These definitions were written by [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), [denisname](https://github.com/denisname), [Hugues Stefanski](https://github.com/ledragon), [Nathan Bierema](https://github.com/Methuselah96), and [Fil](https://github.com/Fil). diff --git a/node_modules/@types/d3-color/index.d.ts b/node_modules/@types/d3-color/index.d.ts new file mode 100644 index 0000000..0ffcfae --- /dev/null +++ b/node_modules/@types/d3-color/index.d.ts @@ -0,0 +1,669 @@ +// Last module patch version validated against: 3.1.0 + +// --------------------------------------------------------------------------- +// Shared Type Definitions and Interfaces +// --------------------------------------------------------------------------- + +/** + * Type allowing for color objects from a specified color space + */ +export type ColorSpaceObject = RGBColor | HSLColor | LabColor | HCLColor | CubehelixColor; + +/** + * A helper interface of methods common to color objects (including colors defined outside the d3-color standard module, + * e.g. in d3-hsv). This interface + */ +export interface ColorCommonInstance { + /** + * Returns true if and only if the color is displayable on standard hardware. + * For example, this returns false for an RGB color if any channel value is less than zero or greater than 255, or if the opacity is not in the range [0, 1]. + */ + displayable(): boolean; + /** + * Returns a string representing this color according to the CSS Object Model specification, + * such as rgb(247, 234, 186) or rgba(247, 234, 186, 0.2). + * If this color is not displayable, a suitable displayable color is returned instead. + * For example, RGB channel values greater than 255 are clamped to 255. + */ + toString(): string; + /** + * Returns a brighter copy of this color. If k is specified, it controls how much brighter the returned color should be. + * If k is not specified, it defaults to 1. The behavior of this method is dependent on the implementing color space. + * + * @param k A color space dependent number to determine, how much brighter the returned color should be. + */ + brighter(k?: number): this; + /** + * Returns a darker copy of this color. If k is specified, it controls how much darker the returned color should be. + * If k is not specified, it defaults to 1. The behavior of this method is dependent on the implementing color space. + * + * @param k A color space dependent number to determine, how much darker the returned color should be. + */ + darker(k?: number): this; + /** + * Returns the RGB equivalent of this color. For RGB colors, that’s "this". + */ + rgb(): RGBColor; + /** + * Returns a hexadecimal string representing this color. + * If this color is not displayable, a suitable displayable color is returned instead. + * For example, RGB channel values greater than 255 are clamped to 255. + */ + hex(): string; +} + +/** + * A Color object which serves as a base class for + * colorspace-specific sub-class implementations. + */ +export interface Color { + /** + * Returns true if and only if the color is displayable on standard hardware. + * For example, this returns false for an RGB color if any channel value is less than zero or greater than 255, or if the opacity is not in the range [0, 1]. + */ + displayable(): boolean; // Note: While this method is used in prototyping for colors of specific colorspaces, it should not be called directly, as 'this.rgb' would not be implemented on Color + /** + * Returns a string representing this color according to the CSS Object Model specification, + * such as rgb(247, 234, 186) or rgba(247, 234, 186, 0.2). + * If this color is not displayable, a suitable displayable color is returned instead. + * For example, RGB channel values greater than 255 are clamped to 255. + */ + toString(): string; // Note: While this method is used in prototyping for colors of specific colorspaces, it should not be called directly, as 'this.rgb' would not be implemented on Color + /** + * Returns a hexadecimal string representing this color in RGB space, such as #f7eaba. + * If this color is not displayable, a suitable displayable color is returned instead. + * For example, RGB channel values greater than 255 are clamped to 255. + */ + formatHex(): string; + /** + * Returns a hexadecimal string representing this color in RGBA space, such as #f7eaba90. + * If this color is not displayable, a suitable displayable color is returned instead. + * For example, RGB channel values greater than 255 are clamped to 255. + */ + formatHex8(): string; + /** + * Returns a string representing this color according to the CSS Color Module Level 3 specification, such as hsl(257, 50%, 80%) or hsla(257, 50%, 80%, 0.2). + * If this color is not displayable, a suitable displayable color is returned instead by clamping S and L channel values to the interval [0, 100]. + */ + formatHsl(): string; + /** + * Returns a string representing this color according to the CSS Object Model specification, such as rgb(247, 234, 186) or rgba(247, 234, 186, 0.2). + * If this color is not displayable, a suitable displayable color is returned instead by clamping RGB channel values to the interval [0, 255]. + */ + formatRgb(): string; + /** + * @deprecated Use color.formatHex. + */ + hex(): string; +} + +/** + * A Color factory object, which may also be used with instanceof to test if an object is a color instance. + */ +export interface ColorFactory extends Function { + /** + * Parses the specified CSS Color Module Level 3 specifier string, returning an RGB or HSL color. + * If the specifier was not valid, null is returned. + * + * @param cssColorSpecifier A CSS Color Module Level 3 specifier string. + */ + (cssColorSpecifier: string): RGBColor | HSLColor | null; + /** + * Converts the provided color instance and returns an RGB or HSL color. + * + * @param color A permissible color space instance. + */ + (color: ColorSpaceObject | ColorCommonInstance): RGBColor | HSLColor; + /** + * Prototype of the factory, which can be used for instanceof testing + */ + readonly prototype: Color; +} + +/** + * An RGB color object. + */ +export interface RGBColor extends Color { + /** + * Value of red channel + */ + r: number; + /** + * Value of green channel + */ + g: number; + /** + * Value of blue channel + */ + b: number; + /** + * Opacity value + */ + opacity: number; + /** + * Returns a brighter copy of this color. If k is specified, it controls how much brighter the returned color should be. + * If k is not specified, it defaults to 1. + * + * @param k A color space dependent number to determine, how much brighter the returned color should be. + */ + brighter(k?: number): this; + /** + * Returns a darker copy of this color. If k is specified, it controls how much darker the returned color should be. + * If k is not specified, it defaults to 1. + * + * @param k A color space dependent number to determine, how much darker the returned color should be. + */ + darker(k?: number): this; + /** + * Returns the RGB equivalent of this color. + */ + rgb(): this; + /** + * Returns a copy of this color. + * + * @param values If values is specified, any enumerable own properties of values are assigned to the new returned color. + */ + copy( + values?: { + r?: number | undefined; + g?: number | undefined; + b?: number | undefined; + opacity?: number | undefined; + }, + ): this; + /** + * Returns a new RGB color where the r, g, and b channels are clamped to the range [0, 255] and rounded to the nearest integer value, + * and the opacity is clamped to the range [0, 1]. + */ + clamp(): this; +} + +/** + * An RGB color factory object, which may also be used with instanceof to test if an object + * is an RGB color instance. + */ +export interface RGBColorFactory extends Function { + /** + * Constructs a new RGB color based on the specified channel values and opacity. + * + * @param r Red channel value. + * @param g Green channel value. + * @param b Blue channel value. + * @param opacity Optional opacity value, defaults to 1. + */ + (r: number, g: number, b: number, opacity?: number): RGBColor; + /** + * Parses the specified CSS Color Module Level 3 specifier string, returning an RGB color. + * If the specifier was not valid, null is returned. + * + * @param cssColorSpecifier A CSS Color Module Level 3 specifier string. + */ + (cssColorSpecifier: string): RGBColor; + /** + * Converts the provided color instance and returns an RGB color. The color instance is converted to the RGB color space using color.rgb. + * Note that unlike color.rgb this method always returns a new instance, even if color is already an RGB color. + * + * @param color A permissible color space instance. + */ + // tslint:disable-next-line:unified-signatures + (color: ColorSpaceObject | ColorCommonInstance): RGBColor; + /** + * Prototype of the factory, which can be used for instanceof testing + */ + readonly prototype: RGBColor; +} + +/** + * An HSL color object. + */ +export interface HSLColor extends Color { + /** + * Hue channel value. + */ + h: number; + /** + * Saturation channel value. + */ + s: number; + /** + * Lightness channel value. + */ + l: number; + /** + * Opacity value. + */ + opacity: number; + /** + * Returns a brighter copy of this color. If k is specified, it controls how much brighter the returned color should be. + * If k is not specified, it defaults to 1. + * + * @param k A color space dependent number to determine, how much brighter the returned color should be. + */ + brighter(k?: number): this; + /** + * Returns a darker copy of this color. If k is specified, it controls how much darker the returned color should be. + * If k is not specified, it defaults to 1. + * + * @param k A color space dependent number to determine, how much darker the returned color should be. + */ + darker(k?: number): this; + /** + * Returns the RGB color equivalent of this color. + */ + rgb(): RGBColor; + /** + * Returns a copy of this color. + * + * @param values If values is specified, any enumerable own properties of values are assigned to the new returned color. + */ + copy( + values?: { + h?: number | undefined; + s?: number | undefined; + l?: number | undefined; + opacity?: number | undefined; + }, + ): this; + /** + * Returns a new HSL color where the h channel is clamped to the range [0, 360), and the s, l, and opacity channels are clamped to the range [0, 1]. + */ + clamp(): this; +} + +/** + * An HSL color factory object, which may also be used with instanceof to test if an object + * is an HSL color instance. + */ +export interface HSLColorFactory extends Function { + /** + * Constructs a new HSL color based on the specified channel values and opacity. + * + * @param h Hue channel value. + * @param s Saturation channel value. + * @param l Lightness channel value. + * @param opacity Optional opacity value, defaults to 1. + */ + (h: number, s: number, l: number, opacity?: number): HSLColor; + /** + * Parses the specified CSS Color Module Level 3 specifier string, returning an HSL color. + * If the specifier was not valid, null is returned. + * + * @param cssColorSpecifier A CSS Color Module Level 3 specifier string. + */ + (cssColorSpecifier: string): HSLColor; + /** + * Converts the provided color instance and returns an HSL color. + * The color instance is converted to the RGB color space using color.rgb and then converted to HSL. + * (Colors already in the HSL color space skip the conversion to RGB.) + * + * @param color A permissible color space instance. + */ + // tslint:disable-next-line:unified-signatures + (color: ColorSpaceObject | ColorCommonInstance): HSLColor; + /** + * Prototype of the factory, which can be used for instanceof testing + */ + readonly prototype: HSLColor; +} + +/** + * A Lab (CIELAB) color object. + */ +export interface LabColor extends Color { + /** + * Lightness typically in the range [0, 100]. + */ + l: number; + /** + * Position between red/magenta and green typically in [-160, +160]. + */ + a: number; + /** + * Position between yellow and blue typically in [-160, +160]. + */ + b: number; + /** + * Opacity value + */ + opacity: number; + /** + * Returns a brighter copy of this color. If k is specified, it controls how much brighter the returned color should be. + * If k is not specified, it defaults to 1. + * + * @param k A color space dependent number to determine, how much brighter the returned color should be. + */ + brighter(k?: number): this; + /** + * Returns a darker copy of this color. If k is specified, it controls how much darker the returned color should be. + * If k is not specified, it defaults to 1. + * + * @param k A color space dependent number to determine, how much darker the returned color should be. + */ + darker(k?: number): this; + /** + * Returns the RGB color equivalent of this color. + */ + rgb(): RGBColor; + /** + * Returns a copy of this color. + * + * @param values If values is specified, any enumerable own properties of values are assigned to the new returned color. + */ + copy( + values?: { + l?: number | undefined; + a?: number | undefined; + b?: number | undefined; + opacity?: number | undefined; + }, + ): this; +} + +/** + * A Lab (CIELAB) color factory object, which may also be used with instanceof to test if an object + * is a Lab color instance. + */ +export interface LabColorFactory extends Function { + /** + * Constructs a new CIELAB color based on the specified channel values and opacity. + * + * @param l Lightness typically in the range [0, 100]. + * @param a Position between red/magenta and green typically in [-160, +160]. + * @param b Position between yellow and blue typically in [-160, +160]. + * @param opacity Optional opacity value, defaults to 1. + */ + (l: number, a: number, b: number, opacity?: number): LabColor; + /** + * Parses the specified CSS Color Module Level 3 specifier string, returning a Lab color. + * If the specifier was not valid, null is returned. + * + * @param cssColorSpecifier A CSS Color Module Level 3 specifier string. + */ + (cssColorSpecifier: string): LabColor; + /** + * Converts the provided color instance and returns a Lab color. + * The color instance is converted to the RGB color space using color.rgb and then converted to CIELAB. + * (Colors already in the Lab color space skip the conversion to RGB, + * and colors in the HCL color space are converted directly to CIELAB.) + * + * @param color A permissible color space instance. + */ + // tslint:disable-next-line:unified-signatures + (color: ColorSpaceObject | ColorCommonInstance): LabColor; + /** + * Prototype of the factory, which can be used for instanceof testing + */ + readonly prototype: LabColor; +} + +/** + * A gray color factory for Lab (CIELAB) colors. + */ +export type GrayColorFactory = + /** + * Constructs a new CIELAB color with the specified l value and a = b = 0. + * + * @param l Lightness typically in the range [0, 100]. + * @param opacity Optional opacity value, defaults to 1. + */ + (l: number, opacity?: number) => LabColor; + +/** + * An HCL (CIELCH) color object. + */ +export interface HCLColor extends Color { + /** + * Hue channel value typically in [0, 360). + */ + h: number; + /** + * Chroma channel value typically in [0, 230]. + */ + c: number; + /** + * Luminance channel value typically in the range [0, 100]. + */ + l: number; + /** + * Opacity value + */ + opacity: number; + /** + * Returns a brighter copy of this color. If k is specified, it controls how much brighter the returned color should be. + * If k is not specified, it defaults to 1. + * + * @param k A color space dependent number to determine, how much brighter the returned color should be. + */ + brighter(k?: number): this; + /** + * Returns a darker copy of this color. If k is specified, it controls how much darker the returned color should be. + * If k is not specified, it defaults to 1. + * + * @param k A color space dependent number to determine, how much darker the returned color should be. + */ + darker(k?: number): this; + /** + * Returns the RGB color equivalent of this color. + */ + rgb(): RGBColor; + /** + * Returns a copy of this color. + * + * @param values If values is specified, any enumerable own properties of values are assigned to the new returned color. + */ + copy( + values?: { + h?: number | undefined; + c?: number | undefined; + l?: number | undefined; + opacity?: number | undefined; + }, + ): this; +} + +/** + * An HCL (CIELCH) color factory object, which may also be used with instanceof to test if an object + * is an HCL color instance. + */ +export interface HCLColorFactory extends Function { + /** + * Constructs a new HCL color based on the specified channel values and opacity. + * + * @param h Hue channel value typically in [0, 360). + * @param c Chroma channel value typically in [0, 230]. + * @param l Luminance channel value typically in the range [0, 100]. + * @param opacity Optional opacity value, defaults to 1. + */ + (h: number, c: number, l: number, opacity?: number): HCLColor; + /** + * Parses the specified CSS Color Module Level 3 specifier string, returning an HCL color. + * If the specifier was not valid, null is returned. + * + * @param cssColorSpecifier A CSS Color Module Level 3 specifier string. + */ + (cssColorSpecifier: string): HCLColor; + /** + * Converts the provided color instance and returns an HCL color. + * The color instance is converted to the RGB color space using color.rgb and then converted to HCL. + * (Colors already in the HCL color space skip the conversion to RGB, + * and colors in the Lab color space are converted directly to HCL.) + * + * @param color A permissible color space instance. + */ + // tslint:disable-next-line:unified-signatures + (color: ColorSpaceObject | ColorCommonInstance): HCLColor; + /** + * Prototype of the factory, which can be used for instanceof testing + */ + readonly prototype: HCLColor; +} + +/** + * An LCH (CIELCH) color factory function to create an HCL color object. + */ +export interface LCHColorFactory { + /** + * Constructs a new HCL color based on the specified channel values and opacity. + * + * @param l Luminance channel value typically in the range [0, 100]. + * @param c Chroma channel value typically in [0, 230]. + * @param h Hue channel value typically in [0, 360). + * @param opacity Optional opacity value, defaults to 1. + */ + (l: number, c: number, h: number, opacity?: number): HCLColor; + /** + * Parses the specified CSS Color Module Level 3 specifier string, returning an HCL color. + * If the specifier was not valid, null is returned. + * + * @param cssColorSpecifier A CSS color Module Level 3 specifier string. + */ + (cssColorSpecifier: string): HCLColor; + /** + * Converts the provided color instance and returns an HCL color. + * The color instance is converted to the RGB color space using color.rgb and then converted to HCL. + * (Colors already in the HCL color space skip the conversion to RGB, + * and colors in the Lab color space are converted directly to HCL.) + * + * @param color A permissible color space instance. + */ + // tslint:disable-next-line:unified-signatures + (color: ColorSpaceObject | ColorCommonInstance): HCLColor; +} + +/** + * Dave Green’s Cubehelix color object. + */ +export interface CubehelixColor extends Color { + /** + * Hue channel value. + */ + h: number; + /** + * Saturation channel value. + */ + s: number; + /** + * Lightness channel value. + */ + l: number; + /** + * Opacity value. + */ + opacity: number; + /** + * Returns a brighter copy of this color. If k is specified, it controls how much brighter the returned color should be. + * If k is not specified, it defaults to 1. + * + * @param k A color space dependent number to determine, how much brighter the returned color should be. + */ + brighter(k?: number): this; + /** + * Returns a darker copy of this color. If k is specified, it controls how much darker the returned color should be. + * If k is not specified, it defaults to 1. + * + * @param k A color space dependent number to determine, how much darker the returned color should be. + */ + darker(k?: number): this; + /** + * Returns the RGB color equivalent of this color. + */ + rgb(): RGBColor; + /** + * Returns a copy of this color. + * + * @param values If values is specified, any enumerable own properties of values are assigned to the new returned color. + */ + copy( + values?: { + h?: number | undefined; + s?: number | undefined; + l?: number | undefined; + opacity?: number | undefined; + }, + ): this; +} + +/** + * A color factory object for Dave Green's Cubehelix colors, which may also be used with instanceof to test if an object + * is a Cubehelix color instance. + */ +export interface CubehelixColorFactory extends Function { + /** + * Constructs a new Cubehelix color based on the specified channel values and opacity. + * + * @param h Hue channel value. + * @param s Saturation channel value. + * @param l Lightness channel value. + * @param opacity Optional opacity value, defaults to 1. + */ + (h: number, s: number, l: number, opacity?: number): CubehelixColor; + /** + * Parses the specified CSS Color Module Level 3 specifier string, returning an Cubehelix color. + * If the specifier was not valid, null is returned. + * + * @param cssColorSpecifier A CSS Color Module Level 3 specifier string. + */ + (cssColorSpecifier: string): CubehelixColor; + /** + * Converts the provided color instance and returns a Cubehelix color. + * The color instance is specified, it is converted to the RGB color space using color.rgb and then converted to Cubehelix. + * (Colors already in the Cubehelix color space skip the conversion to RGB.) + * + * @param color A permissible color space instance. + */ + // tslint:disable-next-line:unified-signatures + (color: ColorSpaceObject | ColorCommonInstance): CubehelixColor; + /** + * Prototype of the factory, which can be used for instanceof testing + */ + readonly prototype: CubehelixColor; +} + +// -------------------------------------------------------------------------- +// Color object factories +// -------------------------------------------------------------------------- + +/** + * A Color factory object, which may also be used with instanceof to test if an object is a color instance. + */ +export const color: ColorFactory; + +/** + * An RGB color factory object, which may also be used with instanceof to test if an object + * is an RGB color instance. + */ +export const rgb: RGBColorFactory; + +/** + * An HSL color factory object, which may also be used with instanceof to test if an object + * is an HSL color instance. + */ +export const hsl: HSLColorFactory; + +/** + * A Lab (CIELAB) color factory object, which may also be used with instanceof to test if an object + * is a Lab color instance. + */ +export const lab: LabColorFactory; + +/** + * A gray color factory for Lab (CIELAB) colors. + */ +export const gray: GrayColorFactory; + +/** + * An HCL (CIELCH) color factory object, which may also be used with instanceof to test if an object + * is an HCL color instance. + */ +export const hcl: HCLColorFactory; + +/** + * An LCH (CIELCH) color factory function to create an HCL color object. + */ +export const lch: LCHColorFactory; + +/** + * A color factory object for Dave Green's Cubehelix colors, which may also be used with instanceof to test if an object + * is a Cubehelix color instance. + */ +export const cubehelix: CubehelixColorFactory; diff --git a/node_modules/@types/d3-color/package.json b/node_modules/@types/d3-color/package.json new file mode 100644 index 0000000..6a59cad --- /dev/null +++ b/node_modules/@types/d3-color/package.json @@ -0,0 +1,55 @@ +{ + "name": "@types/d3-color", + "version": "3.1.3", + "description": "TypeScript definitions for d3-color", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-color", + "license": "MIT", + "contributors": [ + { + "name": "Tom Wanzek", + "githubUsername": "tomwanzek", + "url": "https://github.com/tomwanzek" + }, + { + "name": "Alex Ford", + "githubUsername": "gustavderdrache", + "url": "https://github.com/gustavderdrache" + }, + { + "name": "Boris Yankov", + "githubUsername": "borisyankov", + "url": "https://github.com/borisyankov" + }, + { + "name": "denisname", + "githubUsername": "denisname", + "url": "https://github.com/denisname" + }, + { + "name": "Hugues Stefanski", + "githubUsername": "ledragon", + "url": "https://github.com/ledragon" + }, + { + "name": "Nathan Bierema", + "githubUsername": "Methuselah96", + "url": "https://github.com/Methuselah96" + }, + { + "name": "Fil", + "githubUsername": "Fil", + "url": "https://github.com/Fil" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/d3-color" + }, + "scripts": {}, + "dependencies": {}, + "typesPublisherContentHash": "89cf9357324cddaa31cfb539b1c33d118648ed55319f2a0d26f24b004975a947", + "typeScriptVersion": "4.5" +} \ No newline at end of file diff --git a/node_modules/@types/d3-drag/LICENSE b/node_modules/@types/d3-drag/LICENSE new file mode 100644 index 0000000..9e841e7 --- /dev/null +++ b/node_modules/@types/d3-drag/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/node_modules/@types/d3-drag/README.md b/node_modules/@types/d3-drag/README.md new file mode 100644 index 0000000..f89b739 --- /dev/null +++ b/node_modules/@types/d3-drag/README.md @@ -0,0 +1,15 @@ +# Installation +> `npm install --save @types/d3-drag` + +# Summary +This package contains type definitions for d3-drag (https://github.com/d3/d3-drag/). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-drag. + +### Additional Details + * Last updated: Tue, 07 Nov 2023 15:11:36 GMT + * Dependencies: [@types/d3-selection](https://npmjs.com/package/@types/d3-selection) + +# Credits +These definitions were written by [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), and [Nathan Bierema](https://github.com/Methuselah96). diff --git a/node_modules/@types/d3-drag/index.d.ts b/node_modules/@types/d3-drag/index.d.ts new file mode 100644 index 0000000..8200e5e --- /dev/null +++ b/node_modules/@types/d3-drag/index.d.ts @@ -0,0 +1,395 @@ +// Last module patch version validated against: 3.0.0 + +import { Selection, ValueFn } from "d3-selection"; + +// -------------------------------------------------------------------------- +// Shared Type Definitions and Interfaces +// -------------------------------------------------------------------------- + +/** + * DraggedElementBaseType serves as an alias for the 'minimal' data type which can be selected + * without 'd3-drag' (and related code in 'd3-selection') trying to use properties internally which would otherwise not + * be supported. + */ +export type DraggedElementBaseType = Element; + +/** + * Container element type usable for mouse/touch functions + */ +export type DragContainerElement = HTMLElement | SVGSVGElement | SVGGElement; // HTMLElement includes HTMLCanvasElement + +/** + * The subject datum should at a minimum expose x and y properties, so that the relative position + * of the subject and the pointer can be preserved during the drag gesture. + */ +export interface SubjectPosition { + /** + * x-coordinate + */ + x: number; + /** + * y-coordinate + */ + y: number; +} + +/** + * A D3 Drag Behavior + * + * The first generic refers to the type of element to be dragged. + * The second generic refers to the type of the datum of the dragged element. + * The third generic refers to the type of the drag behavior subject. + * + * The subject of a drag gesture represents the thing being dragged. + * It is computed when an initiating input event is received, + * such as a mousedown or touchstart, immediately before the drag gesture starts. + * The subject is then exposed as event.subject on subsequent drag events for this gesture. + * + * The default subject is the datum of the element in the originating selection (see drag) + * that received the initiating input event; if this datum is undefined, + * an object representing the coordinates of the pointer is created. + * When dragging circle elements in SVG, the default subject is thus the datum of the circle being dragged. + * With Canvas, the default subject is the canvas element’s datum (regardless of where on the canvas you click). + * In this case, a custom subject accessor would be more appropriate, + * such as one that picks the closest circle to the mouse within a given search radius. + */ +export interface DragBehavior extends Function { + /** + * Applies the drag behavior to the selected elements. + * This function is typically not invoked directly, and is instead invoked via selection.call. + * + * For details see: {@link https://github.com/d3/d3-drag#_drag} + * + * @param selection A D3 selection of elements. + * @param args Optional arguments to be passed in. + */ + (selection: Selection, ...args: any[]): void; + + /** + * Returns the current container accessor function. + */ + container(): ValueFn; + /** + * Sets the container accessor to the specified function and returns the drag behavior. + * + * The container of a drag gesture determines the coordinate system of subsequent drag events, affecting event.x and event.y. + * The element returned by the container accessor is subsequently passed to d3.pointer to determine the local coordinates of the pointer. + * + * The default container accessor returns the parent node of the element in the originating selection (see drag) + * that received the initiating input event. This is often appropriate when dragging SVG or HTML elements, + * since those elements are typically positioned relative to a parent. For dragging graphical elements with a Canvas, + * however, you may want to redefine the container as the initiating element itself, using "this" in the accessor + * function. + * + * @param accessor A container accessor function which is evaluated for each selected element, + * in order, being passed the current datum (d), the current index (i), and the current group (nodes), + * with this as the current DOM element. The function returns the container element. + */ + container(accessor: ValueFn): this; + /** + * Sets the container accessor to the specified object and returns the drag behavior. + * + * The container of a drag gesture determines the coordinate system of subsequent drag events, affecting event.x and event.y. + * The element returned by the container accessor is subsequently passed to d3.pointer to determine the local coordinates of the pointer. + * + * The default container accessor returns the parent node of the element in the originating selection (see drag) + * that received the initiating input event. This is often appropriate when dragging SVG or HTML elements, + * since those elements are typically positioned relative to a parent. For dragging graphical elements with a Canvas, + * however, you may want to redefine the container as the initiating element itself, such as drag.container(canvas). + * + * @param container Container element for the drag gesture. + */ + container(container: DragContainerElement): this; + + /** + * Returns the current filter function. + */ + filter(): (this: GElement, event: any, d: Datum) => boolean; + /** + * Sets the event filter to the specified filter function and returns the drag behavior. + * + * If the filter returns falsey, the initiating event is ignored and no drag gesture is started. + * Thus, the filter determines which input events are ignored. The default filter ignores mousedown events on secondary buttons, + * since those buttons are typically intended for other purposes, such as the context menu. + * + * @param filterFn A filter function which is evaluated for each selected element, + * in order, being passed the current event (event) and datum d, with the this context as the current DOM element. + * The function returns a boolean value. + */ + filter(filterFn: (this: GElement, event: any, d: Datum) => boolean): this; + + /** + * Returns the current touch support detector, which defaults to a function returning true, + * if the "ontouchstart" event is supported on the current element. + */ + touchable(): ValueFn; + /** + * Sets the touch support detector to the specified boolean value and returns the drag behavior. + * + * Touch event listeners are only registered if the detector returns truthy for the corresponding element when the drag behavior is applied. + * The default detector works well for most browsers that are capable of touch input, but not all; Chrome’s mobile device emulator, for example, + * fails detection. + * + * @param touchable A boolean value. true when touch event listeners should be applied to the corresponding element, otherwise false. + */ + touchable(touchable: boolean): this; + /** + * Sets the touch support detector to the specified function and returns the drag behavior. + * + * Touch event listeners are only registered if the detector returns truthy for the corresponding element when the drag behavior is applied. + * The default detector works well for most browsers that are capable of touch input, but not all; Chrome’s mobile device emulator, for example, + * fails detection. + * + * @param touchable A touch support detector function, which returns true when touch event listeners should be applied to the corresponding element. + * The function is evaluated for each selected element to which the drag behavior was applied, in order, being passed the current datum (d), + * the current index (i), and the current group (nodes), with this as the current DOM element. The function returns a boolean value. + */ + touchable(touchable: ValueFn): this; + + /** + * Returns the current subject accessor functions. + */ + subject(): (this: GElement, event: any, d: Datum) => Subject; + /** + * Sets the subject accessor to the specified function and returns the drag behavior. + * + * The subject of a drag gesture represents the thing being dragged. + * It is computed when an initiating input event is received, + * such as a mousedown or touchstart, immediately before the drag gesture starts. + * The subject is then exposed as event.subject on subsequent drag events for this gesture. + * + * The default subject is the datum of the element in the originating selection (see drag) + * that received the initiating input event; if this datum is undefined, + * an object representing the coordinates of the pointer is created. + * When dragging circle elements in SVG, the default subject is thus the datum of the circle being dragged. + * With Canvas, the default subject is the canvas element’s datum (regardless of where on the canvas you click). + * In this case, a custom subject accessor would be more appropriate, + * such as one that picks the closest circle to the mouse within a given search radius. + * + * The subject of a drag gesture may not be changed after the gesture starts. + * + * During the evaluation of the subject accessor, event is a beforestart drag event. + * Use event.sourceEvent to access the initiating input event and event.identifier to access the touch identifier. + * The event.x and event.y are relative to the container, and are computed using d3.pointer. + * + * @param accessor An extent accessor function which is evaluated for each selected element, + * in order, being passed the current event (`event`) and datum `d`, with the `this` context as the current DOM element. + * The returned subject should be an object that exposes x and y properties, + * so that the relative position of the subject and the pointer can be preserved during the drag gesture. + * If the subject is null or undefined, no drag gesture is started for this pointer; + * however, other starting touches may yet start drag gestures. + */ + subject(accessor: (this: GElement, event: any, d: Datum) => Subject): this; + + /** + * Return the current click distance threshold, which defaults to zero. + */ + clickDistance(): number; + /** + * Set the maximum distance that the mouse can move between mousedown and mouseup that will trigger + * a subsequent click event. If at any point between mousedown and mouseup the mouse is greater than or equal to + * distance from its position on mousedown, the click event following mouseup will be suppressed. + * + * @param distance The distance threshold between mousedown and mouseup measured in client coordinates (event.clientX and event.clientY). + * The default is zero. + */ + clickDistance(distance: number): this; + + /** + * Return the first currently-assigned listener matching the specified typenames, if any. + * + * @param typenames The typenames is a string containing one or more typename separated by whitespace. + * Each typename is a type, optionally followed by a period (.) and a name, such as "drag.foo"" and "drag.bar"; + * the name allows multiple listeners to be registered for the same type. The type must be one of the following: + * start (after a new pointer becomes active [on mousedown or touchstart]), drag (after an active pointer moves [on mousemove or touchmove], or + * end (after an active pointer becomes inactive [on mouseup, touchend or touchcancel].) + */ + on(typenames: string): ((this: GElement, event: any, d: Datum) => void) | undefined; + /** + * Remove the current event listeners for the specified typenames, if any, return the drag behavior. + * + * @param typenames The typenames is a string containing one or more typename separated by whitespace. + * Each typename is a type, optionally followed by a period (.) and a name, such as "drag.foo"" and "drag.bar"; + * the name allows multiple listeners to be registered for the same type. The type must be one of the following: + * start (after a new pointer becomes active [on mousedown or touchstart]), drag (after an active pointer moves [on mousemove or touchmove], or + * end (after an active pointer becomes inactive [on mouseup, touchend or touchcancel].) + * @param listener Use null to remove the listener. + */ + on(typenames: string, listener: null): this; + /** + * Set the event listener for the specified typenames and return the drag behavior. + * If an event listener was already registered for the same type and name, + * the existing listener is removed before the new listener is added. + * When a specified event is dispatched, each listener will be invoked with the same context and arguments as selection.on listeners. + * + * Changes to registered listeners via drag.on during a drag gesture do not affect the current drag gesture. + * Instead, you must use event.on, which also allows you to register temporary event listeners for the current drag gesture. + * Separate events are dispatched for each active pointer during a drag gesture. + * For example, if simultaneously dragging multiple subjects with multiple fingers, a start event is dispatched for each finger, + * even if both fingers start touching simultaneously. + * + * @param typenames The typenames is a string containing one or more typename separated by whitespace. + * Each typename is a type, optionally followed by a period (.) and a name, such as "drag.foo"" and "drag.bar"; + * the name allows multiple listeners to be registered for the same type. The type must be one of the following: + * start (after a new pointer becomes active [on mousedown or touchstart]), drag (after an active pointer moves [on mousemove or touchmove], or + * end (after an active pointer becomes inactive [on mouseup, touchend or touchcancel].) + * @param listener An event listener function which is evaluated for each selected element, + * in order, being passed the current event (event) and datum d, with the this context as the current DOM element. + */ + on(typenames: string, listener: (this: GElement, event: any, d: Datum) => void): this; +} + +/** + * Creates a new drag behavior. The returned behavior, drag, is both an object and a function, and is + * typically applied to selected elements via selection.call. + * + * Use this signature when using the default subject accessor. + * + * The first generic refers to the type of element to be dragged. + * The second generic refers to the type of the datum of the dragged element. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function drag(): DragBehavior< + GElement, + Datum, + Datum | SubjectPosition +>; +/** + * Creates a new drag behavior. The returned behavior, drag, is both an object and a function, and is + * typically applied to selected elements via selection.call. + * + * Use this signature when using a custom subject accessor. + * + * The first generic refers to the type of element to be dragged. + * The second generic refers to the type of the datum of the dragged element. + * The third generic refers to the type of the drag behavior subject. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function drag(): DragBehavior; + +/** + * D3 Drag event + * + * The first generic refers to the type of element to be dragged. + * The second generic refers to the type of the datum of the dragged element. + * The third generic refers to the type of the drag behavior subject. + */ +export interface D3DragEvent { + /** + * The DragBehavior associated with the event + */ + target: DragBehavior; + /** + * The event type for the DragEvent + */ + type: "start" | "drag" | "end" | string; // Leave failsafe string type for cases like 'drag.foo' + /** + * The drag subject, defined by drag.subject. + */ + subject: Subject; + /** + * The new x-coordinate of the subject, relative to the container + */ + x: number; + /** + * The new y-coordinate of the subject, relative to the container + */ + y: number; + /** + * The change in x-coordinate since the previous drag event. + */ + dx: number; + /** + * The change in y-coordinate since the previous drag event. + */ + dy: number; + /** + * The string “mouse”, or a numeric touch identifier. + */ + identifier: "mouse" | number; + /** + * The number of currently active drag gestures (on start and end, not including this one). + * + * The event.active field is useful for detecting the first start event and the last end event + * in a sequence of concurrent drag gestures: it is zero when the first drag gesture starts, + * and zero when the last drag gesture ends. + */ + active: number; + /** + * The underlying input event, such as mousemove or touchmove. + */ + sourceEvent: any; + /** + * Return the first currently-assigned listener matching the specified typenames, if any. + * + * Equivalent to drag.on, but only applies to the current drag gesture. Before the drag gesture starts, + * a copy of the current drag event listeners is made. This copy is bound to the current drag gesture + * and modified by event.on. This is useful for temporary listeners that only receive events for the current drag gesture. + * + * @param typenames The typenames is a string containing one or more typename separated by whitespace. + * Each typename is a type, optionally followed by a period (.) and a name, such as "drag.foo"" and "drag.bar"; + * the name allows multiple listeners to be registered for the same type. The type must be one of the following: + * start (after a new pointer becomes active [on mousedown or touchstart]), drag (after an active pointer moves [on mousemove or touchmove], or + * end (after an active pointer becomes inactive [on mouseup, touchend or touchcancel].) + */ + on(typenames: string): ((this: GElement, event: any, d: Datum) => void) | undefined; + /** + * Remove the current event listeners for the specified typenames, if any, return the drag behavior. + * + * Equivalent to drag.on, but only applies to the current drag gesture. Before the drag gesture starts, + * a copy of the current drag event listeners is made. This copy is bound to the current drag gesture + * and modified by event.on. This is useful for temporary listeners that only receive events for the current drag gesture. + * + * @param typenames The typenames is a string containing one or more typename separated by whitespace. + * Each typename is a type, optionally followed by a period (.) and a name, such as "drag.foo"" and "drag.bar"; + * the name allows multiple listeners to be registered for the same type. The type must be one of the following: + * start (after a new pointer becomes active [on mousedown or touchstart]), drag (after an active pointer moves [on mousemove or touchmove], or + * end (after an active pointer becomes inactive [on mouseup, touchend or touchcancel].) + * @param listener Use null to remove the listener. + */ + on(typenames: string, listener: null): this; + /** + * Set the event listener for the specified typenames and return the drag behavior. + * If an event listener was already registered for the same type and name, + * the existing listener is removed before the new listener is added. + * When a specified event is dispatched, each listener will be invoked with the same context and arguments as selection.on listeners. + * + * Equivalent to drag.on, but only applies to the current drag gesture. Before the drag gesture starts, + * a copy of the current drag event listeners is made. This copy is bound to the current drag gesture + * and modified by event.on. This is useful for temporary listeners that only receive events for the current drag gesture. + * + * @param typenames The typenames is a string containing one or more typename separated by whitespace. + * Each typename is a type, optionally followed by a period (.) and a name, such as "drag.foo"" and "drag.bar"; + * the name allows multiple listeners to be registered for the same type. The type must be one of the following: + * start (after a new pointer becomes active [on mousedown or touchstart]), drag (after an active pointer moves [on mousemove or touchmove], or + * end (after an active pointer becomes inactive [on mouseup, touchend or touchcancel].) + * @param listener An event listener function which is evaluated for each selected element, + * in order, being passed the current event (event) and datum d, with the this context as the current DOM element. + */ + on(typenames: string, listener: (this: GElement, event: any, d: Datum) => void): this; +} + +/** + * Prevents native drag-and-drop and text selection on the specified window. + * As an alternative to preventing the default action of mousedown events, + * this method prevents undesirable default actions following mousedown. In supported browsers, + * this means capturing dragstart and selectstart events, preventing the associated default actions, + * and immediately stopping their propagation. In browsers that do not support selection events, + * the user-select CSS property is set to none on the document element. + * This method is intended to be called on mousedown, followed by d3.dragEnable on mouseup. + * + * @param window The window for which drag should be disabled. + */ +export function dragDisable(window: Window): void; + +/** + * Allows native drag-and-drop and text selection on the specified window; undoes the effect of d3.dragDisable. + * This method is intended to be called on mouseup, preceded by d3.dragDisable on mousedown. + * If noclick is true, this method also temporarily suppresses click events. + * The suppression of click events expires after a zero-millisecond timeout, + * such that it only suppress the click event that would immediately follow the current mouseup event, if any. + * + * @param window The window for which drag should be (re-)enabled. + * @param noClick An optional flag. If noclick is true, this method also temporarily suppresses click events. + */ +export function dragEnable(window: Window, noClick?: boolean): void; diff --git a/node_modules/@types/d3-drag/package.json b/node_modules/@types/d3-drag/package.json new file mode 100644 index 0000000..83aa1e6 --- /dev/null +++ b/node_modules/@types/d3-drag/package.json @@ -0,0 +1,42 @@ +{ + "name": "@types/d3-drag", + "version": "3.0.7", + "description": "TypeScript definitions for d3-drag", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-drag", + "license": "MIT", + "contributors": [ + { + "name": "Tom Wanzek", + "githubUsername": "tomwanzek", + "url": "https://github.com/tomwanzek" + }, + { + "name": "Alex Ford", + "githubUsername": "gustavderdrache", + "url": "https://github.com/gustavderdrache" + }, + { + "name": "Boris Yankov", + "githubUsername": "borisyankov", + "url": "https://github.com/borisyankov" + }, + { + "name": "Nathan Bierema", + "githubUsername": "Methuselah96", + "url": "https://github.com/Methuselah96" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/d3-drag" + }, + "scripts": {}, + "dependencies": { + "@types/d3-selection": "*" + }, + "typesPublisherContentHash": "cbd098773821019893d7397be4129e19f5b62205943d423ef95a612ec9c9eac6", + "typeScriptVersion": "4.5" +} \ No newline at end of file diff --git a/node_modules/@types/d3-interpolate/LICENSE b/node_modules/@types/d3-interpolate/LICENSE new file mode 100644 index 0000000..9e841e7 --- /dev/null +++ b/node_modules/@types/d3-interpolate/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/node_modules/@types/d3-interpolate/README.md b/node_modules/@types/d3-interpolate/README.md new file mode 100644 index 0000000..8fb9cf8 --- /dev/null +++ b/node_modules/@types/d3-interpolate/README.md @@ -0,0 +1,15 @@ +# Installation +> `npm install --save @types/d3-interpolate` + +# Summary +This package contains type definitions for d3-interpolate (https://github.com/d3/d3-interpolate/). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-interpolate. + +### Additional Details + * Last updated: Tue, 07 Nov 2023 15:11:37 GMT + * Dependencies: [@types/d3-color](https://npmjs.com/package/@types/d3-color) + +# Credits +These definitions were written by [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), [denisname](https://github.com/denisname), and [Nathan Bierema](https://github.com/Methuselah96). diff --git a/node_modules/@types/d3-interpolate/index.d.ts b/node_modules/@types/d3-interpolate/index.d.ts new file mode 100644 index 0000000..cbb655b --- /dev/null +++ b/node_modules/@types/d3-interpolate/index.d.ts @@ -0,0 +1,387 @@ +// Last module patch version validated against: 3.0.1 + +import { ColorCommonInstance } from "d3-color"; + +// --------------------------------------------------------------------------- +// Shared Type Definitions and Interfaces +// --------------------------------------------------------------------------- + +export interface ZoomInterpolator extends Function { + (t: number): ZoomView; + /** + * Recommended duration of zoom transition in milliseconds. + */ + duration: number; + + /** + * Given a zoom interpolator, returns a new zoom interpolator using the specified curvature rho. + * When rho is close to 0, the interpolator is almost linear. + * The default curvature is sqrt(2). + * @param rho + */ + rho(rho: number): this; +} + +export interface ColorGammaInterpolationFactory extends Function { + (a: string | ColorCommonInstance, b: string | ColorCommonInstance): (t: number) => string; + /** + * Returns a new interpolator factory of the same type using the specified *gamma*. + * For example, to interpolate from purple to orange with a gamma of 2.2 in RGB space: `d3.interpolateRgb.gamma(2.2)("purple", "orange")`. + * See Eric Brasseur’s article, [Gamma error in picture scaling](https://web.archive.org/web/20160112115812/http://www.4p8.com/eric.brasseur/gamma.html), for more on gamma correction. + */ + gamma(g: number): ColorGammaInterpolationFactory; +} + +/** + * Type zoomView is used to represent a numeric array with three elements. + * In order of appearance the elements correspond to: + * - cx: *x*-coordinate of the center of the viewport + * - cy: *y*-coordinate of the center of the viewport + * - width: size of the viewport + */ +export type ZoomView = [number, number, number]; + +export type TypedArray = + | Int8Array + | Uint8Array + | Int16Array + | Uint16Array + | Int32Array + | Uint32Array + | Uint8ClampedArray + | Float32Array + | Float64Array; + +export type NumberArray = TypedArray | DataView; + +// --------------------------------------------------------------------------- +// Interpolation Function Factories +// --------------------------------------------------------------------------- + +/** + * Returns an `null` constant interpolator. + */ +export function interpolate(a: any, b: null): (t: number) => null; +/** + * Returns an boolean constant interpolator of value `b`. + */ +export function interpolate(a: any, b: boolean): (t: number) => boolean; +/** + * Returns a `interpolateRgb` interpolator. + */ +export function interpolate(a: string | ColorCommonInstance, b: ColorCommonInstance): (t: number) => string; +/** + * Returns a `interpolateDate` interpolator. + */ +export function interpolate(a: Date, b: Date): (t: number) => Date; +/** + * Returns a `interpolateNumber` interpolator. + */ +export function interpolate( + a: number | { valueOf(): number }, + b: number | { valueOf(): number }, +): (t: number) => number; +/** + * Returns a `interpolateNumberArray` interpolator. + */ +export function interpolate(a: NumberArray | number[], b: T): (t: number) => T; +/** + * Returns a `interpolateString` interpolator. If `b` is a string coercible to a color use use `interpolateRgb`. + */ +export function interpolate(a: string | { toString(): string }, b: string): (t: number) => string; +/** + * Returns a `interpolateArray` interpolator. + */ +export function interpolate(a: any[], b: U): (t: number) => U; +/** + * Returns a `interpolateObject` interpolator. + */ +export function interpolate(a: any, b: U): (t: number) => U; + +/** + * Returns an interpolator between the two numbers `a` and `b`. + * The returned interpolator is equivalent to: `(t) => a * (1 - t) + b * t`. + */ +export function interpolateNumber( + a: number | { valueOf(): number }, + b: number | { valueOf(): number }, +): (t: number) => number; + +/** + * Returns an interpolator between the two numbers `a` and `b`; the interpolator is similar to `interpolateNumber`, + * except it will round the resulting value to the nearest integer. + */ +export function interpolateRound( + a: number | { valueOf(): number }, + b: number | { valueOf(): number }, +): (t: number) => number; + +/** + * Returns an interpolator between the two strings `a` and `b`. + * The string interpolator finds numbers embedded in `a` and `b`, where each number is of the form understood by JavaScript. + * A few examples of numbers that will be detected within a string: `-1`, `42`, `3.14159`, and `6.0221413e+23`. + * + * For each number embedded in `b`, the interpolator will attempt to find a corresponding number in `a`. + * If a corresponding number is found, a numeric interpolator is created using `interpolateNumber`. + * The remaining parts of the string `b` are used as a template. + * + * For example, if `a` is `"300 12px sans-serif"`, and `b` is `"500 36px Comic-Sans"`, two embedded numbers are found. + * The remaining static parts (of string `b`) are a space between the two numbers (`" "`), and the suffix (`"px Comic-Sans"`). + * The result of the interpolator at `t` = 0.5 is `"400 24px Comic-Sans"`. + */ +export function interpolateString( + a: string | { toString(): string }, + b: string | { toString(): string }, +): (t: number) => string; + +/** + * Returns an interpolator between the two dates `a` and `b`. + * + * Note: *no defensive copy* of the returned date is created; the same Date instance is returned for every evaluation of the interpolator. + * No copy is made for performance reasons; interpolators are often part of the inner loop of animated transitions. + */ +export function interpolateDate(a: Date, b: Date): (t: number) => Date; + +export type ArrayInterpolator = (t: number) => A; + +/** + * Returns an interpolator between the two arrays `a` and `b`. Internally, an array template is created that is the same length in `b`. + * For each element in `b`, if there exists a corresponding element in `a`, a generic interpolator is created for the two elements using `interpolate`. + * If there is no such element, the static value from `b` is used in the template. + * Then, for the given parameter `t`, the template’s embedded interpolators are evaluated. The updated array template is then returned. + * + * For example, if `a` is the array `[0, 1]` and `b` is the array `[1, 10, 100]`, then the result of the interpolator for `t = 0.5` is the array `[0.5, 5.5, 100]`. + * + * Note: *no defensive copy* of the template array is created; modifications of the returned array may adversely affect subsequent evaluation of the interpolator. + * No copy is made for performance reasons; interpolators are often part of the inner loop of animated transitions. + */ +export function interpolateArray(a: any[], b: A): ArrayInterpolator; +/** + * interpolateNumberArray is called + */ +export function interpolateArray(a: NumberArray | number[], b: T): (t: number) => T; + +/** + * Returns an interpolator between the two arrays of numbers a and b. + * Internally, an array template is created that is the same type and length as b. + * For each element in b, if there exists a corresponding element in a, the values are directly interpolated in the array template. + * If there is no such element, the static value from b is copied. + * The updated array template is then returned. + * + * Note: For performance reasons, no defensive copy is made of the template array and the arguments a and b; modifications of these arrays may affect subsequent evaluation of the interpolator. + */ +export function interpolateNumberArray( + a: NumberArray | number[], + b: T, +): (t: number) => T; + +/** + * Returns an interpolator between the two objects `a` and `b`. Internally, an object template is created that has the same properties as `b`. + * For each property in `b`, if there exists a corresponding property in `a`, a generic interpolator is created for the two elements using `interpolate`. + * If there is no such property, the static value from `b` is used in the template. + * Then, for the given parameter `t`, the template's embedded interpolators are evaluated and the updated object template is then returned. + * + * For example, if `a` is the object `{x: 0, y: 1}` and `b` is the object `{x: 1, y: 10, z: 100}`, the result of the interpolator for `t = 0.5` is the object `{x: 0.5, y: 5.5, z: 100}`. + * + * Note: *no defensive copy* of the template object is created; modifications of the returned object may adversely affect subsequent evaluation of the interpolator. + * No copy is made for performance reasons; interpolators are often part of the inner loop of animated transitions. + */ +export function interpolateObject(a: any, b: U): (t: number) => U; + +/** + * Returns an interpolator between the two 2D CSS transforms represented by `a` and `b`. + * Each transform is decomposed to a standard representation of translate, rotate, *x*-skew and scale; these component transformations are then interpolated. + * This behavior is standardized by CSS: see [matrix decomposition for animation](http://www.w3.org/TR/css3-2d-transforms/#matrix-decomposition). + */ +export function interpolateTransformCss(a: string, b: string): (t: number) => string; + +/** + * Returns an interpolator between the two 2D SVG transforms represented by `a` and `b`. + * Each transform is decomposed to a standard representation of translate, rotate, *x*-skew and scale; these component transformations are then interpolated. + * This behavior is standardized by CSS: see [matrix decomposition for animation](http://www.w3.org/TR/css3-2d-transforms/#matrix-decomposition). + */ +export function interpolateTransformSvg(a: string, b: string): (t: number) => string; + +/** + * Returns an interpolator between the two views `a` and `b` of a two-dimensional plane, + * based on [“Smooth and efficient zooming and panning”](http://www.win.tue.nl/~vanwijk/zoompan.pdf). + * Each view is defined as an array of three numbers: *cx*, *cy* and *width*. + * The first two coordinates *cx*, *cy* represent the center of the viewport; the last coordinate *width* represents the size of the viewport. + * + * The returned interpolator exposes a *duration* property which encodes the recommended transition duration in milliseconds. + * This duration is based on the path length of the curved trajectory through *x,y* space. + * If you want to a slower or faster transition, multiply this by an arbitrary scale factor (*V* as described in the original paper). + */ +export function interpolateZoom(a: ZoomView, b: ZoomView): ZoomInterpolator; + +/** + * Returns a discrete interpolator for the given array of values. The returned interpolator maps `t` in `[0, 1 / n)` to values[0], + * `t` in `[1 / n, 2 / n)` to `values[1]`, and so on, where `n = values.length`. In effect, this is a lightweight quantize scale with a fixed domain of [0, 1]. + */ +export function interpolateDiscrete(values: T[]): (t: number) => T; + +// Sampling ------------------------------------------------------------------ + +/** + * Returns `n` uniformly-spaced samples from the specified `interpolator`, where `n` is an integer greater than one. + * The first sample is always at `t = 0`, and the last sample is always at `t = 1`. + * This can be useful in generating a fixed number of samples from a given interpolator, + * such as to derive the range of a [quantize scale](https://github.com/d3/d3-scale#quantize-scales) from a [continuous interpolator](https://github.com/d3/d3-scale#interpolateWarm). + * + * Caution: this method will not work with interpolators that do not return defensive copies of their output, + * such as `d3.interpolateArray`, `d3.interpolateDate` and `d3.interpolateObject`. For those interpolators, you must wrap the interpolator and create a copy for each returned value. + */ +export function quantize(interpolator: (t: number) => T, n: number): T[]; + +// Color Spaces + +/** + * Returns an RGB color space interpolator between the two colors `a` and `b` with a configurable gamma. If the gamma is not specified, it defaults to 1.0. + * The colors `a` and `b` need not be in RGB; they will be converted to RGB using [`d3.rgb`](https://github.com/d3/d3-color#rgb). The return value of the interpolator is an RGB string. + */ +export const interpolateRgb: ColorGammaInterpolationFactory; + +/** + * Returns a uniform nonrational B-spline interpolator through the specified array of *colors*, which are converted to RGB color space. + * Implicit control points are generated such that the interpolator returns `colors[0]` at `t = 0` and `colors[colors.length - 1]` at `t = 1`. + * Opacity interpolation is not currently supported. See also `d3.interpolateBasis`, and see [d3-scale-chromatic](https://github.com/d3/d3-scale-chromatic) for examples. + */ +export function interpolateRgbBasis(colors: Array): (t: number) => string; + +/** + * Returns a uniform nonrational B-spline interpolator through the specified array of colors, which are converted to RGB color space. + * The control points are implicitly repeated such that the resulting spline has cyclical C² continuity when repeated around `t` in [0,1]; + * this is useful, for example, to create cyclical color scales. Opacity interpolation is not currently supported. + * See also `d3.interpolateBasisClosed, and see [d3-scale-chromatic](https://github.com/d3/d3-scale-chromatic) for examples. + */ +export function interpolateRgbBasisClosed(colors: Array): (t: number) => string; + +/** + * Returns an HSL color space interpolator between the two colors *a* and *b*. The colors *a* and *b* need not be in HSL; + * they will be converted to HSL using `d3.hsl`. If either color’s hue or saturation is NaN, the opposing color’s channel value is used. + * The shortest path between hues is used. The return value of the interpolator is an RGB string. + */ +export function interpolateHsl(a: string | ColorCommonInstance, b: string | ColorCommonInstance): (t: number) => string; + +/** + * Like `interpolateHsl`, but does not use the shortest path between hues. + */ +export function interpolateHslLong( + a: string | ColorCommonInstance, + b: string | ColorCommonInstance, +): (t: number) => string; + +/** + * Returns a Lab color space interpolator between the two colors *a* and *b*. The colors *a* and *b* need not be in Lab; + * they will be converted to Lab using `d3.lab`. The return value of the interpolator is an RGB string. + */ +export function interpolateLab(a: string | ColorCommonInstance, b: string | ColorCommonInstance): (t: number) => string; + +/** + * Returns an HCL color space interpolator between the two colors `a` and `b`. The colors `a` and `b` need not be in HCL; + * they will be converted to HCL using `d3.hcl`. If either color’s hue or chroma is NaN, the opposing color’s channel value is used. + * The shortest path between hues is used. The return value of the interpolator is an RGB string. + */ +export function interpolateHcl(a: string | ColorCommonInstance, b: string | ColorCommonInstance): (t: number) => string; + +/** + * Like `interpolateHcl`, but does not use the shortest path between hues. + */ +export function interpolateHclLong( + a: string | ColorCommonInstance, + b: string | ColorCommonInstance, +): (t: number) => string; + +/** + * Returns a Cubehelix color space interpolator between the two colors `a` and `b` using a configurable `gamma`. + * If the gamma is not specified, it defaults to 1.0. The colors `a` and `b` need not be in Cubehelix; + * they will be converted to Cubehelix using [`d3.cubehelix`](https://github.com/d3/d3-color#cubehelix). + * If either color’s hue or saturation is NaN, the opposing color’s channel value is used. The shortest path between hues is used. The return value of the interpolator is an RGB string. + */ +export const interpolateCubehelix: ColorGammaInterpolationFactory; + +/** + * Like `interpolateCubehelix`, but does not use the shortest path between hues. + */ +export const interpolateCubehelixLong: ColorGammaInterpolationFactory; + +/** + * Returns an interpolator between the two hue angles `a` and `b`. If either hue is NaN, the opposing value is used. + * The shortest path between hues is used. The return value of the interpolator is a number in `[0, 360)`. + */ +export function interpolateHue(a: number, b: number): (t: number) => number; + +// Splines ------------------------------------------------------------------- + +/** + * Returns a uniform nonrational B-spline interpolator through the specified array of `values`, which must be numbers. + * Implicit control points are generated such that the interpolator returns `values[0]` at `t` = 0 and `values[values.length - 1]` at `t` = 1. + * See also [`d3.curveBasis`](https://github.com/d3/d3-shape#curveBasis). + */ +export function interpolateBasis(splineNodes: number[]): (t: number) => number; + +/** + * Returns a uniform nonrational B-spline interpolator through the specified array of `values`, which must be numbers. + * The control points are implicitly repeated such that the resulting one-dimensional spline has cyclical C² continuity when repeated around `t` in [0,1]. + * See also [`d3.curveBasisClosed`](https://github.com/d3/d3-shape#curveBasisClosed). + */ +export function interpolateBasisClosed(splineNodes: number[]): (t: number) => number; + +// Piecewise ----------------------------------------------------------------- + +/** + * Returns a piecewise zoom interpolator, composing zoom interpolators for each adjacent pair of zoom view. + * The returned interpolator maps `t` in `[0, 1 / (n - 1)]` to `interpolate(values[0], values[1])`, `t` in `[1 / (n - 1), 2 / (n - 1)]` to `interpolate(values[1], values[2])`, + * and so on, where `n = values.length`. In effect, this is a lightweight linear scale. + * For example, to blend through three different zoom views: `d3.piecewise(d3.interpolateZoom, [[0, 0, 1], [0, 0, 10], [0, 0, 15]])`. + * + * interpolate defaults to d3.interpolate. + */ +export function piecewise(values: ZoomView[]): ZoomInterpolator; +/** + * Returns a piecewise zoom interpolator, composing zoom interpolators for each adjacent pair of zoom view. + * The returned interpolator maps `t` in `[0, 1 / (n - 1)]` to `interpolate(values[0], values[1])`, `t` in `[1 / (n - 1), 2 / (n - 1)]` to `interpolate(values[1], values[2])`, + * and so on, where `n = values.length`. In effect, this is a lightweight linear scale. + * For example, to blend through three different zoom views: `d3.piecewise(d3.interpolateZoom, [[0, 0, 1], [0, 0, 10], [0, 0, 15]])`. + */ +export function piecewise( + interpolate: (a: ZoomView, b: ZoomView) => ZoomInterpolator, + values: ZoomView[], +): ZoomInterpolator; + +/** + * Returns a piecewise array interpolator, composing array interpolators for each adjacent pair of arrays. + * The returned interpolator maps `t` in `[0, 1 / (n - 1)]` to `interpolate(values[0], values[1])`, `t` in `[1 / (n - 1), 2 / (n - 1)]` to `interpolate(values[1], values[2])`, + * and so on, where `n = values.length`. In effect, this is a lightweight linear scale. + * For example, to blend through three different arrays: `d3.piecewise(d3.interpolateArray, [[0, 0, 1], [0, 0, 10], [0, 0, 15]])`. + * + * interpolate defaults to d3.interpolate. + */ +export function piecewise(values: A[]): ArrayInterpolator; +/** + * Returns a piecewise array interpolator, composing array interpolators for each adjacent pair of arrays. + * The returned interpolator maps `t` in `[0, 1 / (n - 1)]` to `interpolate(values[0], values[1])`, `t` in `[1 / (n - 1), 2 / (n - 1)]` to `interpolate(values[1], values[2])`, + * and so on, where `n = values.length`. In effect, this is a lightweight linear scale. + * For example, to blend through three different arrays: `d3.piecewise(d3.interpolateArray, [[0, 0, 1], [0, 0, 10], [0, 0, 15]])`. + */ +export function piecewise( + interpolate: (a: any[], b: A) => ArrayInterpolator, + values: A[], +): ArrayInterpolator; + +/** + * Returns a piecewise interpolator, composing interpolators for each adjacent pair of values. + * The returned interpolator maps `t` in `[0, 1 / (n - 1)]` to `interpolate(values[0], values[1])`, `t` in `[1 / (n - 1), 2 / (n - 1)]` to `interpolate(values[1], values[2])`, + * and so on, where `n = values.length`. In effect, this is a lightweight linear scale. + * For example, to blend through red, green and blue: `d3.piecewise(d3.interpolateRgb.gamma(2.2), ["red", "green", "blue"])`. + * + * interpolate defaults to d3.interpolate. + */ +export function piecewise(values: unknown[]): (t: number) => any; +/** + * Returns a piecewise interpolator, composing interpolators for each adjacent pair of values. + * The returned interpolator maps `t` in `[0, 1 / (n - 1)]` to `interpolate(values[0], values[1])`, `t` in `[1 / (n - 1), 2 / (n - 1)]` to `interpolate(values[1], values[2])`, + * and so on, where `n = values.length`. In effect, this is a lightweight linear scale. + * For example, to blend through red, green and blue: `d3.piecewise(d3.interpolateRgb.gamma(2.2), ["red", "green", "blue"])`. + */ +export function piecewise(interpolate: (a: TData, b: TData) => unknown, values: TData[]): (t: number) => any; diff --git a/node_modules/@types/d3-interpolate/package.json b/node_modules/@types/d3-interpolate/package.json new file mode 100644 index 0000000..9d687bb --- /dev/null +++ b/node_modules/@types/d3-interpolate/package.json @@ -0,0 +1,47 @@ +{ + "name": "@types/d3-interpolate", + "version": "3.0.4", + "description": "TypeScript definitions for d3-interpolate", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-interpolate", + "license": "MIT", + "contributors": [ + { + "name": "Tom Wanzek", + "githubUsername": "tomwanzek", + "url": "https://github.com/tomwanzek" + }, + { + "name": "Alex Ford", + "githubUsername": "gustavderdrache", + "url": "https://github.com/gustavderdrache" + }, + { + "name": "Boris Yankov", + "githubUsername": "borisyankov", + "url": "https://github.com/borisyankov" + }, + { + "name": "denisname", + "githubUsername": "denisname", + "url": "https://github.com/denisname" + }, + { + "name": "Nathan Bierema", + "githubUsername": "Methuselah96", + "url": "https://github.com/Methuselah96" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/d3-interpolate" + }, + "scripts": {}, + "dependencies": { + "@types/d3-color": "*" + }, + "typesPublisherContentHash": "d315fc677144695b44f1447ef7429c9ff248886716c2e9f742d031abcb319115", + "typeScriptVersion": "4.5" +} \ No newline at end of file diff --git a/node_modules/@types/d3-selection/LICENSE b/node_modules/@types/d3-selection/LICENSE new file mode 100644 index 0000000..9e841e7 --- /dev/null +++ b/node_modules/@types/d3-selection/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/node_modules/@types/d3-selection/README.md b/node_modules/@types/d3-selection/README.md new file mode 100644 index 0000000..c502eab --- /dev/null +++ b/node_modules/@types/d3-selection/README.md @@ -0,0 +1,15 @@ +# Installation +> `npm install --save @types/d3-selection` + +# Summary +This package contains type definitions for d3-selection (https://github.com/d3/d3-selection/). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-selection. + +### Additional Details + * Last updated: Mon, 07 Oct 2024 22:38:10 GMT + * Dependencies: none + +# Credits +These definitions were written by [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), [denisname](https://github.com/denisname), [Nathan Bierema](https://github.com/Methuselah96), and [Ambar Mutha](https://github.com/ambar-arkin). diff --git a/node_modules/@types/d3-selection/index.d.ts b/node_modules/@types/d3-selection/index.d.ts new file mode 100644 index 0000000..1187c25 --- /dev/null +++ b/node_modules/@types/d3-selection/index.d.ts @@ -0,0 +1,1173 @@ +// Last module patch version validated against: 3.0.0 + +// -------------------------------------------------------------------------- +// Shared Type Definitions and Interfaces +// -------------------------------------------------------------------------- + +/** + * BaseType serves as an alias for the 'minimal' data type which can be selected + * without 'd3-selection' trying to use properties internally which would otherwise not + * be supported. + */ +export type BaseType = Element | EnterElement | Document | Window | null; + +/** + * KeyType serves as alias for valid types that d3 supports as key for data binding + */ +export type KeyType = string | number; + +/** + * A helper interface which covers arguments like NodeListOf or HTMLCollectionOf + * argument types + */ +export interface ArrayLike { + length: number; + item(index: number): T | null; + [index: number]: T; +} + +/** + * An interface describing the element type of the Enter Selection group elements + * created when invoking selection.enter(). + */ +export interface EnterElement { + ownerDocument: Document; + namespaceURI: string; + appendChild(newChild: Node): Node; + insertBefore(newChild: Node, refChild: Node): Node; + querySelector(selectors: string): Element; + querySelectorAll(selectors: string): NodeListOf; +} + +/** + * Container element type usable for mouse/touch functions + */ +export type ContainerElement = HTMLElement | SVGSVGElement | SVGGElement; + +/** + * A User interface event (e.g. mouse event, touch or MSGestureEvent) with captured clientX and clientY properties. + */ +export interface ClientPointEvent { + clientX: number; + clientY: number; +} + +/** + * Interface for optional parameters map, when dispatching custom events + * on a selection + */ +export interface CustomEventParameters { + /** + * If true, the event is dispatched to ancestors in reverse tree order + */ + bubbles: boolean; + /** + * If true, event.preventDefault is allowed + */ + cancelable: boolean; + /** + * Any custom data associated with the event + */ + detail: any; +} + +/** + * Callback type for selections and transitions + */ +export type ValueFn = ( + this: T, + datum: Datum, + index: number, + groups: T[] | ArrayLike, +) => Result; + +/** + * TransitionLike is a helper interface to represent a quasi-Transition, without specifying the full Transition interface in this file. + * For example, wherever d3-zoom allows a Transition to be passed in as an argument, it internally immediately invokes its `selection()` + * method to retrieve the underlying Selection object before proceeding. + * d3-brush uses a subset of Transition methods internally. + * The use of this interface instead of the full imported Transition interface is [referred] to achieve + * two things: + * (1) the d3-transition module may not be required by a projects use case, + * (2) it avoids possible complications from 'module augmentation' from d3-transition to Selection. + */ +export interface TransitionLike { + selection(): Selection; + on(type: string, listener: null): TransitionLike; + on(type: string, listener: ValueFn): TransitionLike; + tween(name: string, tweenFn: null): TransitionLike; + tween(name: string, tweenFn: ValueFn void)>): TransitionLike; +} + +// -------------------------------------------------------------------------- +// All Selection related interfaces and function +// -------------------------------------------------------------------------- + +/** + * Select the first element that matches the specified selector string. If no elements match the selector, returns an empty selection. + * If multiple elements match the selector, only the first matching element (in document order) will be selected. + * + * The first generic "GElement" refers to the type of element to be selected. The second generic "OldDatum" refers to the type of the + * datum, on the selected element. This is useful when re-selecting an element with a previously set, know datum type. + * + * @param selector CSS selector string + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function select( + selector: string, +): Selection; +/** + * Select the specified node element. + * + * The first generic "GElement" refers to the type of element to be selected. The second generic "OldDatum" refers to the type of the + * datum, on the selected element. This is useful when re-selecting an element with a previously set, know datum type. + * + * @param node An element to be selected + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function select( + node: GElement, +): Selection; + +/** + * Create an empty selection. + */ +export function selectAll(selector?: null): Selection; +/** + * Select all elements that match the specified selector string. The elements will be selected in document order (top-to-bottom). + * If no elements in the document match the selector, returns an empty selection. + * + * The first generic "GElement" refers to the type of element to be selected. The second generic "OldDatum" refers to the type of the + * datum, of a selected element. This is useful when re-selecting elements with a previously set, know datum type. + * + * @param selector CSS selector string + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function selectAll( + selector: string, +): Selection; +/** + * Select the specified array, array-like, or iterable of nodes. + * This is useful if you already have a reference to nodes, such as `this.childNodes` within an event listener or a global such as `document.links`. + * The nodes may instead be an iterable, or a pseudo-array such as a NodeList. + * + * The first generic "GElement" refers to the type of element to be selected. + * The second generic "OldDatum" refers to the type of the datum, of a selected element. + * + * @param nodes An array, array-like, or iterable of nodes + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function selectAll( + nodes: GElement[] | ArrayLike | Iterable, +): Selection; + +/** + * A D3 Selection of elements. + * + * The first generic "GElement" refers to the type of the selected element(s). + * The second generic "Datum" refers to the type of the datum of a selected element(s). + * The third generic "PElement" refers to the type of the parent element(s) in the D3 selection. + * The fourth generic "PDatum" refers to the type of the datum of the parent element(s). + */ +export interface Selection { + // Sub-selection ------------------------- + + /** + * For each selected element, select the first descendant element that matches the specified selector string. + * If no element matches the specified selector for the current element, the element at the current index will + * be null in the returned selection. If multiple elements match the selector, only the first matching element + * in document order is selected. Selection.select does not affect grouping: it preserves the existing group + * structure and indexes, and propagates data (if any) to selected children. + * + * If the current element has associated data, this data is propagated to the + * corresponding selected element. + * + * The generic represents the type of the descendant element to be selected. + * + * @param selector CSS selector string + */ + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + select(selector: string): Selection; + /** + * Create an empty sub-selection. Selection.select does not affect grouping: it preserves the existing group + * structure and indexes. + */ + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + select(selector: null): Selection; + /** + * For each selected element, select the descendant element returned by the selector function. + * If no element is returned by the selector function for the current element, the element at the + * current index will be null in the returned selection. Selection.select does not affect grouping: + * it preserves the existing group structure and indexes, and propagates data (if any) to selected children. + * + * If the current element has associated data, this data is propagated to the + * corresponding selected element. + * + * The generic represents the type of the descendant element to be selected. + * + * @param selector A selector function, which is evaluated for each selected element, in order, being passed the current datum (d), + * the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). + * It must return an element, or null if there is no matching element. + */ + select( + selector: ValueFn, + ): Selection; + + /** + * Create an empty sub-selection. Selection.selectAll does affect grouping: The elements in the returned + * selection are grouped by their corresponding parent node in this selection, the group at the current index will be empty. + */ + selectAll(selector?: null): Selection; + /** + * For each selected element, selects the descendant elements that match the specified selector string. The elements in the returned + * selection are grouped by their corresponding parent node in this selection. If no element matches the specified selector + * for the current element, the group at the current index will be empty. Selection.selectAll does affect grouping: each selected descendant + * is grouped by the parent element in the originating selection. + * + * The selected elements do not inherit data from this selection; use selection.data to propagate data to children. + * + * The first generic "DescElement" refers to the type of descendant element to be selected. The second generic "OldDatum" refers to the type of the + * datum, of a selected element. This is useful when re-selecting elements with a previously set, know datum type. + * + * @param selector CSS selector string + */ + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + selectAll( + selector: string, + ): Selection; + /** + * For each selected element, selects the descendant elements returned by the selector function. The elements in the returned + * selection are grouped by their corresponding parent node in this selection. If no element matches the specified selector + * for the current element, the group at the current index will be empty. Selection.selectAll does affect grouping: each selected descendant + * is grouped by the parent element in the originating selection. + * + * The selected elements do not inherit data from this selection; use selection.data to propagate data to children. + * + * The first generic "DescElement" refers to the type of descendant element to be selected. The second generic "OldDatum" refers to the type of the + * datum, of a selected element. This is useful when re-selecting elements with a previously set, know datum type. + * + * @param selector A selector function which is evaluated for each selected element, in order, being passed the current datum (d), + * the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). It must return an array of elements + * (or an iterable, or a pseudo-array, such as a NodeList), or the empty array if there are no matching elements. + */ + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + selectAll( + selector: ValueFn | Iterable>, + ): Selection; + + /** + * Filters the selection, returning a new selection that contains only the elements for + * which the specified filter is true. + * + * The returned filtered selection preserves the parents of this selection, but like array.filter, + * it does not preserve indexes as some elements may be removed; use selection.select to preserve the index, if needed. + * + * @param selector A CSS selector string to match when filtering. + */ + filter(selector: string): Selection; + /** + * Filters the selection, returning a new selection that contains only the elements for + * which the specified filter is true. + * + * The returned filtered selection preserves the parents of this selection, but like array.filter, + * it does not preserve indexes as some elements may be removed; use selection.select to preserve the index, if needed. + * + * The generic refers to the type of element which will be selected after applying the filter, i.e. if the element types + * contained in a pre-filter selection are narrowed to a subset as part of the filtering. + * + * @param selector A CSS selector string to match when filtering. + */ + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + filter(selector: string): Selection; + /** + * Filter the selection, returning a new selection that contains only the elements for + * which the specified filter is true. + * + * The returned filtered selection preserves the parents of this selection, but like array.filter, + * it does not preserve indexes as some elements may be removed; use selection.select to preserve the index, if needed. + * + * @param selector A value function which is evaluated for each selected element, in order, being passed the current datum (d), + * the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). This function should return true + * for an element to be included, and false otherwise. + */ + filter(selector: ValueFn): Selection; + /** + * Filter the selection, returning a new selection that contains only the elements for + * which the specified filter is true. + * + * The returned filtered selection preserves the parents of this selection, but like array.filter, + * it does not preserve indexes as some elements may be removed; use selection.select to preserve the index, if needed. + * + * @param selector A value function which is evaluated for each selected element, in order, being passed the current datum (d), + * the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). This function should return true + * for an element to be included, and false otherwise. + */ + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + filter( + selector: ValueFn, + ): Selection; + + /** + * Returns a new selection merging this selection with the specified other selection or transition. + * The returned selection has the same number of groups and the same parents as this selection. + * Any missing (null) elements in this selection are filled with the corresponding element, + * if present (not null), from the specified selection. (If the other selection has additional groups or parents, + * they are ignored.) + * + * This method is commonly used to merge the enter and update selections after a data-join. + * After modifying the entering and updating elements separately, you can merge the two selections and + * perform operations on both without duplicate code. + * + * This method is not intended for concatenating arbitrary selections, however: if both this selection + * and the specified other selection have (non-null) elements at the same index, this selection’s element + * is returned in the merge and the other selection’s element is ignored. + * + * @param other Selection to be merged. + */ + merge( + other: Selection | TransitionLike, + ): Selection; + + /** + * Returns a new selection with the (first) child of each element of the current selection matching the selector. + * Selects the first child that matches (if any). + * + * The generic represents the type of the descendant element to be selected. + * + * @param selector CSS selector string + */ + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + selectChild(selector?: string): Selection; + /** + * Returns a new selection with the (first) child of each element of the current selection matching the selector. + * + * The first generic represents the type of the descendant element to be selected. + * The second generic represents the type of any of the child elements. + * + * @param selector A selector function, which is evaluated for each of the children nodes, in order, being passed the child (child), the child’s index (i), and the list of children (children); + * the method selects the first child for which the selector return truthy, if any. + */ + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + selectChild( + selector: (child: ChildElement, i: number, children: ChildElement[]) => boolean, + ): Selection; + + /** + * Returns a new selection with the children of each element of the current selection matching the selector. + * Selects the children that match (if any) + * + * The first generic represents the type of the descendant element to be selected. + * The second generic refers to the type of the datum of the element to be selected. + * + * @param selector CSS selector string + */ + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + selectChildren( + selector?: string, + ): Selection; + /** + * Returns a new selection with the children of each element of the current selection matching the selector. + * + * The first generic represents the type of the descendant element to be selected. + * The second generic refers to the type of the datum of the element to be selected. + * The third generic represents the type of any of the child elements. + * + * @param selector A selector function, which is evaluated for each of the children nodes, in order, being passed the child (child), the child’s index (i), and the list of children (children); + * the method selects the first child for which the selector return truthy, if any. + */ + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + selectChildren( + selector: (child: ChildElement, i: number, children: ChildElement[]) => boolean, + ): Selection; + + /** + * Returns the selection (for symmetry with transition.selection). + */ + selection(): this; + + // Modifying ------------------------------- + + /** + * Return the current value of the specified attribute for the first (non-null) element in the selection. + * This is generally useful only if you know that the selection contains exactly one element. + * + * @param name Name of the attribute + */ + attr(name: string): string; + /** + * Sets the attribute with the specified name to the specified value on the selected elements and returns this selection. + * If the value is a constant, all elements are given the same attribute value; + * otherwise, if the value is a function, it is evaluated for each selected element, in order, being passed the current datum (d), + * the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). + * The function’s return value is then used to set each element’s attribute. + * A null value will remove the specified attribute. + */ + attr( + name: string, + value: + | null + | string + | number + | boolean + | ReadonlyArray + | ValueFn>, + ): this; + + /** + * Returns true if and only if the first (non-null) selected element has the specified classes. + * This is generally useful only if you know the selection contains exactly one element. + * + * @param names A string of space-separated class names. + */ + classed(names: string): boolean; + /** + * Assigns or unassigns the specified CSS class names on the selected elements by setting + * the class attribute or modifying the classList property and returns this selection. + * If the constant value is truthy, then all elements are assigned the specified classes; otherwise, the classes are unassigned. + * + * @param names A string of space-separated class names. + * @param value A boolean flag (true = assign / false = unassign) + */ + classed(names: string, value: boolean): this; + /** + * Assigns or unassigns the specified CSS class names on the selected elements by setting + * the class attribute or modifying the classList property and returns this selection. + * The assign/unassign status for the individual selected elements is determined by the boolean return + * value of the value function. + * + * @param names A string of space-separated class names. + * @param value A value function which is evaluated for each selected element, in order, + * being passed the current datum (d), the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). + * The function’s return value is then used to assign or unassign classes on each element. + */ + classed(names: string, value: ValueFn): this; + + /** + * Returns the current value of the specified style property for the first (non-null) element in the selection. + * The current value is defined as the element’s inline value, if present, and otherwise its computed value. + * Accessing the current style value is generally useful only if you know the selection contains exactly one element. + * + * @param name Name of the style + */ + style(name: string): string; + /** + * Clear the style with the specified name for the selected elements and returns this selection. + * + * @param name Name of the style + * @param value null,to clear the style + */ + style(name: string, value: null): this; + /** + * Sets the value of the style with the specified name for the selected elements and returns this selection. + * All elements are given the same style value. + * + * @param name Name of the style + * @param value Constant value for the style + * @param priority An optional priority flag, either null or the string important (without the exclamation point) + */ + style(name: string, value: string | number | boolean, priority?: null | "important"): this; + /** + * Sets the value of the style with the specified name for the selected elements and returns this selection. + * The value for the individual selected elements is determined by the value function. + * + * @param name Name of the style + * @param value A value function which is evaluated for each selected element, in order, being passed the current datum (d), + * the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). A null value will clear the style. + * @param priority An optional priority flag, either null or the string important (without the exclamation point) + */ + style( + name: string, + value: ValueFn, + priority?: null | "important", + ): this; + + /** + * Return the current value of the specified property for the first (non-null) element in the selection. + * This is generally useful only if you know that the selection contains exactly one element. + * + * @param name Name of the property + */ + property(name: string): any; + /** + * Look up a local variable on the first node of this selection. Note that this is not equivalent to `local.get(selection.node())` in that it will not look up locals set on the parent node(s). + * + * @param name The `d3.local` variable to look up. + */ + property(name: Local): T | undefined; + /** + * Sets the property with the specified name to the specified value on selected elements. + * If the value is a constant, then all elements are given the same property value; + * otherwise, if the value is a function, it is evaluated for each selected element, in order, being passed the current datum (d), + * the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). + * The function’s return value is then used to set each element’s property. A null value will delete the specified property. + */ + property(name: string, value: ValueFn | null): this; + /** + * Sets the value of the property with the specified name for the selected elements and returns this selection. + * All elements are given the same property value. + * + * @param name Name of the property + * @param value Constant value for the property + */ + property(name: string, value: any): this; + /** + * Store a value in a `d3.local` variable. + * This is equivalent to `selection.each(function (d, i, g) { name.set(this, value.call(this, d, i, g)); })` but more concise. + * + * @param name A `d3.local` variable + * @param value A callback that returns the value to store + */ + property(name: Local, value: ValueFn): this; + /** + * Store a value in a `d3.local` variable for each node in the selection. + * This is equivalent to `selection.each(function () { name.set(this, value); })` but more concise. + * + * @param name A `d3.local` variable + * @param value A callback that returns the value to store + */ + property(name: Local, value: T): this; + + /** + * Returns the text content for the first (non-null) element in the selection. + * This is generally useful only if you know the selection contains exactly one element. + */ + text(): string; + /** + * Sets the text content to the specified value on all selected elements, replacing any existing child elements. + * If the value is a constant, then all elements are given the same text content; + * otherwise, if the value is a function, it is evaluated for each selected element, in order, being passed the current datum (d), + * the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). + * The function’s return value is then used to set each element’s text content. + * A null value will clear the content. + */ + text(value: null | string | number | boolean | ValueFn): this; + + /** + * Returns a string representation of the inner HTML for the first (non-null) element in the selection. + * This is generally useful only if you know the selection contains exactly one element. + */ + html(): string; + /** + * Sets the inner HTML to the specified value on all selected elements, replacing any existing child elements. + * If the value is a constant, then all elements are given the same inner HTML; + * otherwise, if the value is a function, it is evaluated for each selected element, in order, being passed the current datum (d), + * the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). + * The function’s return value is then used to set each element’s inner HTML. + * A null value will clear the content. + */ + html(value: null | string | ValueFn): this; + + /** + * Appends a new element of this type (tag name) as the last child of each selected element, + * or before the next following sibling in the update selection if this is an enter selection. + * The latter behavior for enter selections allows you to insert elements into the DOM in an order consistent with the new bound data; + * however, note that selection.order may still be required if updating elements change order + * (i.e., if the order of new data is inconsistent with old data). + * + * This method returns a new selection containing the appended elements. + * Each new element inherits the data of the current elements, if any. + * + * @param type A string representing the tag name. + */ + append(type: K): Selection; + /** + * Appends a new element of this type (tag name) as the last child of each selected element, + * or before the next following sibling in the update selection if this is an enter selection. + * The latter behavior for enter selections allows you to insert elements into the DOM in an order consistent with the new bound data; + * however, note that selection.order may still be required if updating elements change order + * (i.e., if the order of new data is inconsistent with old data). + * + * This method returns a new selection containing the appended elements. + * Each new element inherits the data of the current elements, if any. + * + * The generic refers to the type of the child element to be appended. + * + * @param type A string representing the tag name. The specified name may have a namespace prefix, such as svg:text + * to specify a text attribute in the SVG namespace. If no namespace is specified, the namespace will be inherited + * from the parent element; or, if the name is one of the known prefixes, the corresponding namespace will be used + * (for example, svg implies svg:svg) + */ + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + append(type: string): Selection; + /** + * Appends a new element of the type provided by the element creator function as the last child of each selected element, + * or before the next following sibling in the update selection if this is an enter selection. + * The latter behavior for enter selections allows you to insert elements into the DOM in an order consistent with the new bound data; + * however, note that selection.order may still be required if updating elements change order + * (i.e., if the order of new data is inconsistent with old data). + * + * This method returns a new selection containing the appended elements. + * Each new element inherits the data of the current elements, if any. + * + * The generic refers to the type of the child element to be appended. + * + * @param type A creator function which is evaluated for each selected element, in order, being passed the current datum (d), + * the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). This function should return + * an element to be appended. (The function typically creates a new element, but it may instead return an existing element.) + */ + append( + type: ValueFn, + ): Selection; + + /** + * Inserts a new element of the specified type (tag name) before the first element matching the specified + * before selector for each selected element. For example, a before selector :first-child will prepend nodes before the first child. + * If before is not specified, it defaults to null. (To append elements in an order consistent with bound data, use selection.append.) + * + * This method returns a new selection containing the appended elements. + * Each new element inherits the data of the current elements, if any. + * + * The generic refers to the type of the child element to be appended. + * + * @param type A string representing the tag name for the element type to be inserted. + * @param before One of: + * * A CSS selector string for the element before which the insertion should occur. + * * A child selector function which is evaluated for each selected element, in order, being passed the current datum (d), + * the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). This function should return the child element + * before which the element should be inserted. + */ + insert( + type: K, + before?: string | ValueFn, + ): Selection; + /** + * Inserts a new element of the specified type (tag name) before the first element matching the specified + * before selector for each selected element. For example, a before selector :first-child will prepend nodes before the first child. + * If before is not specified, it defaults to null. (To append elements in an order consistent with bound data, use selection.append.) + * + * This method returns a new selection containing the appended elements. + * Each new element inherits the data of the current elements, if any. + * + * The generic refers to the type of the child element to be appended. + * + * @param type One of: + * * A string representing the tag name for the element type to be inserted. The specified name may have a namespace prefix, + * such as svg:text to specify a text attribute in the SVG namespace. If no namespace is specified, the namespace will be inherited + * from the parent element; or, if the name is one of the known prefixes, the corresponding namespace will be used + * (for example, svg implies svg:svg) + * * A creator function which is evaluated for each selected element, in order, being passed the current datum (d), + * the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). This function should return + * an element to be inserted. (The function typically creates a new element, but it may instead return an existing element.) + * @param before One of: + * * A CSS selector string for the element before which the insertion should occur. + * * A child selector function which is evaluated for each selected element, in order, being passed the current datum (d), + * the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). This function should return the child element + * before which the element should be inserted. + */ + insert( + type: string | ValueFn, + before?: string | ValueFn, + ): Selection; + + /** + * Removes the selected elements from the document. + * Returns this selection (the removed elements) which are now detached from the DOM. + */ + remove(): this; + + /** + * Inserts clones of the selected elements immediately following the selected elements and returns a selection of the newly + * added clones. If deep is true, the descendant nodes of the selected elements will be cloned as well. Otherwise, only the elements + * themselves will be cloned. + * + * @param deep Perform deep cloning if this flag is set to true. + */ + clone(deep?: boolean): Selection; + + /** + * Return a new selection that contains a copy of each group in this selection sorted according + * to the compare function. After sorting, re-inserts elements to match the resulting order (per selection.order). + * + * Note that sorting is not guaranteed to be stable; however, it is guaranteed to have the same + * behavior as your browser’s built-in sort method on arrays. + * + * @param comparator An optional comparator function, which defaults to "ascending". The function is passed + * two elements’ data a and b to compare. It should return either a negative, positive, or zero value. + * If negative, then a should be before b; if positive, then a should be after b; otherwise, a and b are + * considered equal and the order is arbitrary. + */ + sort(comparator?: (a: Datum, b: Datum) => number): this; + + /** + * Re-insert elements into the document such that the document order of each group matches the selection order. + * This is equivalent to calling selection.sort if the data is already sorted, but much faster. + */ + order(): this; + + /** + * Re-insert each selected element, in order, as the last child of its parent. + */ + raise(): this; + + /** + * Re-insert each selected element, in order, as the first child of its parent. + */ + lower(): this; + + // Data Join --------------------------------- + + /** + * Returns the array of data for the selected elements. + */ + data(): Datum[]; + /** + * Joins the specified array of data with the selected elements, returning a new selection that represents + * the update selection: the elements successfully bound to data. Also defines the enter and exit selections on + * the returned selection, which can be used to add or remove elements to correspond to the new data. + * + * The data is specified for each group in the selection. If the selection has multiple groups + * (such as d3.selectAll followed by selection.selectAll), then data should typically be specified as a function. + * + * If a key function is not specified, then the first datum in data is assigned to the first selected element, + * the second datum to the second selected element, and so on. + * A key function may be specified to control which datum is assigned to which element, replacing the default join-by-index, + * by computing a string identifier for each datum and element. + * + * The update and enter selections are returned in data order, while the exit selection preserves the selection + * order prior to the join. If a key function is specified, the order of elements in the selection may not match + * their order in the document; use selection.order or selection.sort as needed. + * + * This method cannot be used to clear bound data; use selection.datum instead. + * + * For details see: {@link https://github.com/d3/d3-selection#joining-data } + * + * The generic refers to the type of the new datum to be used for the selected elements. + * + * @param data The specified data is an array or iterable of arbitrary values (e.g., numbers or objects) + * or a value function which will be evaluated for each group in order, being passed the group’s parent datum + * (d, which may be undefined), the group index (i), and the selection’s parent nodes (nodes), + * with this as the group’s parent element. The function returns an array or iterable of values for each group. + * @param key An optional key function which is evaluated for each selected element, in order, being passed the + * current datum (d), the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]); the returned string is the element’s key. + * The key function is then also evaluated for each new datum in data, being passed the current datum (d), + * the current index (i), and the group’s new data, with this as the group’s parent DOM element (nodes[i]); the returned string is the datum’s key. + * The datum for a given key is assigned to the element with the matching key. If multiple elements have the same key, + * the duplicate elements are put into the exit selection; if multiple data have the same key, the duplicate data are put into the enter selection. + */ + data( + data: NewDatum[] | Iterable | ValueFn>, + key?: ValueFn, + ): Selection; + + /** + * Appends, removes and reorders elements as necessary to match the data that was previously bound by `selection.data`, returning the merged enter and update selection. + * This method is a convenient alternative to the more explicit `selection.enter`, `selection.exit`, `selection.append` and `selection.remove`. + * + * The "matching" logic is determined by the key function passed to `selection.data`. + */ + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + join( + enter: K, + update?: ( + elem: Selection, + ) => Selection | TransitionLike | undefined, + exit?: (elem: Selection) => void, + ): Selection; + /** + * Appends, removes and reorders elements as necessary to match the data that was previously bound by `selection.data`, returning the merged enter and update selection. + * This method is a convenient alternative to the more explicit `selection.enter`, `selection.exit`, `selection.append` and `selection.remove`. + * + * The "matching" logic is determined by the key function passed to `selection.data`. + */ + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + join( + enter: + | string + | (( + elem: Selection, + ) => Selection | TransitionLike), + update?: ( + elem: Selection, + ) => Selection | TransitionLike | undefined, + exit?: (elem: Selection) => void, + ): Selection; + + /** + * Return the enter selection: placeholder nodes for each datum that had no corresponding DOM element + * in the selection. (The enter selection is empty for selections not returned by selection.data.) + */ + enter(): Selection; + + /** + * Returns the exit selection: existing DOM elements in the selection for which no new datum was found. + * (The exit selection is empty for selections not returned by selection.data.) + * + * IMPORTANT: The generic refers to the type of the old datum associated with the exit selection elements. + * Ensure you set the generic to the correct type, if you need to access the data on the exit selection in + * follow-up steps, e.g. to set styles as part of an exit transition before removing them. + */ + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + exit(): Selection; + + /** + * Returns the bound datum for the first (non-null) element in the selection. + * This is generally useful only if you know the selection contains exactly one element. + */ + datum(): Datum; + /** + * Delete the bound data for each element in the selection. + */ + datum(value: null): Selection; + /** + * Sets the element’s bound data using the specified value function on all selected elements. + * Unlike selection.data, this method does not compute a join and does not affect + * indexes or the enter and exit selections. + * + * The generic refers to the type of the new datum to be used for the selected elements. + * + * @param value A value function which is evaluated for each selected element, in order, + * being passed the current datum (d), the current index (i), and the current group (nodes), + * with this as the current DOM element (nodes[i]). The function is then used to set each element’s new data. + * A null value will delete the bound data. + */ + datum(value: ValueFn): Selection; + /** + * Sets the element’s bound data to the specified value on all selected elements. + * Unlike selection.data, this method does not compute a join and does not affect + * indexes or the enter and exit selections. + * + * The generic refers to the type of the new datum to be used for the selected elements. + * + * @param value A value object to be used as the datum for each element. + */ + datum(value: NewDatum): Selection; + + // Event Handling ------------------- + + /** + * Return the currently-assigned listener for the specified event typename on the first (non-null) selected element, + * if any, If multiple typenames are specified, the first matching listener is returned. + * + * @param typenames The typenames is a string event type, such as click, mouseover, or submit; any DOM event type supported by your browser may be used. + * The type may be optionally followed by a period (.) and a name; the optional name allows multiple callbacks to be registered + * to receive events of the same type, such as click.foo and click.bar. To specify multiple typenames, separate typenames with spaces, + * such as "input change"" or "click.foo click.bar". + */ + on(typenames: string): ((this: GElement, event: any, d: Datum) => void) | undefined; + /** + * Remove a listener for the specified event type names. To remove all listeners for a given name, + * pass null as the listener and ".foo" as the typename, where foo is the name; to remove all listeners with no name, specify "." as the typename. + * + * @param typenames The typenames is a string event type, such as click, mouseover, or submit; any DOM event type supported by your browser may be used. + * The type may be optionally followed by a period (.) and a name; the optional name allows multiple callbacks to be registered + * to receive events of the same type, such as click.foo and click.bar. To specify multiple typenames, separate typenames with spaces, + * such as "input change"" or "click.foo click.bar". + * @param listener null to indicate removal of listener + */ + on(typenames: string, listener: null): this; + /** + * Add an event listener for the specified event type names. If an event listener was previously registered for the same typename + * on a selected element, the old listener is removed before the new listener is added. + * + * When a specified event is dispatched on a selected node, the specified listener will be evaluated for each selected element. + * + * @param typenames The typenames is a string event type, such as click, mouseover, or submit; any DOM event type supported by your browser may be used. + * The type may be optionally followed by a period (.) and a name; the optional name allows multiple callbacks to be registered + * to receive events of the same type, such as click.foo and click.bar. To specify multiple typenames, separate typenames with spaces, + * such as "input change"" or "click.foo click.bar". + * @param listener A listener function which will be evaluated for each selected element, + * being passed the current event (event) and the current datum (d), with this as the current DOM element (event.currentTarget). + * Listeners always see the latest datum for their element. + * Note: while you can use event.pageX and event.pageY directly, + * it is often convenient to transform the event position to the local coordinate system of that element that received the event using d3.pointer. + * @param options An optional options object may specify characteristics about the event listener, such as wehether it is captures or passive; see element.addEventListener. + */ + on(typenames: string, listener: (this: GElement, event: any, d: Datum) => void, options?: any): this; + + /** + * Dispatches a custom event of the specified type to each selected element, in order. + * An optional parameters map may be specified to set additional properties of the event. + * + * @param type Name of event to dispatch + * @param parameters An optional value map with custom event parameters + */ + dispatch(type: string, parameters?: CustomEventParameters): this; + /** + * Dispatches a custom event of the specified type to each selected element, in order. + * An optional value function returning a parameters map for each element in the selection may be specified to set additional properties of the event. + * + * @param type Name of event to dispatch + * @param parameters A value function which is evaluated for each selected element, in order, + * being passed the current datum (d), the current index (i), and the current group (nodes), + * with this as the current DOM element (nodes[i]). It must return the parameters map for the current element. + */ + dispatch(type: string, parameters?: ValueFn): this; + + // Control Flow ---------------------- + + /** + * Invoke the specified function for each selected element, passing in the current datum (d), + * the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). + * This method can be used to invoke arbitrary code for each selected element, and is useful for creating a context to access parent and child data simultaneously. + * + * @param func A function which is invoked for each selected element, + * being passed the current datum (d), the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). + */ + each(func: ValueFn): this; + + /** + * Invoke the specified function exactly once, passing in this selection along with any optional arguments. + * Returns this selection. + * + * @param func A function which is passed this selection as the first argument along with any optional arguments. + * @param args List of optional arguments to be passed to the callback function. + */ + call( + func: (selection: Selection, ...args: Args) => void, + ...args: Args + ): this; + + /** + * Return true if this selection contains no (non-null) elements. + */ + empty(): boolean; + + /** + * Return an array of all (non-null) elements in this selection. + */ + nodes(): GElement[]; + + /** + * Return the first (non-null) element in this selection. If the selection is empty, returns null. + */ + node(): GElement | null; + + /** + * Returns the total number of elements in this selection. + */ + size(): number; + + /** + * Returns an iterator over the selected (non-null) elements. + */ + [Symbol.iterator](): Iterator; +} + +/** + * Selects the root element, document.documentElement. This function can also be used to test for selections + * (instanceof d3.selection) or to extend the selection prototype. + */ +export type SelectionFn = () => Selection; + +/** + * Selects the root element, document.documentElement. This function can also be used to test for selections + * (instanceof d3.selection) or to extend the selection prototype. + */ +export const selection: SelectionFn; + +// --------------------------------------------------------------------------- +// pointer.js and pointers.js related +// --------------------------------------------------------------------------- + +/** + * Returns a two-element array of numbers [x, y] representing the coordinates of the specified event relative to the specified target. + * event can be a MouseEvent, a PointerEvent, a Touch, or a custom event holding a UIEvent as event.sourceEvent. + * + * If target is not specified, it defaults to the source event’s currentTarget property, if available. + * If the target is an SVG element, the event’s coordinates are transformed using the inverse of the screen coordinate transformation matrix. + * If the target is an HTML element, the event’s coordinates are translated relative to the top-left corner of the target’s bounding client rectangle. + * (As such, the coordinate system can only be translated relative to the client coordinates. See also GeometryUtils.) + * Otherwise, [event.pageX, event.pageY] is returned. + * + * @param event The specified event. + * @param target The target which the coordinates are relative to. + */ +export function pointer(event: any, target?: any): [number, number]; + +/** + * Returns an array [[x0, y0], [x1, y1]…] of coordinates of the specified event’s pointer locations relative to the specified target. + * For touch events, the returned array of positions corresponds to the event.touches array; for other events, returns a single-element array. + * + * If target is not specified, it defaults to the source event’s currentTarget property, if any. + * + * @param event The specified event. + * @param target The target which the coordinates are relative to. + */ +export function pointers(event: any, target?: any): Array<[number, number]>; + +// --------------------------------------------------------------------------- +// style +// --------------------------------------------------------------------------- + +/** + * Returns the value of the style property with the specified name for the specified node. + * If the node has an inline style with the specified name, its value is returned; otherwise, the computed property value is returned. + * See also selection.style. + * + * @param node A DOM node (e.g. HTMLElement, SVGElement) for which to retrieve the style property. + * @param name Style property name. + */ +export function style(node: Element, name: string): string; + +// --------------------------------------------------------------------------- +// local.js related +// --------------------------------------------------------------------------- + +export interface Local { + /** + * Retrieves a local variable stored on the node (or one of its parents). + * + * @param node A node element. + */ + get(node: Element): T | undefined; + /** + * Deletes the value associated with the given node. Values stored on ancestors are not affected, meaning that child nodes will still see inherited values. + * + * This function returns true if there was a value stored directly on the node, and false otherwise. + * + * @param node A node element. + */ + remove(node: Element): boolean; + /** + * Store a value for this local variable. Calling `.get()` on children of this node will also retrieve the variable's value. + * + * @param node A node element. + * @param value Value to store locally + */ + set(node: Element, value: T): T; + /** + * Obtain a string with the internally assigned property name for the local + * which is used to store the value on a node + */ + toString(): string; +} + +/** + * Obtain a new local variable + * + * The generic refers to the type of the variable to store locally. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function local(): Local; + +// --------------------------------------------------------------------------- +// namespace.js related +// --------------------------------------------------------------------------- + +/** + * Interface for object literal containing local name with related fully qualified namespace + */ +export interface NamespaceLocalObject { + /** + * Fully qualified namespace + */ + space: string; + /** + * Name of the local to be namespaced. + */ + local: string; +} + +/** + * Obtain an object with properties of fully qualified namespace string and + * name of local by parsing a shorthand string "prefix:local". If the prefix + * does not exist in the "namespaces" object provided by d3-selection, then + * the local name is returned as a simple string. + * + * @param prefixedLocal A string composed of the namespace prefix and local + * name separated by colon, e.g. "svg:text". + */ +export function namespace(prefixedLocal: string): NamespaceLocalObject | string; + +// --------------------------------------------------------------------------- +// namespaces.js related +// --------------------------------------------------------------------------- + +/** + * Interface for maps of namespace prefixes to corresponding fully qualified namespace strings + */ +export interface NamespaceMap { + [prefix: string]: string; +} + +/** + * Map of namespace prefixes to corresponding fully qualified namespace strings + */ +export const namespaces: NamespaceMap; + +// --------------------------------------------------------------------------- +// window.js related +// --------------------------------------------------------------------------- + +/** + * Returns the owner window for the specified node. If node is a node, returns the owner document’s default view; + * if node is a document, returns its default view; otherwise returns the node. + * + * @param DOMNode A DOM element + */ +export function window(DOMNode: Window | Document | Element): Window; + +// --------------------------------------------------------------------------- +// creator.js and matcher.js Complex helper closure generating functions +// for explicit bound-context dependent use +// --------------------------------------------------------------------------- + +/** + * Given the specified element name, returns a single-element selection containing + * a detached element of the given name in the current document. + * + * @param name tag name of the element to be added. + */ +export function create( + name: K, +): Selection; +/** + * Given the specified element name, returns a single-element selection containing + * a detached element of the given name in the current document. + * + * @param name Tag name of the element to be added. See "namespace" for details on supported namespace prefixes, + * such as for SVG elements. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function create(name: string): Selection; + +/** + * Given the specified element name, returns a function which creates an element of the given name, + * assuming that "this" is the parent element. + * + * @param name Tag name of the element to be added. + */ +export function creator(name: K): (this: BaseType) => ElementTagNameMap[K]; +/** + * Given the specified element name, returns a function which creates an element of the given name, + * assuming that "this" is the parent element. + * + * The generic refers to the type of the new element to be returned by the creator function. + * + * @param name Tag name of the element to be added. See "namespace" for details on supported namespace prefixes, + * such as for SVG elements. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function creator(name: string): (this: BaseType) => NewGElement; + +/** + * Given the specified selector, returns a function which returns true if "this" element matches the specified selector. + * + * @param selector A CSS selector string. + */ +export function matcher(selector: string): (this: BaseType) => boolean; + +// ---------------------------------------------------------------------------- +// selector.js and selectorAll.js related functions +// ---------------------------------------------------------------------------- + +/** + * Given the specified selector, returns a function which returns the first descendant of "this" element + * that matches the specified selector. + * + * The generic refers to the type of the returned descendant element. + * + * @param selector A CSS selector string. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function selector(selector: string): (this: BaseType) => DescElement; + +/** + * Given the specified selector, returns a function which returns all descendants of "this" element that match the specified selector. + * + * The generic refers to the type of the returned descendant element. + * + * @param selector A CSS selector string. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function selectorAll(selector: string): (this: BaseType) => NodeListOf; diff --git a/node_modules/@types/d3-selection/package.json b/node_modules/@types/d3-selection/package.json new file mode 100644 index 0000000..40493de --- /dev/null +++ b/node_modules/@types/d3-selection/package.json @@ -0,0 +1,50 @@ +{ + "name": "@types/d3-selection", + "version": "3.0.11", + "description": "TypeScript definitions for d3-selection", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-selection", + "license": "MIT", + "contributors": [ + { + "name": "Tom Wanzek", + "githubUsername": "tomwanzek", + "url": "https://github.com/tomwanzek" + }, + { + "name": "Alex Ford", + "githubUsername": "gustavderdrache", + "url": "https://github.com/gustavderdrache" + }, + { + "name": "Boris Yankov", + "githubUsername": "borisyankov", + "url": "https://github.com/borisyankov" + }, + { + "name": "denisname", + "githubUsername": "denisname", + "url": "https://github.com/denisname" + }, + { + "name": "Nathan Bierema", + "githubUsername": "Methuselah96", + "url": "https://github.com/Methuselah96" + }, + { + "name": "Ambar Mutha", + "githubUsername": "ambar-arkin", + "url": "https://github.com/ambar-arkin" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/d3-selection" + }, + "scripts": {}, + "dependencies": {}, + "typesPublisherContentHash": "fefb1bdeb8d385251c2a5f0f16c4a924e80663081d09b1d98f79573a4db8ff6c", + "typeScriptVersion": "4.8" +} \ No newline at end of file diff --git a/node_modules/@types/d3-transition/LICENSE b/node_modules/@types/d3-transition/LICENSE new file mode 100644 index 0000000..9e841e7 --- /dev/null +++ b/node_modules/@types/d3-transition/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/node_modules/@types/d3-transition/README.md b/node_modules/@types/d3-transition/README.md new file mode 100644 index 0000000..716374e --- /dev/null +++ b/node_modules/@types/d3-transition/README.md @@ -0,0 +1,15 @@ +# Installation +> `npm install --save @types/d3-transition` + +# Summary +This package contains type definitions for d3-transition (https://github.com/d3/d3-transition/). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-transition. + +### Additional Details + * Last updated: Mon, 07 Oct 2024 22:38:10 GMT + * Dependencies: [@types/d3-selection](https://npmjs.com/package/@types/d3-selection) + +# Credits +These definitions were written by [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), [Robert Moura](https://github.com/robertmoura), and [Nathan Bierema](https://github.com/Methuselah96). diff --git a/node_modules/@types/d3-transition/index.d.ts b/node_modules/@types/d3-transition/index.d.ts new file mode 100644 index 0000000..046b080 --- /dev/null +++ b/node_modules/@types/d3-transition/index.d.ts @@ -0,0 +1,664 @@ +// Last module patch version validated against: 3.0.1 + +import { ArrayLike, BaseType, Selection, ValueFn } from "d3-selection"; + +/** + * Extend interface 'Selection' by declaration merging with 'd3-selection' + */ +declare module "d3-selection" { + /** + * A D3 Selection of elements. + * + * The first generic "GElement" refers to the type of the selected element(s). + * The second generic "Datum" refers to the type of the datum of a selected element(s). + * The third generic "PElement" refers to the type of the parent element(s) in the D3 selection. + * The fourth generic "PDatum" refers to the type of the datum of the parent element(s). + */ + interface Selection { + /** + * Interrupts the active transition of the specified name on the selected elements, and cancels any pending transitions with the specified name, if any. + * If a name is not specified, null is used. + * + * IMPORTANT: Interrupting a transition on an element has no effect on any transitions on any descendant elements. + * For example, an axis transition consists of multiple independent, synchronized transitions on the descendants of the axis G element + * (the tick lines, the tick labels, the domain path, etc.). To interrupt the axis transition, you must therefore interrupt the descendants. + * + * @param name Name of the transition. + */ + interrupt(name?: string): this; + /** + * Returns a new transition on the given selection with the specified name. If a name is not specified, null is used. + * The new transition is only exclusive with other transitions of the same name. + * + * @param name Name of the transition. + */ + transition(name?: string): Transition; + /** + * Returns a new transition on the given selection. + * + * When using a transition instance, the returned transition has the same id and name as the specified transition. + * If a transition with the same id already exists on a selected element, the existing transition is returned for that element. + * Otherwise, the timing of the returned transition is inherited from the existing transition of the same id on the nearest ancestor of each selected element. + * Thus, this method can be used to synchronize a transition across multiple selections, + * or to re-select a transition for specific elements and modify its configuration. + * + * If the specified transition is not found on a selected node or its ancestors (such as if the transition already ended), + * the default timing parameters are used; however, in a future release, this will likely be changed to throw an error. + * + * @param transition A transition instance. + */ + transition(transition: Transition): Transition; + } +} + +/** + * Return the active transition on the specified node with the specified name, if any. + * If no name is specified, null is used. Returns null if there is no such active transition on the specified node. + * This method is useful for creating chained transitions. + * + * The first generic "GElement" refers to the type of element on which the returned active transition was defined. The second generic "Datum" refers to the type of the + * datum, of a selected element on which the transition is defined. The third generic refers to the type of the parent elements in the returned Transition. + * The fourth generic refers to the type of the datum defined on the parent elements in the returned Transition. + * + * @param node Element for which the active transition should be returned. + * @param name Name of the transition. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function active( + node: GElement, + name?: string, +): Transition | null; + +/** + * Interrupts the active transition of the specified name on the specified node, and cancels any pending transitions with the specified name, if any. + * If a name is not specified, null is used. + * + * @param node Element for which the transition should be interrupted. + * @param name Name of the transition to be interrupted. If a name is not specified, null is used. + */ +export function interrupt(node: BaseType, name?: string): void; + +/** + * A D3 Transition. + * + * The first generic "GElement" refers to the type of the selected element(s) in the Transition. + * The second generic "Datum" refers to the type of the datum of a selected element(s) in the Transition. + * The third generic "PElement" refers to the type of the parent element(s) in the D3 selection in the Transition. + * The fourth generic "PDatum" refers to the type of the datum of the parent element(s) in the Transition. + */ +export interface Transition { + // Sub-selection ------------------------- + + /** + * For each selected element, select the first descendant element that matches the specified selector string, if any, + * and returns a transition on the resulting selection. The new transition has the same id, name and timing as this transition; + * however, if a transition with the same id already exists on a selected element, + * the existing transition is returned for that element. + * + * The generic represents the type of the descendant element to be selected. + * + * @param selector CSS selector string + */ + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + select(selector: string): Transition; + /** + * For each selected element, select the descendant element returned by the selector function, if any, + * and returns a transition on the resulting selection. The new transition has the same id, name and timing as this transition; + * however, if a transition with the same id already exists on a selected element, + * the existing transition is returned for that element. + * + * The generic represents the type of the descendant element to be selected. + * + * @param selector A selector function, which is evaluated for each selected element, in order, being passed the current datum (d), + * the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). + * It must return an element, or null if there is no matching element. + */ + select( + selector: ValueFn, + ): Transition; + + /** + * For each selected element, select all descendant elements that match the specified selector string, if any, + * and returns a transition on the resulting selection. The new transition has the same id, name and timing as this transition; + * however, if a transition with the same id already exists on a selected element, the existing transition is returned for that element. + * + * The first generic "DescElement" refers to the type of descendant element to be selected. The second generic "OldDatum" refers to the type of the + * datum, of a selected element. This is useful when re-selecting elements with a previously set, know datum type. + * + * @param selector CSS selector string + */ + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + selectAll( + selector: string, + ): Transition; + /** + * For each selected element, select all descendant elements returned by the selector function, if any, + * and returns a transition on the resulting selection. The new transition has the same id, name and timing as this transition; + * however, if a transition with the same id already exists on a selected element, the existing transition is returned for that element. + * + * The first generic "DescElement" refers to the type of descendant element to be selected. The second generic "OldDatum" refers to the type of the + * datum, of a selected element. This is useful when re-selecting elements with a previously set, know datum type. + * + * @param selector A selector function which is evaluated for each selected element, in order, being passed the current datum (d), + * the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). It must return an array of elements + * (or a pseudo-array, such as a NodeList), or the empty array if there are no matching elements. + */ + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + selectAll( + selector: ValueFn>, + ): Transition; + + /** + * For each selected element, selects the first child element that matches the specified selector string, if any, and returns a transition on the resulting selection. + * The selector may be specified either as a selector string or a function. + * If a function, it is evaluated for each selected element, in order, being passed the current datum (d), + * the current index (i), and the current group (nodes), with this as the current DOM element. + * The new transition has the same id, name and timing as this transition; + * however, if a transition with the same id already exists on a selected element, the existing transition is returned for that element. + * This method is equivalent to deriving the selection for this transition via transition.selection, + * creating a subselection via selection.selectChild, and then creating a new transition via selection.transition. + */ + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + selectChild( + selector?: string | ValueFn, + ): Transition; + + /** + * For each selected element, selects all children that match the specified selector string, if any, and returns a transition on the resulting selection. + * The selector may be specified either as a selector string or a function. + * If a function, it is evaluated for each selected element, in order, being passed the current datum (d), + * the current index (i), and the current group (nodes), with this as the current DOM element. + * The new transition has the same id, name and timing as this transition; + * however, if a transition with the same id already exists on a selected element, the existing transition is returned for that element. + * This method is equivalent to deriving the selection for this transition via transition.selection, + * creating a subselection via selection.selectChildren, and then creating a new transition via selection.transition. + */ + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + selectChildren( + selector?: string | ValueFn, + ): Transition; + + /** + * Return the selection corresponding to this transition. + */ + selection(): Selection; + + /** + * Returns a new transition on the same selected elements as this transition, scheduled to start when this transition ends. + * The new transition inherits a reference time equal to this transition’s time plus its delay and duration. + * The new transition also inherits this transition’s name, duration, and easing. + * This method can be used to schedule a sequence of chained transitions. + * + * A delay configured for the new transition will be relative to the previous transition. + */ + transition(): Transition; + + // Modifying ------------------------------- + + /** + * For each selected element, assigns the attribute tween for the attribute with the specified name to the specified target value. + * The starting value of the tween is the attribute’s value when the transition starts. + * If the target value is null, the attribute is removed when the transition starts. + */ + attr(name: string, value: null | string | number | boolean): this; + /** + * For each selected element, assigns the attribute tween for the attribute with the specified name to the specified target value. + * The starting value of the tween is the attribute’s value when the transition starts. + * The target value is return value of the value function evaluated for the selected element. + * + * An interpolator is chosen based on the type of the target value, using the following algorithm: + * 1.) If value is a number, use interpolateNumber. + * 2.) If value is a color or a string coercible to a color, use interpolateRgb. + * 3.) Use interpolateString. + * + * To apply a different interpolator, use transition.attrTween. + * + * @param name Name of the attribute. + * @param value A value function which is evaluated for each selected element, in order, being passed the current datum (d), + * the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). + * A null value will clear the attribute at the start of the transition. + */ + attr(name: string, value: ValueFn): this; + + /** + * Return the current interpolator factory for attribute with the specified name, or undefined if no such tween exists. + * + * @param name Name of attribute. + */ + attrTween(name: string): ValueFn string> | undefined; + /** + * Remove the previously-assigned attribute tween of the specified name, if any. + * + * @param name Name of attribute. + * @param factory Use null to remove previously-assigned attribute tween. + */ + attrTween(name: string, factory: null): this; + /** + * Assign the attribute tween for the attribute with the specified name to the specified interpolator factory. + * An interpolator factory is a function that returns an interpolator; when the transition starts, the factory is evaluated for each selected element. + * The returned interpolator will then be invoked for each frame of the transition, in order, + * being passed the eased time t, typically in the range [0, 1]. Lastly, the return value of the interpolator will be used to set the attribute value. + * The interpolator must return a string. + * + * @param name Name of attribute. + * @param factory An interpolator factory which is evaluated for each selected element, in order, being passed the current datum (d), + * the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). The interpolator factory returns a string interpolator, + * which takes as its argument eased time t, typically in the range [0, 1] and returns the interpolated string. + */ + attrTween(name: string, factory: ValueFn string>): this; + + /** + * For each selected element, the style with the specified name will be cleared at the start of the transition. + * + * @param name Name of the style. + * @param value Use null to clear the style. + */ + style(name: string, value: null): this; + /** + * For each selected element, assigns the style tween for the style with the specified name to the specified target value with the + * specified priority. + * The starting value of the tween is the style’s inline value if present, and otherwise its computed value. + * The target value is the specified constant value for all elements. + * + * An interpolator is chosen based on the type of the target value, using the following algorithm: + * 1.) If value is a number, use interpolateNumber. + * 2.) If value is a color or a string coercible to a color, use interpolateRgb. + * 3.) Use interpolateString. + * + * To apply a different interpolator, use transition.attrTween. + * + * @param name Name of the style. + * @param value Target value for the style. + * @param priority An optional priority flag, either null or the string important (without the exclamation point) + */ + style(name: string, value: string | number | boolean, priority?: null | "important"): this; + /** + * For each selected element, assigns the style tween for the style with the specified name to the specified target value with the + * specified priority. + * The starting value of the tween is the style's inline value if present, and otherwise its computed value. + * The target value is return value of the value function evaluated for the selected element. + * + * An interpolator is chosen based on the type of the target value, using the following algorithm: + * 1.) If value is a number, use interpolateNumber. + * 2.) If value is a color or a string coercible to a color, use interpolateRgb. + * 3.) Use interpolateString. + * + * To apply a different interpolator, use transition.attrTween. + * + * @param name Name of the style. + * @param value A value function which is evaluated for each selected element, in order, being passed the current datum (d), + * the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). + * A null value will clear the style at the start of the transition. + * @param priority An optional priority flag, either null or the string important (without the exclamation point) + */ + style( + name: string, + value: ValueFn, + priority?: null | "important", + ): this; + + /** + * Return the current interpolator factory for style with the specified name, or undefined if no such tween exists. + * + * @param name Name of style. + */ + styleTween(name: string): ValueFn string> | undefined; + /** + * Remove the previously-assigned style tween of the specified name, if any. + * + * @param name Name of style. + * @param factory Use null to remove previously-assigned style tween. + */ + styleTween(name: string, factory: null): this; + /** + * Assign the style tween for the style with the specified name to the specified interpolator factory. + * An interpolator factory is a function that returns an interpolator; when the transition starts, the factory is evaluated for each selected element. + * The returned interpolator will then be invoked for each frame of the transition, in order, + * being passed the eased time t, typically in the range [0, 1]. Lastly, the return value of the interpolator will be used to set the style value. + * The interpolator must return a string. + * + * @param name Name of style. + * @param factory An interpolator factory which is evaluated for each selected element, in order, being passed the current datum (d), + * the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). The interpolator factory returns a string interpolator, + * which takes as its argument eased time t, typically in the range [0, 1] and returns the interpolated string. + * @param priority An optional priority flag, either null or the string important (without the exclamation point) + */ + styleTween( + name: string, + factory: ValueFn string>, + priority?: null | "important", + ): this; + + /** + * For each selected element, sets the text content to the specified target value when the transition starts. + * A null value will clear the content. + */ + text(value: null | string | number | boolean): this; + /** + * For each selected element, sets the text content returned by the value function for each selected element when the transition starts. + * + * To interpolate text rather than to set it on start, use transition.textTween (for example) or append a replacement element and cross-fade opacity (for example). + * Text is not interpolated by default because it is usually undesirable. + * + * @param value A value function which is evaluated for each selected element, in order, being passed the current datum (d), + * the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). + * A null value will clear the text content at the start of the transition. + */ + text(value: ValueFn): this; + + /** + * Returns the current interpolator factory for text, or undefined if no such tween exists. + */ + textTween(): ValueFn string> | undefined; + /** + * Removes the previously-assigned text tween, if any + * + * @param factory Use null to remove previously-assigned text tween. + */ + textTween(factory: null): this; + /** + * Assigns the text tween to the specified interpolator factory. + * An interpolator factory is a function that returns an interpolator; when the transition starts, the factory is evaluated for each selected element, + * in order, being passed the current datum d and index i, with the this context as the current DOM element. + * The returned interpolator will then be invoked for each frame of the transition, in order, being passed the eased time t, typically in the range [0, 1]. + * Lastly, the return value of the interpolator will be used to set the text. + * The interpolator must return a string. + * + * @param factory An interpolator factory is a function that returns an interpolator; when the transition starts, the factory is evaluated for each selected element, + * in order, being passed the current datum d and index i, with the this context as the current DOM element. + * The returned interpolator will then be invoked for each frame of the transition, in order, being passed the eased time t, typically in the range [0, 1]. + * Lastly, the return value of the interpolator will be used to set the text. + * The interpolator must return a string. + */ + textTween(factory: ValueFn string>): this; + + /** + * For each selected element, removes the element when the transition ends, as long as the element has no other active or pending transitions. + * If the element has other active or pending transitions, does nothing. + */ + remove(): this; + + /** + * Returns the tween with the specified name, or undefined, if no tween was previously assigned to + * that name. + * + * @param name Name of tween. + */ + tween(name: string): ValueFn void> | undefined; + /** + * Removes the tween with the specified name, if a tween was previously assigned to + * that name. + * + * @param name Name of tween. + * @param tweenFn Use null to remove a previously-assigned tween. + */ + tween(name: string, tweenFn: null): this; + /** + * For each selected element, assigns the tween with the specified name with the specified value function. + * The value must be specified as a function that returns a function. + * When the transition starts, the value function is evaluated for each selected element. + * The returned function is then invoked for each frame of the transition, in order, + * being passed the eased time t, typically in the range [0, 1]. + * + * @param name Name of tween. + * @param tweenFn A tween function which is evaluated for each selected element, in order, being passed the current datum (d), + * the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). The tween function returns a function + * which takes as its argument eased time t, typically in the range [0, 1] and performs the tweening activities for each transition frame. + */ + tween(name: string, tweenFn: ValueFn void>): this; + + /** + * Returns a new transition merging this transition with the specified other transition, + * which must have the same id as this transition. The returned transition has the same number of groups, + * the same parents, the same name and the same id as this transition. + * Any missing (null) elements in this transition are filled with the corresponding element, if present (not null), from the other transition. + * + * @param other The transition to be merged. + */ + merge(other: Transition): Transition; + + /** + * For each selected element, selects only the elements that match the specified filter, and returns a transition on the resulting selection. + * + * The new transition has the same id, name and timing as this transition; however, if a transition with the same id already exists on a selected element, + * the existing transition is returned for that element. + * + * @param filter A CSS selector string. + */ + filter(filter: string): Transition; + /** + * For each selected element, selects only the elements that match the specified filter, and returns a transition on the resulting selection. + * + * The new transition has the same id, name and timing as this transition; however, if a transition with the same id already exists on a selected element, + * the existing transition is returned for that element. + * + * The generic refers to the type of element which will be selected after applying the filter, i.e. if the element types + * contained in a pre-filter selection are narrowed to a subset as part of the filtering. + * + * @param filter A CSS selector string. + */ + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + filter(filter: string): Transition; + /** + * For each selected element, selects only the elements that match the specified filter, and returns a transition on the resulting selection. + * + * The new transition has the same id, name and timing as this transition; however, if a transition with the same id already exists on a selected element, + * the existing transition is returned for that element. + * + * @param filter A filter function which is evaluated for each selected element, in order, being passed the current datum (d), + * the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). The filter function returns a boolean indicating, + * whether the selected element matches. + */ + filter(filter: ValueFn): Transition; + /** + * For each selected element, selects only the elements that match the specified filter, and returns a transition on the resulting selection. + * + * The new transition has the same id, name and timing as this transition; however, if a transition with the same id already exists on a selected element, + * the existing transition is returned for that element. + * + * The generic refers to the type of element which will be selected after applying the filter, i.e. if the element types + * contained in a pre-filter selection are narrowed to a subset as part of the filtering. + * + * @param filter A filter function which is evaluated for each selected element, in order, being passed the current datum (d), + * the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). The filter function returns a boolean indicating, + * whether the selected element matches. + */ + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + filter( + filter: ValueFn, + ): Transition; + + // Event Handling ------------------- + + /** + * Return the currently-assigned listener for the specified event typename on the first (non-null) selected element, if any. + * If multiple typenames are specified, the first matching listener is returned. + * + * @param typenames The typenames is one of the following string event types: start (when the transition starts), end (when the transition ends), + * interrupt (when the transition is interrupted), cancel(when the transition is cancelled). + * Note that these are not native DOM events. The type may be optionally followed by a period (.) and a name; + * the optional name allows multiple callbacks to be registered to receive events of the same type, such as "start.foo"" and "start.bar". + * To specify multiple typenames, separate typenames with spaces, such as "interrupt end"" or "start.foo start.bar". + */ + on(typenames: string): ValueFn | undefined; + /** + * Remove all listeners for a given name. + * + * @param typenames Name of the event type for which the listener should be removed. To remove all listeners for a given name use ".foo" + * as the typename, where foo is the name; to remove all listeners with no name, specify "." as the typename. + * @param listener Use null to remove listeners. + */ + on(typenames: string, listener: null): this; + /** + * Add a listener to each selected element for the specified event typenames. + * + * When a specified transition event is dispatched on a selected node, the specified listener will be invoked for each transitioning element. + * Listeners always see the latest datum for their element, but the index is a property of the selection and is fixed when the listener is assigned; + * to update the index, re-assign the listener. + * + * @param typenames The typenames is one of the following string event types: start (when the transition starts), end (when the transition ends), + * interrupt (when the transition is interrupted), cancel(when the transition is cancelled). + * Note that these are not native DOM events. The type may be optionally followed by a period (.) and a name; + * the optional name allows multiple callbacks to be registered to receive events of the same type, such as "start.foo"" and "start.bar". + * To specify multiple typenames, separate typenames with spaces, such as "interrupt end"" or "start.foo start.bar". + * @param listener A listener function which will be evaluated for each selected element, being passed the current datum (d), the current index (i), + * and the current group (nodes), with this as the current DOM element (nodes[i]). Listeners always see the latest datum for their element, + * but the index is a property of the selection and is fixed when the listener is assigned; to update the index, re-assign the listener. + */ + on(typenames: string, listener: ValueFn): this; + + /** + * Returns a promise that resolves when every selected element finishes transitioning. If any element’s transition is cancelled or interrupted, the promise rejects. + */ + end(): Promise; + + // Control Flow ---------------------- + + /** + * Invoke the specified function for each selected element, passing the current datum (d), + * the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). + * This method can be used to invoke arbitrary code for each selected element, and is useful for creating a context to access parent and child data simultaneously. + * + * @param func A function which is invoked for each selected element, + * being passed the current datum (d), the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). + */ + each(func: ValueFn): this; + + /** + * Invoke the specified function exactly once, passing in this transition along with any optional arguments. + * Returns this transition. + * + * @param func A function which is passed this transition as the first argument along with any optional arguments. + * @param args List of optional arguments to be passed to the callback function. + */ + call( + func: (transition: Transition, ...args: any[]) => any, + ...args: any[] + ): this; + + /** + * Return true if this transition contains no (non-null) elements. + */ + empty(): boolean; + + /** + * Return the first (non-null) element in this transition. If the transition is empty, returns null. + */ + node(): GElement | null; + + /** + * Return an array of all (non-null) elements in this transition. + */ + nodes(): GElement[]; + + /** + * Returns the total number of elements in this transition. + */ + size(): number; + + // Transition Configuration ---------------------- + + /** + * Returns the current value of the delay for the first (non-null) element in the transition. + * This is generally useful only if you know that the transition contains exactly one element. + */ + delay(): number; + /** + * For each selected element, sets the transition delay to the specified value in milliseconds. + * If a delay is not specified, it defaults to zero. + * + * @param milliseconds Number of milliseconds for the delay. + */ + delay(milliseconds: number): this; + /** + * For each selected element, sets the transition delay to the value in milliseconds returned by the + * value function. + * + * @param milliseconds A value function which is evaluated for each selected element, being passed the current datum (d), + * the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). The return value is a number + * specifying the delay in milliseconds. + */ + delay(milliseconds: ValueFn): this; + + /** + * Returns the current value of the duration for the first (non-null) element in the transition. + * This is generally useful only if you know that the transition contains exactly one element. + */ + duration(): number; + /** + * For each selected element, sets the transition duration to the specified value in milliseconds. + * If a duration is not specified, it defaults to 250ms. + * + * @param duration Number of milliseconds for the duration. + */ + duration(milliseconds: number): this; + /** + * For each selected element, sets the transition duration to the value in milliseconds returned by the + * value function. + * + * @param milliseconds A value function which is evaluated for each selected element, being passed the current datum (d), + * the current index (i), and the current group (nodes), with this as the current DOM element (nodes[i]). The return value is a number + * specifying the duration in milliseconds. + */ + duration(milliseconds: ValueFn): this; + + /** + * Returns the current easing function for the first (non-null) element in the transition. + * This is generally useful only if you know that the transition contains exactly one element. + */ + ease(): (normalizedTime: number) => number; + /** + * Specifies the transition easing function for all selected elements. The value must be specified as a function. + * The easing function is invoked for each frame of the animation, being passed the normalized time t in the range [0, 1]; + * it must then return the eased time tʹ which is typically also in the range [0, 1]. + * A good easing function should return 0 if t = 0 and 1 if t = 1. If an easing function is not specified, + * it defaults to d3.easeCubic. + * + * @param easingFn An easing function which is passed the normalized time t in the range [0, 1]; + * it must then return the eased time tʹ which is typically also in the range [0, 1]. + * A good easing function should return 0 if t = 0 and 1 if t = 1. + */ + ease(easingFn: (normalizedTime: number) => number): this; + + /** + * Specifies a factory for the transition easing function. + * + * @param factory The factory must be a function. + * It is invoked for each node of the selection, being passed the current datum (d), the current index (i), and the current group (nodes), with this as the current DOM element. + * It must return an easing function. + */ + easeVarying(factory: ValueFn number>): this; +} + +/** + * Represents the union of the Selection and Transition types for any usages that operate on both. + * Typically used for functions which take in either a selection or transition and set or update attributes. + */ +export type SelectionOrTransition = + | Selection + | Transition; + +/** + * Returns a new transition with the specified name. If a name is not specified, null is used. + * The new transition is only exclusive with other transitions of the same name. + * + * The generic "OldDatum" refers to the type of a previously-set datum of the selected element in the Transition. + * + * @param name Name of the transition. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function transition(name?: string): Transition; + +/** + * Returns a new transition from an existing transition. + * + * When using a transition instance, the returned transition has the same id and name as the specified transition. + * + * The generic "OldDatum" refers to the type of a previously-set datum of the selected element in the Transition. + * + * @param transition A transition instance. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function transition( + transition: Transition, +): Transition; diff --git a/node_modules/@types/d3-transition/package.json b/node_modules/@types/d3-transition/package.json new file mode 100644 index 0000000..564ad4a --- /dev/null +++ b/node_modules/@types/d3-transition/package.json @@ -0,0 +1,47 @@ +{ + "name": "@types/d3-transition", + "version": "3.0.9", + "description": "TypeScript definitions for d3-transition", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-transition", + "license": "MIT", + "contributors": [ + { + "name": "Tom Wanzek", + "githubUsername": "tomwanzek", + "url": "https://github.com/tomwanzek" + }, + { + "name": "Alex Ford", + "githubUsername": "gustavderdrache", + "url": "https://github.com/gustavderdrache" + }, + { + "name": "Boris Yankov", + "githubUsername": "borisyankov", + "url": "https://github.com/borisyankov" + }, + { + "name": "Robert Moura", + "githubUsername": "robertmoura", + "url": "https://github.com/robertmoura" + }, + { + "name": "Nathan Bierema", + "githubUsername": "Methuselah96", + "url": "https://github.com/Methuselah96" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/d3-transition" + }, + "scripts": {}, + "dependencies": { + "@types/d3-selection": "*" + }, + "typesPublisherContentHash": "69cd5510811e76132548e17770c16a10a8ffe039c97e6d45b3663749af4591dd", + "typeScriptVersion": "4.8" +} \ No newline at end of file diff --git a/node_modules/@types/d3-zoom/LICENSE b/node_modules/@types/d3-zoom/LICENSE new file mode 100644 index 0000000..9e841e7 --- /dev/null +++ b/node_modules/@types/d3-zoom/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/node_modules/@types/d3-zoom/README.md b/node_modules/@types/d3-zoom/README.md new file mode 100644 index 0000000..dfec451 --- /dev/null +++ b/node_modules/@types/d3-zoom/README.md @@ -0,0 +1,15 @@ +# Installation +> `npm install --save @types/d3-zoom` + +# Summary +This package contains type definitions for d3-zoom (https://github.com/d3/d3-zoom/). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-zoom. + +### Additional Details + * Last updated: Tue, 07 Nov 2023 15:11:37 GMT + * Dependencies: [@types/d3-interpolate](https://npmjs.com/package/@types/d3-interpolate), [@types/d3-selection](https://npmjs.com/package/@types/d3-selection) + +# Credits +These definitions were written by [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), [denisname](https://github.com/denisname), and [Nathan Bierema](https://github.com/Methuselah96). diff --git a/node_modules/@types/d3-zoom/index.d.ts b/node_modules/@types/d3-zoom/index.d.ts new file mode 100644 index 0000000..36c0838 --- /dev/null +++ b/node_modules/@types/d3-zoom/index.d.ts @@ -0,0 +1,611 @@ +// Last module patch version validated against: 3.0.0 + +import { ZoomView } from "d3-interpolate"; +import { Selection, TransitionLike, ValueFn } from "d3-selection"; + +// -------------------------------------------------------------------------- +// Shared Type Definitions and Interfaces +// -------------------------------------------------------------------------- + +/** + * ZoomedElementBaseType serves as an alias for the 'minimal' data type which can be selected + * without 'd3-zoom' (and related code in 'd3-selection') trying to use properties internally which would otherwise not + * be supported. + */ +export type ZoomedElementBaseType = Element; + +/** + * Minimal interface for a continuous scale. + * This interface is used as a minimum contract for scale objects + * that can be passed into zoomTransform methods rescaleX and rescaleY + */ +export interface ZoomScale { + domain(): number[] | Date[]; + domain(domain: Array): this; + range(): number[]; + range(range: number[]): this; + copy(): ZoomScale; + invert(value: number): number | Date; +} + +// -------------------------------------------------------------------------- +// Zoom Behavior +// -------------------------------------------------------------------------- + +/** + * A D3 Zoom Behavior + * + * The first generic refers to the type of reference element to which the zoom behavior is attached. + * The second generic refers to the type of the datum of the reference element. + */ +export interface ZoomBehavior extends Function { + /** + * Applies this zoom behavior to the specified selection, binding the necessary event listeners to + * allow panning and zooming, and initializing the zoom transform on each selected element to the identity transform if not already defined. This function is typically not invoked directly, + * and is instead invoked via selection.call. + * + * For details see: {@link https://github.com/d3/d3-zoom#_zoom} + * + * @param selection A D3 selection of elements. + * @param args Optional arguments to be passed in. + */ + (selection: Selection, ...args: any[]): void; + /** + * If selection is a selection, sets the current zoom transform of the selected elements to the specified transform, instantaneously emitting start, zoom and end events. + * If selection is a transition, defines a “zoom” tween to the specified transform using d3.interpolateZoom, emitting a start event when the transition starts, + * zoom events for each tick of the transition, and then an end event when the transition ends (or is interrupted). + * The transition will attempt to minimize the visual movement around the specified point; if the point is not specified, it defaults to the center of the viewport extent. + * + * This function is typically not invoked directly, and is instead invoked via selection.call or transition.call. + * + * @param selection A selection or a transition. + * @param transform A zoom transform or a function that returns a zoom transform. + * If a function, it is invoked for each selected element, being passed the current event (event) and datum d, with the this context as the current DOM element. + * @param point A two-element array [x, y] or a function that returns such an array. + * If a function, it is invoked for each selected element, being passed the current event (event) and datum d, with the this context as the current DOM element. + */ + transform( + selection: Selection | TransitionLike, + transform: ZoomTransform | ((this: ZoomRefElement, event: any, d: Datum) => ZoomTransform), + point?: [number, number] | ((this: ZoomRefElement, event: any, d: Datum) => [number, number]), + ): void; + + /** + * If selection is a selection, translates the current zoom transform of the selected elements by x and y, such that the new tx1 = tx0 + kx and ty1 = ty0 + ky. + * If selection is a transition, defines a “zoom” tween translating the current transform. + * This method is a convenience method for zoom.transform. + * + * @param selection A selection or a transition. + * @param x A number or a function that returns a number. + * If a function, it is invoked for each selected element, being passed the current datum d and index i, with the this context as the current DOM element. + * @param y A number or a function that returns a number. + * If a function, it is invoked for each selected element, being passed the current datum d and index i, with the this context as the current DOM element. + */ + translateBy( + selection: Selection | TransitionLike, + x: number | ValueFn, + y: number | ValueFn, + ): void; + + /** + * If selection is a selection, translates the current zoom transform of the selected elements such that the given position ⟨x,y⟩ appears at given point p. + * The new tx = px - kx and ty = py - ky. If p is not specified, it defaults to the center of the viewport extent. + * If selection is a transition, defines a “zoom” tween translating the current transform. This method is a convenience method for zoom.transform. + * + * Translates the current zoom transform of the selected elements such that the specified position ⟨x,y⟩ appears at the center of the viewport extent. + * The new tx = cx - kx and ty = cy - ky, where ⟨cx,cy⟩ is the center. + * + * x is provided as a constant for all elements. + * y is provided as a constant for all elements. + * + * @param selection A selection or a transition. + * @param x A number or a function that returns a number. + * If a function, it is invoked for each selected element, being passed the current datum d and index i, with the this context as the current DOM element. + * @param y A number or a function that returns a number. + * If a function, it is invoked for each selected element, being passed the current datum d and index i, with the this context as the current DOM element. + * @param p A two-element array [px,py] or a function + * If a function, it is invoked for each selected element, being passed the current datum d and index i, with the this context as the current DOM element. + */ + translateTo( + selection: Selection | TransitionLike, + x: number | ValueFn, + y: number | ValueFn, + p?: [number, number] | ValueFn, + ): void; + + /** + * If selection is a selection, scales the current zoom transform of the selected elements by k, such that the new k₁ = k₀k. + * The reference point p does move. + * If p is not specified, it defaults to the center of the viewport extent. + * If selection is a transition, defines a “zoom” tween translating the current transform. + * This method is a convenience method for zoom.transform. + * + * @param selection A selection or a transition. + * @param k Scale factor. A number or a function that returns a number. + * If a function, it is invoked for each selected element, being passed the current datum d and index i, with the this context as the current DOM element. + * @param p A two-element array [px,py] or a function. + * If a function, it is invoked for each selected element, being passed the current datum d and index i, with the this context as the current DOM element. + */ + scaleBy( + selection: Selection | TransitionLike, + k: number | ValueFn, + p?: [number, number] | ValueFn, + ): void; + + /** + * If selection is a selection, scales the current zoom transform of the selected elements to k, such that the new k₁ = k. + * The reference point p does move. + * If p is not specified, it defaults to the center of the viewport extent. + * If selection is a transition, defines a “zoom” tween translating the current transform. + * This method is a convenience method for zoom.transform. + * + * @param selection: A selection or a transition. + * @param k Scale factor. A number or a function that returns a number. + * If a function, it is invoked for each selected element, being passed the current datum d and index i, with the this context as the current DOM element. + * @param p A two-element array [px,py] or a function. + * If a function, it is invoked for each selected element, being passed the current datum d and index i, with the this context as the current DOM element. + */ + scaleTo( + selection: Selection | TransitionLike, + k: number | ValueFn, + p?: [number, number], + ): void; + + /** + * Returns the current constraint function. + * The default implementation attempts to ensure that the viewport extent does not go outside the translate extent. + */ + constrain(): ( + transform: ZoomTransform, + extent: [[number, number], [number, number]], + translateExtent: [[number, number], [number, number]], + ) => ZoomTransform; + /** + * Sets the transform constraint function to the specified function and returns the zoom behavior. + * + * @param constraint A constraint function which returns a transform given the current transform, viewport extent and translate extent. + * The default implementation attempts to ensure that the viewport extent does not go outside the translate extent. + */ + constrain( + constraint: ( + transform: ZoomTransform, + extent: [[number, number], [number, number]], + translateExtent: [[number, number], [number, number]], + ) => ZoomTransform, + ): this; + + /** + * Returns the current filter function. + */ + filter(): (this: ZoomRefElement, event: any, datum: Datum) => boolean; + /** + * Sets the filter to the specified filter function and returns the zoom behavior. + * The filter function is invoked in the zoom initiating event handlers of each element to which the zoom behavior was applied. + * + * If the filter returns falsey, the initiating event is ignored and no zoom gesture is started. + * Thus, the filter determines which input events are ignored. The default filter ignores mousedown events on secondary buttons, + * since those buttons are typically intended for other purposes, such as the context menu. + * + * @param filter A filter function which is invoked in the zoom initiating event handlers of each element to which the zoom behavior was applied, + * in order, being passed the current event (event) and datum d, with the this context as the current DOM element. + * The function returns a boolean value. + */ + filter(filter: (this: ZoomRefElement, event: any, datum: Datum) => boolean): this; + + /** + * Returns the current touch support detector, which defaults to a function returning true, + * if the "ontouchstart" event is supported on the current element. + */ + touchable(): ValueFn; + /** + * Sets the touch support detector to the specified boolean value and returns the zoom behavior. + * + * Touch event listeners are only registered if the detector returns truthy for the corresponding element when the zoom behavior is applied. + * The default detector works well for most browsers that are capable of touch input, but not all; Chrome’s mobile device emulator, for example, + * fails detection. + * + * @param touchable A boolean value. true when touch event listeners should be applied to the corresponding element, otherwise false. + */ + touchable(touchable: boolean): this; + /** + * Sets the touch support detector to the specified function and returns the zoom behavior. + * + * Touch event listeners are only registered if the detector returns truthy for the corresponding element when the zoom behavior is applied. + * The default detector works well for most browsers that are capable of touch input, but not all; Chrome’s mobile device emulator, for example, + * fails detection. + * + * @param touchable A touch support detector function, which returns true when touch event listeners should be applied to the corresponding element. + * The function is evaluated for each selected element to which the zoom behavior was applied, in order, being passed the current datum (d), + * the current index (i), and the current group (nodes), with this as the current DOM element. The function returns a boolean value. + */ + touchable(touchable: ValueFn): this; + + /** + * Returns the current wheelDelta function. + */ + wheelDelta(): ValueFn; + /** + * Sets the wheel delta function to the specified function and returns the zoom behavior. The wheel delta function which is invoked in the wheel event handler + * of each element to which the zoom behavior was applied. + * The value Δ returned by the wheel delta function determines the amount of scaling applied in response to a WheelEvent. + * The scale factor transform.k is multiplied by 2Δ; for example, a Δ of +1 doubles the scale factor, Δ of -1 halves the scale factor. + * + * @param delta Wheel delta function which is invoked in the wheel event handler of each element to which the zoom behavior was applied, + * in order, being passed the wheel event that triggered the handler, + * with this as the current DOM element. The function returns a numeric value. + */ + wheelDelta(delta: ((event: WheelEvent) => number) | number): this; + + /** + * Return the current extent accessor, which defaults to [[0, 0], [width, height]] where width is the client width of the element and height is its client height; + * for SVG elements, the nearest ancestor SVG element’s width and height is used. In this case, + * the owner SVG element must have defined width and height attributes rather than (for example) relying on CSS properties or the viewBox attribute; + * SVG provides no programmatic method for retrieving the initial viewport size. Alternatively, consider using element.getBoundingClientRect. + * (In Firefox, element.clientWidth and element.clientHeight is zero for SVG elements!) + */ + extent(): (this: ZoomRefElement, datum: Datum) => [[number, number], [number, number]]; + /** + * Set the viewport extent to the specified array of points [[x0, y0], [x1, y1]], + * where [x0, y0] is the top-left corner of the viewport and [x1, y1] is the bottom-right corner of the viewport, + * and return this zoom behavior. + * + * The viewport extent affects several functions: the center of the viewport remains fixed during changes by zoom.scaleBy and zoom.scaleTo; + * the viewport center and dimensions affect the path chosen by d3.interpolateZoom; and the viewport extent is needed to enforce the optional translate extent. + * + * @param extent An extent specified as an array of two coordinates. + */ + extent(extent: [[number, number], [number, number]]): this; + /** + * Set the viewport extent to the array of points [[x0, y0], [x1, y1]] returned by the + * extent accessor function, and return this zoom behavior. + * The extent accessor function is evaluated for each element. + * + * [x0, y0] is the top-left corner of the viewport and [x1, y1] is the bottom-right corner of the viewport. + * + * The viewport extent affects several functions: the center of the viewport remains fixed during changes by zoom.scaleBy and zoom.scaleTo; + * the viewport center and dimensions affect the path chosen by d3.interpolateZoom; and the viewport extent is needed to enforce the optional translate extent. + * + * The default is [[0, 0], [width, height]] where width is the client width of the element and height is its client height; + * for SVG elements, the nearest ancestor SVG element’s width and height is used. + * In this case, the owner SVG element must have defined width and height attributes rather than (for example) relying on CSS properties or the viewBox attribute; + * SVG provides no programmatic method for retrieving the initial viewport size. Alternatively, consider using element.getBoundingClientRect. + * (In Firefox, element.clientWidth and element.clientHeight is zero for SVG elements!) + * + * @param extent An extent accessor function which is evaluated for each selected element, being passed the current datum d, with the this context as the current DOM element. + * The function returns the extent array. + */ + extent(extent: (this: ZoomRefElement, datum: Datum) => [[number, number], [number, number]]): this; + + /** + * Return the current scale extent. + */ + scaleExtent(): [number, number]; + /** + * Set the scale extent to the specified array of numbers [k0, k1] where k0 is the minimum allowed scale factor and k1 is the maximum allowed scale factor, + * and return this zoom behavior. + * + * The scale extent restricts zooming in and out. It is enforced on interaction and when using zoom.scaleBy, zoom.scaleTo and zoom.translateBy; + * however, it is not enforced when using zoom.transform to set the transform explicitly. + * + * The default scale extent is [0, infinity]. + * + * If the user tries to zoom by wheeling when already at the corresponding limit of the scale extent, the wheel events will be ignored and not initiate a zoom gesture. + * This allows the user to scroll down past a zoomable area after zooming in, or to scroll up after zooming out. + * If you would prefer to always prevent scrolling on wheel input regardless of the scale extent, register a wheel event listener to prevent the browser default behavior + * + * @param extent A scale extent array of two numbers representing the scale boundaries. + */ + scaleExtent(extent: [number, number]): this; + + /** + * Return the current translate extent. + */ + translateExtent(): [[number, number], [number, number]]; + /** + * Set the translate extent to the specified array of points [[x0, y0], [x1, y1]], where [x0, y0] is the top-left corner of the world and [x1, y1] + * is the bottom-right corner of the world, and return this zoom behavior. + * + * The translate extent restricts panning, and may cause translation on zoom out. It is enforced on interaction and when using zoom.scaleBy, zoom.scaleTo and zoom.translateBy; + * however, it is not enforced when using zoom.transform to set the transform explicitly. + * + * The default scale extent is [[-infinity, infinity], [-infinity, infinity]]. + * + * @param extent A translate extent array, i.e. an array of two arrays, each representing a point. + */ + translateExtent(extent: [[number, number], [number, number]]): this; + + /** + * Return the current click distance threshold, which defaults to zero. + */ + clickDistance(): number; + /** + * Set the maximum distance that the mouse can move between mousedown and mouseup that will trigger + * a subsequent click event. If at any point between mousedown and mouseup the mouse is greater than or equal to + * distance from its position on mousedown, the click event following mouseup will be suppressed. + * + * @param distance The distance threshold between mousedown and mouseup measured in client coordinates (event.clientX and event.clientY). + * The default is zero. + */ + clickDistance(distance: number): this; + + /** + * Return the current tap distance threshold, which defaults to 10. + */ + tapDistance(): number; + /** + * Sets the maximum distance that a double-tap gesture can move between first touchstart and second touchend that will trigger a subsequent double-click event. + * + * @param distance The distance threshold between mousedown and mouseup measured in client coordinates (event.clientX and event.clientY). + * The default is 10. + */ + tapDistance(distance: number): this; + + /** + * Get the duration for zoom transitions on double-click and double-tap in milliseconds. + */ + duration(): number; + /** + * Set the duration for zoom transitions on double-click and double-tap to the specified number of milliseconds and returns the zoom behavior. + * + * To disable double-click and double-tap transitions, you can remove the zoom behavior’s dblclick event listener after applying the zoom behavior to the selection. + * + * @param duration in milliseconds. + */ + duration(duration: number): this; + + /** + * Returns the current interpolation factory, which defaults to d3.interpolateZoom to implement smooth zooming. + */ + interpolate< + // eslint-disable-next-line @definitelytyped/no-unnecessary-generics + InterpolationFactory extends (a: ZoomView, b: ZoomView) => (t: number) => ZoomView, + >(): InterpolationFactory; + + /** + * Sets the interpolation factory for zoom transitions to the specified function. + * Use the default d3.interpolateZoom to implement smooth zooming. + * To apply direct interpolation between two views, try d3.interpolate instead. + * + * Each view is defined as an array of three numbers: cx, cy and width. The first two coordinates cx, cy represent the center of the viewport; + * the last coordinate width represents the size of the viewport. + * + * @param interpolatorFactory An interpolator factory to be used to generate interpolators between zooms for transitions. + */ + interpolate(interpolatorFactory: (a: ZoomView, b: ZoomView) => (t: number) => ZoomView): this; + + /** + * Return the first currently-assigned listener matching the specified typenames, if any. + * + * @param typenames The typenames is a string containing one or more typename separated by whitespace. + * Each typename is a type, optionally followed by a period (.) and a name, such as "drag.foo"" and "drag.bar"; + * the name allows multiple listeners to be registered for the same type. The type must be one of the following: + * start (after zooming begins [such as mousedown]), zoom (after a change to the zoom transform [such as mousemove], or + * end (after an active pointer becomes inactive [such as on mouseup].) + */ + on(typenames: string): ((this: ZoomRefElement, event: any, d: Datum) => void) | undefined; + /** + * Remove the current event listeners for the specified typenames, if any, return the drag behavior. + * + * @param typenames The typenames is a string containing one or more typename separated by whitespace. + * Each typename is a type, optionally followed by a period (.) and a name, such as "drag.foo"" and "drag.bar"; + * the name allows multiple listeners to be registered for the same type. The type must be one of the following: + * start (after zooming begins [such as mousedown]), zoom (after a change to the zoom transform [such as mousemove], or + * end (after an active pointer becomes inactive [such as on mouseup].) + * @param listener Use null to remove the listener. + */ + on(typenames: string, listener: null): this; + /** + * Set the event listener for the specified typenames and return the zoom behavior. + * If an event listener was already registered for the same type and name, + * the existing listener is removed before the new listener is added. + * When a specified event is dispatched, each listener will be invoked with the same context and arguments as selection.on listeners. + * + * @param typenames The typenames is a string containing one or more typename separated by whitespace. + * Each typename is a type, optionally followed by a period (.) and a name, such as "drag.foo"" and "drag.bar"; + * the name allows multiple listeners to be registered for the same type. The type must be one of the following: + * start (after zooming begins [such as mousedown]), zoom (after a change to the zoom transform [such as mousemove], or + * end (after an active pointer becomes inactive [such as on mouseup].) + * @param listener An event listener function which is evaluated for each selected element, + * in order, being passed the current event (event) and datum d, with the this context as the current DOM element. + */ + on(typenames: string, listener: (this: ZoomRefElement, event: any, d: Datum) => void): this; +} + +/** + * Creates a new zoom behavior. The returned behavior, zoom, is both an object and a function, + * and is typically applied to selected elements via selection.call. + * + * The first generic refers to the type of reference element to which the zoom behavior is attached. + * The second generic refers to the type of the datum of the reference element. + */ +// eslint-disable-next-line @definitelytyped/no-unnecessary-generics +export function zoom(): ZoomBehavior; + +// -------------------------------------------------------------------------- +// Zoom Event +// -------------------------------------------------------------------------- + +/** + * A D3 Zoom Event + * + * The first generic refers to the type of reference element to which the zoom behavior is attached. + * The second generic refers to the type of the datum of the reference element. + */ +export interface D3ZoomEvent { + /** + * The ZoomBehavior associated with the event + */ + target: ZoomBehavior; + /** + * The event type for the zoom event + */ + type: "start" | "zoom" | "end" | string; // Leave failsafe string type for cases like 'zoom.foo' + /** + * The current zoom transform + */ + transform: ZoomTransform; + /** + * The underlying input event, such as mousemove or touchmove. + */ + sourceEvent: any; +} + +// -------------------------------------------------------------------------- +// Zoom Transforms +// -------------------------------------------------------------------------- + +/** + * A zoom transform + * + * The zoom behavior stores the zoom state on the element to which the zoom behavior was applied, not on the zoom behavior itself. + * This is because the zoom behavior can be applied to many elements simultaneously, and each element can be zoomed independently. + * The zoom state can change either on user interaction or programmatically via zoom.transform. + * + * To retrieve the zoom state, use event.transform on the current zoom event within a zoom event listener (see zoom.on), or use d3.zoomTransform for a given node. + * The latter is particularly useful for modifying the zoom state programmatically, + * say to implement buttons for zooming in and out. + * + * For details see {@link https://github.com/d3/d3-zoom#zoom-transforms} + */ +export class ZoomTransform { + /** + * Returns a transform with scale k and translation (x, y). + */ + constructor(k: number, x: number, y: number); + + /** + * The translation amount tx along the x-axis. + * This property should be considered read-only; instead of mutating a transform, + * use transform.scale and transform.translate to derive a new transform. + * Also see zoom.scaleBy, zoom.scaleTo and zoom.translateBy for convenience methods on the zoom behavior. + */ + readonly x: number; + + /** + * The translation amount ty along the y-axis + * This property should be considered read-only; instead of mutating a transform, + * use transform.scale and transform.translate to derive a new transform. + * Also see zoom.scaleBy, zoom.scaleTo and zoom.translateBy for convenience methods on the zoom behavior. + */ + readonly y: number; + + /** + * The scale factor k. + * This property should be considered read-only; instead of mutating a transform, + * use transform.scale and transform.translate to derive a new transform. + * Also see zoom.scaleBy, zoom.scaleTo and zoom.translateBy for convenience methods on the zoom behavior. + */ + readonly k: number; + + /** + * Return the transformation of the specified point which is a two-element array of numbers [x, y]. + * The returned point is equal to [xk + tx, yk + ty]. + * + * @param point Point coordinates [x, y] + */ + apply(point: [number, number]): [number, number]; + + /** + * Return the transformation of the specified x-coordinate, xk + tx. + * + * @param x Value of x-coordinate. + */ + applyX(x: number): number; + + /** + * Return the transformation of the specified y-coordinate, yk + ty. + * + * @param y Value of y-coordinate. + */ + applyY(y: number): number; + + /** + * Return the inverse transformation of the specified point which is a two-element array of numbers [x, y]. + * The returned point is equal to [(x - tx) / k, (y - ty) / k]. + * + * @param point Point coordinates [x, y] + */ + invert(point: [number, number]): [number, number]; + + /** + * Return the inverse transformation of the specified x-coordinate, (x - tx) / k. + * + * @param x Value of x-coordinate. + */ + invertX(x: number): number; + + /** + * Return the inverse transformation of the specified y-coordinate, (y - ty) / k. + * + * @param y Value of y-coordinate. + */ + invertY(y: number): number; + + /** + * Returns a copy of the continuous scale x whose domain is transformed. + * This is implemented by first applying the inverse x-transform on the scale’s range, + * and then applying the inverse scale to compute the corresponding domain + * + * The scale x must use d3.interpolateNumber; do not use continuous.rangeRound as this + * reduces the accuracy of continuous.invert and can lead to an inaccurate rescaled domain. + * This method does not modify the input scale x; x thus represents the untransformed scale, + * while the returned scale represents its transformed view. + * + * @param xScale A continuous scale for x-dimension. + */ + rescaleX(xScale: S): S; + + /** + * Returns a copy of the continuous scale y whose domain is transformed. + * This is implemented by first applying the inverse y-transform on the scale’s range, + * and then applying the inverse scale to compute the corresponding domain + * + * The scale y must use d3.interpolateNumber; do not use continuous.rangeRound as this + * reduces the accuracy of continuous.invert and can lead to an inaccurate rescaled domain. + * This method does not modify the input scale x; x thus represents the untransformed scale, + * while the returned scale represents its transformed view. + * + * @param yScale A continuous scale for y-dimension. + */ + rescaleY(yScale: S): S; + + /** + * Return a transform whose scale k1 is equal to k0 × k, where k0 is this transform’s scale. + * + * @param k A scale factor. + */ + scale(k: number): ZoomTransform; + + /** + * Return a string representing the SVG transform corresponding to this transform. + */ + toString(): string; + + /** + * Returns a transform whose translation tx1 and ty1 is equal to tx0 + tkx and ty0 + tky, + * where tx0 and ty0 is this transform’s translation and tk is this transform’s scale. + * + * @param x Amount of translation in x-direction. + * @param y Amount of translation in y-direction. + */ + translate(x: number, y: number): ZoomTransform; +} + +/** + * Returns the current transform for the specified node. Note that node should typically be a DOM element, and not a selection. + * (A selection may consist of multiple nodes, in different states, and this function only returns a single transform.) If you have a selection, call selection.node first. + * In the context of an event listener, the node is typically the element that received the input event (which should be equal to event.transform), "this". + * Internally, an element’s transform is stored as element.__zoom; however, you should use this method rather than accessing it directly. + * If the given node has no defined transform, returns the identity transformation. + * The returned transform represents a two-dimensional transformation matrix + * + * For details see {@link https://github.com/d3/d3-zoom#zoom-transforms} + * + * @param node An element for which to retrieve its current zoom transform. + */ +export function zoomTransform(node: ZoomedElementBaseType): ZoomTransform; + +/** + * The identity transform, where k = 1, tx = ty = 0. + */ +export const zoomIdentity: ZoomTransform; diff --git a/node_modules/@types/d3-zoom/package.json b/node_modules/@types/d3-zoom/package.json new file mode 100644 index 0000000..3209916 --- /dev/null +++ b/node_modules/@types/d3-zoom/package.json @@ -0,0 +1,48 @@ +{ + "name": "@types/d3-zoom", + "version": "3.0.8", + "description": "TypeScript definitions for d3-zoom", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-zoom", + "license": "MIT", + "contributors": [ + { + "name": "Tom Wanzek", + "githubUsername": "tomwanzek", + "url": "https://github.com/tomwanzek" + }, + { + "name": "Alex Ford", + "githubUsername": "gustavderdrache", + "url": "https://github.com/gustavderdrache" + }, + { + "name": "Boris Yankov", + "githubUsername": "borisyankov", + "url": "https://github.com/borisyankov" + }, + { + "name": "denisname", + "githubUsername": "denisname", + "url": "https://github.com/denisname" + }, + { + "name": "Nathan Bierema", + "githubUsername": "Methuselah96", + "url": "https://github.com/Methuselah96" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/d3-zoom" + }, + "scripts": {}, + "dependencies": { + "@types/d3-interpolate": "*", + "@types/d3-selection": "*" + }, + "typesPublisherContentHash": "19cbff2a5c60ea95d9eaa6d3d1a4ec6f8e60ec8a8560cf1bd2e359f057335776", + "typeScriptVersion": "4.5" +} \ No newline at end of file diff --git a/node_modules/@xyflow/react/LICENSE b/node_modules/@xyflow/react/LICENSE new file mode 100644 index 0000000..8540abf --- /dev/null +++ b/node_modules/@xyflow/react/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019-2024 webkid GmbH + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@xyflow/react/README.md b/node_modules/@xyflow/react/README.md new file mode 100644 index 0000000..360c368 --- /dev/null +++ b/node_modules/@xyflow/react/README.md @@ -0,0 +1,135 @@ +![readme-header](https://user-images.githubusercontent.com/2857535/279691008-efd8f0d2-d235-4f19-b136-6e81e5ba974d.svg#gh-light-mode-only) +![readme-header-dark](https://user-images.githubusercontent.com/2857535/279691021-f1cbf9e6-ea4d-43e8-935d-dd4c4983c0d9.svg#gh-dark-mode-only) + +
+ +![GitHub License MIT](https://img.shields.io/github/license/wbkd/react-flow?color=%23ff0072) +![npm downloads](https://img.shields.io/npm/dt/reactflow?color=%23FF0072&label=downloads) +![GitHub Repo stars](https://img.shields.io/github/stars/wbkd/react-flow?color=%23FF0072) +![GitHub release (latest by date)](https://img.shields.io/github/v/release/wbkd/react-flow?color=%23FF0072) + +A highly customizable React component for building interactive graphs and node-based editors. + +[🚀 Getting Started](https://reactflow.dev/learn) | [📖 Documentation](https://reactflow.dev/api-reference/react-flow) | [📺 Examples](https://reactflow.dev/examples/overview) | [☎️ Discord](https://discord.gg/RVmnytFmGW) | [💎 React Flow Pro](https://pro.reactflow.dev) + +
+ +--- + +## Key Features + +- **Easy to use:** Seamless zooming and panning, single- and multi selection of graph elements and keyboard shortcuts are supported out of the box +- **Customizable:** Different [node](https://reactflow.dev/examples) and [edge types](https://reactflow.dev/examples/edges/edge-types) and support for custom nodes with multiple handles and custom edges +- **Fast rendering:** Only nodes that have changed are re-rendered +- **Hooks and Utils:** [Hooks](https://reactflow.dev/api-reference/hooks) for handling nodes, edges and the viewport and graph [helper functions](https://reactflow.dev/api-reference/utils) +- **Plugin Components:** [Background](https://reactflow.dev/api-reference/components/background), [MiniMap](https://reactflow.dev/api-reference/components/minimap) and [Controls](https://reactflow.dev/api-reference/components/controls) +- **Reliable**: Written in [Typescript](https://www.typescriptlang.org/) and tested with [cypress](https://www.cypress.io/) + +## Commercial Usage + +**Are you using React Flow for a personal project?** Great! No sponsorship needed, you can support us by reporting any bugs you find, sending us screenshots of your projects, and starring us on Github 🌟 + +**Are you using React Flow at your organization and making money from it?** Awesome! We rely on your support to keep React Flow developed and maintained under an MIT License, just how we like it. You can do that on the [React Flow Pro website](https://pro.reactflow.dev) or through [Github Sponsors](https://github.com/sponsors/wbkd). + +You can find more information in our [React Flow Pro FAQs](https://pro.reactflow.dev/info). + +## Installation + +The easiest way to get the latest version of React Flow is to install it via npm, yarn or pnpm: + +```bash +npm install @xyflow/react +``` + +## Quickstart + +This is only a very basic usage example of React Flow. To see everything that is possible with the library, please refer to the [website](https://reactflow.dev) for [guides](https://reactflow.dev/learn/customization/custom-nodes), [examples](https://reactflow.dev/examples/overview) and the full [API reference](https://reactflow.dev/api-reference/react-flow). + +```jsx +import { useCallback } from 'react'; +import { + ReactFlow, + MiniMap, + Controls, + Background, + useNodesState, + useEdgesState, + addEdge, +} from '@xyflow/react'; + +import '@xyflow/react/dist/style.css'; + +const initialNodes = [ + { id: '1', position: { x: 0, y: 0 }, data: { label: '1' } }, + { id: '2', position: { x: 0, y: 100 }, data: { label: '2' } }, +]; + +const initialEdges = [{ id: 'e1-2', source: '1', target: '2' }]; + +function Flow() { + const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes); + const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges); + + const onConnect = useCallback((params) => setEdges((eds) => addEdge(params, eds)), [setEdges]); + + return ( + + + + + + ); +} + +export default Flow; +``` + +## Development + +Before you can start developing please make sure that you have [pnpm](https://pnpm.io/) installed (`npm i -g pnpm`). Then install the dependencies using pnpm: `pnpm install`. + +Run `pnpm build` once and then you can use `pnpm dev` for local development. + +## Testing + +Testing is done with cypress. You can find the tests in the [`examples/vite-app/cypress`](/examples/vite-app/cypress/) folder. In order to run the tests do: + +```sh +pnpm test +``` + +## xyflow Team + +React Flow is maintained by the team behind [xyflow](https://xyflow.com). If you need help or want to talk to us about a collaboration, reach out through our [contact form](https://xyflow.com/contact) or by joining our [Discord Server](https://discord.gg/Bqt6xrs). + +- Christopher • [Twitter](https://twitter.com/chrtze) • [Github](https://github.com/chrtze) +- Hayleigh • [Twitter](https://twitter.com/hayleighdotdev) • [Github](https://github.com/hayleigh-dot-dev) +- John • [Website](https://johnrobbdesign.com/) • [Mastodon](https://mastodon.social/@johnrobbjr) +- Moritz • [Twitter](https://twitter.com/moklick) • [Github](https://github.com/moklick) +- Peter • [Github](https://github.com/peterkogo) + +Any support you provide goes directly towards the development and maintenance of React Flow and Svelte Flow, allowing us to continue to operate as an independent company, working on what we think is best for our open-source libraries. + +## Community Packages + +- [useUndoable](https://github.com/xplato/useUndoable) - Hook for undo/redo functionality with an explicit React Flow example +- [react-flow-smart-edge](https://github.com/tisoap/react-flow-smart-edge) - Custom edge that doesn't intersect with nodes +- [Feliz.ReactFlow](https://github.com/tforkmann/Feliz.ReactFlow) - Feliz React Bindings for React Flow + +## Credits + +React Flow was initially developed for [datablocks](https://datablocks.pro), a graph-based editor for transforming, analyzing and visualizing data in the browser. Under the hood, React Flow depends on these great libraries: + +- [d3-zoom](https://github.com/d3/d3-zoom) - used for zoom, pan and drag interactions with the graph canvas +- [d3-drag](https://github.com/d3/d3-drag) - used for making the nodes draggable +- [zustand](https://github.com/pmndrs/zustand) - internal state management + +## License + +React Flow is [MIT licensed](../../LICENSE). diff --git a/node_modules/@xyflow/react/dist/base.css b/node_modules/@xyflow/react/dist/base.css new file mode 100644 index 0000000..6cec274 --- /dev/null +++ b/node_modules/@xyflow/react/dist/base.css @@ -0,0 +1,494 @@ +/* this will be exported as base.css and can be used for a basic styling */ +/* these are the necessary styles for React/Svelte Flow, they get used by base.css and style.css */ +.react-flow { + direction: ltr; + + --xy-edge-stroke-default: #b1b1b7; + --xy-edge-stroke-width-default: 1; + --xy-edge-stroke-selected-default: #555; + + --xy-connectionline-stroke-default: #b1b1b7; + --xy-connectionline-stroke-width-default: 1; + + --xy-attribution-background-color-default: rgba(255, 255, 255, 0.5); + + --xy-minimap-background-color-default: #fff; + --xy-minimap-mask-background-color-default: rgba(240, 240, 240, 0.6); + --xy-minimap-mask-stroke-color-default: transparent; + --xy-minimap-mask-stroke-width-default: 1; + --xy-minimap-node-background-color-default: #e2e2e2; + --xy-minimap-node-stroke-color-default: transparent; + --xy-minimap-node-stroke-width-default: 2; + + --xy-background-color-default: transparent; + --xy-background-pattern-dots-color-default: #91919a; + --xy-background-pattern-lines-color-default: #eee; + --xy-background-pattern-cross-color-default: #e2e2e2; + background-color: var(--xy-background-color, var(--xy-background-color-default)); + --xy-node-border-default: 1px solid #bbb; + --xy-node-border-selected-default: 1px solid #555; + + --xy-handle-background-color-default: #333; + + --xy-selection-background-color-default: rgba(150, 150, 180, 0.1); + --xy-selection-border-default: 1px dotted rgba(155, 155, 155, 0.8); + --xy-resize-background-color-default: #3367d9; +} +.react-flow.dark { + --xy-edge-stroke-default: #3e3e3e; + --xy-edge-stroke-width-default: 1; + --xy-edge-stroke-selected-default: #727272; + + --xy-connectionline-stroke-default: #b1b1b7; + --xy-connectionline-stroke-width-default: 1; + + --xy-attribution-background-color-default: rgba(150, 150, 150, 0.25); + + --xy-minimap-background-color-default: #141414; + --xy-minimap-mask-background-color-default: rgba(60, 60, 60, 0.6); + --xy-minimap-mask-stroke-color-default: transparent; + --xy-minimap-mask-stroke-width-default: 1; + --xy-minimap-node-background-color-default: #2b2b2b; + --xy-minimap-node-stroke-color-default: transparent; + --xy-minimap-node-stroke-width-default: 2; + + --xy-background-color-default: #141414; + --xy-background-pattern-dots-color-default: #777; + --xy-background-pattern-lines-color-default: #777; + --xy-background-pattern-cross-color-default: #777; + --xy-node-color-default: #f8f8f8; +} +.react-flow__background { + background-color: var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default))); + pointer-events: none; + z-index: -1; +} +.react-flow__container { + position: absolute; + width: 100%; + height: 100%; + top: 0; + left: 0; +} +.react-flow__pane { + z-index: 1; +} +.react-flow__pane.draggable { + cursor: grab; + } +.react-flow__pane.dragging { + cursor: grabbing; + } +.react-flow__pane.selection { + cursor: pointer; + } +.react-flow__viewport { + transform-origin: 0 0; + z-index: 2; + pointer-events: none; +} +.react-flow__renderer { + z-index: 4; +} +.react-flow__selection { + z-index: 6; +} +.react-flow__nodesselection-rect:focus, +.react-flow__nodesselection-rect:focus-visible { + outline: none; +} +.react-flow__edge-path { + stroke: var(--xy-edge-stroke, var(--xy-edge-stroke-default)); + stroke-width: var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default)); + fill: none; +} +.react-flow__connection-path { + stroke: var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default)); + stroke-width: var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default)); + fill: none; +} +.react-flow .react-flow__edges { + position: absolute; +} +.react-flow .react-flow__edges svg { + overflow: visible; + position: absolute; + pointer-events: none; + } +.react-flow__edge { + pointer-events: visibleStroke; +} +.react-flow__edge.selectable { + cursor: pointer; + } +.react-flow__edge.animated path { + stroke-dasharray: 5; + animation: dashdraw 0.5s linear infinite; + } +.react-flow__edge.animated path.react-flow__edge-interaction { + stroke-dasharray: none; + animation: none; + } +.react-flow__edge.inactive { + pointer-events: none; + } +.react-flow__edge.selected, + .react-flow__edge:focus, + .react-flow__edge:focus-visible { + outline: none; + } +.react-flow__edge.selected .react-flow__edge-path, + .react-flow__edge.selectable:focus .react-flow__edge-path, + .react-flow__edge.selectable:focus-visible .react-flow__edge-path { + stroke: var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default)); + } +.react-flow__edge-textwrapper { + pointer-events: all; + } +.react-flow__edge .react-flow__edge-text { + pointer-events: none; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + } +.react-flow__connection { + pointer-events: none; +} +.react-flow__connection .animated { + stroke-dasharray: 5; + animation: dashdraw 0.5s linear infinite; + } +svg.react-flow__connectionline { + z-index: 1001; + overflow: visible; + position: absolute; +} +.react-flow__nodes { + pointer-events: none; + transform-origin: 0 0; +} +.react-flow__node { + position: absolute; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + pointer-events: all; + transform-origin: 0 0; + box-sizing: border-box; + cursor: default; +} +.react-flow__node.selectable { + cursor: pointer; + } +.react-flow__node.draggable { + cursor: grab; + pointer-events: all; + } +.react-flow__node.draggable.dragging { + cursor: grabbing; + } +.react-flow__nodesselection { + z-index: 3; + transform-origin: left top; + pointer-events: none; +} +.react-flow__nodesselection-rect { + position: absolute; + pointer-events: all; + cursor: grab; + } +.react-flow__handle { + position: absolute; + pointer-events: none; + min-width: 5px; + min-height: 5px; + background-color: var(--xy-handle-background-color, var(--xy-handle-background-color-default)); +} +.react-flow__handle.connectingfrom { + pointer-events: all; + } +.react-flow__handle.connectionindicator { + pointer-events: all; + cursor: crosshair; + } +.react-flow__handle-bottom { + top: auto; + left: 50%; + bottom: 0; + transform: translate(-50%, 50%); + } +.react-flow__handle-top { + top: 0; + left: 50%; + transform: translate(-50%, -50%); + } +.react-flow__handle-left { + top: 50%; + left: 0; + transform: translate(-50%, -50%); + } +.react-flow__handle-right { + top: 50%; + right: 0; + transform: translate(50%, -50%); + } +.react-flow__edgeupdater { + cursor: move; + pointer-events: all; +} +.react-flow__panel { + position: absolute; + z-index: 5; + margin: 15px; +} +.react-flow__panel.top { + top: 0; + } +.react-flow__panel.bottom { + bottom: 0; + } +.react-flow__panel.top.center, .react-flow__panel.bottom.center { + left: 50%; + transform: translateX(-15px) translateX(-50%); + } +.react-flow__panel.left { + left: 0; + } +.react-flow__panel.right { + right: 0; + } +.react-flow__panel.left.center, .react-flow__panel.right.center { + top: 50%; + transform: translateY(-15px) translateY(-50%); + } +.react-flow__attribution { + font-size: 10px; + background: var(--xy-attribution-background-color, var(--xy-attribution-background-color-default)); + padding: 2px 3px; + margin: 0; +} +.react-flow__attribution a { + text-decoration: none; + color: #999; + } +@keyframes dashdraw { + from { + stroke-dashoffset: 10; + } +} +.react-flow__edgelabel-renderer { + position: absolute; + width: 100%; + height: 100%; + pointer-events: none; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + left: 0; + top: 0; +} +.react-flow__viewport-portal { + position: absolute; + width: 100%; + height: 100%; + left: 0; + top: 0; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; +} +.react-flow__minimap { + background: var( + --xy-minimap-background-color-props, + var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) + ); +} +.react-flow__minimap-svg { + display: block; + } +.react-flow__minimap-mask { + fill: var( + --xy-minimap-mask-background-color-props, + var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) + ); + stroke: var( + --xy-minimap-mask-stroke-color-props, + var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) + ); + stroke-width: var( + --xy-minimap-mask-stroke-width-props, + var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) + ); + } +.react-flow__minimap-node { + fill: var( + --xy-minimap-node-background-color-props, + var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) + ); + stroke: var( + --xy-minimap-node-stroke-color-props, + var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) + ); + stroke-width: var( + --xy-minimap-node-stroke-width-props, + var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) + ); + } +.react-flow__background-pattern.dots { + fill: var( + --xy-background-pattern-color-props, + var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) + ); + } +.react-flow__background-pattern.lines { + stroke: var( + --xy-background-pattern-color-props, + var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) + ); + } +.react-flow__background-pattern.cross { + stroke: var( + --xy-background-pattern-color-props, + var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) + ); + } +.react-flow__controls { + display: flex; + flex-direction: column; +} +.react-flow__controls.horizontal { + flex-direction: row; + } +.react-flow__controls-button { + display: flex; + justify-content: center; + align-items: center; + height: 26px; + width: 26px; + padding: 4px; + } +.react-flow__controls-button svg { + width: 100%; + max-width: 12px; + max-height: 12px; + fill: currentColor; + } +.react-flow__node-input, +.react-flow__node-default, +.react-flow__node-output, +.react-flow__node-group { + border: var(--xy-node-border, var(--xy-node-border-default)); + color: var(--xy-node-color, var(--xy-node-color-default)); +} +.react-flow__node-input.selected, + .react-flow__node-input:focus, + .react-flow__node-input:focus-visible, + .react-flow__node-default.selected, + .react-flow__node-default:focus, + .react-flow__node-default:focus-visible, + .react-flow__node-output.selected, + .react-flow__node-output:focus, + .react-flow__node-output:focus-visible, + .react-flow__node-group.selected, + .react-flow__node-group:focus, + .react-flow__node-group:focus-visible { + outline: none; + border: var(--xy-node-border-selected, var(--xy-node-border-selected-default)); + } +.react-flow__nodesselection-rect, +.react-flow__selection { + background: var(--xy-selection-background-color, var(--xy-selection-background-color-default)); + border: var(--xy-selection-border, var(--xy-selection-border-default)); +} +.react-flow__resize-control { + position: absolute; +} +.react-flow__resize-control.left, +.react-flow__resize-control.right { + cursor: ew-resize; +} +.react-flow__resize-control.top, +.react-flow__resize-control.bottom { + cursor: ns-resize; +} +.react-flow__resize-control.top.left, +.react-flow__resize-control.bottom.right { + cursor: nwse-resize; +} +.react-flow__resize-control.bottom.left, +.react-flow__resize-control.top.right { + cursor: nesw-resize; +} +/* handle styles */ +.react-flow__resize-control.handle { + width: 5px; + height: 5px; + border: 1px solid #fff; + border-radius: 1px; + background-color: var(--xy-resize-background-color, var(--xy-resize-background-color-default)); + translate: -50% -50%; +} +.react-flow__resize-control.handle.left { + left: 0; + top: 50%; +} +.react-flow__resize-control.handle.right { + left: 100%; + top: 50%; +} +.react-flow__resize-control.handle.top { + left: 50%; + top: 0; +} +.react-flow__resize-control.handle.bottom { + left: 50%; + top: 100%; +} +.react-flow__resize-control.handle.top.left { + left: 0; +} +.react-flow__resize-control.handle.bottom.left { + left: 0; +} +.react-flow__resize-control.handle.top.right { + left: 100%; +} +.react-flow__resize-control.handle.bottom.right { + left: 100%; +} +/* line styles */ +.react-flow__resize-control.line { + border-color: var(--xy-resize-background-color, var(--xy-resize-background-color-default)); + border-width: 0; + border-style: solid; +} +.react-flow__resize-control.line.left, +.react-flow__resize-control.line.right { + width: 1px; + transform: translate(-50%, 0); + top: 0; + height: 100%; +} +.react-flow__resize-control.line.left { + left: 0; + border-left-width: 1px; +} +.react-flow__resize-control.line.right { + left: 100%; + border-right-width: 1px; +} +.react-flow__resize-control.line.top, +.react-flow__resize-control.line.bottom { + height: 1px; + transform: translate(0, -50%); + left: 0; + width: 100%; +} +.react-flow__resize-control.line.top { + top: 0; + border-top-width: 1px; +} +.react-flow__resize-control.line.bottom { + border-bottom-width: 1px; + top: 100%; +} diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/Background/Background.d.ts b/node_modules/@xyflow/react/dist/esm/additional-components/Background/Background.d.ts new file mode 100644 index 0000000..00c489a --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/Background/Background.d.ts @@ -0,0 +1,61 @@ +import { type BackgroundProps } from './types'; +declare function BackgroundComponent({ id, variant, gap, size, lineWidth, offset, color, bgColor, style, className, patternClassName, }: BackgroundProps): import("react/jsx-runtime").JSX.Element; +declare namespace BackgroundComponent { + var displayName: string; +} +/** + * The `` component makes it convenient to render different types of backgrounds common in node-based UIs. It comes with three variants: lines, dots and cross. + * + * @example + * + * A simple example of how to use the Background component. + * + * ```tsx + * import { useState } from 'react'; + * import { ReactFlow, Background, BackgroundVariant } from '@xyflow/react'; + * + * export default function Flow() { + * return ( + * + * + * + * ); + * } + * ``` + * + * @example + * + * In this example you can see how to combine multiple backgrounds + * + * ```tsx + * import { ReactFlow, Background, BackgroundVariant } from '@xyflow/react'; + * import '@xyflow/react/dist/style.css'; + * + * export default function Flow() { + * return ( + * + * + * + * + * ); + * } + * ``` + * + * @remarks + * + * When combining multiple components it’s important to give each of them a unique id prop! + * + */ +export declare const Background: import("react").MemoExoticComponent; +export {}; +//# sourceMappingURL=Background.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/Background/Background.d.ts.map b/node_modules/@xyflow/react/dist/esm/additional-components/Background/Background.d.ts.map new file mode 100644 index 0000000..18667ac --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/Background/Background.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Background.d.ts","sourceRoot":"","sources":["../../../src/additional-components/Background/Background.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,eAAe,EAAqB,MAAM,SAAS,CAAC;AAWlE,iBAAS,mBAAmB,CAAC,EAC3B,EAAE,EACF,OAAgC,EAEhC,GAAQ,EAER,IAAI,EACJ,SAAa,EACb,MAAU,EACV,KAAK,EACL,OAAO,EACP,KAAK,EACL,SAAS,EACT,gBAAgB,GACjB,EAAE,eAAe,2CAwDjB;kBAtEQ,mBAAmB;;;AA0E5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,eAAO,MAAM,UAAU,iEAA4B,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/Background/Patterns.d.ts b/node_modules/@xyflow/react/dist/esm/additional-components/Background/Patterns.d.ts new file mode 100644 index 0000000..df8ade2 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/Background/Patterns.d.ts @@ -0,0 +1,15 @@ +import { BackgroundVariant } from './types'; +type LinePatternProps = { + dimensions: [number, number]; + variant: BackgroundVariant; + lineWidth?: number; + className?: string; +}; +export declare function LinePattern({ dimensions, lineWidth, variant, className }: LinePatternProps): import("react/jsx-runtime").JSX.Element; +type DotPatternProps = { + radius: number; + className?: string; +}; +export declare function DotPattern({ radius, className }: DotPatternProps): import("react/jsx-runtime").JSX.Element; +export {}; +//# sourceMappingURL=Patterns.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/Background/Patterns.d.ts.map b/node_modules/@xyflow/react/dist/esm/additional-components/Background/Patterns.d.ts.map new file mode 100644 index 0000000..949a517 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/Background/Patterns.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Patterns.d.ts","sourceRoot":"","sources":["../../../src/additional-components/Background/Patterns.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,KAAK,gBAAgB,GAAG;IACtB,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,WAAW,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,gBAAgB,2CAQ1F;AAED,KAAK,eAAe,GAAG;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,eAAe,2CAIhE"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/Background/index.d.ts b/node_modules/@xyflow/react/dist/esm/additional-components/Background/index.d.ts new file mode 100644 index 0000000..1873c3a --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/Background/index.d.ts @@ -0,0 +1,3 @@ +export { Background } from './Background'; +export { BackgroundVariant, type BackgroundProps } from './types'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/Background/index.d.ts.map b/node_modules/@xyflow/react/dist/esm/additional-components/Background/index.d.ts.map new file mode 100644 index 0000000..be81c4b --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/Background/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/additional-components/Background/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/Background/types.d.ts b/node_modules/@xyflow/react/dist/esm/additional-components/Background/types.d.ts new file mode 100644 index 0000000..50b0708 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/Background/types.d.ts @@ -0,0 +1,59 @@ +import { CSSProperties } from 'react'; +/** + * The three variants are exported as an enum for convenience. You can either import + * the enum and use it like `BackgroundVariant.Lines` or you can use the raw string + * value directly. + * @public + */ +export declare enum BackgroundVariant { + Lines = "lines", + Dots = "dots", + Cross = "cross" +} +/** + * @expand + */ +export type BackgroundProps = { + /** When multiple backgrounds are present on the page, each one should have a unique id. */ + id?: string; + /** Color of the pattern. */ + color?: string; + /** Color of the background. */ + bgColor?: string; + /** Class applied to the container. */ + className?: string; + /** Class applied to the pattern. */ + patternClassName?: string; + /** + * The gap between patterns. Passing in a tuple allows you to control the x and y gap + * independently. + * @default 20 + */ + gap?: number | [number, number]; + /** + * The radius of each dot or the size of each rectangle if `BackgroundVariant.Dots` or + * `BackgroundVariant.Cross` is used. This defaults to 1 or 6 respectively, or ignored if + * `BackgroundVariant.Lines` is used. + */ + size?: number; + /** + * Offset of the pattern. + * @default 0 + */ + offset?: number | [number, number]; + /** + * The stroke thickness used when drawing the pattern. + * @default 1 + */ + lineWidth?: number; + /** + * Variant of the pattern. + * @default BackgroundVariant.Dots + * @example BackgroundVariant.Lines, BackgroundVariant.Dots, BackgroundVariant.Cross + * 'lines', 'dots', 'cross' + */ + variant?: BackgroundVariant; + /** Style applied to the container. */ + style?: CSSProperties; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/Background/types.d.ts.map b/node_modules/@xyflow/react/dist/esm/additional-components/Background/types.d.ts.map new file mode 100644 index 0000000..5f11f58 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/Background/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/additional-components/Background/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC;;;;;GAKG;AACH,oBAAY,iBAAiB;IAC3B,KAAK,UAAU;IACf,IAAI,SAAS;IACb,KAAK,UAAU;CAChB;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,2FAA2F;IAC3F,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,sCAAsC;IACtC,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/Controls/ControlButton.d.ts b/node_modules/@xyflow/react/dist/esm/additional-components/Controls/ControlButton.d.ts new file mode 100644 index 0000000..f16846c --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/Controls/ControlButton.d.ts @@ -0,0 +1,26 @@ +import type { ControlButtonProps } from './types'; +/** + * You can add buttons to the control panel by using the `` component + * and pass it as a child to the [``](/api-reference/components/controls) component. + * + * @public + * @example + *```jsx + *import { MagicWand } from '@radix-ui/react-icons' + *import { ReactFlow, Controls, ControlButton } from '@xyflow/react' + * + *export default function Flow() { + * return ( + * + * + * alert('Something magical just happened. ✨')}> + * + * + * + * + * ) + *} + *``` + */ +export declare function ControlButton({ children, className, ...rest }: ControlButtonProps): import("react/jsx-runtime").JSX.Element; +//# sourceMappingURL=ControlButton.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/Controls/ControlButton.d.ts.map b/node_modules/@xyflow/react/dist/esm/additional-components/Controls/ControlButton.d.ts.map new file mode 100644 index 0000000..ecba112 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/Controls/ControlButton.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ControlButton.d.ts","sourceRoot":"","sources":["../../../src/additional-components/Controls/ControlButton.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,kBAAkB,2CAMjF"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Controls.d.ts b/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Controls.d.ts new file mode 100644 index 0000000..d2029fd --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Controls.d.ts @@ -0,0 +1,29 @@ +import type { ControlProps } from './types'; +declare function ControlsComponent({ style, showZoom, showFitView, showInteractive, fitViewOptions, onZoomIn, onZoomOut, onFitView, onInteractiveChange, className, children, position, orientation, 'aria-label': ariaLabel, }: ControlProps): import("react/jsx-runtime").JSX.Element; +declare namespace ControlsComponent { + var displayName: string; +} +/** + * The `` component renders a small panel that contains convenient + * buttons to zoom in, zoom out, fit the view, and lock the viewport. + * + * @public + * @example + *```tsx + *import { ReactFlow, Controls } from '@xyflow/react' + * + *export default function Flow() { + * return ( + * + * + * + * ) + *} + *``` + * + * @remarks To extend or customise the controls, you can use the [``](/api-reference/components/control-button) component + * + */ +export declare const Controls: import("react").MemoExoticComponent; +export {}; +//# sourceMappingURL=Controls.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Controls.d.ts.map b/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Controls.d.ts.map new file mode 100644 index 0000000..2d540bc --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Controls.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Controls.d.ts","sourceRoot":"","sources":["../../../src/additional-components/Controls/Controls.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAS5C,iBAAS,iBAAiB,CAAC,EACzB,KAAK,EACL,QAAe,EACf,WAAkB,EAClB,eAAsB,EACtB,cAAc,EACd,QAAQ,EACR,SAAS,EACT,SAAS,EACT,mBAAmB,EACnB,SAAS,EACT,QAAQ,EACR,QAAwB,EACxB,WAAwB,EACxB,YAAY,EAAE,SAAS,GACxB,EAAE,YAAY,2CAoFd;kBAnGQ,iBAAiB;;;AAuG1B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,QAAQ,+DAA0B,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/FitView.d.ts b/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/FitView.d.ts new file mode 100644 index 0000000..0484017 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/FitView.d.ts @@ -0,0 +1,2 @@ +export declare function FitViewIcon(): import("react/jsx-runtime").JSX.Element; +//# sourceMappingURL=FitView.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/FitView.d.ts.map b/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/FitView.d.ts.map new file mode 100644 index 0000000..f25c00c --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/FitView.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"FitView.d.ts","sourceRoot":"","sources":["../../../../src/additional-components/Controls/Icons/FitView.tsx"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,4CAM1B"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Lock.d.ts b/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Lock.d.ts new file mode 100644 index 0000000..d0c9a1a --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Lock.d.ts @@ -0,0 +1,2 @@ +export declare function LockIcon(): import("react/jsx-runtime").JSX.Element; +//# sourceMappingURL=Lock.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Lock.d.ts.map b/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Lock.d.ts.map new file mode 100644 index 0000000..b9b9821 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Lock.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Lock.d.ts","sourceRoot":"","sources":["../../../../src/additional-components/Controls/Icons/Lock.tsx"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,4CAMvB"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Minus.d.ts b/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Minus.d.ts new file mode 100644 index 0000000..ee21712 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Minus.d.ts @@ -0,0 +1,2 @@ +export declare function MinusIcon(): import("react/jsx-runtime").JSX.Element; +//# sourceMappingURL=Minus.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Minus.d.ts.map b/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Minus.d.ts.map new file mode 100644 index 0000000..12c2986 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Minus.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Minus.d.ts","sourceRoot":"","sources":["../../../../src/additional-components/Controls/Icons/Minus.tsx"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,4CAMxB"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Plus.d.ts b/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Plus.d.ts new file mode 100644 index 0000000..74c6ecc --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Plus.d.ts @@ -0,0 +1,2 @@ +export declare function PlusIcon(): import("react/jsx-runtime").JSX.Element; +//# sourceMappingURL=Plus.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Plus.d.ts.map b/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Plus.d.ts.map new file mode 100644 index 0000000..66dd227 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Plus.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Plus.d.ts","sourceRoot":"","sources":["../../../../src/additional-components/Controls/Icons/Plus.tsx"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,4CAMvB"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Unlock.d.ts b/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Unlock.d.ts new file mode 100644 index 0000000..0411d05 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Unlock.d.ts @@ -0,0 +1,2 @@ +export declare function UnlockIcon(): import("react/jsx-runtime").JSX.Element; +//# sourceMappingURL=Unlock.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Unlock.d.ts.map b/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Unlock.d.ts.map new file mode 100644 index 0000000..cb8c165 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/Controls/Icons/Unlock.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Unlock.d.ts","sourceRoot":"","sources":["../../../../src/additional-components/Controls/Icons/Unlock.tsx"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,4CAMzB"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/Controls/index.d.ts b/node_modules/@xyflow/react/dist/esm/additional-components/Controls/index.d.ts new file mode 100644 index 0000000..4b86d58 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/Controls/index.d.ts @@ -0,0 +1,4 @@ +export { Controls } from './Controls'; +export { ControlButton } from './ControlButton'; +export type { ControlProps, ControlButtonProps } from './types'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/Controls/index.d.ts.map b/node_modules/@xyflow/react/dist/esm/additional-components/Controls/index.d.ts.map new file mode 100644 index 0000000..adf9ac3 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/Controls/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/additional-components/Controls/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/Controls/types.d.ts b/node_modules/@xyflow/react/dist/esm/additional-components/Controls/types.d.ts new file mode 100644 index 0000000..44591c0 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/Controls/types.d.ts @@ -0,0 +1,66 @@ +import type { ButtonHTMLAttributes, ReactNode } from 'react'; +import type { PanelPosition } from '@xyflow/system'; +import type { FitViewOptions } from '../../types'; +/** + * @expand + */ +export type ControlProps = { + /** + * Whether or not to show the zoom in and zoom out buttons. These buttons will adjust the viewport + * zoom by a fixed amount each press. + * @default true + */ + showZoom?: boolean; + /** + * Whether or not to show the fit view button. By default, this button will adjust the viewport so + * that all nodes are visible at once. + * @default true + */ + showFitView?: boolean; + /** + * Show button for toggling interactivity + * @default true + */ + showInteractive?: boolean; + /** + * Customise the options for the fit view button. These are the same options you would pass to the + * fitView function. + */ + fitViewOptions?: FitViewOptions; + /** Called in addition the default zoom behavior when the zoom in button is clicked. */ + onZoomIn?: () => void; + /** Called in addition the default zoom behavior when the zoom out button is clicked. */ + onZoomOut?: () => void; + /** + * Called when the fit view button is clicked. When this is not provided, the viewport will be + * adjusted so that all nodes are visible. + */ + onFitView?: () => void; + /** Called when the interactive (lock) button is clicked. */ + onInteractiveChange?: (interactiveStatus: boolean) => void; + /** + * Position of the controls on the pane + * @default PanelPosition.BottomLeft + * @example PanelPosition.TopLeft, PanelPosition.TopRight, + * PanelPosition.BottomLeft, PanelPosition.BottomRight + */ + position?: PanelPosition; + children?: ReactNode; + /** Style applied to container */ + style?: React.CSSProperties; + /** Class name applied to container */ + className?: string; + /** + * @default 'React Flow controls' + */ + 'aria-label'?: string; + /** + * @default 'vertical' + */ + orientation?: 'horizontal' | 'vertical'; +}; +/** + * @expand + */ +export type ControlButtonProps = ButtonHTMLAttributes; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/Controls/types.d.ts.map b/node_modules/@xyflow/react/dist/esm/additional-components/Controls/types.d.ts.map new file mode 100644 index 0000000..664b48f --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/Controls/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/additional-components/Controls/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,uFAAuF;IACvF,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,wFAAwF;IACxF,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,4DAA4D;IAC5D,mBAAmB,CAAC,EAAE,CAAC,iBAAiB,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3D;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,iCAAiC;IACjC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;CACzC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/MiniMap.d.ts b/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/MiniMap.d.ts new file mode 100644 index 0000000..1d1c2e6 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/MiniMap.d.ts @@ -0,0 +1,29 @@ +import type { Node } from '../../types'; +import type { MiniMapProps } from './types'; +declare function MiniMapComponent({ style, className, nodeStrokeColor, nodeColor, nodeClassName, nodeBorderRadius, nodeStrokeWidth, nodeComponent, bgColor, maskColor, maskStrokeColor, maskStrokeWidth, position, onClick, onNodeClick, pannable, zoomable, ariaLabel, inversePan, zoomStep, offsetScale, }: MiniMapProps): import("react/jsx-runtime").JSX.Element; +declare namespace MiniMapComponent { + var displayName: string; +} +/** + * The `` component can be used to render an overview of your flow. It + * renders each node as an SVG element and visualizes where the current viewport is + * in relation to the rest of the flow. + * + * @public + * @example + * + * ```jsx + *import { ReactFlow, MiniMap } from '@xyflow/react'; + * + *export default function Flow() { + * return ( + * + * + * + * ); + *} + *``` + */ +export declare const MiniMap: typeof MiniMapComponent; +export {}; +//# sourceMappingURL=MiniMap.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/MiniMap.d.ts.map b/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/MiniMap.d.ts.map new file mode 100644 index 0000000..18e06b0 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/MiniMap.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MiniMap.d.ts","sourceRoot":"","sources":["../../../src/additional-components/MiniMap/MiniMap.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAkB,IAAI,EAAE,MAAM,aAAa,CAAC;AAGxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AA+B5C,iBAAS,gBAAgB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,EACtD,KAAK,EACL,SAAS,EACT,eAAe,EACf,SAAS,EACT,aAAkB,EAClB,gBAAoB,EACpB,eAAe,EAKf,aAAa,EACb,OAAO,EACP,SAAS,EACT,eAAe,EACf,eAAe,EACf,QAAyB,EACzB,OAAO,EACP,WAAW,EACX,QAAgB,EAChB,QAAgB,EAChB,SAAS,EACT,UAAU,EACV,QAAa,EACb,WAAe,GAChB,EAAE,YAAY,CAAC,QAAQ,CAAC,2CAsHxB;kBAhJQ,gBAAgB;;;AAoJzB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,OAAO,EAA6B,OAAO,gBAAgB,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/MiniMapNode.d.ts b/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/MiniMapNode.d.ts new file mode 100644 index 0000000..54bddea --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/MiniMapNode.d.ts @@ -0,0 +1,5 @@ +import type { MiniMapNodeProps } from './types'; +declare function MiniMapNodeComponent({ id, x, y, width, height, style, color, strokeColor, strokeWidth, className, borderRadius, shapeRendering, selected, onClick, }: MiniMapNodeProps): import("react/jsx-runtime").JSX.Element; +export declare const MiniMapNode: import("react").MemoExoticComponent; +export {}; +//# sourceMappingURL=MiniMapNode.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/MiniMapNode.d.ts.map b/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/MiniMapNode.d.ts.map new file mode 100644 index 0000000..5e9d2ad --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/MiniMapNode.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MiniMapNode.d.ts","sourceRoot":"","sources":["../../../src/additional-components/MiniMap/MiniMapNode.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,iBAAS,oBAAoB,CAAC,EAC5B,EAAE,EACF,CAAC,EACD,CAAC,EACD,KAAK,EACL,MAAM,EACN,KAAK,EACL,KAAK,EACL,WAAW,EACX,WAAW,EACX,SAAS,EACT,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,OAAO,GACR,EAAE,gBAAgB,2CAsBlB;AAED,eAAO,MAAM,WAAW,kEAA6B,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/MiniMapNodes.d.ts b/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/MiniMapNodes.d.ts new file mode 100644 index 0000000..ca10305 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/MiniMapNodes.d.ts @@ -0,0 +1,6 @@ +import type { Node } from '../../types'; +import type { MiniMapNodes as MiniMapNodesProps } from './types'; +declare function MiniMapNodes({ nodeStrokeColor, nodeColor, nodeClassName, nodeBorderRadius, nodeStrokeWidth, nodeComponent: NodeComponent, onClick, }: MiniMapNodesProps): import("react/jsx-runtime").JSX.Element; +declare const _default: typeof MiniMapNodes; +export default _default; +//# sourceMappingURL=MiniMapNodes.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/MiniMapNodes.d.ts.map b/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/MiniMapNodes.d.ts.map new file mode 100644 index 0000000..a71f150 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/MiniMapNodes.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MiniMapNodes.d.ts","sourceRoot":"","sources":["../../../src/additional-components/MiniMap/MiniMapNodes.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAkB,IAAI,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,IAAI,iBAAiB,EAA6C,MAAM,SAAS,CAAC;AAQ5G,iBAAS,YAAY,CAAC,QAAQ,SAAS,IAAI,EAAE,EAC3C,eAAe,EACf,SAAS,EACT,aAAkB,EAClB,gBAAoB,EACpB,eAAe,EAKf,aAAa,EAAE,aAA2B,EAC1C,OAAO,GACR,EAAE,iBAAiB,CAAC,QAAQ,CAAC,2CAiC7B;wBAgEoC,OAAO,YAAY;AAAxD,wBAAyD"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/index.d.ts b/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/index.d.ts new file mode 100644 index 0000000..eeb5c18 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/index.d.ts @@ -0,0 +1,3 @@ +export { MiniMap } from './MiniMap'; +export * from './types'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/index.d.ts.map b/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/index.d.ts.map new file mode 100644 index 0000000..623c213 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/additional-components/MiniMap/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,cAAc,SAAS,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/types.d.ts b/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/types.d.ts new file mode 100644 index 0000000..4215867 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/types.d.ts @@ -0,0 +1,123 @@ +import type { ComponentType, CSSProperties, HTMLAttributes, MouseEvent } from 'react'; +import type { PanelPosition, XYPosition } from '@xyflow/system'; +import type { Node } from '../../types'; +export type GetMiniMapNodeAttribute = (node: NodeType) => string; +/** + * @expand + */ +export type MiniMapProps = Omit, 'onClick'> & { + /** + * Color of nodes on minimap. + * @default "#e2e2e2" + */ + nodeColor?: string | GetMiniMapNodeAttribute; + /** + * Stroke color of nodes on minimap. + * @default "transparent" + */ + nodeStrokeColor?: string | GetMiniMapNodeAttribute; + /** + * Class name applied to nodes on minimap. + * @default "" + */ + nodeClassName?: string | GetMiniMapNodeAttribute; + /** + * Border radius of nodes on minimap. + * @default 5 + */ + nodeBorderRadius?: number; + /** + * Stroke width of nodes on minimap. + * @default 2 + */ + nodeStrokeWidth?: number; + /** + * A custom component to render the nodes in the minimap. This component must render an SVG + * element! + */ + nodeComponent?: ComponentType; + /** Background color of minimap. */ + bgColor?: string; + /** + * The color of the mask that covers the portion of the minimap not currently visible in the + * viewport. + * @default "rgba(240, 240, 240, 0.6)" + */ + maskColor?: string; + /** + * Stroke color of mask representing viewport. + * @default transparent + */ + maskStrokeColor?: string; + /** + * Stroke width of mask representing viewport. + * @default 1 + */ + maskStrokeWidth?: number; + /** + * Position of minimap on pane. + * @default PanelPosition.BottomRight + * @example PanelPosition.TopLeft, PanelPosition.TopRight, + * PanelPosition.BottomLeft, PanelPosition.BottomRight + */ + position?: PanelPosition; + /** Callback called when minimap is clicked. */ + onClick?: (event: MouseEvent, position: XYPosition) => void; + /** Callback called when node on minimap is clicked. */ + onNodeClick?: (event: MouseEvent, node: NodeType) => void; + /** + * Determines whether you can pan the viewport by dragging inside the minimap. + * @default false + */ + pannable?: boolean; + /** + * Determines whether you can zoom the viewport by scrolling inside the minimap. + * @default false + */ + zoomable?: boolean; + /** + * There is no text inside the minimap for a screen reader to use as an accessible name, so it's + * important we provide one to make the minimap accessible. The default is sufficient, but you may + * want to replace it with something more relevant to your app or product. + * @default "Mini Map" + */ + ariaLabel?: string | null; + /** Invert direction when panning the minimap viewport. */ + inversePan?: boolean; + /** + * Step size for zooming in/out on minimap. + * @default 10 + */ + zoomStep?: number; + /** + * Offset the viewport on the minimap, acts like a padding. + * @default 5 + */ + offsetScale?: number; +}; +export type MiniMapNodes = Pick, 'nodeColor' | 'nodeStrokeColor' | 'nodeClassName' | 'nodeBorderRadius' | 'nodeStrokeWidth' | 'nodeComponent'> & { + onClick?: (event: MouseEvent, nodeId: string) => void; +}; +/** + * The props that are passed to the MiniMapNode component + * + * @public + * @expand + */ +export type MiniMapNodeProps = { + id: string; + x: number; + y: number; + width: number; + height: number; + borderRadius: number; + className: string; + color?: string; + shapeRendering: string; + strokeColor?: string; + strokeWidth?: number; + style?: CSSProperties; + selected: boolean; + onClick?: (event: MouseEvent, id: string) => void; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/types.d.ts.map b/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/types.d.ts.map new file mode 100644 index 0000000..50daa2b --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/MiniMap/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/additional-components/MiniMap/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACtF,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEhE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,MAAM,uBAAuB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,QAAQ,KAAK,MAAM,CAAC;AAE/F;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,EAAE,SAAS,CAAC,GAAG;IACxG;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,uBAAuB,CAAC,QAAQ,CAAC,CAAC;IACvD;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,uBAAuB,CAAC,QAAQ,CAAC,CAAC;IAC7D;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,uBAAuB,CAAC,QAAQ,CAAC,CAAC;IAC3D;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAChD,mCAAmC;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,KAAK,IAAI,CAAC;IAC5D,uDAAuD;IACvD,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC1D;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,0DAA0D;IAC1D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,YAAY,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,IAAI,CAC3D,YAAY,CAAC,QAAQ,CAAC,EACtB,WAAW,GAAG,iBAAiB,GAAG,eAAe,GAAG,kBAAkB,GAAG,iBAAiB,GAAG,eAAe,CAC7G,GAAG;IACF,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACvD,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACnD,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/NodeResizeControl.d.ts b/node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/NodeResizeControl.d.ts new file mode 100644 index 0000000..2c9a83b --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/NodeResizeControl.d.ts @@ -0,0 +1,11 @@ +import type { ResizeControlProps, ResizeControlLineProps } from './types'; +declare function ResizeControl({ nodeId, position, variant, className, style, children, color, minWidth, minHeight, maxWidth, maxHeight, keepAspectRatio, resizeDirection, autoScale, shouldResize, onResizeStart, onResize, onResizeEnd, }: ResizeControlProps): import("react/jsx-runtime").JSX.Element; +export declare function ResizeControlLine(props: ResizeControlLineProps): import("react/jsx-runtime").JSX.Element; +/** + * To create your own resizing UI, you can use the `NodeResizeControl` component where you can pass children (such as icons). + * @public + * + */ +export declare const NodeResizeControl: import("react").MemoExoticComponent; +export {}; +//# sourceMappingURL=NodeResizeControl.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/NodeResizeControl.d.ts.map b/node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/NodeResizeControl.d.ts.map new file mode 100644 index 0000000..75fd3a2 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/NodeResizeControl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"NodeResizeControl.d.ts","sourceRoot":"","sources":["../../../src/additional-components/NodeResizer/NodeResizeControl.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAW1E,iBAAS,aAAa,CAAC,EACrB,MAAM,EACN,QAAQ,EACR,OAAqC,EACrC,SAAS,EACT,KAAiB,EACjB,QAAQ,EACR,KAAK,EACL,QAAa,EACb,SAAc,EACd,QAA2B,EAC3B,SAA4B,EAC5B,eAAuB,EACvB,eAAe,EACf,SAAgB,EAChB,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,WAAW,GACZ,EAAE,kBAAkB,2CA4KpB;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,2CAE9D;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,2DAAsB,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/NodeResizer.d.ts b/node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/NodeResizer.d.ts new file mode 100644 index 0000000..bb00652 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/NodeResizer.d.ts @@ -0,0 +1,27 @@ +import type { NodeResizerProps } from './types'; +/** + * The `` component can be used to add a resize functionality to your + * nodes. It renders draggable controls around the node to resize in all directions. + * @public + * + * @example + *```jsx + *import { memo } from 'react'; + *import { Handle, Position, NodeResizer } from '@xyflow/react'; + * + *function ResizableNode({ data }) { + * return ( + * <> + * + * + *
{data.label}
+ * + * + * ); + *}; + * + *export default memo(ResizableNode); + *``` + */ +export declare function NodeResizer({ nodeId, isVisible, handleClassName, handleStyle, lineClassName, lineStyle, color, minWidth, minHeight, maxWidth, maxHeight, keepAspectRatio, autoScale, shouldResize, onResizeStart, onResize, onResizeEnd, }: NodeResizerProps): import("react/jsx-runtime").JSX.Element | null; +//# sourceMappingURL=NodeResizer.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/NodeResizer.d.ts.map b/node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/NodeResizer.d.ts.map new file mode 100644 index 0000000..22ce64e --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/NodeResizer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"NodeResizer.d.ts","sourceRoot":"","sources":["../../../src/additional-components/NodeResizer/NodeResizer.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,WAAW,CAAC,EAC1B,MAAM,EACN,SAAgB,EAChB,eAAe,EACf,WAAW,EACX,aAAa,EACb,SAAS,EACT,KAAK,EACL,QAAa,EACb,SAAc,EACd,QAA2B,EAC3B,SAA4B,EAC5B,eAAuB,EACvB,SAAgB,EAChB,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,WAAW,GACZ,EAAE,gBAAgB,kDAkDlB"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/index.d.ts b/node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/index.d.ts new file mode 100644 index 0000000..58c7e6a --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/index.d.ts @@ -0,0 +1,4 @@ +export { NodeResizer } from './NodeResizer'; +export { NodeResizeControl } from './NodeResizeControl'; +export * from './types'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/index.d.ts.map b/node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/index.d.ts.map new file mode 100644 index 0000000..8187fea --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/additional-components/NodeResizer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,cAAc,SAAS,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/types.d.ts b/node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/types.d.ts new file mode 100644 index 0000000..2e5d891 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/types.d.ts @@ -0,0 +1,97 @@ +import type { CSSProperties, ReactNode } from 'react'; +import type { ControlPosition, ControlLinePosition, ResizeControlVariant, ResizeControlDirection, ShouldResize, OnResizeStart, OnResize, OnResizeEnd } from '@xyflow/system'; +/** + * @expand + */ +export type NodeResizerProps = { + /** + * Id of the node it is resizing. + * @remarks optional if used inside custom node + */ + nodeId?: string; + /** Color of the resize handle. */ + color?: string; + /** Class name applied to handle. */ + handleClassName?: string; + /** Style applied to handle. */ + handleStyle?: CSSProperties; + /** Class name applied to line. */ + lineClassName?: string; + /** Style applied to line. */ + lineStyle?: CSSProperties; + /** + * Are the controls visible. + * @default true + */ + isVisible?: boolean; + /** + * Minimum width of node. + * @default 10 + */ + minWidth?: number; + /** + * Minimum height of node. + * @default 10 + */ + minHeight?: number; + /** + * Maximum width of node. + * @default Number.MAX_VALUE + */ + maxWidth?: number; + /** + * Maximum height of node. + * @default Number.MAX_VALUE + */ + maxHeight?: number; + /** + * Keep aspect ratio when resizing. + * @default false + */ + keepAspectRatio?: boolean; + /** + * Scale the controls with the zoom level. + * @default true + */ + autoScale?: boolean; + /** Callback to determine if node should resize. */ + shouldResize?: ShouldResize; + /** Callback called when resizing starts. */ + onResizeStart?: OnResizeStart; + /** Callback called when resizing. */ + onResize?: OnResize; + /** Callback called when resizing ends. */ + onResizeEnd?: OnResizeEnd; +}; +/** + * @expand + */ +export type ResizeControlProps = Pick & { + /** + * Position of the control. + * @example ControlPosition.TopLeft, ControlPosition.TopRight, + * ControlPosition.BottomLeft, ControlPosition.BottomRight + */ + position?: ControlPosition; + /** + * Variant of the control. + * @default "handle" + * @example ResizeControlVariant.Handle, ResizeControlVariant.Line + */ + variant?: ResizeControlVariant; + /** + * The direction the user can resize the node. + * If not provided, the user can resize in any direction. + */ + resizeDirection?: ResizeControlDirection; + className?: string; + style?: CSSProperties; + children?: ReactNode; +}; +/** + * @expand + */ +export type ResizeControlLineProps = Omit & { + position?: ControlLinePosition; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/types.d.ts.map b/node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/types.d.ts.map new file mode 100644 index 0000000..4fbe2cc --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/NodeResizer/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/additional-components/NodeResizer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACtB,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,WAAW,EACZ,MAAM,gBAAgB,CAAC;AAExB;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,+BAA+B;IAC/B,WAAW,CAAC,EAAE,aAAa,CAAC;IAC5B,kCAAkC;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mDAAmD;IACnD,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,4CAA4C;IAC5C,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,qCAAqC;IACrC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,0CAA0C;IAC1C,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,gBAAgB,EACd,QAAQ,GACR,OAAO,GACP,UAAU,GACV,WAAW,GACX,UAAU,GACV,WAAW,GACX,iBAAiB,GACjB,cAAc,GACd,WAAW,GACX,eAAe,GACf,UAAU,GACV,aAAa,CAChB,GAAG;IACF;;;;OAIG;IACH,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B;;;;OAIG;IACH,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B;;;OAGG;IACH,eAAe,CAAC,EAAE,sBAAsB,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,kBAAkB,EAAE,iBAAiB,CAAC,GAAG;IACjF,QAAQ,CAAC,EAAE,mBAAmB,CAAC;CAChC,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/NodeToolbar.d.ts b/node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/NodeToolbar.d.ts new file mode 100644 index 0000000..571b536 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/NodeToolbar.d.ts @@ -0,0 +1,38 @@ +import type { NodeToolbarProps } from './types'; +/** + * This component can render a toolbar or tooltip to one side of a custom node. This + * toolbar doesn't scale with the viewport so that the content is always visible. + * + * @public + * @example + * ```jsx + *import { memo } from 'react'; + *import { Handle, Position, NodeToolbar } from '@xyflow/react'; + * + *function CustomNode({ data }) { + * return ( + * <> + * + * + * + * + * + * + *
+ * {data.label} + *
+ * + * + * + * + * ); + *}; + * + *export default memo(CustomNode); + *``` + * @remarks By default, the toolbar is only visible when a node is selected. If multiple + * nodes are selected it will not be visible to prevent overlapping toolbars or + * clutter. You can override this behavior by setting the `isVisible` prop to `true`. + */ +export declare function NodeToolbar({ nodeId, children, className, style, isVisible, position, offset, align, ...rest }: NodeToolbarProps): import("react/jsx-runtime").JSX.Element | null; +//# sourceMappingURL=NodeToolbar.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/NodeToolbar.d.ts.map b/node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/NodeToolbar.d.ts.map new file mode 100644 index 0000000..960b0db --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/NodeToolbar.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"NodeToolbar.d.ts","sourceRoot":"","sources":["../../../src/additional-components/NodeToolbar/NodeToolbar.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AA+BhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,WAAW,CAAC,EAC1B,MAAM,EACN,QAAQ,EACR,SAAS,EACT,KAAK,EACL,SAAS,EACT,QAAuB,EACvB,MAAW,EACX,KAAgB,EAChB,GAAG,IAAI,EACR,EAAE,gBAAgB,kDAwDlB"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/NodeToolbarPortal.d.ts b/node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/NodeToolbarPortal.d.ts new file mode 100644 index 0000000..1036d76 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/NodeToolbarPortal.d.ts @@ -0,0 +1,5 @@ +import { ReactNode } from 'react'; +export declare function NodeToolbarPortal({ children }: { + children: ReactNode; +}): import("react").ReactPortal | null; +//# sourceMappingURL=NodeToolbarPortal.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/NodeToolbarPortal.d.ts.map b/node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/NodeToolbarPortal.d.ts.map new file mode 100644 index 0000000..ff908ea --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/NodeToolbarPortal.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"NodeToolbarPortal.d.ts","sourceRoot":"","sources":["../../../src/additional-components/NodeToolbar/NodeToolbarPortal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQlC,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,sCAQtE"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/index.d.ts b/node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/index.d.ts new file mode 100644 index 0000000..ae78d04 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/index.d.ts @@ -0,0 +1,3 @@ +export { NodeToolbar } from './NodeToolbar'; +export type { NodeToolbarProps } from './types'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/index.d.ts.map b/node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/index.d.ts.map new file mode 100644 index 0000000..300eba1 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/additional-components/NodeToolbar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/types.d.ts b/node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/types.d.ts new file mode 100644 index 0000000..0eedc02 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/types.d.ts @@ -0,0 +1,32 @@ +import type { HTMLAttributes } from 'react'; +import type { Position, Align } from '@xyflow/system'; +/** + * @expand + */ +export type NodeToolbarProps = HTMLAttributes & { + /** + * By passing in an array of node id's you can render a single tooltip for a group or collection + * of nodes. + */ + nodeId?: string | string[]; + /** If `true`, node toolbar is visible even if node is not selected. */ + isVisible?: boolean; + /** + * Position of the toolbar relative to the node. + * @default Position.Top + * @example Position.TopLeft, Position.TopRight, Position.BottomLeft, Position.BottomRight + */ + position?: Position; + /** + * The space between the node and the toolbar, measured in pixels. + * @default 10 + */ + offset?: number; + /** + * Align the toolbar relative to the node. + * @default "center" + * @example Align.Start, Align.Center, Align.End + */ + align?: Align; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/types.d.ts.map b/node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/types.d.ts.map new file mode 100644 index 0000000..6e8199f --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/NodeToolbar/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/additional-components/NodeToolbar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEtD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAC9D;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC3B,uEAAuE;IACvE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/index.d.ts b/node_modules/@xyflow/react/dist/esm/additional-components/index.d.ts new file mode 100644 index 0000000..4f53059 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/index.d.ts @@ -0,0 +1,6 @@ +export * from './Background'; +export * from './Controls'; +export * from './MiniMap'; +export * from './NodeResizer'; +export * from './NodeToolbar'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/additional-components/index.d.ts.map b/node_modules/@xyflow/react/dist/esm/additional-components/index.d.ts.map new file mode 100644 index 0000000..f16f262 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/additional-components/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/additional-components/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/A11yDescriptions/index.d.ts b/node_modules/@xyflow/react/dist/esm/components/A11yDescriptions/index.d.ts new file mode 100644 index 0000000..a8afaa3 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/A11yDescriptions/index.d.ts @@ -0,0 +1,8 @@ +export declare const ARIA_NODE_DESC_KEY = "react-flow__node-desc"; +export declare const ARIA_EDGE_DESC_KEY = "react-flow__edge-desc"; +export declare const ARIA_LIVE_MESSAGE = "react-flow__aria-live"; +export declare function A11yDescriptions({ rfId, disableKeyboardA11y }: { + rfId: string; + disableKeyboardA11y: boolean; +}): import("react/jsx-runtime").JSX.Element; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/A11yDescriptions/index.d.ts.map b/node_modules/@xyflow/react/dist/esm/components/A11yDescriptions/index.d.ts.map new file mode 100644 index 0000000..02a814c --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/A11yDescriptions/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/A11yDescriptions/index.tsx"],"names":[],"mappings":"AAkBA,eAAO,MAAM,kBAAkB,0BAA0B,CAAC;AAC1D,eAAO,MAAM,kBAAkB,0BAA0B,CAAC;AAC1D,eAAO,MAAM,iBAAiB,0BAA0B,CAAC;AAezD,wBAAgB,gBAAgB,CAAC,EAAE,IAAI,EAAE,mBAAmB,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,mBAAmB,EAAE,OAAO,CAAA;CAAE,2CAgB7G"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/Attribution/index.d.ts b/node_modules/@xyflow/react/dist/esm/components/Attribution/index.d.ts new file mode 100644 index 0000000..bf992f9 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/Attribution/index.d.ts @@ -0,0 +1,8 @@ +import type { PanelPosition, ProOptions } from '@xyflow/system'; +type AttributionProps = { + proOptions?: ProOptions; + position?: PanelPosition; +}; +export declare function Attribution({ proOptions, position }: AttributionProps): import("react/jsx-runtime").JSX.Element | null; +export {}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/Attribution/index.d.ts.map b/node_modules/@xyflow/react/dist/esm/components/Attribution/index.d.ts.map new file mode 100644 index 0000000..900ce33 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/Attribution/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Attribution/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAIhE,KAAK,gBAAgB,GAAG;IACtB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC,EAAE,aAAa,CAAC;CAC1B,CAAC;AAEF,wBAAgB,WAAW,CAAC,EAAE,UAAU,EAAE,QAAyB,EAAE,EAAE,gBAAgB,kDAgBtF"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/BatchProvider/index.d.ts b/node_modules/@xyflow/react/dist/esm/components/BatchProvider/index.d.ts new file mode 100644 index 0000000..42650c6 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/BatchProvider/index.d.ts @@ -0,0 +1,17 @@ +import { ReactNode } from 'react'; +import { Queue } from './types'; +import type { Edge, Node } from '../../types'; +/** + * This is a context provider that holds and processes the node and edge update queues + * that are needed to handle setNodes, addNodes, setEdges and addEdges. + * + * @internal + */ +export declare function BatchProvider({ children, }: { + children: ReactNode; +}): import("react/jsx-runtime").JSX.Element; +export declare function useBatchContext(): { + nodeQueue: Queue; + edgeQueue: Queue; +}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/BatchProvider/index.d.ts.map b/node_modules/@xyflow/react/dist/esm/components/BatchProvider/index.d.ts.map new file mode 100644 index 0000000..a42645f --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/BatchProvider/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/BatchProvider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAAoC,MAAM,OAAO,CAAC;AAKnF,OAAO,EAAE,KAAK,EAAa,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAU9C;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,EACxF,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;CACrB,2CAkEA;AAED,wBAAgB,eAAe;eAnFlB,KAAK,CAAC,GAAG,CAAC;eAEV,KAAK,CAAC,GAAG,CAAC;EAyFtB"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/BatchProvider/types.d.ts b/node_modules/@xyflow/react/dist/esm/components/BatchProvider/types.d.ts new file mode 100644 index 0000000..b96a61e --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/BatchProvider/types.d.ts @@ -0,0 +1,7 @@ +export type QueueItem = T[] | ((items: T[]) => T[]); +export type Queue = { + get: () => QueueItem[]; + reset: () => void; + push: (item: QueueItem) => void; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/BatchProvider/types.d.ts.map b/node_modules/@xyflow/react/dist/esm/components/BatchProvider/types.d.ts.map new file mode 100644 index 0000000..a5cb6b8 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/BatchProvider/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/BatchProvider/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;AAEvD,MAAM,MAAM,KAAK,CAAC,CAAC,IAAI;IACrB,GAAG,EAAE,MAAM,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1B,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,IAAI,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;CACpC,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/BatchProvider/useQueue.d.ts b/node_modules/@xyflow/react/dist/esm/components/BatchProvider/useQueue.d.ts new file mode 100644 index 0000000..f4842ba --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/BatchProvider/useQueue.d.ts @@ -0,0 +1,11 @@ +import { Queue, QueueItem } from './types'; +/** + * This hook returns a queue that can be used to batch updates. + * + * @param runQueue - a function that gets called when the queue is flushed + * @internal + * + * @returns a Queue object + */ +export declare function useQueue(runQueue: (items: QueueItem[]) => void): Queue; +//# sourceMappingURL=useQueue.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/BatchProvider/useQueue.d.ts.map b/node_modules/@xyflow/react/dist/esm/components/BatchProvider/useQueue.d.ts.map new file mode 100644 index 0000000..e195793 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/BatchProvider/useQueue.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useQueue.d.ts","sourceRoot":"","sources":["../../../src/components/BatchProvider/useQueue.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,YAiCpE"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/ConnectionLine/index.d.ts b/node_modules/@xyflow/react/dist/esm/components/ConnectionLine/index.d.ts new file mode 100644 index 0000000..8aff7b0 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/ConnectionLine/index.d.ts @@ -0,0 +1,12 @@ +import { CSSProperties } from 'react'; +import { ConnectionLineType } from '@xyflow/system'; +import type { ConnectionLineComponent, Node } from '../../types'; +type ConnectionLineWrapperProps = { + type: ConnectionLineType; + component?: ConnectionLineComponent; + containerStyle?: CSSProperties; + style?: CSSProperties; +}; +export declare function ConnectionLineWrapper({ containerStyle, style, type, component, }: ConnectionLineWrapperProps): import("react/jsx-runtime").JSX.Element | null; +export {}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/ConnectionLine/index.d.ts.map b/node_modules/@xyflow/react/dist/esm/components/ConnectionLine/index.d.ts.map new file mode 100644 index 0000000..90edd83 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/ConnectionLine/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ConnectionLine/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAGtC,OAAO,EACL,kBAAkB,EAKnB,MAAM,gBAAgB,CAAC;AAIxB,OAAO,KAAK,EAAE,uBAAuB,EAAE,IAAI,EAAkB,MAAM,aAAa,CAAC;AAGjF,KAAK,0BAA0B,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI;IAC9D,IAAI,EAAE,kBAAkB,CAAC;IACzB,SAAS,CAAC,EAAE,uBAAuB,CAAC,QAAQ,CAAC,CAAC;IAC9C,cAAc,CAAC,EAAE,aAAa,CAAC;IAC/B,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,CAAC;AAUF,wBAAgB,qBAAqB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,EAClE,cAAc,EACd,KAAK,EACL,IAAI,EACJ,SAAS,GACV,EAAE,0BAA0B,CAAC,QAAQ,CAAC,kDAoBtC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/EdgeLabelRenderer/index.d.ts b/node_modules/@xyflow/react/dist/esm/components/EdgeLabelRenderer/index.d.ts new file mode 100644 index 0000000..558f6ed --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/EdgeLabelRenderer/index.d.ts @@ -0,0 +1,47 @@ +import type { ReactNode } from 'react'; +export type EdgeLabelRendererProps = { + children: ReactNode; +}; +/** + * Edges are SVG-based. If you want to render more complex labels you can use the + * `` component to access a div based renderer. This component + * is a portal that renders the label in a `
` that is positioned on top of + * the edges. You can see an example usage of the component in the + * [edge label renderer example](/examples/edges/edge-label-renderer). + * @public + * + * @example + * ```jsx + * import React from 'react'; + * import { getBezierPath, EdgeLabelRenderer, BaseEdge } from '@xyflow/react'; + * + * export function CustomEdge({ id, data, ...props }) { + * const [edgePath, labelX, labelY] = getBezierPath(props); + * + * return ( + * <> + * + * + *
+ * {data.label} + *
+ *
+ * + * ); + * }; + * ``` + * + * @remarks The `` has no pointer events by default. If you want to + * add mouse interactions you need to set the style `pointerEvents: all` and add + * the `nopan` class on the label or the element you want to interact with. + */ +export declare function EdgeLabelRenderer({ children }: EdgeLabelRendererProps): import("react").ReactPortal | null; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/EdgeLabelRenderer/index.d.ts.map b/node_modules/@xyflow/react/dist/esm/components/EdgeLabelRenderer/index.d.ts.map new file mode 100644 index 0000000..836e3b8 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/EdgeLabelRenderer/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/EdgeLabelRenderer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQvC,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,EAAE,SAAS,CAAA;CACpB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,EAAE,sBAAsB,sCAQrE"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/EdgeWrapper/EdgeUpdateAnchors.d.ts b/node_modules/@xyflow/react/dist/esm/components/EdgeWrapper/EdgeUpdateAnchors.d.ts new file mode 100644 index 0000000..06c2cf6 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/EdgeWrapper/EdgeUpdateAnchors.d.ts @@ -0,0 +1,15 @@ +import { EdgePosition } from '@xyflow/system'; +import type { EdgeWrapperProps, Edge } from '../../types/edges'; +type EdgeUpdateAnchorsProps = { + edge: EdgeType; + isReconnectable: boolean | 'source' | 'target'; + reconnectRadius: EdgeWrapperProps['reconnectRadius']; + onReconnect: EdgeWrapperProps['onReconnect']; + onReconnectStart: EdgeWrapperProps['onReconnectStart']; + onReconnectEnd: EdgeWrapperProps['onReconnectEnd']; + setUpdateHover: (hover: boolean) => void; + setReconnecting: (updating: boolean) => void; +} & EdgePosition; +export declare function EdgeUpdateAnchors({ isReconnectable, reconnectRadius, edge, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, onReconnect, onReconnectStart, onReconnectEnd, setReconnecting, setUpdateHover, }: EdgeUpdateAnchorsProps): import("react/jsx-runtime").JSX.Element; +export {}; +//# sourceMappingURL=EdgeUpdateAnchors.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/EdgeWrapper/EdgeUpdateAnchors.d.ts.map b/node_modules/@xyflow/react/dist/esm/components/EdgeWrapper/EdgeUpdateAnchors.d.ts.map new file mode 100644 index 0000000..30f178f --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/EdgeWrapper/EdgeUpdateAnchors.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"EdgeUpdateAnchors.d.ts","sourceRoot":"","sources":["../../../src/components/EdgeWrapper/EdgeUpdateAnchors.tsx"],"names":[],"mappings":"AACA,OAAO,EAA6B,YAAY,EAAoC,MAAM,gBAAgB,CAAC;AAG3G,OAAO,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAGhE,KAAK,sBAAsB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI;IAC1D,IAAI,EAAE,QAAQ,CAAC;IACf,eAAe,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC/C,eAAe,EAAE,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;IACrD,WAAW,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC,CAAC;IACvD,gBAAgB,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC,kBAAkB,CAAC,CAAC;IACjE,cAAc,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC,gBAAgB,CAAC,CAAC;IAC7D,cAAc,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,eAAe,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;CAC9C,GAAG,YAAY,CAAC;AAEjB,wBAAgB,iBAAiB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,EAC9D,eAAe,EACf,eAAe,EACf,IAAI,EACJ,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,cAAc,EACd,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,cAAc,GACf,EAAE,sBAAsB,CAAC,QAAQ,CAAC,2CAmGlC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/EdgeWrapper/index.d.ts b/node_modules/@xyflow/react/dist/esm/components/EdgeWrapper/index.d.ts new file mode 100644 index 0000000..ba43841 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/EdgeWrapper/index.d.ts @@ -0,0 +1,4 @@ +import { JSX } from 'react'; +import type { Edge, EdgeWrapperProps } from '../../types'; +export declare function EdgeWrapper({ id, edgesFocusable, edgesReconnectable, elementsSelectable, onClick, onDoubleClick, onContextMenu, onMouseEnter, onMouseMove, onMouseLeave, reconnectRadius, onReconnect, onReconnectStart, onReconnectEnd, rfId, edgeTypes, noPanClassName, onError, disableKeyboardA11y, }: EdgeWrapperProps): JSX.Element | null; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/EdgeWrapper/index.d.ts.map b/node_modules/@xyflow/react/dist/esm/components/EdgeWrapper/index.d.ts.map new file mode 100644 index 0000000..d23d932 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/EdgeWrapper/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/EdgeWrapper/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA8D,GAAG,EAAE,MAAM,OAAO,CAAC;AAexF,OAAO,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE1D,wBAAgB,WAAW,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,EACxD,EAAE,EACF,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,OAAO,EACP,aAAa,EACb,aAAa,EACb,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,IAAI,EACJ,SAAS,EACT,cAAc,EACd,OAAO,EACP,mBAAmB,GACpB,EAAE,gBAAgB,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAmOjD"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/EdgeWrapper/utils.d.ts b/node_modules/@xyflow/react/dist/esm/components/EdgeWrapper/utils.d.ts new file mode 100644 index 0000000..8dfb923 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/EdgeWrapper/utils.d.ts @@ -0,0 +1,11 @@ +import type { EdgeTypes } from '../../types'; +export declare const builtinEdgeTypes: EdgeTypes; +export declare const nullPosition: { + sourceX: null; + sourceY: null; + targetX: null; + targetY: null; + sourcePosition: null; + targetPosition: null; +}; +//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/EdgeWrapper/utils.d.ts.map b/node_modules/@xyflow/react/dist/esm/components/EdgeWrapper/utils.d.ts.map new file mode 100644 index 0000000..e3f5a7e --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/EdgeWrapper/utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/EdgeWrapper/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAS7C,eAAO,MAAM,gBAAgB,EAAE,SAM9B,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;CAOxB,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/Edges/BaseEdge.d.ts b/node_modules/@xyflow/react/dist/esm/components/Edges/BaseEdge.d.ts new file mode 100644 index 0000000..328af2f --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/Edges/BaseEdge.d.ts @@ -0,0 +1,30 @@ +import type { BaseEdgeProps } from '../../types'; +/** + * The `` component gets used internally for all the edges. It can be + * used inside a custom edge and handles the invisible helper edge and the edge label + * for you. + * + * @public + * @example + * ```jsx + *import { BaseEdge } from '@xyflow/react'; + * + *export function CustomEdge({ sourceX, sourceY, targetX, targetY, ...props }) { + * const [edgePath] = getStraightPath({ + * sourceX, + * sourceY, + * targetX, + * targetY, + * }); + * + * return ; + *} + *``` + * + * @remarks If you want to use an edge marker with the [``](/api-reference/components/base-edge) component, + * you can pass the `markerStart` or `markerEnd` props passed to your custom edge + * through to the [``](/api-reference/components/base-edge) component. + * You can see all the props passed to a custom edge by looking at the [`EdgeProps`](/api-reference/types/edge-props) type. + */ +export declare function BaseEdge({ path, labelX, labelY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, interactionWidth, ...props }: BaseEdgeProps): import("react/jsx-runtime").JSX.Element; +//# sourceMappingURL=BaseEdge.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/Edges/BaseEdge.d.ts.map b/node_modules/@xyflow/react/dist/esm/components/Edges/BaseEdge.d.ts.map new file mode 100644 index 0000000..7e03035 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/Edges/BaseEdge.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"BaseEdge.d.ts","sourceRoot":"","sources":["../../../src/components/Edges/BaseEdge.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,QAAQ,CAAC,EACvB,IAAI,EACJ,MAAM,EACN,MAAM,EACN,KAAK,EACL,UAAU,EACV,WAAW,EACX,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,gBAAqB,EACrB,GAAG,KAAK,EACT,EAAE,aAAa,2CA2Bf"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/Edges/BezierEdge.d.ts b/node_modules/@xyflow/react/dist/esm/components/Edges/BezierEdge.d.ts new file mode 100644 index 0000000..d0570d5 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/Edges/BezierEdge.d.ts @@ -0,0 +1,31 @@ +import type { BezierEdgeProps } from '../../types'; +/** + * Component that can be used inside a custom edge to render a bezier curve. + * + * @public + * @example + * + * ```tsx + * import { BezierEdge } from '@xyflow/react'; + * + * function CustomEdge({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition }) { + * return ( + * + * ); + * } + * ``` + */ +declare const BezierEdge: import("react").MemoExoticComponent<({ id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, markerEnd, markerStart, pathOptions, interactionWidth, }: BezierEdgeProps) => import("react/jsx-runtime").JSX.Element>; +/** + * @internal + */ +declare const BezierEdgeInternal: import("react").MemoExoticComponent<({ id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, markerEnd, markerStart, pathOptions, interactionWidth, }: BezierEdgeProps) => import("react/jsx-runtime").JSX.Element>; +export { BezierEdge, BezierEdgeInternal }; +//# sourceMappingURL=BezierEdge.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/Edges/BezierEdge.d.ts.map b/node_modules/@xyflow/react/dist/esm/components/Edges/BezierEdge.d.ts.map new file mode 100644 index 0000000..60b5ae3 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/Edges/BezierEdge.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"BezierEdge.d.ts","sourceRoot":"","sources":["../../../src/components/Edges/BezierEdge.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AA2DnD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,QAAA,MAAM,UAAU,qQA1DT,eAAe,6CA0DoC,CAAC;AAE3D;;GAEG;AACH,QAAA,MAAM,kBAAkB,qQA/DjB,eAAe,6CA+D2C,CAAC;AAKlE,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/Edges/EdgeAnchor.d.ts b/node_modules/@xyflow/react/dist/esm/components/Edges/EdgeAnchor.d.ts new file mode 100644 index 0000000..a3465d4 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/Edges/EdgeAnchor.d.ts @@ -0,0 +1,17 @@ +import type { MouseEvent as ReactMouseEvent, SVGAttributes } from 'react'; +import { Position } from '@xyflow/system'; +export interface EdgeAnchorProps extends SVGAttributes { + position: Position; + centerX: number; + centerY: number; + radius?: number; + onMouseDown: (event: ReactMouseEvent) => void; + onMouseEnter: (event: ReactMouseEvent) => void; + onMouseOut: (event: ReactMouseEvent) => void; + type: string; +} +/** + * @internal + */ +export declare function EdgeAnchor({ position, centerX, centerY, radius, onMouseDown, onMouseEnter, onMouseOut, type, }: EdgeAnchorProps): import("react/jsx-runtime").JSX.Element; +//# sourceMappingURL=EdgeAnchor.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/Edges/EdgeAnchor.d.ts.map b/node_modules/@xyflow/react/dist/esm/components/Edges/EdgeAnchor.d.ts.map new file mode 100644 index 0000000..69cfdfe --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/Edges/EdgeAnchor.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"EdgeAnchor.d.ts","sourceRoot":"","sources":["../../../src/components/Edges/EdgeAnchor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,IAAI,eAAe,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE1E,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAc1C,MAAM,WAAW,eAAgB,SAAQ,aAAa,CAAC,WAAW,CAAC;IACjE,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,CAAC,KAAK,EAAE,eAAe,CAAC,WAAW,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IACvE,YAAY,EAAE,CAAC,KAAK,EAAE,eAAe,CAAC,WAAW,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IACxE,UAAU,EAAE,CAAC,KAAK,EAAE,eAAe,CAAC,WAAW,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IACtE,IAAI,EAAE,MAAM,CAAC;CACd;AAID;;GAEG;AACH,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,OAAO,EACP,OAAO,EACP,MAAW,EACX,WAAW,EACX,YAAY,EACZ,UAAU,EACV,IAAI,GACL,EAAE,eAAe,2CAcjB"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/Edges/EdgeText.d.ts b/node_modules/@xyflow/react/dist/esm/components/Edges/EdgeText.d.ts new file mode 100644 index 0000000..cab46cf --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/Edges/EdgeText.d.ts @@ -0,0 +1,34 @@ +import type { EdgeTextProps } from '../../types'; +declare function EdgeTextComponent({ x, y, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, children, className, ...rest }: EdgeTextProps): import("react/jsx-runtime").JSX.Element | null; +declare namespace EdgeTextComponent { + var displayName: string; +} +/** + * You can use the `` component as a helper component to display text + * within your custom edges. + * + * @public + * + * @example + * ```jsx + * import { EdgeText } from '@xyflow/react'; + * + * export function CustomEdgeLabel({ label }) { + * return ( + * + * ); + * } + *``` + */ +export declare const EdgeText: import("react").MemoExoticComponent; +export {}; +//# sourceMappingURL=EdgeText.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/Edges/EdgeText.d.ts.map b/node_modules/@xyflow/react/dist/esm/components/Edges/EdgeText.d.ts.map new file mode 100644 index 0000000..b151af5 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/Edges/EdgeText.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"EdgeText.d.ts","sourceRoot":"","sources":["../../../src/components/Edges/EdgeText.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,iBAAS,iBAAiB,CAAC,EACzB,CAAC,EACD,CAAC,EACD,KAAK,EACL,UAAU,EACV,WAAkB,EAClB,YAAY,EACZ,cAAuB,EACvB,mBAAuB,EACvB,QAAQ,EACR,SAAS,EACT,GAAG,IAAI,EACR,EAAE,aAAa,kDAqDf;kBAjEQ,iBAAiB;;;AAqE1B;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,QAAQ,+DAA0B,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/Edges/SimpleBezierEdge.d.ts b/node_modules/@xyflow/react/dist/esm/components/Edges/SimpleBezierEdge.d.ts new file mode 100644 index 0000000..7d39b01 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/Edges/SimpleBezierEdge.d.ts @@ -0,0 +1,30 @@ +import { Position } from '@xyflow/system'; +import type { SimpleBezierEdgeProps } from '../../types'; +export interface GetSimpleBezierPathParams { + sourceX: number; + sourceY: number; + /** @default Position.Bottom */ + sourcePosition?: Position; + targetX: number; + targetY: number; + /** @default Position.Top */ + targetPosition?: Position; +} +/** + * The `getSimpleBezierPath` util returns everything you need to render a simple + * bezier edge between two nodes. + * @public + * @returns + * - `path`: the path to use in an SVG `` element. + * - `labelX`: the `x` position you can use to render a label for this edge. + * - `labelY`: the `y` position you can use to render a label for this edge. + * - `offsetX`: the absolute difference between the source `x` position and the `x` position of the + * middle of this path. + * - `offsetY`: the absolute difference between the source `y` position and the `y` position of the + * middle of this path. + */ +export declare function getSimpleBezierPath({ sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition, }: GetSimpleBezierPathParams): [path: string, labelX: number, labelY: number, offsetX: number, offsetY: number]; +declare const SimpleBezierEdge: import("react").MemoExoticComponent<({ id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, markerEnd, markerStart, interactionWidth, }: SimpleBezierEdgeProps) => import("react/jsx-runtime").JSX.Element>; +declare const SimpleBezierEdgeInternal: import("react").MemoExoticComponent<({ id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, markerEnd, markerStart, interactionWidth, }: SimpleBezierEdgeProps) => import("react/jsx-runtime").JSX.Element>; +export { SimpleBezierEdge, SimpleBezierEdgeInternal }; +//# sourceMappingURL=SimpleBezierEdge.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/Edges/SimpleBezierEdge.d.ts.map b/node_modules/@xyflow/react/dist/esm/components/Edges/SimpleBezierEdge.d.ts.map new file mode 100644 index 0000000..43ba79b --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/Edges/SimpleBezierEdge.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"SimpleBezierEdge.d.ts","sourceRoot":"","sources":["../../../src/components/Edges/SimpleBezierEdge.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAuB,MAAM,gBAAgB,CAAC;AAG/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEzD,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,+BAA+B;IAC/B,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,4BAA4B;IAC5B,cAAc,CAAC,EAAE,QAAQ,CAAC;CAC3B;AAkBD;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,OAAO,EACP,OAAO,EACP,cAAgC,EAChC,OAAO,EACP,OAAO,EACP,cAA6B,GAC9B,EAAE,yBAAyB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAiC9G;AAyDD,QAAA,MAAM,gBAAgB,wPAlCf,qBAAqB,6CAkC0C,CAAC;AACvE,QAAA,MAAM,wBAAwB,wPAnCvB,qBAAqB,6CAmCiD,CAAC;AAK9E,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/Edges/SmoothStepEdge.d.ts b/node_modules/@xyflow/react/dist/esm/components/Edges/SmoothStepEdge.d.ts new file mode 100644 index 0000000..e6ac0cb --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/Edges/SmoothStepEdge.d.ts @@ -0,0 +1,31 @@ +import type { SmoothStepEdgeProps } from '../../types'; +/** + * Component that can be used inside a custom edge to render a smooth step edge. + * + * @public + * @example + * + * ```tsx + * import { SmoothStepEdge } from '@xyflow/react'; + * + * function CustomEdge({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition }) { + * return ( + * + * ); + * } + * ``` + */ +declare const SmoothStepEdge: import("react").MemoExoticComponent<({ id, sourceX, sourceY, targetX, targetY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, sourcePosition, targetPosition, markerEnd, markerStart, pathOptions, interactionWidth, }: SmoothStepEdgeProps) => import("react/jsx-runtime").JSX.Element>; +/** + * @internal + */ +declare const SmoothStepEdgeInternal: import("react").MemoExoticComponent<({ id, sourceX, sourceY, targetX, targetY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, sourcePosition, targetPosition, markerEnd, markerStart, pathOptions, interactionWidth, }: SmoothStepEdgeProps) => import("react/jsx-runtime").JSX.Element>; +export { SmoothStepEdge, SmoothStepEdgeInternal }; +//# sourceMappingURL=SmoothStepEdge.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/Edges/SmoothStepEdge.d.ts.map b/node_modules/@xyflow/react/dist/esm/components/Edges/SmoothStepEdge.d.ts.map new file mode 100644 index 0000000..097375a --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/Edges/SmoothStepEdge.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"SmoothStepEdge.d.ts","sourceRoot":"","sources":["../../../src/components/Edges/SmoothStepEdge.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AA4DvD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,QAAA,MAAM,cAAc,qQA3Db,mBAAmB,6CA2DwC,CAAC;AAEnE;;GAEG;AACH,QAAA,MAAM,sBAAsB,qQAhErB,mBAAmB,6CAgE+C,CAAC;AAK1E,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/Edges/StepEdge.d.ts b/node_modules/@xyflow/react/dist/esm/components/Edges/StepEdge.d.ts new file mode 100644 index 0000000..b335551 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/Edges/StepEdge.d.ts @@ -0,0 +1,31 @@ +import type { StepEdgeProps } from '../../types'; +/** + * Component that can be used inside a custom edge to render a step edge. + * + * @public + * @example + * + * ```tsx + * import { StepEdge } from '@xyflow/react'; + * + * function CustomEdge({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition }) { + * return ( + * + * ); + * } + * ``` + */ +declare const StepEdge: import("react").MemoExoticComponent<({ id, ...props }: StepEdgeProps) => import("react/jsx-runtime").JSX.Element>; +/** + * @internal + */ +declare const StepEdgeInternal: import("react").MemoExoticComponent<({ id, ...props }: StepEdgeProps) => import("react/jsx-runtime").JSX.Element>; +export { StepEdge, StepEdgeInternal }; +//# sourceMappingURL=StepEdge.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/Edges/StepEdge.d.ts.map b/node_modules/@xyflow/react/dist/esm/components/Edges/StepEdge.d.ts.map new file mode 100644 index 0000000..9fd57f9 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/Edges/StepEdge.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"StepEdge.d.ts","sourceRoot":"","sources":["../../../src/components/Edges/StepEdge.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAoBjD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,QAAA,MAAM,QAAQ,yDAvCmB,aAAa,6CAuCQ,CAAC;AAEvD;;GAEG;AACH,QAAA,MAAM,gBAAgB,yDA5CW,aAAa,6CA4Ce,CAAC;AAK9D,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/Edges/StraightEdge.d.ts b/node_modules/@xyflow/react/dist/esm/components/Edges/StraightEdge.d.ts new file mode 100644 index 0000000..0af4c28 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/Edges/StraightEdge.d.ts @@ -0,0 +1,29 @@ +import type { StraightEdgeProps } from '../../types'; +/** + * Component that can be used inside a custom edge to render a straight line. + * + * @public + * @example + * + * ```tsx + * import { StraightEdge } from '@xyflow/react'; + * + * function CustomEdge({ sourceX, sourceY, targetX, targetY }) { + * return ( + * + * ); + * } + * ``` + */ +declare const StraightEdge: import("react").MemoExoticComponent<({ id, sourceX, sourceY, targetX, targetY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, markerEnd, markerStart, interactionWidth, }: StraightEdgeProps) => import("react/jsx-runtime").JSX.Element>; +/** + * @internal + */ +declare const StraightEdgeInternal: import("react").MemoExoticComponent<({ id, sourceX, sourceY, targetX, targetY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, markerEnd, markerStart, interactionWidth, }: StraightEdgeProps) => import("react/jsx-runtime").JSX.Element>; +export { StraightEdge, StraightEdgeInternal }; +//# sourceMappingURL=StraightEdge.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/Edges/StraightEdge.d.ts.map b/node_modules/@xyflow/react/dist/esm/components/Edges/StraightEdge.d.ts.map new file mode 100644 index 0000000..4037d38 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/Edges/StraightEdge.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"StraightEdge.d.ts","sourceRoot":"","sources":["../../../src/components/Edges/StraightEdge.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAgDrD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,QAAA,MAAM,YAAY,wNAhDX,iBAAiB,6CAgDsC,CAAC;AAE/D;;GAEG;AACH,QAAA,MAAM,oBAAoB,wNArDnB,iBAAiB,6CAqD6C,CAAC;AAKtE,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/Edges/index.d.ts b/node_modules/@xyflow/react/dist/esm/components/Edges/index.d.ts new file mode 100644 index 0000000..d90e7ba --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/Edges/index.d.ts @@ -0,0 +1,6 @@ +export { SimpleBezierEdge, SimpleBezierEdgeInternal } from './SimpleBezierEdge'; +export { SmoothStepEdge, SmoothStepEdgeInternal } from './SmoothStepEdge'; +export { StepEdge, StepEdgeInternal } from './StepEdge'; +export { StraightEdge, StraightEdgeInternal } from './StraightEdge'; +export { BezierEdge, BezierEdgeInternal } from './BezierEdge'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/Edges/index.d.ts.map b/node_modules/@xyflow/react/dist/esm/components/Edges/index.d.ts.map new file mode 100644 index 0000000..b8fbaa2 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/Edges/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Edges/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/Handle/index.d.ts b/node_modules/@xyflow/react/dist/esm/components/Handle/index.d.ts new file mode 100644 index 0000000..40659a6 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/Handle/index.d.ts @@ -0,0 +1,39 @@ +import { type HTMLAttributes } from 'react'; +import { type HandleProps as HandlePropsSystem, OnConnect } from '@xyflow/system'; +/** + * @expand + */ +export type HandleProps = HandlePropsSystem & Omit, 'id'> & { + /** Callback called when connection is made */ + onConnect?: OnConnect; +}; +/** + * The `` component is used in your [custom nodes](/learn/customization/custom-nodes) + * to define connection points. + * + *@public + * + *@example + * + *```jsx + *import { Handle, Position } from '@xyflow/react'; + * + *export function CustomNode({ data }) { + * return ( + * <> + *
+ * {data.label} + *
+ * + * + * + * + * ); + *}; + *``` + */ +export declare const Handle: import("react").MemoExoticComponent<(props: HandlePropsSystem & Omit, "id"> & { + /** Callback called when connection is made */ + onConnect?: OnConnect; +} & import("react").RefAttributes) => import("react").JSX.Element>; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/Handle/index.d.ts.map b/node_modules/@xyflow/react/dist/esm/components/Handle/index.d.ts.map new file mode 100644 index 0000000..8ca09e9 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/Handle/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Handle/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EAKpB,MAAM,OAAO,CAAC;AAGf,OAAO,EAOL,KAAK,WAAW,IAAI,iBAAiB,EAIrC,SAAS,EAGV,MAAM,gBAAgB,CAAC;AAOxB;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,iBAAiB,GACzC,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,IAAI,CAAC,GAAG;IAC3C,8CAA8C;IAC9C,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AA6NJ;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,MAAM;IAxPf,8CAA8C;gBAClC,SAAS;kFAuPmC,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/NodeWrapper/index.d.ts b/node_modules/@xyflow/react/dist/esm/components/NodeWrapper/index.d.ts new file mode 100644 index 0000000..994b276 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/NodeWrapper/index.d.ts @@ -0,0 +1,3 @@ +import type { Node, NodeWrapperProps } from '../../types'; +export declare function NodeWrapper({ id, onClick, onMouseEnter, onMouseMove, onMouseLeave, onContextMenu, onDoubleClick, nodesDraggable, elementsSelectable, nodesConnectable, nodesFocusable, resizeObserver, noDragClassName, noPanClassName, disableKeyboardA11y, rfId, nodeTypes, nodeClickDistance, onError, }: NodeWrapperProps): import("react/jsx-runtime").JSX.Element | null; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/NodeWrapper/index.d.ts.map b/node_modules/@xyflow/react/dist/esm/components/NodeWrapper/index.d.ts.map new file mode 100644 index 0000000..7460e3a --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/NodeWrapper/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/NodeWrapper/index.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAgB,IAAI,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAExE,wBAAgB,WAAW,CAAC,QAAQ,SAAS,IAAI,EAAE,EACjD,EAAE,EACF,OAAO,EACP,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,aAAa,EACb,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,IAAI,EACJ,SAAS,EACT,iBAAiB,EACjB,OAAO,GACR,EAAE,gBAAgB,CAAC,QAAQ,CAAC,kDAgN5B"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/NodeWrapper/useNodeObserver.d.ts b/node_modules/@xyflow/react/dist/esm/components/NodeWrapper/useNodeObserver.d.ts new file mode 100644 index 0000000..457539f --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/NodeWrapper/useNodeObserver.d.ts @@ -0,0 +1,14 @@ +import type { InternalNode } from '../../types'; +/** + * Hook to handle the resize observation + internal updates for the passed node. + * + * @internal + * @returns nodeRef - reference to the node element + */ +export declare function useNodeObserver({ node, nodeType, hasDimensions, resizeObserver, }: { + node: InternalNode; + nodeType: string; + hasDimensions: boolean; + resizeObserver: ResizeObserver | null; +}): import("react").MutableRefObject; +//# sourceMappingURL=useNodeObserver.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/NodeWrapper/useNodeObserver.d.ts.map b/node_modules/@xyflow/react/dist/esm/components/NodeWrapper/useNodeObserver.d.ts.map new file mode 100644 index 0000000..34342f7 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/NodeWrapper/useNodeObserver.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useNodeObserver.d.ts","sourceRoot":"","sources":["../../../src/components/NodeWrapper/useNodeObserver.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,cAAc,GACf,EAAE;IACD,IAAI,EAAE,YAAY,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,OAAO,CAAC;IACvB,cAAc,EAAE,cAAc,GAAG,IAAI,CAAC;CACvC,2DAmDA"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/NodeWrapper/utils.d.ts b/node_modules/@xyflow/react/dist/esm/components/NodeWrapper/utils.d.ts new file mode 100644 index 0000000..ec4720e --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/NodeWrapper/utils.d.ts @@ -0,0 +1,9 @@ +import type { XYPosition } from '@xyflow/system'; +import type { InternalNode, Node, NodeTypes } from '../../types'; +export declare const arrowKeyDiffs: Record; +export declare const builtinNodeTypes: NodeTypes; +export declare function getNodeInlineStyleDimensions(node: InternalNode): { + width: number | string | undefined; + height: number | string | undefined; +}; +//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/NodeWrapper/utils.d.ts.map b/node_modules/@xyflow/react/dist/esm/components/NodeWrapper/utils.d.ts.map new file mode 100644 index 0000000..9450c4e --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/NodeWrapper/utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/NodeWrapper/utils.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAMjD,OAAO,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEjE,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAKpD,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,SAK9B,CAAC;AAEF,wBAAgB,4BAA4B,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EACvE,IAAI,EAAE,YAAY,CAAC,QAAQ,CAAC,GAC3B;IACD,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACnC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CACrC,CAYA"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/Nodes/DefaultNode.d.ts b/node_modules/@xyflow/react/dist/esm/components/Nodes/DefaultNode.d.ts new file mode 100644 index 0000000..c97468e --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/Nodes/DefaultNode.d.ts @@ -0,0 +1,3 @@ +import type { BuiltInNode, NodeProps } from '../../types/nodes'; +export declare function DefaultNode({ data, isConnectable, targetPosition, sourcePosition, }: NodeProps): import("react/jsx-runtime").JSX.Element; +//# sourceMappingURL=DefaultNode.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/Nodes/DefaultNode.d.ts.map b/node_modules/@xyflow/react/dist/esm/components/Nodes/DefaultNode.d.ts.map new file mode 100644 index 0000000..39117d0 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/Nodes/DefaultNode.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"DefaultNode.d.ts","sourceRoot":"","sources":["../../../src/components/Nodes/DefaultNode.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEhE,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,aAAa,EACb,cAA6B,EAC7B,cAAgC,GACjC,EAAE,SAAS,CAAC,WAAW,CAAC,2CAQxB"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/Nodes/GroupNode.d.ts b/node_modules/@xyflow/react/dist/esm/components/Nodes/GroupNode.d.ts new file mode 100644 index 0000000..901decc --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/Nodes/GroupNode.d.ts @@ -0,0 +1,2 @@ +export declare function GroupNode(): null; +//# sourceMappingURL=GroupNode.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/Nodes/GroupNode.d.ts.map b/node_modules/@xyflow/react/dist/esm/components/Nodes/GroupNode.d.ts.map new file mode 100644 index 0000000..8427516 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/Nodes/GroupNode.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"GroupNode.d.ts","sourceRoot":"","sources":["../../../src/components/Nodes/GroupNode.tsx"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,SAExB"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/Nodes/InputNode.d.ts b/node_modules/@xyflow/react/dist/esm/components/Nodes/InputNode.d.ts new file mode 100644 index 0000000..5f54760 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/Nodes/InputNode.d.ts @@ -0,0 +1,3 @@ +import type { BuiltInNode, NodeProps } from '../../types/nodes'; +export declare function InputNode({ data, isConnectable, sourcePosition }: NodeProps): import("react/jsx-runtime").JSX.Element; +//# sourceMappingURL=InputNode.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/Nodes/InputNode.d.ts.map b/node_modules/@xyflow/react/dist/esm/components/Nodes/InputNode.d.ts.map new file mode 100644 index 0000000..1b43a1c --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/Nodes/InputNode.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"InputNode.d.ts","sourceRoot":"","sources":["../../../src/components/Nodes/InputNode.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEhE,wBAAgB,SAAS,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,cAAgC,EAAE,EAAE,SAAS,CAAC,WAAW,CAAC,2CAO1G"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/Nodes/OutputNode.d.ts b/node_modules/@xyflow/react/dist/esm/components/Nodes/OutputNode.d.ts new file mode 100644 index 0000000..d66c1fb --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/Nodes/OutputNode.d.ts @@ -0,0 +1,3 @@ +import type { BuiltInNode, NodeProps } from '../../types/nodes'; +export declare function OutputNode({ data, isConnectable, targetPosition }: NodeProps): import("react/jsx-runtime").JSX.Element; +//# sourceMappingURL=OutputNode.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/Nodes/OutputNode.d.ts.map b/node_modules/@xyflow/react/dist/esm/components/Nodes/OutputNode.d.ts.map new file mode 100644 index 0000000..f53ab00 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/Nodes/OutputNode.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"OutputNode.d.ts","sourceRoot":"","sources":["../../../src/components/Nodes/OutputNode.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEhE,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,cAA6B,EAAE,EAAE,SAAS,CAAC,WAAW,CAAC,2CAOxG"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/Nodes/utils.d.ts b/node_modules/@xyflow/react/dist/esm/components/Nodes/utils.d.ts new file mode 100644 index 0000000..25d4ff1 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/Nodes/utils.d.ts @@ -0,0 +1,13 @@ +import type { RefObject } from 'react'; +import type { StoreApi } from 'zustand'; +import type { ReactFlowState } from '../../types'; +export declare function handleNodeClick({ id, store, unselect, nodeRef, }: { + id: string; + store: { + getState: StoreApi['getState']; + setState: StoreApi['setState']; + }; + unselect?: boolean; + nodeRef?: RefObject; +}): void; +//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/Nodes/utils.d.ts.map b/node_modules/@xyflow/react/dist/esm/components/Nodes/utils.d.ts.map new file mode 100644 index 0000000..84a7a1c --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/Nodes/utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/Nodes/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAQlD,wBAAgB,eAAe,CAAC,EAC9B,EAAE,EACF,KAAK,EACL,QAAgB,EAChB,OAAO,GACR,EAAE;IACD,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE;QACL,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,UAAU,CAAC,CAAC;QAC/C,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,UAAU,CAAC,CAAC;KAChD,CAAC;IACF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;CACrC,QAkBA"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/NodesSelection/index.d.ts b/node_modules/@xyflow/react/dist/esm/components/NodesSelection/index.d.ts new file mode 100644 index 0000000..0c09613 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/NodesSelection/index.d.ts @@ -0,0 +1,13 @@ +/** + * The nodes selection rectangle gets displayed when a user + * made a selection with on or several nodes + */ +import { type MouseEvent } from 'react'; +import type { Node } from '../../types'; +export type NodesSelectionProps = { + onSelectionContextMenu?: (event: MouseEvent, nodes: NodeType[]) => void; + noPanClassName?: string; + disableKeyboardA11y: boolean; +}; +export declare function NodesSelection({ onSelectionContextMenu, noPanClassName, disableKeyboardA11y, }: NodesSelectionProps): import("react/jsx-runtime").JSX.Element | null; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/NodesSelection/index.d.ts.map b/node_modules/@xyflow/react/dist/esm/components/NodesSelection/index.d.ts.map new file mode 100644 index 0000000..c1915c3 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/NodesSelection/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/NodesSelection/index.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAqB,KAAK,UAAU,EAAsB,MAAM,OAAO,CAAC;AAS/E,OAAO,KAAK,EAAE,IAAI,EAAkB,MAAM,aAAa,CAAC;AAExD,MAAM,MAAM,mBAAmB,CAAC,QAAQ,IAAI;IAC1C,sBAAsB,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;IACxE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mBAAmB,EAAE,OAAO,CAAC;CAC9B,CAAC;AAeF,wBAAgB,cAAc,CAAC,QAAQ,SAAS,IAAI,EAAE,EACpD,sBAAsB,EACtB,cAAc,EACd,mBAAmB,GACpB,EAAE,mBAAmB,CAAC,QAAQ,CAAC,kDA6D/B"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/Panel/index.d.ts b/node_modules/@xyflow/react/dist/esm/components/Panel/index.d.ts new file mode 100644 index 0000000..f9a8b24 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/Panel/index.d.ts @@ -0,0 +1,45 @@ +import { HTMLAttributes } from 'react'; +import type { PanelPosition } from '@xyflow/system'; +/** + * @expand + */ +export type PanelProps = HTMLAttributes & { + /** + * The position of the panel. + * @default "top-left" + */ + position?: PanelPosition; +}; +/** + * The `` component helps you position content above the viewport. + * It is used internally by the [``](/api-reference/components/minimap) + * and [``](/api-reference/components/controls) components. + * + * @public + * + * @example + * ```jsx + *import { ReactFlow, Background, Panel } from '@xyflow/react'; + * + *export default function Flow() { + * return ( + * + * top-left + * top-center + * top-right + * bottom-left + * bottom-center + * bottom-right + * + * ); + *} + *``` + */ +export declare const Panel: import("react").ForwardRefExoticComponent & { + /** + * The position of the panel. + * @default "top-left" + */ + position?: PanelPosition; +} & import("react").RefAttributes>; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/Panel/index.d.ts.map b/node_modules/@xyflow/react/dist/esm/components/Panel/index.d.ts.map new file mode 100644 index 0000000..42759ef --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/Panel/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Panel/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAc,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAKpD;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IACxD;;;OAGG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAC;CAC1B,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,KAAK;IAlChB;;;OAGG;eACQ,aAAa;kDA8CzB,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/ReactFlowProvider/index.d.ts b/node_modules/@xyflow/react/dist/esm/components/ReactFlowProvider/index.d.ts new file mode 100644 index 0000000..e5f5f35 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/ReactFlowProvider/index.d.ts @@ -0,0 +1,82 @@ +import { type ReactNode } from 'react'; +import type { Node, Edge, FitViewOptions } from '../../types'; +import { CoordinateExtent, NodeOrigin } from '@xyflow/system'; +export type ReactFlowProviderProps = { + /** These nodes are used to initialize the flow. They are not dynamic. */ + initialNodes?: Node[]; + /** These edges are used to initialize the flow. They are not dynamic. */ + initialEdges?: Edge[]; + /** These nodes are used to initialize the flow. They are not dynamic. */ + defaultNodes?: Node[]; + /** These edges are used to initialize the flow. They are not dynamic. */ + defaultEdges?: Edge[]; + /** The initial width is necessary to be able to use fitView on the server */ + initialWidth?: number; + /** The initial height is necessary to be able to use fitView on the server */ + initialHeight?: number; + /** When `true`, the flow will be zoomed and panned to fit all the nodes initially provided. */ + fitView?: boolean; + /** + * You can provide an object of options to customize the initial fitView behavior. + */ + initialFitViewOptions?: FitViewOptions; + /** Initial minimum zoom level */ + initialMinZoom?: number; + /** Initial maximum zoom level */ + initialMaxZoom?: number; + /** + * The origin of the node to use when placing it in the flow or looking up its `x` and `y` + * position. An origin of `[0, 0]` means that a node's top left corner will be placed at the `x` + * and `y` position. + * @default [0, 0] + * @example + * [0, 0] // default, top left + * [0.5, 0.5] // center + * [1, 1] // bottom right + */ + nodeOrigin?: NodeOrigin; + /** + * By default, nodes can be placed on an infinite flow. You can use this prop to set a boundary. + * + * The first pair of coordinates is the top left boundary and the second pair is the bottom right. + * @example [[-1000, -10000], [1000, 1000]] + */ + nodeExtent?: CoordinateExtent; + children: ReactNode; +}; +/** + * The `` component is a [context provider](https://react.dev/learn/passing-data-deeply-with-context#) + * that makes it possible to access a flow's internal state outside of the + * [``](/api-reference/react-flow) component. Many of the hooks we + * provide rely on this component to work. + * @public + * + * @example + * ```tsx + *import { ReactFlow, ReactFlowProvider, useNodes } from '@xyflow/react' + * + *export default function Flow() { + * return ( + * + * + * + * + * ); + *} + * + *function Sidebar() { + * // This hook will only work if the component it's used in is a child of a + * // . + * const nodes = useNodes() + * + * return ; + *} + *``` + * + * @remarks If you're using a router and want your flow's state to persist across routes, + * it's vital that you place the `` component _outside_ of + * your router. If you have multiple flows on the same page you will need to use a separate + * `` for each flow. + */ +export declare function ReactFlowProvider({ initialNodes: nodes, initialEdges: edges, defaultNodes, defaultEdges, initialWidth: width, initialHeight: height, initialMinZoom: minZoom, initialMaxZoom: maxZoom, initialFitViewOptions: fitViewOptions, fitView, nodeOrigin, nodeExtent, children, }: ReactFlowProviderProps): import("react/jsx-runtime").JSX.Element; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/ReactFlowProvider/index.d.ts.map b/node_modules/@xyflow/react/dist/esm/components/ReactFlowProvider/index.d.ts.map new file mode 100644 index 0000000..74bf151 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/ReactFlowProvider/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ReactFlowProvider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAKjD,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE9D,MAAM,MAAM,sBAAsB,GAAG;IACnC,yEAAyE;IACzE,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;IACtB,yEAAyE;IACzE,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;IACtB,yEAAyE;IACzE,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;IACtB,yEAAyE;IACzE,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;IACtB,6EAA6E;IAC7E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,8EAA8E;IAC9E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,+FAA+F;IAC/F,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,qBAAqB,CAAC,EAAE,cAAc,CAAC;IACvC,iCAAiC;IACjC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iCAAiC;IACjC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;;;;OASG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,YAAY,EAAE,KAAK,EACnB,YAAY,EAAE,KAAK,EACnB,YAAY,EACZ,YAAY,EACZ,YAAY,EAAE,KAAK,EACnB,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,OAAO,EACvB,cAAc,EAAE,OAAO,EACvB,qBAAqB,EAAE,cAAc,EACrC,OAAO,EACP,UAAU,EACV,UAAU,EACV,QAAQ,GACT,EAAE,sBAAsB,2CAuBxB"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/SelectionListener/index.d.ts b/node_modules/@xyflow/react/dist/esm/components/SelectionListener/index.d.ts new file mode 100644 index 0000000..2eb1cb3 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/SelectionListener/index.d.ts @@ -0,0 +1,7 @@ +import type { OnSelectionChangeFunc, Node, Edge } from '../../types'; +type SelectionListenerProps = { + onSelectionChange?: OnSelectionChangeFunc; +}; +export declare function SelectionListener({ onSelectionChange, }: SelectionListenerProps): import("react/jsx-runtime").JSX.Element | null; +export {}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/SelectionListener/index.d.ts.map b/node_modules/@xyflow/react/dist/esm/components/SelectionListener/index.d.ts.map new file mode 100644 index 0000000..ff248c3 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/SelectionListener/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SelectionListener/index.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAkB,qBAAqB,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAErF,KAAK,sBAAsB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI;IACxF,iBAAiB,CAAC,EAAE,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;CAC/D,CAAC;AAkDF,wBAAgB,iBAAiB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,EAC5F,iBAAiB,GAClB,EAAE,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,CAAC,kDAQ5C"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/StoreUpdater/index.d.ts b/node_modules/@xyflow/react/dist/esm/components/StoreUpdater/index.d.ts new file mode 100644 index 0000000..c9f4914 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/StoreUpdater/index.d.ts @@ -0,0 +1,9 @@ +import type { Node, Edge, ReactFlowProps } from '../../types'; +declare const reactFlowFieldsToTrack: readonly ["nodes", "edges", "defaultNodes", "defaultEdges", "onConnect", "onConnectStart", "onConnectEnd", "onClickConnectStart", "onClickConnectEnd", "nodesDraggable", "autoPanOnNodeFocus", "nodesConnectable", "nodesFocusable", "edgesFocusable", "edgesReconnectable", "elevateNodesOnSelect", "elevateEdgesOnSelect", "minZoom", "maxZoom", "nodeExtent", "onNodesChange", "onEdgesChange", "elementsSelectable", "connectionMode", "snapGrid", "snapToGrid", "translateExtent", "connectOnClick", "defaultEdgeOptions", "fitView", "fitViewOptions", "onNodesDelete", "onEdgesDelete", "onDelete", "onNodeDrag", "onNodeDragStart", "onNodeDragStop", "onSelectionDrag", "onSelectionDragStart", "onSelectionDragStop", "onMoveStart", "onMove", "onMoveEnd", "noPanClassName", "nodeOrigin", "autoPanOnConnect", "autoPanOnNodeDrag", "onError", "connectionRadius", "isValidConnection", "selectNodesOnDrag", "nodeDragThreshold", "onBeforeDelete", "debug", "autoPanSpeed", "paneClickDistance", "ariaLabelConfig"]; +type ReactFlowFieldsToTrack = (typeof reactFlowFieldsToTrack)[number]; +type StoreUpdaterProps = Pick, ReactFlowFieldsToTrack> & { + rfId: string; +}; +export declare function StoreUpdater(props: StoreUpdaterProps): null; +export {}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/StoreUpdater/index.d.ts.map b/node_modules/@xyflow/react/dist/esm/components/StoreUpdater/index.d.ts.map new file mode 100644 index 0000000..d96502f --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/StoreUpdater/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/StoreUpdater/index.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAkB,cAAc,EAAkB,MAAM,aAAa,CAAC;AAI9F,QAAA,MAAM,sBAAsB,i+BA0DlB,CAAC;AAEX,KAAK,sBAAsB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AACtE,KAAK,iBAAiB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,IAAI,CACvF,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAClC,sBAAsB,CACvB,GAAG;IACF,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAiCF,wBAAgB,YAAY,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,EACrF,KAAK,EAAE,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,CAAC,QA6D7C"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/UserSelection/index.d.ts b/node_modules/@xyflow/react/dist/esm/components/UserSelection/index.d.ts new file mode 100644 index 0000000..51a455d --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/UserSelection/index.d.ts @@ -0,0 +1,2 @@ +export declare function UserSelection(): import("react/jsx-runtime").JSX.Element | null; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/UserSelection/index.d.ts.map b/node_modules/@xyflow/react/dist/esm/components/UserSelection/index.d.ts.map new file mode 100644 index 0000000..ee199d0 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/UserSelection/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/UserSelection/index.tsx"],"names":[],"mappings":"AAUA,wBAAgB,aAAa,mDAkB5B"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/ViewportPortal/index.d.ts b/node_modules/@xyflow/react/dist/esm/components/ViewportPortal/index.d.ts new file mode 100644 index 0000000..2702355 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/ViewportPortal/index.d.ts @@ -0,0 +1,30 @@ +import type { ReactNode } from 'react'; +/** + * The `` component can be used to add components to the same viewport + * of the flow where nodes and edges are rendered. This is useful when you want to render + * your own components that are adhere to the same coordinate system as the nodes & edges + * and are also affected by zooming and panning + * @public + * @example + * + * ```jsx + *import React from 'react'; + *import { ViewportPortal } from '@xyflow/react'; + * + *export default function () { + * return ( + * + *
+ * This div is positioned at [100, 100] on the flow. + *
+ *
+ * ); + *} + *``` + */ +export declare function ViewportPortal({ children }: { + children: ReactNode; +}): import("react").ReactPortal | null; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/components/ViewportPortal/index.d.ts.map b/node_modules/@xyflow/react/dist/esm/components/ViewportPortal/index.d.ts.map new file mode 100644 index 0000000..439da41 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/components/ViewportPortal/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ViewportPortal/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQvC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,sCAQnE"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/container/EdgeRenderer/MarkerDefinitions.d.ts b/node_modules/@xyflow/react/dist/esm/container/EdgeRenderer/MarkerDefinitions.d.ts new file mode 100644 index 0000000..88986cd --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/container/EdgeRenderer/MarkerDefinitions.d.ts @@ -0,0 +1,10 @@ +type MarkerDefinitionsProps = { + defaultColor: string; + rfId?: string; +}; +declare const _default: import("react").MemoExoticComponent<{ + ({ defaultColor, rfId }: MarkerDefinitionsProps): import("react/jsx-runtime").JSX.Element | null; + displayName: string; +}>; +export default _default; +//# sourceMappingURL=MarkerDefinitions.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/container/EdgeRenderer/MarkerDefinitions.d.ts.map b/node_modules/@xyflow/react/dist/esm/container/EdgeRenderer/MarkerDefinitions.d.ts.map new file mode 100644 index 0000000..94bed4a --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/container/EdgeRenderer/MarkerDefinitions.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MarkerDefinitions.d.ts","sourceRoot":"","sources":["../../../src/container/EdgeRenderer/MarkerDefinitions.tsx"],"names":[],"mappings":"AAMA,KAAK,sBAAsB,GAAG;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;;6BAwCiD,sBAAsB;;;AA0CzE,wBAAuC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/container/EdgeRenderer/MarkerSymbols.d.ts b/node_modules/@xyflow/react/dist/esm/container/EdgeRenderer/MarkerSymbols.d.ts new file mode 100644 index 0000000..07d19a9 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/container/EdgeRenderer/MarkerSymbols.d.ts @@ -0,0 +1,9 @@ +import { MarkerType, type EdgeMarker } from '@xyflow/system'; +type SymbolProps = Omit; +export declare const MarkerSymbols: { + arrow: ({ color, strokeWidth }: SymbolProps) => import("react/jsx-runtime").JSX.Element; + arrowclosed: ({ color, strokeWidth }: SymbolProps) => import("react/jsx-runtime").JSX.Element; +}; +export declare function useMarkerSymbol(type: MarkerType): (({ color, strokeWidth }: SymbolProps) => import("react/jsx-runtime").JSX.Element) | null; +export {}; +//# sourceMappingURL=MarkerSymbols.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/container/EdgeRenderer/MarkerSymbols.d.ts.map b/node_modules/@xyflow/react/dist/esm/container/EdgeRenderer/MarkerSymbols.d.ts.map new file mode 100644 index 0000000..9cdfd16 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/container/EdgeRenderer/MarkerSymbols.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MarkerSymbols.d.ts","sourceRoot":"","sources":["../../../src/container/EdgeRenderer/MarkerSymbols.tsx"],"names":[],"mappings":"AACA,OAAO,EAAiB,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAI5E,KAAK,WAAW,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;AAgC5C,eAAO,MAAM,aAAa;oCA9BgC,WAAW;0CAeL,WAAW;CAkB1E,CAAC;AAEF,wBAAgB,eAAe,CAAC,IAAI,EAAE,UAAU,6BAnCU,WAAW,qDAmDpE"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/container/EdgeRenderer/index.d.ts b/node_modules/@xyflow/react/dist/esm/container/EdgeRenderer/index.d.ts new file mode 100644 index 0000000..ee91865 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/container/EdgeRenderer/index.d.ts @@ -0,0 +1,13 @@ +import { ReactNode } from 'react'; +import { GraphViewProps } from '../GraphView'; +import type { Edge, Node } from '../../types'; +type EdgeRendererProps = Pick, 'onEdgeClick' | 'onEdgeDoubleClick' | 'defaultMarkerColor' | 'onlyRenderVisibleElements' | 'onReconnect' | 'onEdgeContextMenu' | 'onEdgeMouseEnter' | 'onEdgeMouseMove' | 'onEdgeMouseLeave' | 'onReconnectStart' | 'onReconnectEnd' | 'reconnectRadius' | 'noPanClassName' | 'rfId' | 'disableKeyboardA11y' | 'edgeTypes'> & { + children?: ReactNode; +}; +declare function EdgeRendererComponent({ defaultMarkerColor, onlyRenderVisibleElements, rfId, edgeTypes, noPanClassName, onReconnect, onEdgeContextMenu, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, onEdgeClick, reconnectRadius, onEdgeDoubleClick, onReconnectStart, onReconnectEnd, disableKeyboardA11y, }: EdgeRendererProps): import("react/jsx-runtime").JSX.Element; +declare namespace EdgeRendererComponent { + var displayName: string; +} +export declare const EdgeRenderer: typeof EdgeRendererComponent; +export {}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/container/EdgeRenderer/index.d.ts.map b/node_modules/@xyflow/react/dist/esm/container/EdgeRenderer/index.d.ts.map new file mode 100644 index 0000000..d3a1f62 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/container/EdgeRenderer/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/container/EdgeRenderer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,SAAS,EAAE,MAAM,OAAO,CAAC;AAMxC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EAAE,IAAI,EAAkB,IAAI,EAAE,MAAM,aAAa,CAAC;AAE9D,KAAK,iBAAiB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,IAAI,CACzD,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAC,EAC5B,aAAa,GACb,mBAAmB,GACnB,oBAAoB,GACpB,2BAA2B,GAC3B,aAAa,GACb,mBAAmB,GACnB,kBAAkB,GAClB,iBAAiB,GACjB,kBAAkB,GAClB,kBAAkB,GAClB,gBAAgB,GAChB,iBAAiB,GACjB,gBAAgB,GAChB,MAAM,GACN,qBAAqB,GACrB,WAAW,CACd,GAAG;IACF,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAUF,iBAAS,qBAAqB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,EAC3D,kBAAkB,EAClB,yBAAyB,EACzB,IAAI,EACJ,SAAS,EACT,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,mBAAmB,GACpB,EAAE,iBAAiB,CAAC,QAAQ,CAAC,2CAoC7B;kBArDQ,qBAAqB;;;AAyD9B,eAAO,MAAM,YAAY,EAAkC,OAAO,qBAAqB,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/container/FlowRenderer/index.d.ts b/node_modules/@xyflow/react/dist/esm/container/FlowRenderer/index.d.ts new file mode 100644 index 0000000..655c5a3 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/container/FlowRenderer/index.d.ts @@ -0,0 +1,14 @@ +import { type ReactNode } from 'react'; +import { GraphViewProps } from '../GraphView'; +import type { Node } from '../../types'; +export type FlowRendererProps = Omit, 'snapToGrid' | 'nodeTypes' | 'edgeTypes' | 'snapGrid' | 'connectionLineType' | 'connectionLineContainerStyle' | 'arrowHeadColor' | 'onlyRenderVisibleElements' | 'selectNodesOnDrag' | 'defaultMarkerColor' | 'rfId' | 'nodeClickDistance'> & { + isControlledViewport: boolean; + children: ReactNode; +}; +declare function FlowRendererComponent({ children, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneContextMenu, onPaneScroll, paneClickDistance, deleteKeyCode, selectionKeyCode, selectionOnDrag, selectionMode, onSelectionStart, onSelectionEnd, multiSelectionKeyCode, panActivationKeyCode, zoomActivationKeyCode, elementsSelectable, zoomOnScroll, zoomOnPinch, panOnScroll: _panOnScroll, panOnScrollSpeed, panOnScrollMode, zoomOnDoubleClick, panOnDrag: _panOnDrag, defaultViewport, translateExtent, minZoom, maxZoom, preventScrolling, onSelectionContextMenu, noWheelClassName, noPanClassName, disableKeyboardA11y, onViewportChange, isControlledViewport, }: FlowRendererProps): import("react/jsx-runtime").JSX.Element; +declare namespace FlowRendererComponent { + var displayName: string; +} +export declare const FlowRenderer: typeof FlowRendererComponent; +export {}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/container/FlowRenderer/index.d.ts.map b/node_modules/@xyflow/react/dist/esm/container/FlowRenderer/index.d.ts.map new file mode 100644 index 0000000..1ee1826 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/container/FlowRenderer/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/container/FlowRenderer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAK7C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAI9C,OAAO,KAAK,EAAkB,IAAI,EAAE,MAAM,aAAa,CAAC;AAExD,MAAM,MAAM,iBAAiB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,IAAI,CAChE,cAAc,CAAC,QAAQ,CAAC,EACtB,YAAY,GACZ,WAAW,GACX,WAAW,GACX,UAAU,GACV,oBAAoB,GACpB,8BAA8B,GAC9B,gBAAgB,GAChB,2BAA2B,GAC3B,mBAAmB,GACnB,oBAAoB,GACpB,MAAM,GACN,mBAAmB,CACtB,GAAG;IACF,oBAAoB,EAAE,OAAO,CAAC;IAC9B,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAQF,iBAAS,qBAAqB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,EAC3D,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,YAAY,EACZ,WAAW,EACX,WAAW,EAAE,YAAY,EACzB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,SAAS,EAAE,UAAU,EACrB,eAAe,EACf,eAAe,EACf,OAAO,EACP,OAAO,EACP,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,GACrB,EAAE,iBAAiB,CAAC,QAAQ,CAAC,2CA6D7B;kBAlGQ,qBAAqB;;;AAsG9B,eAAO,MAAM,YAAY,EAAkC,OAAO,qBAAqB,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/container/GraphView/index.d.ts b/node_modules/@xyflow/react/dist/esm/container/GraphView/index.d.ts new file mode 100644 index 0000000..9b1cd31 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/container/GraphView/index.d.ts @@ -0,0 +1,11 @@ +import type { Edge, Node, ReactFlowProps } from '../../types'; +export type GraphViewProps = Omit, 'onSelectionChange' | 'nodes' | 'edges' | 'onMove' | 'onMoveStart' | 'onMoveEnd' | 'elevateEdgesOnSelect'> & Required, 'selectionKeyCode' | 'deleteKeyCode' | 'multiSelectionKeyCode' | 'connectionLineType' | 'onlyRenderVisibleElements' | 'translateExtent' | 'minZoom' | 'maxZoom' | 'defaultMarkerColor' | 'noDragClassName' | 'noWheelClassName' | 'noPanClassName' | 'defaultViewport' | 'disableKeyboardA11y' | 'paneClickDistance' | 'nodeClickDistance'>> & { + rfId: string; +}; +declare function GraphViewComponent({ nodeTypes, edgeTypes, onInit, onNodeClick, onEdgeClick, onNodeDoubleClick, onEdgeDoubleClick, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave, onNodeContextMenu, onSelectionContextMenu, onSelectionStart, onSelectionEnd, connectionLineType, connectionLineStyle, connectionLineComponent, connectionLineContainerStyle, selectionKeyCode, selectionOnDrag, selectionMode, multiSelectionKeyCode, panActivationKeyCode, zoomActivationKeyCode, deleteKeyCode, onlyRenderVisibleElements, elementsSelectable, defaultViewport, translateExtent, minZoom, maxZoom, preventScrolling, defaultMarkerColor, zoomOnScroll, zoomOnPinch, panOnScroll, panOnScrollSpeed, panOnScrollMode, zoomOnDoubleClick, panOnDrag, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneScroll, onPaneContextMenu, paneClickDistance, nodeClickDistance, onEdgeContextMenu, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, reconnectRadius, onReconnect, onReconnectStart, onReconnectEnd, noDragClassName, noWheelClassName, noPanClassName, disableKeyboardA11y, nodeExtent, rfId, viewport, onViewportChange, }: GraphViewProps): import("react/jsx-runtime").JSX.Element; +declare namespace GraphViewComponent { + var displayName: string; +} +export declare const GraphView: typeof GraphViewComponent; +export {}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/container/GraphView/index.d.ts.map b/node_modules/@xyflow/react/dist/esm/container/GraphView/index.d.ts.map new file mode 100644 index 0000000..f94f3ab --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/container/GraphView/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/container/GraphView/index.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG9D,MAAM,MAAM,cAAc,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,IAAI,CAC3F,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAClC,mBAAmB,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,aAAa,GAAG,WAAW,GAAG,sBAAsB,CAC1G,GACC,QAAQ,CACN,IAAI,CACF,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAChC,kBAAkB,GAClB,eAAe,GACf,uBAAuB,GACvB,oBAAoB,GACpB,2BAA2B,GAC3B,iBAAiB,GACjB,SAAS,GACT,SAAS,GACT,oBAAoB,GACpB,iBAAiB,GACjB,kBAAkB,GAClB,gBAAgB,GAChB,iBAAiB,GACjB,qBAAqB,GACrB,mBAAmB,GACnB,mBAAmB,CACtB,CACF,GAAG;IACF,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEJ,iBAAS,kBAAkB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,EACtF,SAAS,EACT,SAAS,EACT,MAAM,EACN,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,4BAA4B,EAC5B,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,aAAa,EACb,yBAAyB,EACzB,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,OAAO,EACP,OAAO,EACP,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,gBAAgB,GACjB,EAAE,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,2CA6FpC;kBA9JQ,kBAAkB;;;AAkK3B,eAAO,MAAM,SAAS,EAA+B,OAAO,kBAAkB,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/container/GraphView/useNodeOrEdgeTypesWarning.d.ts b/node_modules/@xyflow/react/dist/esm/container/GraphView/useNodeOrEdgeTypesWarning.d.ts new file mode 100644 index 0000000..601d170 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/container/GraphView/useNodeOrEdgeTypesWarning.d.ts @@ -0,0 +1,10 @@ +import type { EdgeTypes, NodeTypes } from '../../types'; +/** + * This hook warns the user if nodeTypes or edgeTypes changed. + * It is only used in development mode. + * + * @internal + */ +export declare function useNodeOrEdgeTypesWarning(nodeOrEdgeTypes?: NodeTypes): void; +export declare function useNodeOrEdgeTypesWarning(nodeOrEdgeTypes?: EdgeTypes): void; +//# sourceMappingURL=useNodeOrEdgeTypesWarning.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/container/GraphView/useNodeOrEdgeTypesWarning.d.ts.map b/node_modules/@xyflow/react/dist/esm/container/GraphView/useNodeOrEdgeTypesWarning.d.ts.map new file mode 100644 index 0000000..52c6320 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/container/GraphView/useNodeOrEdgeTypesWarning.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useNodeOrEdgeTypesWarning.d.ts","sourceRoot":"","sources":["../../../src/container/GraphView/useNodeOrEdgeTypesWarning.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAIxD;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,eAAe,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;AAC7E,wBAAgB,yBAAyB,CAAC,eAAe,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/container/GraphView/useStylesLoadedWarning.d.ts b/node_modules/@xyflow/react/dist/esm/container/GraphView/useStylesLoadedWarning.d.ts new file mode 100644 index 0000000..736e3be --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/container/GraphView/useStylesLoadedWarning.d.ts @@ -0,0 +1,2 @@ +export declare function useStylesLoadedWarning(): void; +//# sourceMappingURL=useStylesLoadedWarning.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/container/GraphView/useStylesLoadedWarning.d.ts.map b/node_modules/@xyflow/react/dist/esm/container/GraphView/useStylesLoadedWarning.d.ts.map new file mode 100644 index 0000000..f7c8afb --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/container/GraphView/useStylesLoadedWarning.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useStylesLoadedWarning.d.ts","sourceRoot":"","sources":["../../../src/container/GraphView/useStylesLoadedWarning.ts"],"names":[],"mappings":"AAKA,wBAAgB,sBAAsB,SAiBrC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/container/NodeRenderer/index.d.ts b/node_modules/@xyflow/react/dist/esm/container/NodeRenderer/index.d.ts new file mode 100644 index 0000000..3686e1e --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/container/NodeRenderer/index.d.ts @@ -0,0 +1,10 @@ +import { GraphViewProps } from '../GraphView'; +import type { Node } from '../../types'; +export type NodeRendererProps = Pick, 'onNodeClick' | 'onNodeDoubleClick' | 'onNodeMouseEnter' | 'onNodeMouseMove' | 'onNodeMouseLeave' | 'onNodeContextMenu' | 'onlyRenderVisibleElements' | 'noPanClassName' | 'noDragClassName' | 'rfId' | 'disableKeyboardA11y' | 'nodeExtent' | 'nodeTypes' | 'nodeClickDistance'>; +declare function NodeRendererComponent(props: NodeRendererProps): import("react/jsx-runtime").JSX.Element; +declare namespace NodeRendererComponent { + var displayName: string; +} +export declare const NodeRenderer: typeof NodeRendererComponent; +export {}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/container/NodeRenderer/index.d.ts.map b/node_modules/@xyflow/react/dist/esm/container/NodeRenderer/index.d.ts.map new file mode 100644 index 0000000..4f5f0e3 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/container/NodeRenderer/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/container/NodeRenderer/index.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAG9C,OAAO,KAAK,EAAE,IAAI,EAAkB,MAAM,aAAa,CAAC;AAExD,MAAM,MAAM,iBAAiB,CAAC,QAAQ,SAAS,IAAI,IAAI,IAAI,CACzD,cAAc,CAAC,QAAQ,CAAC,EACtB,aAAa,GACb,mBAAmB,GACnB,kBAAkB,GAClB,iBAAiB,GACjB,kBAAkB,GAClB,mBAAmB,GACnB,2BAA2B,GAC3B,gBAAgB,GAChB,iBAAiB,GACjB,MAAM,GACN,qBAAqB,GACrB,YAAY,GACZ,WAAW,GACX,mBAAmB,CACtB,CAAC;AAUF,iBAAS,qBAAqB,CAAC,QAAQ,SAAS,IAAI,EAAE,KAAK,EAAE,iBAAiB,CAAC,QAAQ,CAAC,2CA6DvF;kBA7DQ,qBAAqB;;;AAiE9B,eAAO,MAAM,YAAY,EAAkC,OAAO,qBAAqB,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/container/NodeRenderer/useResizeObserver.d.ts b/node_modules/@xyflow/react/dist/esm/container/NodeRenderer/useResizeObserver.d.ts new file mode 100644 index 0000000..cfb3b54 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/container/NodeRenderer/useResizeObserver.d.ts @@ -0,0 +1,2 @@ +export declare function useResizeObserver(): ResizeObserver | null; +//# sourceMappingURL=useResizeObserver.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/container/NodeRenderer/useResizeObserver.d.ts.map b/node_modules/@xyflow/react/dist/esm/container/NodeRenderer/useResizeObserver.d.ts.map new file mode 100644 index 0000000..7fbcf4e --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/container/NodeRenderer/useResizeObserver.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useResizeObserver.d.ts","sourceRoot":"","sources":["../../../src/container/NodeRenderer/useResizeObserver.ts"],"names":[],"mappings":"AAQA,wBAAgB,iBAAiB,0BA6BhC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/container/Pane/index.d.ts b/node_modules/@xyflow/react/dist/esm/container/Pane/index.d.ts new file mode 100644 index 0000000..1b42e6f --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/container/Pane/index.d.ts @@ -0,0 +1,13 @@ +/** + * The user selection rectangle gets displayed when a user drags the mouse while pressing shift + */ +import { type ReactNode } from 'react'; +import type { ReactFlowProps } from '../../types'; +type PaneProps = { + isSelecting: boolean; + selectionKeyPressed: boolean; + children: ReactNode; +} & Partial>; +export declare function Pane({ isSelecting, selectionKeyPressed, selectionMode, panOnDrag, selectionOnDrag, onSelectionStart, onSelectionEnd, onPaneClick, onPaneContextMenu, onPaneScroll, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, children, }: PaneProps): import("react/jsx-runtime").JSX.Element; +export {}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/container/Pane/index.d.ts.map b/node_modules/@xyflow/react/dist/esm/container/Pane/index.d.ts.map new file mode 100644 index 0000000..cc5a9c6 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/container/Pane/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/container/Pane/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAIL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAgBf,OAAO,KAAK,EAAE,cAAc,EAAkB,MAAM,aAAa,CAAC;AAElE,KAAK,SAAS,GAAG;IACf,WAAW,EAAE,OAAO,CAAC;IACrB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,OAAO,CACT,IAAI,CACF,cAAc,EACZ,eAAe,GACf,WAAW,GACX,kBAAkB,GAClB,gBAAgB,GAChB,aAAa,GACb,mBAAmB,GACnB,cAAc,GACd,kBAAkB,GAClB,iBAAiB,GACjB,kBAAkB,GAClB,iBAAiB,CACpB,CACF,CAAC;AAqBF,wBAAgB,IAAI,CAAC,EACnB,WAAW,EACX,mBAAmB,EACnB,aAAkC,EAClC,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,QAAQ,GACT,EAAE,SAAS,2CAyMX"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/container/ReactFlow/Wrapper.d.ts b/node_modules/@xyflow/react/dist/esm/container/ReactFlow/Wrapper.d.ts new file mode 100644 index 0000000..f00aeeb --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/container/ReactFlow/Wrapper.d.ts @@ -0,0 +1,19 @@ +import { type ReactNode } from 'react'; +import type { Node, Edge, FitViewOptions } from '../../types'; +import { CoordinateExtent, NodeOrigin } from '@xyflow/system'; +export declare function Wrapper({ children, nodes, edges, defaultNodes, defaultEdges, width, height, fitView, fitViewOptions, minZoom, maxZoom, nodeOrigin, nodeExtent, }: { + children: ReactNode; + nodes?: Node[]; + edges?: Edge[]; + defaultNodes?: Node[]; + defaultEdges?: Edge[]; + width?: number; + height?: number; + fitView?: boolean; + fitViewOptions?: FitViewOptions; + minZoom?: number; + maxZoom?: number; + nodeOrigin?: NodeOrigin; + nodeExtent?: CoordinateExtent; +}): import("react/jsx-runtime").JSX.Element; +//# sourceMappingURL=Wrapper.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/container/ReactFlow/Wrapper.d.ts.map b/node_modules/@xyflow/react/dist/esm/container/ReactFlow/Wrapper.d.ts.map new file mode 100644 index 0000000..cfae5bc --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/container/ReactFlow/Wrapper.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Wrapper.d.ts","sourceRoot":"","sources":["../../../src/container/ReactFlow/Wrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAInD,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE9D,wBAAgB,OAAO,CAAC,EACtB,QAAQ,EACR,KAAK,EACL,KAAK,EACL,YAAY,EACZ,YAAY,EACZ,KAAK,EACL,MAAM,EACN,OAAO,EACP,cAAc,EACd,OAAO,EACP,OAAO,EACP,UAAU,EACV,UAAU,GACX,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;IACtB,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,UAAU,CAAC,EAAE,gBAAgB,CAAC;CAC/B,2CA6BA"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/container/ReactFlow/index.d.ts b/node_modules/@xyflow/react/dist/esm/container/ReactFlow/index.d.ts new file mode 100644 index 0000000..3c796a9 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/container/ReactFlow/index.d.ts @@ -0,0 +1,24 @@ +import type { Edge, Node, ReactFlowProps } from '../../types'; +/** + * The `` component is the heart of your React Flow application. + * It renders your nodes and edges and handles user interaction + * + * @public + * + * @example + * ```tsx + *import { ReactFlow } from '@xyflow/react' + * + *export default function Flow() { + * return (); + *} + *``` + */ +declare const _default: (props: ReactFlowProps & import("react").RefAttributes) => import("react").JSX.Element; +export default _default; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/container/ReactFlow/index.d.ts.map b/node_modules/@xyflow/react/dist/esm/container/ReactFlow/index.d.ts.map new file mode 100644 index 0000000..e45fb7c --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/container/ReactFlow/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/container/ReactFlow/index.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAuT9D;;;;;;;;;;;;;;;;;;;GAmBG;yBA9TgB,QAAQ,SAAS,IAAI,SAAS,QAAQ,SAAS,IAAI;AA+TtE,wBAA0C"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/container/ReactFlow/init-values.d.ts b/node_modules/@xyflow/react/dist/esm/container/ReactFlow/init-values.d.ts new file mode 100644 index 0000000..683999a --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/container/ReactFlow/init-values.d.ts @@ -0,0 +1,4 @@ +import { type NodeOrigin, Viewport } from '@xyflow/system'; +export declare const defaultNodeOrigin: NodeOrigin; +export declare const defaultViewport: Viewport; +//# sourceMappingURL=init-values.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/container/ReactFlow/init-values.d.ts.map b/node_modules/@xyflow/react/dist/esm/container/ReactFlow/init-values.d.ts.map new file mode 100644 index 0000000..4f68c0a --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/container/ReactFlow/init-values.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"init-values.d.ts","sourceRoot":"","sources":["../../../src/container/ReactFlow/init-values.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE3D,eAAO,MAAM,iBAAiB,EAAE,UAAmB,CAAC;AACpD,eAAO,MAAM,eAAe,EAAE,QAAkC,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/container/Viewport/index.d.ts b/node_modules/@xyflow/react/dist/esm/container/Viewport/index.d.ts new file mode 100644 index 0000000..e0d0cec --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/container/Viewport/index.d.ts @@ -0,0 +1,7 @@ +import type { ReactNode } from 'react'; +type ViewportProps = { + children: ReactNode; +}; +export declare function Viewport({ children }: ViewportProps): import("react/jsx-runtime").JSX.Element; +export {}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/container/Viewport/index.d.ts.map b/node_modules/@xyflow/react/dist/esm/container/Viewport/index.d.ts.map new file mode 100644 index 0000000..79d6f12 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/container/Viewport/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/container/Viewport/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOvC,KAAK,aAAa,GAAG;IACnB,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,EAAE,aAAa,2CAQnD"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/container/ZoomPane/index.d.ts b/node_modules/@xyflow/react/dist/esm/container/ZoomPane/index.d.ts new file mode 100644 index 0000000..ca8edb4 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/container/ZoomPane/index.d.ts @@ -0,0 +1,7 @@ +import type { FlowRendererProps } from '../FlowRenderer'; +type ZoomPaneProps = Omit & { + isControlledViewport: boolean; +}; +export declare function ZoomPane({ onPaneContextMenu, zoomOnScroll, zoomOnPinch, panOnScroll, panOnScrollSpeed, panOnScrollMode, zoomOnDoubleClick, panOnDrag, defaultViewport, translateExtent, minZoom, maxZoom, zoomActivationKeyCode, preventScrolling, children, noWheelClassName, noPanClassName, onViewportChange, isControlledViewport, paneClickDistance, }: ZoomPaneProps): import("react/jsx-runtime").JSX.Element; +export {}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/container/ZoomPane/index.d.ts.map b/node_modules/@xyflow/react/dist/esm/container/ZoomPane/index.d.ts.map new file mode 100644 index 0000000..6674f9b --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/container/ZoomPane/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/container/ZoomPane/index.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGzD,KAAK,aAAa,GAAG,IAAI,CACvB,iBAAiB,EACf,eAAe,GACf,kBAAkB,GAClB,uBAAuB,GACvB,iBAAiB,GACjB,qBAAqB,GACrB,iBAAiB,CACpB,GAAG;IACF,oBAAoB,EAAE,OAAO,CAAC;CAC/B,CAAC;AAOF,wBAAgB,QAAQ,CAAC,EACvB,iBAAiB,EACjB,YAAmB,EACnB,WAAkB,EAClB,WAAmB,EACnB,gBAAsB,EACtB,eAAsC,EACtC,iBAAwB,EACxB,SAAgB,EAChB,eAAe,EACf,eAAe,EACf,OAAO,EACP,OAAO,EACP,qBAAqB,EACrB,gBAAuB,EACvB,QAAQ,EACR,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,GAClB,EAAE,aAAa,2CAsGf"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/contexts/NodeIdContext.d.ts b/node_modules/@xyflow/react/dist/esm/contexts/NodeIdContext.d.ts new file mode 100644 index 0000000..516f33a --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/contexts/NodeIdContext.d.ts @@ -0,0 +1,34 @@ +export declare const NodeIdContext: import("react").Context; +export declare const Provider: import("react").Provider; +export declare const Consumer: import("react").Consumer; +/** + * You can use this hook to get the id of the node it is used inside. It is useful + * if you need the node's id deeper in the render tree but don't want to manually + * drill down the id as a prop. + * + * @public + * @returns The id for a node in the flow. + * + * @example + *```jsx + *import { useNodeId } from '@xyflow/react'; + * + *export default function CustomNode() { + * return ( + *
+ * This node has an id of + * + *
+ * ); + *} + * + *function NodeIdDisplay() { + * const nodeId = useNodeId(); + * + * return {nodeId}; + *} + *``` + */ +export declare const useNodeId: () => string | null; +export default NodeIdContext; +//# sourceMappingURL=NodeIdContext.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/contexts/NodeIdContext.d.ts.map b/node_modules/@xyflow/react/dist/esm/contexts/NodeIdContext.d.ts.map new file mode 100644 index 0000000..5118ac8 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/contexts/NodeIdContext.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"NodeIdContext.d.ts","sourceRoot":"","sources":["../../src/contexts/NodeIdContext.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,wCAAqC,CAAC;AAChE,eAAO,MAAM,QAAQ,yCAAyB,CAAC;AAC/C,eAAO,MAAM,QAAQ,yCAAyB,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,SAAS,QAAO,MAAM,GAAG,IAGrC,CAAC;AAEF,eAAe,aAAa,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/contexts/StoreContext.d.ts b/node_modules/@xyflow/react/dist/esm/contexts/StoreContext.d.ts new file mode 100644 index 0000000..f83f503 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/contexts/StoreContext.d.ts @@ -0,0 +1,4 @@ +declare const StoreContext: import("react").Context> | null>; +export declare const Provider: import("react").Provider> | null>; +export default StoreContext; +//# sourceMappingURL=StoreContext.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/contexts/StoreContext.d.ts.map b/node_modules/@xyflow/react/dist/esm/contexts/StoreContext.d.ts.map new file mode 100644 index 0000000..8ad90d4 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/contexts/StoreContext.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"StoreContext.d.ts","sourceRoot":"","sources":["../../src/contexts/StoreContext.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,YAAY,oJAA6D,CAAC;AAEhF,eAAO,MAAM,QAAQ,qJAAwB,CAAC;AAC9C,eAAe,YAAY,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useColorModeClass.d.ts b/node_modules/@xyflow/react/dist/esm/hooks/useColorModeClass.d.ts new file mode 100644 index 0000000..7053d2c --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useColorModeClass.d.ts @@ -0,0 +1,9 @@ +import type { ColorMode, ColorModeClass } from '@xyflow/system'; +/** + * Hook for receiving the current color mode class 'dark' or 'light'. + * + * @internal + * @param colorMode - The color mode to use ('dark', 'light' or 'system') + */ +export declare function useColorModeClass(colorMode: ColorMode): ColorModeClass; +//# sourceMappingURL=useColorModeClass.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useColorModeClass.d.ts.map b/node_modules/@xyflow/react/dist/esm/hooks/useColorModeClass.d.ts.map new file mode 100644 index 0000000..630898f --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useColorModeClass.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useColorModeClass.d.ts","sourceRoot":"","sources":["../../src/hooks/useColorModeClass.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAUhE;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,GAAG,cAAc,CAuBtE"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useConnection.d.ts b/node_modules/@xyflow/react/dist/esm/hooks/useConnection.d.ts new file mode 100644 index 0000000..13d3f7c --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useConnection.d.ts @@ -0,0 +1,33 @@ +import { ConnectionState } from '@xyflow/system'; +import type { InternalNode, Node } from '../types'; +/** + * The `useConnection` hook returns the current connection when there is an active + * connection interaction. If no connection interaction is active, it returns null + * for every property. A typical use case for this hook is to colorize handles + * based on a certain condition (e.g. if the connection is valid or not). + * + * @public + * @param connectionSelector - An optional selector function used to extract a slice of the + * `ConnectionState` data. Using a selector can prevent component re-renders where data you don't + * otherwise care about might change. If a selector is not provided, the entire `ConnectionState` + * object is returned unchanged. + * @example + * + * ```tsx + *import { useConnection } from '@xyflow/react'; + * + *function App() { + * const connection = useConnection(); + * + * return ( + *
{connection ? `Someone is trying to make a connection from ${connection.fromNode} to this one.` : 'There are currently no incoming connections!'} + * + *
+ * ); + * } + * ``` + * + * @returns ConnectionState + */ +export declare function useConnection>>(connectionSelector?: (connection: ConnectionState>) => SelectorReturn): SelectorReturn; +//# sourceMappingURL=useConnection.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useConnection.d.ts.map b/node_modules/@xyflow/react/dist/esm/hooks/useConnection.d.ts.map new file mode 100644 index 0000000..4e00752 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useConnection.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useConnection.d.ts","sourceRoot":"","sources":["../../src/hooks/useConnection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAwB,MAAM,gBAAgB,CAAC;AAGvE,OAAO,KAAK,EAAE,YAAY,EAAE,IAAI,EAAkB,MAAM,UAAU,CAAC;AAqBnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,aAAa,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,cAAc,GAAG,eAAe,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,EAClH,kBAAkB,CAAC,EAAE,CAAC,UAAU,EAAE,eAAe,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,KAAK,cAAc,GAC3F,cAAc,CAGhB"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useDrag.d.ts b/node_modules/@xyflow/react/dist/esm/hooks/useDrag.d.ts new file mode 100644 index 0000000..dc85f00 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useDrag.d.ts @@ -0,0 +1,18 @@ +import { type RefObject } from 'react'; +type UseDragParams = { + nodeRef: RefObject; + disabled?: boolean; + noDragClassName?: string; + handleSelector?: string; + nodeId?: string; + isSelectable?: boolean; + nodeClickDistance?: number; +}; +/** + * Hook for calling XYDrag helper from @xyflow/system. + * + * @internal + */ +export declare function useDrag({ nodeRef, disabled, noDragClassName, handleSelector, nodeId, isSelectable, nodeClickDistance, }: UseDragParams): boolean; +export {}; +//# sourceMappingURL=useDrag.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useDrag.d.ts.map b/node_modules/@xyflow/react/dist/esm/hooks/useDrag.d.ts.map new file mode 100644 index 0000000..3b42f97 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useDrag.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useDrag.d.ts","sourceRoot":"","sources":["../../src/hooks/useDrag.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAMpE,KAAK,aAAa,GAAG;IACnB,OAAO,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,EACtB,OAAO,EACP,QAAgB,EAChB,eAAe,EACf,cAAc,EACd,MAAM,EACN,YAAY,EACZ,iBAAiB,GAClB,EAAE,aAAa,WA2Cf"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useEdges.d.ts b/node_modules/@xyflow/react/dist/esm/hooks/useEdges.d.ts new file mode 100644 index 0000000..dd8579f --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useEdges.d.ts @@ -0,0 +1,21 @@ +import type { Edge } from '../types'; +/** + * This hook returns an array of the current edges. Components that use this hook + * will re-render **whenever any edge changes**. + * + * @public + * @returns An array of all edges currently in the flow. + * + * @example + * ```tsx + *import { useEdges } from '@xyflow/react'; + * + *export default function () { + * const edges = useEdges(); + * + * return
There are currently {edges.length} edges!
; + *} + *``` + */ +export declare function useEdges(): EdgeType[]; +//# sourceMappingURL=useEdges.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useEdges.d.ts.map b/node_modules/@xyflow/react/dist/esm/hooks/useEdges.d.ts.map new file mode 100644 index 0000000..914f004 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useEdges.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useEdges.d.ts","sourceRoot":"","sources":["../../src/hooks/useEdges.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAkB,MAAM,UAAU,CAAC;AAIrD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,EAAE,CAInE"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useGlobalKeyHandler.d.ts b/node_modules/@xyflow/react/dist/esm/hooks/useGlobalKeyHandler.d.ts new file mode 100644 index 0000000..619d3e3 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useGlobalKeyHandler.d.ts @@ -0,0 +1,11 @@ +import type { KeyCode } from '@xyflow/system'; +/** + * Hook for handling global key events. + * + * @internal + */ +export declare function useGlobalKeyHandler({ deleteKeyCode, multiSelectionKeyCode, }: { + deleteKeyCode: KeyCode | null; + multiSelectionKeyCode: KeyCode | null; +}): void; +//# sourceMappingURL=useGlobalKeyHandler.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useGlobalKeyHandler.d.ts.map b/node_modules/@xyflow/react/dist/esm/hooks/useGlobalKeyHandler.d.ts.map new file mode 100644 index 0000000..573f15b --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useGlobalKeyHandler.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useGlobalKeyHandler.d.ts","sourceRoot":"","sources":["../../src/hooks/useGlobalKeyHandler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAW9C;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,aAAa,EACb,qBAAqB,GACtB,EAAE;IACD,aAAa,EAAE,OAAO,GAAG,IAAI,CAAC;IAC9B,qBAAqB,EAAE,OAAO,GAAG,IAAI,CAAC;CACvC,GAAG,IAAI,CAkBP"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useHandleConnections.d.ts b/node_modules/@xyflow/react/dist/esm/hooks/useHandleConnections.d.ts new file mode 100644 index 0000000..33231ca --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useHandleConnections.d.ts @@ -0,0 +1,23 @@ +import { Connection, HandleConnection, HandleType } from '@xyflow/system'; +type UseHandleConnectionsParams = { + /** What type of handle connections do you want to observe? */ + type: HandleType; + /** The handle id (this is only needed if the node has multiple handles of the same type). */ + id?: string | null; + /** If node id is not provided, the node id from the `NodeIdContext` is used. */ + nodeId?: string; + /** Gets called when a connection is established. */ + onConnect?: (connections: Connection[]) => void; + /** Gets called when a connection is removed. */ + onDisconnect?: (connections: Connection[]) => void; +}; +/** + * Hook to check if a is connected to another and get the connections. + * + * @public + * @deprecated Use `useNodeConnections` instead. + * @returns An array with handle connections. + */ +export declare function useHandleConnections({ type, id, nodeId, onConnect, onDisconnect, }: UseHandleConnectionsParams): HandleConnection[]; +export {}; +//# sourceMappingURL=useHandleConnections.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useHandleConnections.d.ts.map b/node_modules/@xyflow/react/dist/esm/hooks/useHandleConnections.d.ts.map new file mode 100644 index 0000000..43d849a --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useHandleConnections.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useHandleConnections.d.ts","sourceRoot":"","sources":["../../src/hooks/useHandleConnections.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,UAAU,EAGX,MAAM,gBAAgB,CAAC;AAKxB,KAAK,0BAA0B,GAAG;IAChC,8DAA8D;IAC9D,IAAI,EAAE,UAAU,CAAC;IACjB,6FAA6F;IAC7F,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,gFAAgF;IAChF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oDAAoD;IACpD,SAAS,CAAC,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;IAChD,gDAAgD;IAChD,YAAY,CAAC,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;CACpD,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,IAAI,EACJ,EAAE,EACF,MAAM,EACN,SAAS,EACT,YAAY,GACb,EAAE,0BAA0B,GAAG,gBAAgB,EAAE,CA2BjD"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useInternalNode.d.ts b/node_modules/@xyflow/react/dist/esm/hooks/useInternalNode.d.ts new file mode 100644 index 0000000..f661522 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useInternalNode.d.ts @@ -0,0 +1,30 @@ +import type { InternalNode, Node } from '../types'; +/** + * This hook returns the internal representation of a specific node. + * Components that use this hook will re-render **whenever the node changes**, + * including when a node is selected or moved. + * + * @public + * @param id - The ID of a node you want to observe. + * @returns The `InternalNode` object for the node with the given ID. + * + * @example + * ```tsx + *import { useInternalNode } from '@xyflow/react'; + * + *export default function () { + * const internalNode = useInternalNode('node-1'); + * const absolutePosition = internalNode.internals.positionAbsolute; + * + * return ( + *
+ * The absolute position of the node is at: + *

x: {absolutePosition.x}

+ *

y: {absolutePosition.y}

+ *
+ * ); + *} + *``` + */ +export declare function useInternalNode(id: string): InternalNode | undefined; +//# sourceMappingURL=useInternalNode.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useInternalNode.d.ts.map b/node_modules/@xyflow/react/dist/esm/hooks/useInternalNode.d.ts.map new file mode 100644 index 0000000..4688719 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useInternalNode.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useInternalNode.d.ts","sourceRoot":"","sources":["../../src/hooks/useInternalNode.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,eAAe,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,EAAE,EAAE,MAAM,GAAG,YAAY,CAAC,QAAQ,CAAC,GAAG,SAAS,CAO5G"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useIsomorphicLayoutEffect.d.ts b/node_modules/@xyflow/react/dist/esm/hooks/useIsomorphicLayoutEffect.d.ts new file mode 100644 index 0000000..5c1131b --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useIsomorphicLayoutEffect.d.ts @@ -0,0 +1,3 @@ +import { useEffect } from 'react'; +export declare const useIsomorphicLayoutEffect: typeof useEffect; +//# sourceMappingURL=useIsomorphicLayoutEffect.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useIsomorphicLayoutEffect.d.ts.map b/node_modules/@xyflow/react/dist/esm/hooks/useIsomorphicLayoutEffect.d.ts.map new file mode 100644 index 0000000..073e997 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useIsomorphicLayoutEffect.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useIsomorphicLayoutEffect.d.ts","sourceRoot":"","sources":["../../src/hooks/useIsomorphicLayoutEffect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmB,MAAM,OAAO,CAAC;AAGnD,eAAO,MAAM,yBAAyB,kBAA8D,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useKeyPress.d.ts b/node_modules/@xyflow/react/dist/esm/hooks/useKeyPress.d.ts new file mode 100644 index 0000000..63cd825 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useKeyPress.d.ts @@ -0,0 +1,53 @@ +import { type KeyCode } from '@xyflow/system'; +export type UseKeyPressOptions = { + /** + * Listen to key presses on a specific element. + * @default document + */ + target?: Window | Document | HTMLElement | ShadowRoot | null; + /** + * You can use this flag to prevent triggering the key press hook when an input field is focused. + * @default true + */ + actInsideInputWithModifier?: boolean; + preventDefault?: boolean; +}; +/** + * This hook lets you listen for specific key codes and tells you whether they are + * currently pressed or not. + * + * @public + * @param options - Options + * + * @example + * ```tsx + *import { useKeyPress } from '@xyflow/react'; + * + *export default function () { + * const spacePressed = useKeyPress('Space'); + * const cmdAndSPressed = useKeyPress(['Meta+s', 'Strg+s']); + * + * return ( + *
+ * {spacePressed &&

Space pressed!

} + * {cmdAndSPressed &&

Cmd + S pressed!

} + *
+ * ); + *} + *``` + */ +export declare function useKeyPress( +/** + * The key code (string or array of strings) specifies which key(s) should trigger + * an action. + * + * A **string** can represent: + * - A **single key**, e.g. `'a'` + * - A **key combination**, using `'+'` to separate keys, e.g. `'a+d'` + * + * An **array of strings** represents **multiple possible key inputs**. For example, `['a', 'd+s']` + * means the user can press either the single key `'a'` or the combination of `'d'` and `'s'`. + * @default null + */ +keyCode?: KeyCode | null, options?: UseKeyPressOptions): boolean; +//# sourceMappingURL=useKeyPress.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useKeyPress.d.ts.map b/node_modules/@xyflow/react/dist/esm/hooks/useKeyPress.d.ts.map new file mode 100644 index 0000000..347fb0f --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useKeyPress.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useKeyPress.d.ts","sourceRoot":"","sources":["../../src/hooks/useKeyPress.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAM9D,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,WAAW,GAAG,UAAU,GAAG,IAAI,CAAC;IAC7D;;;OAGG;IACH,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,WAAW;AACzB;;;;;;;;;;;GAWG;AACH,OAAO,GAAE,OAAO,GAAG,IAAW,EAC9B,OAAO,GAAE,kBAA6E,GACrF,OAAO,CAuGT"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useMoveSelectedNodes.d.ts b/node_modules/@xyflow/react/dist/esm/hooks/useMoveSelectedNodes.d.ts new file mode 100644 index 0000000..24389ec --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useMoveSelectedNodes.d.ts @@ -0,0 +1,12 @@ +import { type XYPosition } from '@xyflow/system'; +/** + * Hook for updating node positions by passing a direction and factor + * + * @internal + * @returns function for updating node positions + */ +export declare function useMoveSelectedNodes(): (params: { + direction: XYPosition; + factor: number; +}) => void; +//# sourceMappingURL=useMoveSelectedNodes.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useMoveSelectedNodes.d.ts.map b/node_modules/@xyflow/react/dist/esm/hooks/useMoveSelectedNodes.d.ts.map new file mode 100644 index 0000000..34c5829 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useMoveSelectedNodes.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useMoveSelectedNodes.d.ts","sourceRoot":"","sources":["../../src/hooks/useMoveSelectedNodes.ts"],"names":[],"mappings":"AACA,OAAO,EAAuC,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAQtF;;;;;GAKG;AACH,wBAAgB,oBAAoB,aAGa;IAAE,SAAS,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,UAiDzF"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useNodeConnections.d.ts b/node_modules/@xyflow/react/dist/esm/hooks/useNodeConnections.d.ts new file mode 100644 index 0000000..c36fa0c --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useNodeConnections.d.ts @@ -0,0 +1,38 @@ +import { Connection, NodeConnection, HandleType } from '@xyflow/system'; +type UseNodeConnectionsParams = { + /** ID of the node, filled in automatically if used inside custom node. */ + id?: string; + /** What type of handle connections do you want to observe? */ + handleType?: HandleType; + /** Filter by handle id (this is only needed if the node has multiple handles of the same type). */ + handleId?: string; + /** Gets called when a connection is established. */ + onConnect?: (connections: Connection[]) => void; + /** Gets called when a connection is removed. */ + onDisconnect?: (connections: Connection[]) => void; +}; +/** + * This hook returns an array of connections on a specific node, handle type ('source', 'target') or handle ID. + * + * @public + * @returns An array with connections. + * + * @example + * ```jsx + *import { useNodeConnections } from '@xyflow/react'; + * + *export default function () { + * const connections = useNodeConnections({ + * handleType: 'target', + * handleId: 'my-handle', + * }); + * + * return ( + *
There are currently {connections.length} incoming connections!
+ * ); + *} + *``` + */ +export declare function useNodeConnections({ id, handleType, handleId, onConnect, onDisconnect, }?: UseNodeConnectionsParams): NodeConnection[]; +export {}; +//# sourceMappingURL=useNodeConnections.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useNodeConnections.d.ts.map b/node_modules/@xyflow/react/dist/esm/hooks/useNodeConnections.d.ts.map new file mode 100644 index 0000000..5285c01 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useNodeConnections.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useNodeConnections.d.ts","sourceRoot":"","sources":["../../src/hooks/useNodeConnections.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,cAAc,EACd,UAAU,EAIX,MAAM,gBAAgB,CAAC;AAOxB,KAAK,wBAAwB,GAAG;IAC9B,0EAA0E;IAC1E,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,8DAA8D;IAC9D,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,mGAAmG;IACnG,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,SAAS,CAAC,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;IAChD,gDAAgD;IAChD,YAAY,CAAC,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;CACpD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,EAAE,EACF,UAAU,EACV,QAAQ,EACR,SAAS,EACT,YAAY,GACb,GAAE,wBAA6B,GAAG,cAAc,EAAE,CA8BlD"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useNodes.d.ts b/node_modules/@xyflow/react/dist/esm/hooks/useNodes.d.ts new file mode 100644 index 0000000..e3fc0d9 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useNodes.d.ts @@ -0,0 +1,22 @@ +import type { Node } from '../types'; +/** + * This hook returns an array of the current nodes. Components that use this hook + * will re-render **whenever any node changes**, including when a node is selected + * or moved. + * + * @public + * @returns An array of all nodes currently in the flow. + * + * @example + * ```jsx + *import { useNodes } from '@xyflow/react'; + * + *export default function() { + * const nodes = useNodes(); + * + * return
There are currently {nodes.length} nodes!
; + *} + *``` + */ +export declare function useNodes(): NodeType[]; +//# sourceMappingURL=useNodes.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useNodes.d.ts.map b/node_modules/@xyflow/react/dist/esm/hooks/useNodes.d.ts.map new file mode 100644 index 0000000..c27f37a --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useNodes.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useNodes.d.ts","sourceRoot":"","sources":["../../src/hooks/useNodes.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAkB,MAAM,UAAU,CAAC;AAIrD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,EAAE,CAInE"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useNodesData.d.ts b/node_modules/@xyflow/react/dist/esm/hooks/useNodesData.d.ts new file mode 100644 index 0000000..4430a6e --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useNodesData.d.ts @@ -0,0 +1,26 @@ +import type { Node } from '../types'; +/** + * This hook lets you subscribe to changes of a specific nodes `data` object. + * + * @public + * @returns An object (or array of object) with `id`, `type`, `data` representing each node. + * + * @example + *```jsx + *import { useNodesData } from '@xyflow/react'; + * + *export default function() { + * const nodeData = useNodesData('nodeId-1'); + * const nodesData = useNodesData(['nodeId-1', 'nodeId-2']); + * + * return null; + *} + *``` + */ +export declare function useNodesData( +/** The id of the node to get the data from. */ +nodeId: string): Pick | null; +export declare function useNodesData( +/** The ids of the nodes to get the data from. */ +nodeIds: string[]): Pick[]; +//# sourceMappingURL=useNodesData.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useNodesData.d.ts.map b/node_modules/@xyflow/react/dist/esm/hooks/useNodesData.d.ts.map new file mode 100644 index 0000000..71698db --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useNodesData.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useNodesData.d.ts","sourceRoot":"","sources":["../../src/hooks/useNodesData.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAErC;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI;AACvD,+CAA+C;AAC/C,MAAM,EAAE,MAAM,GACb,IAAI,CAAC,QAAQ,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC,GAAG,IAAI,CAAC;AACjD,wBAAgB,YAAY,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI;AACvD,iDAAiD;AACjD,OAAO,EAAE,MAAM,EAAE,GAChB,IAAI,CAAC,QAAQ,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useNodesEdgesState.d.ts b/node_modules/@xyflow/react/dist/esm/hooks/useNodesEdgesState.d.ts new file mode 100644 index 0000000..8ae95ad --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useNodesEdgesState.d.ts @@ -0,0 +1,105 @@ +import { type Dispatch, type SetStateAction } from 'react'; +import type { Node, Edge, OnNodesChange, OnEdgesChange } from '../types'; +/** + * This hook makes it easy to prototype a controlled flow where you manage the + * state of nodes and edges outside the `ReactFlowInstance`. You can think of it + * like React's `useState` hook with an additional helper callback. + * + * @public + * @returns + * - `nodes`: The current array of nodes. You might pass this directly to the `nodes` prop of your + * `` component, or you may want to manipulate it first to perform some layouting, + * for example. + * - `setNodes`: A function that you can use to update the nodes. You can pass it a new array of + * nodes or a callback that receives the current array of nodes and returns a new array of nodes. + * This is the same as the second element of the tuple returned by React's `useState` hook. + * - `onNodesChange`: A handy callback that can take an array of `NodeChanges` and update the nodes + * state accordingly. You'll typically pass this directly to the `onNodesChange` prop of your + * `` component. + * @example + * + *```tsx + *import { ReactFlow, useNodesState, useEdgesState } from '@xyflow/react'; + * + *const initialNodes = []; + *const initialEdges = []; + * + *export default function () { + * const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes); + * const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges); + * + * return ( + * + * ); + *} + *``` + * + * @remarks This hook was created to make prototyping easier and our documentation + * examples clearer. Although it is OK to use this hook in production, in + * practice you may want to use a more sophisticated state management solution + * like Zustand {@link https://reactflow.dev/docs/guides/state-management/} instead. + * + */ +export declare function useNodesState(initialNodes: NodeType[]): [ + nodes: NodeType[], + setNodes: Dispatch>, + onNodesChange: OnNodesChange +]; +/** + * This hook makes it easy to prototype a controlled flow where you manage the + * state of nodes and edges outside the `ReactFlowInstance`. You can think of it + * like React's `useState` hook with an additional helper callback. + * + * @public + * @returns + * - `edges`: The current array of edges. You might pass this directly to the `edges` prop of your + * `` component, or you may want to manipulate it first to perform some layouting, + * for example. + * + * - `setEdges`: A function that you can use to update the edges. You can pass it a new array of + * edges or a callback that receives the current array of edges and returns a new array of edges. + * This is the same as the second element of the tuple returned by React's `useState` hook. + * + * - `onEdgesChange`: A handy callback that can take an array of `EdgeChanges` and update the edges + * state accordingly. You'll typically pass this directly to the `onEdgesChange` prop of your + * `` component. + * @example + * + *```tsx + *import { ReactFlow, useNodesState, useEdgesState } from '@xyflow/react'; + * + *const initialNodes = []; + *const initialEdges = []; + * + *export default function () { + * const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes); + * const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges); + * + * return ( + * + * ); + *} + *``` + * + * @remarks This hook was created to make prototyping easier and our documentation + * examples clearer. Although it is OK to use this hook in production, in + * practice you may want to use a more sophisticated state management solution + * like Zustand {@link https://reactflow.dev/docs/guides/state-management/} instead. + * + */ +export declare function useEdgesState(initialEdges: EdgeType[]): [ + edges: EdgeType[], + setEdges: Dispatch>, + onEdgesChange: OnEdgesChange +]; +//# sourceMappingURL=useNodesEdgesState.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useNodesEdgesState.d.ts.map b/node_modules/@xyflow/react/dist/esm/hooks/useNodesEdgesState.d.ts.map new file mode 100644 index 0000000..d0d00ce --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useNodesEdgesState.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useNodesEdgesState.d.ts","sourceRoot":"","sources":["../../src/hooks/useNodesEdgesState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAGlF,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,aAAa,CAAC,QAAQ,SAAS,IAAI,EACjD,YAAY,EAAE,QAAQ,EAAE,GACvB;IAED,KAAK,EAAE,QAAQ,EAAE;IACjB,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC9C,aAAa,EAAE,aAAa,CAAC,QAAQ,CAAC;CACvC,CAQA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,aAAa,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EACxD,YAAY,EAAE,QAAQ,EAAE,GACvB;IAED,KAAK,EAAE,QAAQ,EAAE;IACjB,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC9C,aAAa,EAAE,aAAa,CAAC,QAAQ,CAAC;CACvC,CAQA"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useNodesInitialized.d.ts b/node_modules/@xyflow/react/dist/esm/hooks/useNodesInitialized.d.ts new file mode 100644 index 0000000..2cab0f3 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useNodesInitialized.d.ts @@ -0,0 +1,39 @@ +export type UseNodesInitializedOptions = { + /** @default false */ + includeHiddenNodes?: boolean; +}; +/** + * This hook tells you whether all the nodes in a flow have been measured and given + *a width and height. When you add a node to the flow, this hook will return + *`false` and then `true` again once the node has been measured. + * + * @public + * @returns Whether or not the nodes have been initialized by the `` component and + * given a width and height. + * + * @example + * ```jsx + *import { useReactFlow, useNodesInitialized } from '@xyflow/react'; + *import { useEffect, useState } from 'react'; + * + *const options = { + * includeHiddenNodes: false, + *}; + * + *export default function useLayout() { + * const { getNodes } = useReactFlow(); + * const nodesInitialized = useNodesInitialized(options); + * const [layoutedNodes, setLayoutedNodes] = useState(getNodes()); + * + * useEffect(() => { + * if (nodesInitialized) { + * setLayoutedNodes(yourLayoutingFunction(getNodes())); + * } + * }, [nodesInitialized]); + * + * return layoutedNodes; + *} + *``` + */ +export declare function useNodesInitialized(options?: UseNodesInitializedOptions): boolean; +//# sourceMappingURL=useNodesInitialized.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useNodesInitialized.d.ts.map b/node_modules/@xyflow/react/dist/esm/hooks/useNodesInitialized.d.ts.map new file mode 100644 index 0000000..4faa85a --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useNodesInitialized.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useNodesInitialized.d.ts","sourceRoot":"","sources":["../../src/hooks/useNodesInitialized.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,0BAA0B,GAAG;IACvC,qBAAqB;IACrB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAoBF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,GAAE,0BAER,GACA,OAAO,CAIT"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useOnInitHandler.d.ts b/node_modules/@xyflow/react/dist/esm/hooks/useOnInitHandler.d.ts new file mode 100644 index 0000000..95b04fe --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useOnInitHandler.d.ts @@ -0,0 +1,8 @@ +import type { OnInit, Node, Edge } from '../types'; +/** + * Hook for calling onInit handler. + * + * @internal + */ +export declare function useOnInitHandler(onInit: OnInit | undefined): void; +//# sourceMappingURL=useOnInitHandler.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useOnInitHandler.d.ts.map b/node_modules/@xyflow/react/dist/esm/hooks/useOnInitHandler.d.ts.map new file mode 100644 index 0000000..9fa9e56 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useOnInitHandler.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useOnInitHandler.d.ts","sourceRoot":"","sources":["../../src/hooks/useOnInitHandler.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEnD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,EACzF,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,SAAS,QAW/C"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useOnSelectionChange.d.ts b/node_modules/@xyflow/react/dist/esm/hooks/useOnSelectionChange.d.ts new file mode 100644 index 0000000..d28e602 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useOnSelectionChange.d.ts @@ -0,0 +1,43 @@ +import type { OnSelectionChangeFunc, Node, Edge } from '../types'; +export type UseOnSelectionChangeOptions = { + /** The handler to register. */ + onChange: OnSelectionChangeFunc; +}; +/** + * This hook lets you listen for changes to both node and edge selection. As the + *name implies, the callback you provide will be called whenever the selection of + *_either_ nodes or edges changes. + * + * @public + * @example + * ```jsx + *import { useState } from 'react'; + *import { ReactFlow, useOnSelectionChange } from '@xyflow/react'; + * + *function SelectionDisplay() { + * const [selectedNodes, setSelectedNodes] = useState([]); + * const [selectedEdges, setSelectedEdges] = useState([]); + * + * // the passed handler has to be memoized, otherwise the hook will not work correctly + * const onChange = useCallback(({ nodes, edges }) => { + * setSelectedNodes(nodes.map((node) => node.id)); + * setSelectedEdges(edges.map((edge) => edge.id)); + * }, []); + * + * useOnSelectionChange({ + * onChange, + * }); + * + * return ( + *
+ *

Selected nodes: {selectedNodes.join(', ')}

+ *

Selected edges: {selectedEdges.join(', ')}

+ *
+ * ); + *} + *``` + * + * @remarks You need to memoize the passed `onChange` handler, otherwise the hook will not work correctly. + */ +export declare function useOnSelectionChange({ onChange, }: UseOnSelectionChangeOptions): void; +//# sourceMappingURL=useOnSelectionChange.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useOnSelectionChange.d.ts.map b/node_modules/@xyflow/react/dist/esm/hooks/useOnSelectionChange.d.ts.map new file mode 100644 index 0000000..5c7645c --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useOnSelectionChange.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useOnSelectionChange.d.ts","sourceRoot":"","sources":["../../src/hooks/useOnSelectionChange.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAElE,MAAM,MAAM,2BAA2B,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI;IACpG,+BAA+B;IAC/B,QAAQ,EAAE,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;CACrD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,EAC/F,QAAQ,GACT,EAAE,2BAA2B,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAYjD"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useOnViewportChange.d.ts b/node_modules/@xyflow/react/dist/esm/hooks/useOnViewportChange.d.ts new file mode 100644 index 0000000..b0843b0 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useOnViewportChange.d.ts @@ -0,0 +1,33 @@ +import type { OnViewportChange } from '@xyflow/system'; +export type UseOnViewportChangeOptions = { + /** Gets called when the viewport starts changing. */ + onStart?: OnViewportChange; + /** Gets called when the viewport changes. */ + onChange?: OnViewportChange; + /** Gets called when the viewport stops changing. */ + onEnd?: OnViewportChange; +}; +/** + * The `useOnViewportChange` hook lets you listen for changes to the viewport such + * as panning and zooming. You can provide a callback for each phase of a viewport + * change: `onStart`, `onChange`, and `onEnd`. + * + * @public + * @example + * ```jsx + *import { useCallback } from 'react'; + *import { useOnViewportChange } from '@xyflow/react'; + * + *function ViewportChangeLogger() { + * useOnViewportChange({ + * onStart: (viewport: Viewport) => console.log('start', viewport), + * onChange: (viewport: Viewport) => console.log('change', viewport), + * onEnd: (viewport: Viewport) => console.log('end', viewport), + * }); + * + * return null; + *} + *``` + */ +export declare function useOnViewportChange({ onStart, onChange, onEnd }: UseOnViewportChangeOptions): void; +//# sourceMappingURL=useOnViewportChange.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useOnViewportChange.d.ts.map b/node_modules/@xyflow/react/dist/esm/hooks/useOnViewportChange.d.ts.map new file mode 100644 index 0000000..dc42277 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useOnViewportChange.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useOnViewportChange.d.ts","sourceRoot":"","sources":["../../src/hooks/useOnViewportChange.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAIvD,MAAM,MAAM,0BAA0B,GAAG;IACvC,qDAAqD;IACrD,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,oDAAoD;IACpD,KAAK,CAAC,EAAE,gBAAgB,CAAC;CAC1B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,0BAA0B,QAc3F"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useReactFlow.d.ts b/node_modules/@xyflow/react/dist/esm/hooks/useReactFlow.d.ts new file mode 100644 index 0000000..6ed8bc2 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useReactFlow.d.ts @@ -0,0 +1,30 @@ +import type { ReactFlowInstance, Node, Edge } from '../types'; +/** + * This hook returns a ReactFlowInstance that can be used to update nodes and edges, manipulate the viewport, or query the current state of the flow. + * + * @public + * @example + * ```jsx + *import { useCallback, useState } from 'react'; + *import { useReactFlow } from '@xyflow/react'; + * + *export function NodeCounter() { + * const reactFlow = useReactFlow(); + * const [count, setCount] = useState(0); + * const countNodes = useCallback(() => { + * setCount(reactFlow.getNodes().length); + * // you need to pass it as a dependency if you are using it with useEffect or useCallback + * // because at the first render, it's not initialized yet and some functions might not work. + * }, [reactFlow]); + * + * return ( + *
+ * + *

There are {count} nodes in the flow.

+ *
+ * ); + *} + *``` + */ +export declare function useReactFlow(): ReactFlowInstance; +//# sourceMappingURL=useReactFlow.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useReactFlow.d.ts.map b/node_modules/@xyflow/react/dist/esm/hooks/useReactFlow.d.ts.map new file mode 100644 index 0000000..50847a2 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useReactFlow.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useReactFlow.d.ts","sourceRoot":"","sources":["../../src/hooks/useReactFlow.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EACV,iBAAiB,EACjB,IAAI,EACJ,IAAI,EAKL,MAAM,UAAU,CAAC;AAIlB;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,YAAY,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,KAAK,iBAAiB,CAC3G,QAAQ,EACR,QAAQ,CACT,CAiPA"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useResizeHandler.d.ts b/node_modules/@xyflow/react/dist/esm/hooks/useResizeHandler.d.ts new file mode 100644 index 0000000..23199fc --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useResizeHandler.d.ts @@ -0,0 +1,8 @@ +import { type MutableRefObject } from 'react'; +/** + * Hook for handling resize events. + * + * @internal + */ +export declare function useResizeHandler(domNode: MutableRefObject): void; +//# sourceMappingURL=useResizeHandler.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useResizeHandler.d.ts.map b/node_modules/@xyflow/react/dist/esm/hooks/useResizeHandler.d.ts.map new file mode 100644 index 0000000..021d0be --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useResizeHandler.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useResizeHandler.d.ts","sourceRoot":"","sources":["../../src/hooks/useResizeHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAKzD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,CAAC,cAAc,GAAG,IAAI,CAAC,GAAG,IAAI,CAiCvF"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useStore.d.ts b/node_modules/@xyflow/react/dist/esm/hooks/useStore.d.ts new file mode 100644 index 0000000..a4ad5c9 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useStore.d.ts @@ -0,0 +1,45 @@ +import type { Edge, Node, ReactFlowState } from '../types'; +/** + * This hook can be used to subscribe to internal state changes of the React Flow + * component. The `useStore` hook is re-exported from the [Zustand](https://github.com/pmndrs/zustand) + * state management library, so you should check out their docs for more details. + * + * @public + * @param selector - A selector function that returns a slice of the flow's internal state. + * Extracting or transforming just the state you need is a good practice to avoid unnecessary + * re-renders. + * @param equalityFn - A function to compare the previous and next value. This is incredibly useful + * for preventing unnecessary re-renders. Good sensible defaults are using `Object.is` or importing + * `zustand/shallow`, but you can be as granular as you like. + * @returns The selected state slice. + * + * @example + * ```ts + * const nodes = useStore((state) => state.nodes); + * ``` + * + * @remarks This hook should only be used if there is no other way to access the internal + * state. For many of the common use cases, there are dedicated hooks available + * such as {@link useReactFlow}, {@link useViewport}, etc. + */ +declare function useStore(selector: (state: ReactFlowState) => StateSlice, equalityFn?: (a: StateSlice, b: StateSlice) => boolean): StateSlice; +/** + * In some cases, you might need to access the store directly. This hook returns the store object which can be used on demand to access the state or dispatch actions. + * + * @returns The store object. + * @example + * ```ts + * const store = useStoreApi(); + * ``` + * + * @remarks This hook should only be used if there is no other way to access the internal + * state. For many of the common use cases, there are dedicated hooks available + * such as {@link useReactFlow}, {@link useViewport}, etc. + */ +declare function useStoreApi(): { + getState: () => ReactFlowState; + setState: (partial: ReactFlowState | Partial> | ((state: ReactFlowState) => ReactFlowState | Partial>), replace?: boolean | undefined) => void; + subscribe: (listener: (state: ReactFlowState, prevState: ReactFlowState) => void) => () => void; +}; +export { useStore, useStoreApi }; +//# sourceMappingURL=useStore.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useStore.d.ts.map b/node_modules/@xyflow/react/dist/esm/hooks/useStore.d.ts.map new file mode 100644 index 0000000..d3d1213 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useStore.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useStore.d.ts","sourceRoot":"","sources":["../../src/hooks/useStore.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAI3D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,iBAAS,QAAQ,CAAC,UAAU,GAAG,OAAO,EACpC,QAAQ,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,UAAU,EAC/C,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,KAAK,OAAO,cASvD;AAED;;;;;;;;;;;;GAYG;AACH,iBAAS,WAAW,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI;;;;EAiB9E;AAED,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useUpdateNodeInternals.d.ts b/node_modules/@xyflow/react/dist/esm/hooks/useUpdateNodeInternals.d.ts new file mode 100644 index 0000000..fb78ea9 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useUpdateNodeInternals.d.ts @@ -0,0 +1,48 @@ +import type { UpdateNodeInternals } from '@xyflow/system'; +/** + * When you programmatically add or remove handles to a node or update a node's + * handle position, you need to let React Flow know about it using this hook. This + * will update the internal dimensions of the node and properly reposition handles + * on the canvas if necessary. + * + * @public + * @returns Use this function to tell React Flow to update the internal state of one or more nodes + * that you have changed programmatically. + * + * @example + * ```jsx + *import { useCallback, useState } from 'react'; + *import { Handle, useUpdateNodeInternals } from '@xyflow/react'; + * + *export default function RandomHandleNode({ id }) { + * const updateNodeInternals = useUpdateNodeInternals(); + * const [handleCount, setHandleCount] = useState(0); + * const randomizeHandleCount = useCallback(() => { + * setHandleCount(Math.floor(Math.random() * 10)); + * updateNodeInternals(id); + * }, [id, updateNodeInternals]); + * + * return ( + * <> + * {Array.from({ length: handleCount }).map((_, index) => ( + * + * ))} + * + *
+ * + *

There are {handleCount} handles on this node.

+ *
+ * + * ); + *} + *``` + * @remarks This hook can only be used in a component that is a child of a + *{@link ReactFlowProvider} or a {@link ReactFlow} component. + */ +export declare function useUpdateNodeInternals(): UpdateNodeInternals; +//# sourceMappingURL=useUpdateNodeInternals.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useUpdateNodeInternals.d.ts.map b/node_modules/@xyflow/react/dist/esm/hooks/useUpdateNodeInternals.d.ts.map new file mode 100644 index 0000000..4f5a18f --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useUpdateNodeInternals.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useUpdateNodeInternals.d.ts","sourceRoot":"","sources":["../../src/hooks/useUpdateNodeInternals.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAsB,MAAM,gBAAgB,CAAC;AAI9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,sBAAsB,IAAI,mBAAmB,CAkB5D"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useViewport.d.ts b/node_modules/@xyflow/react/dist/esm/hooks/useViewport.d.ts new file mode 100644 index 0000000..428255f --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useViewport.d.ts @@ -0,0 +1,32 @@ +import type { Viewport } from '@xyflow/system'; +/** + * The `useViewport` hook is a convenient way to read the current state of the + * {@link Viewport} in a component. Components that use this hook + * will re-render **whenever the viewport changes**. + * + * @public + * @returns The current viewport. + * + * @example + * + *```jsx + *import { useViewport } from '@xyflow/react'; + * + *export default function ViewportDisplay() { + * const { x, y, zoom } = useViewport(); + * + * return ( + *
+ *

+ * The viewport is currently at ({x}, {y}) and zoomed to {zoom}. + *

+ *
+ * ); + *} + *``` + * + * @remarks This hook can only be used in a component that is a child of a + *{@link ReactFlowProvider} or a {@link ReactFlow} component. + */ +export declare function useViewport(): Viewport; +//# sourceMappingURL=useViewport.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useViewport.d.ts.map b/node_modules/@xyflow/react/dist/esm/hooks/useViewport.d.ts.map new file mode 100644 index 0000000..19e207a --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useViewport.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useViewport.d.ts","sourceRoot":"","sources":["../../src/hooks/useViewport.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAW/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,WAAW,IAAI,QAAQ,CAItC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useViewportHelper.d.ts b/node_modules/@xyflow/react/dist/esm/hooks/useViewportHelper.d.ts new file mode 100644 index 0000000..bab517a --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useViewportHelper.d.ts @@ -0,0 +1,10 @@ +import type { ViewportHelperFunctions } from '../types'; +/** + * Hook for getting viewport helper functions. + * + * @internal + * @returns viewport helper functions + */ +declare const useViewportHelper: () => ViewportHelperFunctions; +export default useViewportHelper; +//# sourceMappingURL=useViewportHelper.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useViewportHelper.d.ts.map b/node_modules/@xyflow/react/dist/esm/hooks/useViewportHelper.d.ts.map new file mode 100644 index 0000000..7c4a669 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useViewportHelper.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useViewportHelper.d.ts","sourceRoot":"","sources":["../../src/hooks/useViewportHelper.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExD;;;;;GAKG;AACH,QAAA,MAAM,iBAAiB,QAAO,uBAsG7B,CAAC;AAEF,eAAe,iBAAiB,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useViewportSync.d.ts b/node_modules/@xyflow/react/dist/esm/hooks/useViewportSync.d.ts new file mode 100644 index 0000000..d810354 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useViewportSync.d.ts @@ -0,0 +1,9 @@ +import type { Viewport } from '@xyflow/system'; +/** + * Hook for syncing the viewport with the panzoom instance. + * + * @internal + * @param viewport + */ +export declare function useViewportSync(viewport?: Viewport): null; +//# sourceMappingURL=useViewportSync.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useViewportSync.d.ts.map b/node_modules/@xyflow/react/dist/esm/hooks/useViewportSync.d.ts.map new file mode 100644 index 0000000..d2e3395 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useViewportSync.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useViewportSync.d.ts","sourceRoot":"","sources":["../../src/hooks/useViewportSync.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAO/C;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,QAAQ,CAAC,EAAE,QAAQ,QAYlD"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useVisibleEdgeIds.d.ts b/node_modules/@xyflow/react/dist/esm/hooks/useVisibleEdgeIds.d.ts new file mode 100644 index 0000000..cab1370 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useVisibleEdgeIds.d.ts @@ -0,0 +1,9 @@ +/** + * Hook for getting the visible edge ids from the store. + * + * @internal + * @param onlyRenderVisible + * @returns array with visible edge ids + */ +export declare function useVisibleEdgeIds(onlyRenderVisible: boolean): string[]; +//# sourceMappingURL=useVisibleEdgeIds.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useVisibleEdgeIds.d.ts.map b/node_modules/@xyflow/react/dist/esm/hooks/useVisibleEdgeIds.d.ts.map new file mode 100644 index 0000000..fcd115a --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useVisibleEdgeIds.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useVisibleEdgeIds.d.ts","sourceRoot":"","sources":["../../src/hooks/useVisibleEdgeIds.ts"],"names":[],"mappings":"AAOA;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,iBAAiB,EAAE,OAAO,GAAG,MAAM,EAAE,CAuCtE"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useVisibleNodeIds.d.ts b/node_modules/@xyflow/react/dist/esm/hooks/useVisibleNodeIds.d.ts new file mode 100644 index 0000000..67bbac1 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useVisibleNodeIds.d.ts @@ -0,0 +1,9 @@ +/** + * Hook for getting the visible node ids from the store. + * + * @internal + * @param onlyRenderVisible + * @returns array with visible node ids + */ +export declare function useVisibleNodeIds(onlyRenderVisible: boolean): string[]; +//# sourceMappingURL=useVisibleNodeIds.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/hooks/useVisibleNodeIds.d.ts.map b/node_modules/@xyflow/react/dist/esm/hooks/useVisibleNodeIds.d.ts.map new file mode 100644 index 0000000..5fe24da --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/hooks/useVisibleNodeIds.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useVisibleNodeIds.d.ts","sourceRoot":"","sources":["../../src/hooks/useVisibleNodeIds.ts"],"names":[],"mappings":"AAeA;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,iBAAiB,EAAE,OAAO,YAI3D"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/index.d.ts b/node_modules/@xyflow/react/dist/esm/index.d.ts new file mode 100644 index 0000000..0748bfd --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/index.d.ts @@ -0,0 +1,39 @@ +export { default as ReactFlow } from './container/ReactFlow'; +export { Handle, type HandleProps } from './components/Handle'; +export { EdgeText } from './components/Edges/EdgeText'; +export { StraightEdge } from './components/Edges/StraightEdge'; +export { StepEdge } from './components/Edges/StepEdge'; +export { BezierEdge } from './components/Edges/BezierEdge'; +export { SimpleBezierEdge, getSimpleBezierPath } from './components/Edges/SimpleBezierEdge'; +export { SmoothStepEdge } from './components/Edges/SmoothStepEdge'; +export { BaseEdge } from './components/Edges/BaseEdge'; +export { ReactFlowProvider } from './components/ReactFlowProvider'; +export { Panel, type PanelProps } from './components/Panel'; +export { EdgeLabelRenderer, type EdgeLabelRendererProps } from './components/EdgeLabelRenderer'; +export { ViewportPortal } from './components/ViewportPortal'; +export { useReactFlow } from './hooks/useReactFlow'; +export { useUpdateNodeInternals } from './hooks/useUpdateNodeInternals'; +export { useNodes } from './hooks/useNodes'; +export { useEdges } from './hooks/useEdges'; +export { useViewport } from './hooks/useViewport'; +export { useKeyPress } from './hooks/useKeyPress'; +export { useNodesState, useEdgesState } from './hooks/useNodesEdgesState'; +export { useStore, useStoreApi } from './hooks/useStore'; +export { useOnViewportChange, type UseOnViewportChangeOptions } from './hooks/useOnViewportChange'; +export { useOnSelectionChange, type UseOnSelectionChangeOptions } from './hooks/useOnSelectionChange'; +export { useNodesInitialized, type UseNodesInitializedOptions } from './hooks/useNodesInitialized'; +export { useHandleConnections } from './hooks/useHandleConnections'; +export { useNodeConnections } from './hooks/useNodeConnections'; +export { useNodesData } from './hooks/useNodesData'; +export { useConnection } from './hooks/useConnection'; +export { useInternalNode } from './hooks/useInternalNode'; +export { useNodeId } from './contexts/NodeIdContext'; +export { applyNodeChanges, applyEdgeChanges } from './utils/changes'; +export { isNode, isEdge } from './utils/general'; +export * from './additional-components'; +export * from './types'; +export { type Align, type SmoothStepPathOptions, type BezierPathOptions, ConnectionLineType, type EdgeMarker, type EdgeMarkerType, MarkerType, type OnMove, type OnMoveStart, type OnMoveEnd, type Connection, ConnectionMode, type OnConnectStartParams, type OnConnectStart, type OnConnect, type OnConnectEnd, type Viewport, type SnapGrid, PanOnScrollMode, type ViewportHelperFunctionOptions, type SetCenterOptions, type FitBoundsOptions, type PanelPosition, type ProOptions, SelectionMode, type SelectionRect, type OnError, type NodeOrigin, type OnSelectionDrag, Position, type XYPosition, type XYZPosition, type Dimensions, type Rect, type Box, type Transform, type CoordinateExtent, type ColorMode, type ColorModeClass, type HandleType, type ShouldResize, type OnResizeStart, type OnResize, type OnResizeEnd, type ControlPosition, type ControlLinePosition, ResizeControlVariant, type ResizeParams, type ResizeParamsWithDirection, type ResizeDragEvent, type NodeChange, type NodeDimensionChange, type NodePositionChange, type NodeSelectionChange, type NodeRemoveChange, type NodeAddChange, type NodeReplaceChange, type EdgeChange, type EdgeSelectionChange, type EdgeRemoveChange, type EdgeAddChange, type EdgeReplaceChange, type KeyCode, type ConnectionState, type FinalConnectionState, type ConnectionInProgress, type NoConnection, type NodeConnection, type OnReconnect, type AriaLabelConfig, } from '@xyflow/system'; +import { type Handle as HandleBound } from '@xyflow/system'; +export type Handle = HandleBound; +export { type GetBezierPathParams, getBezierEdgeCenter, getBezierPath, getEdgeCenter, type GetSmoothStepPathParams, getSmoothStepPath, type GetStraightPathParams, getStraightPath, getViewportForBounds, getNodesBounds, getIncomers, getOutgoers, addEdge, reconnectEdge, getConnectedEdges, } from '@xyflow/system'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/index.d.ts.map b/node_modules/@xyflow/react/dist/esm/index.d.ts.map new file mode 100644 index 0000000..4ddf055 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC5F,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAChG,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,KAAK,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACnG,OAAO,EAAE,oBAAoB,EAAE,KAAK,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AACtG,OAAO,EAAE,mBAAmB,EAAE,KAAK,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACnG,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEjD,cAAc,yBAAyB,CAAC;AAExC,cAAc,SAAS,CAAC;AAGxB,OAAO,EACL,KAAK,KAAK,EACV,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,kBAAkB,EAClB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,UAAU,EACV,KAAK,MAAM,EACX,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,UAAU,EACf,cAAc,EACd,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,eAAe,EACf,KAAK,6BAA6B,EAClC,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,aAAa,EACb,KAAK,aAAa,EAClB,KAAK,OAAO,EACZ,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,QAAQ,EACR,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,IAAI,EACT,KAAK,GAAG,EACR,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,oBAAoB,EACpB,KAAK,YAAY,EACjB,KAAK,yBAAyB,EAC9B,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,OAAO,EACZ,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,eAAe,GACrB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,KAAK,MAAM,IAAI,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC5D,MAAM,MAAM,MAAM,GAAG,WAAW,CAAC;AAGjC,OAAO,EACL,KAAK,mBAAmB,EACxB,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,KAAK,uBAAuB,EAC5B,iBAAiB,EACjB,KAAK,qBAAqB,EAC1B,eAAe,EACf,oBAAoB,EACpB,cAAc,EACd,WAAW,EACX,WAAW,EACX,OAAO,EACP,aAAa,EACb,iBAAiB,GAClB,MAAM,gBAAgB,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/index.js b/node_modules/@xyflow/react/dist/esm/index.js new file mode 100644 index 0000000..13eadd5 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/index.js @@ -0,0 +1,4826 @@ +"use client" +import { jsxs, Fragment, jsx } from 'react/jsx-runtime'; +import { createContext, useContext, useMemo, forwardRef, useEffect, useRef, useState, useLayoutEffect, useCallback, memo } from 'react'; +import cc from 'classcat'; +import { errorMessages, mergeAriaLabelConfig, infiniteExtent, isInputDOMNode, getViewportForBounds, pointToRendererPoint, rendererPointToPoint, isNodeBase, isEdgeBase, getElementsToRemove, isRectObject, nodeToRect, getOverlappingArea, getNodesBounds, withResolvers, evaluateAbsolutePosition, getDimensions, XYPanZoom, PanOnScrollMode, SelectionMode, getEventPosition, getNodesInside, areSetsEqual, XYDrag, snapPosition, calculateNodePosition, Position, ConnectionMode, isMouseEvent, XYHandle, getHostForElement, addEdge, getInternalNodesBounds, isNumeric, nodeHasDimensions, getNodeDimensions, elementSelectionKeys, isEdgeVisible, MarkerType, createMarkerIds, getBezierEdgeCenter, getSmoothStepPath, getStraightPath, getBezierPath, getEdgePosition, getElevatedEdgeZIndex, getMarkerId, getConnectionStatus, ConnectionLineType, updateConnectionLookup, adoptUserNodes, initialConnection, devWarn, defaultAriaLabelConfig, updateNodeInternals, updateAbsolutePositions, handleExpandParent, panBy, fitViewport, isMacOs, areConnectionMapsEqual, handleConnectionChange, shallowNodeData, XYMinimap, getBoundsOfRects, ResizeControlVariant, XYResizer, XY_RESIZER_LINE_POSITIONS, XY_RESIZER_HANDLE_POSITIONS, getNodeToolbarTransform } from '@xyflow/system'; +export { ConnectionLineType, ConnectionMode, MarkerType, PanOnScrollMode, Position, ResizeControlVariant, SelectionMode, addEdge, getBezierEdgeCenter, getBezierPath, getConnectedEdges, getEdgeCenter, getIncomers, getNodesBounds, getOutgoers, getSmoothStepPath, getStraightPath, getViewportForBounds, reconnectEdge } from '@xyflow/system'; +import { useStoreWithEqualityFn, createWithEqualityFn } from 'zustand/traditional'; +import { shallow } from 'zustand/shallow'; +import { createPortal } from 'react-dom'; + +const StoreContext = createContext(null); +const Provider$1 = StoreContext.Provider; + +const zustandErrorMessage = errorMessages['error001'](); +/** + * This hook can be used to subscribe to internal state changes of the React Flow + * component. The `useStore` hook is re-exported from the [Zustand](https://github.com/pmndrs/zustand) + * state management library, so you should check out their docs for more details. + * + * @public + * @param selector - A selector function that returns a slice of the flow's internal state. + * Extracting or transforming just the state you need is a good practice to avoid unnecessary + * re-renders. + * @param equalityFn - A function to compare the previous and next value. This is incredibly useful + * for preventing unnecessary re-renders. Good sensible defaults are using `Object.is` or importing + * `zustand/shallow`, but you can be as granular as you like. + * @returns The selected state slice. + * + * @example + * ```ts + * const nodes = useStore((state) => state.nodes); + * ``` + * + * @remarks This hook should only be used if there is no other way to access the internal + * state. For many of the common use cases, there are dedicated hooks available + * such as {@link useReactFlow}, {@link useViewport}, etc. + */ +function useStore(selector, equalityFn) { + const store = useContext(StoreContext); + if (store === null) { + throw new Error(zustandErrorMessage); + } + return useStoreWithEqualityFn(store, selector, equalityFn); +} +/** + * In some cases, you might need to access the store directly. This hook returns the store object which can be used on demand to access the state or dispatch actions. + * + * @returns The store object. + * @example + * ```ts + * const store = useStoreApi(); + * ``` + * + * @remarks This hook should only be used if there is no other way to access the internal + * state. For many of the common use cases, there are dedicated hooks available + * such as {@link useReactFlow}, {@link useViewport}, etc. + */ +function useStoreApi() { + const store = useContext(StoreContext); + if (store === null) { + throw new Error(zustandErrorMessage); + } + return useMemo(() => ({ + getState: store.getState, + setState: store.setState, + subscribe: store.subscribe, + }), [store]); +} + +const style = { display: 'none' }; +const ariaLiveStyle = { + position: 'absolute', + width: 1, + height: 1, + margin: -1, + border: 0, + padding: 0, + overflow: 'hidden', + clip: 'rect(0px, 0px, 0px, 0px)', + clipPath: 'inset(100%)', +}; +const ARIA_NODE_DESC_KEY = 'react-flow__node-desc'; +const ARIA_EDGE_DESC_KEY = 'react-flow__edge-desc'; +const ARIA_LIVE_MESSAGE = 'react-flow__aria-live'; +const ariaLiveSelector = (s) => s.ariaLiveMessage; +const ariaLabelConfigSelector = (s) => s.ariaLabelConfig; +function AriaLiveMessage({ rfId }) { + const ariaLiveMessage = useStore(ariaLiveSelector); + return (jsx("div", { id: `${ARIA_LIVE_MESSAGE}-${rfId}`, "aria-live": "assertive", "aria-atomic": "true", style: ariaLiveStyle, children: ariaLiveMessage })); +} +function A11yDescriptions({ rfId, disableKeyboardA11y }) { + const ariaLabelConfig = useStore(ariaLabelConfigSelector); + return (jsxs(Fragment, { children: [jsx("div", { id: `${ARIA_NODE_DESC_KEY}-${rfId}`, style: style, children: disableKeyboardA11y + ? ariaLabelConfig['node.a11yDescription.default'] + : ariaLabelConfig['node.a11yDescription.keyboardDisabled'] }), jsx("div", { id: `${ARIA_EDGE_DESC_KEY}-${rfId}`, style: style, children: ariaLabelConfig['edge.a11yDescription.default'] }), !disableKeyboardA11y && jsx(AriaLiveMessage, { rfId: rfId })] })); +} + +const selector$n = (s) => (s.userSelectionActive ? 'none' : 'all'); +/** + * The `` component helps you position content above the viewport. + * It is used internally by the [``](/api-reference/components/minimap) + * and [``](/api-reference/components/controls) components. + * + * @public + * + * @example + * ```jsx + *import { ReactFlow, Background, Panel } from '@xyflow/react'; + * + *export default function Flow() { + * return ( + * + * top-left + * top-center + * top-right + * bottom-left + * bottom-center + * bottom-right + * + * ); + *} + *``` + */ +const Panel = forwardRef(({ position = 'top-left', children, className, style, ...rest }, ref) => { + const pointerEvents = useStore(selector$n); + const positionClasses = `${position}`.split('-'); + return (jsx("div", { className: cc(['react-flow__panel', className, ...positionClasses]), style: { ...style, pointerEvents }, ref: ref, ...rest, children: children })); +}); +Panel.displayName = 'Panel'; + +function Attribution({ proOptions, position = 'bottom-right' }) { + if (proOptions?.hideAttribution) { + return null; + } + return (jsx(Panel, { position: position, className: "react-flow__attribution", "data-message": "Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev", children: jsx("a", { href: "https://reactflow.dev", target: "_blank", rel: "noopener noreferrer", "aria-label": "React Flow attribution", children: "React Flow" }) })); +} + +const selector$m = (s) => { + const selectedNodes = []; + const selectedEdges = []; + for (const [, node] of s.nodeLookup) { + if (node.selected) { + selectedNodes.push(node.internals.userNode); + } + } + for (const [, edge] of s.edgeLookup) { + if (edge.selected) { + selectedEdges.push(edge); + } + } + return { selectedNodes, selectedEdges }; +}; +const selectId = (obj) => obj.id; +function areEqual(a, b) { + return (shallow(a.selectedNodes.map(selectId), b.selectedNodes.map(selectId)) && + shallow(a.selectedEdges.map(selectId), b.selectedEdges.map(selectId))); +} +function SelectionListenerInner({ onSelectionChange, }) { + const store = useStoreApi(); + const { selectedNodes, selectedEdges } = useStore(selector$m, areEqual); + useEffect(() => { + const params = { nodes: selectedNodes, edges: selectedEdges }; + onSelectionChange?.(params); + store.getState().onSelectionChangeHandlers.forEach((fn) => fn(params)); + }, [selectedNodes, selectedEdges, onSelectionChange]); + return null; +} +const changeSelector = (s) => !!s.onSelectionChangeHandlers; +function SelectionListener({ onSelectionChange, }) { + const storeHasSelectionChangeHandlers = useStore(changeSelector); + if (onSelectionChange || storeHasSelectionChangeHandlers) { + return jsx(SelectionListenerInner, { onSelectionChange: onSelectionChange }); + } + return null; +} + +const defaultNodeOrigin = [0, 0]; +const defaultViewport = { x: 0, y: 0, zoom: 1 }; + +/* + * This component helps us to update the store with the values coming from the user. + * We distinguish between values we can update directly with `useDirectStoreUpdater` (like `snapGrid`) + * and values that have a dedicated setter function in the store (like `setNodes`). + */ +// These fields exist in the global store, and we need to keep them up to date +const reactFlowFieldsToTrack = [ + 'nodes', + 'edges', + 'defaultNodes', + 'defaultEdges', + 'onConnect', + 'onConnectStart', + 'onConnectEnd', + 'onClickConnectStart', + 'onClickConnectEnd', + 'nodesDraggable', + 'autoPanOnNodeFocus', + 'nodesConnectable', + 'nodesFocusable', + 'edgesFocusable', + 'edgesReconnectable', + 'elevateNodesOnSelect', + 'elevateEdgesOnSelect', + 'minZoom', + 'maxZoom', + 'nodeExtent', + 'onNodesChange', + 'onEdgesChange', + 'elementsSelectable', + 'connectionMode', + 'snapGrid', + 'snapToGrid', + 'translateExtent', + 'connectOnClick', + 'defaultEdgeOptions', + 'fitView', + 'fitViewOptions', + 'onNodesDelete', + 'onEdgesDelete', + 'onDelete', + 'onNodeDrag', + 'onNodeDragStart', + 'onNodeDragStop', + 'onSelectionDrag', + 'onSelectionDragStart', + 'onSelectionDragStop', + 'onMoveStart', + 'onMove', + 'onMoveEnd', + 'noPanClassName', + 'nodeOrigin', + 'autoPanOnConnect', + 'autoPanOnNodeDrag', + 'onError', + 'connectionRadius', + 'isValidConnection', + 'selectNodesOnDrag', + 'nodeDragThreshold', + 'onBeforeDelete', + 'debug', + 'autoPanSpeed', + 'paneClickDistance', + 'ariaLabelConfig', +]; +// rfId doesn't exist in ReactFlowProps, but it's one of the fields we want to update +const fieldsToTrack = [...reactFlowFieldsToTrack, 'rfId']; +const selector$l = (s) => ({ + setNodes: s.setNodes, + setEdges: s.setEdges, + setMinZoom: s.setMinZoom, + setMaxZoom: s.setMaxZoom, + setTranslateExtent: s.setTranslateExtent, + setNodeExtent: s.setNodeExtent, + reset: s.reset, + setDefaultNodesAndEdges: s.setDefaultNodesAndEdges, + setPaneClickDistance: s.setPaneClickDistance, +}); +const initPrevValues = { + /* + * these are values that are also passed directly to other components + * than the StoreUpdater. We can reduce the number of setStore calls + * by setting the same values here as prev fields. + */ + translateExtent: infiniteExtent, + nodeOrigin: defaultNodeOrigin, + minZoom: 0.5, + maxZoom: 2, + elementsSelectable: true, + noPanClassName: 'nopan', + rfId: '1', + paneClickDistance: 0, +}; +function StoreUpdater(props) { + const { setNodes, setEdges, setMinZoom, setMaxZoom, setTranslateExtent, setNodeExtent, reset, setDefaultNodesAndEdges, setPaneClickDistance, } = useStore(selector$l, shallow); + const store = useStoreApi(); + useEffect(() => { + setDefaultNodesAndEdges(props.defaultNodes, props.defaultEdges); + return () => { + // when we reset the store we also need to reset the previous fields + previousFields.current = initPrevValues; + reset(); + }; + }, []); + const previousFields = useRef(initPrevValues); + useEffect(() => { + for (const fieldName of fieldsToTrack) { + const fieldValue = props[fieldName]; + const previousFieldValue = previousFields.current[fieldName]; + if (fieldValue === previousFieldValue) + continue; + if (typeof props[fieldName] === 'undefined') + continue; + // Custom handling with dedicated setters for some fields + if (fieldName === 'nodes') + setNodes(fieldValue); + else if (fieldName === 'edges') + setEdges(fieldValue); + else if (fieldName === 'minZoom') + setMinZoom(fieldValue); + else if (fieldName === 'maxZoom') + setMaxZoom(fieldValue); + else if (fieldName === 'translateExtent') + setTranslateExtent(fieldValue); + else if (fieldName === 'nodeExtent') + setNodeExtent(fieldValue); + else if (fieldName === 'paneClickDistance') + setPaneClickDistance(fieldValue); + // Renamed fields + else if (fieldName === 'fitView') + store.setState({ fitViewQueued: fieldValue }); + else if (fieldName === 'fitViewOptions') + store.setState({ fitViewOptions: fieldValue }); + if (fieldName === 'ariaLabelConfig') { + store.setState({ ariaLabelConfig: mergeAriaLabelConfig(fieldValue) }); + } + // General case + else + store.setState({ [fieldName]: fieldValue }); + } + previousFields.current = props; + }, + // Only re-run the effect if one of the fields we track changes + fieldsToTrack.map((fieldName) => props[fieldName])); + return null; +} + +function getMediaQuery() { + if (typeof window === 'undefined' || !window.matchMedia) { + return null; + } + return window.matchMedia('(prefers-color-scheme: dark)'); +} +/** + * Hook for receiving the current color mode class 'dark' or 'light'. + * + * @internal + * @param colorMode - The color mode to use ('dark', 'light' or 'system') + */ +function useColorModeClass(colorMode) { + const [colorModeClass, setColorModeClass] = useState(colorMode === 'system' ? null : colorMode); + useEffect(() => { + if (colorMode !== 'system') { + setColorModeClass(colorMode); + return; + } + const mediaQuery = getMediaQuery(); + const updateColorModeClass = () => setColorModeClass(mediaQuery?.matches ? 'dark' : 'light'); + updateColorModeClass(); + mediaQuery?.addEventListener('change', updateColorModeClass); + return () => { + mediaQuery?.removeEventListener('change', updateColorModeClass); + }; + }, [colorMode]); + return colorModeClass !== null ? colorModeClass : getMediaQuery()?.matches ? 'dark' : 'light'; +} + +const defaultDoc = typeof document !== 'undefined' ? document : null; +/** + * This hook lets you listen for specific key codes and tells you whether they are + * currently pressed or not. + * + * @public + * @param options - Options + * + * @example + * ```tsx + *import { useKeyPress } from '@xyflow/react'; + * + *export default function () { + * const spacePressed = useKeyPress('Space'); + * const cmdAndSPressed = useKeyPress(['Meta+s', 'Strg+s']); + * + * return ( + *
+ * {spacePressed &&

Space pressed!

} + * {cmdAndSPressed &&

Cmd + S pressed!

} + *
+ * ); + *} + *``` + */ +function useKeyPress( +/** + * The key code (string or array of strings) specifies which key(s) should trigger + * an action. + * + * A **string** can represent: + * - A **single key**, e.g. `'a'` + * - A **key combination**, using `'+'` to separate keys, e.g. `'a+d'` + * + * An **array of strings** represents **multiple possible key inputs**. For example, `['a', 'd+s']` + * means the user can press either the single key `'a'` or the combination of `'d'` and `'s'`. + * @default null + */ +keyCode = null, options = { target: defaultDoc, actInsideInputWithModifier: true }) { + const [keyPressed, setKeyPressed] = useState(false); + // we need to remember if a modifier key is pressed in order to track it + const modifierPressed = useRef(false); + // we need to remember the pressed keys in order to support combinations + const pressedKeys = useRef(new Set([])); + /* + * keyCodes = array with single keys [['a']] or key combinations [['a', 's']] + * keysToWatch = array with all keys flattened ['a', 'd', 'ShiftLeft'] + * used to check if we store event.code or event.key. When the code is in the list of keysToWatch + * we use the code otherwise the key. Explainer: When you press the left "command" key, the code is "MetaLeft" + * and the key is "Meta". We want users to be able to pass keys and codes so we assume that the key is meant when + * we can't find it in the list of keysToWatch. + */ + const [keyCodes, keysToWatch] = useMemo(() => { + if (keyCode !== null) { + const keyCodeArr = Array.isArray(keyCode) ? keyCode : [keyCode]; + const keys = keyCodeArr + .filter((kc) => typeof kc === 'string') + /* + * we first replace all '+' with '\n' which we will use to split the keys on + * then we replace '\n\n' with '\n+', this way we can also support the combination 'key++' + * in the end we simply split on '\n' to get the key array + */ + .map((kc) => kc.replace('+', '\n').replace('\n\n', '\n+').split('\n')); + const keysFlat = keys.reduce((res, item) => res.concat(...item), []); + return [keys, keysFlat]; + } + return [[], []]; + }, [keyCode]); + useEffect(() => { + const target = options?.target ?? defaultDoc; + const actInsideInputWithModifier = options?.actInsideInputWithModifier ?? true; + if (keyCode !== null) { + const downHandler = (event) => { + modifierPressed.current = event.ctrlKey || event.metaKey || event.shiftKey || event.altKey; + const preventAction = (!modifierPressed.current || (modifierPressed.current && !actInsideInputWithModifier)) && + isInputDOMNode(event); + if (preventAction) { + return false; + } + const keyOrCode = useKeyOrCode(event.code, keysToWatch); + pressedKeys.current.add(event[keyOrCode]); + if (isMatchingKey(keyCodes, pressedKeys.current, false)) { + const target = (event.composedPath?.()?.[0] || event.target); + const isInteractiveElement = target?.nodeName === 'BUTTON' || target?.nodeName === 'A'; + if (options.preventDefault !== false && (modifierPressed.current || !isInteractiveElement)) { + event.preventDefault(); + } + setKeyPressed(true); + } + }; + const upHandler = (event) => { + const keyOrCode = useKeyOrCode(event.code, keysToWatch); + if (isMatchingKey(keyCodes, pressedKeys.current, true)) { + setKeyPressed(false); + pressedKeys.current.clear(); + } + else { + pressedKeys.current.delete(event[keyOrCode]); + } + // fix for Mac: when cmd key is pressed, keyup is not triggered for any other key, see: https://stackoverflow.com/questions/27380018/when-cmd-key-is-kept-pressed-keyup-is-not-triggered-for-any-other-key + if (event.key === 'Meta') { + pressedKeys.current.clear(); + } + modifierPressed.current = false; + }; + const resetHandler = () => { + pressedKeys.current.clear(); + setKeyPressed(false); + }; + target?.addEventListener('keydown', downHandler); + target?.addEventListener('keyup', upHandler); + window.addEventListener('blur', resetHandler); + window.addEventListener('contextmenu', resetHandler); + return () => { + target?.removeEventListener('keydown', downHandler); + target?.removeEventListener('keyup', upHandler); + window.removeEventListener('blur', resetHandler); + window.removeEventListener('contextmenu', resetHandler); + }; + } + }, [keyCode, setKeyPressed]); + return keyPressed; +} +// utils +function isMatchingKey(keyCodes, pressedKeys, isUp) { + return (keyCodes + /* + * we only want to compare same sizes of keyCode definitions + * and pressed keys. When the user specified 'Meta' as a key somewhere + * this would also be truthy without this filter when user presses 'Meta' + 'r' + */ + .filter((keys) => isUp || keys.length === pressedKeys.size) + /* + * since we want to support multiple possibilities only one of the + * combinations need to be part of the pressed keys + */ + .some((keys) => keys.every((k) => pressedKeys.has(k)))); +} +function useKeyOrCode(eventCode, keysToWatch) { + return keysToWatch.includes(eventCode) ? 'code' : 'key'; +} + +/** + * Hook for getting viewport helper functions. + * + * @internal + * @returns viewport helper functions + */ +const useViewportHelper = () => { + const store = useStoreApi(); + return useMemo(() => { + return { + zoomIn: (options) => { + const { panZoom } = store.getState(); + return panZoom ? panZoom.scaleBy(1.2, { duration: options?.duration }) : Promise.resolve(false); + }, + zoomOut: (options) => { + const { panZoom } = store.getState(); + return panZoom ? panZoom.scaleBy(1 / 1.2, { duration: options?.duration }) : Promise.resolve(false); + }, + zoomTo: (zoomLevel, options) => { + const { panZoom } = store.getState(); + return panZoom ? panZoom.scaleTo(zoomLevel, { duration: options?.duration }) : Promise.resolve(false); + }, + getZoom: () => store.getState().transform[2], + setViewport: async (viewport, options) => { + const { transform: [tX, tY, tZoom], panZoom, } = store.getState(); + if (!panZoom) { + return Promise.resolve(false); + } + await panZoom.setViewport({ + x: viewport.x ?? tX, + y: viewport.y ?? tY, + zoom: viewport.zoom ?? tZoom, + }, options); + return Promise.resolve(true); + }, + getViewport: () => { + const [x, y, zoom] = store.getState().transform; + return { x, y, zoom }; + }, + setCenter: async (x, y, options) => { + return store.getState().setCenter(x, y, options); + }, + fitBounds: async (bounds, options) => { + const { width, height, minZoom, maxZoom, panZoom } = store.getState(); + const viewport = getViewportForBounds(bounds, width, height, minZoom, maxZoom, options?.padding ?? 0.1); + if (!panZoom) { + return Promise.resolve(false); + } + await panZoom.setViewport(viewport, { + duration: options?.duration, + ease: options?.ease, + interpolate: options?.interpolate, + }); + return Promise.resolve(true); + }, + screenToFlowPosition: (clientPosition, options = {}) => { + const { transform, snapGrid, snapToGrid, domNode } = store.getState(); + if (!domNode) { + return clientPosition; + } + const { x: domX, y: domY } = domNode.getBoundingClientRect(); + const correctedPosition = { + x: clientPosition.x - domX, + y: clientPosition.y - domY, + }; + const _snapGrid = options.snapGrid ?? snapGrid; + const _snapToGrid = options.snapToGrid ?? snapToGrid; + return pointToRendererPoint(correctedPosition, transform, _snapToGrid, _snapGrid); + }, + flowToScreenPosition: (flowPosition) => { + const { transform, domNode } = store.getState(); + if (!domNode) { + return flowPosition; + } + const { x: domX, y: domY } = domNode.getBoundingClientRect(); + const rendererPosition = rendererPointToPoint(flowPosition, transform); + return { + x: rendererPosition.x + domX, + y: rendererPosition.y + domY, + }; + }, + }; + }, []); +}; + +/* + * This function applies changes to nodes or edges that are triggered by React Flow internally. + * When you drag a node for example, React Flow will send a position change update. + * This function then applies the changes and returns the updated elements. + */ +function applyChanges(changes, elements) { + const updatedElements = []; + /* + * By storing a map of changes for each element, we can a quick lookup as we + * iterate over the elements array! + */ + const changesMap = new Map(); + const addItemChanges = []; + for (const change of changes) { + if (change.type === 'add') { + addItemChanges.push(change); + continue; + } + else if (change.type === 'remove' || change.type === 'replace') { + /* + * For a 'remove' change we can safely ignore any other changes queued for + * the same element, it's going to be removed anyway! + */ + changesMap.set(change.id, [change]); + } + else { + const elementChanges = changesMap.get(change.id); + if (elementChanges) { + /* + * If we have some changes queued already, we can do a mutable update of + * that array and save ourselves some copying. + */ + elementChanges.push(change); + } + else { + changesMap.set(change.id, [change]); + } + } + } + for (const element of elements) { + const changes = changesMap.get(element.id); + /* + * When there are no changes for an element we can just push it unmodified, + * no need to copy it. + */ + if (!changes) { + updatedElements.push(element); + continue; + } + // If we have a 'remove' change queued, it'll be the only change in the array + if (changes[0].type === 'remove') { + continue; + } + if (changes[0].type === 'replace') { + updatedElements.push({ ...changes[0].item }); + continue; + } + /** + * For other types of changes, we want to start with a shallow copy of the + * object so React knows this element has changed. Sequential changes will + * each _mutate_ this object, so there's only ever one copy. + */ + const updatedElement = { ...element }; + for (const change of changes) { + applyChange(change, updatedElement); + } + updatedElements.push(updatedElement); + } + /* + * we need to wait for all changes to be applied before adding new items + * to be able to add them at the correct index + */ + if (addItemChanges.length) { + addItemChanges.forEach((change) => { + if (change.index !== undefined) { + updatedElements.splice(change.index, 0, { ...change.item }); + } + else { + updatedElements.push({ ...change.item }); + } + }); + } + return updatedElements; +} +// Applies a single change to an element. This is a *mutable* update. +function applyChange(change, element) { + switch (change.type) { + case 'select': { + element.selected = change.selected; + break; + } + case 'position': { + if (typeof change.position !== 'undefined') { + element.position = change.position; + } + if (typeof change.dragging !== 'undefined') { + element.dragging = change.dragging; + } + break; + } + case 'dimensions': { + if (typeof change.dimensions !== 'undefined') { + element.measured ??= {}; + element.measured.width = change.dimensions.width; + element.measured.height = change.dimensions.height; + if (change.setAttributes) { + if (change.setAttributes === true || change.setAttributes === 'width') { + element.width = change.dimensions.width; + } + if (change.setAttributes === true || change.setAttributes === 'height') { + element.height = change.dimensions.height; + } + } + } + if (typeof change.resizing === 'boolean') { + element.resizing = change.resizing; + } + break; + } + } +} +/** + * Drop in function that applies node changes to an array of nodes. + * @public + * @param changes - Array of changes to apply. + * @param nodes - Array of nodes to apply the changes to. + * @returns Array of updated nodes. + * @example + *```tsx + *import { useState, useCallback } from 'react'; + *import { ReactFlow, applyNodeChanges, type Node, type Edge, type OnNodesChange } from '@xyflow/react'; + * + *export default function Flow() { + * const [nodes, setNodes] = useState([]); + * const [edges, setEdges] = useState([]); + * const onNodesChange: OnNodesChange = useCallback( + * (changes) => { + * setNodes((oldNodes) => applyNodeChanges(changes, oldNodes)); + * }, + * [setNodes], + * ); + * + * return ( + * + * ); + *} + *``` + * @remarks Various events on the component can produce an {@link NodeChange} + * that describes how to update the edges of your flow in some way. + * If you don't need any custom behaviour, this util can be used to take an array + * of these changes and apply them to your edges. + */ +function applyNodeChanges(changes, nodes) { + return applyChanges(changes, nodes); +} +/** + * Drop in function that applies edge changes to an array of edges. + * @public + * @param changes - Array of changes to apply. + * @param edges - Array of edge to apply the changes to. + * @returns Array of updated edges. + * @example + * ```tsx + *import { useState, useCallback } from 'react'; + *import { ReactFlow, applyEdgeChanges } from '@xyflow/react'; + * + *export default function Flow() { + * const [nodes, setNodes] = useState([]); + * const [edges, setEdges] = useState([]); + * const onEdgesChange = useCallback( + * (changes) => { + * setEdges((oldEdges) => applyEdgeChanges(changes, oldEdges)); + * }, + * [setEdges], + * ); + * + * return ( + * + * ); + *} + *``` + * @remarks Various events on the component can produce an {@link EdgeChange} + * that describes how to update the edges of your flow in some way. + * If you don't need any custom behaviour, this util can be used to take an array + * of these changes and apply them to your edges. + */ +function applyEdgeChanges(changes, edges) { + return applyChanges(changes, edges); +} +function createSelectionChange(id, selected) { + return { + id, + type: 'select', + selected, + }; +} +function getSelectionChanges(items, selectedIds = new Set(), mutateItem = false) { + const changes = []; + for (const [id, item] of items) { + const willBeSelected = selectedIds.has(id); + // we don't want to set all items to selected=false on the first selection + if (!(item.selected === undefined && !willBeSelected) && item.selected !== willBeSelected) { + if (mutateItem) { + /* + * this hack is needed for nodes. When the user dragged a node, it's selected. + * When another node gets dragged, we need to deselect the previous one, + * in order to have only one selected node at a time - the onNodesChange callback comes too late here :/ + */ + item.selected = willBeSelected; + } + changes.push(createSelectionChange(item.id, willBeSelected)); + } + } + return changes; +} +function getElementsDiffChanges({ items = [], lookup, }) { + const changes = []; + const itemsLookup = new Map(items.map((item) => [item.id, item])); + for (const [index, item] of items.entries()) { + const lookupItem = lookup.get(item.id); + const storeItem = lookupItem?.internals?.userNode ?? lookupItem; + if (storeItem !== undefined && storeItem !== item) { + changes.push({ id: item.id, item: item, type: 'replace' }); + } + if (storeItem === undefined) { + changes.push({ item: item, type: 'add', index }); + } + } + for (const [id] of lookup) { + const nextNode = itemsLookup.get(id); + if (nextNode === undefined) { + changes.push({ id, type: 'remove' }); + } + } + return changes; +} +function elementToRemoveChange(item) { + return { + id: item.id, + type: 'remove', + }; +} + +/** + * Test whether an object is usable as an [`Node`](/api-reference/types/node). + * In TypeScript this is a type guard that will narrow the type of whatever you pass in to + * [`Node`](/api-reference/types/node) if it returns `true`. + * + * @public + * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Node if it returns true + * @param element - The element to test. + * @returns Tests whether the provided value can be used as a `Node`. If you're using TypeScript, + * this function acts as a type guard and will narrow the type of the value to `Node` if it returns + * `true`. + * + * @example + * ```js + *import { isNode } from '@xyflow/react'; + * + *if (isNode(node)) { + * // ... + *} + *``` + */ +const isNode = (element) => isNodeBase(element); +/** + * Test whether an object is usable as an [`Edge`](/api-reference/types/edge). + * In TypeScript this is a type guard that will narrow the type of whatever you pass in to + * [`Edge`](/api-reference/types/edge) if it returns `true`. + * + * @public + * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Edge if it returns true + * @param element - The element to test + * @returns Tests whether the provided value can be used as an `Edge`. If you're using TypeScript, + * this function acts as a type guard and will narrow the type of the value to `Edge` if it returns + * `true`. + * + * @example + * ```js + *import { isEdge } from '@xyflow/react'; + * + *if (isEdge(edge)) { + * // ... + *} + *``` + */ +const isEdge = (element) => isEdgeBase(element); +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +function fixedForwardRef(render) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return forwardRef(render); +} + +// we need this hook to prevent a warning when using react-flow in SSR +const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect; + +/** + * This hook returns a queue that can be used to batch updates. + * + * @param runQueue - a function that gets called when the queue is flushed + * @internal + * + * @returns a Queue object + */ +function useQueue(runQueue) { + /* + * Because we're using a ref above, we need some way to let React know when to + * actually process the queue. We increment this number any time we mutate the + * queue, creating a new state to trigger the layout effect below. + * Using a boolean dirty flag here instead would lead to issues related to + * automatic batching. (https://github.com/xyflow/xyflow/issues/4779) + */ + const [serial, setSerial] = useState(BigInt(0)); + /* + * A reference of all the batched updates to process before the next render. We + * want a reference here so multiple synchronous calls to `setNodes` etc can be + * batched together. + */ + const [queue] = useState(() => createQueue(() => setSerial(n => n + BigInt(1)))); + /* + * Layout effects are guaranteed to run before the next render which means we + * shouldn't run into any issues with stale state or weird issues that come from + * rendering things one frame later than expected (we used to use `setTimeout`). + */ + useIsomorphicLayoutEffect(() => { + const queueItems = queue.get(); + if (queueItems.length) { + runQueue(queueItems); + queue.reset(); + } + }, [serial]); + return queue; +} +function createQueue(cb) { + let queue = []; + return { + get: () => queue, + reset: () => { + queue = []; + }, + push: (item) => { + queue.push(item); + cb(); + }, + }; +} + +const BatchContext = createContext(null); +/** + * This is a context provider that holds and processes the node and edge update queues + * that are needed to handle setNodes, addNodes, setEdges and addEdges. + * + * @internal + */ +function BatchProvider({ children, }) { + const store = useStoreApi(); + const nodeQueueHandler = useCallback((queueItems) => { + const { nodes = [], setNodes, hasDefaultNodes, onNodesChange, nodeLookup, fitViewQueued } = store.getState(); + /* + * This is essentially an `Array.reduce` in imperative clothing. Processing + * this queue is a relatively hot path so we'd like to avoid the overhead of + * array methods where we can. + */ + let next = nodes; + for (const payload of queueItems) { + next = typeof payload === 'function' ? payload(next) : payload; + } + const changes = getElementsDiffChanges({ + items: next, + lookup: nodeLookup, + }); + if (hasDefaultNodes) { + setNodes(next); + } + // We only want to fire onNodesChange if there are changes to the nodes + if (changes.length > 0) { + onNodesChange?.(changes); + } + else if (fitViewQueued) { + // If there are no changes to the nodes, we still need to call setNodes + // to trigger a re-render and fitView. + window.requestAnimationFrame(() => { + const { fitViewQueued, nodes, setNodes } = store.getState(); + if (fitViewQueued) { + setNodes(nodes); + } + }); + } + }, []); + const nodeQueue = useQueue(nodeQueueHandler); + const edgeQueueHandler = useCallback((queueItems) => { + const { edges = [], setEdges, hasDefaultEdges, onEdgesChange, edgeLookup } = store.getState(); + let next = edges; + for (const payload of queueItems) { + next = typeof payload === 'function' ? payload(next) : payload; + } + if (hasDefaultEdges) { + setEdges(next); + } + else if (onEdgesChange) { + onEdgesChange(getElementsDiffChanges({ + items: next, + lookup: edgeLookup, + })); + } + }, []); + const edgeQueue = useQueue(edgeQueueHandler); + const value = useMemo(() => ({ nodeQueue, edgeQueue }), []); + return jsx(BatchContext.Provider, { value: value, children: children }); +} +function useBatchContext() { + const batchContext = useContext(BatchContext); + if (!batchContext) { + throw new Error('useBatchContext must be used within a BatchProvider'); + } + return batchContext; +} + +const selector$k = (s) => !!s.panZoom; +/** + * This hook returns a ReactFlowInstance that can be used to update nodes and edges, manipulate the viewport, or query the current state of the flow. + * + * @public + * @example + * ```jsx + *import { useCallback, useState } from 'react'; + *import { useReactFlow } from '@xyflow/react'; + * + *export function NodeCounter() { + * const reactFlow = useReactFlow(); + * const [count, setCount] = useState(0); + * const countNodes = useCallback(() => { + * setCount(reactFlow.getNodes().length); + * // you need to pass it as a dependency if you are using it with useEffect or useCallback + * // because at the first render, it's not initialized yet and some functions might not work. + * }, [reactFlow]); + * + * return ( + *
+ * + *

There are {count} nodes in the flow.

+ *
+ * ); + *} + *``` + */ +function useReactFlow() { + const viewportHelper = useViewportHelper(); + const store = useStoreApi(); + const batchContext = useBatchContext(); + const viewportInitialized = useStore(selector$k); + const generalHelper = useMemo(() => { + const getInternalNode = (id) => store.getState().nodeLookup.get(id); + const setNodes = (payload) => { + batchContext.nodeQueue.push(payload); + }; + const setEdges = (payload) => { + batchContext.edgeQueue.push(payload); + }; + const getNodeRect = (node) => { + const { nodeLookup, nodeOrigin } = store.getState(); + const nodeToUse = isNode(node) ? node : nodeLookup.get(node.id); + const position = nodeToUse.parentId + ? evaluateAbsolutePosition(nodeToUse.position, nodeToUse.measured, nodeToUse.parentId, nodeLookup, nodeOrigin) + : nodeToUse.position; + const nodeWithPosition = { + ...nodeToUse, + position, + width: nodeToUse.measured?.width ?? nodeToUse.width, + height: nodeToUse.measured?.height ?? nodeToUse.height, + }; + return nodeToRect(nodeWithPosition); + }; + const updateNode = (id, nodeUpdate, options = { replace: false }) => { + setNodes((prevNodes) => prevNodes.map((node) => { + if (node.id === id) { + const nextNode = typeof nodeUpdate === 'function' ? nodeUpdate(node) : nodeUpdate; + return options.replace && isNode(nextNode) ? nextNode : { ...node, ...nextNode }; + } + return node; + })); + }; + const updateEdge = (id, edgeUpdate, options = { replace: false }) => { + setEdges((prevEdges) => prevEdges.map((edge) => { + if (edge.id === id) { + const nextEdge = typeof edgeUpdate === 'function' ? edgeUpdate(edge) : edgeUpdate; + return options.replace && isEdge(nextEdge) ? nextEdge : { ...edge, ...nextEdge }; + } + return edge; + })); + }; + return { + getNodes: () => store.getState().nodes.map((n) => ({ ...n })), + getNode: (id) => getInternalNode(id)?.internals.userNode, + getInternalNode, + getEdges: () => { + const { edges = [] } = store.getState(); + return edges.map((e) => ({ ...e })); + }, + getEdge: (id) => store.getState().edgeLookup.get(id), + setNodes, + setEdges, + addNodes: (payload) => { + const newNodes = Array.isArray(payload) ? payload : [payload]; + batchContext.nodeQueue.push((nodes) => [...nodes, ...newNodes]); + }, + addEdges: (payload) => { + const newEdges = Array.isArray(payload) ? payload : [payload]; + batchContext.edgeQueue.push((edges) => [...edges, ...newEdges]); + }, + toObject: () => { + const { nodes = [], edges = [], transform } = store.getState(); + const [x, y, zoom] = transform; + return { + nodes: nodes.map((n) => ({ ...n })), + edges: edges.map((e) => ({ ...e })), + viewport: { + x, + y, + zoom, + }, + }; + }, + deleteElements: async ({ nodes: nodesToRemove = [], edges: edgesToRemove = [] }) => { + const { nodes, edges, onNodesDelete, onEdgesDelete, triggerNodeChanges, triggerEdgeChanges, onDelete, onBeforeDelete, } = store.getState(); + const { nodes: matchingNodes, edges: matchingEdges } = await getElementsToRemove({ + nodesToRemove, + edgesToRemove, + nodes, + edges, + onBeforeDelete, + }); + const hasMatchingEdges = matchingEdges.length > 0; + const hasMatchingNodes = matchingNodes.length > 0; + if (hasMatchingEdges) { + const edgeChanges = matchingEdges.map(elementToRemoveChange); + onEdgesDelete?.(matchingEdges); + triggerEdgeChanges(edgeChanges); + } + if (hasMatchingNodes) { + const nodeChanges = matchingNodes.map(elementToRemoveChange); + onNodesDelete?.(matchingNodes); + triggerNodeChanges(nodeChanges); + } + if (hasMatchingNodes || hasMatchingEdges) { + onDelete?.({ nodes: matchingNodes, edges: matchingEdges }); + } + return { deletedNodes: matchingNodes, deletedEdges: matchingEdges }; + }, + getIntersectingNodes: (nodeOrRect, partially = true, nodes) => { + const isRect = isRectObject(nodeOrRect); + const nodeRect = isRect ? nodeOrRect : getNodeRect(nodeOrRect); + const hasNodesOption = nodes !== undefined; + if (!nodeRect) { + return []; + } + return (nodes || store.getState().nodes).filter((n) => { + const internalNode = store.getState().nodeLookup.get(n.id); + if (internalNode && !isRect && (n.id === nodeOrRect.id || !internalNode.internals.positionAbsolute)) { + return false; + } + const currNodeRect = nodeToRect(hasNodesOption ? n : internalNode); + const overlappingArea = getOverlappingArea(currNodeRect, nodeRect); + const partiallyVisible = partially && overlappingArea > 0; + return partiallyVisible || overlappingArea >= nodeRect.width * nodeRect.height; + }); + }, + isNodeIntersecting: (nodeOrRect, area, partially = true) => { + const isRect = isRectObject(nodeOrRect); + const nodeRect = isRect ? nodeOrRect : getNodeRect(nodeOrRect); + if (!nodeRect) { + return false; + } + const overlappingArea = getOverlappingArea(nodeRect, area); + const partiallyVisible = partially && overlappingArea > 0; + return partiallyVisible || overlappingArea >= nodeRect.width * nodeRect.height; + }, + updateNode, + updateNodeData: (id, dataUpdate, options = { replace: false }) => { + updateNode(id, (node) => { + const nextData = typeof dataUpdate === 'function' ? dataUpdate(node) : dataUpdate; + return options.replace ? { ...node, data: nextData } : { ...node, data: { ...node.data, ...nextData } }; + }, options); + }, + updateEdge, + updateEdgeData: (id, dataUpdate, options = { replace: false }) => { + updateEdge(id, (edge) => { + const nextData = typeof dataUpdate === 'function' ? dataUpdate(edge) : dataUpdate; + return options.replace ? { ...edge, data: nextData } : { ...edge, data: { ...edge.data, ...nextData } }; + }, options); + }, + getNodesBounds: (nodes) => { + const { nodeLookup, nodeOrigin } = store.getState(); + return getNodesBounds(nodes, { nodeLookup, nodeOrigin }); + }, + getHandleConnections: ({ type, id, nodeId }) => Array.from(store + .getState() + .connectionLookup.get(`${nodeId}-${type}${id ? `-${id}` : ''}`) + ?.values() ?? []), + getNodeConnections: ({ type, handleId, nodeId }) => Array.from(store + .getState() + .connectionLookup.get(`${nodeId}${type ? (handleId ? `-${type}-${handleId}` : `-${type}`) : ''}`) + ?.values() ?? []), + fitView: async (options) => { + // We either create a new Promise or reuse the existing one + // Even if fitView is called multiple times in a row, we only end up with a single Promise + const fitViewResolver = store.getState().fitViewResolver ?? withResolvers(); + // We schedule a fitView by setting fitViewQueued and triggering a setNodes + store.setState({ fitViewQueued: true, fitViewOptions: options, fitViewResolver }); + batchContext.nodeQueue.push((nodes) => [...nodes]); + return fitViewResolver.promise; + }, + }; + }, []); + return useMemo(() => { + return { + ...generalHelper, + ...viewportHelper, + viewportInitialized, + }; + }, [viewportInitialized]); +} + +const selected = (item) => item.selected; +const win$1 = typeof window !== 'undefined' ? window : undefined; +/** + * Hook for handling global key events. + * + * @internal + */ +function useGlobalKeyHandler({ deleteKeyCode, multiSelectionKeyCode, }) { + const store = useStoreApi(); + const { deleteElements } = useReactFlow(); + const deleteKeyPressed = useKeyPress(deleteKeyCode, { actInsideInputWithModifier: false }); + const multiSelectionKeyPressed = useKeyPress(multiSelectionKeyCode, { target: win$1 }); + useEffect(() => { + if (deleteKeyPressed) { + const { edges, nodes } = store.getState(); + deleteElements({ nodes: nodes.filter(selected), edges: edges.filter(selected) }); + store.setState({ nodesSelectionActive: false }); + } + }, [deleteKeyPressed]); + useEffect(() => { + store.setState({ multiSelectionActive: multiSelectionKeyPressed }); + }, [multiSelectionKeyPressed]); +} + +/** + * Hook for handling resize events. + * + * @internal + */ +function useResizeHandler(domNode) { + const store = useStoreApi(); + useEffect(() => { + const updateDimensions = () => { + if (!domNode.current) { + return false; + } + const size = getDimensions(domNode.current); + if (size.height === 0 || size.width === 0) { + store.getState().onError?.('004', errorMessages['error004']()); + } + store.setState({ width: size.width || 500, height: size.height || 500 }); + }; + if (domNode.current) { + updateDimensions(); + window.addEventListener('resize', updateDimensions); + const resizeObserver = new ResizeObserver(() => updateDimensions()); + resizeObserver.observe(domNode.current); + return () => { + window.removeEventListener('resize', updateDimensions); + if (resizeObserver && domNode.current) { + resizeObserver.unobserve(domNode.current); + } + }; + } + }, []); +} + +const containerStyle = { + position: 'absolute', + width: '100%', + height: '100%', + top: 0, + left: 0, +}; + +const selector$j = (s) => ({ + userSelectionActive: s.userSelectionActive, + lib: s.lib, +}); +function ZoomPane({ onPaneContextMenu, zoomOnScroll = true, zoomOnPinch = true, panOnScroll = false, panOnScrollSpeed = 0.5, panOnScrollMode = PanOnScrollMode.Free, zoomOnDoubleClick = true, panOnDrag = true, defaultViewport, translateExtent, minZoom, maxZoom, zoomActivationKeyCode, preventScrolling = true, children, noWheelClassName, noPanClassName, onViewportChange, isControlledViewport, paneClickDistance, }) { + const store = useStoreApi(); + const zoomPane = useRef(null); + const { userSelectionActive, lib } = useStore(selector$j, shallow); + const zoomActivationKeyPressed = useKeyPress(zoomActivationKeyCode); + const panZoom = useRef(); + useResizeHandler(zoomPane); + const onTransformChange = useCallback((transform) => { + onViewportChange?.({ x: transform[0], y: transform[1], zoom: transform[2] }); + if (!isControlledViewport) { + store.setState({ transform }); + } + }, [onViewportChange, isControlledViewport]); + useEffect(() => { + if (zoomPane.current) { + panZoom.current = XYPanZoom({ + domNode: zoomPane.current, + minZoom, + maxZoom, + translateExtent, + viewport: defaultViewport, + paneClickDistance, + onDraggingChange: (paneDragging) => store.setState({ paneDragging }), + onPanZoomStart: (event, vp) => { + const { onViewportChangeStart, onMoveStart } = store.getState(); + onMoveStart?.(event, vp); + onViewportChangeStart?.(vp); + }, + onPanZoom: (event, vp) => { + const { onViewportChange, onMove } = store.getState(); + onMove?.(event, vp); + onViewportChange?.(vp); + }, + onPanZoomEnd: (event, vp) => { + const { onViewportChangeEnd, onMoveEnd } = store.getState(); + onMoveEnd?.(event, vp); + onViewportChangeEnd?.(vp); + }, + }); + const { x, y, zoom } = panZoom.current.getViewport(); + store.setState({ + panZoom: panZoom.current, + transform: [x, y, zoom], + domNode: zoomPane.current.closest('.react-flow'), + }); + return () => { + panZoom.current?.destroy(); + }; + } + }, []); + useEffect(() => { + panZoom.current?.update({ + onPaneContextMenu, + zoomOnScroll, + zoomOnPinch, + panOnScroll, + panOnScrollSpeed, + panOnScrollMode, + zoomOnDoubleClick, + panOnDrag, + zoomActivationKeyPressed, + preventScrolling, + noPanClassName, + userSelectionActive, + noWheelClassName, + lib, + onTransformChange, + }); + }, [ + onPaneContextMenu, + zoomOnScroll, + zoomOnPinch, + panOnScroll, + panOnScrollSpeed, + panOnScrollMode, + zoomOnDoubleClick, + panOnDrag, + zoomActivationKeyPressed, + preventScrolling, + noPanClassName, + userSelectionActive, + noWheelClassName, + lib, + onTransformChange, + ]); + return (jsx("div", { className: "react-flow__renderer", ref: zoomPane, style: containerStyle, children: children })); +} + +const selector$i = (s) => ({ + userSelectionActive: s.userSelectionActive, + userSelectionRect: s.userSelectionRect, +}); +function UserSelection() { + const { userSelectionActive, userSelectionRect } = useStore(selector$i, shallow); + const isActive = userSelectionActive && userSelectionRect; + if (!isActive) { + return null; + } + return (jsx("div", { className: "react-flow__selection react-flow__container", style: { + width: userSelectionRect.width, + height: userSelectionRect.height, + transform: `translate(${userSelectionRect.x}px, ${userSelectionRect.y}px)`, + } })); +} + +const wrapHandler = (handler, containerRef) => { + return (event) => { + if (event.target !== containerRef.current) { + return; + } + handler?.(event); + }; +}; +const selector$h = (s) => ({ + userSelectionActive: s.userSelectionActive, + elementsSelectable: s.elementsSelectable, + connectionInProgress: s.connection.inProgress, + dragging: s.paneDragging, +}); +function Pane({ isSelecting, selectionKeyPressed, selectionMode = SelectionMode.Full, panOnDrag, selectionOnDrag, onSelectionStart, onSelectionEnd, onPaneClick, onPaneContextMenu, onPaneScroll, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, children, }) { + const store = useStoreApi(); + const { userSelectionActive, elementsSelectable, dragging, connectionInProgress } = useStore(selector$h, shallow); + const hasActiveSelection = elementsSelectable && (isSelecting || userSelectionActive); + const container = useRef(null); + const containerBounds = useRef(); + const selectedNodeIds = useRef(new Set()); + const selectedEdgeIds = useRef(new Set()); + // Used to prevent click events when the user lets go of the selectionKey during a selection + const selectionInProgress = useRef(false); + const selectionStarted = useRef(false); + const onClick = (event) => { + // We prevent click events when the user let go of the selectionKey during a selection + // We also prevent click events when a connection is in progress + if (selectionInProgress.current || connectionInProgress) { + selectionInProgress.current = false; + return; + } + onPaneClick?.(event); + store.getState().resetSelectedElements(); + store.setState({ nodesSelectionActive: false }); + }; + const onContextMenu = (event) => { + if (Array.isArray(panOnDrag) && panOnDrag?.includes(2)) { + event.preventDefault(); + return; + } + onPaneContextMenu?.(event); + }; + const onWheel = onPaneScroll ? (event) => onPaneScroll(event) : undefined; + const onPointerDown = (event) => { + const { resetSelectedElements, domNode } = store.getState(); + containerBounds.current = domNode?.getBoundingClientRect(); + if (!elementsSelectable || + !isSelecting || + event.button !== 0 || + event.target !== container.current || + !containerBounds.current) { + return; + } + event.target?.setPointerCapture?.(event.pointerId); + selectionStarted.current = true; + selectionInProgress.current = false; + const { x, y } = getEventPosition(event.nativeEvent, containerBounds.current); + resetSelectedElements(); + store.setState({ + userSelectionRect: { + width: 0, + height: 0, + startX: x, + startY: y, + x, + y, + }, + }); + onSelectionStart?.(event); + }; + const onPointerMove = (event) => { + const { userSelectionRect, transform, nodeLookup, edgeLookup, connectionLookup, triggerNodeChanges, triggerEdgeChanges, defaultEdgeOptions, } = store.getState(); + if (!containerBounds.current || !userSelectionRect) { + return; + } + selectionInProgress.current = true; + const { x: mouseX, y: mouseY } = getEventPosition(event.nativeEvent, containerBounds.current); + const { startX, startY } = userSelectionRect; + const nextUserSelectRect = { + startX, + startY, + x: mouseX < startX ? mouseX : startX, + y: mouseY < startY ? mouseY : startY, + width: Math.abs(mouseX - startX), + height: Math.abs(mouseY - startY), + }; + const prevSelectedNodeIds = selectedNodeIds.current; + const prevSelectedEdgeIds = selectedEdgeIds.current; + selectedNodeIds.current = new Set(getNodesInside(nodeLookup, nextUserSelectRect, transform, selectionMode === SelectionMode.Partial, true).map((node) => node.id)); + selectedEdgeIds.current = new Set(); + const edgesSelectable = defaultEdgeOptions?.selectable ?? true; + // We look for all edges connected to the selected nodes + for (const nodeId of selectedNodeIds.current) { + const connections = connectionLookup.get(nodeId); + if (!connections) + continue; + for (const { edgeId } of connections.values()) { + const edge = edgeLookup.get(edgeId); + if (edge && (edge.selectable ?? edgesSelectable)) { + selectedEdgeIds.current.add(edgeId); + } + } + } + if (!areSetsEqual(prevSelectedNodeIds, selectedNodeIds.current)) { + const changes = getSelectionChanges(nodeLookup, selectedNodeIds.current, true); + triggerNodeChanges(changes); + } + if (!areSetsEqual(prevSelectedEdgeIds, selectedEdgeIds.current)) { + const changes = getSelectionChanges(edgeLookup, selectedEdgeIds.current); + triggerEdgeChanges(changes); + } + store.setState({ + userSelectionRect: nextUserSelectRect, + userSelectionActive: true, + nodesSelectionActive: false, + }); + }; + const onPointerUp = (event) => { + if (event.button !== 0 || !selectionStarted.current) { + return; + } + event.target?.releasePointerCapture?.(event.pointerId); + const { userSelectionRect } = store.getState(); + /* + * We only want to trigger click functions when in selection mode if + * the user did not move the mouse. + */ + if (!userSelectionActive && userSelectionRect && event.target === container.current) { + onClick?.(event); + } + store.setState({ + userSelectionActive: false, + userSelectionRect: null, + nodesSelectionActive: selectedNodeIds.current.size > 0, + }); + onSelectionEnd?.(event); + /* + * If the user kept holding the selectionKey during the selection, + * we need to reset the selectionInProgress, so the next click event is not prevented + */ + if (selectionKeyPressed || selectionOnDrag) { + selectionInProgress.current = false; + } + selectionStarted.current = false; + }; + const draggable = panOnDrag === true || (Array.isArray(panOnDrag) && panOnDrag.includes(0)); + return (jsxs("div", { className: cc(['react-flow__pane', { draggable, dragging, selection: isSelecting }]), onClick: hasActiveSelection ? undefined : wrapHandler(onClick, container), onContextMenu: wrapHandler(onContextMenu, container), onWheel: wrapHandler(onWheel, container), onPointerEnter: hasActiveSelection ? undefined : onPaneMouseEnter, onPointerDown: hasActiveSelection ? onPointerDown : onPaneMouseMove, onPointerMove: hasActiveSelection ? onPointerMove : onPaneMouseMove, onPointerUp: hasActiveSelection ? onPointerUp : undefined, onPointerLeave: onPaneMouseLeave, ref: container, style: containerStyle, children: [children, jsx(UserSelection, {})] })); +} + +/* + * this handler is called by + * 1. the click handler when node is not draggable or selectNodesOnDrag = false + * or + * 2. the on drag start handler when node is draggable and selectNodesOnDrag = true + */ +function handleNodeClick({ id, store, unselect = false, nodeRef, }) { + const { addSelectedNodes, unselectNodesAndEdges, multiSelectionActive, nodeLookup, onError } = store.getState(); + const node = nodeLookup.get(id); + if (!node) { + onError?.('012', errorMessages['error012'](id)); + return; + } + store.setState({ nodesSelectionActive: false }); + if (!node.selected) { + addSelectedNodes([id]); + } + else if (unselect || (node.selected && multiSelectionActive)) { + unselectNodesAndEdges({ nodes: [node], edges: [] }); + requestAnimationFrame(() => nodeRef?.current?.blur()); + } +} + +/** + * Hook for calling XYDrag helper from @xyflow/system. + * + * @internal + */ +function useDrag({ nodeRef, disabled = false, noDragClassName, handleSelector, nodeId, isSelectable, nodeClickDistance, }) { + const store = useStoreApi(); + const [dragging, setDragging] = useState(false); + const xyDrag = useRef(); + useEffect(() => { + xyDrag.current = XYDrag({ + getStoreItems: () => store.getState(), + onNodeMouseDown: (id) => { + handleNodeClick({ + id, + store, + nodeRef, + }); + }, + onDragStart: () => { + setDragging(true); + }, + onDragStop: () => { + setDragging(false); + }, + }); + }, []); + useEffect(() => { + if (disabled) { + xyDrag.current?.destroy(); + } + else if (nodeRef.current) { + xyDrag.current?.update({ + noDragClassName, + handleSelector, + domNode: nodeRef.current, + isSelectable, + nodeId, + nodeClickDistance, + }); + return () => { + xyDrag.current?.destroy(); + }; + } + }, [noDragClassName, handleSelector, disabled, isSelectable, nodeRef, nodeId]); + return dragging; +} + +const selectedAndDraggable = (nodesDraggable) => (n) => n.selected && (n.draggable || (nodesDraggable && typeof n.draggable === 'undefined')); +/** + * Hook for updating node positions by passing a direction and factor + * + * @internal + * @returns function for updating node positions + */ +function useMoveSelectedNodes() { + const store = useStoreApi(); + const moveSelectedNodes = useCallback((params) => { + const { nodeExtent, snapToGrid, snapGrid, nodesDraggable, onError, updateNodePositions, nodeLookup, nodeOrigin } = store.getState(); + const nodeUpdates = new Map(); + const isSelected = selectedAndDraggable(nodesDraggable); + /* + * by default a node moves 5px on each key press + * if snap grid is enabled, we use that for the velocity + */ + const xVelo = snapToGrid ? snapGrid[0] : 5; + const yVelo = snapToGrid ? snapGrid[1] : 5; + const xDiff = params.direction.x * xVelo * params.factor; + const yDiff = params.direction.y * yVelo * params.factor; + for (const [, node] of nodeLookup) { + if (!isSelected(node)) { + continue; + } + let nextPosition = { + x: node.internals.positionAbsolute.x + xDiff, + y: node.internals.positionAbsolute.y + yDiff, + }; + if (snapToGrid) { + nextPosition = snapPosition(nextPosition, snapGrid); + } + const { position, positionAbsolute } = calculateNodePosition({ + nodeId: node.id, + nextPosition, + nodeLookup, + nodeExtent, + nodeOrigin, + onError, + }); + node.position = position; + node.internals.positionAbsolute = positionAbsolute; + nodeUpdates.set(node.id, node); + } + updateNodePositions(nodeUpdates); + }, []); + return moveSelectedNodes; +} + +const NodeIdContext = createContext(null); +const Provider = NodeIdContext.Provider; +NodeIdContext.Consumer; +/** + * You can use this hook to get the id of the node it is used inside. It is useful + * if you need the node's id deeper in the render tree but don't want to manually + * drill down the id as a prop. + * + * @public + * @returns The id for a node in the flow. + * + * @example + *```jsx + *import { useNodeId } from '@xyflow/react'; + * + *export default function CustomNode() { + * return ( + *
+ * This node has an id of + * + *
+ * ); + *} + * + *function NodeIdDisplay() { + * const nodeId = useNodeId(); + * + * return {nodeId}; + *} + *``` + */ +const useNodeId = () => { + const nodeId = useContext(NodeIdContext); + return nodeId; +}; + +const selector$g = (s) => ({ + connectOnClick: s.connectOnClick, + noPanClassName: s.noPanClassName, + rfId: s.rfId, +}); +const connectingSelector = (nodeId, handleId, type) => (state) => { + const { connectionClickStartHandle: clickHandle, connectionMode, connection } = state; + const { fromHandle, toHandle, isValid } = connection; + const connectingTo = toHandle?.nodeId === nodeId && toHandle?.id === handleId && toHandle?.type === type; + return { + connectingFrom: fromHandle?.nodeId === nodeId && fromHandle?.id === handleId && fromHandle?.type === type, + connectingTo, + clickConnecting: clickHandle?.nodeId === nodeId && clickHandle?.id === handleId && clickHandle?.type === type, + isPossibleEndHandle: connectionMode === ConnectionMode.Strict + ? fromHandle?.type !== type + : nodeId !== fromHandle?.nodeId || handleId !== fromHandle?.id, + connectionInProcess: !!fromHandle, + clickConnectionInProcess: !!clickHandle, + valid: connectingTo && isValid, + }; +}; +function HandleComponent({ type = 'source', position = Position.Top, isValidConnection, isConnectable = true, isConnectableStart = true, isConnectableEnd = true, id, onConnect, children, className, onMouseDown, onTouchStart, ...rest }, ref) { + const handleId = id || null; + const isTarget = type === 'target'; + const store = useStoreApi(); + const nodeId = useNodeId(); + const { connectOnClick, noPanClassName, rfId } = useStore(selector$g, shallow); + const { connectingFrom, connectingTo, clickConnecting, isPossibleEndHandle, connectionInProcess, clickConnectionInProcess, valid, } = useStore(connectingSelector(nodeId, handleId, type), shallow); + if (!nodeId) { + store.getState().onError?.('010', errorMessages['error010']()); + } + const onConnectExtended = (params) => { + const { defaultEdgeOptions, onConnect: onConnectAction, hasDefaultEdges } = store.getState(); + const edgeParams = { + ...defaultEdgeOptions, + ...params, + }; + if (hasDefaultEdges) { + const { edges, setEdges } = store.getState(); + setEdges(addEdge(edgeParams, edges)); + } + onConnectAction?.(edgeParams); + onConnect?.(edgeParams); + }; + const onPointerDown = (event) => { + if (!nodeId) { + return; + } + const isMouseTriggered = isMouseEvent(event.nativeEvent); + if (isConnectableStart && + ((isMouseTriggered && event.button === 0) || !isMouseTriggered)) { + const currentStore = store.getState(); + XYHandle.onPointerDown(event.nativeEvent, { + autoPanOnConnect: currentStore.autoPanOnConnect, + connectionMode: currentStore.connectionMode, + connectionRadius: currentStore.connectionRadius, + domNode: currentStore.domNode, + nodeLookup: currentStore.nodeLookup, + lib: currentStore.lib, + isTarget, + handleId, + nodeId, + flowId: currentStore.rfId, + panBy: currentStore.panBy, + cancelConnection: currentStore.cancelConnection, + onConnectStart: currentStore.onConnectStart, + onConnectEnd: currentStore.onConnectEnd, + updateConnection: currentStore.updateConnection, + onConnect: onConnectExtended, + isValidConnection: isValidConnection || currentStore.isValidConnection, + getTransform: () => store.getState().transform, + getFromHandle: () => store.getState().connection.fromHandle, + autoPanSpeed: currentStore.autoPanSpeed, + }); + } + if (isMouseTriggered) { + onMouseDown?.(event); + } + else { + onTouchStart?.(event); + } + }; + const onClick = (event) => { + const { onClickConnectStart, onClickConnectEnd, connectionClickStartHandle, connectionMode, isValidConnection: isValidConnectionStore, lib, rfId: flowId, nodeLookup, connection: connectionState, } = store.getState(); + if (!nodeId || (!connectionClickStartHandle && !isConnectableStart)) { + return; + } + if (!connectionClickStartHandle) { + onClickConnectStart?.(event.nativeEvent, { nodeId, handleId, handleType: type }); + store.setState({ connectionClickStartHandle: { nodeId, type, id: handleId } }); + return; + } + const doc = getHostForElement(event.target); + const isValidConnectionHandler = isValidConnection || isValidConnectionStore; + const { connection, isValid } = XYHandle.isValid(event.nativeEvent, { + handle: { + nodeId, + id: handleId, + type, + }, + connectionMode, + fromNodeId: connectionClickStartHandle.nodeId, + fromHandleId: connectionClickStartHandle.id || null, + fromType: connectionClickStartHandle.type, + isValidConnection: isValidConnectionHandler, + flowId, + doc, + lib, + nodeLookup, + }); + if (isValid && connection) { + onConnectExtended(connection); + } + const connectionClone = structuredClone(connectionState); + delete connectionClone.inProgress; + connectionClone.toPosition = connectionClone.toHandle ? connectionClone.toHandle.position : null; + onClickConnectEnd?.(event, connectionClone); + store.setState({ connectionClickStartHandle: null }); + }; + return (jsx("div", { "data-handleid": handleId, "data-nodeid": nodeId, "data-handlepos": position, "data-id": `${rfId}-${nodeId}-${handleId}-${type}`, className: cc([ + 'react-flow__handle', + `react-flow__handle-${position}`, + 'nodrag', + noPanClassName, + className, + { + source: !isTarget, + target: isTarget, + connectable: isConnectable, + connectablestart: isConnectableStart, + connectableend: isConnectableEnd, + clickconnecting: clickConnecting, + connectingfrom: connectingFrom, + connectingto: connectingTo, + valid, + /* + * shows where you can start a connection from + * and where you can end it while connecting + */ + connectionindicator: isConnectable && + (!connectionInProcess || isPossibleEndHandle) && + (connectionInProcess || clickConnectionInProcess ? isConnectableEnd : isConnectableStart), + }, + ]), onMouseDown: onPointerDown, onTouchStart: onPointerDown, onClick: connectOnClick ? onClick : undefined, ref: ref, ...rest, children: children })); +} +/** + * The `` component is used in your [custom nodes](/learn/customization/custom-nodes) + * to define connection points. + * + *@public + * + *@example + * + *```jsx + *import { Handle, Position } from '@xyflow/react'; + * + *export function CustomNode({ data }) { + * return ( + * <> + *
+ * {data.label} + *
+ * + * + * + * + * ); + *}; + *``` + */ +const Handle = memo(fixedForwardRef(HandleComponent)); + +function InputNode({ data, isConnectable, sourcePosition = Position.Bottom }) { + return (jsxs(Fragment, { children: [data?.label, jsx(Handle, { type: "source", position: sourcePosition, isConnectable: isConnectable })] })); +} + +function DefaultNode({ data, isConnectable, targetPosition = Position.Top, sourcePosition = Position.Bottom, }) { + return (jsxs(Fragment, { children: [jsx(Handle, { type: "target", position: targetPosition, isConnectable: isConnectable }), data?.label, jsx(Handle, { type: "source", position: sourcePosition, isConnectable: isConnectable })] })); +} + +function GroupNode() { + return null; +} + +function OutputNode({ data, isConnectable, targetPosition = Position.Top }) { + return (jsxs(Fragment, { children: [jsx(Handle, { type: "target", position: targetPosition, isConnectable: isConnectable }), data?.label] })); +} + +const arrowKeyDiffs = { + ArrowUp: { x: 0, y: -1 }, + ArrowDown: { x: 0, y: 1 }, + ArrowLeft: { x: -1, y: 0 }, + ArrowRight: { x: 1, y: 0 }, +}; +const builtinNodeTypes = { + input: InputNode, + default: DefaultNode, + output: OutputNode, + group: GroupNode, +}; +function getNodeInlineStyleDimensions(node) { + if (node.internals.handleBounds === undefined) { + return { + width: node.width ?? node.initialWidth ?? node.style?.width, + height: node.height ?? node.initialHeight ?? node.style?.height, + }; + } + return { + width: node.width ?? node.style?.width, + height: node.height ?? node.style?.height, + }; +} + +const selector$f = (s) => { + const { width, height, x, y } = getInternalNodesBounds(s.nodeLookup, { + filter: (node) => !!node.selected, + }); + return { + width: isNumeric(width) ? width : null, + height: isNumeric(height) ? height : null, + userSelectionActive: s.userSelectionActive, + transformString: `translate(${s.transform[0]}px,${s.transform[1]}px) scale(${s.transform[2]}) translate(${x}px,${y}px)`, + }; +}; +function NodesSelection({ onSelectionContextMenu, noPanClassName, disableKeyboardA11y, }) { + const store = useStoreApi(); + const { width, height, transformString, userSelectionActive } = useStore(selector$f, shallow); + const moveSelectedNodes = useMoveSelectedNodes(); + const nodeRef = useRef(null); + useEffect(() => { + if (!disableKeyboardA11y) { + nodeRef.current?.focus({ + preventScroll: true, + }); + } + }, [disableKeyboardA11y]); + useDrag({ + nodeRef, + }); + if (userSelectionActive || !width || !height) { + return null; + } + const onContextMenu = onSelectionContextMenu + ? (event) => { + const selectedNodes = store.getState().nodes.filter((n) => n.selected); + onSelectionContextMenu(event, selectedNodes); + } + : undefined; + const onKeyDown = (event) => { + if (Object.prototype.hasOwnProperty.call(arrowKeyDiffs, event.key)) { + event.preventDefault(); + moveSelectedNodes({ + direction: arrowKeyDiffs[event.key], + factor: event.shiftKey ? 4 : 1, + }); + } + }; + return (jsx("div", { className: cc(['react-flow__nodesselection', 'react-flow__container', noPanClassName]), style: { + transform: transformString, + }, children: jsx("div", { ref: nodeRef, className: "react-flow__nodesselection-rect", onContextMenu: onContextMenu, tabIndex: disableKeyboardA11y ? undefined : -1, onKeyDown: disableKeyboardA11y ? undefined : onKeyDown, style: { + width, + height, + } }) })); +} + +const win = typeof window !== 'undefined' ? window : undefined; +const selector$e = (s) => { + return { nodesSelectionActive: s.nodesSelectionActive, userSelectionActive: s.userSelectionActive }; +}; +function FlowRendererComponent({ children, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneContextMenu, onPaneScroll, paneClickDistance, deleteKeyCode, selectionKeyCode, selectionOnDrag, selectionMode, onSelectionStart, onSelectionEnd, multiSelectionKeyCode, panActivationKeyCode, zoomActivationKeyCode, elementsSelectable, zoomOnScroll, zoomOnPinch, panOnScroll: _panOnScroll, panOnScrollSpeed, panOnScrollMode, zoomOnDoubleClick, panOnDrag: _panOnDrag, defaultViewport, translateExtent, minZoom, maxZoom, preventScrolling, onSelectionContextMenu, noWheelClassName, noPanClassName, disableKeyboardA11y, onViewportChange, isControlledViewport, }) { + const { nodesSelectionActive, userSelectionActive } = useStore(selector$e); + const selectionKeyPressed = useKeyPress(selectionKeyCode, { target: win }); + const panActivationKeyPressed = useKeyPress(panActivationKeyCode, { target: win }); + const panOnDrag = panActivationKeyPressed || _panOnDrag; + const panOnScroll = panActivationKeyPressed || _panOnScroll; + const _selectionOnDrag = selectionOnDrag && panOnDrag !== true; + const isSelecting = selectionKeyPressed || userSelectionActive || _selectionOnDrag; + useGlobalKeyHandler({ deleteKeyCode, multiSelectionKeyCode }); + return (jsx(ZoomPane, { onPaneContextMenu: onPaneContextMenu, elementsSelectable: elementsSelectable, zoomOnScroll: zoomOnScroll, zoomOnPinch: zoomOnPinch, panOnScroll: panOnScroll, panOnScrollSpeed: panOnScrollSpeed, panOnScrollMode: panOnScrollMode, zoomOnDoubleClick: zoomOnDoubleClick, panOnDrag: !selectionKeyPressed && panOnDrag, defaultViewport: defaultViewport, translateExtent: translateExtent, minZoom: minZoom, maxZoom: maxZoom, zoomActivationKeyCode: zoomActivationKeyCode, preventScrolling: preventScrolling, noWheelClassName: noWheelClassName, noPanClassName: noPanClassName, onViewportChange: onViewportChange, isControlledViewport: isControlledViewport, paneClickDistance: paneClickDistance, children: jsxs(Pane, { onSelectionStart: onSelectionStart, onSelectionEnd: onSelectionEnd, onPaneClick: onPaneClick, onPaneMouseEnter: onPaneMouseEnter, onPaneMouseMove: onPaneMouseMove, onPaneMouseLeave: onPaneMouseLeave, onPaneContextMenu: onPaneContextMenu, onPaneScroll: onPaneScroll, panOnDrag: panOnDrag, isSelecting: !!isSelecting, selectionMode: selectionMode, selectionKeyPressed: selectionKeyPressed, selectionOnDrag: _selectionOnDrag, children: [children, nodesSelectionActive && (jsx(NodesSelection, { onSelectionContextMenu: onSelectionContextMenu, noPanClassName: noPanClassName, disableKeyboardA11y: disableKeyboardA11y }))] }) })); +} +FlowRendererComponent.displayName = 'FlowRenderer'; +const FlowRenderer = memo(FlowRendererComponent); + +const selector$d = (onlyRenderVisible) => (s) => { + return onlyRenderVisible + ? getNodesInside(s.nodeLookup, { x: 0, y: 0, width: s.width, height: s.height }, s.transform, true).map((node) => node.id) + : Array.from(s.nodeLookup.keys()); +}; +/** + * Hook for getting the visible node ids from the store. + * + * @internal + * @param onlyRenderVisible + * @returns array with visible node ids + */ +function useVisibleNodeIds(onlyRenderVisible) { + const nodeIds = useStore(useCallback(selector$d(onlyRenderVisible), [onlyRenderVisible]), shallow); + return nodeIds; +} + +const selector$c = (s) => s.updateNodeInternals; +function useResizeObserver() { + const updateNodeInternals = useStore(selector$c); + const [resizeObserver] = useState(() => { + if (typeof ResizeObserver === 'undefined') { + return null; + } + return new ResizeObserver((entries) => { + const updates = new Map(); + entries.forEach((entry) => { + const id = entry.target.getAttribute('data-id'); + updates.set(id, { + id, + nodeElement: entry.target, + force: true, + }); + }); + updateNodeInternals(updates); + }); + }); + useEffect(() => { + return () => { + resizeObserver?.disconnect(); + }; + }, [resizeObserver]); + return resizeObserver; +} + +/** + * Hook to handle the resize observation + internal updates for the passed node. + * + * @internal + * @returns nodeRef - reference to the node element + */ +function useNodeObserver({ node, nodeType, hasDimensions, resizeObserver, }) { + const store = useStoreApi(); + const nodeRef = useRef(null); + const observedNode = useRef(null); + const prevSourcePosition = useRef(node.sourcePosition); + const prevTargetPosition = useRef(node.targetPosition); + const prevType = useRef(nodeType); + const isInitialized = hasDimensions && !!node.internals.handleBounds; + useEffect(() => { + if (nodeRef.current && !node.hidden && (!isInitialized || observedNode.current !== nodeRef.current)) { + if (observedNode.current) { + resizeObserver?.unobserve(observedNode.current); + } + resizeObserver?.observe(nodeRef.current); + observedNode.current = nodeRef.current; + } + }, [isInitialized, node.hidden]); + useEffect(() => { + return () => { + if (observedNode.current) { + resizeObserver?.unobserve(observedNode.current); + observedNode.current = null; + } + }; + }, []); + useEffect(() => { + if (nodeRef.current) { + /* + * when the user programmatically changes the source or handle position, we need to update the internals + * to make sure the edges are updated correctly + */ + const typeChanged = prevType.current !== nodeType; + const sourcePosChanged = prevSourcePosition.current !== node.sourcePosition; + const targetPosChanged = prevTargetPosition.current !== node.targetPosition; + if (typeChanged || sourcePosChanged || targetPosChanged) { + prevType.current = nodeType; + prevSourcePosition.current = node.sourcePosition; + prevTargetPosition.current = node.targetPosition; + store + .getState() + .updateNodeInternals(new Map([[node.id, { id: node.id, nodeElement: nodeRef.current, force: true }]])); + } + } + }, [node.id, nodeType, node.sourcePosition, node.targetPosition]); + return nodeRef; +} + +function NodeWrapper({ id, onClick, onMouseEnter, onMouseMove, onMouseLeave, onContextMenu, onDoubleClick, nodesDraggable, elementsSelectable, nodesConnectable, nodesFocusable, resizeObserver, noDragClassName, noPanClassName, disableKeyboardA11y, rfId, nodeTypes, nodeClickDistance, onError, }) { + const { node, internals, isParent } = useStore((s) => { + const node = s.nodeLookup.get(id); + const isParent = s.parentLookup.has(id); + return { + node, + internals: node.internals, + isParent, + }; + }, shallow); + let nodeType = node.type || 'default'; + let NodeComponent = nodeTypes?.[nodeType] || builtinNodeTypes[nodeType]; + if (NodeComponent === undefined) { + onError?.('003', errorMessages['error003'](nodeType)); + nodeType = 'default'; + NodeComponent = builtinNodeTypes.default; + } + const isDraggable = !!(node.draggable || (nodesDraggable && typeof node.draggable === 'undefined')); + const isSelectable = !!(node.selectable || (elementsSelectable && typeof node.selectable === 'undefined')); + const isConnectable = !!(node.connectable || (nodesConnectable && typeof node.connectable === 'undefined')); + const isFocusable = !!(node.focusable || (nodesFocusable && typeof node.focusable === 'undefined')); + const store = useStoreApi(); + const hasDimensions = nodeHasDimensions(node); + const nodeRef = useNodeObserver({ node, nodeType, hasDimensions, resizeObserver }); + const dragging = useDrag({ + nodeRef, + disabled: node.hidden || !isDraggable, + noDragClassName, + handleSelector: node.dragHandle, + nodeId: id, + isSelectable, + nodeClickDistance, + }); + const moveSelectedNodes = useMoveSelectedNodes(); + if (node.hidden) { + return null; + } + const nodeDimensions = getNodeDimensions(node); + const inlineDimensions = getNodeInlineStyleDimensions(node); + const hasPointerEvents = isSelectable || isDraggable || onClick || onMouseEnter || onMouseMove || onMouseLeave; + const onMouseEnterHandler = onMouseEnter + ? (event) => onMouseEnter(event, { ...internals.userNode }) + : undefined; + const onMouseMoveHandler = onMouseMove + ? (event) => onMouseMove(event, { ...internals.userNode }) + : undefined; + const onMouseLeaveHandler = onMouseLeave + ? (event) => onMouseLeave(event, { ...internals.userNode }) + : undefined; + const onContextMenuHandler = onContextMenu + ? (event) => onContextMenu(event, { ...internals.userNode }) + : undefined; + const onDoubleClickHandler = onDoubleClick + ? (event) => onDoubleClick(event, { ...internals.userNode }) + : undefined; + const onSelectNodeHandler = (event) => { + const { selectNodesOnDrag, nodeDragThreshold } = store.getState(); + if (isSelectable && (!selectNodesOnDrag || !isDraggable || nodeDragThreshold > 0)) { + /* + * this handler gets called by XYDrag on drag start when selectNodesOnDrag=true + * here we only need to call it when selectNodesOnDrag=false + */ + handleNodeClick({ + id, + store, + nodeRef, + }); + } + if (onClick) { + onClick(event, { ...internals.userNode }); + } + }; + const onKeyDown = (event) => { + if (isInputDOMNode(event.nativeEvent) || disableKeyboardA11y) { + return; + } + if (elementSelectionKeys.includes(event.key) && isSelectable) { + const unselect = event.key === 'Escape'; + handleNodeClick({ + id, + store, + unselect, + nodeRef, + }); + } + else if (isDraggable && node.selected && Object.prototype.hasOwnProperty.call(arrowKeyDiffs, event.key)) { + // prevent default scrolling behavior on arrow key press when node is moved + event.preventDefault(); + const { ariaLabelConfig } = store.getState(); + store.setState({ + ariaLiveMessage: ariaLabelConfig['node.a11yDescription.ariaLiveMessage']({ + direction: event.key.replace('Arrow', '').toLowerCase(), + x: ~~internals.positionAbsolute.x, + y: ~~internals.positionAbsolute.y, + }), + }); + moveSelectedNodes({ + direction: arrowKeyDiffs[event.key], + factor: event.shiftKey ? 4 : 1, + }); + } + }; + const onFocus = () => { + if (disableKeyboardA11y || !nodeRef.current?.matches(':focus-visible')) { + return; + } + const { transform, width, height, autoPanOnNodeFocus, setCenter } = store.getState(); + if (!autoPanOnNodeFocus) { + return; + } + const withinViewport = getNodesInside(new Map([[id, node]]), { x: 0, y: 0, width, height }, transform, true).length > 0; + if (!withinViewport) { + setCenter(node.position.x + nodeDimensions.width / 2, node.position.y + nodeDimensions.height / 2, { + zoom: transform[2], + }); + } + }; + return (jsx("div", { className: cc([ + 'react-flow__node', + `react-flow__node-${nodeType}`, + { + // this is overwritable by passing `nopan` as a class name + [noPanClassName]: isDraggable, + }, + node.className, + { + selected: node.selected, + selectable: isSelectable, + parent: isParent, + draggable: isDraggable, + dragging, + }, + ]), ref: nodeRef, style: { + zIndex: internals.z, + transform: `translate(${internals.positionAbsolute.x}px,${internals.positionAbsolute.y}px)`, + pointerEvents: hasPointerEvents ? 'all' : 'none', + visibility: hasDimensions ? 'visible' : 'hidden', + ...node.style, + ...inlineDimensions, + }, "data-id": id, "data-testid": `rf__node-${id}`, onMouseEnter: onMouseEnterHandler, onMouseMove: onMouseMoveHandler, onMouseLeave: onMouseLeaveHandler, onContextMenu: onContextMenuHandler, onClick: onSelectNodeHandler, onDoubleClick: onDoubleClickHandler, onKeyDown: isFocusable ? onKeyDown : undefined, tabIndex: isFocusable ? 0 : undefined, onFocus: isFocusable ? onFocus : undefined, role: node.ariaRole ?? (isFocusable ? 'group' : undefined), "aria-roledescription": "node", "aria-describedby": disableKeyboardA11y ? undefined : `${ARIA_NODE_DESC_KEY}-${rfId}`, "aria-label": node.ariaLabel, ...node.domAttributes, children: jsx(Provider, { value: id, children: jsx(NodeComponent, { id: id, data: node.data, type: nodeType, positionAbsoluteX: internals.positionAbsolute.x, positionAbsoluteY: internals.positionAbsolute.y, selected: node.selected ?? false, selectable: isSelectable, draggable: isDraggable, deletable: node.deletable ?? true, isConnectable: isConnectable, sourcePosition: node.sourcePosition, targetPosition: node.targetPosition, dragging: dragging, dragHandle: node.dragHandle, zIndex: internals.z, parentId: node.parentId, ...nodeDimensions }) }) })); +} + +const selector$b = (s) => ({ + nodesDraggable: s.nodesDraggable, + nodesConnectable: s.nodesConnectable, + nodesFocusable: s.nodesFocusable, + elementsSelectable: s.elementsSelectable, + onError: s.onError, +}); +function NodeRendererComponent(props) { + const { nodesDraggable, nodesConnectable, nodesFocusable, elementsSelectable, onError } = useStore(selector$b, shallow); + const nodeIds = useVisibleNodeIds(props.onlyRenderVisibleElements); + const resizeObserver = useResizeObserver(); + return (jsx("div", { className: "react-flow__nodes", style: containerStyle, children: nodeIds.map((nodeId) => { + return ( + /* + * The split of responsibilities between NodeRenderer and + * NodeComponentWrapper may appear weird. However, it’s designed to + * minimize the cost of updates when individual nodes change. + * + * For example, when you’re dragging a single node, that node gets + * updated multiple times per second. If `NodeRenderer` were to update + * every time, it would have to re-run the `nodes.map()` loop every + * time. This gets pricey with hundreds of nodes, especially if every + * loop cycle does more than just rendering a JSX element! + * + * As a result of this choice, we took the following implementation + * decisions: + * - NodeRenderer subscribes *only* to node IDs – and therefore + * rerender *only* when visible nodes are added or removed. + * - NodeRenderer performs all operations the result of which can be + * shared between nodes (such as creating the `ResizeObserver` + * instance, or subscribing to `selector`). This means extra prop + * drilling into `NodeComponentWrapper`, but it means we need to run + * these operations only once – instead of once per node. + * - Any operations that you’d normally write inside `nodes.map` are + * moved into `NodeComponentWrapper`. This ensures they are + * memorized – so if `NodeRenderer` *has* to rerender, it only + * needs to regenerate the list of nodes, nothing else. + */ + jsx(NodeWrapper, { id: nodeId, nodeTypes: props.nodeTypes, nodeExtent: props.nodeExtent, onClick: props.onNodeClick, onMouseEnter: props.onNodeMouseEnter, onMouseMove: props.onNodeMouseMove, onMouseLeave: props.onNodeMouseLeave, onContextMenu: props.onNodeContextMenu, onDoubleClick: props.onNodeDoubleClick, noDragClassName: props.noDragClassName, noPanClassName: props.noPanClassName, rfId: props.rfId, disableKeyboardA11y: props.disableKeyboardA11y, resizeObserver: resizeObserver, nodesDraggable: nodesDraggable, nodesConnectable: nodesConnectable, nodesFocusable: nodesFocusable, elementsSelectable: elementsSelectable, nodeClickDistance: props.nodeClickDistance, onError: onError }, nodeId)); + }) })); +} +NodeRendererComponent.displayName = 'NodeRenderer'; +const NodeRenderer = memo(NodeRendererComponent); + +/** + * Hook for getting the visible edge ids from the store. + * + * @internal + * @param onlyRenderVisible + * @returns array with visible edge ids + */ +function useVisibleEdgeIds(onlyRenderVisible) { + const edgeIds = useStore(useCallback((s) => { + if (!onlyRenderVisible) { + return s.edges.map((edge) => edge.id); + } + const visibleEdgeIds = []; + if (s.width && s.height) { + for (const edge of s.edges) { + const sourceNode = s.nodeLookup.get(edge.source); + const targetNode = s.nodeLookup.get(edge.target); + if (sourceNode && + targetNode && + isEdgeVisible({ + sourceNode, + targetNode, + width: s.width, + height: s.height, + transform: s.transform, + })) { + visibleEdgeIds.push(edge.id); + } + } + } + return visibleEdgeIds; + }, [onlyRenderVisible]), shallow); + return edgeIds; +} + +const ArrowSymbol = ({ color = 'none', strokeWidth = 1 }) => { + return (jsx("polyline", { style: { + stroke: color, + strokeWidth, + }, strokeLinecap: "round", strokeLinejoin: "round", fill: "none", points: "-5,-4 0,0 -5,4" })); +}; +const ArrowClosedSymbol = ({ color = 'none', strokeWidth = 1 }) => { + return (jsx("polyline", { style: { + stroke: color, + fill: color, + strokeWidth, + }, strokeLinecap: "round", strokeLinejoin: "round", points: "-5,-4 0,0 -5,4 -5,-4" })); +}; +const MarkerSymbols = { + [MarkerType.Arrow]: ArrowSymbol, + [MarkerType.ArrowClosed]: ArrowClosedSymbol, +}; +function useMarkerSymbol(type) { + const store = useStoreApi(); + const symbol = useMemo(() => { + const symbolExists = Object.prototype.hasOwnProperty.call(MarkerSymbols, type); + if (!symbolExists) { + store.getState().onError?.('009', errorMessages['error009'](type)); + return null; + } + return MarkerSymbols[type]; + }, [type]); + return symbol; +} + +const Marker = ({ id, type, color, width = 12.5, height = 12.5, markerUnits = 'strokeWidth', strokeWidth, orient = 'auto-start-reverse', }) => { + const Symbol = useMarkerSymbol(type); + if (!Symbol) { + return null; + } + return (jsx("marker", { className: "react-flow__arrowhead", id: id, markerWidth: `${width}`, markerHeight: `${height}`, viewBox: "-10 -10 20 20", markerUnits: markerUnits, orient: orient, refX: "0", refY: "0", children: jsx(Symbol, { color: color, strokeWidth: strokeWidth }) })); +}; +/* + * when you have multiple flows on a page and you hide the first one, the other ones have no markers anymore + * when they do have markers with the same ids. To prevent this the user can pass a unique id to the react flow wrapper + * that we can then use for creating our unique marker ids + */ +const MarkerDefinitions = ({ defaultColor, rfId }) => { + const edges = useStore((s) => s.edges); + const defaultEdgeOptions = useStore((s) => s.defaultEdgeOptions); + const markers = useMemo(() => { + const markers = createMarkerIds(edges, { + id: rfId, + defaultColor, + defaultMarkerStart: defaultEdgeOptions?.markerStart, + defaultMarkerEnd: defaultEdgeOptions?.markerEnd, + }); + return markers; + }, [edges, defaultEdgeOptions, rfId, defaultColor]); + if (!markers.length) { + return null; + } + return (jsx("svg", { className: "react-flow__marker", "aria-hidden": "true", children: jsx("defs", { children: markers.map((marker) => (jsx(Marker, { id: marker.id, type: marker.type, color: marker.color, width: marker.width, height: marker.height, markerUnits: marker.markerUnits, strokeWidth: marker.strokeWidth, orient: marker.orient }, marker.id))) }) })); +}; +MarkerDefinitions.displayName = 'MarkerDefinitions'; +var MarkerDefinitions$1 = memo(MarkerDefinitions); + +function EdgeTextComponent({ x, y, label, labelStyle, labelShowBg = true, labelBgStyle, labelBgPadding = [2, 4], labelBgBorderRadius = 2, children, className, ...rest }) { + const [edgeTextBbox, setEdgeTextBbox] = useState({ x: 1, y: 0, width: 0, height: 0 }); + const edgeTextClasses = cc(['react-flow__edge-textwrapper', className]); + const edgeTextRef = useRef(null); + useEffect(() => { + if (edgeTextRef.current) { + const textBbox = edgeTextRef.current.getBBox(); + setEdgeTextBbox({ + x: textBbox.x, + y: textBbox.y, + width: textBbox.width, + height: textBbox.height, + }); + } + }, [label]); + if (!label) { + return null; + } + return (jsxs("g", { transform: `translate(${x - edgeTextBbox.width / 2} ${y - edgeTextBbox.height / 2})`, className: edgeTextClasses, visibility: edgeTextBbox.width ? 'visible' : 'hidden', ...rest, children: [labelShowBg && (jsx("rect", { width: edgeTextBbox.width + 2 * labelBgPadding[0], x: -labelBgPadding[0], y: -labelBgPadding[1], height: edgeTextBbox.height + 2 * labelBgPadding[1], className: "react-flow__edge-textbg", style: labelBgStyle, rx: labelBgBorderRadius, ry: labelBgBorderRadius })), jsx("text", { className: "react-flow__edge-text", y: edgeTextBbox.height / 2, dy: "0.3em", ref: edgeTextRef, style: labelStyle, children: label }), children] })); +} +EdgeTextComponent.displayName = 'EdgeText'; +/** + * You can use the `` component as a helper component to display text + * within your custom edges. + * + * @public + * + * @example + * ```jsx + * import { EdgeText } from '@xyflow/react'; + * + * export function CustomEdgeLabel({ label }) { + * return ( + * + * ); + * } + *``` + */ +const EdgeText = memo(EdgeTextComponent); + +/** + * The `` component gets used internally for all the edges. It can be + * used inside a custom edge and handles the invisible helper edge and the edge label + * for you. + * + * @public + * @example + * ```jsx + *import { BaseEdge } from '@xyflow/react'; + * + *export function CustomEdge({ sourceX, sourceY, targetX, targetY, ...props }) { + * const [edgePath] = getStraightPath({ + * sourceX, + * sourceY, + * targetX, + * targetY, + * }); + * + * return ; + *} + *``` + * + * @remarks If you want to use an edge marker with the [``](/api-reference/components/base-edge) component, + * you can pass the `markerStart` or `markerEnd` props passed to your custom edge + * through to the [``](/api-reference/components/base-edge) component. + * You can see all the props passed to a custom edge by looking at the [`EdgeProps`](/api-reference/types/edge-props) type. + */ +function BaseEdge({ path, labelX, labelY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, interactionWidth = 20, ...props }) { + return (jsxs(Fragment, { children: [jsx("path", { ...props, d: path, fill: "none", className: cc(['react-flow__edge-path', props.className]) }), interactionWidth && (jsx("path", { d: path, fill: "none", strokeOpacity: 0, strokeWidth: interactionWidth, className: "react-flow__edge-interaction" })), label && isNumeric(labelX) && isNumeric(labelY) ? (jsx(EdgeText, { x: labelX, y: labelY, label: label, labelStyle: labelStyle, labelShowBg: labelShowBg, labelBgStyle: labelBgStyle, labelBgPadding: labelBgPadding, labelBgBorderRadius: labelBgBorderRadius })) : null] })); +} + +function getControl({ pos, x1, y1, x2, y2 }) { + if (pos === Position.Left || pos === Position.Right) { + return [0.5 * (x1 + x2), y1]; + } + return [x1, 0.5 * (y1 + y2)]; +} +/** + * The `getSimpleBezierPath` util returns everything you need to render a simple + * bezier edge between two nodes. + * @public + * @returns + * - `path`: the path to use in an SVG `` element. + * - `labelX`: the `x` position you can use to render a label for this edge. + * - `labelY`: the `y` position you can use to render a label for this edge. + * - `offsetX`: the absolute difference between the source `x` position and the `x` position of the + * middle of this path. + * - `offsetY`: the absolute difference between the source `y` position and the `y` position of the + * middle of this path. + */ +function getSimpleBezierPath({ sourceX, sourceY, sourcePosition = Position.Bottom, targetX, targetY, targetPosition = Position.Top, }) { + const [sourceControlX, sourceControlY] = getControl({ + pos: sourcePosition, + x1: sourceX, + y1: sourceY, + x2: targetX, + y2: targetY, + }); + const [targetControlX, targetControlY] = getControl({ + pos: targetPosition, + x1: targetX, + y1: targetY, + x2: sourceX, + y2: sourceY, + }); + const [labelX, labelY, offsetX, offsetY] = getBezierEdgeCenter({ + sourceX, + sourceY, + targetX, + targetY, + sourceControlX, + sourceControlY, + targetControlX, + targetControlY, + }); + return [ + `M${sourceX},${sourceY} C${sourceControlX},${sourceControlY} ${targetControlX},${targetControlY} ${targetX},${targetY}`, + labelX, + labelY, + offsetX, + offsetY, + ]; +} +function createSimpleBezierEdge(params) { + // eslint-disable-next-line react/display-name + return memo(({ id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, markerEnd, markerStart, interactionWidth, }) => { + const [path, labelX, labelY] = getSimpleBezierPath({ + sourceX, + sourceY, + sourcePosition, + targetX, + targetY, + targetPosition, + }); + const _id = params.isInternal ? undefined : id; + return (jsx(BaseEdge, { id: _id, path: path, labelX: labelX, labelY: labelY, label: label, labelStyle: labelStyle, labelShowBg: labelShowBg, labelBgStyle: labelBgStyle, labelBgPadding: labelBgPadding, labelBgBorderRadius: labelBgBorderRadius, style: style, markerEnd: markerEnd, markerStart: markerStart, interactionWidth: interactionWidth })); + }); +} +const SimpleBezierEdge = createSimpleBezierEdge({ isInternal: false }); +const SimpleBezierEdgeInternal = createSimpleBezierEdge({ isInternal: true }); +SimpleBezierEdge.displayName = 'SimpleBezierEdge'; +SimpleBezierEdgeInternal.displayName = 'SimpleBezierEdgeInternal'; + +function createSmoothStepEdge(params) { + // eslint-disable-next-line react/display-name + return memo(({ id, sourceX, sourceY, targetX, targetY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, sourcePosition = Position.Bottom, targetPosition = Position.Top, markerEnd, markerStart, pathOptions, interactionWidth, }) => { + const [path, labelX, labelY] = getSmoothStepPath({ + sourceX, + sourceY, + sourcePosition, + targetX, + targetY, + targetPosition, + borderRadius: pathOptions?.borderRadius, + offset: pathOptions?.offset, + }); + const _id = params.isInternal ? undefined : id; + return (jsx(BaseEdge, { id: _id, path: path, labelX: labelX, labelY: labelY, label: label, labelStyle: labelStyle, labelShowBg: labelShowBg, labelBgStyle: labelBgStyle, labelBgPadding: labelBgPadding, labelBgBorderRadius: labelBgBorderRadius, style: style, markerEnd: markerEnd, markerStart: markerStart, interactionWidth: interactionWidth })); + }); +} +/** + * Component that can be used inside a custom edge to render a smooth step edge. + * + * @public + * @example + * + * ```tsx + * import { SmoothStepEdge } from '@xyflow/react'; + * + * function CustomEdge({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition }) { + * return ( + * + * ); + * } + * ``` + */ +const SmoothStepEdge = createSmoothStepEdge({ isInternal: false }); +/** + * @internal + */ +const SmoothStepEdgeInternal = createSmoothStepEdge({ isInternal: true }); +SmoothStepEdge.displayName = 'SmoothStepEdge'; +SmoothStepEdgeInternal.displayName = 'SmoothStepEdgeInternal'; + +function createStepEdge(params) { + // eslint-disable-next-line react/display-name + return memo(({ id, ...props }) => { + const _id = params.isInternal ? undefined : id; + return (jsx(SmoothStepEdge, { ...props, id: _id, pathOptions: useMemo(() => ({ borderRadius: 0, offset: props.pathOptions?.offset }), [props.pathOptions?.offset]) })); + }); +} +/** + * Component that can be used inside a custom edge to render a step edge. + * + * @public + * @example + * + * ```tsx + * import { StepEdge } from '@xyflow/react'; + * + * function CustomEdge({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition }) { + * return ( + * + * ); + * } + * ``` + */ +const StepEdge = createStepEdge({ isInternal: false }); +/** + * @internal + */ +const StepEdgeInternal = createStepEdge({ isInternal: true }); +StepEdge.displayName = 'StepEdge'; +StepEdgeInternal.displayName = 'StepEdgeInternal'; + +function createStraightEdge(params) { + // eslint-disable-next-line react/display-name + return memo(({ id, sourceX, sourceY, targetX, targetY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, markerEnd, markerStart, interactionWidth, }) => { + const [path, labelX, labelY] = getStraightPath({ sourceX, sourceY, targetX, targetY }); + const _id = params.isInternal ? undefined : id; + return (jsx(BaseEdge, { id: _id, path: path, labelX: labelX, labelY: labelY, label: label, labelStyle: labelStyle, labelShowBg: labelShowBg, labelBgStyle: labelBgStyle, labelBgPadding: labelBgPadding, labelBgBorderRadius: labelBgBorderRadius, style: style, markerEnd: markerEnd, markerStart: markerStart, interactionWidth: interactionWidth })); + }); +} +/** + * Component that can be used inside a custom edge to render a straight line. + * + * @public + * @example + * + * ```tsx + * import { StraightEdge } from '@xyflow/react'; + * + * function CustomEdge({ sourceX, sourceY, targetX, targetY }) { + * return ( + * + * ); + * } + * ``` + */ +const StraightEdge = createStraightEdge({ isInternal: false }); +/** + * @internal + */ +const StraightEdgeInternal = createStraightEdge({ isInternal: true }); +StraightEdge.displayName = 'StraightEdge'; +StraightEdgeInternal.displayName = 'StraightEdgeInternal'; + +function createBezierEdge(params) { + // eslint-disable-next-line react/display-name + return memo(({ id, sourceX, sourceY, targetX, targetY, sourcePosition = Position.Bottom, targetPosition = Position.Top, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, markerEnd, markerStart, pathOptions, interactionWidth, }) => { + const [path, labelX, labelY] = getBezierPath({ + sourceX, + sourceY, + sourcePosition, + targetX, + targetY, + targetPosition, + curvature: pathOptions?.curvature, + }); + const _id = params.isInternal ? undefined : id; + return (jsx(BaseEdge, { id: _id, path: path, labelX: labelX, labelY: labelY, label: label, labelStyle: labelStyle, labelShowBg: labelShowBg, labelBgStyle: labelBgStyle, labelBgPadding: labelBgPadding, labelBgBorderRadius: labelBgBorderRadius, style: style, markerEnd: markerEnd, markerStart: markerStart, interactionWidth: interactionWidth })); + }); +} +/** + * Component that can be used inside a custom edge to render a bezier curve. + * + * @public + * @example + * + * ```tsx + * import { BezierEdge } from '@xyflow/react'; + * + * function CustomEdge({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition }) { + * return ( + * + * ); + * } + * ``` + */ +const BezierEdge = createBezierEdge({ isInternal: false }); +/** + * @internal + */ +const BezierEdgeInternal = createBezierEdge({ isInternal: true }); +BezierEdge.displayName = 'BezierEdge'; +BezierEdgeInternal.displayName = 'BezierEdgeInternal'; + +const builtinEdgeTypes = { + default: BezierEdgeInternal, + straight: StraightEdgeInternal, + step: StepEdgeInternal, + smoothstep: SmoothStepEdgeInternal, + simplebezier: SimpleBezierEdgeInternal, +}; +const nullPosition = { + sourceX: null, + sourceY: null, + targetX: null, + targetY: null, + sourcePosition: null, + targetPosition: null, +}; + +const shiftX = (x, shift, position) => { + if (position === Position.Left) + return x - shift; + if (position === Position.Right) + return x + shift; + return x; +}; +const shiftY = (y, shift, position) => { + if (position === Position.Top) + return y - shift; + if (position === Position.Bottom) + return y + shift; + return y; +}; +const EdgeUpdaterClassName = 'react-flow__edgeupdater'; +/** + * @internal + */ +function EdgeAnchor({ position, centerX, centerY, radius = 10, onMouseDown, onMouseEnter, onMouseOut, type, }) { + return (jsx("circle", { onMouseDown: onMouseDown, onMouseEnter: onMouseEnter, onMouseOut: onMouseOut, className: cc([EdgeUpdaterClassName, `${EdgeUpdaterClassName}-${type}`]), cx: shiftX(centerX, radius, position), cy: shiftY(centerY, radius, position), r: radius, stroke: "transparent", fill: "transparent" })); +} + +function EdgeUpdateAnchors({ isReconnectable, reconnectRadius, edge, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, onReconnect, onReconnectStart, onReconnectEnd, setReconnecting, setUpdateHover, }) { + const store = useStoreApi(); + const handleEdgeUpdater = (event, oppositeHandle) => { + // avoid triggering edge updater if mouse btn is not left + if (event.button !== 0) { + return; + } + const { autoPanOnConnect, domNode, isValidConnection, connectionMode, connectionRadius, lib, onConnectStart, onConnectEnd, cancelConnection, nodeLookup, rfId: flowId, panBy, updateConnection, } = store.getState(); + const isTarget = oppositeHandle.type === 'target'; + setReconnecting(true); + onReconnectStart?.(event, edge, oppositeHandle.type); + const _onReconnectEnd = (evt, connectionState) => { + setReconnecting(false); + onReconnectEnd?.(evt, edge, oppositeHandle.type, connectionState); + }; + const onConnectEdge = (connection) => onReconnect?.(edge, connection); + XYHandle.onPointerDown(event.nativeEvent, { + autoPanOnConnect, + connectionMode, + connectionRadius, + domNode, + handleId: oppositeHandle.id, + nodeId: oppositeHandle.nodeId, + nodeLookup, + isTarget, + edgeUpdaterType: oppositeHandle.type, + lib, + flowId, + cancelConnection, + panBy, + isValidConnection, + onConnect: onConnectEdge, + onConnectStart, + onConnectEnd, + onReconnectEnd: _onReconnectEnd, + updateConnection, + getTransform: () => store.getState().transform, + getFromHandle: () => store.getState().connection.fromHandle, + }); + }; + const onReconnectSourceMouseDown = (event) => handleEdgeUpdater(event, { nodeId: edge.target, id: edge.targetHandle ?? null, type: 'target' }); + const onReconnectTargetMouseDown = (event) => handleEdgeUpdater(event, { nodeId: edge.source, id: edge.sourceHandle ?? null, type: 'source' }); + const onReconnectMouseEnter = () => setUpdateHover(true); + const onReconnectMouseOut = () => setUpdateHover(false); + return (jsxs(Fragment, { children: [(isReconnectable === true || isReconnectable === 'source') && (jsx(EdgeAnchor, { position: sourcePosition, centerX: sourceX, centerY: sourceY, radius: reconnectRadius, onMouseDown: onReconnectSourceMouseDown, onMouseEnter: onReconnectMouseEnter, onMouseOut: onReconnectMouseOut, type: "source" })), (isReconnectable === true || isReconnectable === 'target') && (jsx(EdgeAnchor, { position: targetPosition, centerX: targetX, centerY: targetY, radius: reconnectRadius, onMouseDown: onReconnectTargetMouseDown, onMouseEnter: onReconnectMouseEnter, onMouseOut: onReconnectMouseOut, type: "target" }))] })); +} + +function EdgeWrapper({ id, edgesFocusable, edgesReconnectable, elementsSelectable, onClick, onDoubleClick, onContextMenu, onMouseEnter, onMouseMove, onMouseLeave, reconnectRadius, onReconnect, onReconnectStart, onReconnectEnd, rfId, edgeTypes, noPanClassName, onError, disableKeyboardA11y, }) { + let edge = useStore((s) => s.edgeLookup.get(id)); + const defaultEdgeOptions = useStore((s) => s.defaultEdgeOptions); + edge = defaultEdgeOptions ? { ...defaultEdgeOptions, ...edge } : edge; + let edgeType = edge.type || 'default'; + let EdgeComponent = edgeTypes?.[edgeType] || builtinEdgeTypes[edgeType]; + if (EdgeComponent === undefined) { + onError?.('011', errorMessages['error011'](edgeType)); + edgeType = 'default'; + EdgeComponent = builtinEdgeTypes.default; + } + const isFocusable = !!(edge.focusable || (edgesFocusable && typeof edge.focusable === 'undefined')); + const isReconnectable = typeof onReconnect !== 'undefined' && + (edge.reconnectable || (edgesReconnectable && typeof edge.reconnectable === 'undefined')); + const isSelectable = !!(edge.selectable || (elementsSelectable && typeof edge.selectable === 'undefined')); + const edgeRef = useRef(null); + const [updateHover, setUpdateHover] = useState(false); + const [reconnecting, setReconnecting] = useState(false); + const store = useStoreApi(); + const { zIndex, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition } = useStore(useCallback((store) => { + const sourceNode = store.nodeLookup.get(edge.source); + const targetNode = store.nodeLookup.get(edge.target); + if (!sourceNode || !targetNode) { + return { + zIndex: edge.zIndex, + ...nullPosition, + }; + } + const edgePosition = getEdgePosition({ + id, + sourceNode, + targetNode, + sourceHandle: edge.sourceHandle || null, + targetHandle: edge.targetHandle || null, + connectionMode: store.connectionMode, + onError, + }); + const zIndex = getElevatedEdgeZIndex({ + selected: edge.selected, + zIndex: edge.zIndex, + sourceNode, + targetNode, + elevateOnSelect: store.elevateEdgesOnSelect, + }); + return { + zIndex, + ...(edgePosition || nullPosition), + }; + }, [edge.source, edge.target, edge.sourceHandle, edge.targetHandle, edge.selected, edge.zIndex]), shallow); + const markerStartUrl = useMemo(() => (edge.markerStart ? `url('#${getMarkerId(edge.markerStart, rfId)}')` : undefined), [edge.markerStart, rfId]); + const markerEndUrl = useMemo(() => (edge.markerEnd ? `url('#${getMarkerId(edge.markerEnd, rfId)}')` : undefined), [edge.markerEnd, rfId]); + if (edge.hidden || sourceX === null || sourceY === null || targetX === null || targetY === null) { + return null; + } + const onEdgeClick = (event) => { + const { addSelectedEdges, unselectNodesAndEdges, multiSelectionActive } = store.getState(); + if (isSelectable) { + store.setState({ nodesSelectionActive: false }); + if (edge.selected && multiSelectionActive) { + unselectNodesAndEdges({ nodes: [], edges: [edge] }); + edgeRef.current?.blur(); + } + else { + addSelectedEdges([id]); + } + } + if (onClick) { + onClick(event, edge); + } + }; + const onEdgeDoubleClick = onDoubleClick + ? (event) => { + onDoubleClick(event, { ...edge }); + } + : undefined; + const onEdgeContextMenu = onContextMenu + ? (event) => { + onContextMenu(event, { ...edge }); + } + : undefined; + const onEdgeMouseEnter = onMouseEnter + ? (event) => { + onMouseEnter(event, { ...edge }); + } + : undefined; + const onEdgeMouseMove = onMouseMove + ? (event) => { + onMouseMove(event, { ...edge }); + } + : undefined; + const onEdgeMouseLeave = onMouseLeave + ? (event) => { + onMouseLeave(event, { ...edge }); + } + : undefined; + const onKeyDown = (event) => { + if (!disableKeyboardA11y && elementSelectionKeys.includes(event.key) && isSelectable) { + const { unselectNodesAndEdges, addSelectedEdges } = store.getState(); + const unselect = event.key === 'Escape'; + if (unselect) { + edgeRef.current?.blur(); + unselectNodesAndEdges({ edges: [edge] }); + } + else { + addSelectedEdges([id]); + } + } + }; + return (jsx("svg", { style: { zIndex }, children: jsxs("g", { className: cc([ + 'react-flow__edge', + `react-flow__edge-${edgeType}`, + edge.className, + noPanClassName, + { + selected: edge.selected, + animated: edge.animated, + inactive: !isSelectable && !onClick, + updating: updateHover, + selectable: isSelectable, + }, + ]), onClick: onEdgeClick, onDoubleClick: onEdgeDoubleClick, onContextMenu: onEdgeContextMenu, onMouseEnter: onEdgeMouseEnter, onMouseMove: onEdgeMouseMove, onMouseLeave: onEdgeMouseLeave, onKeyDown: isFocusable ? onKeyDown : undefined, tabIndex: isFocusable ? 0 : undefined, role: edge.ariaRole ?? (isFocusable ? 'group' : 'img'), "aria-roledescription": "edge", "data-id": id, "data-testid": `rf__edge-${id}`, "aria-label": edge.ariaLabel === null ? undefined : edge.ariaLabel || `Edge from ${edge.source} to ${edge.target}`, "aria-describedby": isFocusable ? `${ARIA_EDGE_DESC_KEY}-${rfId}` : undefined, ref: edgeRef, ...edge.domAttributes, children: [!reconnecting && (jsx(EdgeComponent, { id: id, source: edge.source, target: edge.target, type: edge.type, selected: edge.selected, animated: edge.animated, selectable: isSelectable, deletable: edge.deletable ?? true, label: edge.label, labelStyle: edge.labelStyle, labelShowBg: edge.labelShowBg, labelBgStyle: edge.labelBgStyle, labelBgPadding: edge.labelBgPadding, labelBgBorderRadius: edge.labelBgBorderRadius, sourceX: sourceX, sourceY: sourceY, targetX: targetX, targetY: targetY, sourcePosition: sourcePosition, targetPosition: targetPosition, data: edge.data, style: edge.style, sourceHandleId: edge.sourceHandle, targetHandleId: edge.targetHandle, markerStart: markerStartUrl, markerEnd: markerEndUrl, pathOptions: 'pathOptions' in edge ? edge.pathOptions : undefined, interactionWidth: edge.interactionWidth })), isReconnectable && (jsx(EdgeUpdateAnchors, { edge: edge, isReconnectable: isReconnectable, reconnectRadius: reconnectRadius, onReconnect: onReconnect, onReconnectStart: onReconnectStart, onReconnectEnd: onReconnectEnd, sourceX: sourceX, sourceY: sourceY, targetX: targetX, targetY: targetY, sourcePosition: sourcePosition, targetPosition: targetPosition, setUpdateHover: setUpdateHover, setReconnecting: setReconnecting }))] }) })); +} + +const selector$a = (s) => ({ + edgesFocusable: s.edgesFocusable, + edgesReconnectable: s.edgesReconnectable, + elementsSelectable: s.elementsSelectable, + connectionMode: s.connectionMode, + onError: s.onError, +}); +function EdgeRendererComponent({ defaultMarkerColor, onlyRenderVisibleElements, rfId, edgeTypes, noPanClassName, onReconnect, onEdgeContextMenu, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, onEdgeClick, reconnectRadius, onEdgeDoubleClick, onReconnectStart, onReconnectEnd, disableKeyboardA11y, }) { + const { edgesFocusable, edgesReconnectable, elementsSelectable, onError } = useStore(selector$a, shallow); + const edgeIds = useVisibleEdgeIds(onlyRenderVisibleElements); + return (jsxs("div", { className: "react-flow__edges", children: [jsx(MarkerDefinitions$1, { defaultColor: defaultMarkerColor, rfId: rfId }), edgeIds.map((id) => { + return (jsx(EdgeWrapper, { id: id, edgesFocusable: edgesFocusable, edgesReconnectable: edgesReconnectable, elementsSelectable: elementsSelectable, noPanClassName: noPanClassName, onReconnect: onReconnect, onContextMenu: onEdgeContextMenu, onMouseEnter: onEdgeMouseEnter, onMouseMove: onEdgeMouseMove, onMouseLeave: onEdgeMouseLeave, onClick: onEdgeClick, reconnectRadius: reconnectRadius, onDoubleClick: onEdgeDoubleClick, onReconnectStart: onReconnectStart, onReconnectEnd: onReconnectEnd, rfId: rfId, onError: onError, edgeTypes: edgeTypes, disableKeyboardA11y: disableKeyboardA11y }, id)); + })] })); +} +EdgeRendererComponent.displayName = 'EdgeRenderer'; +const EdgeRenderer = memo(EdgeRendererComponent); + +const selector$9 = (s) => `translate(${s.transform[0]}px,${s.transform[1]}px) scale(${s.transform[2]})`; +function Viewport({ children }) { + const transform = useStore(selector$9); + return (jsx("div", { className: "react-flow__viewport xyflow__viewport react-flow__container", style: { transform }, children: children })); +} + +/** + * Hook for calling onInit handler. + * + * @internal + */ +function useOnInitHandler(onInit) { + const rfInstance = useReactFlow(); + const isInitialized = useRef(false); + useEffect(() => { + if (!isInitialized.current && rfInstance.viewportInitialized && onInit) { + setTimeout(() => onInit(rfInstance), 1); + isInitialized.current = true; + } + }, [onInit, rfInstance.viewportInitialized]); +} + +const selector$8 = (state) => state.panZoom?.syncViewport; +/** + * Hook for syncing the viewport with the panzoom instance. + * + * @internal + * @param viewport + */ +function useViewportSync(viewport) { + const syncViewport = useStore(selector$8); + const store = useStoreApi(); + useEffect(() => { + if (viewport) { + syncViewport?.(viewport); + store.setState({ transform: [viewport.x, viewport.y, viewport.zoom] }); + } + }, [viewport, syncViewport]); + return null; +} + +function storeSelector$1(s) { + return s.connection.inProgress + ? { ...s.connection, to: pointToRendererPoint(s.connection.to, s.transform) } + : { ...s.connection }; +} +function getSelector(connectionSelector) { + if (connectionSelector) { + const combinedSelector = (s) => { + const connection = storeSelector$1(s); + return connectionSelector(connection); + }; + return combinedSelector; + } + return storeSelector$1; +} +/** + * The `useConnection` hook returns the current connection when there is an active + * connection interaction. If no connection interaction is active, it returns null + * for every property. A typical use case for this hook is to colorize handles + * based on a certain condition (e.g. if the connection is valid or not). + * + * @public + * @param connectionSelector - An optional selector function used to extract a slice of the + * `ConnectionState` data. Using a selector can prevent component re-renders where data you don't + * otherwise care about might change. If a selector is not provided, the entire `ConnectionState` + * object is returned unchanged. + * @example + * + * ```tsx + *import { useConnection } from '@xyflow/react'; + * + *function App() { + * const connection = useConnection(); + * + * return ( + *
{connection ? `Someone is trying to make a connection from ${connection.fromNode} to this one.` : 'There are currently no incoming connections!'} + * + *
+ * ); + * } + * ``` + * + * @returns ConnectionState + */ +function useConnection(connectionSelector) { + const combinedSelector = getSelector(connectionSelector); + return useStore(combinedSelector, shallow); +} + +const selector$7 = (s) => ({ + nodesConnectable: s.nodesConnectable, + isValid: s.connection.isValid, + inProgress: s.connection.inProgress, + width: s.width, + height: s.height, +}); +function ConnectionLineWrapper({ containerStyle, style, type, component, }) { + const { nodesConnectable, width, height, isValid, inProgress } = useStore(selector$7, shallow); + const renderConnection = !!(width && nodesConnectable && inProgress); + if (!renderConnection) { + return null; + } + return (jsx("svg", { style: containerStyle, width: width, height: height, className: "react-flow__connectionline react-flow__container", children: jsx("g", { className: cc(['react-flow__connection', getConnectionStatus(isValid)]), children: jsx(ConnectionLine, { style: style, type: type, CustomComponent: component, isValid: isValid }) }) })); +} +const ConnectionLine = ({ style, type = ConnectionLineType.Bezier, CustomComponent, isValid, }) => { + const { inProgress, from, fromNode, fromHandle, fromPosition, to, toNode, toHandle, toPosition } = useConnection(); + if (!inProgress) { + return; + } + if (CustomComponent) { + return (jsx(CustomComponent, { connectionLineType: type, connectionLineStyle: style, fromNode: fromNode, fromHandle: fromHandle, fromX: from.x, fromY: from.y, toX: to.x, toY: to.y, fromPosition: fromPosition, toPosition: toPosition, connectionStatus: getConnectionStatus(isValid), toNode: toNode, toHandle: toHandle })); + } + let path = ''; + const pathParams = { + sourceX: from.x, + sourceY: from.y, + sourcePosition: fromPosition, + targetX: to.x, + targetY: to.y, + targetPosition: toPosition, + }; + switch (type) { + case ConnectionLineType.Bezier: + [path] = getBezierPath(pathParams); + break; + case ConnectionLineType.SimpleBezier: + [path] = getSimpleBezierPath(pathParams); + break; + case ConnectionLineType.Step: + [path] = getSmoothStepPath({ + ...pathParams, + borderRadius: 0, + }); + break; + case ConnectionLineType.SmoothStep: + [path] = getSmoothStepPath(pathParams); + break; + default: + [path] = getStraightPath(pathParams); + } + return jsx("path", { d: path, fill: "none", className: "react-flow__connection-path", style: style }); +}; +ConnectionLine.displayName = 'ConnectionLine'; + +const emptyTypes = {}; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function useNodeOrEdgeTypesWarning(nodeOrEdgeTypes = emptyTypes) { + const typesRef = useRef(nodeOrEdgeTypes); + const store = useStoreApi(); + useEffect(() => { + if (process.env.NODE_ENV === 'development') { + const usedKeys = new Set([...Object.keys(typesRef.current), ...Object.keys(nodeOrEdgeTypes)]); + for (const key of usedKeys) { + if (typesRef.current[key] !== nodeOrEdgeTypes[key]) { + store.getState().onError?.('002', errorMessages['error002']()); + break; + } + } + typesRef.current = nodeOrEdgeTypes; + } + }, [nodeOrEdgeTypes]); +} + +function useStylesLoadedWarning() { + const store = useStoreApi(); + const checked = useRef(false); + useEffect(() => { + if (process.env.NODE_ENV === 'development') { + if (!checked.current) { + const pane = document.querySelector('.react-flow__pane'); + if (pane && !(window.getComputedStyle(pane).zIndex === '1')) { + store.getState().onError?.('013', errorMessages['error013']('react')); + } + checked.current = true; + } + } + }, []); +} + +function GraphViewComponent({ nodeTypes, edgeTypes, onInit, onNodeClick, onEdgeClick, onNodeDoubleClick, onEdgeDoubleClick, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave, onNodeContextMenu, onSelectionContextMenu, onSelectionStart, onSelectionEnd, connectionLineType, connectionLineStyle, connectionLineComponent, connectionLineContainerStyle, selectionKeyCode, selectionOnDrag, selectionMode, multiSelectionKeyCode, panActivationKeyCode, zoomActivationKeyCode, deleteKeyCode, onlyRenderVisibleElements, elementsSelectable, defaultViewport, translateExtent, minZoom, maxZoom, preventScrolling, defaultMarkerColor, zoomOnScroll, zoomOnPinch, panOnScroll, panOnScrollSpeed, panOnScrollMode, zoomOnDoubleClick, panOnDrag, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneScroll, onPaneContextMenu, paneClickDistance, nodeClickDistance, onEdgeContextMenu, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, reconnectRadius, onReconnect, onReconnectStart, onReconnectEnd, noDragClassName, noWheelClassName, noPanClassName, disableKeyboardA11y, nodeExtent, rfId, viewport, onViewportChange, }) { + useNodeOrEdgeTypesWarning(nodeTypes); + useNodeOrEdgeTypesWarning(edgeTypes); + useStylesLoadedWarning(); + useOnInitHandler(onInit); + useViewportSync(viewport); + return (jsx(FlowRenderer, { onPaneClick: onPaneClick, onPaneMouseEnter: onPaneMouseEnter, onPaneMouseMove: onPaneMouseMove, onPaneMouseLeave: onPaneMouseLeave, onPaneContextMenu: onPaneContextMenu, onPaneScroll: onPaneScroll, paneClickDistance: paneClickDistance, deleteKeyCode: deleteKeyCode, selectionKeyCode: selectionKeyCode, selectionOnDrag: selectionOnDrag, selectionMode: selectionMode, onSelectionStart: onSelectionStart, onSelectionEnd: onSelectionEnd, multiSelectionKeyCode: multiSelectionKeyCode, panActivationKeyCode: panActivationKeyCode, zoomActivationKeyCode: zoomActivationKeyCode, elementsSelectable: elementsSelectable, zoomOnScroll: zoomOnScroll, zoomOnPinch: zoomOnPinch, zoomOnDoubleClick: zoomOnDoubleClick, panOnScroll: panOnScroll, panOnScrollSpeed: panOnScrollSpeed, panOnScrollMode: panOnScrollMode, panOnDrag: panOnDrag, defaultViewport: defaultViewport, translateExtent: translateExtent, minZoom: minZoom, maxZoom: maxZoom, onSelectionContextMenu: onSelectionContextMenu, preventScrolling: preventScrolling, noDragClassName: noDragClassName, noWheelClassName: noWheelClassName, noPanClassName: noPanClassName, disableKeyboardA11y: disableKeyboardA11y, onViewportChange: onViewportChange, isControlledViewport: !!viewport, children: jsxs(Viewport, { children: [jsx(EdgeRenderer, { edgeTypes: edgeTypes, onEdgeClick: onEdgeClick, onEdgeDoubleClick: onEdgeDoubleClick, onReconnect: onReconnect, onReconnectStart: onReconnectStart, onReconnectEnd: onReconnectEnd, onlyRenderVisibleElements: onlyRenderVisibleElements, onEdgeContextMenu: onEdgeContextMenu, onEdgeMouseEnter: onEdgeMouseEnter, onEdgeMouseMove: onEdgeMouseMove, onEdgeMouseLeave: onEdgeMouseLeave, reconnectRadius: reconnectRadius, defaultMarkerColor: defaultMarkerColor, noPanClassName: noPanClassName, disableKeyboardA11y: disableKeyboardA11y, rfId: rfId }), jsx(ConnectionLineWrapper, { style: connectionLineStyle, type: connectionLineType, component: connectionLineComponent, containerStyle: connectionLineContainerStyle }), jsx("div", { className: "react-flow__edgelabel-renderer" }), jsx(NodeRenderer, { nodeTypes: nodeTypes, onNodeClick: onNodeClick, onNodeDoubleClick: onNodeDoubleClick, onNodeMouseEnter: onNodeMouseEnter, onNodeMouseMove: onNodeMouseMove, onNodeMouseLeave: onNodeMouseLeave, onNodeContextMenu: onNodeContextMenu, nodeClickDistance: nodeClickDistance, onlyRenderVisibleElements: onlyRenderVisibleElements, noPanClassName: noPanClassName, noDragClassName: noDragClassName, disableKeyboardA11y: disableKeyboardA11y, nodeExtent: nodeExtent, rfId: rfId }), jsx("div", { className: "react-flow__viewport-portal" })] }) })); +} +GraphViewComponent.displayName = 'GraphView'; +const GraphView = memo(GraphViewComponent); + +const getInitialState = ({ nodes, edges, defaultNodes, defaultEdges, width, height, fitView, fitViewOptions, minZoom = 0.5, maxZoom = 2, nodeOrigin, nodeExtent, } = {}) => { + const nodeLookup = new Map(); + const parentLookup = new Map(); + const connectionLookup = new Map(); + const edgeLookup = new Map(); + const storeEdges = defaultEdges ?? edges ?? []; + const storeNodes = defaultNodes ?? nodes ?? []; + const storeNodeOrigin = nodeOrigin ?? [0, 0]; + const storeNodeExtent = nodeExtent ?? infiniteExtent; + updateConnectionLookup(connectionLookup, edgeLookup, storeEdges); + const nodesInitialized = adoptUserNodes(storeNodes, nodeLookup, parentLookup, { + nodeOrigin: storeNodeOrigin, + nodeExtent: storeNodeExtent, + elevateNodesOnSelect: false, + }); + let transform = [0, 0, 1]; + if (fitView && width && height) { + const bounds = getInternalNodesBounds(nodeLookup, { + filter: (node) => !!((node.width || node.initialWidth) && (node.height || node.initialHeight)), + }); + const { x, y, zoom } = getViewportForBounds(bounds, width, height, minZoom, maxZoom, fitViewOptions?.padding ?? 0.1); + transform = [x, y, zoom]; + } + return { + rfId: '1', + width: 0, + height: 0, + transform, + nodes: storeNodes, + nodesInitialized, + nodeLookup, + parentLookup, + edges: storeEdges, + edgeLookup, + connectionLookup, + onNodesChange: null, + onEdgesChange: null, + hasDefaultNodes: defaultNodes !== undefined, + hasDefaultEdges: defaultEdges !== undefined, + panZoom: null, + minZoom, + maxZoom, + translateExtent: infiniteExtent, + nodeExtent: storeNodeExtent, + nodesSelectionActive: false, + userSelectionActive: false, + userSelectionRect: null, + connectionMode: ConnectionMode.Strict, + domNode: null, + paneDragging: false, + noPanClassName: 'nopan', + nodeOrigin: storeNodeOrigin, + nodeDragThreshold: 1, + snapGrid: [15, 15], + snapToGrid: false, + nodesDraggable: true, + nodesConnectable: true, + nodesFocusable: true, + edgesFocusable: true, + edgesReconnectable: true, + elementsSelectable: true, + elevateNodesOnSelect: true, + elevateEdgesOnSelect: false, + selectNodesOnDrag: true, + multiSelectionActive: false, + fitViewQueued: fitView ?? false, + fitViewOptions, + fitViewResolver: null, + connection: { ...initialConnection }, + connectionClickStartHandle: null, + connectOnClick: true, + ariaLiveMessage: '', + autoPanOnConnect: true, + autoPanOnNodeDrag: true, + autoPanOnNodeFocus: true, + autoPanSpeed: 15, + connectionRadius: 20, + onError: devWarn, + isValidConnection: undefined, + onSelectionChangeHandlers: [], + lib: 'react', + debug: false, + ariaLabelConfig: defaultAriaLabelConfig, + }; +}; + +const createStore = ({ nodes, edges, defaultNodes, defaultEdges, width, height, fitView, fitViewOptions, minZoom, maxZoom, nodeOrigin, nodeExtent, }) => createWithEqualityFn((set, get) => { + async function resolveFitView() { + const { nodeLookup, panZoom, fitViewOptions, fitViewResolver, width, height, minZoom, maxZoom } = get(); + if (!panZoom) { + return; + } + await fitViewport({ + nodes: nodeLookup, + width, + height, + panZoom, + minZoom, + maxZoom, + }, fitViewOptions); + fitViewResolver?.resolve(true); + /** + * wait for the fitViewport to resolve before deleting the resolver, + * we want to reuse the old resolver if the user calls fitView again in the mean time + */ + set({ fitViewResolver: null }); + } + return { + ...getInitialState({ + nodes, + edges, + width, + height, + fitView, + fitViewOptions, + minZoom, + maxZoom, + nodeOrigin, + nodeExtent, + defaultNodes, + defaultEdges, + }), + setNodes: (nodes) => { + const { nodeLookup, parentLookup, nodeOrigin, elevateNodesOnSelect, fitViewQueued } = get(); + /* + * setNodes() is called exclusively in response to user actions: + * - either when the `` prop is updated in the controlled ReactFlow setup, + * - or when the user calls something like `reactFlowInstance.setNodes()` in an uncontrolled ReactFlow setup. + * + * When this happens, we take the note objects passed by the user and extend them with fields + * relevant for internal React Flow operations. + */ + const nodesInitialized = adoptUserNodes(nodes, nodeLookup, parentLookup, { + nodeOrigin, + nodeExtent, + elevateNodesOnSelect, + checkEquality: true, + }); + if (fitViewQueued && nodesInitialized) { + resolveFitView(); + set({ nodes, nodesInitialized, fitViewQueued: false, fitViewOptions: undefined }); + } + else { + set({ nodes, nodesInitialized }); + } + }, + setEdges: (edges) => { + const { connectionLookup, edgeLookup } = get(); + updateConnectionLookup(connectionLookup, edgeLookup, edges); + set({ edges }); + }, + setDefaultNodesAndEdges: (nodes, edges) => { + if (nodes) { + const { setNodes } = get(); + setNodes(nodes); + set({ hasDefaultNodes: true }); + } + if (edges) { + const { setEdges } = get(); + setEdges(edges); + set({ hasDefaultEdges: true }); + } + }, + /* + * Every node gets registerd at a ResizeObserver. Whenever a node + * changes its dimensions, this function is called to measure the + * new dimensions and update the nodes. + */ + updateNodeInternals: (updates) => { + const { triggerNodeChanges, nodeLookup, parentLookup, domNode, nodeOrigin, nodeExtent, debug, fitViewQueued } = get(); + const { changes, updatedInternals } = updateNodeInternals(updates, nodeLookup, parentLookup, domNode, nodeOrigin, nodeExtent); + if (!updatedInternals) { + return; + } + updateAbsolutePositions(nodeLookup, parentLookup, { nodeOrigin, nodeExtent }); + if (fitViewQueued) { + resolveFitView(); + set({ fitViewQueued: false, fitViewOptions: undefined }); + } + else { + // we always want to trigger useStore calls whenever updateNodeInternals is called + set({}); + } + if (changes?.length > 0) { + if (debug) { + console.log('React Flow: trigger node changes', changes); + } + triggerNodeChanges?.(changes); + } + }, + updateNodePositions: (nodeDragItems, dragging = false) => { + const parentExpandChildren = []; + const changes = []; + const { nodeLookup, triggerNodeChanges } = get(); + for (const [id, dragItem] of nodeDragItems) { + // we are using the nodelookup to be sure to use the current expandParent and parentId value + const node = nodeLookup.get(id); + const expandParent = !!(node?.expandParent && node?.parentId && dragItem?.position); + const change = { + id, + type: 'position', + position: expandParent + ? { + x: Math.max(0, dragItem.position.x), + y: Math.max(0, dragItem.position.y), + } + : dragItem.position, + dragging, + }; + if (expandParent && node.parentId) { + parentExpandChildren.push({ + id, + parentId: node.parentId, + rect: { + ...dragItem.internals.positionAbsolute, + width: dragItem.measured.width ?? 0, + height: dragItem.measured.height ?? 0, + }, + }); + } + changes.push(change); + } + if (parentExpandChildren.length > 0) { + const { parentLookup, nodeOrigin } = get(); + const parentExpandChanges = handleExpandParent(parentExpandChildren, nodeLookup, parentLookup, nodeOrigin); + changes.push(...parentExpandChanges); + } + triggerNodeChanges(changes); + }, + triggerNodeChanges: (changes) => { + const { onNodesChange, setNodes, nodes, hasDefaultNodes, debug } = get(); + if (changes?.length) { + if (hasDefaultNodes) { + const updatedNodes = applyNodeChanges(changes, nodes); + setNodes(updatedNodes); + } + if (debug) { + console.log('React Flow: trigger node changes', changes); + } + onNodesChange?.(changes); + } + }, + triggerEdgeChanges: (changes) => { + const { onEdgesChange, setEdges, edges, hasDefaultEdges, debug } = get(); + if (changes?.length) { + if (hasDefaultEdges) { + const updatedEdges = applyEdgeChanges(changes, edges); + setEdges(updatedEdges); + } + if (debug) { + console.log('React Flow: trigger edge changes', changes); + } + onEdgesChange?.(changes); + } + }, + addSelectedNodes: (selectedNodeIds) => { + const { multiSelectionActive, edgeLookup, nodeLookup, triggerNodeChanges, triggerEdgeChanges } = get(); + if (multiSelectionActive) { + const nodeChanges = selectedNodeIds.map((nodeId) => createSelectionChange(nodeId, true)); + triggerNodeChanges(nodeChanges); + return; + } + triggerNodeChanges(getSelectionChanges(nodeLookup, new Set([...selectedNodeIds]), true)); + triggerEdgeChanges(getSelectionChanges(edgeLookup)); + }, + addSelectedEdges: (selectedEdgeIds) => { + const { multiSelectionActive, edgeLookup, nodeLookup, triggerNodeChanges, triggerEdgeChanges } = get(); + if (multiSelectionActive) { + const changedEdges = selectedEdgeIds.map((edgeId) => createSelectionChange(edgeId, true)); + triggerEdgeChanges(changedEdges); + return; + } + triggerEdgeChanges(getSelectionChanges(edgeLookup, new Set([...selectedEdgeIds]))); + triggerNodeChanges(getSelectionChanges(nodeLookup, new Set(), true)); + }, + unselectNodesAndEdges: ({ nodes, edges } = {}) => { + const { edges: storeEdges, nodes: storeNodes, nodeLookup, triggerNodeChanges, triggerEdgeChanges } = get(); + const nodesToUnselect = nodes ? nodes : storeNodes; + const edgesToUnselect = edges ? edges : storeEdges; + const nodeChanges = nodesToUnselect.map((n) => { + const internalNode = nodeLookup.get(n.id); + if (internalNode) { + /* + * we need to unselect the internal node that was selected previously before we + * send the change to the user to prevent it to be selected while dragging the new node + */ + internalNode.selected = false; + } + return createSelectionChange(n.id, false); + }); + const edgeChanges = edgesToUnselect.map((edge) => createSelectionChange(edge.id, false)); + triggerNodeChanges(nodeChanges); + triggerEdgeChanges(edgeChanges); + }, + setMinZoom: (minZoom) => { + const { panZoom, maxZoom } = get(); + panZoom?.setScaleExtent([minZoom, maxZoom]); + set({ minZoom }); + }, + setMaxZoom: (maxZoom) => { + const { panZoom, minZoom } = get(); + panZoom?.setScaleExtent([minZoom, maxZoom]); + set({ maxZoom }); + }, + setTranslateExtent: (translateExtent) => { + get().panZoom?.setTranslateExtent(translateExtent); + set({ translateExtent }); + }, + setPaneClickDistance: (clickDistance) => { + get().panZoom?.setClickDistance(clickDistance); + }, + resetSelectedElements: () => { + const { edges, nodes, triggerNodeChanges, triggerEdgeChanges, elementsSelectable } = get(); + if (!elementsSelectable) { + return; + } + const nodeChanges = nodes.reduce((res, node) => (node.selected ? [...res, createSelectionChange(node.id, false)] : res), []); + const edgeChanges = edges.reduce((res, edge) => (edge.selected ? [...res, createSelectionChange(edge.id, false)] : res), []); + triggerNodeChanges(nodeChanges); + triggerEdgeChanges(edgeChanges); + }, + setNodeExtent: (nextNodeExtent) => { + const { nodes, nodeLookup, parentLookup, nodeOrigin, elevateNodesOnSelect, nodeExtent } = get(); + if (nextNodeExtent[0][0] === nodeExtent[0][0] && + nextNodeExtent[0][1] === nodeExtent[0][1] && + nextNodeExtent[1][0] === nodeExtent[1][0] && + nextNodeExtent[1][1] === nodeExtent[1][1]) { + return; + } + adoptUserNodes(nodes, nodeLookup, parentLookup, { + nodeOrigin, + nodeExtent: nextNodeExtent, + elevateNodesOnSelect, + checkEquality: false, + }); + set({ nodeExtent: nextNodeExtent }); + }, + panBy: (delta) => { + const { transform, width, height, panZoom, translateExtent } = get(); + return panBy({ delta, panZoom, transform, translateExtent, width, height }); + }, + setCenter: async (x, y, options) => { + const { width, height, maxZoom, panZoom } = get(); + if (!panZoom) { + return Promise.resolve(false); + } + const nextZoom = typeof options?.zoom !== 'undefined' ? options.zoom : maxZoom; + await panZoom.setViewport({ + x: width / 2 - x * nextZoom, + y: height / 2 - y * nextZoom, + zoom: nextZoom, + }, { duration: options?.duration, ease: options?.ease, interpolate: options?.interpolate }); + return Promise.resolve(true); + }, + cancelConnection: () => { + set({ + connection: { ...initialConnection }, + }); + }, + updateConnection: (connection) => { + set({ connection }); + }, + reset: () => set({ ...getInitialState() }), + }; +}, Object.is); + +/** + * The `` component is a [context provider](https://react.dev/learn/passing-data-deeply-with-context#) + * that makes it possible to access a flow's internal state outside of the + * [``](/api-reference/react-flow) component. Many of the hooks we + * provide rely on this component to work. + * @public + * + * @example + * ```tsx + *import { ReactFlow, ReactFlowProvider, useNodes } from '@xyflow/react' + * + *export default function Flow() { + * return ( + * + * + * + * + * ); + *} + * + *function Sidebar() { + * // This hook will only work if the component it's used in is a child of a + * // . + * const nodes = useNodes() + * + * return ; + *} + *``` + * + * @remarks If you're using a router and want your flow's state to persist across routes, + * it's vital that you place the `` component _outside_ of + * your router. If you have multiple flows on the same page you will need to use a separate + * `` for each flow. + */ +function ReactFlowProvider({ initialNodes: nodes, initialEdges: edges, defaultNodes, defaultEdges, initialWidth: width, initialHeight: height, initialMinZoom: minZoom, initialMaxZoom: maxZoom, initialFitViewOptions: fitViewOptions, fitView, nodeOrigin, nodeExtent, children, }) { + const [store] = useState(() => createStore({ + nodes, + edges, + defaultNodes, + defaultEdges, + width, + height, + fitView, + minZoom, + maxZoom, + fitViewOptions, + nodeOrigin, + nodeExtent, + })); + return (jsx(Provider$1, { value: store, children: jsx(BatchProvider, { children: children }) })); +} + +function Wrapper({ children, nodes, edges, defaultNodes, defaultEdges, width, height, fitView, fitViewOptions, minZoom, maxZoom, nodeOrigin, nodeExtent, }) { + const isWrapped = useContext(StoreContext); + if (isWrapped) { + /* + * we need to wrap it with a fragment because it's not allowed for children to be a ReactNode + * https://github.com/DefinitelyTyped/DefinitelyTyped/issues/18051 + */ + return jsx(Fragment, { children: children }); + } + return (jsx(ReactFlowProvider, { initialNodes: nodes, initialEdges: edges, defaultNodes: defaultNodes, defaultEdges: defaultEdges, initialWidth: width, initialHeight: height, fitView: fitView, initialFitViewOptions: fitViewOptions, initialMinZoom: minZoom, initialMaxZoom: maxZoom, nodeOrigin: nodeOrigin, nodeExtent: nodeExtent, children: children })); +} + +const wrapperStyle = { + width: '100%', + height: '100%', + overflow: 'hidden', + position: 'relative', + zIndex: 0, +}; +function ReactFlow({ nodes, edges, defaultNodes, defaultEdges, className, nodeTypes, edgeTypes, onNodeClick, onEdgeClick, onInit, onMove, onMoveStart, onMoveEnd, onConnect, onConnectStart, onConnectEnd, onClickConnectStart, onClickConnectEnd, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave, onNodeContextMenu, onNodeDoubleClick, onNodeDragStart, onNodeDrag, onNodeDragStop, onNodesDelete, onEdgesDelete, onDelete, onSelectionChange, onSelectionDragStart, onSelectionDrag, onSelectionDragStop, onSelectionContextMenu, onSelectionStart, onSelectionEnd, onBeforeDelete, connectionMode, connectionLineType = ConnectionLineType.Bezier, connectionLineStyle, connectionLineComponent, connectionLineContainerStyle, deleteKeyCode = 'Backspace', selectionKeyCode = 'Shift', selectionOnDrag = false, selectionMode = SelectionMode.Full, panActivationKeyCode = 'Space', multiSelectionKeyCode = isMacOs() ? 'Meta' : 'Control', zoomActivationKeyCode = isMacOs() ? 'Meta' : 'Control', snapToGrid, snapGrid, onlyRenderVisibleElements = false, selectNodesOnDrag, nodesDraggable, autoPanOnNodeFocus, nodesConnectable, nodesFocusable, nodeOrigin = defaultNodeOrigin, edgesFocusable, edgesReconnectable, elementsSelectable = true, defaultViewport: defaultViewport$1 = defaultViewport, minZoom = 0.5, maxZoom = 2, translateExtent = infiniteExtent, preventScrolling = true, nodeExtent, defaultMarkerColor = '#b1b1b7', zoomOnScroll = true, zoomOnPinch = true, panOnScroll = false, panOnScrollSpeed = 0.5, panOnScrollMode = PanOnScrollMode.Free, zoomOnDoubleClick = true, panOnDrag = true, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneScroll, onPaneContextMenu, paneClickDistance = 0, nodeClickDistance = 0, children, onReconnect, onReconnectStart, onReconnectEnd, onEdgeContextMenu, onEdgeDoubleClick, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, reconnectRadius = 10, onNodesChange, onEdgesChange, noDragClassName = 'nodrag', noWheelClassName = 'nowheel', noPanClassName = 'nopan', fitView, fitViewOptions, connectOnClick, attributionPosition, proOptions, defaultEdgeOptions, elevateNodesOnSelect, elevateEdgesOnSelect, disableKeyboardA11y = false, autoPanOnConnect, autoPanOnNodeDrag, autoPanSpeed, connectionRadius, isValidConnection, onError, style, id, nodeDragThreshold, viewport, onViewportChange, width, height, colorMode = 'light', debug, onScroll, ariaLabelConfig, ...rest }, ref) { + const rfId = id || '1'; + const colorModeClassName = useColorModeClass(colorMode); + // Undo scroll events, preventing viewport from shifting when nodes outside of it are focused + const wrapperOnScroll = useCallback((e) => { + e.currentTarget.scrollTo({ top: 0, left: 0, behavior: 'instant' }); + onScroll?.(e); + }, [onScroll]); + return (jsx("div", { "data-testid": "rf__wrapper", ...rest, onScroll: wrapperOnScroll, style: { ...style, ...wrapperStyle }, ref: ref, className: cc(['react-flow', className, colorModeClassName]), id: id, role: "application", children: jsxs(Wrapper, { nodes: nodes, edges: edges, width: width, height: height, fitView: fitView, fitViewOptions: fitViewOptions, minZoom: minZoom, maxZoom: maxZoom, nodeOrigin: nodeOrigin, nodeExtent: nodeExtent, children: [jsx(GraphView, { onInit: onInit, onNodeClick: onNodeClick, onEdgeClick: onEdgeClick, onNodeMouseEnter: onNodeMouseEnter, onNodeMouseMove: onNodeMouseMove, onNodeMouseLeave: onNodeMouseLeave, onNodeContextMenu: onNodeContextMenu, onNodeDoubleClick: onNodeDoubleClick, nodeTypes: nodeTypes, edgeTypes: edgeTypes, connectionLineType: connectionLineType, connectionLineStyle: connectionLineStyle, connectionLineComponent: connectionLineComponent, connectionLineContainerStyle: connectionLineContainerStyle, selectionKeyCode: selectionKeyCode, selectionOnDrag: selectionOnDrag, selectionMode: selectionMode, deleteKeyCode: deleteKeyCode, multiSelectionKeyCode: multiSelectionKeyCode, panActivationKeyCode: panActivationKeyCode, zoomActivationKeyCode: zoomActivationKeyCode, onlyRenderVisibleElements: onlyRenderVisibleElements, defaultViewport: defaultViewport$1, translateExtent: translateExtent, minZoom: minZoom, maxZoom: maxZoom, preventScrolling: preventScrolling, zoomOnScroll: zoomOnScroll, zoomOnPinch: zoomOnPinch, zoomOnDoubleClick: zoomOnDoubleClick, panOnScroll: panOnScroll, panOnScrollSpeed: panOnScrollSpeed, panOnScrollMode: panOnScrollMode, panOnDrag: panOnDrag, onPaneClick: onPaneClick, onPaneMouseEnter: onPaneMouseEnter, onPaneMouseMove: onPaneMouseMove, onPaneMouseLeave: onPaneMouseLeave, onPaneScroll: onPaneScroll, onPaneContextMenu: onPaneContextMenu, paneClickDistance: paneClickDistance, nodeClickDistance: nodeClickDistance, onSelectionContextMenu: onSelectionContextMenu, onSelectionStart: onSelectionStart, onSelectionEnd: onSelectionEnd, onReconnect: onReconnect, onReconnectStart: onReconnectStart, onReconnectEnd: onReconnectEnd, onEdgeContextMenu: onEdgeContextMenu, onEdgeDoubleClick: onEdgeDoubleClick, onEdgeMouseEnter: onEdgeMouseEnter, onEdgeMouseMove: onEdgeMouseMove, onEdgeMouseLeave: onEdgeMouseLeave, reconnectRadius: reconnectRadius, defaultMarkerColor: defaultMarkerColor, noDragClassName: noDragClassName, noWheelClassName: noWheelClassName, noPanClassName: noPanClassName, rfId: rfId, disableKeyboardA11y: disableKeyboardA11y, nodeExtent: nodeExtent, viewport: viewport, onViewportChange: onViewportChange }), jsx(StoreUpdater, { nodes: nodes, edges: edges, defaultNodes: defaultNodes, defaultEdges: defaultEdges, onConnect: onConnect, onConnectStart: onConnectStart, onConnectEnd: onConnectEnd, onClickConnectStart: onClickConnectStart, onClickConnectEnd: onClickConnectEnd, nodesDraggable: nodesDraggable, autoPanOnNodeFocus: autoPanOnNodeFocus, nodesConnectable: nodesConnectable, nodesFocusable: nodesFocusable, edgesFocusable: edgesFocusable, edgesReconnectable: edgesReconnectable, elementsSelectable: elementsSelectable, elevateNodesOnSelect: elevateNodesOnSelect, elevateEdgesOnSelect: elevateEdgesOnSelect, minZoom: minZoom, maxZoom: maxZoom, nodeExtent: nodeExtent, onNodesChange: onNodesChange, onEdgesChange: onEdgesChange, snapToGrid: snapToGrid, snapGrid: snapGrid, connectionMode: connectionMode, translateExtent: translateExtent, connectOnClick: connectOnClick, defaultEdgeOptions: defaultEdgeOptions, fitView: fitView, fitViewOptions: fitViewOptions, onNodesDelete: onNodesDelete, onEdgesDelete: onEdgesDelete, onDelete: onDelete, onNodeDragStart: onNodeDragStart, onNodeDrag: onNodeDrag, onNodeDragStop: onNodeDragStop, onSelectionDrag: onSelectionDrag, onSelectionDragStart: onSelectionDragStart, onSelectionDragStop: onSelectionDragStop, onMove: onMove, onMoveStart: onMoveStart, onMoveEnd: onMoveEnd, noPanClassName: noPanClassName, nodeOrigin: nodeOrigin, rfId: rfId, autoPanOnConnect: autoPanOnConnect, autoPanOnNodeDrag: autoPanOnNodeDrag, autoPanSpeed: autoPanSpeed, onError: onError, connectionRadius: connectionRadius, isValidConnection: isValidConnection, selectNodesOnDrag: selectNodesOnDrag, nodeDragThreshold: nodeDragThreshold, onBeforeDelete: onBeforeDelete, paneClickDistance: paneClickDistance, debug: debug, ariaLabelConfig: ariaLabelConfig }), jsx(SelectionListener, { onSelectionChange: onSelectionChange }), children, jsx(Attribution, { proOptions: proOptions, position: attributionPosition }), jsx(A11yDescriptions, { rfId: rfId, disableKeyboardA11y: disableKeyboardA11y })] }) })); +} +/** + * The `` component is the heart of your React Flow application. + * It renders your nodes and edges and handles user interaction + * + * @public + * + * @example + * ```tsx + *import { ReactFlow } from '@xyflow/react' + * + *export default function Flow() { + * return (); + *} + *``` + */ +var index = fixedForwardRef(ReactFlow); + +const selector$6 = (s) => s.domNode?.querySelector('.react-flow__edgelabel-renderer'); +/** + * Edges are SVG-based. If you want to render more complex labels you can use the + * `` component to access a div based renderer. This component + * is a portal that renders the label in a `
` that is positioned on top of + * the edges. You can see an example usage of the component in the + * [edge label renderer example](/examples/edges/edge-label-renderer). + * @public + * + * @example + * ```jsx + * import React from 'react'; + * import { getBezierPath, EdgeLabelRenderer, BaseEdge } from '@xyflow/react'; + * + * export function CustomEdge({ id, data, ...props }) { + * const [edgePath, labelX, labelY] = getBezierPath(props); + * + * return ( + * <> + * + * + *
+ * {data.label} + *
+ *
+ * + * ); + * }; + * ``` + * + * @remarks The `` has no pointer events by default. If you want to + * add mouse interactions you need to set the style `pointerEvents: all` and add + * the `nopan` class on the label or the element you want to interact with. + */ +function EdgeLabelRenderer({ children }) { + const edgeLabelRenderer = useStore(selector$6); + if (!edgeLabelRenderer) { + return null; + } + return createPortal(children, edgeLabelRenderer); +} + +const selector$5 = (s) => s.domNode?.querySelector('.react-flow__viewport-portal'); +/** + * The `` component can be used to add components to the same viewport + * of the flow where nodes and edges are rendered. This is useful when you want to render + * your own components that are adhere to the same coordinate system as the nodes & edges + * and are also affected by zooming and panning + * @public + * @example + * + * ```jsx + *import React from 'react'; + *import { ViewportPortal } from '@xyflow/react'; + * + *export default function () { + * return ( + * + *
+ * This div is positioned at [100, 100] on the flow. + *
+ *
+ * ); + *} + *``` + */ +function ViewportPortal({ children }) { + const viewPortalDiv = useStore(selector$5); + if (!viewPortalDiv) { + return null; + } + return createPortal(children, viewPortalDiv); +} + +/** + * When you programmatically add or remove handles to a node or update a node's + * handle position, you need to let React Flow know about it using this hook. This + * will update the internal dimensions of the node and properly reposition handles + * on the canvas if necessary. + * + * @public + * @returns Use this function to tell React Flow to update the internal state of one or more nodes + * that you have changed programmatically. + * + * @example + * ```jsx + *import { useCallback, useState } from 'react'; + *import { Handle, useUpdateNodeInternals } from '@xyflow/react'; + * + *export default function RandomHandleNode({ id }) { + * const updateNodeInternals = useUpdateNodeInternals(); + * const [handleCount, setHandleCount] = useState(0); + * const randomizeHandleCount = useCallback(() => { + * setHandleCount(Math.floor(Math.random() * 10)); + * updateNodeInternals(id); + * }, [id, updateNodeInternals]); + * + * return ( + * <> + * {Array.from({ length: handleCount }).map((_, index) => ( + * + * ))} + * + *
+ * + *

There are {handleCount} handles on this node.

+ *
+ * + * ); + *} + *``` + * @remarks This hook can only be used in a component that is a child of a + *{@link ReactFlowProvider} or a {@link ReactFlow} component. + */ +function useUpdateNodeInternals() { + const store = useStoreApi(); + return useCallback((id) => { + const { domNode, updateNodeInternals } = store.getState(); + const updateIds = Array.isArray(id) ? id : [id]; + const updates = new Map(); + updateIds.forEach((updateId) => { + const nodeElement = domNode?.querySelector(`.react-flow__node[data-id="${updateId}"]`); + if (nodeElement) { + updates.set(updateId, { id: updateId, nodeElement, force: true }); + } + }); + requestAnimationFrame(() => updateNodeInternals(updates, { triggerFitView: false })); + }, []); +} + +const nodesSelector = (state) => state.nodes; +/** + * This hook returns an array of the current nodes. Components that use this hook + * will re-render **whenever any node changes**, including when a node is selected + * or moved. + * + * @public + * @returns An array of all nodes currently in the flow. + * + * @example + * ```jsx + *import { useNodes } from '@xyflow/react'; + * + *export default function() { + * const nodes = useNodes(); + * + * return
There are currently {nodes.length} nodes!
; + *} + *``` + */ +function useNodes() { + const nodes = useStore(nodesSelector, shallow); + return nodes; +} + +const edgesSelector = (state) => state.edges; +/** + * This hook returns an array of the current edges. Components that use this hook + * will re-render **whenever any edge changes**. + * + * @public + * @returns An array of all edges currently in the flow. + * + * @example + * ```tsx + *import { useEdges } from '@xyflow/react'; + * + *export default function () { + * const edges = useEdges(); + * + * return
There are currently {edges.length} edges!
; + *} + *``` + */ +function useEdges() { + const edges = useStore(edgesSelector, shallow); + return edges; +} + +const viewportSelector = (state) => ({ + x: state.transform[0], + y: state.transform[1], + zoom: state.transform[2], +}); +/** + * The `useViewport` hook is a convenient way to read the current state of the + * {@link Viewport} in a component. Components that use this hook + * will re-render **whenever the viewport changes**. + * + * @public + * @returns The current viewport. + * + * @example + * + *```jsx + *import { useViewport } from '@xyflow/react'; + * + *export default function ViewportDisplay() { + * const { x, y, zoom } = useViewport(); + * + * return ( + *
+ *

+ * The viewport is currently at ({x}, {y}) and zoomed to {zoom}. + *

+ *
+ * ); + *} + *``` + * + * @remarks This hook can only be used in a component that is a child of a + *{@link ReactFlowProvider} or a {@link ReactFlow} component. + */ +function useViewport() { + const viewport = useStore(viewportSelector, shallow); + return viewport; +} + +/** + * This hook makes it easy to prototype a controlled flow where you manage the + * state of nodes and edges outside the `ReactFlowInstance`. You can think of it + * like React's `useState` hook with an additional helper callback. + * + * @public + * @returns + * - `nodes`: The current array of nodes. You might pass this directly to the `nodes` prop of your + * `` component, or you may want to manipulate it first to perform some layouting, + * for example. + * - `setNodes`: A function that you can use to update the nodes. You can pass it a new array of + * nodes or a callback that receives the current array of nodes and returns a new array of nodes. + * This is the same as the second element of the tuple returned by React's `useState` hook. + * - `onNodesChange`: A handy callback that can take an array of `NodeChanges` and update the nodes + * state accordingly. You'll typically pass this directly to the `onNodesChange` prop of your + * `` component. + * @example + * + *```tsx + *import { ReactFlow, useNodesState, useEdgesState } from '@xyflow/react'; + * + *const initialNodes = []; + *const initialEdges = []; + * + *export default function () { + * const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes); + * const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges); + * + * return ( + * + * ); + *} + *``` + * + * @remarks This hook was created to make prototyping easier and our documentation + * examples clearer. Although it is OK to use this hook in production, in + * practice you may want to use a more sophisticated state management solution + * like Zustand {@link https://reactflow.dev/docs/guides/state-management/} instead. + * + */ +function useNodesState(initialNodes) { + const [nodes, setNodes] = useState(initialNodes); + const onNodesChange = useCallback((changes) => setNodes((nds) => applyNodeChanges(changes, nds)), []); + return [nodes, setNodes, onNodesChange]; +} +/** + * This hook makes it easy to prototype a controlled flow where you manage the + * state of nodes and edges outside the `ReactFlowInstance`. You can think of it + * like React's `useState` hook with an additional helper callback. + * + * @public + * @returns + * - `edges`: The current array of edges. You might pass this directly to the `edges` prop of your + * `` component, or you may want to manipulate it first to perform some layouting, + * for example. + * + * - `setEdges`: A function that you can use to update the edges. You can pass it a new array of + * edges or a callback that receives the current array of edges and returns a new array of edges. + * This is the same as the second element of the tuple returned by React's `useState` hook. + * + * - `onEdgesChange`: A handy callback that can take an array of `EdgeChanges` and update the edges + * state accordingly. You'll typically pass this directly to the `onEdgesChange` prop of your + * `` component. + * @example + * + *```tsx + *import { ReactFlow, useNodesState, useEdgesState } from '@xyflow/react'; + * + *const initialNodes = []; + *const initialEdges = []; + * + *export default function () { + * const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes); + * const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges); + * + * return ( + * + * ); + *} + *``` + * + * @remarks This hook was created to make prototyping easier and our documentation + * examples clearer. Although it is OK to use this hook in production, in + * practice you may want to use a more sophisticated state management solution + * like Zustand {@link https://reactflow.dev/docs/guides/state-management/} instead. + * + */ +function useEdgesState(initialEdges) { + const [edges, setEdges] = useState(initialEdges); + const onEdgesChange = useCallback((changes) => setEdges((eds) => applyEdgeChanges(changes, eds)), []); + return [edges, setEdges, onEdgesChange]; +} + +/** + * The `useOnViewportChange` hook lets you listen for changes to the viewport such + * as panning and zooming. You can provide a callback for each phase of a viewport + * change: `onStart`, `onChange`, and `onEnd`. + * + * @public + * @example + * ```jsx + *import { useCallback } from 'react'; + *import { useOnViewportChange } from '@xyflow/react'; + * + *function ViewportChangeLogger() { + * useOnViewportChange({ + * onStart: (viewport: Viewport) => console.log('start', viewport), + * onChange: (viewport: Viewport) => console.log('change', viewport), + * onEnd: (viewport: Viewport) => console.log('end', viewport), + * }); + * + * return null; + *} + *``` + */ +function useOnViewportChange({ onStart, onChange, onEnd }) { + const store = useStoreApi(); + useEffect(() => { + store.setState({ onViewportChangeStart: onStart }); + }, [onStart]); + useEffect(() => { + store.setState({ onViewportChange: onChange }); + }, [onChange]); + useEffect(() => { + store.setState({ onViewportChangeEnd: onEnd }); + }, [onEnd]); +} + +/** + * This hook lets you listen for changes to both node and edge selection. As the + *name implies, the callback you provide will be called whenever the selection of + *_either_ nodes or edges changes. + * + * @public + * @example + * ```jsx + *import { useState } from 'react'; + *import { ReactFlow, useOnSelectionChange } from '@xyflow/react'; + * + *function SelectionDisplay() { + * const [selectedNodes, setSelectedNodes] = useState([]); + * const [selectedEdges, setSelectedEdges] = useState([]); + * + * // the passed handler has to be memoized, otherwise the hook will not work correctly + * const onChange = useCallback(({ nodes, edges }) => { + * setSelectedNodes(nodes.map((node) => node.id)); + * setSelectedEdges(edges.map((edge) => edge.id)); + * }, []); + * + * useOnSelectionChange({ + * onChange, + * }); + * + * return ( + *
+ *

Selected nodes: {selectedNodes.join(', ')}

+ *

Selected edges: {selectedEdges.join(', ')}

+ *
+ * ); + *} + *``` + * + * @remarks You need to memoize the passed `onChange` handler, otherwise the hook will not work correctly. + */ +function useOnSelectionChange({ onChange, }) { + const store = useStoreApi(); + useEffect(() => { + const nextOnSelectionChangeHandlers = [...store.getState().onSelectionChangeHandlers, onChange]; + store.setState({ onSelectionChangeHandlers: nextOnSelectionChangeHandlers }); + return () => { + const nextHandlers = store.getState().onSelectionChangeHandlers.filter((fn) => fn !== onChange); + store.setState({ onSelectionChangeHandlers: nextHandlers }); + }; + }, [onChange]); +} + +const selector$4 = (options) => (s) => { + if (!options.includeHiddenNodes) { + return s.nodesInitialized; + } + if (s.nodeLookup.size === 0) { + return false; + } + for (const [, { internals }] of s.nodeLookup) { + if (internals.handleBounds === undefined || !nodeHasDimensions(internals.userNode)) { + return false; + } + } + return true; +}; +/** + * This hook tells you whether all the nodes in a flow have been measured and given + *a width and height. When you add a node to the flow, this hook will return + *`false` and then `true` again once the node has been measured. + * + * @public + * @returns Whether or not the nodes have been initialized by the `` component and + * given a width and height. + * + * @example + * ```jsx + *import { useReactFlow, useNodesInitialized } from '@xyflow/react'; + *import { useEffect, useState } from 'react'; + * + *const options = { + * includeHiddenNodes: false, + *}; + * + *export default function useLayout() { + * const { getNodes } = useReactFlow(); + * const nodesInitialized = useNodesInitialized(options); + * const [layoutedNodes, setLayoutedNodes] = useState(getNodes()); + * + * useEffect(() => { + * if (nodesInitialized) { + * setLayoutedNodes(yourLayoutingFunction(getNodes())); + * } + * }, [nodesInitialized]); + * + * return layoutedNodes; + *} + *``` + */ +function useNodesInitialized(options = { + includeHiddenNodes: false, +}) { + const initialized = useStore(selector$4(options)); + return initialized; +} + +/** + * Hook to check if a is connected to another and get the connections. + * + * @public + * @deprecated Use `useNodeConnections` instead. + * @returns An array with handle connections. + */ +function useHandleConnections({ type, id, nodeId, onConnect, onDisconnect, }) { + console.warn('[DEPRECATED] `useHandleConnections` is deprecated. Instead use `useNodeConnections` https://reactflow.dev/api-reference/hooks/useNodeConnections'); + const _nodeId = useNodeId(); + const currentNodeId = nodeId ?? _nodeId; + const prevConnections = useRef(null); + const connections = useStore((state) => state.connectionLookup.get(`${currentNodeId}-${type}${id ? `-${id}` : ''}`), areConnectionMapsEqual); + useEffect(() => { + // @todo dicuss if onConnect/onDisconnect should be called when the component mounts/unmounts + if (prevConnections.current && prevConnections.current !== connections) { + const _connections = connections ?? new Map(); + handleConnectionChange(prevConnections.current, _connections, onDisconnect); + handleConnectionChange(_connections, prevConnections.current, onConnect); + } + prevConnections.current = connections ?? new Map(); + }, [connections, onConnect, onDisconnect]); + return useMemo(() => Array.from(connections?.values() ?? []), [connections]); +} + +const error014 = errorMessages['error014'](); +/** + * This hook returns an array of connections on a specific node, handle type ('source', 'target') or handle ID. + * + * @public + * @returns An array with connections. + * + * @example + * ```jsx + *import { useNodeConnections } from '@xyflow/react'; + * + *export default function () { + * const connections = useNodeConnections({ + * handleType: 'target', + * handleId: 'my-handle', + * }); + * + * return ( + *
There are currently {connections.length} incoming connections!
+ * ); + *} + *``` + */ +function useNodeConnections({ id, handleType, handleId, onConnect, onDisconnect, } = {}) { + const nodeId = useNodeId(); + const currentNodeId = id ?? nodeId; + if (!currentNodeId) { + throw new Error(error014); + } + const prevConnections = useRef(null); + const connections = useStore((state) => state.connectionLookup.get(`${currentNodeId}${handleType ? (handleId ? `-${handleType}-${handleId}` : `-${handleType}`) : ''}`), areConnectionMapsEqual); + useEffect(() => { + // @todo discuss if onConnect/onDisconnect should be called when the component mounts/unmounts + if (prevConnections.current && prevConnections.current !== connections) { + const _connections = connections ?? new Map(); + handleConnectionChange(prevConnections.current, _connections, onDisconnect); + handleConnectionChange(_connections, prevConnections.current, onConnect); + } + prevConnections.current = connections ?? new Map(); + }, [connections, onConnect, onDisconnect]); + return useMemo(() => Array.from(connections?.values() ?? []), [connections]); +} + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function useNodesData(nodeIds) { + const nodesData = useStore(useCallback((s) => { + const data = []; + const isArrayOfIds = Array.isArray(nodeIds); + const _nodeIds = isArrayOfIds ? nodeIds : [nodeIds]; + for (const nodeId of _nodeIds) { + const node = s.nodeLookup.get(nodeId); + if (node) { + data.push({ + id: node.id, + type: node.type, + data: node.data, + }); + } + } + return isArrayOfIds ? data : data[0] ?? null; + }, [nodeIds]), shallowNodeData); + return nodesData; +} + +/** + * This hook returns the internal representation of a specific node. + * Components that use this hook will re-render **whenever the node changes**, + * including when a node is selected or moved. + * + * @public + * @param id - The ID of a node you want to observe. + * @returns The `InternalNode` object for the node with the given ID. + * + * @example + * ```tsx + *import { useInternalNode } from '@xyflow/react'; + * + *export default function () { + * const internalNode = useInternalNode('node-1'); + * const absolutePosition = internalNode.internals.positionAbsolute; + * + * return ( + *
+ * The absolute position of the node is at: + *

x: {absolutePosition.x}

+ *

y: {absolutePosition.y}

+ *
+ * ); + *} + *``` + */ +function useInternalNode(id) { + const node = useStore(useCallback((s) => s.nodeLookup.get(id), [id]), shallow); + return node; +} + +function LinePattern({ dimensions, lineWidth, variant, className }) { + return (jsx("path", { strokeWidth: lineWidth, d: `M${dimensions[0] / 2} 0 V${dimensions[1]} M0 ${dimensions[1] / 2} H${dimensions[0]}`, className: cc(['react-flow__background-pattern', variant, className]) })); +} +function DotPattern({ radius, className }) { + return (jsx("circle", { cx: radius, cy: radius, r: radius, className: cc(['react-flow__background-pattern', 'dots', className]) })); +} + +/** + * The three variants are exported as an enum for convenience. You can either import + * the enum and use it like `BackgroundVariant.Lines` or you can use the raw string + * value directly. + * @public + */ +var BackgroundVariant; +(function (BackgroundVariant) { + BackgroundVariant["Lines"] = "lines"; + BackgroundVariant["Dots"] = "dots"; + BackgroundVariant["Cross"] = "cross"; +})(BackgroundVariant || (BackgroundVariant = {})); + +const defaultSize = { + [BackgroundVariant.Dots]: 1, + [BackgroundVariant.Lines]: 1, + [BackgroundVariant.Cross]: 6, +}; +const selector$3 = (s) => ({ transform: s.transform, patternId: `pattern-${s.rfId}` }); +function BackgroundComponent({ id, variant = BackgroundVariant.Dots, +// only used for dots and cross +gap = 20, +// only used for lines and cross +size, lineWidth = 1, offset = 0, color, bgColor, style, className, patternClassName, }) { + const ref = useRef(null); + const { transform, patternId } = useStore(selector$3, shallow); + const patternSize = size || defaultSize[variant]; + const isDots = variant === BackgroundVariant.Dots; + const isCross = variant === BackgroundVariant.Cross; + const gapXY = Array.isArray(gap) ? gap : [gap, gap]; + const scaledGap = [gapXY[0] * transform[2] || 1, gapXY[1] * transform[2] || 1]; + const scaledSize = patternSize * transform[2]; + const offsetXY = Array.isArray(offset) ? offset : [offset, offset]; + const patternDimensions = isCross ? [scaledSize, scaledSize] : scaledGap; + const scaledOffset = [ + offsetXY[0] * transform[2] || 1 + patternDimensions[0] / 2, + offsetXY[1] * transform[2] || 1 + patternDimensions[1] / 2, + ]; + const _patternId = `${patternId}${id ? id : ''}`; + return (jsxs("svg", { className: cc(['react-flow__background', className]), style: { + ...style, + ...containerStyle, + '--xy-background-color-props': bgColor, + '--xy-background-pattern-color-props': color, + }, ref: ref, "data-testid": "rf__background", children: [jsx("pattern", { id: _patternId, x: transform[0] % scaledGap[0], y: transform[1] % scaledGap[1], width: scaledGap[0], height: scaledGap[1], patternUnits: "userSpaceOnUse", patternTransform: `translate(-${scaledOffset[0]},-${scaledOffset[1]})`, children: isDots ? (jsx(DotPattern, { radius: scaledSize / 2, className: patternClassName })) : (jsx(LinePattern, { dimensions: patternDimensions, lineWidth: lineWidth, variant: variant, className: patternClassName })) }), jsx("rect", { x: "0", y: "0", width: "100%", height: "100%", fill: `url(#${_patternId})` })] })); +} +BackgroundComponent.displayName = 'Background'; +/** + * The `` component makes it convenient to render different types of backgrounds common in node-based UIs. It comes with three variants: lines, dots and cross. + * + * @example + * + * A simple example of how to use the Background component. + * + * ```tsx + * import { useState } from 'react'; + * import { ReactFlow, Background, BackgroundVariant } from '@xyflow/react'; + * + * export default function Flow() { + * return ( + * + * + * + * ); + * } + * ``` + * + * @example + * + * In this example you can see how to combine multiple backgrounds + * + * ```tsx + * import { ReactFlow, Background, BackgroundVariant } from '@xyflow/react'; + * import '@xyflow/react/dist/style.css'; + * + * export default function Flow() { + * return ( + * + * + * + * + * ); + * } + * ``` + * + * @remarks + * + * When combining multiple components it’s important to give each of them a unique id prop! + * + */ +const Background = memo(BackgroundComponent); + +function PlusIcon() { + return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", children: jsx("path", { d: "M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z" }) })); +} + +function MinusIcon() { + return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 5", children: jsx("path", { d: "M0 0h32v4.2H0z" }) })); +} + +function FitViewIcon() { + return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 30", children: jsx("path", { d: "M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z" }) })); +} + +function LockIcon() { + return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 25 32", children: jsx("path", { d: "M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z" }) })); +} + +function UnlockIcon() { + return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 25 32", children: jsx("path", { d: "M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z" }) })); +} + +/** + * You can add buttons to the control panel by using the `` component + * and pass it as a child to the [``](/api-reference/components/controls) component. + * + * @public + * @example + *```jsx + *import { MagicWand } from '@radix-ui/react-icons' + *import { ReactFlow, Controls, ControlButton } from '@xyflow/react' + * + *export default function Flow() { + * return ( + * + * + * alert('Something magical just happened. ✨')}> + * + * + * + * + * ) + *} + *``` + */ +function ControlButton({ children, className, ...rest }) { + return (jsx("button", { type: "button", className: cc(['react-flow__controls-button', className]), ...rest, children: children })); +} + +const selector$2 = (s) => ({ + isInteractive: s.nodesDraggable || s.nodesConnectable || s.elementsSelectable, + minZoomReached: s.transform[2] <= s.minZoom, + maxZoomReached: s.transform[2] >= s.maxZoom, + ariaLabelConfig: s.ariaLabelConfig, +}); +function ControlsComponent({ style, showZoom = true, showFitView = true, showInteractive = true, fitViewOptions, onZoomIn, onZoomOut, onFitView, onInteractiveChange, className, children, position = 'bottom-left', orientation = 'vertical', 'aria-label': ariaLabel, }) { + const store = useStoreApi(); + const { isInteractive, minZoomReached, maxZoomReached, ariaLabelConfig } = useStore(selector$2, shallow); + const { zoomIn, zoomOut, fitView } = useReactFlow(); + const onZoomInHandler = () => { + zoomIn(); + onZoomIn?.(); + }; + const onZoomOutHandler = () => { + zoomOut(); + onZoomOut?.(); + }; + const onFitViewHandler = () => { + fitView(fitViewOptions); + onFitView?.(); + }; + const onToggleInteractivity = () => { + store.setState({ + nodesDraggable: !isInteractive, + nodesConnectable: !isInteractive, + elementsSelectable: !isInteractive, + }); + onInteractiveChange?.(!isInteractive); + }; + const orientationClass = orientation === 'horizontal' ? 'horizontal' : 'vertical'; + return (jsxs(Panel, { className: cc(['react-flow__controls', orientationClass, className]), position: position, style: style, "data-testid": "rf__controls", "aria-label": ariaLabel ?? ariaLabelConfig['controls.ariaLabel'], children: [showZoom && (jsxs(Fragment, { children: [jsx(ControlButton, { onClick: onZoomInHandler, className: "react-flow__controls-zoomin", title: ariaLabelConfig['controls.zoomIn.ariaLabel'], "aria-label": ariaLabelConfig['controls.zoomIn.ariaLabel'], disabled: maxZoomReached, children: jsx(PlusIcon, {}) }), jsx(ControlButton, { onClick: onZoomOutHandler, className: "react-flow__controls-zoomout", title: ariaLabelConfig['controls.zoomOut.ariaLabel'], "aria-label": ariaLabelConfig['controls.zoomOut.ariaLabel'], disabled: minZoomReached, children: jsx(MinusIcon, {}) })] })), showFitView && (jsx(ControlButton, { className: "react-flow__controls-fitview", onClick: onFitViewHandler, title: ariaLabelConfig['controls.fitView.ariaLabel'], "aria-label": ariaLabelConfig['controls.fitView.ariaLabel'], children: jsx(FitViewIcon, {}) })), showInteractive && (jsx(ControlButton, { className: "react-flow__controls-interactive", onClick: onToggleInteractivity, title: ariaLabelConfig['controls.interactive.ariaLabel'], "aria-label": ariaLabelConfig['controls.interactive.ariaLabel'], children: isInteractive ? jsx(UnlockIcon, {}) : jsx(LockIcon, {}) })), children] })); +} +ControlsComponent.displayName = 'Controls'; +/** + * The `` component renders a small panel that contains convenient + * buttons to zoom in, zoom out, fit the view, and lock the viewport. + * + * @public + * @example + *```tsx + *import { ReactFlow, Controls } from '@xyflow/react' + * + *export default function Flow() { + * return ( + * + * + * + * ) + *} + *``` + * + * @remarks To extend or customise the controls, you can use the [``](/api-reference/components/control-button) component + * + */ +const Controls = memo(ControlsComponent); + +function MiniMapNodeComponent({ id, x, y, width, height, style, color, strokeColor, strokeWidth, className, borderRadius, shapeRendering, selected, onClick, }) { + const { background, backgroundColor } = style || {}; + const fill = (color || background || backgroundColor); + return (jsx("rect", { className: cc(['react-flow__minimap-node', { selected }, className]), x: x, y: y, rx: borderRadius, ry: borderRadius, width: width, height: height, style: { + fill, + stroke: strokeColor, + strokeWidth, + }, shapeRendering: shapeRendering, onClick: onClick ? (event) => onClick(event, id) : undefined })); +} +const MiniMapNode = memo(MiniMapNodeComponent); + +const selectorNodeIds = (s) => s.nodes.map((node) => node.id); +const getAttrFunction = (func) => func instanceof Function ? func : () => func; +function MiniMapNodes({ nodeStrokeColor, nodeColor, nodeClassName = '', nodeBorderRadius = 5, nodeStrokeWidth, +/* + * We need to rename the prop to be `CapitalCase` so that JSX will render it as + * a component properly. + */ +nodeComponent: NodeComponent = MiniMapNode, onClick, }) { + const nodeIds = useStore(selectorNodeIds, shallow); + const nodeColorFunc = getAttrFunction(nodeColor); + const nodeStrokeColorFunc = getAttrFunction(nodeStrokeColor); + const nodeClassNameFunc = getAttrFunction(nodeClassName); + const shapeRendering = typeof window === 'undefined' || !!window.chrome ? 'crispEdges' : 'geometricPrecision'; + return (jsx(Fragment, { children: nodeIds.map((nodeId) => ( + /* + * The split of responsibilities between MiniMapNodes and + * NodeComponentWrapper may appear weird. However, it’s designed to + * minimize the cost of updates when individual nodes change. + * + * For more details, see a similar commit in `NodeRenderer/index.tsx`. + */ + jsx(NodeComponentWrapper, { id: nodeId, nodeColorFunc: nodeColorFunc, nodeStrokeColorFunc: nodeStrokeColorFunc, nodeClassNameFunc: nodeClassNameFunc, nodeBorderRadius: nodeBorderRadius, nodeStrokeWidth: nodeStrokeWidth, NodeComponent: NodeComponent, onClick: onClick, shapeRendering: shapeRendering }, nodeId))) })); +} +function NodeComponentWrapperInner({ id, nodeColorFunc, nodeStrokeColorFunc, nodeClassNameFunc, nodeBorderRadius, nodeStrokeWidth, shapeRendering, NodeComponent, onClick, }) { + const { node, x, y, width, height } = useStore((s) => { + const { internals } = s.nodeLookup.get(id); + const node = internals.userNode; + const { x, y } = internals.positionAbsolute; + const { width, height } = getNodeDimensions(node); + return { + node, + x, + y, + width, + height, + }; + }, shallow); + if (!node || node.hidden || !nodeHasDimensions(node)) { + return null; + } + return (jsx(NodeComponent, { x: x, y: y, width: width, height: height, style: node.style, selected: !!node.selected, className: nodeClassNameFunc(node), color: nodeColorFunc(node), borderRadius: nodeBorderRadius, strokeColor: nodeStrokeColorFunc(node), strokeWidth: nodeStrokeWidth, shapeRendering: shapeRendering, onClick: onClick, id: node.id })); +} +const NodeComponentWrapper = memo(NodeComponentWrapperInner); +var MiniMapNodes$1 = memo(MiniMapNodes); + +const defaultWidth = 200; +const defaultHeight = 150; +const filterHidden = (node) => !node.hidden; +const selector$1 = (s) => { + const viewBB = { + x: -s.transform[0] / s.transform[2], + y: -s.transform[1] / s.transform[2], + width: s.width / s.transform[2], + height: s.height / s.transform[2], + }; + return { + viewBB, + boundingRect: s.nodeLookup.size > 0 + ? getBoundsOfRects(getInternalNodesBounds(s.nodeLookup, { filter: filterHidden }), viewBB) + : viewBB, + rfId: s.rfId, + panZoom: s.panZoom, + translateExtent: s.translateExtent, + flowWidth: s.width, + flowHeight: s.height, + ariaLabelConfig: s.ariaLabelConfig, + }; +}; +const ARIA_LABEL_KEY = 'react-flow__minimap-desc'; +function MiniMapComponent({ style, className, nodeStrokeColor, nodeColor, nodeClassName = '', nodeBorderRadius = 5, nodeStrokeWidth, +/* + * We need to rename the prop to be `CapitalCase` so that JSX will render it as + * a component properly. + */ +nodeComponent, bgColor, maskColor, maskStrokeColor, maskStrokeWidth, position = 'bottom-right', onClick, onNodeClick, pannable = false, zoomable = false, ariaLabel, inversePan, zoomStep = 10, offsetScale = 5, }) { + const store = useStoreApi(); + const svg = useRef(null); + const { boundingRect, viewBB, rfId, panZoom, translateExtent, flowWidth, flowHeight, ariaLabelConfig } = useStore(selector$1, shallow); + const elementWidth = style?.width ?? defaultWidth; + const elementHeight = style?.height ?? defaultHeight; + const scaledWidth = boundingRect.width / elementWidth; + const scaledHeight = boundingRect.height / elementHeight; + const viewScale = Math.max(scaledWidth, scaledHeight); + const viewWidth = viewScale * elementWidth; + const viewHeight = viewScale * elementHeight; + const offset = offsetScale * viewScale; + const x = boundingRect.x - (viewWidth - boundingRect.width) / 2 - offset; + const y = boundingRect.y - (viewHeight - boundingRect.height) / 2 - offset; + const width = viewWidth + offset * 2; + const height = viewHeight + offset * 2; + const labelledBy = `${ARIA_LABEL_KEY}-${rfId}`; + const viewScaleRef = useRef(0); + const minimapInstance = useRef(); + viewScaleRef.current = viewScale; + useEffect(() => { + if (svg.current && panZoom) { + minimapInstance.current = XYMinimap({ + domNode: svg.current, + panZoom, + getTransform: () => store.getState().transform, + getViewScale: () => viewScaleRef.current, + }); + return () => { + minimapInstance.current?.destroy(); + }; + } + }, [panZoom]); + useEffect(() => { + minimapInstance.current?.update({ + translateExtent, + width: flowWidth, + height: flowHeight, + inversePan, + pannable, + zoomStep, + zoomable, + }); + }, [pannable, zoomable, inversePan, zoomStep, translateExtent, flowWidth, flowHeight]); + const onSvgClick = onClick + ? (event) => { + const [x, y] = minimapInstance.current?.pointer(event) || [0, 0]; + onClick(event, { x, y }); + } + : undefined; + const onSvgNodeClick = onNodeClick + ? useCallback((event, nodeId) => { + const node = store.getState().nodeLookup.get(nodeId).internals.userNode; + onNodeClick(event, node); + }, []) + : undefined; + const _ariaLabel = ariaLabel ?? ariaLabelConfig['minimap.ariaLabel']; + return (jsx(Panel, { position: position, style: { + ...style, + '--xy-minimap-background-color-props': typeof bgColor === 'string' ? bgColor : undefined, + '--xy-minimap-mask-background-color-props': typeof maskColor === 'string' ? maskColor : undefined, + '--xy-minimap-mask-stroke-color-props': typeof maskStrokeColor === 'string' ? maskStrokeColor : undefined, + '--xy-minimap-mask-stroke-width-props': typeof maskStrokeWidth === 'number' ? maskStrokeWidth * viewScale : undefined, + '--xy-minimap-node-background-color-props': typeof nodeColor === 'string' ? nodeColor : undefined, + '--xy-minimap-node-stroke-color-props': typeof nodeStrokeColor === 'string' ? nodeStrokeColor : undefined, + '--xy-minimap-node-stroke-width-props': typeof nodeStrokeWidth === 'number' ? nodeStrokeWidth : undefined, + }, className: cc(['react-flow__minimap', className]), "data-testid": "rf__minimap", children: jsxs("svg", { width: elementWidth, height: elementHeight, viewBox: `${x} ${y} ${width} ${height}`, className: "react-flow__minimap-svg", role: "img", "aria-labelledby": labelledBy, ref: svg, onClick: onSvgClick, children: [_ariaLabel && jsx("title", { id: labelledBy, children: _ariaLabel }), jsx(MiniMapNodes$1, { onClick: onSvgNodeClick, nodeColor: nodeColor, nodeStrokeColor: nodeStrokeColor, nodeBorderRadius: nodeBorderRadius, nodeClassName: nodeClassName, nodeStrokeWidth: nodeStrokeWidth, nodeComponent: nodeComponent }), jsx("path", { className: "react-flow__minimap-mask", d: `M${x - offset},${y - offset}h${width + offset * 2}v${height + offset * 2}h${-width - offset * 2}z + M${viewBB.x},${viewBB.y}h${viewBB.width}v${viewBB.height}h${-viewBB.width}z`, fillRule: "evenodd", pointerEvents: "none" })] }) })); +} +MiniMapComponent.displayName = 'MiniMap'; +/** + * The `` component can be used to render an overview of your flow. It + * renders each node as an SVG element and visualizes where the current viewport is + * in relation to the rest of the flow. + * + * @public + * @example + * + * ```jsx + *import { ReactFlow, MiniMap } from '@xyflow/react'; + * + *export default function Flow() { + * return ( + * + * + * + * ); + *} + *``` + */ +const MiniMap = memo(MiniMapComponent); + +const scaleSelector = (calculateScale) => (store) => calculateScale ? `${Math.max(1 / store.transform[2], 1)}` : undefined; +const defaultPositions = { + [ResizeControlVariant.Line]: 'right', + [ResizeControlVariant.Handle]: 'bottom-right', +}; +function ResizeControl({ nodeId, position, variant = ResizeControlVariant.Handle, className, style = undefined, children, color, minWidth = 10, minHeight = 10, maxWidth = Number.MAX_VALUE, maxHeight = Number.MAX_VALUE, keepAspectRatio = false, resizeDirection, autoScale = true, shouldResize, onResizeStart, onResize, onResizeEnd, }) { + const contextNodeId = useNodeId(); + const id = typeof nodeId === 'string' ? nodeId : contextNodeId; + const store = useStoreApi(); + const resizeControlRef = useRef(null); + const isHandleControl = variant === ResizeControlVariant.Handle; + const scale = useStore(useCallback(scaleSelector(isHandleControl && autoScale), [isHandleControl, autoScale]), shallow); + const resizer = useRef(null); + const controlPosition = position ?? defaultPositions[variant]; + useEffect(() => { + if (!resizeControlRef.current || !id) { + return; + } + if (!resizer.current) { + resizer.current = XYResizer({ + domNode: resizeControlRef.current, + nodeId: id, + getStoreItems: () => { + const { nodeLookup, transform, snapGrid, snapToGrid, nodeOrigin, domNode } = store.getState(); + return { + nodeLookup, + transform, + snapGrid, + snapToGrid, + nodeOrigin, + paneDomNode: domNode, + }; + }, + onChange: (change, childChanges) => { + const { triggerNodeChanges, nodeLookup, parentLookup, nodeOrigin } = store.getState(); + const changes = []; + const nextPosition = { x: change.x, y: change.y }; + const node = nodeLookup.get(id); + if (node && node.expandParent && node.parentId) { + const origin = node.origin ?? nodeOrigin; + const width = change.width ?? node.measured.width ?? 0; + const height = change.height ?? node.measured.height ?? 0; + const child = { + id: node.id, + parentId: node.parentId, + rect: { + width, + height, + ...evaluateAbsolutePosition({ + x: change.x ?? node.position.x, + y: change.y ?? node.position.y, + }, { width, height }, node.parentId, nodeLookup, origin), + }, + }; + const parentExpandChanges = handleExpandParent([child], nodeLookup, parentLookup, nodeOrigin); + changes.push(...parentExpandChanges); + /* + * when the parent was expanded by the child node, its position will be clamped at + * 0,0 when node origin is 0,0 and to width, height if it's 1,1 + */ + nextPosition.x = change.x ? Math.max(origin[0] * width, change.x) : undefined; + nextPosition.y = change.y ? Math.max(origin[1] * height, change.y) : undefined; + } + if (nextPosition.x !== undefined && nextPosition.y !== undefined) { + const positionChange = { + id, + type: 'position', + position: { ...nextPosition }, + }; + changes.push(positionChange); + } + if (change.width !== undefined && change.height !== undefined) { + const setAttributes = !resizeDirection ? true : resizeDirection === 'horizontal' ? 'width' : 'height'; + const dimensionChange = { + id, + type: 'dimensions', + resizing: true, + setAttributes, + dimensions: { + width: change.width, + height: change.height, + }, + }; + changes.push(dimensionChange); + } + for (const childChange of childChanges) { + const positionChange = { + ...childChange, + type: 'position', + }; + changes.push(positionChange); + } + triggerNodeChanges(changes); + }, + onEnd: ({ width, height }) => { + const dimensionChange = { + id: id, + type: 'dimensions', + resizing: false, + dimensions: { + width, + height, + }, + }; + store.getState().triggerNodeChanges([dimensionChange]); + }, + }); + } + resizer.current.update({ + controlPosition, + boundaries: { + minWidth, + minHeight, + maxWidth, + maxHeight, + }, + keepAspectRatio, + resizeDirection, + onResizeStart, + onResize, + onResizeEnd, + shouldResize, + }); + return () => { + resizer.current?.destroy(); + }; + }, [ + controlPosition, + minWidth, + minHeight, + maxWidth, + maxHeight, + keepAspectRatio, + onResizeStart, + onResize, + onResizeEnd, + shouldResize, + ]); + const positionClassNames = controlPosition.split('-'); + return (jsx("div", { className: cc(['react-flow__resize-control', 'nodrag', ...positionClassNames, variant, className]), ref: resizeControlRef, style: { + ...style, + scale, + ...(color && { [isHandleControl ? 'backgroundColor' : 'borderColor']: color }), + }, children: children })); +} +/** + * To create your own resizing UI, you can use the `NodeResizeControl` component where you can pass children (such as icons). + * @public + * + */ +const NodeResizeControl = memo(ResizeControl); + +/** + * The `` component can be used to add a resize functionality to your + * nodes. It renders draggable controls around the node to resize in all directions. + * @public + * + * @example + *```jsx + *import { memo } from 'react'; + *import { Handle, Position, NodeResizer } from '@xyflow/react'; + * + *function ResizableNode({ data }) { + * return ( + * <> + * + * + *
{data.label}
+ * + * + * ); + *}; + * + *export default memo(ResizableNode); + *``` + */ +function NodeResizer({ nodeId, isVisible = true, handleClassName, handleStyle, lineClassName, lineStyle, color, minWidth = 10, minHeight = 10, maxWidth = Number.MAX_VALUE, maxHeight = Number.MAX_VALUE, keepAspectRatio = false, autoScale = true, shouldResize, onResizeStart, onResize, onResizeEnd, }) { + if (!isVisible) { + return null; + } + return (jsxs(Fragment, { children: [XY_RESIZER_LINE_POSITIONS.map((position) => (jsx(NodeResizeControl, { className: lineClassName, style: lineStyle, nodeId: nodeId, position: position, variant: ResizeControlVariant.Line, color: color, minWidth: minWidth, minHeight: minHeight, maxWidth: maxWidth, maxHeight: maxHeight, onResizeStart: onResizeStart, keepAspectRatio: keepAspectRatio, autoScale: autoScale, shouldResize: shouldResize, onResize: onResize, onResizeEnd: onResizeEnd }, position))), XY_RESIZER_HANDLE_POSITIONS.map((position) => (jsx(NodeResizeControl, { className: handleClassName, style: handleStyle, nodeId: nodeId, position: position, color: color, minWidth: minWidth, minHeight: minHeight, maxWidth: maxWidth, maxHeight: maxHeight, onResizeStart: onResizeStart, keepAspectRatio: keepAspectRatio, autoScale: autoScale, shouldResize: shouldResize, onResize: onResize, onResizeEnd: onResizeEnd }, position)))] })); +} + +const selector = (state) => state.domNode?.querySelector('.react-flow__renderer'); +function NodeToolbarPortal({ children }) { + const wrapperRef = useStore(selector); + if (!wrapperRef) { + return null; + } + return createPortal(children, wrapperRef); +} + +const nodeEqualityFn = (a, b) => a?.internals.positionAbsolute.x !== b?.internals.positionAbsolute.x || + a?.internals.positionAbsolute.y !== b?.internals.positionAbsolute.y || + a?.measured.width !== b?.measured.width || + a?.measured.height !== b?.measured.height || + a?.selected !== b?.selected || + a?.internals.z !== b?.internals.z; +const nodesEqualityFn = (a, b) => { + if (a.size !== b.size) { + return false; + } + for (const [key, node] of a) { + if (nodeEqualityFn(node, b.get(key))) { + return false; + } + } + return true; +}; +const storeSelector = (state) => ({ + x: state.transform[0], + y: state.transform[1], + zoom: state.transform[2], + selectedNodesCount: state.nodes.filter((node) => node.selected).length, +}); +/** + * This component can render a toolbar or tooltip to one side of a custom node. This + * toolbar doesn't scale with the viewport so that the content is always visible. + * + * @public + * @example + * ```jsx + *import { memo } from 'react'; + *import { Handle, Position, NodeToolbar } from '@xyflow/react'; + * + *function CustomNode({ data }) { + * return ( + * <> + * + * + * + * + * + * + *
+ * {data.label} + *
+ * + * + * + * + * ); + *}; + * + *export default memo(CustomNode); + *``` + * @remarks By default, the toolbar is only visible when a node is selected. If multiple + * nodes are selected it will not be visible to prevent overlapping toolbars or + * clutter. You can override this behavior by setting the `isVisible` prop to `true`. + */ +function NodeToolbar({ nodeId, children, className, style, isVisible, position = Position.Top, offset = 10, align = 'center', ...rest }) { + const contextNodeId = useNodeId(); + const nodesSelector = useCallback((state) => { + const nodeIds = Array.isArray(nodeId) ? nodeId : [nodeId || contextNodeId || '']; + const internalNodes = nodeIds.reduce((res, id) => { + const node = state.nodeLookup.get(id); + if (node) { + res.set(node.id, node); + } + return res; + }, new Map()); + return internalNodes; + }, [nodeId, contextNodeId]); + const nodes = useStore(nodesSelector, nodesEqualityFn); + const { x, y, zoom, selectedNodesCount } = useStore(storeSelector, shallow); + // if isVisible is not set, we show the toolbar only if its node is selected and no other node is selected + const isActive = typeof isVisible === 'boolean' + ? isVisible + : nodes.size === 1 && nodes.values().next().value?.selected && selectedNodesCount === 1; + if (!isActive || !nodes.size) { + return null; + } + const nodeRect = getInternalNodesBounds(nodes); + const nodesArray = Array.from(nodes.values()); + const zIndex = Math.max(...nodesArray.map((node) => node.internals.z + 1)); + const wrapperStyle = { + position: 'absolute', + transform: getNodeToolbarTransform(nodeRect, { x, y, zoom }, position, offset, align), + zIndex, + ...style, + }; + return (jsx(NodeToolbarPortal, { children: jsx("div", { style: wrapperStyle, className: cc(['react-flow__node-toolbar', className]), ...rest, "data-id": nodesArray.reduce((acc, node) => `${acc}${node.id} `, '').trim(), children: children }) })); +} + +export { Background, BackgroundVariant, BaseEdge, BezierEdge, ControlButton, Controls, EdgeLabelRenderer, EdgeText, Handle, MiniMap, NodeResizeControl, NodeResizer, NodeToolbar, Panel, index as ReactFlow, ReactFlowProvider, SimpleBezierEdge, SmoothStepEdge, StepEdge, StraightEdge, ViewportPortal, applyEdgeChanges, applyNodeChanges, getSimpleBezierPath, isEdge, isNode, useConnection, useEdges, useEdgesState, useHandleConnections, useInternalNode, useKeyPress, useNodeConnections, useNodeId, useNodes, useNodesData, useNodesInitialized, useNodesState, useOnSelectionChange, useOnViewportChange, useReactFlow, useStore, useStoreApi, useUpdateNodeInternals, useViewport }; diff --git a/node_modules/@xyflow/react/dist/esm/index.mjs b/node_modules/@xyflow/react/dist/esm/index.mjs new file mode 100644 index 0000000..13eadd5 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/index.mjs @@ -0,0 +1,4826 @@ +"use client" +import { jsxs, Fragment, jsx } from 'react/jsx-runtime'; +import { createContext, useContext, useMemo, forwardRef, useEffect, useRef, useState, useLayoutEffect, useCallback, memo } from 'react'; +import cc from 'classcat'; +import { errorMessages, mergeAriaLabelConfig, infiniteExtent, isInputDOMNode, getViewportForBounds, pointToRendererPoint, rendererPointToPoint, isNodeBase, isEdgeBase, getElementsToRemove, isRectObject, nodeToRect, getOverlappingArea, getNodesBounds, withResolvers, evaluateAbsolutePosition, getDimensions, XYPanZoom, PanOnScrollMode, SelectionMode, getEventPosition, getNodesInside, areSetsEqual, XYDrag, snapPosition, calculateNodePosition, Position, ConnectionMode, isMouseEvent, XYHandle, getHostForElement, addEdge, getInternalNodesBounds, isNumeric, nodeHasDimensions, getNodeDimensions, elementSelectionKeys, isEdgeVisible, MarkerType, createMarkerIds, getBezierEdgeCenter, getSmoothStepPath, getStraightPath, getBezierPath, getEdgePosition, getElevatedEdgeZIndex, getMarkerId, getConnectionStatus, ConnectionLineType, updateConnectionLookup, adoptUserNodes, initialConnection, devWarn, defaultAriaLabelConfig, updateNodeInternals, updateAbsolutePositions, handleExpandParent, panBy, fitViewport, isMacOs, areConnectionMapsEqual, handleConnectionChange, shallowNodeData, XYMinimap, getBoundsOfRects, ResizeControlVariant, XYResizer, XY_RESIZER_LINE_POSITIONS, XY_RESIZER_HANDLE_POSITIONS, getNodeToolbarTransform } from '@xyflow/system'; +export { ConnectionLineType, ConnectionMode, MarkerType, PanOnScrollMode, Position, ResizeControlVariant, SelectionMode, addEdge, getBezierEdgeCenter, getBezierPath, getConnectedEdges, getEdgeCenter, getIncomers, getNodesBounds, getOutgoers, getSmoothStepPath, getStraightPath, getViewportForBounds, reconnectEdge } from '@xyflow/system'; +import { useStoreWithEqualityFn, createWithEqualityFn } from 'zustand/traditional'; +import { shallow } from 'zustand/shallow'; +import { createPortal } from 'react-dom'; + +const StoreContext = createContext(null); +const Provider$1 = StoreContext.Provider; + +const zustandErrorMessage = errorMessages['error001'](); +/** + * This hook can be used to subscribe to internal state changes of the React Flow + * component. The `useStore` hook is re-exported from the [Zustand](https://github.com/pmndrs/zustand) + * state management library, so you should check out their docs for more details. + * + * @public + * @param selector - A selector function that returns a slice of the flow's internal state. + * Extracting or transforming just the state you need is a good practice to avoid unnecessary + * re-renders. + * @param equalityFn - A function to compare the previous and next value. This is incredibly useful + * for preventing unnecessary re-renders. Good sensible defaults are using `Object.is` or importing + * `zustand/shallow`, but you can be as granular as you like. + * @returns The selected state slice. + * + * @example + * ```ts + * const nodes = useStore((state) => state.nodes); + * ``` + * + * @remarks This hook should only be used if there is no other way to access the internal + * state. For many of the common use cases, there are dedicated hooks available + * such as {@link useReactFlow}, {@link useViewport}, etc. + */ +function useStore(selector, equalityFn) { + const store = useContext(StoreContext); + if (store === null) { + throw new Error(zustandErrorMessage); + } + return useStoreWithEqualityFn(store, selector, equalityFn); +} +/** + * In some cases, you might need to access the store directly. This hook returns the store object which can be used on demand to access the state or dispatch actions. + * + * @returns The store object. + * @example + * ```ts + * const store = useStoreApi(); + * ``` + * + * @remarks This hook should only be used if there is no other way to access the internal + * state. For many of the common use cases, there are dedicated hooks available + * such as {@link useReactFlow}, {@link useViewport}, etc. + */ +function useStoreApi() { + const store = useContext(StoreContext); + if (store === null) { + throw new Error(zustandErrorMessage); + } + return useMemo(() => ({ + getState: store.getState, + setState: store.setState, + subscribe: store.subscribe, + }), [store]); +} + +const style = { display: 'none' }; +const ariaLiveStyle = { + position: 'absolute', + width: 1, + height: 1, + margin: -1, + border: 0, + padding: 0, + overflow: 'hidden', + clip: 'rect(0px, 0px, 0px, 0px)', + clipPath: 'inset(100%)', +}; +const ARIA_NODE_DESC_KEY = 'react-flow__node-desc'; +const ARIA_EDGE_DESC_KEY = 'react-flow__edge-desc'; +const ARIA_LIVE_MESSAGE = 'react-flow__aria-live'; +const ariaLiveSelector = (s) => s.ariaLiveMessage; +const ariaLabelConfigSelector = (s) => s.ariaLabelConfig; +function AriaLiveMessage({ rfId }) { + const ariaLiveMessage = useStore(ariaLiveSelector); + return (jsx("div", { id: `${ARIA_LIVE_MESSAGE}-${rfId}`, "aria-live": "assertive", "aria-atomic": "true", style: ariaLiveStyle, children: ariaLiveMessage })); +} +function A11yDescriptions({ rfId, disableKeyboardA11y }) { + const ariaLabelConfig = useStore(ariaLabelConfigSelector); + return (jsxs(Fragment, { children: [jsx("div", { id: `${ARIA_NODE_DESC_KEY}-${rfId}`, style: style, children: disableKeyboardA11y + ? ariaLabelConfig['node.a11yDescription.default'] + : ariaLabelConfig['node.a11yDescription.keyboardDisabled'] }), jsx("div", { id: `${ARIA_EDGE_DESC_KEY}-${rfId}`, style: style, children: ariaLabelConfig['edge.a11yDescription.default'] }), !disableKeyboardA11y && jsx(AriaLiveMessage, { rfId: rfId })] })); +} + +const selector$n = (s) => (s.userSelectionActive ? 'none' : 'all'); +/** + * The `` component helps you position content above the viewport. + * It is used internally by the [``](/api-reference/components/minimap) + * and [``](/api-reference/components/controls) components. + * + * @public + * + * @example + * ```jsx + *import { ReactFlow, Background, Panel } from '@xyflow/react'; + * + *export default function Flow() { + * return ( + * + * top-left + * top-center + * top-right + * bottom-left + * bottom-center + * bottom-right + * + * ); + *} + *``` + */ +const Panel = forwardRef(({ position = 'top-left', children, className, style, ...rest }, ref) => { + const pointerEvents = useStore(selector$n); + const positionClasses = `${position}`.split('-'); + return (jsx("div", { className: cc(['react-flow__panel', className, ...positionClasses]), style: { ...style, pointerEvents }, ref: ref, ...rest, children: children })); +}); +Panel.displayName = 'Panel'; + +function Attribution({ proOptions, position = 'bottom-right' }) { + if (proOptions?.hideAttribution) { + return null; + } + return (jsx(Panel, { position: position, className: "react-flow__attribution", "data-message": "Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev", children: jsx("a", { href: "https://reactflow.dev", target: "_blank", rel: "noopener noreferrer", "aria-label": "React Flow attribution", children: "React Flow" }) })); +} + +const selector$m = (s) => { + const selectedNodes = []; + const selectedEdges = []; + for (const [, node] of s.nodeLookup) { + if (node.selected) { + selectedNodes.push(node.internals.userNode); + } + } + for (const [, edge] of s.edgeLookup) { + if (edge.selected) { + selectedEdges.push(edge); + } + } + return { selectedNodes, selectedEdges }; +}; +const selectId = (obj) => obj.id; +function areEqual(a, b) { + return (shallow(a.selectedNodes.map(selectId), b.selectedNodes.map(selectId)) && + shallow(a.selectedEdges.map(selectId), b.selectedEdges.map(selectId))); +} +function SelectionListenerInner({ onSelectionChange, }) { + const store = useStoreApi(); + const { selectedNodes, selectedEdges } = useStore(selector$m, areEqual); + useEffect(() => { + const params = { nodes: selectedNodes, edges: selectedEdges }; + onSelectionChange?.(params); + store.getState().onSelectionChangeHandlers.forEach((fn) => fn(params)); + }, [selectedNodes, selectedEdges, onSelectionChange]); + return null; +} +const changeSelector = (s) => !!s.onSelectionChangeHandlers; +function SelectionListener({ onSelectionChange, }) { + const storeHasSelectionChangeHandlers = useStore(changeSelector); + if (onSelectionChange || storeHasSelectionChangeHandlers) { + return jsx(SelectionListenerInner, { onSelectionChange: onSelectionChange }); + } + return null; +} + +const defaultNodeOrigin = [0, 0]; +const defaultViewport = { x: 0, y: 0, zoom: 1 }; + +/* + * This component helps us to update the store with the values coming from the user. + * We distinguish between values we can update directly with `useDirectStoreUpdater` (like `snapGrid`) + * and values that have a dedicated setter function in the store (like `setNodes`). + */ +// These fields exist in the global store, and we need to keep them up to date +const reactFlowFieldsToTrack = [ + 'nodes', + 'edges', + 'defaultNodes', + 'defaultEdges', + 'onConnect', + 'onConnectStart', + 'onConnectEnd', + 'onClickConnectStart', + 'onClickConnectEnd', + 'nodesDraggable', + 'autoPanOnNodeFocus', + 'nodesConnectable', + 'nodesFocusable', + 'edgesFocusable', + 'edgesReconnectable', + 'elevateNodesOnSelect', + 'elevateEdgesOnSelect', + 'minZoom', + 'maxZoom', + 'nodeExtent', + 'onNodesChange', + 'onEdgesChange', + 'elementsSelectable', + 'connectionMode', + 'snapGrid', + 'snapToGrid', + 'translateExtent', + 'connectOnClick', + 'defaultEdgeOptions', + 'fitView', + 'fitViewOptions', + 'onNodesDelete', + 'onEdgesDelete', + 'onDelete', + 'onNodeDrag', + 'onNodeDragStart', + 'onNodeDragStop', + 'onSelectionDrag', + 'onSelectionDragStart', + 'onSelectionDragStop', + 'onMoveStart', + 'onMove', + 'onMoveEnd', + 'noPanClassName', + 'nodeOrigin', + 'autoPanOnConnect', + 'autoPanOnNodeDrag', + 'onError', + 'connectionRadius', + 'isValidConnection', + 'selectNodesOnDrag', + 'nodeDragThreshold', + 'onBeforeDelete', + 'debug', + 'autoPanSpeed', + 'paneClickDistance', + 'ariaLabelConfig', +]; +// rfId doesn't exist in ReactFlowProps, but it's one of the fields we want to update +const fieldsToTrack = [...reactFlowFieldsToTrack, 'rfId']; +const selector$l = (s) => ({ + setNodes: s.setNodes, + setEdges: s.setEdges, + setMinZoom: s.setMinZoom, + setMaxZoom: s.setMaxZoom, + setTranslateExtent: s.setTranslateExtent, + setNodeExtent: s.setNodeExtent, + reset: s.reset, + setDefaultNodesAndEdges: s.setDefaultNodesAndEdges, + setPaneClickDistance: s.setPaneClickDistance, +}); +const initPrevValues = { + /* + * these are values that are also passed directly to other components + * than the StoreUpdater. We can reduce the number of setStore calls + * by setting the same values here as prev fields. + */ + translateExtent: infiniteExtent, + nodeOrigin: defaultNodeOrigin, + minZoom: 0.5, + maxZoom: 2, + elementsSelectable: true, + noPanClassName: 'nopan', + rfId: '1', + paneClickDistance: 0, +}; +function StoreUpdater(props) { + const { setNodes, setEdges, setMinZoom, setMaxZoom, setTranslateExtent, setNodeExtent, reset, setDefaultNodesAndEdges, setPaneClickDistance, } = useStore(selector$l, shallow); + const store = useStoreApi(); + useEffect(() => { + setDefaultNodesAndEdges(props.defaultNodes, props.defaultEdges); + return () => { + // when we reset the store we also need to reset the previous fields + previousFields.current = initPrevValues; + reset(); + }; + }, []); + const previousFields = useRef(initPrevValues); + useEffect(() => { + for (const fieldName of fieldsToTrack) { + const fieldValue = props[fieldName]; + const previousFieldValue = previousFields.current[fieldName]; + if (fieldValue === previousFieldValue) + continue; + if (typeof props[fieldName] === 'undefined') + continue; + // Custom handling with dedicated setters for some fields + if (fieldName === 'nodes') + setNodes(fieldValue); + else if (fieldName === 'edges') + setEdges(fieldValue); + else if (fieldName === 'minZoom') + setMinZoom(fieldValue); + else if (fieldName === 'maxZoom') + setMaxZoom(fieldValue); + else if (fieldName === 'translateExtent') + setTranslateExtent(fieldValue); + else if (fieldName === 'nodeExtent') + setNodeExtent(fieldValue); + else if (fieldName === 'paneClickDistance') + setPaneClickDistance(fieldValue); + // Renamed fields + else if (fieldName === 'fitView') + store.setState({ fitViewQueued: fieldValue }); + else if (fieldName === 'fitViewOptions') + store.setState({ fitViewOptions: fieldValue }); + if (fieldName === 'ariaLabelConfig') { + store.setState({ ariaLabelConfig: mergeAriaLabelConfig(fieldValue) }); + } + // General case + else + store.setState({ [fieldName]: fieldValue }); + } + previousFields.current = props; + }, + // Only re-run the effect if one of the fields we track changes + fieldsToTrack.map((fieldName) => props[fieldName])); + return null; +} + +function getMediaQuery() { + if (typeof window === 'undefined' || !window.matchMedia) { + return null; + } + return window.matchMedia('(prefers-color-scheme: dark)'); +} +/** + * Hook for receiving the current color mode class 'dark' or 'light'. + * + * @internal + * @param colorMode - The color mode to use ('dark', 'light' or 'system') + */ +function useColorModeClass(colorMode) { + const [colorModeClass, setColorModeClass] = useState(colorMode === 'system' ? null : colorMode); + useEffect(() => { + if (colorMode !== 'system') { + setColorModeClass(colorMode); + return; + } + const mediaQuery = getMediaQuery(); + const updateColorModeClass = () => setColorModeClass(mediaQuery?.matches ? 'dark' : 'light'); + updateColorModeClass(); + mediaQuery?.addEventListener('change', updateColorModeClass); + return () => { + mediaQuery?.removeEventListener('change', updateColorModeClass); + }; + }, [colorMode]); + return colorModeClass !== null ? colorModeClass : getMediaQuery()?.matches ? 'dark' : 'light'; +} + +const defaultDoc = typeof document !== 'undefined' ? document : null; +/** + * This hook lets you listen for specific key codes and tells you whether they are + * currently pressed or not. + * + * @public + * @param options - Options + * + * @example + * ```tsx + *import { useKeyPress } from '@xyflow/react'; + * + *export default function () { + * const spacePressed = useKeyPress('Space'); + * const cmdAndSPressed = useKeyPress(['Meta+s', 'Strg+s']); + * + * return ( + *
+ * {spacePressed &&

Space pressed!

} + * {cmdAndSPressed &&

Cmd + S pressed!

} + *
+ * ); + *} + *``` + */ +function useKeyPress( +/** + * The key code (string or array of strings) specifies which key(s) should trigger + * an action. + * + * A **string** can represent: + * - A **single key**, e.g. `'a'` + * - A **key combination**, using `'+'` to separate keys, e.g. `'a+d'` + * + * An **array of strings** represents **multiple possible key inputs**. For example, `['a', 'd+s']` + * means the user can press either the single key `'a'` or the combination of `'d'` and `'s'`. + * @default null + */ +keyCode = null, options = { target: defaultDoc, actInsideInputWithModifier: true }) { + const [keyPressed, setKeyPressed] = useState(false); + // we need to remember if a modifier key is pressed in order to track it + const modifierPressed = useRef(false); + // we need to remember the pressed keys in order to support combinations + const pressedKeys = useRef(new Set([])); + /* + * keyCodes = array with single keys [['a']] or key combinations [['a', 's']] + * keysToWatch = array with all keys flattened ['a', 'd', 'ShiftLeft'] + * used to check if we store event.code or event.key. When the code is in the list of keysToWatch + * we use the code otherwise the key. Explainer: When you press the left "command" key, the code is "MetaLeft" + * and the key is "Meta". We want users to be able to pass keys and codes so we assume that the key is meant when + * we can't find it in the list of keysToWatch. + */ + const [keyCodes, keysToWatch] = useMemo(() => { + if (keyCode !== null) { + const keyCodeArr = Array.isArray(keyCode) ? keyCode : [keyCode]; + const keys = keyCodeArr + .filter((kc) => typeof kc === 'string') + /* + * we first replace all '+' with '\n' which we will use to split the keys on + * then we replace '\n\n' with '\n+', this way we can also support the combination 'key++' + * in the end we simply split on '\n' to get the key array + */ + .map((kc) => kc.replace('+', '\n').replace('\n\n', '\n+').split('\n')); + const keysFlat = keys.reduce((res, item) => res.concat(...item), []); + return [keys, keysFlat]; + } + return [[], []]; + }, [keyCode]); + useEffect(() => { + const target = options?.target ?? defaultDoc; + const actInsideInputWithModifier = options?.actInsideInputWithModifier ?? true; + if (keyCode !== null) { + const downHandler = (event) => { + modifierPressed.current = event.ctrlKey || event.metaKey || event.shiftKey || event.altKey; + const preventAction = (!modifierPressed.current || (modifierPressed.current && !actInsideInputWithModifier)) && + isInputDOMNode(event); + if (preventAction) { + return false; + } + const keyOrCode = useKeyOrCode(event.code, keysToWatch); + pressedKeys.current.add(event[keyOrCode]); + if (isMatchingKey(keyCodes, pressedKeys.current, false)) { + const target = (event.composedPath?.()?.[0] || event.target); + const isInteractiveElement = target?.nodeName === 'BUTTON' || target?.nodeName === 'A'; + if (options.preventDefault !== false && (modifierPressed.current || !isInteractiveElement)) { + event.preventDefault(); + } + setKeyPressed(true); + } + }; + const upHandler = (event) => { + const keyOrCode = useKeyOrCode(event.code, keysToWatch); + if (isMatchingKey(keyCodes, pressedKeys.current, true)) { + setKeyPressed(false); + pressedKeys.current.clear(); + } + else { + pressedKeys.current.delete(event[keyOrCode]); + } + // fix for Mac: when cmd key is pressed, keyup is not triggered for any other key, see: https://stackoverflow.com/questions/27380018/when-cmd-key-is-kept-pressed-keyup-is-not-triggered-for-any-other-key + if (event.key === 'Meta') { + pressedKeys.current.clear(); + } + modifierPressed.current = false; + }; + const resetHandler = () => { + pressedKeys.current.clear(); + setKeyPressed(false); + }; + target?.addEventListener('keydown', downHandler); + target?.addEventListener('keyup', upHandler); + window.addEventListener('blur', resetHandler); + window.addEventListener('contextmenu', resetHandler); + return () => { + target?.removeEventListener('keydown', downHandler); + target?.removeEventListener('keyup', upHandler); + window.removeEventListener('blur', resetHandler); + window.removeEventListener('contextmenu', resetHandler); + }; + } + }, [keyCode, setKeyPressed]); + return keyPressed; +} +// utils +function isMatchingKey(keyCodes, pressedKeys, isUp) { + return (keyCodes + /* + * we only want to compare same sizes of keyCode definitions + * and pressed keys. When the user specified 'Meta' as a key somewhere + * this would also be truthy without this filter when user presses 'Meta' + 'r' + */ + .filter((keys) => isUp || keys.length === pressedKeys.size) + /* + * since we want to support multiple possibilities only one of the + * combinations need to be part of the pressed keys + */ + .some((keys) => keys.every((k) => pressedKeys.has(k)))); +} +function useKeyOrCode(eventCode, keysToWatch) { + return keysToWatch.includes(eventCode) ? 'code' : 'key'; +} + +/** + * Hook for getting viewport helper functions. + * + * @internal + * @returns viewport helper functions + */ +const useViewportHelper = () => { + const store = useStoreApi(); + return useMemo(() => { + return { + zoomIn: (options) => { + const { panZoom } = store.getState(); + return panZoom ? panZoom.scaleBy(1.2, { duration: options?.duration }) : Promise.resolve(false); + }, + zoomOut: (options) => { + const { panZoom } = store.getState(); + return panZoom ? panZoom.scaleBy(1 / 1.2, { duration: options?.duration }) : Promise.resolve(false); + }, + zoomTo: (zoomLevel, options) => { + const { panZoom } = store.getState(); + return panZoom ? panZoom.scaleTo(zoomLevel, { duration: options?.duration }) : Promise.resolve(false); + }, + getZoom: () => store.getState().transform[2], + setViewport: async (viewport, options) => { + const { transform: [tX, tY, tZoom], panZoom, } = store.getState(); + if (!panZoom) { + return Promise.resolve(false); + } + await panZoom.setViewport({ + x: viewport.x ?? tX, + y: viewport.y ?? tY, + zoom: viewport.zoom ?? tZoom, + }, options); + return Promise.resolve(true); + }, + getViewport: () => { + const [x, y, zoom] = store.getState().transform; + return { x, y, zoom }; + }, + setCenter: async (x, y, options) => { + return store.getState().setCenter(x, y, options); + }, + fitBounds: async (bounds, options) => { + const { width, height, minZoom, maxZoom, panZoom } = store.getState(); + const viewport = getViewportForBounds(bounds, width, height, minZoom, maxZoom, options?.padding ?? 0.1); + if (!panZoom) { + return Promise.resolve(false); + } + await panZoom.setViewport(viewport, { + duration: options?.duration, + ease: options?.ease, + interpolate: options?.interpolate, + }); + return Promise.resolve(true); + }, + screenToFlowPosition: (clientPosition, options = {}) => { + const { transform, snapGrid, snapToGrid, domNode } = store.getState(); + if (!domNode) { + return clientPosition; + } + const { x: domX, y: domY } = domNode.getBoundingClientRect(); + const correctedPosition = { + x: clientPosition.x - domX, + y: clientPosition.y - domY, + }; + const _snapGrid = options.snapGrid ?? snapGrid; + const _snapToGrid = options.snapToGrid ?? snapToGrid; + return pointToRendererPoint(correctedPosition, transform, _snapToGrid, _snapGrid); + }, + flowToScreenPosition: (flowPosition) => { + const { transform, domNode } = store.getState(); + if (!domNode) { + return flowPosition; + } + const { x: domX, y: domY } = domNode.getBoundingClientRect(); + const rendererPosition = rendererPointToPoint(flowPosition, transform); + return { + x: rendererPosition.x + domX, + y: rendererPosition.y + domY, + }; + }, + }; + }, []); +}; + +/* + * This function applies changes to nodes or edges that are triggered by React Flow internally. + * When you drag a node for example, React Flow will send a position change update. + * This function then applies the changes and returns the updated elements. + */ +function applyChanges(changes, elements) { + const updatedElements = []; + /* + * By storing a map of changes for each element, we can a quick lookup as we + * iterate over the elements array! + */ + const changesMap = new Map(); + const addItemChanges = []; + for (const change of changes) { + if (change.type === 'add') { + addItemChanges.push(change); + continue; + } + else if (change.type === 'remove' || change.type === 'replace') { + /* + * For a 'remove' change we can safely ignore any other changes queued for + * the same element, it's going to be removed anyway! + */ + changesMap.set(change.id, [change]); + } + else { + const elementChanges = changesMap.get(change.id); + if (elementChanges) { + /* + * If we have some changes queued already, we can do a mutable update of + * that array and save ourselves some copying. + */ + elementChanges.push(change); + } + else { + changesMap.set(change.id, [change]); + } + } + } + for (const element of elements) { + const changes = changesMap.get(element.id); + /* + * When there are no changes for an element we can just push it unmodified, + * no need to copy it. + */ + if (!changes) { + updatedElements.push(element); + continue; + } + // If we have a 'remove' change queued, it'll be the only change in the array + if (changes[0].type === 'remove') { + continue; + } + if (changes[0].type === 'replace') { + updatedElements.push({ ...changes[0].item }); + continue; + } + /** + * For other types of changes, we want to start with a shallow copy of the + * object so React knows this element has changed. Sequential changes will + * each _mutate_ this object, so there's only ever one copy. + */ + const updatedElement = { ...element }; + for (const change of changes) { + applyChange(change, updatedElement); + } + updatedElements.push(updatedElement); + } + /* + * we need to wait for all changes to be applied before adding new items + * to be able to add them at the correct index + */ + if (addItemChanges.length) { + addItemChanges.forEach((change) => { + if (change.index !== undefined) { + updatedElements.splice(change.index, 0, { ...change.item }); + } + else { + updatedElements.push({ ...change.item }); + } + }); + } + return updatedElements; +} +// Applies a single change to an element. This is a *mutable* update. +function applyChange(change, element) { + switch (change.type) { + case 'select': { + element.selected = change.selected; + break; + } + case 'position': { + if (typeof change.position !== 'undefined') { + element.position = change.position; + } + if (typeof change.dragging !== 'undefined') { + element.dragging = change.dragging; + } + break; + } + case 'dimensions': { + if (typeof change.dimensions !== 'undefined') { + element.measured ??= {}; + element.measured.width = change.dimensions.width; + element.measured.height = change.dimensions.height; + if (change.setAttributes) { + if (change.setAttributes === true || change.setAttributes === 'width') { + element.width = change.dimensions.width; + } + if (change.setAttributes === true || change.setAttributes === 'height') { + element.height = change.dimensions.height; + } + } + } + if (typeof change.resizing === 'boolean') { + element.resizing = change.resizing; + } + break; + } + } +} +/** + * Drop in function that applies node changes to an array of nodes. + * @public + * @param changes - Array of changes to apply. + * @param nodes - Array of nodes to apply the changes to. + * @returns Array of updated nodes. + * @example + *```tsx + *import { useState, useCallback } from 'react'; + *import { ReactFlow, applyNodeChanges, type Node, type Edge, type OnNodesChange } from '@xyflow/react'; + * + *export default function Flow() { + * const [nodes, setNodes] = useState([]); + * const [edges, setEdges] = useState([]); + * const onNodesChange: OnNodesChange = useCallback( + * (changes) => { + * setNodes((oldNodes) => applyNodeChanges(changes, oldNodes)); + * }, + * [setNodes], + * ); + * + * return ( + * + * ); + *} + *``` + * @remarks Various events on the component can produce an {@link NodeChange} + * that describes how to update the edges of your flow in some way. + * If you don't need any custom behaviour, this util can be used to take an array + * of these changes and apply them to your edges. + */ +function applyNodeChanges(changes, nodes) { + return applyChanges(changes, nodes); +} +/** + * Drop in function that applies edge changes to an array of edges. + * @public + * @param changes - Array of changes to apply. + * @param edges - Array of edge to apply the changes to. + * @returns Array of updated edges. + * @example + * ```tsx + *import { useState, useCallback } from 'react'; + *import { ReactFlow, applyEdgeChanges } from '@xyflow/react'; + * + *export default function Flow() { + * const [nodes, setNodes] = useState([]); + * const [edges, setEdges] = useState([]); + * const onEdgesChange = useCallback( + * (changes) => { + * setEdges((oldEdges) => applyEdgeChanges(changes, oldEdges)); + * }, + * [setEdges], + * ); + * + * return ( + * + * ); + *} + *``` + * @remarks Various events on the component can produce an {@link EdgeChange} + * that describes how to update the edges of your flow in some way. + * If you don't need any custom behaviour, this util can be used to take an array + * of these changes and apply them to your edges. + */ +function applyEdgeChanges(changes, edges) { + return applyChanges(changes, edges); +} +function createSelectionChange(id, selected) { + return { + id, + type: 'select', + selected, + }; +} +function getSelectionChanges(items, selectedIds = new Set(), mutateItem = false) { + const changes = []; + for (const [id, item] of items) { + const willBeSelected = selectedIds.has(id); + // we don't want to set all items to selected=false on the first selection + if (!(item.selected === undefined && !willBeSelected) && item.selected !== willBeSelected) { + if (mutateItem) { + /* + * this hack is needed for nodes. When the user dragged a node, it's selected. + * When another node gets dragged, we need to deselect the previous one, + * in order to have only one selected node at a time - the onNodesChange callback comes too late here :/ + */ + item.selected = willBeSelected; + } + changes.push(createSelectionChange(item.id, willBeSelected)); + } + } + return changes; +} +function getElementsDiffChanges({ items = [], lookup, }) { + const changes = []; + const itemsLookup = new Map(items.map((item) => [item.id, item])); + for (const [index, item] of items.entries()) { + const lookupItem = lookup.get(item.id); + const storeItem = lookupItem?.internals?.userNode ?? lookupItem; + if (storeItem !== undefined && storeItem !== item) { + changes.push({ id: item.id, item: item, type: 'replace' }); + } + if (storeItem === undefined) { + changes.push({ item: item, type: 'add', index }); + } + } + for (const [id] of lookup) { + const nextNode = itemsLookup.get(id); + if (nextNode === undefined) { + changes.push({ id, type: 'remove' }); + } + } + return changes; +} +function elementToRemoveChange(item) { + return { + id: item.id, + type: 'remove', + }; +} + +/** + * Test whether an object is usable as an [`Node`](/api-reference/types/node). + * In TypeScript this is a type guard that will narrow the type of whatever you pass in to + * [`Node`](/api-reference/types/node) if it returns `true`. + * + * @public + * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Node if it returns true + * @param element - The element to test. + * @returns Tests whether the provided value can be used as a `Node`. If you're using TypeScript, + * this function acts as a type guard and will narrow the type of the value to `Node` if it returns + * `true`. + * + * @example + * ```js + *import { isNode } from '@xyflow/react'; + * + *if (isNode(node)) { + * // ... + *} + *``` + */ +const isNode = (element) => isNodeBase(element); +/** + * Test whether an object is usable as an [`Edge`](/api-reference/types/edge). + * In TypeScript this is a type guard that will narrow the type of whatever you pass in to + * [`Edge`](/api-reference/types/edge) if it returns `true`. + * + * @public + * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Edge if it returns true + * @param element - The element to test + * @returns Tests whether the provided value can be used as an `Edge`. If you're using TypeScript, + * this function acts as a type guard and will narrow the type of the value to `Edge` if it returns + * `true`. + * + * @example + * ```js + *import { isEdge } from '@xyflow/react'; + * + *if (isEdge(edge)) { + * // ... + *} + *``` + */ +const isEdge = (element) => isEdgeBase(element); +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +function fixedForwardRef(render) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return forwardRef(render); +} + +// we need this hook to prevent a warning when using react-flow in SSR +const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect; + +/** + * This hook returns a queue that can be used to batch updates. + * + * @param runQueue - a function that gets called when the queue is flushed + * @internal + * + * @returns a Queue object + */ +function useQueue(runQueue) { + /* + * Because we're using a ref above, we need some way to let React know when to + * actually process the queue. We increment this number any time we mutate the + * queue, creating a new state to trigger the layout effect below. + * Using a boolean dirty flag here instead would lead to issues related to + * automatic batching. (https://github.com/xyflow/xyflow/issues/4779) + */ + const [serial, setSerial] = useState(BigInt(0)); + /* + * A reference of all the batched updates to process before the next render. We + * want a reference here so multiple synchronous calls to `setNodes` etc can be + * batched together. + */ + const [queue] = useState(() => createQueue(() => setSerial(n => n + BigInt(1)))); + /* + * Layout effects are guaranteed to run before the next render which means we + * shouldn't run into any issues with stale state or weird issues that come from + * rendering things one frame later than expected (we used to use `setTimeout`). + */ + useIsomorphicLayoutEffect(() => { + const queueItems = queue.get(); + if (queueItems.length) { + runQueue(queueItems); + queue.reset(); + } + }, [serial]); + return queue; +} +function createQueue(cb) { + let queue = []; + return { + get: () => queue, + reset: () => { + queue = []; + }, + push: (item) => { + queue.push(item); + cb(); + }, + }; +} + +const BatchContext = createContext(null); +/** + * This is a context provider that holds and processes the node and edge update queues + * that are needed to handle setNodes, addNodes, setEdges and addEdges. + * + * @internal + */ +function BatchProvider({ children, }) { + const store = useStoreApi(); + const nodeQueueHandler = useCallback((queueItems) => { + const { nodes = [], setNodes, hasDefaultNodes, onNodesChange, nodeLookup, fitViewQueued } = store.getState(); + /* + * This is essentially an `Array.reduce` in imperative clothing. Processing + * this queue is a relatively hot path so we'd like to avoid the overhead of + * array methods where we can. + */ + let next = nodes; + for (const payload of queueItems) { + next = typeof payload === 'function' ? payload(next) : payload; + } + const changes = getElementsDiffChanges({ + items: next, + lookup: nodeLookup, + }); + if (hasDefaultNodes) { + setNodes(next); + } + // We only want to fire onNodesChange if there are changes to the nodes + if (changes.length > 0) { + onNodesChange?.(changes); + } + else if (fitViewQueued) { + // If there are no changes to the nodes, we still need to call setNodes + // to trigger a re-render and fitView. + window.requestAnimationFrame(() => { + const { fitViewQueued, nodes, setNodes } = store.getState(); + if (fitViewQueued) { + setNodes(nodes); + } + }); + } + }, []); + const nodeQueue = useQueue(nodeQueueHandler); + const edgeQueueHandler = useCallback((queueItems) => { + const { edges = [], setEdges, hasDefaultEdges, onEdgesChange, edgeLookup } = store.getState(); + let next = edges; + for (const payload of queueItems) { + next = typeof payload === 'function' ? payload(next) : payload; + } + if (hasDefaultEdges) { + setEdges(next); + } + else if (onEdgesChange) { + onEdgesChange(getElementsDiffChanges({ + items: next, + lookup: edgeLookup, + })); + } + }, []); + const edgeQueue = useQueue(edgeQueueHandler); + const value = useMemo(() => ({ nodeQueue, edgeQueue }), []); + return jsx(BatchContext.Provider, { value: value, children: children }); +} +function useBatchContext() { + const batchContext = useContext(BatchContext); + if (!batchContext) { + throw new Error('useBatchContext must be used within a BatchProvider'); + } + return batchContext; +} + +const selector$k = (s) => !!s.panZoom; +/** + * This hook returns a ReactFlowInstance that can be used to update nodes and edges, manipulate the viewport, or query the current state of the flow. + * + * @public + * @example + * ```jsx + *import { useCallback, useState } from 'react'; + *import { useReactFlow } from '@xyflow/react'; + * + *export function NodeCounter() { + * const reactFlow = useReactFlow(); + * const [count, setCount] = useState(0); + * const countNodes = useCallback(() => { + * setCount(reactFlow.getNodes().length); + * // you need to pass it as a dependency if you are using it with useEffect or useCallback + * // because at the first render, it's not initialized yet and some functions might not work. + * }, [reactFlow]); + * + * return ( + *
+ * + *

There are {count} nodes in the flow.

+ *
+ * ); + *} + *``` + */ +function useReactFlow() { + const viewportHelper = useViewportHelper(); + const store = useStoreApi(); + const batchContext = useBatchContext(); + const viewportInitialized = useStore(selector$k); + const generalHelper = useMemo(() => { + const getInternalNode = (id) => store.getState().nodeLookup.get(id); + const setNodes = (payload) => { + batchContext.nodeQueue.push(payload); + }; + const setEdges = (payload) => { + batchContext.edgeQueue.push(payload); + }; + const getNodeRect = (node) => { + const { nodeLookup, nodeOrigin } = store.getState(); + const nodeToUse = isNode(node) ? node : nodeLookup.get(node.id); + const position = nodeToUse.parentId + ? evaluateAbsolutePosition(nodeToUse.position, nodeToUse.measured, nodeToUse.parentId, nodeLookup, nodeOrigin) + : nodeToUse.position; + const nodeWithPosition = { + ...nodeToUse, + position, + width: nodeToUse.measured?.width ?? nodeToUse.width, + height: nodeToUse.measured?.height ?? nodeToUse.height, + }; + return nodeToRect(nodeWithPosition); + }; + const updateNode = (id, nodeUpdate, options = { replace: false }) => { + setNodes((prevNodes) => prevNodes.map((node) => { + if (node.id === id) { + const nextNode = typeof nodeUpdate === 'function' ? nodeUpdate(node) : nodeUpdate; + return options.replace && isNode(nextNode) ? nextNode : { ...node, ...nextNode }; + } + return node; + })); + }; + const updateEdge = (id, edgeUpdate, options = { replace: false }) => { + setEdges((prevEdges) => prevEdges.map((edge) => { + if (edge.id === id) { + const nextEdge = typeof edgeUpdate === 'function' ? edgeUpdate(edge) : edgeUpdate; + return options.replace && isEdge(nextEdge) ? nextEdge : { ...edge, ...nextEdge }; + } + return edge; + })); + }; + return { + getNodes: () => store.getState().nodes.map((n) => ({ ...n })), + getNode: (id) => getInternalNode(id)?.internals.userNode, + getInternalNode, + getEdges: () => { + const { edges = [] } = store.getState(); + return edges.map((e) => ({ ...e })); + }, + getEdge: (id) => store.getState().edgeLookup.get(id), + setNodes, + setEdges, + addNodes: (payload) => { + const newNodes = Array.isArray(payload) ? payload : [payload]; + batchContext.nodeQueue.push((nodes) => [...nodes, ...newNodes]); + }, + addEdges: (payload) => { + const newEdges = Array.isArray(payload) ? payload : [payload]; + batchContext.edgeQueue.push((edges) => [...edges, ...newEdges]); + }, + toObject: () => { + const { nodes = [], edges = [], transform } = store.getState(); + const [x, y, zoom] = transform; + return { + nodes: nodes.map((n) => ({ ...n })), + edges: edges.map((e) => ({ ...e })), + viewport: { + x, + y, + zoom, + }, + }; + }, + deleteElements: async ({ nodes: nodesToRemove = [], edges: edgesToRemove = [] }) => { + const { nodes, edges, onNodesDelete, onEdgesDelete, triggerNodeChanges, triggerEdgeChanges, onDelete, onBeforeDelete, } = store.getState(); + const { nodes: matchingNodes, edges: matchingEdges } = await getElementsToRemove({ + nodesToRemove, + edgesToRemove, + nodes, + edges, + onBeforeDelete, + }); + const hasMatchingEdges = matchingEdges.length > 0; + const hasMatchingNodes = matchingNodes.length > 0; + if (hasMatchingEdges) { + const edgeChanges = matchingEdges.map(elementToRemoveChange); + onEdgesDelete?.(matchingEdges); + triggerEdgeChanges(edgeChanges); + } + if (hasMatchingNodes) { + const nodeChanges = matchingNodes.map(elementToRemoveChange); + onNodesDelete?.(matchingNodes); + triggerNodeChanges(nodeChanges); + } + if (hasMatchingNodes || hasMatchingEdges) { + onDelete?.({ nodes: matchingNodes, edges: matchingEdges }); + } + return { deletedNodes: matchingNodes, deletedEdges: matchingEdges }; + }, + getIntersectingNodes: (nodeOrRect, partially = true, nodes) => { + const isRect = isRectObject(nodeOrRect); + const nodeRect = isRect ? nodeOrRect : getNodeRect(nodeOrRect); + const hasNodesOption = nodes !== undefined; + if (!nodeRect) { + return []; + } + return (nodes || store.getState().nodes).filter((n) => { + const internalNode = store.getState().nodeLookup.get(n.id); + if (internalNode && !isRect && (n.id === nodeOrRect.id || !internalNode.internals.positionAbsolute)) { + return false; + } + const currNodeRect = nodeToRect(hasNodesOption ? n : internalNode); + const overlappingArea = getOverlappingArea(currNodeRect, nodeRect); + const partiallyVisible = partially && overlappingArea > 0; + return partiallyVisible || overlappingArea >= nodeRect.width * nodeRect.height; + }); + }, + isNodeIntersecting: (nodeOrRect, area, partially = true) => { + const isRect = isRectObject(nodeOrRect); + const nodeRect = isRect ? nodeOrRect : getNodeRect(nodeOrRect); + if (!nodeRect) { + return false; + } + const overlappingArea = getOverlappingArea(nodeRect, area); + const partiallyVisible = partially && overlappingArea > 0; + return partiallyVisible || overlappingArea >= nodeRect.width * nodeRect.height; + }, + updateNode, + updateNodeData: (id, dataUpdate, options = { replace: false }) => { + updateNode(id, (node) => { + const nextData = typeof dataUpdate === 'function' ? dataUpdate(node) : dataUpdate; + return options.replace ? { ...node, data: nextData } : { ...node, data: { ...node.data, ...nextData } }; + }, options); + }, + updateEdge, + updateEdgeData: (id, dataUpdate, options = { replace: false }) => { + updateEdge(id, (edge) => { + const nextData = typeof dataUpdate === 'function' ? dataUpdate(edge) : dataUpdate; + return options.replace ? { ...edge, data: nextData } : { ...edge, data: { ...edge.data, ...nextData } }; + }, options); + }, + getNodesBounds: (nodes) => { + const { nodeLookup, nodeOrigin } = store.getState(); + return getNodesBounds(nodes, { nodeLookup, nodeOrigin }); + }, + getHandleConnections: ({ type, id, nodeId }) => Array.from(store + .getState() + .connectionLookup.get(`${nodeId}-${type}${id ? `-${id}` : ''}`) + ?.values() ?? []), + getNodeConnections: ({ type, handleId, nodeId }) => Array.from(store + .getState() + .connectionLookup.get(`${nodeId}${type ? (handleId ? `-${type}-${handleId}` : `-${type}`) : ''}`) + ?.values() ?? []), + fitView: async (options) => { + // We either create a new Promise or reuse the existing one + // Even if fitView is called multiple times in a row, we only end up with a single Promise + const fitViewResolver = store.getState().fitViewResolver ?? withResolvers(); + // We schedule a fitView by setting fitViewQueued and triggering a setNodes + store.setState({ fitViewQueued: true, fitViewOptions: options, fitViewResolver }); + batchContext.nodeQueue.push((nodes) => [...nodes]); + return fitViewResolver.promise; + }, + }; + }, []); + return useMemo(() => { + return { + ...generalHelper, + ...viewportHelper, + viewportInitialized, + }; + }, [viewportInitialized]); +} + +const selected = (item) => item.selected; +const win$1 = typeof window !== 'undefined' ? window : undefined; +/** + * Hook for handling global key events. + * + * @internal + */ +function useGlobalKeyHandler({ deleteKeyCode, multiSelectionKeyCode, }) { + const store = useStoreApi(); + const { deleteElements } = useReactFlow(); + const deleteKeyPressed = useKeyPress(deleteKeyCode, { actInsideInputWithModifier: false }); + const multiSelectionKeyPressed = useKeyPress(multiSelectionKeyCode, { target: win$1 }); + useEffect(() => { + if (deleteKeyPressed) { + const { edges, nodes } = store.getState(); + deleteElements({ nodes: nodes.filter(selected), edges: edges.filter(selected) }); + store.setState({ nodesSelectionActive: false }); + } + }, [deleteKeyPressed]); + useEffect(() => { + store.setState({ multiSelectionActive: multiSelectionKeyPressed }); + }, [multiSelectionKeyPressed]); +} + +/** + * Hook for handling resize events. + * + * @internal + */ +function useResizeHandler(domNode) { + const store = useStoreApi(); + useEffect(() => { + const updateDimensions = () => { + if (!domNode.current) { + return false; + } + const size = getDimensions(domNode.current); + if (size.height === 0 || size.width === 0) { + store.getState().onError?.('004', errorMessages['error004']()); + } + store.setState({ width: size.width || 500, height: size.height || 500 }); + }; + if (domNode.current) { + updateDimensions(); + window.addEventListener('resize', updateDimensions); + const resizeObserver = new ResizeObserver(() => updateDimensions()); + resizeObserver.observe(domNode.current); + return () => { + window.removeEventListener('resize', updateDimensions); + if (resizeObserver && domNode.current) { + resizeObserver.unobserve(domNode.current); + } + }; + } + }, []); +} + +const containerStyle = { + position: 'absolute', + width: '100%', + height: '100%', + top: 0, + left: 0, +}; + +const selector$j = (s) => ({ + userSelectionActive: s.userSelectionActive, + lib: s.lib, +}); +function ZoomPane({ onPaneContextMenu, zoomOnScroll = true, zoomOnPinch = true, panOnScroll = false, panOnScrollSpeed = 0.5, panOnScrollMode = PanOnScrollMode.Free, zoomOnDoubleClick = true, panOnDrag = true, defaultViewport, translateExtent, minZoom, maxZoom, zoomActivationKeyCode, preventScrolling = true, children, noWheelClassName, noPanClassName, onViewportChange, isControlledViewport, paneClickDistance, }) { + const store = useStoreApi(); + const zoomPane = useRef(null); + const { userSelectionActive, lib } = useStore(selector$j, shallow); + const zoomActivationKeyPressed = useKeyPress(zoomActivationKeyCode); + const panZoom = useRef(); + useResizeHandler(zoomPane); + const onTransformChange = useCallback((transform) => { + onViewportChange?.({ x: transform[0], y: transform[1], zoom: transform[2] }); + if (!isControlledViewport) { + store.setState({ transform }); + } + }, [onViewportChange, isControlledViewport]); + useEffect(() => { + if (zoomPane.current) { + panZoom.current = XYPanZoom({ + domNode: zoomPane.current, + minZoom, + maxZoom, + translateExtent, + viewport: defaultViewport, + paneClickDistance, + onDraggingChange: (paneDragging) => store.setState({ paneDragging }), + onPanZoomStart: (event, vp) => { + const { onViewportChangeStart, onMoveStart } = store.getState(); + onMoveStart?.(event, vp); + onViewportChangeStart?.(vp); + }, + onPanZoom: (event, vp) => { + const { onViewportChange, onMove } = store.getState(); + onMove?.(event, vp); + onViewportChange?.(vp); + }, + onPanZoomEnd: (event, vp) => { + const { onViewportChangeEnd, onMoveEnd } = store.getState(); + onMoveEnd?.(event, vp); + onViewportChangeEnd?.(vp); + }, + }); + const { x, y, zoom } = panZoom.current.getViewport(); + store.setState({ + panZoom: panZoom.current, + transform: [x, y, zoom], + domNode: zoomPane.current.closest('.react-flow'), + }); + return () => { + panZoom.current?.destroy(); + }; + } + }, []); + useEffect(() => { + panZoom.current?.update({ + onPaneContextMenu, + zoomOnScroll, + zoomOnPinch, + panOnScroll, + panOnScrollSpeed, + panOnScrollMode, + zoomOnDoubleClick, + panOnDrag, + zoomActivationKeyPressed, + preventScrolling, + noPanClassName, + userSelectionActive, + noWheelClassName, + lib, + onTransformChange, + }); + }, [ + onPaneContextMenu, + zoomOnScroll, + zoomOnPinch, + panOnScroll, + panOnScrollSpeed, + panOnScrollMode, + zoomOnDoubleClick, + panOnDrag, + zoomActivationKeyPressed, + preventScrolling, + noPanClassName, + userSelectionActive, + noWheelClassName, + lib, + onTransformChange, + ]); + return (jsx("div", { className: "react-flow__renderer", ref: zoomPane, style: containerStyle, children: children })); +} + +const selector$i = (s) => ({ + userSelectionActive: s.userSelectionActive, + userSelectionRect: s.userSelectionRect, +}); +function UserSelection() { + const { userSelectionActive, userSelectionRect } = useStore(selector$i, shallow); + const isActive = userSelectionActive && userSelectionRect; + if (!isActive) { + return null; + } + return (jsx("div", { className: "react-flow__selection react-flow__container", style: { + width: userSelectionRect.width, + height: userSelectionRect.height, + transform: `translate(${userSelectionRect.x}px, ${userSelectionRect.y}px)`, + } })); +} + +const wrapHandler = (handler, containerRef) => { + return (event) => { + if (event.target !== containerRef.current) { + return; + } + handler?.(event); + }; +}; +const selector$h = (s) => ({ + userSelectionActive: s.userSelectionActive, + elementsSelectable: s.elementsSelectable, + connectionInProgress: s.connection.inProgress, + dragging: s.paneDragging, +}); +function Pane({ isSelecting, selectionKeyPressed, selectionMode = SelectionMode.Full, panOnDrag, selectionOnDrag, onSelectionStart, onSelectionEnd, onPaneClick, onPaneContextMenu, onPaneScroll, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, children, }) { + const store = useStoreApi(); + const { userSelectionActive, elementsSelectable, dragging, connectionInProgress } = useStore(selector$h, shallow); + const hasActiveSelection = elementsSelectable && (isSelecting || userSelectionActive); + const container = useRef(null); + const containerBounds = useRef(); + const selectedNodeIds = useRef(new Set()); + const selectedEdgeIds = useRef(new Set()); + // Used to prevent click events when the user lets go of the selectionKey during a selection + const selectionInProgress = useRef(false); + const selectionStarted = useRef(false); + const onClick = (event) => { + // We prevent click events when the user let go of the selectionKey during a selection + // We also prevent click events when a connection is in progress + if (selectionInProgress.current || connectionInProgress) { + selectionInProgress.current = false; + return; + } + onPaneClick?.(event); + store.getState().resetSelectedElements(); + store.setState({ nodesSelectionActive: false }); + }; + const onContextMenu = (event) => { + if (Array.isArray(panOnDrag) && panOnDrag?.includes(2)) { + event.preventDefault(); + return; + } + onPaneContextMenu?.(event); + }; + const onWheel = onPaneScroll ? (event) => onPaneScroll(event) : undefined; + const onPointerDown = (event) => { + const { resetSelectedElements, domNode } = store.getState(); + containerBounds.current = domNode?.getBoundingClientRect(); + if (!elementsSelectable || + !isSelecting || + event.button !== 0 || + event.target !== container.current || + !containerBounds.current) { + return; + } + event.target?.setPointerCapture?.(event.pointerId); + selectionStarted.current = true; + selectionInProgress.current = false; + const { x, y } = getEventPosition(event.nativeEvent, containerBounds.current); + resetSelectedElements(); + store.setState({ + userSelectionRect: { + width: 0, + height: 0, + startX: x, + startY: y, + x, + y, + }, + }); + onSelectionStart?.(event); + }; + const onPointerMove = (event) => { + const { userSelectionRect, transform, nodeLookup, edgeLookup, connectionLookup, triggerNodeChanges, triggerEdgeChanges, defaultEdgeOptions, } = store.getState(); + if (!containerBounds.current || !userSelectionRect) { + return; + } + selectionInProgress.current = true; + const { x: mouseX, y: mouseY } = getEventPosition(event.nativeEvent, containerBounds.current); + const { startX, startY } = userSelectionRect; + const nextUserSelectRect = { + startX, + startY, + x: mouseX < startX ? mouseX : startX, + y: mouseY < startY ? mouseY : startY, + width: Math.abs(mouseX - startX), + height: Math.abs(mouseY - startY), + }; + const prevSelectedNodeIds = selectedNodeIds.current; + const prevSelectedEdgeIds = selectedEdgeIds.current; + selectedNodeIds.current = new Set(getNodesInside(nodeLookup, nextUserSelectRect, transform, selectionMode === SelectionMode.Partial, true).map((node) => node.id)); + selectedEdgeIds.current = new Set(); + const edgesSelectable = defaultEdgeOptions?.selectable ?? true; + // We look for all edges connected to the selected nodes + for (const nodeId of selectedNodeIds.current) { + const connections = connectionLookup.get(nodeId); + if (!connections) + continue; + for (const { edgeId } of connections.values()) { + const edge = edgeLookup.get(edgeId); + if (edge && (edge.selectable ?? edgesSelectable)) { + selectedEdgeIds.current.add(edgeId); + } + } + } + if (!areSetsEqual(prevSelectedNodeIds, selectedNodeIds.current)) { + const changes = getSelectionChanges(nodeLookup, selectedNodeIds.current, true); + triggerNodeChanges(changes); + } + if (!areSetsEqual(prevSelectedEdgeIds, selectedEdgeIds.current)) { + const changes = getSelectionChanges(edgeLookup, selectedEdgeIds.current); + triggerEdgeChanges(changes); + } + store.setState({ + userSelectionRect: nextUserSelectRect, + userSelectionActive: true, + nodesSelectionActive: false, + }); + }; + const onPointerUp = (event) => { + if (event.button !== 0 || !selectionStarted.current) { + return; + } + event.target?.releasePointerCapture?.(event.pointerId); + const { userSelectionRect } = store.getState(); + /* + * We only want to trigger click functions when in selection mode if + * the user did not move the mouse. + */ + if (!userSelectionActive && userSelectionRect && event.target === container.current) { + onClick?.(event); + } + store.setState({ + userSelectionActive: false, + userSelectionRect: null, + nodesSelectionActive: selectedNodeIds.current.size > 0, + }); + onSelectionEnd?.(event); + /* + * If the user kept holding the selectionKey during the selection, + * we need to reset the selectionInProgress, so the next click event is not prevented + */ + if (selectionKeyPressed || selectionOnDrag) { + selectionInProgress.current = false; + } + selectionStarted.current = false; + }; + const draggable = panOnDrag === true || (Array.isArray(panOnDrag) && panOnDrag.includes(0)); + return (jsxs("div", { className: cc(['react-flow__pane', { draggable, dragging, selection: isSelecting }]), onClick: hasActiveSelection ? undefined : wrapHandler(onClick, container), onContextMenu: wrapHandler(onContextMenu, container), onWheel: wrapHandler(onWheel, container), onPointerEnter: hasActiveSelection ? undefined : onPaneMouseEnter, onPointerDown: hasActiveSelection ? onPointerDown : onPaneMouseMove, onPointerMove: hasActiveSelection ? onPointerMove : onPaneMouseMove, onPointerUp: hasActiveSelection ? onPointerUp : undefined, onPointerLeave: onPaneMouseLeave, ref: container, style: containerStyle, children: [children, jsx(UserSelection, {})] })); +} + +/* + * this handler is called by + * 1. the click handler when node is not draggable or selectNodesOnDrag = false + * or + * 2. the on drag start handler when node is draggable and selectNodesOnDrag = true + */ +function handleNodeClick({ id, store, unselect = false, nodeRef, }) { + const { addSelectedNodes, unselectNodesAndEdges, multiSelectionActive, nodeLookup, onError } = store.getState(); + const node = nodeLookup.get(id); + if (!node) { + onError?.('012', errorMessages['error012'](id)); + return; + } + store.setState({ nodesSelectionActive: false }); + if (!node.selected) { + addSelectedNodes([id]); + } + else if (unselect || (node.selected && multiSelectionActive)) { + unselectNodesAndEdges({ nodes: [node], edges: [] }); + requestAnimationFrame(() => nodeRef?.current?.blur()); + } +} + +/** + * Hook for calling XYDrag helper from @xyflow/system. + * + * @internal + */ +function useDrag({ nodeRef, disabled = false, noDragClassName, handleSelector, nodeId, isSelectable, nodeClickDistance, }) { + const store = useStoreApi(); + const [dragging, setDragging] = useState(false); + const xyDrag = useRef(); + useEffect(() => { + xyDrag.current = XYDrag({ + getStoreItems: () => store.getState(), + onNodeMouseDown: (id) => { + handleNodeClick({ + id, + store, + nodeRef, + }); + }, + onDragStart: () => { + setDragging(true); + }, + onDragStop: () => { + setDragging(false); + }, + }); + }, []); + useEffect(() => { + if (disabled) { + xyDrag.current?.destroy(); + } + else if (nodeRef.current) { + xyDrag.current?.update({ + noDragClassName, + handleSelector, + domNode: nodeRef.current, + isSelectable, + nodeId, + nodeClickDistance, + }); + return () => { + xyDrag.current?.destroy(); + }; + } + }, [noDragClassName, handleSelector, disabled, isSelectable, nodeRef, nodeId]); + return dragging; +} + +const selectedAndDraggable = (nodesDraggable) => (n) => n.selected && (n.draggable || (nodesDraggable && typeof n.draggable === 'undefined')); +/** + * Hook for updating node positions by passing a direction and factor + * + * @internal + * @returns function for updating node positions + */ +function useMoveSelectedNodes() { + const store = useStoreApi(); + const moveSelectedNodes = useCallback((params) => { + const { nodeExtent, snapToGrid, snapGrid, nodesDraggable, onError, updateNodePositions, nodeLookup, nodeOrigin } = store.getState(); + const nodeUpdates = new Map(); + const isSelected = selectedAndDraggable(nodesDraggable); + /* + * by default a node moves 5px on each key press + * if snap grid is enabled, we use that for the velocity + */ + const xVelo = snapToGrid ? snapGrid[0] : 5; + const yVelo = snapToGrid ? snapGrid[1] : 5; + const xDiff = params.direction.x * xVelo * params.factor; + const yDiff = params.direction.y * yVelo * params.factor; + for (const [, node] of nodeLookup) { + if (!isSelected(node)) { + continue; + } + let nextPosition = { + x: node.internals.positionAbsolute.x + xDiff, + y: node.internals.positionAbsolute.y + yDiff, + }; + if (snapToGrid) { + nextPosition = snapPosition(nextPosition, snapGrid); + } + const { position, positionAbsolute } = calculateNodePosition({ + nodeId: node.id, + nextPosition, + nodeLookup, + nodeExtent, + nodeOrigin, + onError, + }); + node.position = position; + node.internals.positionAbsolute = positionAbsolute; + nodeUpdates.set(node.id, node); + } + updateNodePositions(nodeUpdates); + }, []); + return moveSelectedNodes; +} + +const NodeIdContext = createContext(null); +const Provider = NodeIdContext.Provider; +NodeIdContext.Consumer; +/** + * You can use this hook to get the id of the node it is used inside. It is useful + * if you need the node's id deeper in the render tree but don't want to manually + * drill down the id as a prop. + * + * @public + * @returns The id for a node in the flow. + * + * @example + *```jsx + *import { useNodeId } from '@xyflow/react'; + * + *export default function CustomNode() { + * return ( + *
+ * This node has an id of + * + *
+ * ); + *} + * + *function NodeIdDisplay() { + * const nodeId = useNodeId(); + * + * return {nodeId}; + *} + *``` + */ +const useNodeId = () => { + const nodeId = useContext(NodeIdContext); + return nodeId; +}; + +const selector$g = (s) => ({ + connectOnClick: s.connectOnClick, + noPanClassName: s.noPanClassName, + rfId: s.rfId, +}); +const connectingSelector = (nodeId, handleId, type) => (state) => { + const { connectionClickStartHandle: clickHandle, connectionMode, connection } = state; + const { fromHandle, toHandle, isValid } = connection; + const connectingTo = toHandle?.nodeId === nodeId && toHandle?.id === handleId && toHandle?.type === type; + return { + connectingFrom: fromHandle?.nodeId === nodeId && fromHandle?.id === handleId && fromHandle?.type === type, + connectingTo, + clickConnecting: clickHandle?.nodeId === nodeId && clickHandle?.id === handleId && clickHandle?.type === type, + isPossibleEndHandle: connectionMode === ConnectionMode.Strict + ? fromHandle?.type !== type + : nodeId !== fromHandle?.nodeId || handleId !== fromHandle?.id, + connectionInProcess: !!fromHandle, + clickConnectionInProcess: !!clickHandle, + valid: connectingTo && isValid, + }; +}; +function HandleComponent({ type = 'source', position = Position.Top, isValidConnection, isConnectable = true, isConnectableStart = true, isConnectableEnd = true, id, onConnect, children, className, onMouseDown, onTouchStart, ...rest }, ref) { + const handleId = id || null; + const isTarget = type === 'target'; + const store = useStoreApi(); + const nodeId = useNodeId(); + const { connectOnClick, noPanClassName, rfId } = useStore(selector$g, shallow); + const { connectingFrom, connectingTo, clickConnecting, isPossibleEndHandle, connectionInProcess, clickConnectionInProcess, valid, } = useStore(connectingSelector(nodeId, handleId, type), shallow); + if (!nodeId) { + store.getState().onError?.('010', errorMessages['error010']()); + } + const onConnectExtended = (params) => { + const { defaultEdgeOptions, onConnect: onConnectAction, hasDefaultEdges } = store.getState(); + const edgeParams = { + ...defaultEdgeOptions, + ...params, + }; + if (hasDefaultEdges) { + const { edges, setEdges } = store.getState(); + setEdges(addEdge(edgeParams, edges)); + } + onConnectAction?.(edgeParams); + onConnect?.(edgeParams); + }; + const onPointerDown = (event) => { + if (!nodeId) { + return; + } + const isMouseTriggered = isMouseEvent(event.nativeEvent); + if (isConnectableStart && + ((isMouseTriggered && event.button === 0) || !isMouseTriggered)) { + const currentStore = store.getState(); + XYHandle.onPointerDown(event.nativeEvent, { + autoPanOnConnect: currentStore.autoPanOnConnect, + connectionMode: currentStore.connectionMode, + connectionRadius: currentStore.connectionRadius, + domNode: currentStore.domNode, + nodeLookup: currentStore.nodeLookup, + lib: currentStore.lib, + isTarget, + handleId, + nodeId, + flowId: currentStore.rfId, + panBy: currentStore.panBy, + cancelConnection: currentStore.cancelConnection, + onConnectStart: currentStore.onConnectStart, + onConnectEnd: currentStore.onConnectEnd, + updateConnection: currentStore.updateConnection, + onConnect: onConnectExtended, + isValidConnection: isValidConnection || currentStore.isValidConnection, + getTransform: () => store.getState().transform, + getFromHandle: () => store.getState().connection.fromHandle, + autoPanSpeed: currentStore.autoPanSpeed, + }); + } + if (isMouseTriggered) { + onMouseDown?.(event); + } + else { + onTouchStart?.(event); + } + }; + const onClick = (event) => { + const { onClickConnectStart, onClickConnectEnd, connectionClickStartHandle, connectionMode, isValidConnection: isValidConnectionStore, lib, rfId: flowId, nodeLookup, connection: connectionState, } = store.getState(); + if (!nodeId || (!connectionClickStartHandle && !isConnectableStart)) { + return; + } + if (!connectionClickStartHandle) { + onClickConnectStart?.(event.nativeEvent, { nodeId, handleId, handleType: type }); + store.setState({ connectionClickStartHandle: { nodeId, type, id: handleId } }); + return; + } + const doc = getHostForElement(event.target); + const isValidConnectionHandler = isValidConnection || isValidConnectionStore; + const { connection, isValid } = XYHandle.isValid(event.nativeEvent, { + handle: { + nodeId, + id: handleId, + type, + }, + connectionMode, + fromNodeId: connectionClickStartHandle.nodeId, + fromHandleId: connectionClickStartHandle.id || null, + fromType: connectionClickStartHandle.type, + isValidConnection: isValidConnectionHandler, + flowId, + doc, + lib, + nodeLookup, + }); + if (isValid && connection) { + onConnectExtended(connection); + } + const connectionClone = structuredClone(connectionState); + delete connectionClone.inProgress; + connectionClone.toPosition = connectionClone.toHandle ? connectionClone.toHandle.position : null; + onClickConnectEnd?.(event, connectionClone); + store.setState({ connectionClickStartHandle: null }); + }; + return (jsx("div", { "data-handleid": handleId, "data-nodeid": nodeId, "data-handlepos": position, "data-id": `${rfId}-${nodeId}-${handleId}-${type}`, className: cc([ + 'react-flow__handle', + `react-flow__handle-${position}`, + 'nodrag', + noPanClassName, + className, + { + source: !isTarget, + target: isTarget, + connectable: isConnectable, + connectablestart: isConnectableStart, + connectableend: isConnectableEnd, + clickconnecting: clickConnecting, + connectingfrom: connectingFrom, + connectingto: connectingTo, + valid, + /* + * shows where you can start a connection from + * and where you can end it while connecting + */ + connectionindicator: isConnectable && + (!connectionInProcess || isPossibleEndHandle) && + (connectionInProcess || clickConnectionInProcess ? isConnectableEnd : isConnectableStart), + }, + ]), onMouseDown: onPointerDown, onTouchStart: onPointerDown, onClick: connectOnClick ? onClick : undefined, ref: ref, ...rest, children: children })); +} +/** + * The `` component is used in your [custom nodes](/learn/customization/custom-nodes) + * to define connection points. + * + *@public + * + *@example + * + *```jsx + *import { Handle, Position } from '@xyflow/react'; + * + *export function CustomNode({ data }) { + * return ( + * <> + *
+ * {data.label} + *
+ * + * + * + * + * ); + *}; + *``` + */ +const Handle = memo(fixedForwardRef(HandleComponent)); + +function InputNode({ data, isConnectable, sourcePosition = Position.Bottom }) { + return (jsxs(Fragment, { children: [data?.label, jsx(Handle, { type: "source", position: sourcePosition, isConnectable: isConnectable })] })); +} + +function DefaultNode({ data, isConnectable, targetPosition = Position.Top, sourcePosition = Position.Bottom, }) { + return (jsxs(Fragment, { children: [jsx(Handle, { type: "target", position: targetPosition, isConnectable: isConnectable }), data?.label, jsx(Handle, { type: "source", position: sourcePosition, isConnectable: isConnectable })] })); +} + +function GroupNode() { + return null; +} + +function OutputNode({ data, isConnectable, targetPosition = Position.Top }) { + return (jsxs(Fragment, { children: [jsx(Handle, { type: "target", position: targetPosition, isConnectable: isConnectable }), data?.label] })); +} + +const arrowKeyDiffs = { + ArrowUp: { x: 0, y: -1 }, + ArrowDown: { x: 0, y: 1 }, + ArrowLeft: { x: -1, y: 0 }, + ArrowRight: { x: 1, y: 0 }, +}; +const builtinNodeTypes = { + input: InputNode, + default: DefaultNode, + output: OutputNode, + group: GroupNode, +}; +function getNodeInlineStyleDimensions(node) { + if (node.internals.handleBounds === undefined) { + return { + width: node.width ?? node.initialWidth ?? node.style?.width, + height: node.height ?? node.initialHeight ?? node.style?.height, + }; + } + return { + width: node.width ?? node.style?.width, + height: node.height ?? node.style?.height, + }; +} + +const selector$f = (s) => { + const { width, height, x, y } = getInternalNodesBounds(s.nodeLookup, { + filter: (node) => !!node.selected, + }); + return { + width: isNumeric(width) ? width : null, + height: isNumeric(height) ? height : null, + userSelectionActive: s.userSelectionActive, + transformString: `translate(${s.transform[0]}px,${s.transform[1]}px) scale(${s.transform[2]}) translate(${x}px,${y}px)`, + }; +}; +function NodesSelection({ onSelectionContextMenu, noPanClassName, disableKeyboardA11y, }) { + const store = useStoreApi(); + const { width, height, transformString, userSelectionActive } = useStore(selector$f, shallow); + const moveSelectedNodes = useMoveSelectedNodes(); + const nodeRef = useRef(null); + useEffect(() => { + if (!disableKeyboardA11y) { + nodeRef.current?.focus({ + preventScroll: true, + }); + } + }, [disableKeyboardA11y]); + useDrag({ + nodeRef, + }); + if (userSelectionActive || !width || !height) { + return null; + } + const onContextMenu = onSelectionContextMenu + ? (event) => { + const selectedNodes = store.getState().nodes.filter((n) => n.selected); + onSelectionContextMenu(event, selectedNodes); + } + : undefined; + const onKeyDown = (event) => { + if (Object.prototype.hasOwnProperty.call(arrowKeyDiffs, event.key)) { + event.preventDefault(); + moveSelectedNodes({ + direction: arrowKeyDiffs[event.key], + factor: event.shiftKey ? 4 : 1, + }); + } + }; + return (jsx("div", { className: cc(['react-flow__nodesselection', 'react-flow__container', noPanClassName]), style: { + transform: transformString, + }, children: jsx("div", { ref: nodeRef, className: "react-flow__nodesselection-rect", onContextMenu: onContextMenu, tabIndex: disableKeyboardA11y ? undefined : -1, onKeyDown: disableKeyboardA11y ? undefined : onKeyDown, style: { + width, + height, + } }) })); +} + +const win = typeof window !== 'undefined' ? window : undefined; +const selector$e = (s) => { + return { nodesSelectionActive: s.nodesSelectionActive, userSelectionActive: s.userSelectionActive }; +}; +function FlowRendererComponent({ children, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneContextMenu, onPaneScroll, paneClickDistance, deleteKeyCode, selectionKeyCode, selectionOnDrag, selectionMode, onSelectionStart, onSelectionEnd, multiSelectionKeyCode, panActivationKeyCode, zoomActivationKeyCode, elementsSelectable, zoomOnScroll, zoomOnPinch, panOnScroll: _panOnScroll, panOnScrollSpeed, panOnScrollMode, zoomOnDoubleClick, panOnDrag: _panOnDrag, defaultViewport, translateExtent, minZoom, maxZoom, preventScrolling, onSelectionContextMenu, noWheelClassName, noPanClassName, disableKeyboardA11y, onViewportChange, isControlledViewport, }) { + const { nodesSelectionActive, userSelectionActive } = useStore(selector$e); + const selectionKeyPressed = useKeyPress(selectionKeyCode, { target: win }); + const panActivationKeyPressed = useKeyPress(panActivationKeyCode, { target: win }); + const panOnDrag = panActivationKeyPressed || _panOnDrag; + const panOnScroll = panActivationKeyPressed || _panOnScroll; + const _selectionOnDrag = selectionOnDrag && panOnDrag !== true; + const isSelecting = selectionKeyPressed || userSelectionActive || _selectionOnDrag; + useGlobalKeyHandler({ deleteKeyCode, multiSelectionKeyCode }); + return (jsx(ZoomPane, { onPaneContextMenu: onPaneContextMenu, elementsSelectable: elementsSelectable, zoomOnScroll: zoomOnScroll, zoomOnPinch: zoomOnPinch, panOnScroll: panOnScroll, panOnScrollSpeed: panOnScrollSpeed, panOnScrollMode: panOnScrollMode, zoomOnDoubleClick: zoomOnDoubleClick, panOnDrag: !selectionKeyPressed && panOnDrag, defaultViewport: defaultViewport, translateExtent: translateExtent, minZoom: minZoom, maxZoom: maxZoom, zoomActivationKeyCode: zoomActivationKeyCode, preventScrolling: preventScrolling, noWheelClassName: noWheelClassName, noPanClassName: noPanClassName, onViewportChange: onViewportChange, isControlledViewport: isControlledViewport, paneClickDistance: paneClickDistance, children: jsxs(Pane, { onSelectionStart: onSelectionStart, onSelectionEnd: onSelectionEnd, onPaneClick: onPaneClick, onPaneMouseEnter: onPaneMouseEnter, onPaneMouseMove: onPaneMouseMove, onPaneMouseLeave: onPaneMouseLeave, onPaneContextMenu: onPaneContextMenu, onPaneScroll: onPaneScroll, panOnDrag: panOnDrag, isSelecting: !!isSelecting, selectionMode: selectionMode, selectionKeyPressed: selectionKeyPressed, selectionOnDrag: _selectionOnDrag, children: [children, nodesSelectionActive && (jsx(NodesSelection, { onSelectionContextMenu: onSelectionContextMenu, noPanClassName: noPanClassName, disableKeyboardA11y: disableKeyboardA11y }))] }) })); +} +FlowRendererComponent.displayName = 'FlowRenderer'; +const FlowRenderer = memo(FlowRendererComponent); + +const selector$d = (onlyRenderVisible) => (s) => { + return onlyRenderVisible + ? getNodesInside(s.nodeLookup, { x: 0, y: 0, width: s.width, height: s.height }, s.transform, true).map((node) => node.id) + : Array.from(s.nodeLookup.keys()); +}; +/** + * Hook for getting the visible node ids from the store. + * + * @internal + * @param onlyRenderVisible + * @returns array with visible node ids + */ +function useVisibleNodeIds(onlyRenderVisible) { + const nodeIds = useStore(useCallback(selector$d(onlyRenderVisible), [onlyRenderVisible]), shallow); + return nodeIds; +} + +const selector$c = (s) => s.updateNodeInternals; +function useResizeObserver() { + const updateNodeInternals = useStore(selector$c); + const [resizeObserver] = useState(() => { + if (typeof ResizeObserver === 'undefined') { + return null; + } + return new ResizeObserver((entries) => { + const updates = new Map(); + entries.forEach((entry) => { + const id = entry.target.getAttribute('data-id'); + updates.set(id, { + id, + nodeElement: entry.target, + force: true, + }); + }); + updateNodeInternals(updates); + }); + }); + useEffect(() => { + return () => { + resizeObserver?.disconnect(); + }; + }, [resizeObserver]); + return resizeObserver; +} + +/** + * Hook to handle the resize observation + internal updates for the passed node. + * + * @internal + * @returns nodeRef - reference to the node element + */ +function useNodeObserver({ node, nodeType, hasDimensions, resizeObserver, }) { + const store = useStoreApi(); + const nodeRef = useRef(null); + const observedNode = useRef(null); + const prevSourcePosition = useRef(node.sourcePosition); + const prevTargetPosition = useRef(node.targetPosition); + const prevType = useRef(nodeType); + const isInitialized = hasDimensions && !!node.internals.handleBounds; + useEffect(() => { + if (nodeRef.current && !node.hidden && (!isInitialized || observedNode.current !== nodeRef.current)) { + if (observedNode.current) { + resizeObserver?.unobserve(observedNode.current); + } + resizeObserver?.observe(nodeRef.current); + observedNode.current = nodeRef.current; + } + }, [isInitialized, node.hidden]); + useEffect(() => { + return () => { + if (observedNode.current) { + resizeObserver?.unobserve(observedNode.current); + observedNode.current = null; + } + }; + }, []); + useEffect(() => { + if (nodeRef.current) { + /* + * when the user programmatically changes the source or handle position, we need to update the internals + * to make sure the edges are updated correctly + */ + const typeChanged = prevType.current !== nodeType; + const sourcePosChanged = prevSourcePosition.current !== node.sourcePosition; + const targetPosChanged = prevTargetPosition.current !== node.targetPosition; + if (typeChanged || sourcePosChanged || targetPosChanged) { + prevType.current = nodeType; + prevSourcePosition.current = node.sourcePosition; + prevTargetPosition.current = node.targetPosition; + store + .getState() + .updateNodeInternals(new Map([[node.id, { id: node.id, nodeElement: nodeRef.current, force: true }]])); + } + } + }, [node.id, nodeType, node.sourcePosition, node.targetPosition]); + return nodeRef; +} + +function NodeWrapper({ id, onClick, onMouseEnter, onMouseMove, onMouseLeave, onContextMenu, onDoubleClick, nodesDraggable, elementsSelectable, nodesConnectable, nodesFocusable, resizeObserver, noDragClassName, noPanClassName, disableKeyboardA11y, rfId, nodeTypes, nodeClickDistance, onError, }) { + const { node, internals, isParent } = useStore((s) => { + const node = s.nodeLookup.get(id); + const isParent = s.parentLookup.has(id); + return { + node, + internals: node.internals, + isParent, + }; + }, shallow); + let nodeType = node.type || 'default'; + let NodeComponent = nodeTypes?.[nodeType] || builtinNodeTypes[nodeType]; + if (NodeComponent === undefined) { + onError?.('003', errorMessages['error003'](nodeType)); + nodeType = 'default'; + NodeComponent = builtinNodeTypes.default; + } + const isDraggable = !!(node.draggable || (nodesDraggable && typeof node.draggable === 'undefined')); + const isSelectable = !!(node.selectable || (elementsSelectable && typeof node.selectable === 'undefined')); + const isConnectable = !!(node.connectable || (nodesConnectable && typeof node.connectable === 'undefined')); + const isFocusable = !!(node.focusable || (nodesFocusable && typeof node.focusable === 'undefined')); + const store = useStoreApi(); + const hasDimensions = nodeHasDimensions(node); + const nodeRef = useNodeObserver({ node, nodeType, hasDimensions, resizeObserver }); + const dragging = useDrag({ + nodeRef, + disabled: node.hidden || !isDraggable, + noDragClassName, + handleSelector: node.dragHandle, + nodeId: id, + isSelectable, + nodeClickDistance, + }); + const moveSelectedNodes = useMoveSelectedNodes(); + if (node.hidden) { + return null; + } + const nodeDimensions = getNodeDimensions(node); + const inlineDimensions = getNodeInlineStyleDimensions(node); + const hasPointerEvents = isSelectable || isDraggable || onClick || onMouseEnter || onMouseMove || onMouseLeave; + const onMouseEnterHandler = onMouseEnter + ? (event) => onMouseEnter(event, { ...internals.userNode }) + : undefined; + const onMouseMoveHandler = onMouseMove + ? (event) => onMouseMove(event, { ...internals.userNode }) + : undefined; + const onMouseLeaveHandler = onMouseLeave + ? (event) => onMouseLeave(event, { ...internals.userNode }) + : undefined; + const onContextMenuHandler = onContextMenu + ? (event) => onContextMenu(event, { ...internals.userNode }) + : undefined; + const onDoubleClickHandler = onDoubleClick + ? (event) => onDoubleClick(event, { ...internals.userNode }) + : undefined; + const onSelectNodeHandler = (event) => { + const { selectNodesOnDrag, nodeDragThreshold } = store.getState(); + if (isSelectable && (!selectNodesOnDrag || !isDraggable || nodeDragThreshold > 0)) { + /* + * this handler gets called by XYDrag on drag start when selectNodesOnDrag=true + * here we only need to call it when selectNodesOnDrag=false + */ + handleNodeClick({ + id, + store, + nodeRef, + }); + } + if (onClick) { + onClick(event, { ...internals.userNode }); + } + }; + const onKeyDown = (event) => { + if (isInputDOMNode(event.nativeEvent) || disableKeyboardA11y) { + return; + } + if (elementSelectionKeys.includes(event.key) && isSelectable) { + const unselect = event.key === 'Escape'; + handleNodeClick({ + id, + store, + unselect, + nodeRef, + }); + } + else if (isDraggable && node.selected && Object.prototype.hasOwnProperty.call(arrowKeyDiffs, event.key)) { + // prevent default scrolling behavior on arrow key press when node is moved + event.preventDefault(); + const { ariaLabelConfig } = store.getState(); + store.setState({ + ariaLiveMessage: ariaLabelConfig['node.a11yDescription.ariaLiveMessage']({ + direction: event.key.replace('Arrow', '').toLowerCase(), + x: ~~internals.positionAbsolute.x, + y: ~~internals.positionAbsolute.y, + }), + }); + moveSelectedNodes({ + direction: arrowKeyDiffs[event.key], + factor: event.shiftKey ? 4 : 1, + }); + } + }; + const onFocus = () => { + if (disableKeyboardA11y || !nodeRef.current?.matches(':focus-visible')) { + return; + } + const { transform, width, height, autoPanOnNodeFocus, setCenter } = store.getState(); + if (!autoPanOnNodeFocus) { + return; + } + const withinViewport = getNodesInside(new Map([[id, node]]), { x: 0, y: 0, width, height }, transform, true).length > 0; + if (!withinViewport) { + setCenter(node.position.x + nodeDimensions.width / 2, node.position.y + nodeDimensions.height / 2, { + zoom: transform[2], + }); + } + }; + return (jsx("div", { className: cc([ + 'react-flow__node', + `react-flow__node-${nodeType}`, + { + // this is overwritable by passing `nopan` as a class name + [noPanClassName]: isDraggable, + }, + node.className, + { + selected: node.selected, + selectable: isSelectable, + parent: isParent, + draggable: isDraggable, + dragging, + }, + ]), ref: nodeRef, style: { + zIndex: internals.z, + transform: `translate(${internals.positionAbsolute.x}px,${internals.positionAbsolute.y}px)`, + pointerEvents: hasPointerEvents ? 'all' : 'none', + visibility: hasDimensions ? 'visible' : 'hidden', + ...node.style, + ...inlineDimensions, + }, "data-id": id, "data-testid": `rf__node-${id}`, onMouseEnter: onMouseEnterHandler, onMouseMove: onMouseMoveHandler, onMouseLeave: onMouseLeaveHandler, onContextMenu: onContextMenuHandler, onClick: onSelectNodeHandler, onDoubleClick: onDoubleClickHandler, onKeyDown: isFocusable ? onKeyDown : undefined, tabIndex: isFocusable ? 0 : undefined, onFocus: isFocusable ? onFocus : undefined, role: node.ariaRole ?? (isFocusable ? 'group' : undefined), "aria-roledescription": "node", "aria-describedby": disableKeyboardA11y ? undefined : `${ARIA_NODE_DESC_KEY}-${rfId}`, "aria-label": node.ariaLabel, ...node.domAttributes, children: jsx(Provider, { value: id, children: jsx(NodeComponent, { id: id, data: node.data, type: nodeType, positionAbsoluteX: internals.positionAbsolute.x, positionAbsoluteY: internals.positionAbsolute.y, selected: node.selected ?? false, selectable: isSelectable, draggable: isDraggable, deletable: node.deletable ?? true, isConnectable: isConnectable, sourcePosition: node.sourcePosition, targetPosition: node.targetPosition, dragging: dragging, dragHandle: node.dragHandle, zIndex: internals.z, parentId: node.parentId, ...nodeDimensions }) }) })); +} + +const selector$b = (s) => ({ + nodesDraggable: s.nodesDraggable, + nodesConnectable: s.nodesConnectable, + nodesFocusable: s.nodesFocusable, + elementsSelectable: s.elementsSelectable, + onError: s.onError, +}); +function NodeRendererComponent(props) { + const { nodesDraggable, nodesConnectable, nodesFocusable, elementsSelectable, onError } = useStore(selector$b, shallow); + const nodeIds = useVisibleNodeIds(props.onlyRenderVisibleElements); + const resizeObserver = useResizeObserver(); + return (jsx("div", { className: "react-flow__nodes", style: containerStyle, children: nodeIds.map((nodeId) => { + return ( + /* + * The split of responsibilities between NodeRenderer and + * NodeComponentWrapper may appear weird. However, it’s designed to + * minimize the cost of updates when individual nodes change. + * + * For example, when you’re dragging a single node, that node gets + * updated multiple times per second. If `NodeRenderer` were to update + * every time, it would have to re-run the `nodes.map()` loop every + * time. This gets pricey with hundreds of nodes, especially if every + * loop cycle does more than just rendering a JSX element! + * + * As a result of this choice, we took the following implementation + * decisions: + * - NodeRenderer subscribes *only* to node IDs – and therefore + * rerender *only* when visible nodes are added or removed. + * - NodeRenderer performs all operations the result of which can be + * shared between nodes (such as creating the `ResizeObserver` + * instance, or subscribing to `selector`). This means extra prop + * drilling into `NodeComponentWrapper`, but it means we need to run + * these operations only once – instead of once per node. + * - Any operations that you’d normally write inside `nodes.map` are + * moved into `NodeComponentWrapper`. This ensures they are + * memorized – so if `NodeRenderer` *has* to rerender, it only + * needs to regenerate the list of nodes, nothing else. + */ + jsx(NodeWrapper, { id: nodeId, nodeTypes: props.nodeTypes, nodeExtent: props.nodeExtent, onClick: props.onNodeClick, onMouseEnter: props.onNodeMouseEnter, onMouseMove: props.onNodeMouseMove, onMouseLeave: props.onNodeMouseLeave, onContextMenu: props.onNodeContextMenu, onDoubleClick: props.onNodeDoubleClick, noDragClassName: props.noDragClassName, noPanClassName: props.noPanClassName, rfId: props.rfId, disableKeyboardA11y: props.disableKeyboardA11y, resizeObserver: resizeObserver, nodesDraggable: nodesDraggable, nodesConnectable: nodesConnectable, nodesFocusable: nodesFocusable, elementsSelectable: elementsSelectable, nodeClickDistance: props.nodeClickDistance, onError: onError }, nodeId)); + }) })); +} +NodeRendererComponent.displayName = 'NodeRenderer'; +const NodeRenderer = memo(NodeRendererComponent); + +/** + * Hook for getting the visible edge ids from the store. + * + * @internal + * @param onlyRenderVisible + * @returns array with visible edge ids + */ +function useVisibleEdgeIds(onlyRenderVisible) { + const edgeIds = useStore(useCallback((s) => { + if (!onlyRenderVisible) { + return s.edges.map((edge) => edge.id); + } + const visibleEdgeIds = []; + if (s.width && s.height) { + for (const edge of s.edges) { + const sourceNode = s.nodeLookup.get(edge.source); + const targetNode = s.nodeLookup.get(edge.target); + if (sourceNode && + targetNode && + isEdgeVisible({ + sourceNode, + targetNode, + width: s.width, + height: s.height, + transform: s.transform, + })) { + visibleEdgeIds.push(edge.id); + } + } + } + return visibleEdgeIds; + }, [onlyRenderVisible]), shallow); + return edgeIds; +} + +const ArrowSymbol = ({ color = 'none', strokeWidth = 1 }) => { + return (jsx("polyline", { style: { + stroke: color, + strokeWidth, + }, strokeLinecap: "round", strokeLinejoin: "round", fill: "none", points: "-5,-4 0,0 -5,4" })); +}; +const ArrowClosedSymbol = ({ color = 'none', strokeWidth = 1 }) => { + return (jsx("polyline", { style: { + stroke: color, + fill: color, + strokeWidth, + }, strokeLinecap: "round", strokeLinejoin: "round", points: "-5,-4 0,0 -5,4 -5,-4" })); +}; +const MarkerSymbols = { + [MarkerType.Arrow]: ArrowSymbol, + [MarkerType.ArrowClosed]: ArrowClosedSymbol, +}; +function useMarkerSymbol(type) { + const store = useStoreApi(); + const symbol = useMemo(() => { + const symbolExists = Object.prototype.hasOwnProperty.call(MarkerSymbols, type); + if (!symbolExists) { + store.getState().onError?.('009', errorMessages['error009'](type)); + return null; + } + return MarkerSymbols[type]; + }, [type]); + return symbol; +} + +const Marker = ({ id, type, color, width = 12.5, height = 12.5, markerUnits = 'strokeWidth', strokeWidth, orient = 'auto-start-reverse', }) => { + const Symbol = useMarkerSymbol(type); + if (!Symbol) { + return null; + } + return (jsx("marker", { className: "react-flow__arrowhead", id: id, markerWidth: `${width}`, markerHeight: `${height}`, viewBox: "-10 -10 20 20", markerUnits: markerUnits, orient: orient, refX: "0", refY: "0", children: jsx(Symbol, { color: color, strokeWidth: strokeWidth }) })); +}; +/* + * when you have multiple flows on a page and you hide the first one, the other ones have no markers anymore + * when they do have markers with the same ids. To prevent this the user can pass a unique id to the react flow wrapper + * that we can then use for creating our unique marker ids + */ +const MarkerDefinitions = ({ defaultColor, rfId }) => { + const edges = useStore((s) => s.edges); + const defaultEdgeOptions = useStore((s) => s.defaultEdgeOptions); + const markers = useMemo(() => { + const markers = createMarkerIds(edges, { + id: rfId, + defaultColor, + defaultMarkerStart: defaultEdgeOptions?.markerStart, + defaultMarkerEnd: defaultEdgeOptions?.markerEnd, + }); + return markers; + }, [edges, defaultEdgeOptions, rfId, defaultColor]); + if (!markers.length) { + return null; + } + return (jsx("svg", { className: "react-flow__marker", "aria-hidden": "true", children: jsx("defs", { children: markers.map((marker) => (jsx(Marker, { id: marker.id, type: marker.type, color: marker.color, width: marker.width, height: marker.height, markerUnits: marker.markerUnits, strokeWidth: marker.strokeWidth, orient: marker.orient }, marker.id))) }) })); +}; +MarkerDefinitions.displayName = 'MarkerDefinitions'; +var MarkerDefinitions$1 = memo(MarkerDefinitions); + +function EdgeTextComponent({ x, y, label, labelStyle, labelShowBg = true, labelBgStyle, labelBgPadding = [2, 4], labelBgBorderRadius = 2, children, className, ...rest }) { + const [edgeTextBbox, setEdgeTextBbox] = useState({ x: 1, y: 0, width: 0, height: 0 }); + const edgeTextClasses = cc(['react-flow__edge-textwrapper', className]); + const edgeTextRef = useRef(null); + useEffect(() => { + if (edgeTextRef.current) { + const textBbox = edgeTextRef.current.getBBox(); + setEdgeTextBbox({ + x: textBbox.x, + y: textBbox.y, + width: textBbox.width, + height: textBbox.height, + }); + } + }, [label]); + if (!label) { + return null; + } + return (jsxs("g", { transform: `translate(${x - edgeTextBbox.width / 2} ${y - edgeTextBbox.height / 2})`, className: edgeTextClasses, visibility: edgeTextBbox.width ? 'visible' : 'hidden', ...rest, children: [labelShowBg && (jsx("rect", { width: edgeTextBbox.width + 2 * labelBgPadding[0], x: -labelBgPadding[0], y: -labelBgPadding[1], height: edgeTextBbox.height + 2 * labelBgPadding[1], className: "react-flow__edge-textbg", style: labelBgStyle, rx: labelBgBorderRadius, ry: labelBgBorderRadius })), jsx("text", { className: "react-flow__edge-text", y: edgeTextBbox.height / 2, dy: "0.3em", ref: edgeTextRef, style: labelStyle, children: label }), children] })); +} +EdgeTextComponent.displayName = 'EdgeText'; +/** + * You can use the `` component as a helper component to display text + * within your custom edges. + * + * @public + * + * @example + * ```jsx + * import { EdgeText } from '@xyflow/react'; + * + * export function CustomEdgeLabel({ label }) { + * return ( + * + * ); + * } + *``` + */ +const EdgeText = memo(EdgeTextComponent); + +/** + * The `` component gets used internally for all the edges. It can be + * used inside a custom edge and handles the invisible helper edge and the edge label + * for you. + * + * @public + * @example + * ```jsx + *import { BaseEdge } from '@xyflow/react'; + * + *export function CustomEdge({ sourceX, sourceY, targetX, targetY, ...props }) { + * const [edgePath] = getStraightPath({ + * sourceX, + * sourceY, + * targetX, + * targetY, + * }); + * + * return ; + *} + *``` + * + * @remarks If you want to use an edge marker with the [``](/api-reference/components/base-edge) component, + * you can pass the `markerStart` or `markerEnd` props passed to your custom edge + * through to the [``](/api-reference/components/base-edge) component. + * You can see all the props passed to a custom edge by looking at the [`EdgeProps`](/api-reference/types/edge-props) type. + */ +function BaseEdge({ path, labelX, labelY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, interactionWidth = 20, ...props }) { + return (jsxs(Fragment, { children: [jsx("path", { ...props, d: path, fill: "none", className: cc(['react-flow__edge-path', props.className]) }), interactionWidth && (jsx("path", { d: path, fill: "none", strokeOpacity: 0, strokeWidth: interactionWidth, className: "react-flow__edge-interaction" })), label && isNumeric(labelX) && isNumeric(labelY) ? (jsx(EdgeText, { x: labelX, y: labelY, label: label, labelStyle: labelStyle, labelShowBg: labelShowBg, labelBgStyle: labelBgStyle, labelBgPadding: labelBgPadding, labelBgBorderRadius: labelBgBorderRadius })) : null] })); +} + +function getControl({ pos, x1, y1, x2, y2 }) { + if (pos === Position.Left || pos === Position.Right) { + return [0.5 * (x1 + x2), y1]; + } + return [x1, 0.5 * (y1 + y2)]; +} +/** + * The `getSimpleBezierPath` util returns everything you need to render a simple + * bezier edge between two nodes. + * @public + * @returns + * - `path`: the path to use in an SVG `` element. + * - `labelX`: the `x` position you can use to render a label for this edge. + * - `labelY`: the `y` position you can use to render a label for this edge. + * - `offsetX`: the absolute difference between the source `x` position and the `x` position of the + * middle of this path. + * - `offsetY`: the absolute difference between the source `y` position and the `y` position of the + * middle of this path. + */ +function getSimpleBezierPath({ sourceX, sourceY, sourcePosition = Position.Bottom, targetX, targetY, targetPosition = Position.Top, }) { + const [sourceControlX, sourceControlY] = getControl({ + pos: sourcePosition, + x1: sourceX, + y1: sourceY, + x2: targetX, + y2: targetY, + }); + const [targetControlX, targetControlY] = getControl({ + pos: targetPosition, + x1: targetX, + y1: targetY, + x2: sourceX, + y2: sourceY, + }); + const [labelX, labelY, offsetX, offsetY] = getBezierEdgeCenter({ + sourceX, + sourceY, + targetX, + targetY, + sourceControlX, + sourceControlY, + targetControlX, + targetControlY, + }); + return [ + `M${sourceX},${sourceY} C${sourceControlX},${sourceControlY} ${targetControlX},${targetControlY} ${targetX},${targetY}`, + labelX, + labelY, + offsetX, + offsetY, + ]; +} +function createSimpleBezierEdge(params) { + // eslint-disable-next-line react/display-name + return memo(({ id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, markerEnd, markerStart, interactionWidth, }) => { + const [path, labelX, labelY] = getSimpleBezierPath({ + sourceX, + sourceY, + sourcePosition, + targetX, + targetY, + targetPosition, + }); + const _id = params.isInternal ? undefined : id; + return (jsx(BaseEdge, { id: _id, path: path, labelX: labelX, labelY: labelY, label: label, labelStyle: labelStyle, labelShowBg: labelShowBg, labelBgStyle: labelBgStyle, labelBgPadding: labelBgPadding, labelBgBorderRadius: labelBgBorderRadius, style: style, markerEnd: markerEnd, markerStart: markerStart, interactionWidth: interactionWidth })); + }); +} +const SimpleBezierEdge = createSimpleBezierEdge({ isInternal: false }); +const SimpleBezierEdgeInternal = createSimpleBezierEdge({ isInternal: true }); +SimpleBezierEdge.displayName = 'SimpleBezierEdge'; +SimpleBezierEdgeInternal.displayName = 'SimpleBezierEdgeInternal'; + +function createSmoothStepEdge(params) { + // eslint-disable-next-line react/display-name + return memo(({ id, sourceX, sourceY, targetX, targetY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, sourcePosition = Position.Bottom, targetPosition = Position.Top, markerEnd, markerStart, pathOptions, interactionWidth, }) => { + const [path, labelX, labelY] = getSmoothStepPath({ + sourceX, + sourceY, + sourcePosition, + targetX, + targetY, + targetPosition, + borderRadius: pathOptions?.borderRadius, + offset: pathOptions?.offset, + }); + const _id = params.isInternal ? undefined : id; + return (jsx(BaseEdge, { id: _id, path: path, labelX: labelX, labelY: labelY, label: label, labelStyle: labelStyle, labelShowBg: labelShowBg, labelBgStyle: labelBgStyle, labelBgPadding: labelBgPadding, labelBgBorderRadius: labelBgBorderRadius, style: style, markerEnd: markerEnd, markerStart: markerStart, interactionWidth: interactionWidth })); + }); +} +/** + * Component that can be used inside a custom edge to render a smooth step edge. + * + * @public + * @example + * + * ```tsx + * import { SmoothStepEdge } from '@xyflow/react'; + * + * function CustomEdge({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition }) { + * return ( + * + * ); + * } + * ``` + */ +const SmoothStepEdge = createSmoothStepEdge({ isInternal: false }); +/** + * @internal + */ +const SmoothStepEdgeInternal = createSmoothStepEdge({ isInternal: true }); +SmoothStepEdge.displayName = 'SmoothStepEdge'; +SmoothStepEdgeInternal.displayName = 'SmoothStepEdgeInternal'; + +function createStepEdge(params) { + // eslint-disable-next-line react/display-name + return memo(({ id, ...props }) => { + const _id = params.isInternal ? undefined : id; + return (jsx(SmoothStepEdge, { ...props, id: _id, pathOptions: useMemo(() => ({ borderRadius: 0, offset: props.pathOptions?.offset }), [props.pathOptions?.offset]) })); + }); +} +/** + * Component that can be used inside a custom edge to render a step edge. + * + * @public + * @example + * + * ```tsx + * import { StepEdge } from '@xyflow/react'; + * + * function CustomEdge({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition }) { + * return ( + * + * ); + * } + * ``` + */ +const StepEdge = createStepEdge({ isInternal: false }); +/** + * @internal + */ +const StepEdgeInternal = createStepEdge({ isInternal: true }); +StepEdge.displayName = 'StepEdge'; +StepEdgeInternal.displayName = 'StepEdgeInternal'; + +function createStraightEdge(params) { + // eslint-disable-next-line react/display-name + return memo(({ id, sourceX, sourceY, targetX, targetY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, markerEnd, markerStart, interactionWidth, }) => { + const [path, labelX, labelY] = getStraightPath({ sourceX, sourceY, targetX, targetY }); + const _id = params.isInternal ? undefined : id; + return (jsx(BaseEdge, { id: _id, path: path, labelX: labelX, labelY: labelY, label: label, labelStyle: labelStyle, labelShowBg: labelShowBg, labelBgStyle: labelBgStyle, labelBgPadding: labelBgPadding, labelBgBorderRadius: labelBgBorderRadius, style: style, markerEnd: markerEnd, markerStart: markerStart, interactionWidth: interactionWidth })); + }); +} +/** + * Component that can be used inside a custom edge to render a straight line. + * + * @public + * @example + * + * ```tsx + * import { StraightEdge } from '@xyflow/react'; + * + * function CustomEdge({ sourceX, sourceY, targetX, targetY }) { + * return ( + * + * ); + * } + * ``` + */ +const StraightEdge = createStraightEdge({ isInternal: false }); +/** + * @internal + */ +const StraightEdgeInternal = createStraightEdge({ isInternal: true }); +StraightEdge.displayName = 'StraightEdge'; +StraightEdgeInternal.displayName = 'StraightEdgeInternal'; + +function createBezierEdge(params) { + // eslint-disable-next-line react/display-name + return memo(({ id, sourceX, sourceY, targetX, targetY, sourcePosition = Position.Bottom, targetPosition = Position.Top, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, markerEnd, markerStart, pathOptions, interactionWidth, }) => { + const [path, labelX, labelY] = getBezierPath({ + sourceX, + sourceY, + sourcePosition, + targetX, + targetY, + targetPosition, + curvature: pathOptions?.curvature, + }); + const _id = params.isInternal ? undefined : id; + return (jsx(BaseEdge, { id: _id, path: path, labelX: labelX, labelY: labelY, label: label, labelStyle: labelStyle, labelShowBg: labelShowBg, labelBgStyle: labelBgStyle, labelBgPadding: labelBgPadding, labelBgBorderRadius: labelBgBorderRadius, style: style, markerEnd: markerEnd, markerStart: markerStart, interactionWidth: interactionWidth })); + }); +} +/** + * Component that can be used inside a custom edge to render a bezier curve. + * + * @public + * @example + * + * ```tsx + * import { BezierEdge } from '@xyflow/react'; + * + * function CustomEdge({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition }) { + * return ( + * + * ); + * } + * ``` + */ +const BezierEdge = createBezierEdge({ isInternal: false }); +/** + * @internal + */ +const BezierEdgeInternal = createBezierEdge({ isInternal: true }); +BezierEdge.displayName = 'BezierEdge'; +BezierEdgeInternal.displayName = 'BezierEdgeInternal'; + +const builtinEdgeTypes = { + default: BezierEdgeInternal, + straight: StraightEdgeInternal, + step: StepEdgeInternal, + smoothstep: SmoothStepEdgeInternal, + simplebezier: SimpleBezierEdgeInternal, +}; +const nullPosition = { + sourceX: null, + sourceY: null, + targetX: null, + targetY: null, + sourcePosition: null, + targetPosition: null, +}; + +const shiftX = (x, shift, position) => { + if (position === Position.Left) + return x - shift; + if (position === Position.Right) + return x + shift; + return x; +}; +const shiftY = (y, shift, position) => { + if (position === Position.Top) + return y - shift; + if (position === Position.Bottom) + return y + shift; + return y; +}; +const EdgeUpdaterClassName = 'react-flow__edgeupdater'; +/** + * @internal + */ +function EdgeAnchor({ position, centerX, centerY, radius = 10, onMouseDown, onMouseEnter, onMouseOut, type, }) { + return (jsx("circle", { onMouseDown: onMouseDown, onMouseEnter: onMouseEnter, onMouseOut: onMouseOut, className: cc([EdgeUpdaterClassName, `${EdgeUpdaterClassName}-${type}`]), cx: shiftX(centerX, radius, position), cy: shiftY(centerY, radius, position), r: radius, stroke: "transparent", fill: "transparent" })); +} + +function EdgeUpdateAnchors({ isReconnectable, reconnectRadius, edge, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, onReconnect, onReconnectStart, onReconnectEnd, setReconnecting, setUpdateHover, }) { + const store = useStoreApi(); + const handleEdgeUpdater = (event, oppositeHandle) => { + // avoid triggering edge updater if mouse btn is not left + if (event.button !== 0) { + return; + } + const { autoPanOnConnect, domNode, isValidConnection, connectionMode, connectionRadius, lib, onConnectStart, onConnectEnd, cancelConnection, nodeLookup, rfId: flowId, panBy, updateConnection, } = store.getState(); + const isTarget = oppositeHandle.type === 'target'; + setReconnecting(true); + onReconnectStart?.(event, edge, oppositeHandle.type); + const _onReconnectEnd = (evt, connectionState) => { + setReconnecting(false); + onReconnectEnd?.(evt, edge, oppositeHandle.type, connectionState); + }; + const onConnectEdge = (connection) => onReconnect?.(edge, connection); + XYHandle.onPointerDown(event.nativeEvent, { + autoPanOnConnect, + connectionMode, + connectionRadius, + domNode, + handleId: oppositeHandle.id, + nodeId: oppositeHandle.nodeId, + nodeLookup, + isTarget, + edgeUpdaterType: oppositeHandle.type, + lib, + flowId, + cancelConnection, + panBy, + isValidConnection, + onConnect: onConnectEdge, + onConnectStart, + onConnectEnd, + onReconnectEnd: _onReconnectEnd, + updateConnection, + getTransform: () => store.getState().transform, + getFromHandle: () => store.getState().connection.fromHandle, + }); + }; + const onReconnectSourceMouseDown = (event) => handleEdgeUpdater(event, { nodeId: edge.target, id: edge.targetHandle ?? null, type: 'target' }); + const onReconnectTargetMouseDown = (event) => handleEdgeUpdater(event, { nodeId: edge.source, id: edge.sourceHandle ?? null, type: 'source' }); + const onReconnectMouseEnter = () => setUpdateHover(true); + const onReconnectMouseOut = () => setUpdateHover(false); + return (jsxs(Fragment, { children: [(isReconnectable === true || isReconnectable === 'source') && (jsx(EdgeAnchor, { position: sourcePosition, centerX: sourceX, centerY: sourceY, radius: reconnectRadius, onMouseDown: onReconnectSourceMouseDown, onMouseEnter: onReconnectMouseEnter, onMouseOut: onReconnectMouseOut, type: "source" })), (isReconnectable === true || isReconnectable === 'target') && (jsx(EdgeAnchor, { position: targetPosition, centerX: targetX, centerY: targetY, radius: reconnectRadius, onMouseDown: onReconnectTargetMouseDown, onMouseEnter: onReconnectMouseEnter, onMouseOut: onReconnectMouseOut, type: "target" }))] })); +} + +function EdgeWrapper({ id, edgesFocusable, edgesReconnectable, elementsSelectable, onClick, onDoubleClick, onContextMenu, onMouseEnter, onMouseMove, onMouseLeave, reconnectRadius, onReconnect, onReconnectStart, onReconnectEnd, rfId, edgeTypes, noPanClassName, onError, disableKeyboardA11y, }) { + let edge = useStore((s) => s.edgeLookup.get(id)); + const defaultEdgeOptions = useStore((s) => s.defaultEdgeOptions); + edge = defaultEdgeOptions ? { ...defaultEdgeOptions, ...edge } : edge; + let edgeType = edge.type || 'default'; + let EdgeComponent = edgeTypes?.[edgeType] || builtinEdgeTypes[edgeType]; + if (EdgeComponent === undefined) { + onError?.('011', errorMessages['error011'](edgeType)); + edgeType = 'default'; + EdgeComponent = builtinEdgeTypes.default; + } + const isFocusable = !!(edge.focusable || (edgesFocusable && typeof edge.focusable === 'undefined')); + const isReconnectable = typeof onReconnect !== 'undefined' && + (edge.reconnectable || (edgesReconnectable && typeof edge.reconnectable === 'undefined')); + const isSelectable = !!(edge.selectable || (elementsSelectable && typeof edge.selectable === 'undefined')); + const edgeRef = useRef(null); + const [updateHover, setUpdateHover] = useState(false); + const [reconnecting, setReconnecting] = useState(false); + const store = useStoreApi(); + const { zIndex, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition } = useStore(useCallback((store) => { + const sourceNode = store.nodeLookup.get(edge.source); + const targetNode = store.nodeLookup.get(edge.target); + if (!sourceNode || !targetNode) { + return { + zIndex: edge.zIndex, + ...nullPosition, + }; + } + const edgePosition = getEdgePosition({ + id, + sourceNode, + targetNode, + sourceHandle: edge.sourceHandle || null, + targetHandle: edge.targetHandle || null, + connectionMode: store.connectionMode, + onError, + }); + const zIndex = getElevatedEdgeZIndex({ + selected: edge.selected, + zIndex: edge.zIndex, + sourceNode, + targetNode, + elevateOnSelect: store.elevateEdgesOnSelect, + }); + return { + zIndex, + ...(edgePosition || nullPosition), + }; + }, [edge.source, edge.target, edge.sourceHandle, edge.targetHandle, edge.selected, edge.zIndex]), shallow); + const markerStartUrl = useMemo(() => (edge.markerStart ? `url('#${getMarkerId(edge.markerStart, rfId)}')` : undefined), [edge.markerStart, rfId]); + const markerEndUrl = useMemo(() => (edge.markerEnd ? `url('#${getMarkerId(edge.markerEnd, rfId)}')` : undefined), [edge.markerEnd, rfId]); + if (edge.hidden || sourceX === null || sourceY === null || targetX === null || targetY === null) { + return null; + } + const onEdgeClick = (event) => { + const { addSelectedEdges, unselectNodesAndEdges, multiSelectionActive } = store.getState(); + if (isSelectable) { + store.setState({ nodesSelectionActive: false }); + if (edge.selected && multiSelectionActive) { + unselectNodesAndEdges({ nodes: [], edges: [edge] }); + edgeRef.current?.blur(); + } + else { + addSelectedEdges([id]); + } + } + if (onClick) { + onClick(event, edge); + } + }; + const onEdgeDoubleClick = onDoubleClick + ? (event) => { + onDoubleClick(event, { ...edge }); + } + : undefined; + const onEdgeContextMenu = onContextMenu + ? (event) => { + onContextMenu(event, { ...edge }); + } + : undefined; + const onEdgeMouseEnter = onMouseEnter + ? (event) => { + onMouseEnter(event, { ...edge }); + } + : undefined; + const onEdgeMouseMove = onMouseMove + ? (event) => { + onMouseMove(event, { ...edge }); + } + : undefined; + const onEdgeMouseLeave = onMouseLeave + ? (event) => { + onMouseLeave(event, { ...edge }); + } + : undefined; + const onKeyDown = (event) => { + if (!disableKeyboardA11y && elementSelectionKeys.includes(event.key) && isSelectable) { + const { unselectNodesAndEdges, addSelectedEdges } = store.getState(); + const unselect = event.key === 'Escape'; + if (unselect) { + edgeRef.current?.blur(); + unselectNodesAndEdges({ edges: [edge] }); + } + else { + addSelectedEdges([id]); + } + } + }; + return (jsx("svg", { style: { zIndex }, children: jsxs("g", { className: cc([ + 'react-flow__edge', + `react-flow__edge-${edgeType}`, + edge.className, + noPanClassName, + { + selected: edge.selected, + animated: edge.animated, + inactive: !isSelectable && !onClick, + updating: updateHover, + selectable: isSelectable, + }, + ]), onClick: onEdgeClick, onDoubleClick: onEdgeDoubleClick, onContextMenu: onEdgeContextMenu, onMouseEnter: onEdgeMouseEnter, onMouseMove: onEdgeMouseMove, onMouseLeave: onEdgeMouseLeave, onKeyDown: isFocusable ? onKeyDown : undefined, tabIndex: isFocusable ? 0 : undefined, role: edge.ariaRole ?? (isFocusable ? 'group' : 'img'), "aria-roledescription": "edge", "data-id": id, "data-testid": `rf__edge-${id}`, "aria-label": edge.ariaLabel === null ? undefined : edge.ariaLabel || `Edge from ${edge.source} to ${edge.target}`, "aria-describedby": isFocusable ? `${ARIA_EDGE_DESC_KEY}-${rfId}` : undefined, ref: edgeRef, ...edge.domAttributes, children: [!reconnecting && (jsx(EdgeComponent, { id: id, source: edge.source, target: edge.target, type: edge.type, selected: edge.selected, animated: edge.animated, selectable: isSelectable, deletable: edge.deletable ?? true, label: edge.label, labelStyle: edge.labelStyle, labelShowBg: edge.labelShowBg, labelBgStyle: edge.labelBgStyle, labelBgPadding: edge.labelBgPadding, labelBgBorderRadius: edge.labelBgBorderRadius, sourceX: sourceX, sourceY: sourceY, targetX: targetX, targetY: targetY, sourcePosition: sourcePosition, targetPosition: targetPosition, data: edge.data, style: edge.style, sourceHandleId: edge.sourceHandle, targetHandleId: edge.targetHandle, markerStart: markerStartUrl, markerEnd: markerEndUrl, pathOptions: 'pathOptions' in edge ? edge.pathOptions : undefined, interactionWidth: edge.interactionWidth })), isReconnectable && (jsx(EdgeUpdateAnchors, { edge: edge, isReconnectable: isReconnectable, reconnectRadius: reconnectRadius, onReconnect: onReconnect, onReconnectStart: onReconnectStart, onReconnectEnd: onReconnectEnd, sourceX: sourceX, sourceY: sourceY, targetX: targetX, targetY: targetY, sourcePosition: sourcePosition, targetPosition: targetPosition, setUpdateHover: setUpdateHover, setReconnecting: setReconnecting }))] }) })); +} + +const selector$a = (s) => ({ + edgesFocusable: s.edgesFocusable, + edgesReconnectable: s.edgesReconnectable, + elementsSelectable: s.elementsSelectable, + connectionMode: s.connectionMode, + onError: s.onError, +}); +function EdgeRendererComponent({ defaultMarkerColor, onlyRenderVisibleElements, rfId, edgeTypes, noPanClassName, onReconnect, onEdgeContextMenu, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, onEdgeClick, reconnectRadius, onEdgeDoubleClick, onReconnectStart, onReconnectEnd, disableKeyboardA11y, }) { + const { edgesFocusable, edgesReconnectable, elementsSelectable, onError } = useStore(selector$a, shallow); + const edgeIds = useVisibleEdgeIds(onlyRenderVisibleElements); + return (jsxs("div", { className: "react-flow__edges", children: [jsx(MarkerDefinitions$1, { defaultColor: defaultMarkerColor, rfId: rfId }), edgeIds.map((id) => { + return (jsx(EdgeWrapper, { id: id, edgesFocusable: edgesFocusable, edgesReconnectable: edgesReconnectable, elementsSelectable: elementsSelectable, noPanClassName: noPanClassName, onReconnect: onReconnect, onContextMenu: onEdgeContextMenu, onMouseEnter: onEdgeMouseEnter, onMouseMove: onEdgeMouseMove, onMouseLeave: onEdgeMouseLeave, onClick: onEdgeClick, reconnectRadius: reconnectRadius, onDoubleClick: onEdgeDoubleClick, onReconnectStart: onReconnectStart, onReconnectEnd: onReconnectEnd, rfId: rfId, onError: onError, edgeTypes: edgeTypes, disableKeyboardA11y: disableKeyboardA11y }, id)); + })] })); +} +EdgeRendererComponent.displayName = 'EdgeRenderer'; +const EdgeRenderer = memo(EdgeRendererComponent); + +const selector$9 = (s) => `translate(${s.transform[0]}px,${s.transform[1]}px) scale(${s.transform[2]})`; +function Viewport({ children }) { + const transform = useStore(selector$9); + return (jsx("div", { className: "react-flow__viewport xyflow__viewport react-flow__container", style: { transform }, children: children })); +} + +/** + * Hook for calling onInit handler. + * + * @internal + */ +function useOnInitHandler(onInit) { + const rfInstance = useReactFlow(); + const isInitialized = useRef(false); + useEffect(() => { + if (!isInitialized.current && rfInstance.viewportInitialized && onInit) { + setTimeout(() => onInit(rfInstance), 1); + isInitialized.current = true; + } + }, [onInit, rfInstance.viewportInitialized]); +} + +const selector$8 = (state) => state.panZoom?.syncViewport; +/** + * Hook for syncing the viewport with the panzoom instance. + * + * @internal + * @param viewport + */ +function useViewportSync(viewport) { + const syncViewport = useStore(selector$8); + const store = useStoreApi(); + useEffect(() => { + if (viewport) { + syncViewport?.(viewport); + store.setState({ transform: [viewport.x, viewport.y, viewport.zoom] }); + } + }, [viewport, syncViewport]); + return null; +} + +function storeSelector$1(s) { + return s.connection.inProgress + ? { ...s.connection, to: pointToRendererPoint(s.connection.to, s.transform) } + : { ...s.connection }; +} +function getSelector(connectionSelector) { + if (connectionSelector) { + const combinedSelector = (s) => { + const connection = storeSelector$1(s); + return connectionSelector(connection); + }; + return combinedSelector; + } + return storeSelector$1; +} +/** + * The `useConnection` hook returns the current connection when there is an active + * connection interaction. If no connection interaction is active, it returns null + * for every property. A typical use case for this hook is to colorize handles + * based on a certain condition (e.g. if the connection is valid or not). + * + * @public + * @param connectionSelector - An optional selector function used to extract a slice of the + * `ConnectionState` data. Using a selector can prevent component re-renders where data you don't + * otherwise care about might change. If a selector is not provided, the entire `ConnectionState` + * object is returned unchanged. + * @example + * + * ```tsx + *import { useConnection } from '@xyflow/react'; + * + *function App() { + * const connection = useConnection(); + * + * return ( + *
{connection ? `Someone is trying to make a connection from ${connection.fromNode} to this one.` : 'There are currently no incoming connections!'} + * + *
+ * ); + * } + * ``` + * + * @returns ConnectionState + */ +function useConnection(connectionSelector) { + const combinedSelector = getSelector(connectionSelector); + return useStore(combinedSelector, shallow); +} + +const selector$7 = (s) => ({ + nodesConnectable: s.nodesConnectable, + isValid: s.connection.isValid, + inProgress: s.connection.inProgress, + width: s.width, + height: s.height, +}); +function ConnectionLineWrapper({ containerStyle, style, type, component, }) { + const { nodesConnectable, width, height, isValid, inProgress } = useStore(selector$7, shallow); + const renderConnection = !!(width && nodesConnectable && inProgress); + if (!renderConnection) { + return null; + } + return (jsx("svg", { style: containerStyle, width: width, height: height, className: "react-flow__connectionline react-flow__container", children: jsx("g", { className: cc(['react-flow__connection', getConnectionStatus(isValid)]), children: jsx(ConnectionLine, { style: style, type: type, CustomComponent: component, isValid: isValid }) }) })); +} +const ConnectionLine = ({ style, type = ConnectionLineType.Bezier, CustomComponent, isValid, }) => { + const { inProgress, from, fromNode, fromHandle, fromPosition, to, toNode, toHandle, toPosition } = useConnection(); + if (!inProgress) { + return; + } + if (CustomComponent) { + return (jsx(CustomComponent, { connectionLineType: type, connectionLineStyle: style, fromNode: fromNode, fromHandle: fromHandle, fromX: from.x, fromY: from.y, toX: to.x, toY: to.y, fromPosition: fromPosition, toPosition: toPosition, connectionStatus: getConnectionStatus(isValid), toNode: toNode, toHandle: toHandle })); + } + let path = ''; + const pathParams = { + sourceX: from.x, + sourceY: from.y, + sourcePosition: fromPosition, + targetX: to.x, + targetY: to.y, + targetPosition: toPosition, + }; + switch (type) { + case ConnectionLineType.Bezier: + [path] = getBezierPath(pathParams); + break; + case ConnectionLineType.SimpleBezier: + [path] = getSimpleBezierPath(pathParams); + break; + case ConnectionLineType.Step: + [path] = getSmoothStepPath({ + ...pathParams, + borderRadius: 0, + }); + break; + case ConnectionLineType.SmoothStep: + [path] = getSmoothStepPath(pathParams); + break; + default: + [path] = getStraightPath(pathParams); + } + return jsx("path", { d: path, fill: "none", className: "react-flow__connection-path", style: style }); +}; +ConnectionLine.displayName = 'ConnectionLine'; + +const emptyTypes = {}; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function useNodeOrEdgeTypesWarning(nodeOrEdgeTypes = emptyTypes) { + const typesRef = useRef(nodeOrEdgeTypes); + const store = useStoreApi(); + useEffect(() => { + if (process.env.NODE_ENV === 'development') { + const usedKeys = new Set([...Object.keys(typesRef.current), ...Object.keys(nodeOrEdgeTypes)]); + for (const key of usedKeys) { + if (typesRef.current[key] !== nodeOrEdgeTypes[key]) { + store.getState().onError?.('002', errorMessages['error002']()); + break; + } + } + typesRef.current = nodeOrEdgeTypes; + } + }, [nodeOrEdgeTypes]); +} + +function useStylesLoadedWarning() { + const store = useStoreApi(); + const checked = useRef(false); + useEffect(() => { + if (process.env.NODE_ENV === 'development') { + if (!checked.current) { + const pane = document.querySelector('.react-flow__pane'); + if (pane && !(window.getComputedStyle(pane).zIndex === '1')) { + store.getState().onError?.('013', errorMessages['error013']('react')); + } + checked.current = true; + } + } + }, []); +} + +function GraphViewComponent({ nodeTypes, edgeTypes, onInit, onNodeClick, onEdgeClick, onNodeDoubleClick, onEdgeDoubleClick, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave, onNodeContextMenu, onSelectionContextMenu, onSelectionStart, onSelectionEnd, connectionLineType, connectionLineStyle, connectionLineComponent, connectionLineContainerStyle, selectionKeyCode, selectionOnDrag, selectionMode, multiSelectionKeyCode, panActivationKeyCode, zoomActivationKeyCode, deleteKeyCode, onlyRenderVisibleElements, elementsSelectable, defaultViewport, translateExtent, minZoom, maxZoom, preventScrolling, defaultMarkerColor, zoomOnScroll, zoomOnPinch, panOnScroll, panOnScrollSpeed, panOnScrollMode, zoomOnDoubleClick, panOnDrag, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneScroll, onPaneContextMenu, paneClickDistance, nodeClickDistance, onEdgeContextMenu, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, reconnectRadius, onReconnect, onReconnectStart, onReconnectEnd, noDragClassName, noWheelClassName, noPanClassName, disableKeyboardA11y, nodeExtent, rfId, viewport, onViewportChange, }) { + useNodeOrEdgeTypesWarning(nodeTypes); + useNodeOrEdgeTypesWarning(edgeTypes); + useStylesLoadedWarning(); + useOnInitHandler(onInit); + useViewportSync(viewport); + return (jsx(FlowRenderer, { onPaneClick: onPaneClick, onPaneMouseEnter: onPaneMouseEnter, onPaneMouseMove: onPaneMouseMove, onPaneMouseLeave: onPaneMouseLeave, onPaneContextMenu: onPaneContextMenu, onPaneScroll: onPaneScroll, paneClickDistance: paneClickDistance, deleteKeyCode: deleteKeyCode, selectionKeyCode: selectionKeyCode, selectionOnDrag: selectionOnDrag, selectionMode: selectionMode, onSelectionStart: onSelectionStart, onSelectionEnd: onSelectionEnd, multiSelectionKeyCode: multiSelectionKeyCode, panActivationKeyCode: panActivationKeyCode, zoomActivationKeyCode: zoomActivationKeyCode, elementsSelectable: elementsSelectable, zoomOnScroll: zoomOnScroll, zoomOnPinch: zoomOnPinch, zoomOnDoubleClick: zoomOnDoubleClick, panOnScroll: panOnScroll, panOnScrollSpeed: panOnScrollSpeed, panOnScrollMode: panOnScrollMode, panOnDrag: panOnDrag, defaultViewport: defaultViewport, translateExtent: translateExtent, minZoom: minZoom, maxZoom: maxZoom, onSelectionContextMenu: onSelectionContextMenu, preventScrolling: preventScrolling, noDragClassName: noDragClassName, noWheelClassName: noWheelClassName, noPanClassName: noPanClassName, disableKeyboardA11y: disableKeyboardA11y, onViewportChange: onViewportChange, isControlledViewport: !!viewport, children: jsxs(Viewport, { children: [jsx(EdgeRenderer, { edgeTypes: edgeTypes, onEdgeClick: onEdgeClick, onEdgeDoubleClick: onEdgeDoubleClick, onReconnect: onReconnect, onReconnectStart: onReconnectStart, onReconnectEnd: onReconnectEnd, onlyRenderVisibleElements: onlyRenderVisibleElements, onEdgeContextMenu: onEdgeContextMenu, onEdgeMouseEnter: onEdgeMouseEnter, onEdgeMouseMove: onEdgeMouseMove, onEdgeMouseLeave: onEdgeMouseLeave, reconnectRadius: reconnectRadius, defaultMarkerColor: defaultMarkerColor, noPanClassName: noPanClassName, disableKeyboardA11y: disableKeyboardA11y, rfId: rfId }), jsx(ConnectionLineWrapper, { style: connectionLineStyle, type: connectionLineType, component: connectionLineComponent, containerStyle: connectionLineContainerStyle }), jsx("div", { className: "react-flow__edgelabel-renderer" }), jsx(NodeRenderer, { nodeTypes: nodeTypes, onNodeClick: onNodeClick, onNodeDoubleClick: onNodeDoubleClick, onNodeMouseEnter: onNodeMouseEnter, onNodeMouseMove: onNodeMouseMove, onNodeMouseLeave: onNodeMouseLeave, onNodeContextMenu: onNodeContextMenu, nodeClickDistance: nodeClickDistance, onlyRenderVisibleElements: onlyRenderVisibleElements, noPanClassName: noPanClassName, noDragClassName: noDragClassName, disableKeyboardA11y: disableKeyboardA11y, nodeExtent: nodeExtent, rfId: rfId }), jsx("div", { className: "react-flow__viewport-portal" })] }) })); +} +GraphViewComponent.displayName = 'GraphView'; +const GraphView = memo(GraphViewComponent); + +const getInitialState = ({ nodes, edges, defaultNodes, defaultEdges, width, height, fitView, fitViewOptions, minZoom = 0.5, maxZoom = 2, nodeOrigin, nodeExtent, } = {}) => { + const nodeLookup = new Map(); + const parentLookup = new Map(); + const connectionLookup = new Map(); + const edgeLookup = new Map(); + const storeEdges = defaultEdges ?? edges ?? []; + const storeNodes = defaultNodes ?? nodes ?? []; + const storeNodeOrigin = nodeOrigin ?? [0, 0]; + const storeNodeExtent = nodeExtent ?? infiniteExtent; + updateConnectionLookup(connectionLookup, edgeLookup, storeEdges); + const nodesInitialized = adoptUserNodes(storeNodes, nodeLookup, parentLookup, { + nodeOrigin: storeNodeOrigin, + nodeExtent: storeNodeExtent, + elevateNodesOnSelect: false, + }); + let transform = [0, 0, 1]; + if (fitView && width && height) { + const bounds = getInternalNodesBounds(nodeLookup, { + filter: (node) => !!((node.width || node.initialWidth) && (node.height || node.initialHeight)), + }); + const { x, y, zoom } = getViewportForBounds(bounds, width, height, minZoom, maxZoom, fitViewOptions?.padding ?? 0.1); + transform = [x, y, zoom]; + } + return { + rfId: '1', + width: 0, + height: 0, + transform, + nodes: storeNodes, + nodesInitialized, + nodeLookup, + parentLookup, + edges: storeEdges, + edgeLookup, + connectionLookup, + onNodesChange: null, + onEdgesChange: null, + hasDefaultNodes: defaultNodes !== undefined, + hasDefaultEdges: defaultEdges !== undefined, + panZoom: null, + minZoom, + maxZoom, + translateExtent: infiniteExtent, + nodeExtent: storeNodeExtent, + nodesSelectionActive: false, + userSelectionActive: false, + userSelectionRect: null, + connectionMode: ConnectionMode.Strict, + domNode: null, + paneDragging: false, + noPanClassName: 'nopan', + nodeOrigin: storeNodeOrigin, + nodeDragThreshold: 1, + snapGrid: [15, 15], + snapToGrid: false, + nodesDraggable: true, + nodesConnectable: true, + nodesFocusable: true, + edgesFocusable: true, + edgesReconnectable: true, + elementsSelectable: true, + elevateNodesOnSelect: true, + elevateEdgesOnSelect: false, + selectNodesOnDrag: true, + multiSelectionActive: false, + fitViewQueued: fitView ?? false, + fitViewOptions, + fitViewResolver: null, + connection: { ...initialConnection }, + connectionClickStartHandle: null, + connectOnClick: true, + ariaLiveMessage: '', + autoPanOnConnect: true, + autoPanOnNodeDrag: true, + autoPanOnNodeFocus: true, + autoPanSpeed: 15, + connectionRadius: 20, + onError: devWarn, + isValidConnection: undefined, + onSelectionChangeHandlers: [], + lib: 'react', + debug: false, + ariaLabelConfig: defaultAriaLabelConfig, + }; +}; + +const createStore = ({ nodes, edges, defaultNodes, defaultEdges, width, height, fitView, fitViewOptions, minZoom, maxZoom, nodeOrigin, nodeExtent, }) => createWithEqualityFn((set, get) => { + async function resolveFitView() { + const { nodeLookup, panZoom, fitViewOptions, fitViewResolver, width, height, minZoom, maxZoom } = get(); + if (!panZoom) { + return; + } + await fitViewport({ + nodes: nodeLookup, + width, + height, + panZoom, + minZoom, + maxZoom, + }, fitViewOptions); + fitViewResolver?.resolve(true); + /** + * wait for the fitViewport to resolve before deleting the resolver, + * we want to reuse the old resolver if the user calls fitView again in the mean time + */ + set({ fitViewResolver: null }); + } + return { + ...getInitialState({ + nodes, + edges, + width, + height, + fitView, + fitViewOptions, + minZoom, + maxZoom, + nodeOrigin, + nodeExtent, + defaultNodes, + defaultEdges, + }), + setNodes: (nodes) => { + const { nodeLookup, parentLookup, nodeOrigin, elevateNodesOnSelect, fitViewQueued } = get(); + /* + * setNodes() is called exclusively in response to user actions: + * - either when the `` prop is updated in the controlled ReactFlow setup, + * - or when the user calls something like `reactFlowInstance.setNodes()` in an uncontrolled ReactFlow setup. + * + * When this happens, we take the note objects passed by the user and extend them with fields + * relevant for internal React Flow operations. + */ + const nodesInitialized = adoptUserNodes(nodes, nodeLookup, parentLookup, { + nodeOrigin, + nodeExtent, + elevateNodesOnSelect, + checkEquality: true, + }); + if (fitViewQueued && nodesInitialized) { + resolveFitView(); + set({ nodes, nodesInitialized, fitViewQueued: false, fitViewOptions: undefined }); + } + else { + set({ nodes, nodesInitialized }); + } + }, + setEdges: (edges) => { + const { connectionLookup, edgeLookup } = get(); + updateConnectionLookup(connectionLookup, edgeLookup, edges); + set({ edges }); + }, + setDefaultNodesAndEdges: (nodes, edges) => { + if (nodes) { + const { setNodes } = get(); + setNodes(nodes); + set({ hasDefaultNodes: true }); + } + if (edges) { + const { setEdges } = get(); + setEdges(edges); + set({ hasDefaultEdges: true }); + } + }, + /* + * Every node gets registerd at a ResizeObserver. Whenever a node + * changes its dimensions, this function is called to measure the + * new dimensions and update the nodes. + */ + updateNodeInternals: (updates) => { + const { triggerNodeChanges, nodeLookup, parentLookup, domNode, nodeOrigin, nodeExtent, debug, fitViewQueued } = get(); + const { changes, updatedInternals } = updateNodeInternals(updates, nodeLookup, parentLookup, domNode, nodeOrigin, nodeExtent); + if (!updatedInternals) { + return; + } + updateAbsolutePositions(nodeLookup, parentLookup, { nodeOrigin, nodeExtent }); + if (fitViewQueued) { + resolveFitView(); + set({ fitViewQueued: false, fitViewOptions: undefined }); + } + else { + // we always want to trigger useStore calls whenever updateNodeInternals is called + set({}); + } + if (changes?.length > 0) { + if (debug) { + console.log('React Flow: trigger node changes', changes); + } + triggerNodeChanges?.(changes); + } + }, + updateNodePositions: (nodeDragItems, dragging = false) => { + const parentExpandChildren = []; + const changes = []; + const { nodeLookup, triggerNodeChanges } = get(); + for (const [id, dragItem] of nodeDragItems) { + // we are using the nodelookup to be sure to use the current expandParent and parentId value + const node = nodeLookup.get(id); + const expandParent = !!(node?.expandParent && node?.parentId && dragItem?.position); + const change = { + id, + type: 'position', + position: expandParent + ? { + x: Math.max(0, dragItem.position.x), + y: Math.max(0, dragItem.position.y), + } + : dragItem.position, + dragging, + }; + if (expandParent && node.parentId) { + parentExpandChildren.push({ + id, + parentId: node.parentId, + rect: { + ...dragItem.internals.positionAbsolute, + width: dragItem.measured.width ?? 0, + height: dragItem.measured.height ?? 0, + }, + }); + } + changes.push(change); + } + if (parentExpandChildren.length > 0) { + const { parentLookup, nodeOrigin } = get(); + const parentExpandChanges = handleExpandParent(parentExpandChildren, nodeLookup, parentLookup, nodeOrigin); + changes.push(...parentExpandChanges); + } + triggerNodeChanges(changes); + }, + triggerNodeChanges: (changes) => { + const { onNodesChange, setNodes, nodes, hasDefaultNodes, debug } = get(); + if (changes?.length) { + if (hasDefaultNodes) { + const updatedNodes = applyNodeChanges(changes, nodes); + setNodes(updatedNodes); + } + if (debug) { + console.log('React Flow: trigger node changes', changes); + } + onNodesChange?.(changes); + } + }, + triggerEdgeChanges: (changes) => { + const { onEdgesChange, setEdges, edges, hasDefaultEdges, debug } = get(); + if (changes?.length) { + if (hasDefaultEdges) { + const updatedEdges = applyEdgeChanges(changes, edges); + setEdges(updatedEdges); + } + if (debug) { + console.log('React Flow: trigger edge changes', changes); + } + onEdgesChange?.(changes); + } + }, + addSelectedNodes: (selectedNodeIds) => { + const { multiSelectionActive, edgeLookup, nodeLookup, triggerNodeChanges, triggerEdgeChanges } = get(); + if (multiSelectionActive) { + const nodeChanges = selectedNodeIds.map((nodeId) => createSelectionChange(nodeId, true)); + triggerNodeChanges(nodeChanges); + return; + } + triggerNodeChanges(getSelectionChanges(nodeLookup, new Set([...selectedNodeIds]), true)); + triggerEdgeChanges(getSelectionChanges(edgeLookup)); + }, + addSelectedEdges: (selectedEdgeIds) => { + const { multiSelectionActive, edgeLookup, nodeLookup, triggerNodeChanges, triggerEdgeChanges } = get(); + if (multiSelectionActive) { + const changedEdges = selectedEdgeIds.map((edgeId) => createSelectionChange(edgeId, true)); + triggerEdgeChanges(changedEdges); + return; + } + triggerEdgeChanges(getSelectionChanges(edgeLookup, new Set([...selectedEdgeIds]))); + triggerNodeChanges(getSelectionChanges(nodeLookup, new Set(), true)); + }, + unselectNodesAndEdges: ({ nodes, edges } = {}) => { + const { edges: storeEdges, nodes: storeNodes, nodeLookup, triggerNodeChanges, triggerEdgeChanges } = get(); + const nodesToUnselect = nodes ? nodes : storeNodes; + const edgesToUnselect = edges ? edges : storeEdges; + const nodeChanges = nodesToUnselect.map((n) => { + const internalNode = nodeLookup.get(n.id); + if (internalNode) { + /* + * we need to unselect the internal node that was selected previously before we + * send the change to the user to prevent it to be selected while dragging the new node + */ + internalNode.selected = false; + } + return createSelectionChange(n.id, false); + }); + const edgeChanges = edgesToUnselect.map((edge) => createSelectionChange(edge.id, false)); + triggerNodeChanges(nodeChanges); + triggerEdgeChanges(edgeChanges); + }, + setMinZoom: (minZoom) => { + const { panZoom, maxZoom } = get(); + panZoom?.setScaleExtent([minZoom, maxZoom]); + set({ minZoom }); + }, + setMaxZoom: (maxZoom) => { + const { panZoom, minZoom } = get(); + panZoom?.setScaleExtent([minZoom, maxZoom]); + set({ maxZoom }); + }, + setTranslateExtent: (translateExtent) => { + get().panZoom?.setTranslateExtent(translateExtent); + set({ translateExtent }); + }, + setPaneClickDistance: (clickDistance) => { + get().panZoom?.setClickDistance(clickDistance); + }, + resetSelectedElements: () => { + const { edges, nodes, triggerNodeChanges, triggerEdgeChanges, elementsSelectable } = get(); + if (!elementsSelectable) { + return; + } + const nodeChanges = nodes.reduce((res, node) => (node.selected ? [...res, createSelectionChange(node.id, false)] : res), []); + const edgeChanges = edges.reduce((res, edge) => (edge.selected ? [...res, createSelectionChange(edge.id, false)] : res), []); + triggerNodeChanges(nodeChanges); + triggerEdgeChanges(edgeChanges); + }, + setNodeExtent: (nextNodeExtent) => { + const { nodes, nodeLookup, parentLookup, nodeOrigin, elevateNodesOnSelect, nodeExtent } = get(); + if (nextNodeExtent[0][0] === nodeExtent[0][0] && + nextNodeExtent[0][1] === nodeExtent[0][1] && + nextNodeExtent[1][0] === nodeExtent[1][0] && + nextNodeExtent[1][1] === nodeExtent[1][1]) { + return; + } + adoptUserNodes(nodes, nodeLookup, parentLookup, { + nodeOrigin, + nodeExtent: nextNodeExtent, + elevateNodesOnSelect, + checkEquality: false, + }); + set({ nodeExtent: nextNodeExtent }); + }, + panBy: (delta) => { + const { transform, width, height, panZoom, translateExtent } = get(); + return panBy({ delta, panZoom, transform, translateExtent, width, height }); + }, + setCenter: async (x, y, options) => { + const { width, height, maxZoom, panZoom } = get(); + if (!panZoom) { + return Promise.resolve(false); + } + const nextZoom = typeof options?.zoom !== 'undefined' ? options.zoom : maxZoom; + await panZoom.setViewport({ + x: width / 2 - x * nextZoom, + y: height / 2 - y * nextZoom, + zoom: nextZoom, + }, { duration: options?.duration, ease: options?.ease, interpolate: options?.interpolate }); + return Promise.resolve(true); + }, + cancelConnection: () => { + set({ + connection: { ...initialConnection }, + }); + }, + updateConnection: (connection) => { + set({ connection }); + }, + reset: () => set({ ...getInitialState() }), + }; +}, Object.is); + +/** + * The `` component is a [context provider](https://react.dev/learn/passing-data-deeply-with-context#) + * that makes it possible to access a flow's internal state outside of the + * [``](/api-reference/react-flow) component. Many of the hooks we + * provide rely on this component to work. + * @public + * + * @example + * ```tsx + *import { ReactFlow, ReactFlowProvider, useNodes } from '@xyflow/react' + * + *export default function Flow() { + * return ( + * + * + * + * + * ); + *} + * + *function Sidebar() { + * // This hook will only work if the component it's used in is a child of a + * // . + * const nodes = useNodes() + * + * return ; + *} + *``` + * + * @remarks If you're using a router and want your flow's state to persist across routes, + * it's vital that you place the `` component _outside_ of + * your router. If you have multiple flows on the same page you will need to use a separate + * `` for each flow. + */ +function ReactFlowProvider({ initialNodes: nodes, initialEdges: edges, defaultNodes, defaultEdges, initialWidth: width, initialHeight: height, initialMinZoom: minZoom, initialMaxZoom: maxZoom, initialFitViewOptions: fitViewOptions, fitView, nodeOrigin, nodeExtent, children, }) { + const [store] = useState(() => createStore({ + nodes, + edges, + defaultNodes, + defaultEdges, + width, + height, + fitView, + minZoom, + maxZoom, + fitViewOptions, + nodeOrigin, + nodeExtent, + })); + return (jsx(Provider$1, { value: store, children: jsx(BatchProvider, { children: children }) })); +} + +function Wrapper({ children, nodes, edges, defaultNodes, defaultEdges, width, height, fitView, fitViewOptions, minZoom, maxZoom, nodeOrigin, nodeExtent, }) { + const isWrapped = useContext(StoreContext); + if (isWrapped) { + /* + * we need to wrap it with a fragment because it's not allowed for children to be a ReactNode + * https://github.com/DefinitelyTyped/DefinitelyTyped/issues/18051 + */ + return jsx(Fragment, { children: children }); + } + return (jsx(ReactFlowProvider, { initialNodes: nodes, initialEdges: edges, defaultNodes: defaultNodes, defaultEdges: defaultEdges, initialWidth: width, initialHeight: height, fitView: fitView, initialFitViewOptions: fitViewOptions, initialMinZoom: minZoom, initialMaxZoom: maxZoom, nodeOrigin: nodeOrigin, nodeExtent: nodeExtent, children: children })); +} + +const wrapperStyle = { + width: '100%', + height: '100%', + overflow: 'hidden', + position: 'relative', + zIndex: 0, +}; +function ReactFlow({ nodes, edges, defaultNodes, defaultEdges, className, nodeTypes, edgeTypes, onNodeClick, onEdgeClick, onInit, onMove, onMoveStart, onMoveEnd, onConnect, onConnectStart, onConnectEnd, onClickConnectStart, onClickConnectEnd, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave, onNodeContextMenu, onNodeDoubleClick, onNodeDragStart, onNodeDrag, onNodeDragStop, onNodesDelete, onEdgesDelete, onDelete, onSelectionChange, onSelectionDragStart, onSelectionDrag, onSelectionDragStop, onSelectionContextMenu, onSelectionStart, onSelectionEnd, onBeforeDelete, connectionMode, connectionLineType = ConnectionLineType.Bezier, connectionLineStyle, connectionLineComponent, connectionLineContainerStyle, deleteKeyCode = 'Backspace', selectionKeyCode = 'Shift', selectionOnDrag = false, selectionMode = SelectionMode.Full, panActivationKeyCode = 'Space', multiSelectionKeyCode = isMacOs() ? 'Meta' : 'Control', zoomActivationKeyCode = isMacOs() ? 'Meta' : 'Control', snapToGrid, snapGrid, onlyRenderVisibleElements = false, selectNodesOnDrag, nodesDraggable, autoPanOnNodeFocus, nodesConnectable, nodesFocusable, nodeOrigin = defaultNodeOrigin, edgesFocusable, edgesReconnectable, elementsSelectable = true, defaultViewport: defaultViewport$1 = defaultViewport, minZoom = 0.5, maxZoom = 2, translateExtent = infiniteExtent, preventScrolling = true, nodeExtent, defaultMarkerColor = '#b1b1b7', zoomOnScroll = true, zoomOnPinch = true, panOnScroll = false, panOnScrollSpeed = 0.5, panOnScrollMode = PanOnScrollMode.Free, zoomOnDoubleClick = true, panOnDrag = true, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneScroll, onPaneContextMenu, paneClickDistance = 0, nodeClickDistance = 0, children, onReconnect, onReconnectStart, onReconnectEnd, onEdgeContextMenu, onEdgeDoubleClick, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, reconnectRadius = 10, onNodesChange, onEdgesChange, noDragClassName = 'nodrag', noWheelClassName = 'nowheel', noPanClassName = 'nopan', fitView, fitViewOptions, connectOnClick, attributionPosition, proOptions, defaultEdgeOptions, elevateNodesOnSelect, elevateEdgesOnSelect, disableKeyboardA11y = false, autoPanOnConnect, autoPanOnNodeDrag, autoPanSpeed, connectionRadius, isValidConnection, onError, style, id, nodeDragThreshold, viewport, onViewportChange, width, height, colorMode = 'light', debug, onScroll, ariaLabelConfig, ...rest }, ref) { + const rfId = id || '1'; + const colorModeClassName = useColorModeClass(colorMode); + // Undo scroll events, preventing viewport from shifting when nodes outside of it are focused + const wrapperOnScroll = useCallback((e) => { + e.currentTarget.scrollTo({ top: 0, left: 0, behavior: 'instant' }); + onScroll?.(e); + }, [onScroll]); + return (jsx("div", { "data-testid": "rf__wrapper", ...rest, onScroll: wrapperOnScroll, style: { ...style, ...wrapperStyle }, ref: ref, className: cc(['react-flow', className, colorModeClassName]), id: id, role: "application", children: jsxs(Wrapper, { nodes: nodes, edges: edges, width: width, height: height, fitView: fitView, fitViewOptions: fitViewOptions, minZoom: minZoom, maxZoom: maxZoom, nodeOrigin: nodeOrigin, nodeExtent: nodeExtent, children: [jsx(GraphView, { onInit: onInit, onNodeClick: onNodeClick, onEdgeClick: onEdgeClick, onNodeMouseEnter: onNodeMouseEnter, onNodeMouseMove: onNodeMouseMove, onNodeMouseLeave: onNodeMouseLeave, onNodeContextMenu: onNodeContextMenu, onNodeDoubleClick: onNodeDoubleClick, nodeTypes: nodeTypes, edgeTypes: edgeTypes, connectionLineType: connectionLineType, connectionLineStyle: connectionLineStyle, connectionLineComponent: connectionLineComponent, connectionLineContainerStyle: connectionLineContainerStyle, selectionKeyCode: selectionKeyCode, selectionOnDrag: selectionOnDrag, selectionMode: selectionMode, deleteKeyCode: deleteKeyCode, multiSelectionKeyCode: multiSelectionKeyCode, panActivationKeyCode: panActivationKeyCode, zoomActivationKeyCode: zoomActivationKeyCode, onlyRenderVisibleElements: onlyRenderVisibleElements, defaultViewport: defaultViewport$1, translateExtent: translateExtent, minZoom: minZoom, maxZoom: maxZoom, preventScrolling: preventScrolling, zoomOnScroll: zoomOnScroll, zoomOnPinch: zoomOnPinch, zoomOnDoubleClick: zoomOnDoubleClick, panOnScroll: panOnScroll, panOnScrollSpeed: panOnScrollSpeed, panOnScrollMode: panOnScrollMode, panOnDrag: panOnDrag, onPaneClick: onPaneClick, onPaneMouseEnter: onPaneMouseEnter, onPaneMouseMove: onPaneMouseMove, onPaneMouseLeave: onPaneMouseLeave, onPaneScroll: onPaneScroll, onPaneContextMenu: onPaneContextMenu, paneClickDistance: paneClickDistance, nodeClickDistance: nodeClickDistance, onSelectionContextMenu: onSelectionContextMenu, onSelectionStart: onSelectionStart, onSelectionEnd: onSelectionEnd, onReconnect: onReconnect, onReconnectStart: onReconnectStart, onReconnectEnd: onReconnectEnd, onEdgeContextMenu: onEdgeContextMenu, onEdgeDoubleClick: onEdgeDoubleClick, onEdgeMouseEnter: onEdgeMouseEnter, onEdgeMouseMove: onEdgeMouseMove, onEdgeMouseLeave: onEdgeMouseLeave, reconnectRadius: reconnectRadius, defaultMarkerColor: defaultMarkerColor, noDragClassName: noDragClassName, noWheelClassName: noWheelClassName, noPanClassName: noPanClassName, rfId: rfId, disableKeyboardA11y: disableKeyboardA11y, nodeExtent: nodeExtent, viewport: viewport, onViewportChange: onViewportChange }), jsx(StoreUpdater, { nodes: nodes, edges: edges, defaultNodes: defaultNodes, defaultEdges: defaultEdges, onConnect: onConnect, onConnectStart: onConnectStart, onConnectEnd: onConnectEnd, onClickConnectStart: onClickConnectStart, onClickConnectEnd: onClickConnectEnd, nodesDraggable: nodesDraggable, autoPanOnNodeFocus: autoPanOnNodeFocus, nodesConnectable: nodesConnectable, nodesFocusable: nodesFocusable, edgesFocusable: edgesFocusable, edgesReconnectable: edgesReconnectable, elementsSelectable: elementsSelectable, elevateNodesOnSelect: elevateNodesOnSelect, elevateEdgesOnSelect: elevateEdgesOnSelect, minZoom: minZoom, maxZoom: maxZoom, nodeExtent: nodeExtent, onNodesChange: onNodesChange, onEdgesChange: onEdgesChange, snapToGrid: snapToGrid, snapGrid: snapGrid, connectionMode: connectionMode, translateExtent: translateExtent, connectOnClick: connectOnClick, defaultEdgeOptions: defaultEdgeOptions, fitView: fitView, fitViewOptions: fitViewOptions, onNodesDelete: onNodesDelete, onEdgesDelete: onEdgesDelete, onDelete: onDelete, onNodeDragStart: onNodeDragStart, onNodeDrag: onNodeDrag, onNodeDragStop: onNodeDragStop, onSelectionDrag: onSelectionDrag, onSelectionDragStart: onSelectionDragStart, onSelectionDragStop: onSelectionDragStop, onMove: onMove, onMoveStart: onMoveStart, onMoveEnd: onMoveEnd, noPanClassName: noPanClassName, nodeOrigin: nodeOrigin, rfId: rfId, autoPanOnConnect: autoPanOnConnect, autoPanOnNodeDrag: autoPanOnNodeDrag, autoPanSpeed: autoPanSpeed, onError: onError, connectionRadius: connectionRadius, isValidConnection: isValidConnection, selectNodesOnDrag: selectNodesOnDrag, nodeDragThreshold: nodeDragThreshold, onBeforeDelete: onBeforeDelete, paneClickDistance: paneClickDistance, debug: debug, ariaLabelConfig: ariaLabelConfig }), jsx(SelectionListener, { onSelectionChange: onSelectionChange }), children, jsx(Attribution, { proOptions: proOptions, position: attributionPosition }), jsx(A11yDescriptions, { rfId: rfId, disableKeyboardA11y: disableKeyboardA11y })] }) })); +} +/** + * The `` component is the heart of your React Flow application. + * It renders your nodes and edges and handles user interaction + * + * @public + * + * @example + * ```tsx + *import { ReactFlow } from '@xyflow/react' + * + *export default function Flow() { + * return (); + *} + *``` + */ +var index = fixedForwardRef(ReactFlow); + +const selector$6 = (s) => s.domNode?.querySelector('.react-flow__edgelabel-renderer'); +/** + * Edges are SVG-based. If you want to render more complex labels you can use the + * `` component to access a div based renderer. This component + * is a portal that renders the label in a `
` that is positioned on top of + * the edges. You can see an example usage of the component in the + * [edge label renderer example](/examples/edges/edge-label-renderer). + * @public + * + * @example + * ```jsx + * import React from 'react'; + * import { getBezierPath, EdgeLabelRenderer, BaseEdge } from '@xyflow/react'; + * + * export function CustomEdge({ id, data, ...props }) { + * const [edgePath, labelX, labelY] = getBezierPath(props); + * + * return ( + * <> + * + * + *
+ * {data.label} + *
+ *
+ * + * ); + * }; + * ``` + * + * @remarks The `` has no pointer events by default. If you want to + * add mouse interactions you need to set the style `pointerEvents: all` and add + * the `nopan` class on the label or the element you want to interact with. + */ +function EdgeLabelRenderer({ children }) { + const edgeLabelRenderer = useStore(selector$6); + if (!edgeLabelRenderer) { + return null; + } + return createPortal(children, edgeLabelRenderer); +} + +const selector$5 = (s) => s.domNode?.querySelector('.react-flow__viewport-portal'); +/** + * The `` component can be used to add components to the same viewport + * of the flow where nodes and edges are rendered. This is useful when you want to render + * your own components that are adhere to the same coordinate system as the nodes & edges + * and are also affected by zooming and panning + * @public + * @example + * + * ```jsx + *import React from 'react'; + *import { ViewportPortal } from '@xyflow/react'; + * + *export default function () { + * return ( + * + *
+ * This div is positioned at [100, 100] on the flow. + *
+ *
+ * ); + *} + *``` + */ +function ViewportPortal({ children }) { + const viewPortalDiv = useStore(selector$5); + if (!viewPortalDiv) { + return null; + } + return createPortal(children, viewPortalDiv); +} + +/** + * When you programmatically add or remove handles to a node or update a node's + * handle position, you need to let React Flow know about it using this hook. This + * will update the internal dimensions of the node and properly reposition handles + * on the canvas if necessary. + * + * @public + * @returns Use this function to tell React Flow to update the internal state of one or more nodes + * that you have changed programmatically. + * + * @example + * ```jsx + *import { useCallback, useState } from 'react'; + *import { Handle, useUpdateNodeInternals } from '@xyflow/react'; + * + *export default function RandomHandleNode({ id }) { + * const updateNodeInternals = useUpdateNodeInternals(); + * const [handleCount, setHandleCount] = useState(0); + * const randomizeHandleCount = useCallback(() => { + * setHandleCount(Math.floor(Math.random() * 10)); + * updateNodeInternals(id); + * }, [id, updateNodeInternals]); + * + * return ( + * <> + * {Array.from({ length: handleCount }).map((_, index) => ( + * + * ))} + * + *
+ * + *

There are {handleCount} handles on this node.

+ *
+ * + * ); + *} + *``` + * @remarks This hook can only be used in a component that is a child of a + *{@link ReactFlowProvider} or a {@link ReactFlow} component. + */ +function useUpdateNodeInternals() { + const store = useStoreApi(); + return useCallback((id) => { + const { domNode, updateNodeInternals } = store.getState(); + const updateIds = Array.isArray(id) ? id : [id]; + const updates = new Map(); + updateIds.forEach((updateId) => { + const nodeElement = domNode?.querySelector(`.react-flow__node[data-id="${updateId}"]`); + if (nodeElement) { + updates.set(updateId, { id: updateId, nodeElement, force: true }); + } + }); + requestAnimationFrame(() => updateNodeInternals(updates, { triggerFitView: false })); + }, []); +} + +const nodesSelector = (state) => state.nodes; +/** + * This hook returns an array of the current nodes. Components that use this hook + * will re-render **whenever any node changes**, including when a node is selected + * or moved. + * + * @public + * @returns An array of all nodes currently in the flow. + * + * @example + * ```jsx + *import { useNodes } from '@xyflow/react'; + * + *export default function() { + * const nodes = useNodes(); + * + * return
There are currently {nodes.length} nodes!
; + *} + *``` + */ +function useNodes() { + const nodes = useStore(nodesSelector, shallow); + return nodes; +} + +const edgesSelector = (state) => state.edges; +/** + * This hook returns an array of the current edges. Components that use this hook + * will re-render **whenever any edge changes**. + * + * @public + * @returns An array of all edges currently in the flow. + * + * @example + * ```tsx + *import { useEdges } from '@xyflow/react'; + * + *export default function () { + * const edges = useEdges(); + * + * return
There are currently {edges.length} edges!
; + *} + *``` + */ +function useEdges() { + const edges = useStore(edgesSelector, shallow); + return edges; +} + +const viewportSelector = (state) => ({ + x: state.transform[0], + y: state.transform[1], + zoom: state.transform[2], +}); +/** + * The `useViewport` hook is a convenient way to read the current state of the + * {@link Viewport} in a component. Components that use this hook + * will re-render **whenever the viewport changes**. + * + * @public + * @returns The current viewport. + * + * @example + * + *```jsx + *import { useViewport } from '@xyflow/react'; + * + *export default function ViewportDisplay() { + * const { x, y, zoom } = useViewport(); + * + * return ( + *
+ *

+ * The viewport is currently at ({x}, {y}) and zoomed to {zoom}. + *

+ *
+ * ); + *} + *``` + * + * @remarks This hook can only be used in a component that is a child of a + *{@link ReactFlowProvider} or a {@link ReactFlow} component. + */ +function useViewport() { + const viewport = useStore(viewportSelector, shallow); + return viewport; +} + +/** + * This hook makes it easy to prototype a controlled flow where you manage the + * state of nodes and edges outside the `ReactFlowInstance`. You can think of it + * like React's `useState` hook with an additional helper callback. + * + * @public + * @returns + * - `nodes`: The current array of nodes. You might pass this directly to the `nodes` prop of your + * `` component, or you may want to manipulate it first to perform some layouting, + * for example. + * - `setNodes`: A function that you can use to update the nodes. You can pass it a new array of + * nodes or a callback that receives the current array of nodes and returns a new array of nodes. + * This is the same as the second element of the tuple returned by React's `useState` hook. + * - `onNodesChange`: A handy callback that can take an array of `NodeChanges` and update the nodes + * state accordingly. You'll typically pass this directly to the `onNodesChange` prop of your + * `` component. + * @example + * + *```tsx + *import { ReactFlow, useNodesState, useEdgesState } from '@xyflow/react'; + * + *const initialNodes = []; + *const initialEdges = []; + * + *export default function () { + * const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes); + * const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges); + * + * return ( + * + * ); + *} + *``` + * + * @remarks This hook was created to make prototyping easier and our documentation + * examples clearer. Although it is OK to use this hook in production, in + * practice you may want to use a more sophisticated state management solution + * like Zustand {@link https://reactflow.dev/docs/guides/state-management/} instead. + * + */ +function useNodesState(initialNodes) { + const [nodes, setNodes] = useState(initialNodes); + const onNodesChange = useCallback((changes) => setNodes((nds) => applyNodeChanges(changes, nds)), []); + return [nodes, setNodes, onNodesChange]; +} +/** + * This hook makes it easy to prototype a controlled flow where you manage the + * state of nodes and edges outside the `ReactFlowInstance`. You can think of it + * like React's `useState` hook with an additional helper callback. + * + * @public + * @returns + * - `edges`: The current array of edges. You might pass this directly to the `edges` prop of your + * `` component, or you may want to manipulate it first to perform some layouting, + * for example. + * + * - `setEdges`: A function that you can use to update the edges. You can pass it a new array of + * edges or a callback that receives the current array of edges and returns a new array of edges. + * This is the same as the second element of the tuple returned by React's `useState` hook. + * + * - `onEdgesChange`: A handy callback that can take an array of `EdgeChanges` and update the edges + * state accordingly. You'll typically pass this directly to the `onEdgesChange` prop of your + * `` component. + * @example + * + *```tsx + *import { ReactFlow, useNodesState, useEdgesState } from '@xyflow/react'; + * + *const initialNodes = []; + *const initialEdges = []; + * + *export default function () { + * const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes); + * const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges); + * + * return ( + * + * ); + *} + *``` + * + * @remarks This hook was created to make prototyping easier and our documentation + * examples clearer. Although it is OK to use this hook in production, in + * practice you may want to use a more sophisticated state management solution + * like Zustand {@link https://reactflow.dev/docs/guides/state-management/} instead. + * + */ +function useEdgesState(initialEdges) { + const [edges, setEdges] = useState(initialEdges); + const onEdgesChange = useCallback((changes) => setEdges((eds) => applyEdgeChanges(changes, eds)), []); + return [edges, setEdges, onEdgesChange]; +} + +/** + * The `useOnViewportChange` hook lets you listen for changes to the viewport such + * as panning and zooming. You can provide a callback for each phase of a viewport + * change: `onStart`, `onChange`, and `onEnd`. + * + * @public + * @example + * ```jsx + *import { useCallback } from 'react'; + *import { useOnViewportChange } from '@xyflow/react'; + * + *function ViewportChangeLogger() { + * useOnViewportChange({ + * onStart: (viewport: Viewport) => console.log('start', viewport), + * onChange: (viewport: Viewport) => console.log('change', viewport), + * onEnd: (viewport: Viewport) => console.log('end', viewport), + * }); + * + * return null; + *} + *``` + */ +function useOnViewportChange({ onStart, onChange, onEnd }) { + const store = useStoreApi(); + useEffect(() => { + store.setState({ onViewportChangeStart: onStart }); + }, [onStart]); + useEffect(() => { + store.setState({ onViewportChange: onChange }); + }, [onChange]); + useEffect(() => { + store.setState({ onViewportChangeEnd: onEnd }); + }, [onEnd]); +} + +/** + * This hook lets you listen for changes to both node and edge selection. As the + *name implies, the callback you provide will be called whenever the selection of + *_either_ nodes or edges changes. + * + * @public + * @example + * ```jsx + *import { useState } from 'react'; + *import { ReactFlow, useOnSelectionChange } from '@xyflow/react'; + * + *function SelectionDisplay() { + * const [selectedNodes, setSelectedNodes] = useState([]); + * const [selectedEdges, setSelectedEdges] = useState([]); + * + * // the passed handler has to be memoized, otherwise the hook will not work correctly + * const onChange = useCallback(({ nodes, edges }) => { + * setSelectedNodes(nodes.map((node) => node.id)); + * setSelectedEdges(edges.map((edge) => edge.id)); + * }, []); + * + * useOnSelectionChange({ + * onChange, + * }); + * + * return ( + *
+ *

Selected nodes: {selectedNodes.join(', ')}

+ *

Selected edges: {selectedEdges.join(', ')}

+ *
+ * ); + *} + *``` + * + * @remarks You need to memoize the passed `onChange` handler, otherwise the hook will not work correctly. + */ +function useOnSelectionChange({ onChange, }) { + const store = useStoreApi(); + useEffect(() => { + const nextOnSelectionChangeHandlers = [...store.getState().onSelectionChangeHandlers, onChange]; + store.setState({ onSelectionChangeHandlers: nextOnSelectionChangeHandlers }); + return () => { + const nextHandlers = store.getState().onSelectionChangeHandlers.filter((fn) => fn !== onChange); + store.setState({ onSelectionChangeHandlers: nextHandlers }); + }; + }, [onChange]); +} + +const selector$4 = (options) => (s) => { + if (!options.includeHiddenNodes) { + return s.nodesInitialized; + } + if (s.nodeLookup.size === 0) { + return false; + } + for (const [, { internals }] of s.nodeLookup) { + if (internals.handleBounds === undefined || !nodeHasDimensions(internals.userNode)) { + return false; + } + } + return true; +}; +/** + * This hook tells you whether all the nodes in a flow have been measured and given + *a width and height. When you add a node to the flow, this hook will return + *`false` and then `true` again once the node has been measured. + * + * @public + * @returns Whether or not the nodes have been initialized by the `` component and + * given a width and height. + * + * @example + * ```jsx + *import { useReactFlow, useNodesInitialized } from '@xyflow/react'; + *import { useEffect, useState } from 'react'; + * + *const options = { + * includeHiddenNodes: false, + *}; + * + *export default function useLayout() { + * const { getNodes } = useReactFlow(); + * const nodesInitialized = useNodesInitialized(options); + * const [layoutedNodes, setLayoutedNodes] = useState(getNodes()); + * + * useEffect(() => { + * if (nodesInitialized) { + * setLayoutedNodes(yourLayoutingFunction(getNodes())); + * } + * }, [nodesInitialized]); + * + * return layoutedNodes; + *} + *``` + */ +function useNodesInitialized(options = { + includeHiddenNodes: false, +}) { + const initialized = useStore(selector$4(options)); + return initialized; +} + +/** + * Hook to check if a is connected to another and get the connections. + * + * @public + * @deprecated Use `useNodeConnections` instead. + * @returns An array with handle connections. + */ +function useHandleConnections({ type, id, nodeId, onConnect, onDisconnect, }) { + console.warn('[DEPRECATED] `useHandleConnections` is deprecated. Instead use `useNodeConnections` https://reactflow.dev/api-reference/hooks/useNodeConnections'); + const _nodeId = useNodeId(); + const currentNodeId = nodeId ?? _nodeId; + const prevConnections = useRef(null); + const connections = useStore((state) => state.connectionLookup.get(`${currentNodeId}-${type}${id ? `-${id}` : ''}`), areConnectionMapsEqual); + useEffect(() => { + // @todo dicuss if onConnect/onDisconnect should be called when the component mounts/unmounts + if (prevConnections.current && prevConnections.current !== connections) { + const _connections = connections ?? new Map(); + handleConnectionChange(prevConnections.current, _connections, onDisconnect); + handleConnectionChange(_connections, prevConnections.current, onConnect); + } + prevConnections.current = connections ?? new Map(); + }, [connections, onConnect, onDisconnect]); + return useMemo(() => Array.from(connections?.values() ?? []), [connections]); +} + +const error014 = errorMessages['error014'](); +/** + * This hook returns an array of connections on a specific node, handle type ('source', 'target') or handle ID. + * + * @public + * @returns An array with connections. + * + * @example + * ```jsx + *import { useNodeConnections } from '@xyflow/react'; + * + *export default function () { + * const connections = useNodeConnections({ + * handleType: 'target', + * handleId: 'my-handle', + * }); + * + * return ( + *
There are currently {connections.length} incoming connections!
+ * ); + *} + *``` + */ +function useNodeConnections({ id, handleType, handleId, onConnect, onDisconnect, } = {}) { + const nodeId = useNodeId(); + const currentNodeId = id ?? nodeId; + if (!currentNodeId) { + throw new Error(error014); + } + const prevConnections = useRef(null); + const connections = useStore((state) => state.connectionLookup.get(`${currentNodeId}${handleType ? (handleId ? `-${handleType}-${handleId}` : `-${handleType}`) : ''}`), areConnectionMapsEqual); + useEffect(() => { + // @todo discuss if onConnect/onDisconnect should be called when the component mounts/unmounts + if (prevConnections.current && prevConnections.current !== connections) { + const _connections = connections ?? new Map(); + handleConnectionChange(prevConnections.current, _connections, onDisconnect); + handleConnectionChange(_connections, prevConnections.current, onConnect); + } + prevConnections.current = connections ?? new Map(); + }, [connections, onConnect, onDisconnect]); + return useMemo(() => Array.from(connections?.values() ?? []), [connections]); +} + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function useNodesData(nodeIds) { + const nodesData = useStore(useCallback((s) => { + const data = []; + const isArrayOfIds = Array.isArray(nodeIds); + const _nodeIds = isArrayOfIds ? nodeIds : [nodeIds]; + for (const nodeId of _nodeIds) { + const node = s.nodeLookup.get(nodeId); + if (node) { + data.push({ + id: node.id, + type: node.type, + data: node.data, + }); + } + } + return isArrayOfIds ? data : data[0] ?? null; + }, [nodeIds]), shallowNodeData); + return nodesData; +} + +/** + * This hook returns the internal representation of a specific node. + * Components that use this hook will re-render **whenever the node changes**, + * including when a node is selected or moved. + * + * @public + * @param id - The ID of a node you want to observe. + * @returns The `InternalNode` object for the node with the given ID. + * + * @example + * ```tsx + *import { useInternalNode } from '@xyflow/react'; + * + *export default function () { + * const internalNode = useInternalNode('node-1'); + * const absolutePosition = internalNode.internals.positionAbsolute; + * + * return ( + *
+ * The absolute position of the node is at: + *

x: {absolutePosition.x}

+ *

y: {absolutePosition.y}

+ *
+ * ); + *} + *``` + */ +function useInternalNode(id) { + const node = useStore(useCallback((s) => s.nodeLookup.get(id), [id]), shallow); + return node; +} + +function LinePattern({ dimensions, lineWidth, variant, className }) { + return (jsx("path", { strokeWidth: lineWidth, d: `M${dimensions[0] / 2} 0 V${dimensions[1]} M0 ${dimensions[1] / 2} H${dimensions[0]}`, className: cc(['react-flow__background-pattern', variant, className]) })); +} +function DotPattern({ radius, className }) { + return (jsx("circle", { cx: radius, cy: radius, r: radius, className: cc(['react-flow__background-pattern', 'dots', className]) })); +} + +/** + * The three variants are exported as an enum for convenience. You can either import + * the enum and use it like `BackgroundVariant.Lines` or you can use the raw string + * value directly. + * @public + */ +var BackgroundVariant; +(function (BackgroundVariant) { + BackgroundVariant["Lines"] = "lines"; + BackgroundVariant["Dots"] = "dots"; + BackgroundVariant["Cross"] = "cross"; +})(BackgroundVariant || (BackgroundVariant = {})); + +const defaultSize = { + [BackgroundVariant.Dots]: 1, + [BackgroundVariant.Lines]: 1, + [BackgroundVariant.Cross]: 6, +}; +const selector$3 = (s) => ({ transform: s.transform, patternId: `pattern-${s.rfId}` }); +function BackgroundComponent({ id, variant = BackgroundVariant.Dots, +// only used for dots and cross +gap = 20, +// only used for lines and cross +size, lineWidth = 1, offset = 0, color, bgColor, style, className, patternClassName, }) { + const ref = useRef(null); + const { transform, patternId } = useStore(selector$3, shallow); + const patternSize = size || defaultSize[variant]; + const isDots = variant === BackgroundVariant.Dots; + const isCross = variant === BackgroundVariant.Cross; + const gapXY = Array.isArray(gap) ? gap : [gap, gap]; + const scaledGap = [gapXY[0] * transform[2] || 1, gapXY[1] * transform[2] || 1]; + const scaledSize = patternSize * transform[2]; + const offsetXY = Array.isArray(offset) ? offset : [offset, offset]; + const patternDimensions = isCross ? [scaledSize, scaledSize] : scaledGap; + const scaledOffset = [ + offsetXY[0] * transform[2] || 1 + patternDimensions[0] / 2, + offsetXY[1] * transform[2] || 1 + patternDimensions[1] / 2, + ]; + const _patternId = `${patternId}${id ? id : ''}`; + return (jsxs("svg", { className: cc(['react-flow__background', className]), style: { + ...style, + ...containerStyle, + '--xy-background-color-props': bgColor, + '--xy-background-pattern-color-props': color, + }, ref: ref, "data-testid": "rf__background", children: [jsx("pattern", { id: _patternId, x: transform[0] % scaledGap[0], y: transform[1] % scaledGap[1], width: scaledGap[0], height: scaledGap[1], patternUnits: "userSpaceOnUse", patternTransform: `translate(-${scaledOffset[0]},-${scaledOffset[1]})`, children: isDots ? (jsx(DotPattern, { radius: scaledSize / 2, className: patternClassName })) : (jsx(LinePattern, { dimensions: patternDimensions, lineWidth: lineWidth, variant: variant, className: patternClassName })) }), jsx("rect", { x: "0", y: "0", width: "100%", height: "100%", fill: `url(#${_patternId})` })] })); +} +BackgroundComponent.displayName = 'Background'; +/** + * The `` component makes it convenient to render different types of backgrounds common in node-based UIs. It comes with three variants: lines, dots and cross. + * + * @example + * + * A simple example of how to use the Background component. + * + * ```tsx + * import { useState } from 'react'; + * import { ReactFlow, Background, BackgroundVariant } from '@xyflow/react'; + * + * export default function Flow() { + * return ( + * + * + * + * ); + * } + * ``` + * + * @example + * + * In this example you can see how to combine multiple backgrounds + * + * ```tsx + * import { ReactFlow, Background, BackgroundVariant } from '@xyflow/react'; + * import '@xyflow/react/dist/style.css'; + * + * export default function Flow() { + * return ( + * + * + * + * + * ); + * } + * ``` + * + * @remarks + * + * When combining multiple components it’s important to give each of them a unique id prop! + * + */ +const Background = memo(BackgroundComponent); + +function PlusIcon() { + return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", children: jsx("path", { d: "M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z" }) })); +} + +function MinusIcon() { + return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 5", children: jsx("path", { d: "M0 0h32v4.2H0z" }) })); +} + +function FitViewIcon() { + return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 30", children: jsx("path", { d: "M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z" }) })); +} + +function LockIcon() { + return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 25 32", children: jsx("path", { d: "M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z" }) })); +} + +function UnlockIcon() { + return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 25 32", children: jsx("path", { d: "M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z" }) })); +} + +/** + * You can add buttons to the control panel by using the `` component + * and pass it as a child to the [``](/api-reference/components/controls) component. + * + * @public + * @example + *```jsx + *import { MagicWand } from '@radix-ui/react-icons' + *import { ReactFlow, Controls, ControlButton } from '@xyflow/react' + * + *export default function Flow() { + * return ( + * + * + * alert('Something magical just happened. ✨')}> + * + * + * + * + * ) + *} + *``` + */ +function ControlButton({ children, className, ...rest }) { + return (jsx("button", { type: "button", className: cc(['react-flow__controls-button', className]), ...rest, children: children })); +} + +const selector$2 = (s) => ({ + isInteractive: s.nodesDraggable || s.nodesConnectable || s.elementsSelectable, + minZoomReached: s.transform[2] <= s.minZoom, + maxZoomReached: s.transform[2] >= s.maxZoom, + ariaLabelConfig: s.ariaLabelConfig, +}); +function ControlsComponent({ style, showZoom = true, showFitView = true, showInteractive = true, fitViewOptions, onZoomIn, onZoomOut, onFitView, onInteractiveChange, className, children, position = 'bottom-left', orientation = 'vertical', 'aria-label': ariaLabel, }) { + const store = useStoreApi(); + const { isInteractive, minZoomReached, maxZoomReached, ariaLabelConfig } = useStore(selector$2, shallow); + const { zoomIn, zoomOut, fitView } = useReactFlow(); + const onZoomInHandler = () => { + zoomIn(); + onZoomIn?.(); + }; + const onZoomOutHandler = () => { + zoomOut(); + onZoomOut?.(); + }; + const onFitViewHandler = () => { + fitView(fitViewOptions); + onFitView?.(); + }; + const onToggleInteractivity = () => { + store.setState({ + nodesDraggable: !isInteractive, + nodesConnectable: !isInteractive, + elementsSelectable: !isInteractive, + }); + onInteractiveChange?.(!isInteractive); + }; + const orientationClass = orientation === 'horizontal' ? 'horizontal' : 'vertical'; + return (jsxs(Panel, { className: cc(['react-flow__controls', orientationClass, className]), position: position, style: style, "data-testid": "rf__controls", "aria-label": ariaLabel ?? ariaLabelConfig['controls.ariaLabel'], children: [showZoom && (jsxs(Fragment, { children: [jsx(ControlButton, { onClick: onZoomInHandler, className: "react-flow__controls-zoomin", title: ariaLabelConfig['controls.zoomIn.ariaLabel'], "aria-label": ariaLabelConfig['controls.zoomIn.ariaLabel'], disabled: maxZoomReached, children: jsx(PlusIcon, {}) }), jsx(ControlButton, { onClick: onZoomOutHandler, className: "react-flow__controls-zoomout", title: ariaLabelConfig['controls.zoomOut.ariaLabel'], "aria-label": ariaLabelConfig['controls.zoomOut.ariaLabel'], disabled: minZoomReached, children: jsx(MinusIcon, {}) })] })), showFitView && (jsx(ControlButton, { className: "react-flow__controls-fitview", onClick: onFitViewHandler, title: ariaLabelConfig['controls.fitView.ariaLabel'], "aria-label": ariaLabelConfig['controls.fitView.ariaLabel'], children: jsx(FitViewIcon, {}) })), showInteractive && (jsx(ControlButton, { className: "react-flow__controls-interactive", onClick: onToggleInteractivity, title: ariaLabelConfig['controls.interactive.ariaLabel'], "aria-label": ariaLabelConfig['controls.interactive.ariaLabel'], children: isInteractive ? jsx(UnlockIcon, {}) : jsx(LockIcon, {}) })), children] })); +} +ControlsComponent.displayName = 'Controls'; +/** + * The `` component renders a small panel that contains convenient + * buttons to zoom in, zoom out, fit the view, and lock the viewport. + * + * @public + * @example + *```tsx + *import { ReactFlow, Controls } from '@xyflow/react' + * + *export default function Flow() { + * return ( + * + * + * + * ) + *} + *``` + * + * @remarks To extend or customise the controls, you can use the [``](/api-reference/components/control-button) component + * + */ +const Controls = memo(ControlsComponent); + +function MiniMapNodeComponent({ id, x, y, width, height, style, color, strokeColor, strokeWidth, className, borderRadius, shapeRendering, selected, onClick, }) { + const { background, backgroundColor } = style || {}; + const fill = (color || background || backgroundColor); + return (jsx("rect", { className: cc(['react-flow__minimap-node', { selected }, className]), x: x, y: y, rx: borderRadius, ry: borderRadius, width: width, height: height, style: { + fill, + stroke: strokeColor, + strokeWidth, + }, shapeRendering: shapeRendering, onClick: onClick ? (event) => onClick(event, id) : undefined })); +} +const MiniMapNode = memo(MiniMapNodeComponent); + +const selectorNodeIds = (s) => s.nodes.map((node) => node.id); +const getAttrFunction = (func) => func instanceof Function ? func : () => func; +function MiniMapNodes({ nodeStrokeColor, nodeColor, nodeClassName = '', nodeBorderRadius = 5, nodeStrokeWidth, +/* + * We need to rename the prop to be `CapitalCase` so that JSX will render it as + * a component properly. + */ +nodeComponent: NodeComponent = MiniMapNode, onClick, }) { + const nodeIds = useStore(selectorNodeIds, shallow); + const nodeColorFunc = getAttrFunction(nodeColor); + const nodeStrokeColorFunc = getAttrFunction(nodeStrokeColor); + const nodeClassNameFunc = getAttrFunction(nodeClassName); + const shapeRendering = typeof window === 'undefined' || !!window.chrome ? 'crispEdges' : 'geometricPrecision'; + return (jsx(Fragment, { children: nodeIds.map((nodeId) => ( + /* + * The split of responsibilities between MiniMapNodes and + * NodeComponentWrapper may appear weird. However, it’s designed to + * minimize the cost of updates when individual nodes change. + * + * For more details, see a similar commit in `NodeRenderer/index.tsx`. + */ + jsx(NodeComponentWrapper, { id: nodeId, nodeColorFunc: nodeColorFunc, nodeStrokeColorFunc: nodeStrokeColorFunc, nodeClassNameFunc: nodeClassNameFunc, nodeBorderRadius: nodeBorderRadius, nodeStrokeWidth: nodeStrokeWidth, NodeComponent: NodeComponent, onClick: onClick, shapeRendering: shapeRendering }, nodeId))) })); +} +function NodeComponentWrapperInner({ id, nodeColorFunc, nodeStrokeColorFunc, nodeClassNameFunc, nodeBorderRadius, nodeStrokeWidth, shapeRendering, NodeComponent, onClick, }) { + const { node, x, y, width, height } = useStore((s) => { + const { internals } = s.nodeLookup.get(id); + const node = internals.userNode; + const { x, y } = internals.positionAbsolute; + const { width, height } = getNodeDimensions(node); + return { + node, + x, + y, + width, + height, + }; + }, shallow); + if (!node || node.hidden || !nodeHasDimensions(node)) { + return null; + } + return (jsx(NodeComponent, { x: x, y: y, width: width, height: height, style: node.style, selected: !!node.selected, className: nodeClassNameFunc(node), color: nodeColorFunc(node), borderRadius: nodeBorderRadius, strokeColor: nodeStrokeColorFunc(node), strokeWidth: nodeStrokeWidth, shapeRendering: shapeRendering, onClick: onClick, id: node.id })); +} +const NodeComponentWrapper = memo(NodeComponentWrapperInner); +var MiniMapNodes$1 = memo(MiniMapNodes); + +const defaultWidth = 200; +const defaultHeight = 150; +const filterHidden = (node) => !node.hidden; +const selector$1 = (s) => { + const viewBB = { + x: -s.transform[0] / s.transform[2], + y: -s.transform[1] / s.transform[2], + width: s.width / s.transform[2], + height: s.height / s.transform[2], + }; + return { + viewBB, + boundingRect: s.nodeLookup.size > 0 + ? getBoundsOfRects(getInternalNodesBounds(s.nodeLookup, { filter: filterHidden }), viewBB) + : viewBB, + rfId: s.rfId, + panZoom: s.panZoom, + translateExtent: s.translateExtent, + flowWidth: s.width, + flowHeight: s.height, + ariaLabelConfig: s.ariaLabelConfig, + }; +}; +const ARIA_LABEL_KEY = 'react-flow__minimap-desc'; +function MiniMapComponent({ style, className, nodeStrokeColor, nodeColor, nodeClassName = '', nodeBorderRadius = 5, nodeStrokeWidth, +/* + * We need to rename the prop to be `CapitalCase` so that JSX will render it as + * a component properly. + */ +nodeComponent, bgColor, maskColor, maskStrokeColor, maskStrokeWidth, position = 'bottom-right', onClick, onNodeClick, pannable = false, zoomable = false, ariaLabel, inversePan, zoomStep = 10, offsetScale = 5, }) { + const store = useStoreApi(); + const svg = useRef(null); + const { boundingRect, viewBB, rfId, panZoom, translateExtent, flowWidth, flowHeight, ariaLabelConfig } = useStore(selector$1, shallow); + const elementWidth = style?.width ?? defaultWidth; + const elementHeight = style?.height ?? defaultHeight; + const scaledWidth = boundingRect.width / elementWidth; + const scaledHeight = boundingRect.height / elementHeight; + const viewScale = Math.max(scaledWidth, scaledHeight); + const viewWidth = viewScale * elementWidth; + const viewHeight = viewScale * elementHeight; + const offset = offsetScale * viewScale; + const x = boundingRect.x - (viewWidth - boundingRect.width) / 2 - offset; + const y = boundingRect.y - (viewHeight - boundingRect.height) / 2 - offset; + const width = viewWidth + offset * 2; + const height = viewHeight + offset * 2; + const labelledBy = `${ARIA_LABEL_KEY}-${rfId}`; + const viewScaleRef = useRef(0); + const minimapInstance = useRef(); + viewScaleRef.current = viewScale; + useEffect(() => { + if (svg.current && panZoom) { + minimapInstance.current = XYMinimap({ + domNode: svg.current, + panZoom, + getTransform: () => store.getState().transform, + getViewScale: () => viewScaleRef.current, + }); + return () => { + minimapInstance.current?.destroy(); + }; + } + }, [panZoom]); + useEffect(() => { + minimapInstance.current?.update({ + translateExtent, + width: flowWidth, + height: flowHeight, + inversePan, + pannable, + zoomStep, + zoomable, + }); + }, [pannable, zoomable, inversePan, zoomStep, translateExtent, flowWidth, flowHeight]); + const onSvgClick = onClick + ? (event) => { + const [x, y] = minimapInstance.current?.pointer(event) || [0, 0]; + onClick(event, { x, y }); + } + : undefined; + const onSvgNodeClick = onNodeClick + ? useCallback((event, nodeId) => { + const node = store.getState().nodeLookup.get(nodeId).internals.userNode; + onNodeClick(event, node); + }, []) + : undefined; + const _ariaLabel = ariaLabel ?? ariaLabelConfig['minimap.ariaLabel']; + return (jsx(Panel, { position: position, style: { + ...style, + '--xy-minimap-background-color-props': typeof bgColor === 'string' ? bgColor : undefined, + '--xy-minimap-mask-background-color-props': typeof maskColor === 'string' ? maskColor : undefined, + '--xy-minimap-mask-stroke-color-props': typeof maskStrokeColor === 'string' ? maskStrokeColor : undefined, + '--xy-minimap-mask-stroke-width-props': typeof maskStrokeWidth === 'number' ? maskStrokeWidth * viewScale : undefined, + '--xy-minimap-node-background-color-props': typeof nodeColor === 'string' ? nodeColor : undefined, + '--xy-minimap-node-stroke-color-props': typeof nodeStrokeColor === 'string' ? nodeStrokeColor : undefined, + '--xy-minimap-node-stroke-width-props': typeof nodeStrokeWidth === 'number' ? nodeStrokeWidth : undefined, + }, className: cc(['react-flow__minimap', className]), "data-testid": "rf__minimap", children: jsxs("svg", { width: elementWidth, height: elementHeight, viewBox: `${x} ${y} ${width} ${height}`, className: "react-flow__minimap-svg", role: "img", "aria-labelledby": labelledBy, ref: svg, onClick: onSvgClick, children: [_ariaLabel && jsx("title", { id: labelledBy, children: _ariaLabel }), jsx(MiniMapNodes$1, { onClick: onSvgNodeClick, nodeColor: nodeColor, nodeStrokeColor: nodeStrokeColor, nodeBorderRadius: nodeBorderRadius, nodeClassName: nodeClassName, nodeStrokeWidth: nodeStrokeWidth, nodeComponent: nodeComponent }), jsx("path", { className: "react-flow__minimap-mask", d: `M${x - offset},${y - offset}h${width + offset * 2}v${height + offset * 2}h${-width - offset * 2}z + M${viewBB.x},${viewBB.y}h${viewBB.width}v${viewBB.height}h${-viewBB.width}z`, fillRule: "evenodd", pointerEvents: "none" })] }) })); +} +MiniMapComponent.displayName = 'MiniMap'; +/** + * The `` component can be used to render an overview of your flow. It + * renders each node as an SVG element and visualizes where the current viewport is + * in relation to the rest of the flow. + * + * @public + * @example + * + * ```jsx + *import { ReactFlow, MiniMap } from '@xyflow/react'; + * + *export default function Flow() { + * return ( + * + * + * + * ); + *} + *``` + */ +const MiniMap = memo(MiniMapComponent); + +const scaleSelector = (calculateScale) => (store) => calculateScale ? `${Math.max(1 / store.transform[2], 1)}` : undefined; +const defaultPositions = { + [ResizeControlVariant.Line]: 'right', + [ResizeControlVariant.Handle]: 'bottom-right', +}; +function ResizeControl({ nodeId, position, variant = ResizeControlVariant.Handle, className, style = undefined, children, color, minWidth = 10, minHeight = 10, maxWidth = Number.MAX_VALUE, maxHeight = Number.MAX_VALUE, keepAspectRatio = false, resizeDirection, autoScale = true, shouldResize, onResizeStart, onResize, onResizeEnd, }) { + const contextNodeId = useNodeId(); + const id = typeof nodeId === 'string' ? nodeId : contextNodeId; + const store = useStoreApi(); + const resizeControlRef = useRef(null); + const isHandleControl = variant === ResizeControlVariant.Handle; + const scale = useStore(useCallback(scaleSelector(isHandleControl && autoScale), [isHandleControl, autoScale]), shallow); + const resizer = useRef(null); + const controlPosition = position ?? defaultPositions[variant]; + useEffect(() => { + if (!resizeControlRef.current || !id) { + return; + } + if (!resizer.current) { + resizer.current = XYResizer({ + domNode: resizeControlRef.current, + nodeId: id, + getStoreItems: () => { + const { nodeLookup, transform, snapGrid, snapToGrid, nodeOrigin, domNode } = store.getState(); + return { + nodeLookup, + transform, + snapGrid, + snapToGrid, + nodeOrigin, + paneDomNode: domNode, + }; + }, + onChange: (change, childChanges) => { + const { triggerNodeChanges, nodeLookup, parentLookup, nodeOrigin } = store.getState(); + const changes = []; + const nextPosition = { x: change.x, y: change.y }; + const node = nodeLookup.get(id); + if (node && node.expandParent && node.parentId) { + const origin = node.origin ?? nodeOrigin; + const width = change.width ?? node.measured.width ?? 0; + const height = change.height ?? node.measured.height ?? 0; + const child = { + id: node.id, + parentId: node.parentId, + rect: { + width, + height, + ...evaluateAbsolutePosition({ + x: change.x ?? node.position.x, + y: change.y ?? node.position.y, + }, { width, height }, node.parentId, nodeLookup, origin), + }, + }; + const parentExpandChanges = handleExpandParent([child], nodeLookup, parentLookup, nodeOrigin); + changes.push(...parentExpandChanges); + /* + * when the parent was expanded by the child node, its position will be clamped at + * 0,0 when node origin is 0,0 and to width, height if it's 1,1 + */ + nextPosition.x = change.x ? Math.max(origin[0] * width, change.x) : undefined; + nextPosition.y = change.y ? Math.max(origin[1] * height, change.y) : undefined; + } + if (nextPosition.x !== undefined && nextPosition.y !== undefined) { + const positionChange = { + id, + type: 'position', + position: { ...nextPosition }, + }; + changes.push(positionChange); + } + if (change.width !== undefined && change.height !== undefined) { + const setAttributes = !resizeDirection ? true : resizeDirection === 'horizontal' ? 'width' : 'height'; + const dimensionChange = { + id, + type: 'dimensions', + resizing: true, + setAttributes, + dimensions: { + width: change.width, + height: change.height, + }, + }; + changes.push(dimensionChange); + } + for (const childChange of childChanges) { + const positionChange = { + ...childChange, + type: 'position', + }; + changes.push(positionChange); + } + triggerNodeChanges(changes); + }, + onEnd: ({ width, height }) => { + const dimensionChange = { + id: id, + type: 'dimensions', + resizing: false, + dimensions: { + width, + height, + }, + }; + store.getState().triggerNodeChanges([dimensionChange]); + }, + }); + } + resizer.current.update({ + controlPosition, + boundaries: { + minWidth, + minHeight, + maxWidth, + maxHeight, + }, + keepAspectRatio, + resizeDirection, + onResizeStart, + onResize, + onResizeEnd, + shouldResize, + }); + return () => { + resizer.current?.destroy(); + }; + }, [ + controlPosition, + minWidth, + minHeight, + maxWidth, + maxHeight, + keepAspectRatio, + onResizeStart, + onResize, + onResizeEnd, + shouldResize, + ]); + const positionClassNames = controlPosition.split('-'); + return (jsx("div", { className: cc(['react-flow__resize-control', 'nodrag', ...positionClassNames, variant, className]), ref: resizeControlRef, style: { + ...style, + scale, + ...(color && { [isHandleControl ? 'backgroundColor' : 'borderColor']: color }), + }, children: children })); +} +/** + * To create your own resizing UI, you can use the `NodeResizeControl` component where you can pass children (such as icons). + * @public + * + */ +const NodeResizeControl = memo(ResizeControl); + +/** + * The `` component can be used to add a resize functionality to your + * nodes. It renders draggable controls around the node to resize in all directions. + * @public + * + * @example + *```jsx + *import { memo } from 'react'; + *import { Handle, Position, NodeResizer } from '@xyflow/react'; + * + *function ResizableNode({ data }) { + * return ( + * <> + * + * + *
{data.label}
+ * + * + * ); + *}; + * + *export default memo(ResizableNode); + *``` + */ +function NodeResizer({ nodeId, isVisible = true, handleClassName, handleStyle, lineClassName, lineStyle, color, minWidth = 10, minHeight = 10, maxWidth = Number.MAX_VALUE, maxHeight = Number.MAX_VALUE, keepAspectRatio = false, autoScale = true, shouldResize, onResizeStart, onResize, onResizeEnd, }) { + if (!isVisible) { + return null; + } + return (jsxs(Fragment, { children: [XY_RESIZER_LINE_POSITIONS.map((position) => (jsx(NodeResizeControl, { className: lineClassName, style: lineStyle, nodeId: nodeId, position: position, variant: ResizeControlVariant.Line, color: color, minWidth: minWidth, minHeight: minHeight, maxWidth: maxWidth, maxHeight: maxHeight, onResizeStart: onResizeStart, keepAspectRatio: keepAspectRatio, autoScale: autoScale, shouldResize: shouldResize, onResize: onResize, onResizeEnd: onResizeEnd }, position))), XY_RESIZER_HANDLE_POSITIONS.map((position) => (jsx(NodeResizeControl, { className: handleClassName, style: handleStyle, nodeId: nodeId, position: position, color: color, minWidth: minWidth, minHeight: minHeight, maxWidth: maxWidth, maxHeight: maxHeight, onResizeStart: onResizeStart, keepAspectRatio: keepAspectRatio, autoScale: autoScale, shouldResize: shouldResize, onResize: onResize, onResizeEnd: onResizeEnd }, position)))] })); +} + +const selector = (state) => state.domNode?.querySelector('.react-flow__renderer'); +function NodeToolbarPortal({ children }) { + const wrapperRef = useStore(selector); + if (!wrapperRef) { + return null; + } + return createPortal(children, wrapperRef); +} + +const nodeEqualityFn = (a, b) => a?.internals.positionAbsolute.x !== b?.internals.positionAbsolute.x || + a?.internals.positionAbsolute.y !== b?.internals.positionAbsolute.y || + a?.measured.width !== b?.measured.width || + a?.measured.height !== b?.measured.height || + a?.selected !== b?.selected || + a?.internals.z !== b?.internals.z; +const nodesEqualityFn = (a, b) => { + if (a.size !== b.size) { + return false; + } + for (const [key, node] of a) { + if (nodeEqualityFn(node, b.get(key))) { + return false; + } + } + return true; +}; +const storeSelector = (state) => ({ + x: state.transform[0], + y: state.transform[1], + zoom: state.transform[2], + selectedNodesCount: state.nodes.filter((node) => node.selected).length, +}); +/** + * This component can render a toolbar or tooltip to one side of a custom node. This + * toolbar doesn't scale with the viewport so that the content is always visible. + * + * @public + * @example + * ```jsx + *import { memo } from 'react'; + *import { Handle, Position, NodeToolbar } from '@xyflow/react'; + * + *function CustomNode({ data }) { + * return ( + * <> + * + * + * + * + * + * + *
+ * {data.label} + *
+ * + * + * + * + * ); + *}; + * + *export default memo(CustomNode); + *``` + * @remarks By default, the toolbar is only visible when a node is selected. If multiple + * nodes are selected it will not be visible to prevent overlapping toolbars or + * clutter. You can override this behavior by setting the `isVisible` prop to `true`. + */ +function NodeToolbar({ nodeId, children, className, style, isVisible, position = Position.Top, offset = 10, align = 'center', ...rest }) { + const contextNodeId = useNodeId(); + const nodesSelector = useCallback((state) => { + const nodeIds = Array.isArray(nodeId) ? nodeId : [nodeId || contextNodeId || '']; + const internalNodes = nodeIds.reduce((res, id) => { + const node = state.nodeLookup.get(id); + if (node) { + res.set(node.id, node); + } + return res; + }, new Map()); + return internalNodes; + }, [nodeId, contextNodeId]); + const nodes = useStore(nodesSelector, nodesEqualityFn); + const { x, y, zoom, selectedNodesCount } = useStore(storeSelector, shallow); + // if isVisible is not set, we show the toolbar only if its node is selected and no other node is selected + const isActive = typeof isVisible === 'boolean' + ? isVisible + : nodes.size === 1 && nodes.values().next().value?.selected && selectedNodesCount === 1; + if (!isActive || !nodes.size) { + return null; + } + const nodeRect = getInternalNodesBounds(nodes); + const nodesArray = Array.from(nodes.values()); + const zIndex = Math.max(...nodesArray.map((node) => node.internals.z + 1)); + const wrapperStyle = { + position: 'absolute', + transform: getNodeToolbarTransform(nodeRect, { x, y, zoom }, position, offset, align), + zIndex, + ...style, + }; + return (jsx(NodeToolbarPortal, { children: jsx("div", { style: wrapperStyle, className: cc(['react-flow__node-toolbar', className]), ...rest, "data-id": nodesArray.reduce((acc, node) => `${acc}${node.id} `, '').trim(), children: children }) })); +} + +export { Background, BackgroundVariant, BaseEdge, BezierEdge, ControlButton, Controls, EdgeLabelRenderer, EdgeText, Handle, MiniMap, NodeResizeControl, NodeResizer, NodeToolbar, Panel, index as ReactFlow, ReactFlowProvider, SimpleBezierEdge, SmoothStepEdge, StepEdge, StraightEdge, ViewportPortal, applyEdgeChanges, applyNodeChanges, getSimpleBezierPath, isEdge, isNode, useConnection, useEdges, useEdgesState, useHandleConnections, useInternalNode, useKeyPress, useNodeConnections, useNodeId, useNodes, useNodesData, useNodesInitialized, useNodesState, useOnSelectionChange, useOnViewportChange, useReactFlow, useStore, useStoreApi, useUpdateNodeInternals, useViewport }; diff --git a/node_modules/@xyflow/react/dist/esm/store/index.d.ts b/node_modules/@xyflow/react/dist/esm/store/index.d.ts new file mode 100644 index 0000000..6594c7d --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/store/index.d.ts @@ -0,0 +1,18 @@ +import { NodeOrigin, CoordinateExtent } from '@xyflow/system'; +import type { ReactFlowState, Node, Edge, FitViewOptions } from '../types'; +declare const createStore: ({ nodes, edges, defaultNodes, defaultEdges, width, height, fitView, fitViewOptions, minZoom, maxZoom, nodeOrigin, nodeExtent, }: { + nodes?: Node[]; + edges?: Edge[]; + defaultNodes?: Node[]; + defaultEdges?: Edge[]; + width?: number; + height?: number; + fitView?: boolean; + fitViewOptions?: FitViewOptions; + minZoom?: number; + maxZoom?: number; + nodeOrigin?: NodeOrigin; + nodeExtent?: CoordinateExtent; +}) => import("zustand/traditional").UseBoundStoreWithEqualityFn>; +export { createStore }; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/store/index.d.ts.map b/node_modules/@xyflow/react/dist/esm/store/index.d.ts.map new file mode 100644 index 0000000..d32299c --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/store/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":"AACA,OAAO,EAYL,UAAU,EACV,gBAAgB,EAEjB,MAAM,gBAAgB,CAAC;AAIxB,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,EAA+B,cAAc,EAAE,MAAM,UAAU,CAAC;AAExG,QAAA,MAAM,WAAW,oIAad;IACD,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;IACtB,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,UAAU,CAAC,EAAE,gBAAgB,CAAC;CAC/B,0GAyVc,CAAC;AAEhB,OAAO,EAAE,WAAW,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/store/initialState.d.ts b/node_modules/@xyflow/react/dist/esm/store/initialState.d.ts new file mode 100644 index 0000000..82c940e --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/store/initialState.d.ts @@ -0,0 +1,18 @@ +import { NodeOrigin, CoordinateExtent } from '@xyflow/system'; +import type { Edge, FitViewOptions, Node, ReactFlowStore } from '../types'; +declare const getInitialState: ({ nodes, edges, defaultNodes, defaultEdges, width, height, fitView, fitViewOptions, minZoom, maxZoom, nodeOrigin, nodeExtent, }?: { + nodes?: Node[]; + edges?: Edge[]; + defaultNodes?: Node[]; + defaultEdges?: Edge[]; + width?: number; + height?: number; + fitView?: boolean; + fitViewOptions?: FitViewOptions; + minZoom?: number; + maxZoom?: number; + nodeOrigin?: NodeOrigin; + nodeExtent?: CoordinateExtent; +}) => ReactFlowStore; +export default getInitialState; +//# sourceMappingURL=initialState.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/store/initialState.d.ts.map b/node_modules/@xyflow/react/dist/esm/store/initialState.d.ts.map new file mode 100644 index 0000000..013842a --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/store/initialState.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"initialState.d.ts","sourceRoot":"","sources":["../../src/store/initialState.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,UAAU,EAEV,gBAAgB,EAEjB,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,IAAI,EAAE,cAAc,EAAgB,IAAI,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEzF,QAAA,MAAM,eAAe,qIAalB;IACD,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;IACtB,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,UAAU,CAAC,EAAE,gBAAgB,CAAC;CAC/B,KAAQ,cAyGR,CAAC;AAEF,eAAe,eAAe,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/styles/utils.d.ts b/node_modules/@xyflow/react/dist/esm/styles/utils.d.ts new file mode 100644 index 0000000..014d140 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/styles/utils.d.ts @@ -0,0 +1,3 @@ +import type { CSSProperties } from 'react'; +export declare const containerStyle: CSSProperties; +//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/styles/utils.d.ts.map b/node_modules/@xyflow/react/dist/esm/styles/utils.d.ts.map new file mode 100644 index 0000000..b6dc952 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/styles/utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/styles/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,eAAO,MAAM,cAAc,EAAE,aAM5B,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/types/component-props.d.ts b/node_modules/@xyflow/react/dist/esm/types/component-props.d.ts new file mode 100644 index 0000000..8e53ff4 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/types/component-props.d.ts @@ -0,0 +1,634 @@ +import type { CSSProperties, HTMLAttributes, MouseEvent as ReactMouseEvent, WheelEvent } from 'react'; +import type { ConnectionMode, ConnectionLineType, OnConnect, OnConnectStart, OnConnectEnd, CoordinateExtent, KeyCode, PanOnScrollMode, ProOptions, PanelPosition, OnMove, OnMoveStart, OnMoveEnd, Viewport, NodeOrigin, HandleType, SelectionMode, OnError, ColorMode, SnapGrid, OnReconnect, AriaLabelConfig } from '@xyflow/system'; +import type { OnSelectionChangeFunc, NodeTypes, EdgeTypes, Node, Edge, ConnectionLineComponent, OnInit, DefaultEdgeOptions, FitViewOptions, OnNodesDelete, OnEdgesDelete, OnDelete, OnNodesChange, OnEdgesChange, NodeMouseHandler, SelectionDragHandler, EdgeMouseHandler, OnNodeDrag, OnBeforeDelete, IsValidConnection } from '.'; +/** + * ReactFlow component props. + * @public + */ +export interface ReactFlowProps extends Omit, 'onError'> { + /** + * An array of nodes to render in a controlled flow. + * @default [] + * @example + * const nodes = [ + * { + * id: 'node-1', + * type: 'input', + * data: { label: 'Node 1' }, + * position: { x: 250, y: 50 } + * } + * ]; + */ + nodes?: NodeType[]; + /** + * An array of edges to render in a controlled flow. + * @default [] + * @example + * const edges = [ + * { + * id: 'edge-1-2', + * source: 'node-1', + * target: 'node-2', + * } + * ]; + */ + edges?: EdgeType[]; + /** The initial nodes to render in an uncontrolled flow. */ + defaultNodes?: NodeType[]; + /** The initial edges to render in an uncontrolled flow. */ + defaultEdges?: EdgeType[]; + /** + * Defaults to be applied to all new edges that are added to the flow. + * Properties on a new edge will override these defaults if they exist. + * @example + * const defaultEdgeOptions = { + * type: 'customEdgeType', + * animated: true + * } + */ + defaultEdgeOptions?: DefaultEdgeOptions; + /** This event handler is called when a user clicks on a node. */ + onNodeClick?: NodeMouseHandler; + /** This event handler is called when a user double-clicks on a node. */ + onNodeDoubleClick?: NodeMouseHandler; + /** This event handler is called when mouse of a user enters a node. */ + onNodeMouseEnter?: NodeMouseHandler; + /** This event handler is called when mouse of a user moves over a node. */ + onNodeMouseMove?: NodeMouseHandler; + /** This event handler is called when mouse of a user leaves a node. */ + onNodeMouseLeave?: NodeMouseHandler; + /** This event handler is called when a user right-clicks on a node. */ + onNodeContextMenu?: NodeMouseHandler; + /** This event handler is called when a user starts to drag a node. */ + onNodeDragStart?: OnNodeDrag; + /** This event handler is called when a user drags a node. */ + onNodeDrag?: OnNodeDrag; + /** This event handler is called when a user stops dragging a node. */ + onNodeDragStop?: OnNodeDrag; + /** This event handler is called when a user clicks on an edge. */ + onEdgeClick?: (event: ReactMouseEvent, edge: EdgeType) => void; + /** This event handler is called when a user right-clicks on an edge. */ + onEdgeContextMenu?: EdgeMouseHandler; + /** This event handler is called when mouse of a user enters an edge. */ + onEdgeMouseEnter?: EdgeMouseHandler; + /** This event handler is called when mouse of a user moves over an edge. */ + onEdgeMouseMove?: EdgeMouseHandler; + /** This event handler is called when mouse of a user leaves an edge. */ + onEdgeMouseLeave?: EdgeMouseHandler; + /** This event handler is called when a user double-clicks on an edge. */ + onEdgeDoubleClick?: EdgeMouseHandler; + /** + * This handler is called when the source or target of a reconnectable edge is dragged from the + * current node. It will fire even if the edge's source or target do not end up changing. + * You can use the `reconnectEdge` utility to convert the connection to a new edge. + */ + onReconnect?: OnReconnect; + /** + * This event fires when the user begins dragging the source or target of an editable edge. + */ + onReconnectStart?: (event: ReactMouseEvent, edge: EdgeType, handleType: HandleType) => void; + /** + * This event fires when the user releases the source or target of an editable edge. It is called + * even if an edge update does not occur. + */ + onReconnectEnd?: (event: MouseEvent | TouchEvent, edge: EdgeType, handleType: HandleType) => void; + /** + * Use this event handler to add interactivity to a controlled flow. + * It is called on node drag, select, and move. + * @example // Use NodesState hook to create edges and get onNodesChange handler + * import ReactFlow, { useNodesState } from '@xyflow/react'; + * const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes); + * + * return () + * @example // Use helper function to update node + * import ReactFlow, { applyNodeChanges } from '@xyflow/react'; + * + * const onNodeChange = useCallback( + * (changes) => setNode((nds) => applyNodeChanges(changes, nds)), + * [], + * ); + * + * return () + */ + onNodesChange?: OnNodesChange; + /** + * Use this event handler to add interactivity to a controlled flow. It is called on edge select + * and remove. + * @example // Use EdgesState hook to create edges and get onEdgesChange handler + * import ReactFlow, { useEdgesState } from '@xyflow/react'; + * const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges); + * + * return () + * @example // Use helper function to update edge + * import ReactFlow, { applyEdgeChanges } from '@xyflow/react'; + * + * const onEdgesChange = useCallback( + * (changes) => setEdges((eds) => applyEdgeChanges(changes, eds)), + * [], + * ); + * + * return () + */ + onEdgesChange?: OnEdgesChange; + /** This event handler gets called when a node is deleted. */ + onNodesDelete?: OnNodesDelete; + /** This event handler gets called when an edge is deleted. */ + onEdgesDelete?: OnEdgesDelete; + /** This event handler gets called when a node or edge is deleted. */ + onDelete?: OnDelete; + /** This event handler gets called when a user starts to drag a selection box. */ + onSelectionDragStart?: SelectionDragHandler; + /** This event handler gets called when a user drags a selection box. */ + onSelectionDrag?: SelectionDragHandler; + /** This event handler gets called when a user stops dragging a selection box. */ + onSelectionDragStop?: SelectionDragHandler; + onSelectionStart?: (event: ReactMouseEvent) => void; + onSelectionEnd?: (event: ReactMouseEvent) => void; + /** + * This event handler is called when a user right-clicks on a node selection. + */ + onSelectionContextMenu?: (event: ReactMouseEvent, nodes: NodeType[]) => void; + /** + * When a connection line is completed and two nodes are connected by the user, this event fires with the new connection. + * You can use the `addEdge` utility to convert the connection to a complete edge. + * @example // Use helper function to update edges onConnect + * import ReactFlow, { addEdge } from '@xyflow/react'; + * + * const onConnect = useCallback( + * (params) => setEdges((eds) => addEdge(params, eds)), + * [], + * ); + * + * return () + */ + onConnect?: OnConnect; + /** This event handler gets called when a user starts to drag a connection line. */ + onConnectStart?: OnConnectStart; + /** + * This callback will fire regardless of whether a valid connection could be made or not. You can + * use the second `connectionState` parameter to have different behavior when a connection was + * unsuccessful. + */ + onConnectEnd?: OnConnectEnd; + onClickConnectStart?: OnConnectStart; + onClickConnectEnd?: OnConnectEnd; + /** + * The `onInit` callback is called when the viewport is initialized. At this point you can use the + * instance to call methods like `fitView` or `zoomTo`. + */ + onInit?: OnInit; + /** This event handler is called while the user is either panning or zooming the viewport. */ + onMove?: OnMove; + /** This event handler is called when the user begins to pan or zoom the viewport. */ + onMoveStart?: OnMoveStart; + /** + * This event handler is called when panning or zooming viewport movement stops. + * If the movement is not user-initiated, the event parameter will be `null`. + */ + onMoveEnd?: OnMoveEnd; + /** This event handler gets called when a user changes group of selected elements in the flow. */ + onSelectionChange?: OnSelectionChangeFunc; + /** This event handler gets called when user scroll inside the pane. */ + onPaneScroll?: (event?: WheelEvent) => void; + /** This event handler gets called when user clicks inside the pane. */ + onPaneClick?: (event: ReactMouseEvent) => void; + /** This event handler gets called when user right clicks inside the pane. */ + onPaneContextMenu?: (event: ReactMouseEvent | MouseEvent) => void; + /** This event handler gets called when mouse enters the pane. */ + onPaneMouseEnter?: (event: ReactMouseEvent) => void; + /** This event handler gets called when mouse moves over the pane. */ + onPaneMouseMove?: (event: ReactMouseEvent) => void; + /** This event handler gets called when mouse leaves the pane. */ + onPaneMouseLeave?: (event: ReactMouseEvent) => void; + /** + * Distance that the mouse can move between mousedown/up that will trigger a click. + * @default 0 + */ + paneClickDistance?: number; + /** + * Distance that the mouse can move between mousedown/up that will trigger a click. + * @default 0 + */ + nodeClickDistance?: number; + /** + * This handler is called before nodes or edges are deleted, allowing the deletion to be aborted + * by returning `false` or modified by returning updated nodes and edges. + */ + onBeforeDelete?: OnBeforeDelete; + /** + * Custom node types to be available in a flow. + * React Flow matches a node's type to a component in the `nodeTypes` object. + * @default { + * input: InputNode, + * default: DefaultNode, + * output: OutputNode, + * group: GroupNode + * } + * @example + * import CustomNode from './CustomNode'; + * + * const nodeTypes = { nameOfNodeType: CustomNode }; + */ + nodeTypes?: NodeTypes; + /** + * Custom edge types to be available in a flow. + * React Flow matches an edge's type to a component in the `edgeTypes` object. + * @default { + * default: BezierEdge, + * straight: StraightEdge, + * step: StepEdge, + * smoothstep: SmoothStepEdge, + * simplebezier: SimpleBezier + * } + * @example + * import CustomEdge from './CustomEdge'; + * + * const edgeTypes = { nameOfEdgeType: CustomEdge }; + */ + edgeTypes?: EdgeTypes; + /** + * The type of edge path to use for connection lines. + * Although created edges can be of any type, React Flow needs to know what type of path to render for the connection line before the edge is created! + * @default ConnectionLineType.Bezier + */ + connectionLineType?: ConnectionLineType; + /** Styles to be applied to the connection line. */ + connectionLineStyle?: CSSProperties; + /** React Component to be used as a connection line. */ + connectionLineComponent?: ConnectionLineComponent; + /** Styles to be applied to the container of the connection line. */ + connectionLineContainerStyle?: CSSProperties; + /** + * A loose connection mode will allow you to connect handles with differing types, including + * source-to-source connections. However, it does not support target-to-target connections. Strict + * mode allows only connections between source handles and target handles. + * @default 'strict' + */ + connectionMode?: ConnectionMode; + /** + * If set, pressing the key or chord will delete any selected nodes and edges. Passing an array + * represents multiple keys that can be pressed. + + * For example, `["Delete", "Backspace"]` will delete selected elements when either key is pressed. + * @default 'Backspace' + */ + deleteKeyCode?: KeyCode | null; + /** + * If set, holding this key will let you click and drag to draw a selection box around multiple + * nodes and edges. Passing an array represents multiple keys that can be pressed. + * + * For example, `["Shift", "Meta"]` will allow you to draw a selection box when either key is + * pressed. + * @default 'Shift' + */ + selectionKeyCode?: KeyCode | null; + /** + * Select multiple elements with a selection box, without pressing down `selectionKey`. + * @default false + */ + selectionOnDrag?: boolean; + /** + * When set to `"partial"`, when the user creates a selection box by click and dragging nodes that + * are only partially in the box are still selected. + * @default 'full' + */ + selectionMode?: SelectionMode; + /** + * If a key is set, you can pan the viewport while that key is held down even if `panOnScroll` + * is set to `false`. + * + * By setting this prop to `null` you can disable this functionality. + * @default 'Space' + */ + panActivationKeyCode?: KeyCode | null; + /** + * Pressing down this key you can select multiple elements by clicking. + * @default "Meta" for macOS, "Control" for other systems + */ + multiSelectionKeyCode?: KeyCode | null; + /** + * If a key is set, you can zoom the viewport while that key is held down even if `panOnScroll` + * is set to `false`. + * + * By setting this prop to `null` you can disable this functionality. + * @default "Meta" for macOS, "Control" for other systems + * + */ + zoomActivationKeyCode?: KeyCode | null; + /** When enabled, nodes will snap to the grid when dragged. */ + snapToGrid?: boolean; + /** + * If `snapToGrid` is enabled, this prop configures the grid that nodes will snap to. + * @example [20, 20] + */ + snapGrid?: SnapGrid; + /** + * You can enable this optimisation to instruct React Flow to only render nodes and edges that would be visible in the viewport. + * + * This might improve performance when you have a large number of nodes and edges but also adds an overhead. + * @default false + */ + onlyRenderVisibleElements?: boolean; + /** + * Controls whether all nodes should be draggable or not. Individual nodes can override this + * setting by setting their `draggable` prop. If you want to use the mouse handlers on + * non-draggable nodes, you need to add the `"nopan"` class to those nodes. + * @default true + */ + nodesDraggable?: boolean; + /** + * When `true`, the viewport will pan when a node is focused. + * @default true + */ + autoPanOnNodeFocus?: boolean; + /** + * Controls whether all nodes should be connectable or not. Individual nodes can override this + * setting by setting their `connectable` prop. + * @default true + */ + nodesConnectable?: boolean; + /** + * When `true`, focus between nodes can be cycled with the `Tab` key and selected with the `Enter` + * key. This option can be overridden by individual nodes by setting their `focusable` prop. + * @default true + */ + nodesFocusable?: boolean; + /** + * The origin of the node to use when placing it in the flow or looking up its `x` and `y` + * position. An origin of `[0, 0]` means that a node's top left corner will be placed at the `x` + * and `y` position. + * @default [0, 0] + * @example + * [0, 0] // default, top left + * [0.5, 0.5] // center + * [1, 1] // bottom right + */ + nodeOrigin?: NodeOrigin; + /** + * When `true`, focus between edges can be cycled with the `Tab` key and selected with the `Enter` + * key. This option can be overridden by individual edges by setting their `focusable` prop. + * @default true + */ + edgesFocusable?: boolean; + /** + * Whether edges can be updated once they are created. When both this prop is `true` and an + * `onReconnect` handler is provided, the user can drag an existing edge to a new source or + * target. Individual edges can override this value with their reconnectable property. + * @default true + */ + edgesReconnectable?: boolean; + /** + * When `true`, elements (nodes and edges) can be selected by clicking on them. This option can be + * overridden by individual elements by setting their `selectable` prop. + * @default true + */ + elementsSelectable?: boolean; + /** + * If `true`, nodes get selected on drag. + * @default true + */ + selectNodesOnDrag?: boolean; + /** + * Enabling this prop allows users to pan the viewport by clicking and dragging. + * You can also set this prop to an array of numbers to limit which mouse buttons can activate panning. + * @default true + * @example [0, 2] // allows panning with the left and right mouse buttons + * [0, 1, 2, 3, 4] // allows panning with all mouse buttons + */ + panOnDrag?: boolean | number[]; + /** + * Minimum zoom level. + * @default 0.5 + */ + minZoom?: number; + /** + * Maximum zoom level. + * @default 2 + */ + maxZoom?: number; + /** + * When you pass a `viewport` prop, it's controlled, and you also need to pass `onViewportChange` + * to handle internal changes. + */ + viewport?: Viewport; + /** + * Sets the initial position and zoom of the viewport. If a default viewport is provided but + * `fitView` is enabled, the default viewport will be ignored. + * @default { x: 0, y: 0, zoom: 1 } + * @example + * const initialViewport = { + * zoom: 0.5, + * position: { x: 0, y: 0 } + * }; + */ + defaultViewport?: Viewport; + /** + * Used when working with a controlled viewport for updating the user viewport state. + */ + onViewportChange?: (viewport: Viewport) => void; + /** + * By default, the viewport extends infinitely. You can use this prop to set a boundary. + * The first pair of coordinates is the top left boundary and the second pair is the bottom right. + * @default [[-∞, -∞], [+∞, +∞]] + * @example [[-1000, -10000], [1000, 1000]] + */ + translateExtent?: CoordinateExtent; + /** + * Disabling this prop will allow the user to scroll the page even when their pointer is over the flow. + * @default true + */ + preventScrolling?: boolean; + /** + * By default, nodes can be placed on an infinite flow. You can use this prop to set a boundary. + * The first pair of coordinates is the top left boundary and the second pair is the bottom right. + * @example [[-1000, -10000], [1000, 1000]] + */ + nodeExtent?: CoordinateExtent; + /** + * Color of edge markers. + * @default '#b1b1b7' + */ + defaultMarkerColor?: string; + /** + * Controls if the viewport should zoom by scrolling inside the container. + * @default true + */ + zoomOnScroll?: boolean; + /** + * Controls if the viewport should zoom by pinching on a touch screen. + * @default true + */ + zoomOnPinch?: boolean; + /** + * Controls if the viewport should pan by scrolling inside the container. + * Can be limited to a specific direction with `panOnScrollMode`. + * @default false + */ + panOnScroll?: boolean; + /** + * Controls how fast viewport should be panned on scroll. + * Use together with `panOnScroll` prop. + * @default 0.5 + */ + panOnScrollSpeed?: number; + /** + * This prop is used to limit the direction of panning when `panOnScroll` is enabled. + * The `"free"` option allows panning in any direction. + * @default "free" + * @example "horizontal" | "vertical" + */ + panOnScrollMode?: PanOnScrollMode; + /** + * Controls if the viewport should zoom by double-clicking somewhere on the flow. + * @default true + */ + zoomOnDoubleClick?: boolean; + /** + * The radius around an edge connection that can trigger an edge reconnection. + * @default 10 + */ + reconnectRadius?: number; + /** + * If a node is draggable, clicking and dragging that node will move it around the canvas. Adding + * the `"nodrag"` class prevents this behavior and this prop allows you to change the name of that + * class. + * @default "nodrag" + */ + noDragClassName?: string; + /** + * Typically, scrolling the mouse wheel when the mouse is over the canvas will zoom the viewport. + * Adding the `"nowheel"` class to an element n the canvas will prevent this behavior and this prop + * allows you to change the name of that class. + * @default "nowheel" + */ + noWheelClassName?: string; + /** + * If an element in the canvas does not stop mouse events from propagating, clicking and dragging + * that element will pan the viewport. Adding the `"nopan"` class prevents this behavior and this + * prop allows you to change the name of that class. + * @default "nopan" + */ + noPanClassName?: string; + /** When `true`, the flow will be zoomed and panned to fit all the nodes initially provided. */ + fitView?: boolean; + /** + * When you typically call `fitView` on a `ReactFlowInstance`, you can provide an object of + * options to customize its behavior. This prop lets you do the same for the initial `fitView` + * call. + * @example + * const fitViewOptions = { + * padding: 0.1, + * includeHiddenNodes: false, + * minZoom: 0.1, + * maxZoom: 1, + * duration: 200, + * nodes: [{id: 'node-1'}, {id: 'node-2'}], // nodes to fit + * }; + */ + fitViewOptions?: FitViewOptions; + /** + * The `connectOnClick` option lets you click or tap on a source handle to start a connection + * and then click on a target handle to complete the connection. + * + * If you set this option to `false`, users will need to drag the connection line to the target + * handle to create a connection. + * @default true + */ + connectOnClick?: boolean; + /** + * By default, React Flow will render a small attribution in the bottom right corner of the flow. + * + * You can use this prop to change its position in case you want to place something else there. + * @default 'bottom-right' + * @example 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' + */ + attributionPosition?: PanelPosition; + /** + * By default, we render a small attribution in the corner of your flows that links back to the project. + * + * Anyone is free to remove this attribution whether they're a Pro subscriber or not + * but we ask that you take a quick look at our {@link https://reactflow.dev/learn/troubleshooting/remove-attribution | removing attribution guide} + * before doing so. + */ + proOptions?: ProOptions; + /** + * Enabling this option will raise the z-index of nodes when they are selected. + * @default true + */ + elevateNodesOnSelect?: boolean; + /** + * Enabling this option will raise the z-index of edges when they are selected. + */ + elevateEdgesOnSelect?: boolean; + /** + * You can use this prop to disable keyboard accessibility features such as selecting nodes or + * moving selected nodes with the arrow keys. + * @default false + */ + disableKeyboardA11y?: boolean; + /** + * When `true`, the viewport will pan automatically when the cursor moves to the edge of the + * viewport while dragging a node. + * @default true + */ + autoPanOnNodeDrag?: boolean; + /** + * When `true`, the viewport will pan automatically when the cursor moves to the edge of the + * viewport while creating a connection. + * @default true + */ + autoPanOnConnect?: boolean; + /** + * The speed at which the viewport pans while dragging a node or a selection box. + * @default 15 + */ + autoPanSpeed?: number; + /** + * The radius around a handle where you drop a connection line to create a new edge. + * @default 20 + */ + connectionRadius?: number; + /** + * Occasionally something may happen that causes React Flow to throw an error. + * + * Instead of exploding your application, we log a message to the console and then call this event handler. + * You might use it for additional logging or to show a message to the user. + */ + onError?: OnError; + /** + * This callback can be used to validate a new connection + * + * If you return `false`, the edge will not be added to your flow. + * If you have custom connection logic its preferred to use this callback over the + * `isValidConnection` prop on the handle component for performance reasons. + */ + isValidConnection?: IsValidConnection; + /** + * With a threshold greater than zero you can delay node drag events. + * If threshold equals 1, you need to drag the node 1 pixel before a drag event is fired. + * 1 is the default value, so that clicks don't trigger drag events. + * @default 1 + */ + nodeDragThreshold?: number; + /** Sets a fixed width for the flow. */ + width?: number; + /** Sets a fixed height for the flow. */ + height?: number; + /** + * Controls color scheme used for styling the flow. + * @default 'light' + * @example 'system' | 'light' | 'dark' + */ + colorMode?: ColorMode; + /** + * If set `true`, some debug information will be logged to the console like which events are fired. + * @default false + */ + debug?: boolean; + /** + * Configuration for customizable labels, descriptions, and UI text. Provided keys will override the corresponding defaults. + * Allows localization, customization of ARIA descriptions, control labels, minimap labels, and other UI strings. + */ + ariaLabelConfig?: Partial; +} +//# sourceMappingURL=component-props.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/types/component-props.d.ts.map b/node_modules/@xyflow/react/dist/esm/types/component-props.d.ts.map new file mode 100644 index 0000000..6b9f25d --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/types/component-props.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"component-props.d.ts","sourceRoot":"","sources":["../../src/types/component-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,IAAI,eAAe,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACtG,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,SAAS,EACT,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,OAAO,EACP,eAAe,EACf,UAAU,EACV,aAAa,EACb,MAAM,EACN,WAAW,EACX,SAAS,EACT,QAAQ,EACR,UAAU,EACV,UAAU,EACV,aAAa,EACb,OAAO,EACP,SAAS,EACT,QAAQ,EACR,WAAW,EACX,eAAe,EAChB,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EACV,qBAAqB,EACrB,SAAS,EACT,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,uBAAuB,EACvB,MAAM,EACN,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,aAAa,EACb,QAAQ,EACR,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,iBAAiB,EAClB,MAAM,GAAG,CAAC;AAEX;;;GAGG;AACH,MAAM,WAAW,cAAc,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,CACxF,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,SAAS,CAAC;IACvD;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IACnB;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IACnB,2DAA2D;IAC3D,YAAY,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC1B,2DAA2D;IAC3D,YAAY,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC1B;;;;;;;;OAQG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,iEAAiE;IACjE,WAAW,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACzC,wEAAwE;IACxE,iBAAiB,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC/C,uEAAuE;IACvE,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC9C,2EAA2E;IAC3E,eAAe,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC7C,uEAAuE;IACvE,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC9C,uEAAuE;IACvE,iBAAiB,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC/C,sEAAsE;IACtE,eAAe,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IACvC,6DAA6D;IAC7D,UAAU,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IAClC,sEAAsE;IACtE,cAAc,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IACtC,kEAAkE;IAClE,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC/D,wEAAwE;IACxE,iBAAiB,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC/C,wEAAwE;IACxE,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC9C,4EAA4E;IAC5E,eAAe,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC7C,wEAAwE;IACxE,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC9C,yEAAyE;IACzE,iBAAiB,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC/C;;;;OAIG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;IACpC;;OAEG;IACH,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IAC5F;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IAClG;;;;;;;;;;;;;;;;;OAiBG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IACxC;;;;;;;;;;;;;;;;;OAiBG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IACxC,6DAA6D;IAC7D,aAAa,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IACxC,8DAA8D;IAC9D,aAAa,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IACxC,qEAAqE;IACrE,QAAQ,CAAC,EAAE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACxC,iFAAiF;IACjF,oBAAoB,CAAC,EAAE,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IACtD,wEAAwE;IACxE,eAAe,CAAC,EAAE,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IACjD,iFAAiF;IACjF,mBAAmB,CAAC,EAAE,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IACrD,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IACpD,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IAClD;;OAEG;IACH,sBAAsB,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;IAC7E;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,mFAAmF;IACnF,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;;;OAIG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,mBAAmB,CAAC,EAAE,cAAc,CAAC;IACrC,iBAAiB,CAAC,EAAE,YAAY,CAAC;IACjC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACpC,6FAA6F;IAC7F,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qFAAqF;IACrF,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,iGAAiG;IACjG,iBAAiB,CAAC,EAAE,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC9D,uEAAuE;IACvE,YAAY,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IAC5C,uEAAuE;IACvE,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IAC/C,6EAA6E;IAC7E,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,GAAG,UAAU,KAAK,IAAI,CAAC;IAClE,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IACpD,qEAAqE;IACrE,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IACnD,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IACpD;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACpD;;;;;;;;;;;;;OAaG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;;;;;;;;;;;OAcG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,mDAAmD;IACnD,mBAAmB,CAAC,EAAE,aAAa,CAAC;IACpC,uDAAuD;IACvD,uBAAuB,CAAC,EAAE,uBAAuB,CAAC,QAAQ,CAAC,CAAC;IAC5D,oEAAoE;IACpE,4BAA4B,CAAC,EAAE,aAAa,CAAC;IAC7C;;;;;OAKG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC/B;;;;;;;OAOG;IACH,gBAAgB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAClC;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;;;;;OAMG;IACH,oBAAoB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACtC;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACvC;;;;;;;OAOG;IACH,qBAAqB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACvC,8DAA8D;IAC9D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB;;;;;OAKG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;;;;;;OASG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAC;IAC/B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB;;;;;;;;;OASG;IACH,eAAe,CAAC,EAAE,QAAQ,CAAC;IAC3B;;OAEG;IACH,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;IAChD;;;;;OAKG;IACH,eAAe,CAAC,EAAE,gBAAgB,CAAC;IACnC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;OAIG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;;OAKG;IACH,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,+FAA+F;IAC/F,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;;;;;;;OAaG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,aAAa,CAAC;IACpC;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAChD;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CAC5C"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/types/edges.d.ts b/node_modules/@xyflow/react/dist/esm/types/edges.d.ts new file mode 100644 index 0000000..62778d3 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/types/edges.d.ts @@ -0,0 +1,216 @@ +import type { CSSProperties, SVGAttributes, ReactNode, MouseEvent as ReactMouseEvent, ComponentType, AriaRole } from 'react'; +import type { EdgeBase, BezierPathOptions, Position, SmoothStepPathOptions, DefaultEdgeOptionsBase, HandleType, ConnectionLineType, Handle, EdgePosition, StepPathOptions, OnError, OnReconnect, FinalConnectionState } from '@xyflow/system'; +import { EdgeTypes, InternalNode, Node } from '.'; +/** + * @inline + */ +export type EdgeLabelOptions = { + /** + * The label or custom element to render along the edge. This is commonly a text label or some + * custom controls. + */ + label?: ReactNode; + /** + * Custom styles to apply to the label. + */ + labelStyle?: CSSProperties; + labelShowBg?: boolean; + labelBgStyle?: CSSProperties; + labelBgPadding?: [number, number]; + labelBgBorderRadius?: number; +}; +/** + * An `Edge` is the complete description with everything React Flow needs + * to know in order to render it. + * @public + */ +export type Edge = Record, EdgeType extends string | undefined = string | undefined> = EdgeBase & EdgeLabelOptions & { + style?: CSSProperties; + className?: string; + /** + * Determines whether the edge can be updated by dragging the source or target to a new node. + * This property will override the default set by the `edgesReconnectable` prop on the + * `` component. + */ + reconnectable?: boolean | HandleType; + focusable?: boolean; + /** + * The ARIA role attribute for the edge, used for accessibility. + * @default "group" + */ + ariaRole?: AriaRole; + /** + * General escape hatch for adding custom attributes to the edge's DOM element. + */ + domAttributes?: Omit, 'id' | 'style' | 'className' | 'role' | 'aria-label'>; +}; +type SmoothStepEdge = Record> = Edge & { + pathOptions?: SmoothStepPathOptions; +}; +type BezierEdge = Record> = Edge & { + pathOptions?: BezierPathOptions; +}; +type StepEdge = Record> = Edge & { + pathOptions?: StepPathOptions; +}; +type StraightEdge = Record> = Edge; +export type BuiltInEdge = SmoothStepEdge | BezierEdge | StepEdge | StraightEdge; +export type EdgeMouseHandler = (event: ReactMouseEvent, edge: EdgeType) => void; +export type EdgeWrapperProps = { + id: string; + edgesFocusable: boolean; + edgesReconnectable: boolean; + elementsSelectable: boolean; + noPanClassName: string; + onClick?: EdgeMouseHandler; + onDoubleClick?: EdgeMouseHandler; + onReconnect?: OnReconnect; + onContextMenu?: EdgeMouseHandler; + onMouseEnter?: EdgeMouseHandler; + onMouseMove?: EdgeMouseHandler; + onMouseLeave?: EdgeMouseHandler; + reconnectRadius?: number; + onReconnectStart?: (event: ReactMouseEvent, edge: EdgeType, handleType: HandleType) => void; + onReconnectEnd?: (event: MouseEvent | TouchEvent, edge: EdgeType, handleType: HandleType, connectionState: FinalConnectionState) => void; + rfId?: string; + edgeTypes?: EdgeTypes; + onError?: OnError; + disableKeyboardA11y?: boolean; +}; +/** + * Many properties on an [`Edge`](/api-reference/types/edge) are optional. When a new edge is created, + * the properties that are not provided will be filled in with the default values + * passed to the `defaultEdgeOptions` prop of the [``](/api-reference/react-flow#defaultedgeoptions) component. + */ +export type DefaultEdgeOptions = DefaultEdgeOptionsBase; +export type EdgeTextProps = Omit, 'x' | 'y'> & EdgeLabelOptions & { + /** The x position where the label should be rendered. */ + x: number; + /** The y position where the label should be rendered. */ + y: number; +}; +/** + * When you implement a custom edge it is wrapped in a component that enables some + * basic functionality. The `EdgeProps` type is the props that are passed to this. + * @public + * @expand + */ +export type EdgeProps = Pick & EdgePosition & EdgeLabelOptions & { + sourceHandleId?: string | null; + targetHandleId?: string | null; + markerStart?: string; + markerEnd?: string; + pathOptions?: any; + interactionWidth?: number; +}; +/** + * BaseEdge component props + * @public + * @expand + */ +export type BaseEdgeProps = Omit, 'd' | 'path' | 'markerStart' | 'markerEnd'> & EdgeLabelOptions & { + /** + * The width of the invisible area around the edge that the user can interact with. This is + * useful for making the edge easier to click or hover over. + * @default 20 + */ + interactionWidth?: number; + /** The x position of edge label */ + labelX?: number; + /** The y position of edge label */ + labelY?: number; + /** + * The SVG path string that defines the edge. This should look something like + * `'M 0 0 L 100 100'` for a simple line. The utility functions like `getSimpleBezierEdge` can + * be used to generate this string for you. + */ + path: string; + /** + * The id of the SVG marker to use at the start of the edge. This should be defined in a + * `` element in a separate SVG document or element. + */ + markerStart?: string; + /** + * The id of the SVG marker to use at the end of the edge. This should be defined in a `` + * element in a separate SVG document or element. + */ + markerEnd?: string; +}; +/** + * Helper type for edge components that get exported by the library + * @public + * @expand + */ +export type EdgeComponentProps = EdgePosition & EdgeLabelOptions & { + id?: EdgeProps['id']; + markerStart?: EdgeProps['markerStart']; + markerEnd?: EdgeProps['markerEnd']; + interactionWidth?: EdgeProps['interactionWidth']; + style?: EdgeProps['style']; + sourceHandleId?: EdgeProps['sourceHandleId']; + targetHandleId?: EdgeProps['targetHandleId']; +}; +export type EdgeComponentWithPathOptions = EdgeComponentProps & { + pathOptions?: PathOptions; +}; +/** + * BezierEdge component props + * @public + * @expand + */ +export type BezierEdgeProps = EdgeComponentWithPathOptions; +/** + * SmoothStepEdge component props + * @public + * @expand + */ +export type SmoothStepEdgeProps = EdgeComponentWithPathOptions; +/** + * StepEdge component props + * @public + * @expand + */ +export type StepEdgeProps = EdgeComponentWithPathOptions; +/** + * StraightEdge component props + * @public + * @expand + */ +export type StraightEdgeProps = Omit; +/** + * SimpleBezier component props + * @public + * @expand + */ +export type SimpleBezierEdgeProps = EdgeComponentProps; +/** + * If you want to render a custom component for connection lines, you can set the + * `connectionLineComponent` prop on the [``](/api-reference/react-flow#connection-connectionLineComponent) + * component. The `ConnectionLineComponentProps` are passed to your custom component. + * + * @public + */ +export type ConnectionLineComponentProps = { + connectionLineStyle?: CSSProperties; + connectionLineType: ConnectionLineType; + /** The node the connection line originates from. */ + fromNode: InternalNode; + /** The handle on the `fromNode` that the connection line originates from. */ + fromHandle: Handle; + fromX: number; + fromY: number; + toX: number; + toY: number; + fromPosition: Position; + toPosition: Position; + /** + * If there is an `isValidConnection` callback, this prop will be set to `"valid"` or `"invalid"` + * based on the return value of that callback. Otherwise, it will be `null`. + */ + connectionStatus: 'valid' | 'invalid' | null; + toNode: InternalNode | null; + toHandle: Handle | null; +}; +export type ConnectionLineComponent = ComponentType>; +export {}; +//# sourceMappingURL=edges.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/types/edges.d.ts.map b/node_modules/@xyflow/react/dist/esm/types/edges.d.ts.map new file mode 100644 index 0000000..7c36d7d --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/types/edges.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"edges.d.ts","sourceRoot":"","sources":["../../src/types/edges.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,SAAS,EACT,UAAU,IAAI,eAAe,EAC7B,aAAa,EACb,QAAQ,EACT,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EACV,QAAQ,EACR,iBAAiB,EACjB,QAAQ,EACR,qBAAqB,EACrB,sBAAsB,EACtB,UAAU,EACV,kBAAkB,EAClB,MAAM,EACN,YAAY,EACZ,eAAe,EACf,OAAO,EACP,WAAW,EACX,oBAAoB,EACrB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,IAAI,CACd,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClE,QAAQ,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,IACtD,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAC9B,gBAAgB,GAAG;IACjB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IACrC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,EAAE,IAAI,GAAG,OAAO,GAAG,WAAW,GAAG,MAAM,GAAG,YAAY,CAAC,CAAC;CACxG,CAAC;AAEJ,KAAK,cAAc,CAAC,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,IAAI,CAC5F,QAAQ,EACR,YAAY,CACb,GAAG;IACF,WAAW,CAAC,EAAE,qBAAqB,CAAC;CACrC,CAAC;AAEF,KAAK,UAAU,CAAC,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,GAAG;IAChH,WAAW,CAAC,EAAE,iBAAiB,CAAC;CACjC,CAAC;AAEF,KAAK,QAAQ,CAAC,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG;IAC3G,WAAW,CAAC,EAAE,eAAe,CAAC;CAC/B,CAAC;AAEF,KAAK,YAAY,CAAC,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;AAEnH,MAAM,MAAM,WAAW,GAAG,cAAc,GAAG,UAAU,GAAG,QAAQ,GAAG,YAAY,CAAC;AAEhF,MAAM,MAAM,gBAAgB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;AAE9G,MAAM,MAAM,gBAAgB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI;IAC3D,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,OAAO,CAAC;IACxB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACrC,aAAa,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC3C,WAAW,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;IACpC,aAAa,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC3C,YAAY,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC1C,WAAW,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACzC,YAAY,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC1C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IAC5F,cAAc,CAAC,EAAE,CACf,KAAK,EAAE,UAAU,GAAG,UAAU,EAC9B,IAAI,EAAE,QAAQ,EACd,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,oBAAoB,KAClC,IAAI,CAAC;IACV,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,sBAAsB,CAAC,IAAI,CAAC,CAAC;AAE9D,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC,GACpE,gBAAgB,GAAG;IACjB,yDAAyD;IACzD,CAAC,EAAE,MAAM,CAAC;IACV,yDAAyD;IACzD,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEJ;;;;;GAKG;AACH,MAAM,MAAM,SAAS,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,IAAI,CACxD,QAAQ,EACR,IAAI,GAAG,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,YAAY,GAAG,WAAW,CACrG,GACC,YAAY,GACZ,gBAAgB,GAAG;IACjB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEJ;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,EAAE,GAAG,GAAG,MAAM,GAAG,aAAa,GAAG,WAAW,CAAC,GACzG,gBAAgB,GAAG;IACjB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mCAAmC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mCAAmC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEJ;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAC3C,gBAAgB,GAAG;IACjB,EAAE,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;IACrB,WAAW,CAAC,EAAE,SAAS,CAAC,aAAa,CAAC,CAAC;IACvC,SAAS,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IACnC,gBAAgB,CAAC,EAAE,SAAS,CAAC,kBAAkB,CAAC,CAAC;IACjD,KAAK,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC3B,cAAc,CAAC,EAAE,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC7C,cAAc,CAAC,EAAE,SAAS,CAAC,gBAAgB,CAAC,CAAC;CAC9C,CAAC;AAEJ,MAAM,MAAM,4BAA4B,CAAC,WAAW,IAAI,kBAAkB,GAAG;IAC3E,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,4BAA4B,CAAC,iBAAiB,CAAC,CAAC;AAE9E;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,4BAA4B,CAAC,qBAAqB,CAAC,CAAC;AAEtF;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,4BAA4B,CAAC,eAAe,CAAC,CAAC;AAE1E;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,kBAAkB,EAAE,gBAAgB,GAAG,gBAAgB,CAAC,CAAC;AAE9F;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;AAEvD;;;;;;GAMG;AACH,MAAM,MAAM,4BAA4B,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI;IACvE,mBAAmB,CAAC,EAAE,aAAa,CAAC;IACpC,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,oDAAoD;IACpD,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;IACjC,6EAA6E;IAC7E,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,QAAQ,CAAC;IACvB,UAAU,EAAE,QAAQ,CAAC;IACrB;;;OAGG;IACH,gBAAgB,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC;IAC7C,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;IACtC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,uBAAuB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,aAAa,CAC/E,4BAA4B,CAAC,QAAQ,CAAC,CACvC,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/types/general.d.ts b/node_modules/@xyflow/react/dist/esm/types/general.d.ts new file mode 100644 index 0000000..7ef83e6 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/types/general.d.ts @@ -0,0 +1,164 @@ +import { ComponentType } from 'react'; +import { FitViewParamsBase, FitViewOptionsBase, ZoomInOut, ZoomTo, SetViewport, GetZoom, GetViewport, SetCenter, FitBounds, XYPosition, OnBeforeDeleteBase, Connection, NodeChange, EdgeChange } from '@xyflow/system'; +import type { Node, Edge, ReactFlowInstance, EdgeProps, NodeProps } from '.'; +/** + * This type can be used to type the `onNodesChange` function with a custom node type. + * + * @public + * + * @example + * + * ```ts + * const onNodesChange: OnNodesChange = useCallback((changes) => { + * setNodes((nodes) => applyNodeChanges(nodes, changes)); + * },[]); + * ``` + */ +export type OnNodesChange = (changes: NodeChange[]) => void; +/** + * This type can be used to type the `onEdgesChange` function with a custom edge type. + * + * @public + * + * @example + * + * ```ts + * const onEdgesChange: OnEdgesChange = useCallback((changes) => { + * setEdges((edges) => applyEdgeChanges(edges, changes)); + * },[]); + * ``` + */ +export type OnEdgesChange = (changes: EdgeChange[]) => void; +export type OnNodesDelete = (nodes: NodeType[]) => void; +export type OnEdgesDelete = (edges: EdgeType[]) => void; +/** + * This type can be used to type the `onDelete` function with a custom node and edge type. + * + * @public + */ +export type OnDelete = (params: { + nodes: NodeType[]; + edges: EdgeType[]; +}) => void; +export type NodeTypes = Record>; +export type EdgeTypes = Record>; +export type UnselectNodesAndEdgesParams = { + nodes?: NodeType[]; + edges?: EdgeType[]; +}; +export type OnSelectionChangeParams = { + nodes: NodeType[]; + edges: EdgeType[]; +}; +export type OnSelectionChangeFunc = (params: OnSelectionChangeParams) => void; +export type FitViewParams = FitViewParamsBase; +/** + * When calling [`fitView`](/api-reference/types/react-flow-instance#fitview) these options + * can be used to customize the behaviour. For example, the `duration` option can be used to + * transform the viewport smoothly over a given amount of time. + * + * @public + */ +export type FitViewOptions = FitViewOptionsBase; +export type FitView = (fitViewOptions?: FitViewOptions) => Promise; +export type OnInit = (reactFlowInstance: ReactFlowInstance) => void; +/** + * @inline + */ +export type ViewportHelperFunctions = { + /** + * Zooms viewport in by 1.2. + * + * @param options.duration - optional duration. If set, a transition will be applied + */ + zoomIn: ZoomInOut; + /** + * Zooms viewport out by 1 / 1.2. + * + * @param options.duration - optional duration. If set, a transition will be applied + */ + zoomOut: ZoomInOut; + /** + * Zoom the viewport to a given zoom level. Passing in a `duration` will animate the viewport to + * the new zoom level. + * + * @param zoomLevel - the zoom level to set + * @param options.duration - optional duration. If set, a transition will be applied + */ + zoomTo: ZoomTo; + /** + * Get the current zoom level of the viewport. + * + * @returns current zoom as a number + */ + getZoom: GetZoom; + /** + * Sets the current viewport. + * + * @param viewport - the viewport to set + * @param options.duration - optional duration. If set, a transition will be applied + * @param options.ease - optional ease function. + */ + setViewport: SetViewport; + /** + * Returns the current viewport. + * + * @returns Viewport + */ + getViewport: GetViewport; + /** + * Center the viewport on a given position. Passing in a `duration` will animate the viewport to + * the new position. + * + * @param x - x position + * @param y - y position + * @param options.zoom - optional zoom + * @param options.duration - optional duration. If set, a transition will be applied + * @param options.ease - optional ease function. + */ + setCenter: SetCenter; + /** + * A low-level utility function to fit the viewport to a given rectangle. By passing in a + * `duration`, the viewport will animate from its current position to the new position. The + * `padding` option can be used to add space around the bounds. + * + * @param bounds - the bounds ({ x: number, y: number, width: number, height: number }) to fit the view to + * @param options.padding - optional padding + * @param options.duration - optional duration. If set, a transition will be applied + * @param options.ease - optional ease function. + */ + fitBounds: FitBounds; + /** + * With this function you can translate a screen pixel position to a flow position. It is useful + * for implementing drag and drop from a sidebar for example. + * + * @param clientPosition - the screen / client position. When you are working with events you can use event.clientX and event.clientY + * @param options.snapToGrid - if true, the converted position will be snapped to the grid + * @returns position as { x: number, y: number } + * + * @example + * const flowPosition = screenToFlowPosition({ x: event.clientX, y: event.clientY }) + */ + screenToFlowPosition: (clientPosition: XYPosition, options?: { + snapToGrid: boolean; + }) => XYPosition; + /** + * Translate a position inside the flow's canvas to a screen pixel position. + * + * @param flowPosition - the screen / client position. When you are working with events you can use event.clientX and event.clientY + * @returns position as { x: number, y: number } + * + * @example + * const clientPosition = flowToScreenPosition({ x: node.position.x, y: node.position.y }) + */ + flowToScreenPosition: (flowPosition: XYPosition) => XYPosition; +}; +export type OnBeforeDelete = OnBeforeDeleteBase; +export type IsValidConnection = (edge: EdgeType | Connection) => boolean; +//# sourceMappingURL=general.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/types/general.d.ts.map b/node_modules/@xyflow/react/dist/esm/types/general.d.ts.map new file mode 100644 index 0000000..32e6a98 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/types/general.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../src/types/general.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,MAAM,EACN,WAAW,EACX,OAAO,EACP,WAAW,EACX,SAAS,EACT,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,UAAU,EACV,UAAU,EACV,UAAU,EACX,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,iBAAiB,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,CAAC;AAE7E;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,aAAa,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE,KAAK,IAAI,CAAC;AAEpG;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,aAAa,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE,KAAK,IAAI,CAAC;AAEpG,MAAM,MAAM,aAAa,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;AACtF,MAAM,MAAM,aAAa,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;AAEtF;;;;GAIG;AACH,MAAM,MAAM,QAAQ,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CAAC,MAAM,EAAE;IAC1F,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB,KAAK,IAAI,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,MAAM,CAC5B,MAAM,EACN,aAAa,CACX,SAAS,GAAG;IAEV,IAAI,EAAE,GAAG,CAAC;IAEV,IAAI,EAAE,GAAG,CAAC;CACX,CACF,CACF,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,MAAM,CAC5B,MAAM,EACN,aAAa,CACX,SAAS,GAAG;IAEV,IAAI,EAAE,GAAG,CAAC;IAEV,IAAI,EAAE,GAAG,CAAC;CACX,CACF,CACF,CAAC;AAEF,MAAM,MAAM,2BAA2B,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI;IACpG,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,uBAAuB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI;IAChG,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,qBAAqB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CAC9F,MAAM,EAAE,uBAAuB,CAAC,QAAQ,EAAE,QAAQ,CAAC,KAChD,IAAI,CAAC;AAEV,MAAM,MAAM,aAAa,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AAEtF;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,kBAAkB,CAAC,QAAQ,CAAC,CAAC;AACxF,MAAM,MAAM,OAAO,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AACpH,MAAM,MAAM,MAAM,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CAC/E,iBAAiB,EAAE,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,CAAC,KACrD,IAAI,CAAC;AAEV;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC;;;;OAIG;IACH,MAAM,EAAE,SAAS,CAAC;IAClB;;;;OAIG;IACH,OAAO,EAAE,SAAS,CAAC;IACnB;;;;;;OAMG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;;;;OAMG;IACH,WAAW,EAAE,WAAW,CAAC;IACzB;;;;OAIG;IACH,WAAW,EAAE,WAAW,CAAC;IACzB;;;;;;;;;OASG;IACH,SAAS,EAAE,SAAS,CAAC;IACrB;;;;;;;;;OASG;IACH,SAAS,EAAE,SAAS,CAAC;IACrB;;;;;;;;;;OAUG;IACH,oBAAoB,EAAE,CAAC,cAAc,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE;QAAE,UAAU,EAAE,OAAO,CAAA;KAAE,KAAK,UAAU,CAAC;IACpG;;;;;;;;OAQG;IACH,oBAAoB,EAAE,CAAC,YAAY,EAAE,UAAU,KAAK,UAAU,CAAC;CAChE,CAAC;AAEF,MAAM,MAAM,cAAc,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,kBAAkB,CACzG,QAAQ,EACR,QAAQ,CACT,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,QAAQ,GAAG,UAAU,KAAK,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/types/index.d.ts b/node_modules/@xyflow/react/dist/esm/types/index.d.ts new file mode 100644 index 0000000..93a5f0a --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/types/index.d.ts @@ -0,0 +1,7 @@ +export * from './nodes'; +export * from './edges'; +export * from './component-props'; +export * from './general'; +export * from './store'; +export * from './instance'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/types/index.d.ts.map b/node_modules/@xyflow/react/dist/esm/types/index.d.ts.map new file mode 100644 index 0000000..245cc19 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/types/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/types/instance.d.ts b/node_modules/@xyflow/react/dist/esm/types/instance.d.ts new file mode 100644 index 0000000..598377b --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/types/instance.d.ts @@ -0,0 +1,232 @@ +import type { HandleConnection, HandleType, NodeConnection, Rect, Viewport } from '@xyflow/system'; +import type { Node, Edge, ViewportHelperFunctions, InternalNode, FitView } from '.'; +export type ReactFlowJsonObject = { + nodes: NodeType[]; + edges: EdgeType[]; + viewport: Viewport; +}; +export type DeleteElementsOptions = { + nodes?: (Node | { + id: Node['id']; + })[]; + edges?: (Edge | { + id: Edge['id']; + })[]; +}; +/** + * @inline + */ +export type GeneralHelpers = { + /** + * Returns nodes. + * + * @returns nodes array + */ + getNodes: () => NodeType[]; + /** + * Set your nodes array to something else by either overwriting it with a new array or by passing + * in a function to update the existing array. If using a function, it is important to make sure a + * new array is returned instead of mutating the existing array. Calling this function will + * trigger the `onNodesChange` handler in a controlled flow. + * + * @param payload - the nodes to set or a function that receives the current nodes and returns the new nodes + */ + setNodes: (payload: NodeType[] | ((nodes: NodeType[]) => NodeType[])) => void; + /** + * Add one or many nodes to your existing nodes array. Calling this function will trigger the + * `onNodesChange` handler in a controlled flow. + * + * @param payload - the nodes to add + */ + addNodes: (payload: NodeType[] | NodeType) => void; + /** + * Returns a node by id. + * + * @param id - the node id + * @returns the node or undefined if no node was found + */ + getNode: (id: string) => NodeType | undefined; + /** + * Returns an internal node by id. + * + * @param id - the node id + * @returns the internal node or undefined if no node was found + */ + getInternalNode: (id: string) => InternalNode | undefined; + /** + * Returns edges. + * + * @returns edges array + */ + getEdges: () => EdgeType[]; + /** + * Set your edges array to something else by either overwriting it with a new array or by passing + * in a function to update the existing array. If using a function, it is important to make sure a + * new array is returned instead of mutating the existing array. Calling this function will + * trigger the `onEdgesChange` handler in a controlled flow. + * + * @param payload - the edges to set or a function that receives the current edges and returns the new edges + */ + setEdges: (payload: EdgeType[] | ((edges: EdgeType[]) => EdgeType[])) => void; + /** + * Add one or many edges to your existing edges array. Calling this function will trigger the + * `onEdgesChange` handler in a controlled flow. + * + * @param payload - the edges to add + */ + addEdges: (payload: EdgeType[] | EdgeType) => void; + /** + * Returns an edge by id. + * + * @param id - the edge id + * @returns the edge or undefined if no edge was found + */ + getEdge: (id: string) => EdgeType | undefined; + /** + * Returns the nodes, edges and the viewport as a JSON object. + * + * @returns the nodes, edges and the viewport as a JSON object + */ + toObject: () => ReactFlowJsonObject; + /** + * Deletes nodes and edges. + * + * @param params.nodes - optional nodes array to delete + * @param params.edges - optional edges array to delete + * + * @returns a promise that resolves with the deleted nodes and edges + */ + deleteElements: (params: DeleteElementsOptions) => Promise<{ + deletedNodes: Node[]; + deletedEdges: Edge[]; + }>; + /** + * Find all the nodes currently intersecting with a given node or rectangle. The `partially` + * parameter can be set to `true` to include nodes that are only partially intersecting. + * + * @param node - the node or rect to check for intersections + * @param partially - if true, the node is considered to be intersecting if it partially overlaps with the passed node or rect + * @param nodes - optional nodes array to check for intersections + * + * @returns an array of intersecting nodes + */ + getIntersectingNodes: (node: NodeType | { + id: Node['id']; + } | Rect, partially?: boolean, nodes?: NodeType[]) => NodeType[]; + /** + * Determine if a given node or rectangle is intersecting with another rectangle. The `partially` + * parameter can be set to true return `true` even if the node is only partially intersecting. + * + * @param node - the node or rect to check for intersections + * @param area - the rect to check for intersections + * @param partially - if true, the node is considered to be intersecting if it partially overlaps with the passed react + * + * @returns true if the node or rect intersects with the given area + */ + isNodeIntersecting: (node: NodeType | { + id: Node['id']; + } | Rect, area: Rect, partially?: boolean) => boolean; + /** + * Updates a node. + * + * @param id - id of the node to update + * @param nodeUpdate - the node update as an object or a function that receives the current node and returns the node update + * @param options.replace - if true, the node is replaced with the node update, otherwise the changes get merged + * + * @example + * updateNode('node-1', (node) => ({ position: { x: node.position.x + 10, y: node.position.y } })); + */ + updateNode: (id: string, nodeUpdate: Partial | ((node: NodeType) => Partial), options?: { + replace: boolean; + }) => void; + /** + * Updates the data attribute of a node. + * + * @param id - id of the node to update + * @param dataUpdate - the data update as an object or a function that receives the current data and returns the data update + * @param options.replace - if true, the data is replaced with the data update, otherwise the changes get merged + * + * @example + * updateNodeData('node-1', { label: 'A new label' }); + */ + updateNodeData: (id: string, dataUpdate: Partial | ((node: NodeType) => Partial), options?: { + replace: boolean; + }) => void; + /** + * Updates an edge. + * + * @param id - id of the edge to update + * @param edgeUpdate - the edge update as an object or a function that receives the current edge and returns the edge update + * @param options.replace - if true, the edge is replaced with the edge update, otherwise the changes get merged + * + * @example + * updateEdge('edge-1', (edge) => ({ label: 'A new label' })); + */ + updateEdge: (id: string, edgeUpdate: Partial | ((edge: EdgeType) => Partial), options?: { + replace: boolean; + }) => void; + /** + * Updates the data attribute of a edge. + * + * @param id - id of the edge to update + * @param dataUpdate - the data update as an object or a function that receives the current data and returns the data update + * @param options.replace - if true, the data is replaced with the data update, otherwise the changes get merged + * + * @example + * updateEdgeData('edge-1', { label: 'A new label' }); + */ + updateEdgeData: (id: string, dataUpdate: Partial | ((edge: EdgeType) => Partial), options?: { + replace: boolean; + }) => void; + /** + * Returns the bounds of the given nodes or node ids. + * + * @param nodes - the nodes or node ids to calculate the bounds for + * + * @returns the bounds of the given nodes + */ + getNodesBounds: (nodes: (NodeType | InternalNode | string)[]) => Rect; + /** + * Get all the connections of a handle belonging to a specific node. The type parameter be either + * `'source'` or `'target'`. + * @deprecated + * @param type - handle type 'source' or 'target' + * @param id - the handle id (this is only needed if you have multiple handles of the same type, meaning you have to provide a unique id for each handle) + * @param nodeId - the node id the handle belongs to + * @returns an array with handle connections + */ + getHandleConnections: ({ type, id, nodeId, }: { + type: HandleType; + nodeId: string; + id?: string | null; + }) => HandleConnection[]; + /** + * Gets all connections to a node. Can be filtered by handle type and id. + * @param type - handle type 'source' or 'target' + * @param handleId - the handle id (this is only needed if you have multiple handles of the same type, meaning you have to provide a unique id for each handle) + * @param nodeId - the node id the handle belongs to + * @returns an array with handle connections + */ + getNodeConnections: ({ type, handleId, nodeId, }: { + type?: HandleType; + nodeId: string; + handleId?: string | null; + }) => NodeConnection[]; + fitView: FitView; +}; +/** + * The `ReactFlowInstance` provides a collection of methods to query and manipulate + * the internal state of your flow. You can get an instance by using the + * [`useReactFlow`](/api-reference/hooks/use-react-flow) hook or attaching a listener + * to the [`onInit`](/api-reference/react-flow#event-oninit) event. + * + * @public + */ +export type ReactFlowInstance = GeneralHelpers & ViewportHelperFunctions & { + /** + * React Flow needs to mount the viewport to the DOM and initialize its zoom and pan behavior. + * This property tells you when viewport is initialized. + */ + viewportInitialized: boolean; +}; +//# sourceMappingURL=instance.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/types/instance.d.ts.map b/node_modules/@xyflow/react/dist/esm/types/instance.d.ts.map new file mode 100644 index 0000000..9e3bf67 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/types/instance.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"instance.d.ts","sourceRoot":"","sources":["../../src/types/instance.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,cAAc,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACnG,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,uBAAuB,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC;AAEpF,MAAM,MAAM,mBAAmB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI;IAC5F,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,CAAC,EAAE,CAAC,IAAI,GAAG;QAAE,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAA;KAAE,CAAC,EAAE,CAAC;IACtC,KAAK,CAAC,EAAE,CAAC,IAAI,GAAG;QAAE,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAA;KAAE,CAAC,EAAE,CAAC;CACvC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI;IACvF;;;;OAIG;IACH,QAAQ,EAAE,MAAM,QAAQ,EAAE,CAAC;IAC3B;;;;;;;OAOG;IACH,QAAQ,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,QAAQ,EAAE,CAAC,KAAK,IAAI,CAAC;IAC9E;;;;;OAKG;IACH,QAAQ,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,GAAG,QAAQ,KAAK,IAAI,CAAC;IACnD;;;;;OAKG;IACH,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,QAAQ,GAAG,SAAS,CAAC;IAC9C;;;;;OAKG;IACH,eAAe,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,YAAY,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC;IACpE;;;;OAIG;IACH,QAAQ,EAAE,MAAM,QAAQ,EAAE,CAAC;IAC3B;;;;;;;OAOG;IACH,QAAQ,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,QAAQ,EAAE,CAAC,KAAK,IAAI,CAAC;IAC9E;;;;;OAKG;IACH,QAAQ,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,GAAG,QAAQ,KAAK,IAAI,CAAC;IACnD;;;;;OAKG;IACH,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,QAAQ,GAAG,SAAS,CAAC;IAC9C;;;;OAIG;IACH,QAAQ,EAAE,MAAM,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACxD;;;;;;;OAOG;IACH,cAAc,EAAE,CAAC,MAAM,EAAE,qBAAqB,KAAK,OAAO,CAAC;QACzD,YAAY,EAAE,IAAI,EAAE,CAAC;QACrB,YAAY,EAAE,IAAI,EAAE,CAAC;KACtB,CAAC,CAAC;IACH;;;;;;;;;OASG;IACH,oBAAoB,EAAE,CACpB,IAAI,EAAE,QAAQ,GAAG;QAAE,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAA;KAAE,GAAG,IAAI,EAC1C,SAAS,CAAC,EAAE,OAAO,EACnB,KAAK,CAAC,EAAE,QAAQ,EAAE,KACf,QAAQ,EAAE,CAAC;IAChB;;;;;;;;;OASG;IACH,kBAAkB,EAAE,CAAC,IAAI,EAAE,QAAQ,GAAG;QAAE,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAA;KAAE,GAAG,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC;IAC7G;;;;;;;;;OASG;IACH,UAAU,EAAE,CACV,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC,EACvE,OAAO,CAAC,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,KAC3B,IAAI,CAAC;IACV;;;;;;;;;OASG;IACH,cAAc,EAAE,CACd,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EACvF,OAAO,CAAC,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,KAC3B,IAAI,CAAC;IACV;;;;;;;;;OASG;IACH,UAAU,EAAE,CACV,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC,EACvE,OAAO,CAAC,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,KAC3B,IAAI,CAAC;IACV;;;;;;;;;OASG;IACH,cAAc,EAAE,CACd,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EACvF,OAAO,CAAC,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,KAC3B,IAAI,CAAC;IACV;;;;;;OAMG;IACH,cAAc,EAAE,CAAC,KAAK,EAAE,CAAC,QAAQ,GAAG,YAAY,GAAG,MAAM,CAAC,EAAE,KAAK,IAAI,CAAC;IACtE;;;;;;;;OAQG;IACH,oBAAoB,EAAE,CAAC,EACrB,IAAI,EACJ,EAAE,EACF,MAAM,GACP,EAAE;QACD,IAAI,EAAE,UAAU,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC;QACf,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KACpB,KAAK,gBAAgB,EAAE,CAAC;IACzB;;;;;;OAMG;IACH,kBAAkB,EAAE,CAAC,EACnB,IAAI,EACJ,QAAQ,EACR,MAAM,GACP,EAAE;QACD,IAAI,CAAC,EAAE,UAAU,CAAC;QAClB,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAC1B,KAAK,cAAc,EAAE,CAAC;IAWvB,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC5B,CAAC;AACF;;;;;;;GAOG;AACH,MAAM,MAAM,iBAAiB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,cAAc,CACxG,QAAQ,EACR,QAAQ,CACT,GACE,uBAAuB,GAAG;IAC3B;;;OAGG;IACD,mBAAmB,EAAE,OAAO,CAAC;CAC9B,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/types/nodes.d.ts b/node_modules/@xyflow/react/dist/esm/types/nodes.d.ts new file mode 100644 index 0000000..46415c1 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/types/nodes.d.ts @@ -0,0 +1,101 @@ +import type { CSSProperties, MouseEvent as ReactMouseEvent, AriaRole, HTMLAttributes, DOMAttributes } from 'react'; +import type { CoordinateExtent, NodeBase, OnError, NodeProps as NodePropsBase, InternalNodeBase } from '@xyflow/system'; +import { NodeTypes } from './general'; +/** + * The `Node` type represents everything React Flow needs to know about a given node. + * Whenever you want to update a certain attribute of a node, you need to create a new + * node object. + * + * @public + */ +export type Node = Record, NodeType extends string | undefined = string | undefined> = NodeBase & { + style?: CSSProperties; + className?: string; + resizing?: boolean; + focusable?: boolean; + /** + * The ARIA role attribute for the node element, used for accessibility. + * @default "group" + */ + ariaRole?: AriaRole; + /** + * General escape hatch for adding custom attributes to the node's DOM element. + */ + domAttributes?: Omit, 'id' | 'style' | 'className' | 'draggable' | 'role' | 'aria-label' | keyof DOMAttributes>; +}; +/** + * The `InternalNode` type is identical to the base [`Node`](/api-references/types/node) + * type but is extended with some additional properties used internally. + * Some functions and callbacks that return nodes may return an `InternalNode`. + * + * @public + */ +export type InternalNode = InternalNodeBase; +export type NodeMouseHandler = (event: ReactMouseEvent, node: NodeType) => void; +export type SelectionDragHandler = (event: ReactMouseEvent, nodes: NodeType[]) => void; +export type OnNodeDrag = (event: ReactMouseEvent, node: NodeType, nodes: NodeType[]) => void; +export type NodeWrapperProps = { + id: string; + nodesConnectable: boolean; + elementsSelectable: boolean; + nodesDraggable: boolean; + nodesFocusable: boolean; + onClick?: NodeMouseHandler; + onDoubleClick?: NodeMouseHandler; + onMouseEnter?: NodeMouseHandler; + onMouseMove?: NodeMouseHandler; + onMouseLeave?: NodeMouseHandler; + onContextMenu?: NodeMouseHandler; + resizeObserver: ResizeObserver | null; + noDragClassName: string; + noPanClassName: string; + rfId: string; + disableKeyboardA11y: boolean; + nodeTypes?: NodeTypes; + nodeExtent?: CoordinateExtent; + onError?: OnError; + nodeClickDistance?: number; +}; +/** + * The `BuiltInNode` type represents the built-in node types that are available in React Flow. + * You can use this type to extend your custom node type if you still want ot use the built-in ones. + * + * @public + * @example + * ```ts + * type CustomNode = Node<{ value: number }, 'custom'>; + * type MyAppNode = CustomNode | BuiltInNode; + * ``` + */ +export type BuiltInNode = Node<{ + label: string; +}, 'input' | 'output' | 'default'> | Node, 'group'>; +/** + * When you implement a [custom node](/learn/customization/custom-nodes) it is + * wrapped in a component that enables basic functionality like selection and + * dragging. Your custom node receives `NodeProps` as props. + * + * @public + * @example + * ```tsx + *import { useState } from 'react'; + *import { NodeProps, Node } from '@xyflow/react'; + * + *export type CounterNode = Node<{ initialCount?: number }, 'counter'>; + * + *export default function CounterNode(props: NodeProps) { + * const [count, setCount] = useState(props.data?.initialCount ?? 0); + * + * return ( + *
+ *

Count: {count}

+ * + *
+ * ); + *} + *``` + */ +export type NodeProps = NodePropsBase; +//# sourceMappingURL=nodes.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/types/nodes.d.ts.map b/node_modules/@xyflow/react/dist/esm/types/nodes.d.ts.map new file mode 100644 index 0000000..a566f40 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/types/nodes.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../src/types/nodes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,IAAI,eAAe,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACnH,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAExH,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC;;;;;;GAMG;AACH,MAAM,MAAM,IAAI,CACd,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClE,QAAQ,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,IACtD,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG;IACjC,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB;;OAEG;IACH,aAAa,CAAC,EAAE,IAAI,CAClB,cAAc,CAAC,cAAc,CAAC,EAC9B,IAAI,GAAG,OAAO,GAAG,WAAW,GAAG,WAAW,GAAG,MAAM,GAAG,YAAY,GAAG,MAAM,aAAa,CAAC,cAAc,CAAC,CACzG,CAAC;CACH,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,gBAAgB,CAAC,QAAQ,CAAC,CAAC;AAEpF,MAAM,MAAM,gBAAgB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;AAC9G,MAAM,MAAM,oBAAoB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;AACrH,MAAM,MAAM,UAAU,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CACrD,KAAK,EAAE,eAAe,EACtB,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,QAAQ,EAAE,KACd,IAAI,CAAC;AAEV,MAAM,MAAM,gBAAgB,CAAC,QAAQ,SAAS,IAAI,IAAI;IACpD,EAAE,EAAE,MAAM,CAAC;IACX,gBAAgB,EAAE,OAAO,CAAC;IAC1B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACrC,aAAa,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC3C,YAAY,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC1C,WAAW,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACzC,YAAY,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC1C,aAAa,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC3C,cAAc,EAAE,cAAc,GAAG,IAAI,CAAC;IACtC,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB,EAAE,OAAO,CAAC;IAC7B,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,WAAW,GACnB,IAAI,CAAC;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC,GACvD,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,MAAM,SAAS,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,aAAa,CAAC,QAAQ,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/types/store.d.ts b/node_modules/@xyflow/react/dist/esm/types/store.d.ts new file mode 100644 index 0000000..6c45205 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/types/store.d.ts @@ -0,0 +1,112 @@ +import { ConnectionMode, withResolvers, type ConnectionState, type CoordinateExtent, type InternalNodeUpdate, type UpdateNodePositions, type NodeOrigin, type OnConnect, type OnError, type OnViewportChange, type SelectionRect, type SnapGrid, type Handle, type Transform, type PanZoomInstance, type PanBy, type OnConnectStart, type OnConnectEnd, type OnSelectionDrag, type OnMoveStart, type OnMove, type OnMoveEnd, type UpdateConnection, type EdgeLookup, type ConnectionLookup, type NodeLookup, type NodeChange, type EdgeChange, type ParentLookup, type AriaLabelConfig, SetCenter } from '@xyflow/system'; +import type { Edge, Node, OnNodesChange, OnEdgesChange, DefaultEdgeOptions, FitViewOptions, OnNodesDelete, OnEdgesDelete, OnSelectionChangeFunc, UnselectNodesAndEdgesParams, OnDelete, OnNodeDrag, OnBeforeDelete, IsValidConnection, InternalNode } from '.'; +export type ReactFlowStore = { + rfId: string; + width: number; + height: number; + transform: Transform; + nodes: NodeType[]; + nodesInitialized: boolean; + nodeLookup: NodeLookup>; + parentLookup: ParentLookup>; + edges: EdgeType[]; + edgeLookup: EdgeLookup; + connectionLookup: ConnectionLookup; + onNodesChange: OnNodesChange | null; + onEdgesChange: OnEdgesChange | null; + hasDefaultNodes: boolean; + hasDefaultEdges: boolean; + domNode: HTMLDivElement | null; + paneDragging: boolean; + noPanClassName: string; + panZoom: PanZoomInstance | null; + minZoom: number; + maxZoom: number; + translateExtent: CoordinateExtent; + nodeExtent: CoordinateExtent; + nodeOrigin: NodeOrigin; + nodeDragThreshold: number; + nodesSelectionActive: boolean; + userSelectionActive: boolean; + userSelectionRect: SelectionRect | null; + connection: ConnectionState>; + connectionMode: ConnectionMode; + connectionClickStartHandle: (Pick & Required>) | null; + snapToGrid: boolean; + snapGrid: SnapGrid; + nodesDraggable: boolean; + autoPanOnNodeFocus: boolean; + nodesConnectable: boolean; + nodesFocusable: boolean; + edgesFocusable: boolean; + edgesReconnectable: boolean; + elementsSelectable: boolean; + elevateNodesOnSelect: boolean; + elevateEdgesOnSelect: boolean; + selectNodesOnDrag: boolean; + multiSelectionActive: boolean; + onNodeDragStart?: OnNodeDrag; + onNodeDrag?: OnNodeDrag; + onNodeDragStop?: OnNodeDrag; + onSelectionDragStart?: OnSelectionDrag; + onSelectionDrag?: OnSelectionDrag; + onSelectionDragStop?: OnSelectionDrag; + onMoveStart?: OnMoveStart; + onMove?: OnMove; + onMoveEnd?: OnMoveEnd; + onConnect?: OnConnect; + onConnectStart?: OnConnectStart; + onConnectEnd?: OnConnectEnd; + onClickConnectStart?: OnConnectStart; + onClickConnectEnd?: OnConnectEnd; + connectOnClick: boolean; + defaultEdgeOptions?: DefaultEdgeOptions; + fitViewQueued: boolean; + fitViewOptions: FitViewOptions | undefined; + fitViewResolver: ReturnType> | null; + onNodesDelete?: OnNodesDelete; + onEdgesDelete?: OnEdgesDelete; + onDelete?: OnDelete; + onError?: OnError; + onViewportChangeStart?: OnViewportChange; + onViewportChange?: OnViewportChange; + onViewportChangeEnd?: OnViewportChange; + onBeforeDelete?: OnBeforeDelete; + onSelectionChangeHandlers: OnSelectionChangeFunc[]; + ariaLiveMessage: string; + autoPanOnConnect: boolean; + autoPanOnNodeDrag: boolean; + autoPanSpeed: number; + connectionRadius: number; + isValidConnection?: IsValidConnection; + lib: string; + debug: boolean; + ariaLabelConfig: AriaLabelConfig; +}; +export type ReactFlowActions = { + setNodes: (nodes: NodeType[]) => void; + setEdges: (edges: EdgeType[]) => void; + setDefaultNodesAndEdges: (nodes?: NodeType[], edges?: EdgeType[]) => void; + updateNodeInternals: (updates: Map, params?: { + triggerFitView: boolean; + }) => void; + updateNodePositions: UpdateNodePositions; + resetSelectedElements: () => void; + unselectNodesAndEdges: (params?: UnselectNodesAndEdgesParams) => void; + addSelectedNodes: (nodeIds: string[]) => void; + addSelectedEdges: (edgeIds: string[]) => void; + setMinZoom: (minZoom: number) => void; + setMaxZoom: (maxZoom: number) => void; + setTranslateExtent: (translateExtent: CoordinateExtent) => void; + setNodeExtent: (nodeExtent: CoordinateExtent) => void; + cancelConnection: () => void; + updateConnection: UpdateConnection>; + reset: () => void; + triggerNodeChanges: (changes: NodeChange[]) => void; + triggerEdgeChanges: (changes: EdgeChange[]) => void; + panBy: PanBy; + setCenter: SetCenter; + setPaneClickDistance: (distance: number) => void; +}; +export type ReactFlowState = ReactFlowStore & ReactFlowActions; +//# sourceMappingURL=store.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/types/store.d.ts.map b/node_modules/@xyflow/react/dist/esm/types/store.d.ts.map new file mode 100644 index 0000000..8e3f564 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/types/store.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/types/store.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,aAAa,EACb,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,OAAO,EACZ,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,MAAM,EACX,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,KAAK,EACV,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,SAAS,EACV,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EACV,IAAI,EACJ,IAAI,EACJ,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,aAAa,EACb,qBAAqB,EACrB,2BAA2B,EAC3B,QAAQ,EACR,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,YAAY,EACb,MAAM,GAAG,CAAC;AAEX,MAAM,MAAM,cAAc,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI;IACvF,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,UAAU,EAAE,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC/C,YAAY,EAAE,YAAY,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;IACnD,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,UAAU,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IACjC,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,aAAa,EAAE,aAAa,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;IAC9C,aAAa,EAAE,aAAa,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;IAC9C,eAAe,EAAE,OAAO,CAAC;IACzB,eAAe,EAAE,OAAO,CAAC;IACzB,OAAO,EAAE,cAAc,GAAG,IAAI,CAAC;IAC/B,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,gBAAgB,CAAC;IAClC,UAAU,EAAE,gBAAgB,CAAC;IAC7B,UAAU,EAAE,UAAU,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAE1B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,iBAAiB,EAAE,aAAa,GAAG,IAAI,CAAC;IAExC,UAAU,EAAE,eAAe,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;IACpD,cAAc,EAAE,cAAc,CAAC;IAC/B,0BAA0B,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,GAAG,IAAI,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAEpG,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,QAAQ,CAAC;IAEnB,cAAc,EAAE,OAAO,CAAC;IACxB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,iBAAiB,EAAE,OAAO,CAAC;IAE3B,oBAAoB,EAAE,OAAO,CAAC;IAE9B,eAAe,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IACvC,UAAU,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IAClC,cAAc,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IAEtC,oBAAoB,CAAC,EAAE,eAAe,CAAC;IACvC,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,mBAAmB,CAAC,EAAE,eAAe,CAAC;IAEtC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,YAAY,CAAC,EAAE,YAAY,CAAC;IAE5B,mBAAmB,CAAC,EAAE,cAAc,CAAC;IACrC,iBAAiB,CAAC,EAAE,YAAY,CAAC;IAEjC,cAAc,EAAE,OAAO,CAAC;IACxB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IAExC,aAAa,EAAE,OAAO,CAAC;IACvB,cAAc,EAAE,cAAc,GAAG,SAAS,CAAC;IAC3C,eAAe,EAAE,UAAU,CAAC,OAAO,aAAa,CAAC,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAElE,aAAa,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IACxC,aAAa,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IACxC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAGlB,qBAAqB,CAAC,EAAE,gBAAgB,CAAC;IACzC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,mBAAmB,CAAC,EAAE,gBAAgB,CAAC;IACvC,cAAc,CAAC,EAAE,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAEpD,yBAAyB,EAAE,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC;IAEvE,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IAEzB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAEhD,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,OAAO,CAAC;IACf,eAAe,EAAE,eAAe,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,gBAAgB,CAAC,QAAQ,SAAS,IAAI,EAAE,QAAQ,SAAS,IAAI,IAAI;IAC3E,QAAQ,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;IACtC,QAAQ,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;IACtC,uBAAuB,EAAE,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,EAAE,KAAK,CAAC,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;IAC1E,mBAAmB,EAAE,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM,CAAC,EAAE;QAAE,cAAc,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IAC9G,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,qBAAqB,EAAE,MAAM,IAAI,CAAC;IAClC,qBAAqB,EAAE,CAAC,MAAM,CAAC,EAAE,2BAA2B,CAAC,QAAQ,EAAE,QAAQ,CAAC,KAAK,IAAI,CAAC;IAC1F,gBAAgB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC9C,gBAAgB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC9C,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,kBAAkB,EAAE,CAAC,eAAe,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAChE,aAAa,EAAE,CAAC,UAAU,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACtD,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,gBAAgB,EAAE,gBAAgB,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC3D,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,kBAAkB,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE,KAAK,IAAI,CAAC;IAC9D,kBAAkB,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE,KAAK,IAAI,CAAC;IAC9D,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,SAAS,CAAC;IACrB,oBAAoB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CAClD,CAAC;AAEF,MAAM,MAAM,cAAc,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,cAAc,CACrG,QAAQ,EACR,QAAQ,CACT,GACC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/utils/changes.d.ts b/node_modules/@xyflow/react/dist/esm/utils/changes.d.ts new file mode 100644 index 0000000..f9e0936 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/utils/changes.d.ts @@ -0,0 +1,87 @@ +import { EdgeLookup, NodeLookup, EdgeChange, NodeChange, NodeSelectionChange, EdgeSelectionChange, NodeRemoveChange, EdgeRemoveChange } from '@xyflow/system'; +import type { Node, Edge, InternalNode } from '../types'; +/** + * Drop in function that applies node changes to an array of nodes. + * @public + * @param changes - Array of changes to apply. + * @param nodes - Array of nodes to apply the changes to. + * @returns Array of updated nodes. + * @example + *```tsx + *import { useState, useCallback } from 'react'; + *import { ReactFlow, applyNodeChanges, type Node, type Edge, type OnNodesChange } from '@xyflow/react'; + * + *export default function Flow() { + * const [nodes, setNodes] = useState([]); + * const [edges, setEdges] = useState([]); + * const onNodesChange: OnNodesChange = useCallback( + * (changes) => { + * setNodes((oldNodes) => applyNodeChanges(changes, oldNodes)); + * }, + * [setNodes], + * ); + * + * return ( + * + * ); + *} + *``` + * @remarks Various events on the component can produce an {@link NodeChange} + * that describes how to update the edges of your flow in some way. + * If you don't need any custom behaviour, this util can be used to take an array + * of these changes and apply them to your edges. + */ +export declare function applyNodeChanges(changes: NodeChange[], nodes: NodeType[]): NodeType[]; +/** + * Drop in function that applies edge changes to an array of edges. + * @public + * @param changes - Array of changes to apply. + * @param edges - Array of edge to apply the changes to. + * @returns Array of updated edges. + * @example + * ```tsx + *import { useState, useCallback } from 'react'; + *import { ReactFlow, applyEdgeChanges } from '@xyflow/react'; + * + *export default function Flow() { + * const [nodes, setNodes] = useState([]); + * const [edges, setEdges] = useState([]); + * const onEdgesChange = useCallback( + * (changes) => { + * setEdges((oldEdges) => applyEdgeChanges(changes, oldEdges)); + * }, + * [setEdges], + * ); + * + * return ( + * + * ); + *} + *``` + * @remarks Various events on the component can produce an {@link EdgeChange} + * that describes how to update the edges of your flow in some way. + * If you don't need any custom behaviour, this util can be used to take an array + * of these changes and apply them to your edges. + */ +export declare function applyEdgeChanges(changes: EdgeChange[], edges: EdgeType[]): EdgeType[]; +export declare function createSelectionChange(id: string, selected: boolean): NodeSelectionChange | EdgeSelectionChange; +export declare function getSelectionChanges(items: Map, selectedIds?: Set, mutateItem?: boolean): NodeSelectionChange[] | EdgeSelectionChange[]; +/** + * This function is used to find the changes between two sets of elements. + * It is used to determine which nodes or edges have been added, removed or replaced. + * + * @internal + * @param params.items = the next set of elements (nodes or edges) + * @param params.lookup = a lookup map of the current store elements + * @returns an array of changes + */ +export declare function getElementsDiffChanges({ items, lookup, }: { + items: Node[] | undefined; + lookup: NodeLookup>; +}): NodeChange[]; +export declare function getElementsDiffChanges({ items, lookup, }: { + items: Edge[] | undefined; + lookup: EdgeLookup; +}): EdgeChange[]; +export declare function elementToRemoveChange(item: T): NodeRemoveChange | EdgeRemoveChange; +//# sourceMappingURL=changes.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/utils/changes.d.ts.map b/node_modules/@xyflow/react/dist/esm/utils/changes.d.ts.map new file mode 100644 index 0000000..a0847ac --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/utils/changes.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"changes.d.ts","sourceRoot":"","sources":["../../src/utils/changes.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AA2IzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAC3D,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE,EAC/B,KAAK,EAAE,QAAQ,EAAE,GAChB,QAAQ,EAAE,CAEZ;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAC3D,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE,EAC/B,KAAK,EAAE,QAAQ,EAAE,GAChB,QAAQ,EAAE,CAEZ;AAED,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,mBAAmB,GAAG,mBAAmB,CAM9G;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,EACvB,WAAW,GAAE,GAAG,CAAC,MAAM,CAAa,EACpC,UAAU,UAAQ,GACjB,mBAAmB,EAAE,GAAG,mBAAmB,EAAE,CAqB/C;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,KAAK,EACL,MAAM,GACP,EAAE;IACD,KAAK,EAAE,IAAI,EAAE,GAAG,SAAS,CAAC;IAC1B,MAAM,EAAE,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;CACxC,GAAG,UAAU,EAAE,CAAC;AACjB,wBAAgB,sBAAsB,CAAC,EACrC,KAAK,EACL,MAAM,GACP,EAAE;IACD,KAAK,EAAE,IAAI,EAAE,GAAG,SAAS,CAAC;IAC1B,MAAM,EAAE,UAAU,CAAC;CACpB,GAAG,UAAU,EAAE,CAAC;AAmCjB,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,IAAI,GAAG,IAAI,EAAE,IAAI,EAAE,CAAC,GAAG,gBAAgB,GAAG,gBAAgB,CAKzG"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/utils/general.d.ts b/node_modules/@xyflow/react/dist/esm/utils/general.d.ts new file mode 100644 index 0000000..1bf6d18 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/utils/general.d.ts @@ -0,0 +1,48 @@ +import { type Ref, type RefAttributes, JSX } from 'react'; +import type { Edge, Node } from '../types'; +/** + * Test whether an object is usable as an [`Node`](/api-reference/types/node). + * In TypeScript this is a type guard that will narrow the type of whatever you pass in to + * [`Node`](/api-reference/types/node) if it returns `true`. + * + * @public + * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Node if it returns true + * @param element - The element to test. + * @returns Tests whether the provided value can be used as a `Node`. If you're using TypeScript, + * this function acts as a type guard and will narrow the type of the value to `Node` if it returns + * `true`. + * + * @example + * ```js + *import { isNode } from '@xyflow/react'; + * + *if (isNode(node)) { + * // ... + *} + *``` + */ +export declare const isNode: (element: unknown) => element is NodeType; +/** + * Test whether an object is usable as an [`Edge`](/api-reference/types/edge). + * In TypeScript this is a type guard that will narrow the type of whatever you pass in to + * [`Edge`](/api-reference/types/edge) if it returns `true`. + * + * @public + * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Edge if it returns true + * @param element - The element to test + * @returns Tests whether the provided value can be used as an `Edge`. If you're using TypeScript, + * this function acts as a type guard and will narrow the type of the value to `Edge` if it returns + * `true`. + * + * @example + * ```js + *import { isEdge } from '@xyflow/react'; + * + *if (isEdge(edge)) { + * // ... + *} + *``` + */ +export declare const isEdge: (element: unknown) => element is EdgeType; +export declare function fixedForwardRef(render: (props: P, ref: Ref) => JSX.Element): (props: P & RefAttributes) => JSX.Element; +//# sourceMappingURL=general.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/utils/general.d.ts.map b/node_modules/@xyflow/react/dist/esm/utils/general.d.ts.map new file mode 100644 index 0000000..7825da5 --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/utils/general.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../src/utils/general.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,aAAa,EAAc,GAAG,EAAE,MAAM,OAAO,CAAC;AAGtE,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,MAAM,GAAI,QAAQ,SAAS,IAAI,kBAAkB,OAAO,KAAG,OAAO,IAAI,QACpD,CAAC;AAEhC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,MAAM,GAAI,QAAQ,SAAS,IAAI,kBAAkB,OAAO,KAAG,OAAO,IAAI,QACpD,CAAC;AAGhC,wBAAgB,eAAe,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,EACvC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,OAAO,GAC7C,CAAC,KAAK,EAAE,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,OAAO,CAG9C"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/utils/index.d.ts b/node_modules/@xyflow/react/dist/esm/utils/index.d.ts new file mode 100644 index 0000000..21f04cb --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/utils/index.d.ts @@ -0,0 +1,3 @@ +export * from './changes'; +export * from './general'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/esm/utils/index.d.ts.map b/node_modules/@xyflow/react/dist/esm/utils/index.d.ts.map new file mode 100644 index 0000000..95dc8ba --- /dev/null +++ b/node_modules/@xyflow/react/dist/esm/utils/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/style.css b/node_modules/@xyflow/react/dist/style.css new file mode 100644 index 0000000..036f322 --- /dev/null +++ b/node_modules/@xyflow/react/dist/style.css @@ -0,0 +1,614 @@ +/* this gets exported as style.css and can be used for the default theming */ +/* these are the necessary styles for React/Svelte Flow, they get used by base.css and style.css */ +.react-flow { + direction: ltr; + + --xy-edge-stroke-default: #b1b1b7; + --xy-edge-stroke-width-default: 1; + --xy-edge-stroke-selected-default: #555; + + --xy-connectionline-stroke-default: #b1b1b7; + --xy-connectionline-stroke-width-default: 1; + + --xy-attribution-background-color-default: rgba(255, 255, 255, 0.5); + + --xy-minimap-background-color-default: #fff; + --xy-minimap-mask-background-color-default: rgba(240, 240, 240, 0.6); + --xy-minimap-mask-stroke-color-default: transparent; + --xy-minimap-mask-stroke-width-default: 1; + --xy-minimap-node-background-color-default: #e2e2e2; + --xy-minimap-node-stroke-color-default: transparent; + --xy-minimap-node-stroke-width-default: 2; + + --xy-background-color-default: transparent; + --xy-background-pattern-dots-color-default: #91919a; + --xy-background-pattern-lines-color-default: #eee; + --xy-background-pattern-cross-color-default: #e2e2e2; + background-color: var(--xy-background-color, var(--xy-background-color-default)); + --xy-node-color-default: inherit; + --xy-node-border-default: 1px solid #1a192b; + --xy-node-background-color-default: #fff; + --xy-node-group-background-color-default: rgba(240, 240, 240, 0.25); + --xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, 0.08); + --xy-node-boxshadow-selected-default: 0 0 0 0.5px #1a192b; + --xy-node-border-radius-default: 3px; + + --xy-handle-background-color-default: #1a192b; + --xy-handle-border-color-default: #fff; + + --xy-selection-background-color-default: rgba(0, 89, 220, 0.08); + --xy-selection-border-default: 1px dotted rgba(0, 89, 220, 0.8); + + --xy-controls-button-background-color-default: #fefefe; + --xy-controls-button-background-color-hover-default: #f4f4f4; + --xy-controls-button-color-default: inherit; + --xy-controls-button-color-hover-default: inherit; + --xy-controls-button-border-color-default: #eee; + --xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, 0.08); + + --xy-edge-label-background-color-default: #ffffff; + --xy-edge-label-color-default: inherit; + --xy-resize-background-color-default: #3367d9; +} +.react-flow.dark { + --xy-edge-stroke-default: #3e3e3e; + --xy-edge-stroke-width-default: 1; + --xy-edge-stroke-selected-default: #727272; + + --xy-connectionline-stroke-default: #b1b1b7; + --xy-connectionline-stroke-width-default: 1; + + --xy-attribution-background-color-default: rgba(150, 150, 150, 0.25); + + --xy-minimap-background-color-default: #141414; + --xy-minimap-mask-background-color-default: rgba(60, 60, 60, 0.6); + --xy-minimap-mask-stroke-color-default: transparent; + --xy-minimap-mask-stroke-width-default: 1; + --xy-minimap-node-background-color-default: #2b2b2b; + --xy-minimap-node-stroke-color-default: transparent; + --xy-minimap-node-stroke-width-default: 2; + + --xy-background-color-default: #141414; + --xy-background-pattern-dots-color-default: #777; + --xy-background-pattern-lines-color-default: #777; + --xy-background-pattern-cross-color-default: #777; + --xy-node-color-default: #f8f8f8; + --xy-node-border-default: 1px solid #3c3c3c; + --xy-node-background-color-default: #1e1e1e; + --xy-node-group-background-color-default: rgba(240, 240, 240, 0.25); + --xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, 0.08); + --xy-node-boxshadow-selected-default: 0 0 0 0.5px #999; + + --xy-handle-background-color-default: #bebebe; + --xy-handle-border-color-default: #1e1e1e; + + --xy-selection-background-color-default: rgba(200, 200, 220, 0.08); + --xy-selection-border-default: 1px dotted rgba(200, 200, 220, 0.8); + + --xy-controls-button-background-color-default: #2b2b2b; + --xy-controls-button-background-color-hover-default: #3e3e3e; + --xy-controls-button-color-default: #f8f8f8; + --xy-controls-button-color-hover-default: #fff; + --xy-controls-button-border-color-default: #5b5b5b; + --xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, 0.08); + + --xy-edge-label-background-color-default: #141414; + --xy-edge-label-color-default: #f8f8f8; +} +.react-flow__background { + background-color: var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default))); + pointer-events: none; + z-index: -1; +} +.react-flow__container { + position: absolute; + width: 100%; + height: 100%; + top: 0; + left: 0; +} +.react-flow__pane { + z-index: 1; +} +.react-flow__pane.draggable { + cursor: grab; + } +.react-flow__pane.dragging { + cursor: grabbing; + } +.react-flow__pane.selection { + cursor: pointer; + } +.react-flow__viewport { + transform-origin: 0 0; + z-index: 2; + pointer-events: none; +} +.react-flow__renderer { + z-index: 4; +} +.react-flow__selection { + z-index: 6; +} +.react-flow__nodesselection-rect:focus, +.react-flow__nodesselection-rect:focus-visible { + outline: none; +} +.react-flow__edge-path { + stroke: var(--xy-edge-stroke, var(--xy-edge-stroke-default)); + stroke-width: var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default)); + fill: none; +} +.react-flow__connection-path { + stroke: var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default)); + stroke-width: var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default)); + fill: none; +} +.react-flow .react-flow__edges { + position: absolute; +} +.react-flow .react-flow__edges svg { + overflow: visible; + position: absolute; + pointer-events: none; + } +.react-flow__edge { + pointer-events: visibleStroke; +} +.react-flow__edge.selectable { + cursor: pointer; + } +.react-flow__edge.animated path { + stroke-dasharray: 5; + animation: dashdraw 0.5s linear infinite; + } +.react-flow__edge.animated path.react-flow__edge-interaction { + stroke-dasharray: none; + animation: none; + } +.react-flow__edge.inactive { + pointer-events: none; + } +.react-flow__edge.selected, + .react-flow__edge:focus, + .react-flow__edge:focus-visible { + outline: none; + } +.react-flow__edge.selected .react-flow__edge-path, + .react-flow__edge.selectable:focus .react-flow__edge-path, + .react-flow__edge.selectable:focus-visible .react-flow__edge-path { + stroke: var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default)); + } +.react-flow__edge-textwrapper { + pointer-events: all; + } +.react-flow__edge .react-flow__edge-text { + pointer-events: none; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + } +.react-flow__connection { + pointer-events: none; +} +.react-flow__connection .animated { + stroke-dasharray: 5; + animation: dashdraw 0.5s linear infinite; + } +svg.react-flow__connectionline { + z-index: 1001; + overflow: visible; + position: absolute; +} +.react-flow__nodes { + pointer-events: none; + transform-origin: 0 0; +} +.react-flow__node { + position: absolute; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + pointer-events: all; + transform-origin: 0 0; + box-sizing: border-box; + cursor: default; +} +.react-flow__node.selectable { + cursor: pointer; + } +.react-flow__node.draggable { + cursor: grab; + pointer-events: all; + } +.react-flow__node.draggable.dragging { + cursor: grabbing; + } +.react-flow__nodesselection { + z-index: 3; + transform-origin: left top; + pointer-events: none; +} +.react-flow__nodesselection-rect { + position: absolute; + pointer-events: all; + cursor: grab; + } +.react-flow__handle { + position: absolute; + pointer-events: none; + min-width: 5px; + min-height: 5px; + width: 6px; + height: 6px; + background-color: var(--xy-handle-background-color, var(--xy-handle-background-color-default)); + border: 1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default)); + border-radius: 100%; +} +.react-flow__handle.connectingfrom { + pointer-events: all; + } +.react-flow__handle.connectionindicator { + pointer-events: all; + cursor: crosshair; + } +.react-flow__handle-bottom { + top: auto; + left: 50%; + bottom: 0; + transform: translate(-50%, 50%); + } +.react-flow__handle-top { + top: 0; + left: 50%; + transform: translate(-50%, -50%); + } +.react-flow__handle-left { + top: 50%; + left: 0; + transform: translate(-50%, -50%); + } +.react-flow__handle-right { + top: 50%; + right: 0; + transform: translate(50%, -50%); + } +.react-flow__edgeupdater { + cursor: move; + pointer-events: all; +} +.react-flow__panel { + position: absolute; + z-index: 5; + margin: 15px; +} +.react-flow__panel.top { + top: 0; + } +.react-flow__panel.bottom { + bottom: 0; + } +.react-flow__panel.top.center, .react-flow__panel.bottom.center { + left: 50%; + transform: translateX(-15px) translateX(-50%); + } +.react-flow__panel.left { + left: 0; + } +.react-flow__panel.right { + right: 0; + } +.react-flow__panel.left.center, .react-flow__panel.right.center { + top: 50%; + transform: translateY(-15px) translateY(-50%); + } +.react-flow__attribution { + font-size: 10px; + background: var(--xy-attribution-background-color, var(--xy-attribution-background-color-default)); + padding: 2px 3px; + margin: 0; +} +.react-flow__attribution a { + text-decoration: none; + color: #999; + } +@keyframes dashdraw { + from { + stroke-dashoffset: 10; + } +} +.react-flow__edgelabel-renderer { + position: absolute; + width: 100%; + height: 100%; + pointer-events: none; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + left: 0; + top: 0; +} +.react-flow__viewport-portal { + position: absolute; + width: 100%; + height: 100%; + left: 0; + top: 0; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; +} +.react-flow__minimap { + background: var( + --xy-minimap-background-color-props, + var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) + ); +} +.react-flow__minimap-svg { + display: block; + } +.react-flow__minimap-mask { + fill: var( + --xy-minimap-mask-background-color-props, + var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) + ); + stroke: var( + --xy-minimap-mask-stroke-color-props, + var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) + ); + stroke-width: var( + --xy-minimap-mask-stroke-width-props, + var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) + ); + } +.react-flow__minimap-node { + fill: var( + --xy-minimap-node-background-color-props, + var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) + ); + stroke: var( + --xy-minimap-node-stroke-color-props, + var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) + ); + stroke-width: var( + --xy-minimap-node-stroke-width-props, + var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) + ); + } +.react-flow__background-pattern.dots { + fill: var( + --xy-background-pattern-color-props, + var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) + ); + } +.react-flow__background-pattern.lines { + stroke: var( + --xy-background-pattern-color-props, + var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) + ); + } +.react-flow__background-pattern.cross { + stroke: var( + --xy-background-pattern-color-props, + var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) + ); + } +.react-flow__controls { + display: flex; + flex-direction: column; + box-shadow: var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default)); +} +.react-flow__controls.horizontal { + flex-direction: row; + } +.react-flow__controls-button { + display: flex; + justify-content: center; + align-items: center; + height: 26px; + width: 26px; + padding: 4px; + border: none; + background: var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default)); + border-bottom: 1px solid + var( + --xy-controls-button-border-color-props, + var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) + ); + color: var( + --xy-controls-button-color-props, + var(--xy-controls-button-color, var(--xy-controls-button-color-default)) + ); + cursor: pointer; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + } +.react-flow__controls-button svg { + width: 100%; + max-width: 12px; + max-height: 12px; + fill: currentColor; + } +.react-flow__edge.updating .react-flow__edge-path { + stroke: #777; + } +.react-flow__edge-text { + font-size: 10px; + } +.react-flow__node.selectable:focus, + .react-flow__node.selectable:focus-visible { + outline: none; + } +.react-flow__node-input, +.react-flow__node-default, +.react-flow__node-output, +.react-flow__node-group { + padding: 10px; + border-radius: var(--xy-node-border-radius, var(--xy-node-border-radius-default)); + width: 150px; + font-size: 12px; + color: var(--xy-node-color, var(--xy-node-color-default)); + text-align: center; + border: var(--xy-node-border, var(--xy-node-border-default)); + background-color: var(--xy-node-background-color, var(--xy-node-background-color-default)); +} +.react-flow__node-input.selectable:hover, .react-flow__node-default.selectable:hover, .react-flow__node-output.selectable:hover, .react-flow__node-group.selectable:hover { + box-shadow: var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default)); + } +.react-flow__node-input.selectable.selected, + .react-flow__node-input.selectable:focus, + .react-flow__node-input.selectable:focus-visible, + .react-flow__node-default.selectable.selected, + .react-flow__node-default.selectable:focus, + .react-flow__node-default.selectable:focus-visible, + .react-flow__node-output.selectable.selected, + .react-flow__node-output.selectable:focus, + .react-flow__node-output.selectable:focus-visible, + .react-flow__node-group.selectable.selected, + .react-flow__node-group.selectable:focus, + .react-flow__node-group.selectable:focus-visible { + box-shadow: var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default)); + } +.react-flow__node-group { + background-color: var(--xy-node-group-background-color, var(--xy-node-group-background-color-default)); +} +.react-flow__nodesselection-rect, +.react-flow__selection { + background: var(--xy-selection-background-color, var(--xy-selection-background-color-default)); + border: var(--xy-selection-border, var(--xy-selection-border-default)); +} +.react-flow__nodesselection-rect:focus, + .react-flow__nodesselection-rect:focus-visible, + .react-flow__selection:focus, + .react-flow__selection:focus-visible { + outline: none; + } +.react-flow__controls-button:hover { + background: var( + --xy-controls-button-background-color-hover-props, + var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) + ); + color: var( + --xy-controls-button-color-hover-props, + var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) + ); + } +.react-flow__controls-button:disabled { + pointer-events: none; + } +.react-flow__controls-button:disabled svg { + fill-opacity: 0.4; + } +.react-flow__controls-button:last-child { + border-bottom: none; + } +.react-flow__controls.horizontal .react-flow__controls-button { + border-bottom: none; + border-right: 1px solid + var( + --xy-controls-button-border-color-props, + var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) + ); + } +.react-flow__controls.horizontal .react-flow__controls-button:last-child { + border-right: none; + } +.react-flow__resize-control { + position: absolute; +} +.react-flow__resize-control.left, +.react-flow__resize-control.right { + cursor: ew-resize; +} +.react-flow__resize-control.top, +.react-flow__resize-control.bottom { + cursor: ns-resize; +} +.react-flow__resize-control.top.left, +.react-flow__resize-control.bottom.right { + cursor: nwse-resize; +} +.react-flow__resize-control.bottom.left, +.react-flow__resize-control.top.right { + cursor: nesw-resize; +} +/* handle styles */ +.react-flow__resize-control.handle { + width: 5px; + height: 5px; + border: 1px solid #fff; + border-radius: 1px; + background-color: var(--xy-resize-background-color, var(--xy-resize-background-color-default)); + translate: -50% -50%; +} +.react-flow__resize-control.handle.left { + left: 0; + top: 50%; +} +.react-flow__resize-control.handle.right { + left: 100%; + top: 50%; +} +.react-flow__resize-control.handle.top { + left: 50%; + top: 0; +} +.react-flow__resize-control.handle.bottom { + left: 50%; + top: 100%; +} +.react-flow__resize-control.handle.top.left { + left: 0; +} +.react-flow__resize-control.handle.bottom.left { + left: 0; +} +.react-flow__resize-control.handle.top.right { + left: 100%; +} +.react-flow__resize-control.handle.bottom.right { + left: 100%; +} +/* line styles */ +.react-flow__resize-control.line { + border-color: var(--xy-resize-background-color, var(--xy-resize-background-color-default)); + border-width: 0; + border-style: solid; +} +.react-flow__resize-control.line.left, +.react-flow__resize-control.line.right { + width: 1px; + transform: translate(-50%, 0); + top: 0; + height: 100%; +} +.react-flow__resize-control.line.left { + left: 0; + border-left-width: 1px; +} +.react-flow__resize-control.line.right { + left: 100%; + border-right-width: 1px; +} +.react-flow__resize-control.line.top, +.react-flow__resize-control.line.bottom { + height: 1px; + transform: translate(0, -50%); + left: 0; + width: 100%; +} +.react-flow__resize-control.line.top { + top: 0; + border-top-width: 1px; +} +.react-flow__resize-control.line.bottom { + border-bottom-width: 1px; + top: 100%; +} +.react-flow__edge-textbg { + fill: var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default)); +} +.react-flow__edge-text { + fill: var(--xy-edge-label-color, var(--xy-edge-label-color-default)); +} diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/Background/Background.d.ts b/node_modules/@xyflow/react/dist/umd/additional-components/Background/Background.d.ts new file mode 100644 index 0000000..00c489a --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/Background/Background.d.ts @@ -0,0 +1,61 @@ +import { type BackgroundProps } from './types'; +declare function BackgroundComponent({ id, variant, gap, size, lineWidth, offset, color, bgColor, style, className, patternClassName, }: BackgroundProps): import("react/jsx-runtime").JSX.Element; +declare namespace BackgroundComponent { + var displayName: string; +} +/** + * The `` component makes it convenient to render different types of backgrounds common in node-based UIs. It comes with three variants: lines, dots and cross. + * + * @example + * + * A simple example of how to use the Background component. + * + * ```tsx + * import { useState } from 'react'; + * import { ReactFlow, Background, BackgroundVariant } from '@xyflow/react'; + * + * export default function Flow() { + * return ( + * + * + * + * ); + * } + * ``` + * + * @example + * + * In this example you can see how to combine multiple backgrounds + * + * ```tsx + * import { ReactFlow, Background, BackgroundVariant } from '@xyflow/react'; + * import '@xyflow/react/dist/style.css'; + * + * export default function Flow() { + * return ( + * + * + * + * + * ); + * } + * ``` + * + * @remarks + * + * When combining multiple components it’s important to give each of them a unique id prop! + * + */ +export declare const Background: import("react").MemoExoticComponent; +export {}; +//# sourceMappingURL=Background.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/Background/Background.d.ts.map b/node_modules/@xyflow/react/dist/umd/additional-components/Background/Background.d.ts.map new file mode 100644 index 0000000..18667ac --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/Background/Background.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Background.d.ts","sourceRoot":"","sources":["../../../src/additional-components/Background/Background.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,eAAe,EAAqB,MAAM,SAAS,CAAC;AAWlE,iBAAS,mBAAmB,CAAC,EAC3B,EAAE,EACF,OAAgC,EAEhC,GAAQ,EAER,IAAI,EACJ,SAAa,EACb,MAAU,EACV,KAAK,EACL,OAAO,EACP,KAAK,EACL,SAAS,EACT,gBAAgB,GACjB,EAAE,eAAe,2CAwDjB;kBAtEQ,mBAAmB;;;AA0E5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,eAAO,MAAM,UAAU,iEAA4B,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/Background/Patterns.d.ts b/node_modules/@xyflow/react/dist/umd/additional-components/Background/Patterns.d.ts new file mode 100644 index 0000000..df8ade2 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/Background/Patterns.d.ts @@ -0,0 +1,15 @@ +import { BackgroundVariant } from './types'; +type LinePatternProps = { + dimensions: [number, number]; + variant: BackgroundVariant; + lineWidth?: number; + className?: string; +}; +export declare function LinePattern({ dimensions, lineWidth, variant, className }: LinePatternProps): import("react/jsx-runtime").JSX.Element; +type DotPatternProps = { + radius: number; + className?: string; +}; +export declare function DotPattern({ radius, className }: DotPatternProps): import("react/jsx-runtime").JSX.Element; +export {}; +//# sourceMappingURL=Patterns.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/Background/Patterns.d.ts.map b/node_modules/@xyflow/react/dist/umd/additional-components/Background/Patterns.d.ts.map new file mode 100644 index 0000000..949a517 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/Background/Patterns.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Patterns.d.ts","sourceRoot":"","sources":["../../../src/additional-components/Background/Patterns.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,KAAK,gBAAgB,GAAG;IACtB,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,WAAW,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,gBAAgB,2CAQ1F;AAED,KAAK,eAAe,GAAG;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,eAAe,2CAIhE"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/Background/index.d.ts b/node_modules/@xyflow/react/dist/umd/additional-components/Background/index.d.ts new file mode 100644 index 0000000..1873c3a --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/Background/index.d.ts @@ -0,0 +1,3 @@ +export { Background } from './Background'; +export { BackgroundVariant, type BackgroundProps } from './types'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/Background/index.d.ts.map b/node_modules/@xyflow/react/dist/umd/additional-components/Background/index.d.ts.map new file mode 100644 index 0000000..be81c4b --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/Background/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/additional-components/Background/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/Background/types.d.ts b/node_modules/@xyflow/react/dist/umd/additional-components/Background/types.d.ts new file mode 100644 index 0000000..50b0708 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/Background/types.d.ts @@ -0,0 +1,59 @@ +import { CSSProperties } from 'react'; +/** + * The three variants are exported as an enum for convenience. You can either import + * the enum and use it like `BackgroundVariant.Lines` or you can use the raw string + * value directly. + * @public + */ +export declare enum BackgroundVariant { + Lines = "lines", + Dots = "dots", + Cross = "cross" +} +/** + * @expand + */ +export type BackgroundProps = { + /** When multiple backgrounds are present on the page, each one should have a unique id. */ + id?: string; + /** Color of the pattern. */ + color?: string; + /** Color of the background. */ + bgColor?: string; + /** Class applied to the container. */ + className?: string; + /** Class applied to the pattern. */ + patternClassName?: string; + /** + * The gap between patterns. Passing in a tuple allows you to control the x and y gap + * independently. + * @default 20 + */ + gap?: number | [number, number]; + /** + * The radius of each dot or the size of each rectangle if `BackgroundVariant.Dots` or + * `BackgroundVariant.Cross` is used. This defaults to 1 or 6 respectively, or ignored if + * `BackgroundVariant.Lines` is used. + */ + size?: number; + /** + * Offset of the pattern. + * @default 0 + */ + offset?: number | [number, number]; + /** + * The stroke thickness used when drawing the pattern. + * @default 1 + */ + lineWidth?: number; + /** + * Variant of the pattern. + * @default BackgroundVariant.Dots + * @example BackgroundVariant.Lines, BackgroundVariant.Dots, BackgroundVariant.Cross + * 'lines', 'dots', 'cross' + */ + variant?: BackgroundVariant; + /** Style applied to the container. */ + style?: CSSProperties; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/Background/types.d.ts.map b/node_modules/@xyflow/react/dist/umd/additional-components/Background/types.d.ts.map new file mode 100644 index 0000000..5f11f58 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/Background/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/additional-components/Background/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC;;;;;GAKG;AACH,oBAAY,iBAAiB;IAC3B,KAAK,UAAU;IACf,IAAI,SAAS;IACb,KAAK,UAAU;CAChB;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,2FAA2F;IAC3F,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,sCAAsC;IACtC,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/Controls/ControlButton.d.ts b/node_modules/@xyflow/react/dist/umd/additional-components/Controls/ControlButton.d.ts new file mode 100644 index 0000000..f16846c --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/Controls/ControlButton.d.ts @@ -0,0 +1,26 @@ +import type { ControlButtonProps } from './types'; +/** + * You can add buttons to the control panel by using the `` component + * and pass it as a child to the [``](/api-reference/components/controls) component. + * + * @public + * @example + *```jsx + *import { MagicWand } from '@radix-ui/react-icons' + *import { ReactFlow, Controls, ControlButton } from '@xyflow/react' + * + *export default function Flow() { + * return ( + * + * + * alert('Something magical just happened. ✨')}> + * + * + * + * + * ) + *} + *``` + */ +export declare function ControlButton({ children, className, ...rest }: ControlButtonProps): import("react/jsx-runtime").JSX.Element; +//# sourceMappingURL=ControlButton.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/Controls/ControlButton.d.ts.map b/node_modules/@xyflow/react/dist/umd/additional-components/Controls/ControlButton.d.ts.map new file mode 100644 index 0000000..ecba112 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/Controls/ControlButton.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ControlButton.d.ts","sourceRoot":"","sources":["../../../src/additional-components/Controls/ControlButton.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,kBAAkB,2CAMjF"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Controls.d.ts b/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Controls.d.ts new file mode 100644 index 0000000..d2029fd --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Controls.d.ts @@ -0,0 +1,29 @@ +import type { ControlProps } from './types'; +declare function ControlsComponent({ style, showZoom, showFitView, showInteractive, fitViewOptions, onZoomIn, onZoomOut, onFitView, onInteractiveChange, className, children, position, orientation, 'aria-label': ariaLabel, }: ControlProps): import("react/jsx-runtime").JSX.Element; +declare namespace ControlsComponent { + var displayName: string; +} +/** + * The `` component renders a small panel that contains convenient + * buttons to zoom in, zoom out, fit the view, and lock the viewport. + * + * @public + * @example + *```tsx + *import { ReactFlow, Controls } from '@xyflow/react' + * + *export default function Flow() { + * return ( + * + * + * + * ) + *} + *``` + * + * @remarks To extend or customise the controls, you can use the [``](/api-reference/components/control-button) component + * + */ +export declare const Controls: import("react").MemoExoticComponent; +export {}; +//# sourceMappingURL=Controls.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Controls.d.ts.map b/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Controls.d.ts.map new file mode 100644 index 0000000..2d540bc --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Controls.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Controls.d.ts","sourceRoot":"","sources":["../../../src/additional-components/Controls/Controls.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAS5C,iBAAS,iBAAiB,CAAC,EACzB,KAAK,EACL,QAAe,EACf,WAAkB,EAClB,eAAsB,EACtB,cAAc,EACd,QAAQ,EACR,SAAS,EACT,SAAS,EACT,mBAAmB,EACnB,SAAS,EACT,QAAQ,EACR,QAAwB,EACxB,WAAwB,EACxB,YAAY,EAAE,SAAS,GACxB,EAAE,YAAY,2CAoFd;kBAnGQ,iBAAiB;;;AAuG1B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,QAAQ,+DAA0B,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/FitView.d.ts b/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/FitView.d.ts new file mode 100644 index 0000000..0484017 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/FitView.d.ts @@ -0,0 +1,2 @@ +export declare function FitViewIcon(): import("react/jsx-runtime").JSX.Element; +//# sourceMappingURL=FitView.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/FitView.d.ts.map b/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/FitView.d.ts.map new file mode 100644 index 0000000..f25c00c --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/FitView.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"FitView.d.ts","sourceRoot":"","sources":["../../../../src/additional-components/Controls/Icons/FitView.tsx"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,4CAM1B"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Lock.d.ts b/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Lock.d.ts new file mode 100644 index 0000000..d0c9a1a --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Lock.d.ts @@ -0,0 +1,2 @@ +export declare function LockIcon(): import("react/jsx-runtime").JSX.Element; +//# sourceMappingURL=Lock.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Lock.d.ts.map b/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Lock.d.ts.map new file mode 100644 index 0000000..b9b9821 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Lock.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Lock.d.ts","sourceRoot":"","sources":["../../../../src/additional-components/Controls/Icons/Lock.tsx"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,4CAMvB"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Minus.d.ts b/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Minus.d.ts new file mode 100644 index 0000000..ee21712 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Minus.d.ts @@ -0,0 +1,2 @@ +export declare function MinusIcon(): import("react/jsx-runtime").JSX.Element; +//# sourceMappingURL=Minus.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Minus.d.ts.map b/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Minus.d.ts.map new file mode 100644 index 0000000..12c2986 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Minus.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Minus.d.ts","sourceRoot":"","sources":["../../../../src/additional-components/Controls/Icons/Minus.tsx"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,4CAMxB"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Plus.d.ts b/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Plus.d.ts new file mode 100644 index 0000000..74c6ecc --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Plus.d.ts @@ -0,0 +1,2 @@ +export declare function PlusIcon(): import("react/jsx-runtime").JSX.Element; +//# sourceMappingURL=Plus.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Plus.d.ts.map b/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Plus.d.ts.map new file mode 100644 index 0000000..66dd227 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Plus.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Plus.d.ts","sourceRoot":"","sources":["../../../../src/additional-components/Controls/Icons/Plus.tsx"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,4CAMvB"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Unlock.d.ts b/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Unlock.d.ts new file mode 100644 index 0000000..0411d05 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Unlock.d.ts @@ -0,0 +1,2 @@ +export declare function UnlockIcon(): import("react/jsx-runtime").JSX.Element; +//# sourceMappingURL=Unlock.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Unlock.d.ts.map b/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Unlock.d.ts.map new file mode 100644 index 0000000..cb8c165 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/Controls/Icons/Unlock.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Unlock.d.ts","sourceRoot":"","sources":["../../../../src/additional-components/Controls/Icons/Unlock.tsx"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,4CAMzB"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/Controls/index.d.ts b/node_modules/@xyflow/react/dist/umd/additional-components/Controls/index.d.ts new file mode 100644 index 0000000..4b86d58 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/Controls/index.d.ts @@ -0,0 +1,4 @@ +export { Controls } from './Controls'; +export { ControlButton } from './ControlButton'; +export type { ControlProps, ControlButtonProps } from './types'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/Controls/index.d.ts.map b/node_modules/@xyflow/react/dist/umd/additional-components/Controls/index.d.ts.map new file mode 100644 index 0000000..adf9ac3 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/Controls/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/additional-components/Controls/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/Controls/types.d.ts b/node_modules/@xyflow/react/dist/umd/additional-components/Controls/types.d.ts new file mode 100644 index 0000000..44591c0 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/Controls/types.d.ts @@ -0,0 +1,66 @@ +import type { ButtonHTMLAttributes, ReactNode } from 'react'; +import type { PanelPosition } from '@xyflow/system'; +import type { FitViewOptions } from '../../types'; +/** + * @expand + */ +export type ControlProps = { + /** + * Whether or not to show the zoom in and zoom out buttons. These buttons will adjust the viewport + * zoom by a fixed amount each press. + * @default true + */ + showZoom?: boolean; + /** + * Whether or not to show the fit view button. By default, this button will adjust the viewport so + * that all nodes are visible at once. + * @default true + */ + showFitView?: boolean; + /** + * Show button for toggling interactivity + * @default true + */ + showInteractive?: boolean; + /** + * Customise the options for the fit view button. These are the same options you would pass to the + * fitView function. + */ + fitViewOptions?: FitViewOptions; + /** Called in addition the default zoom behavior when the zoom in button is clicked. */ + onZoomIn?: () => void; + /** Called in addition the default zoom behavior when the zoom out button is clicked. */ + onZoomOut?: () => void; + /** + * Called when the fit view button is clicked. When this is not provided, the viewport will be + * adjusted so that all nodes are visible. + */ + onFitView?: () => void; + /** Called when the interactive (lock) button is clicked. */ + onInteractiveChange?: (interactiveStatus: boolean) => void; + /** + * Position of the controls on the pane + * @default PanelPosition.BottomLeft + * @example PanelPosition.TopLeft, PanelPosition.TopRight, + * PanelPosition.BottomLeft, PanelPosition.BottomRight + */ + position?: PanelPosition; + children?: ReactNode; + /** Style applied to container */ + style?: React.CSSProperties; + /** Class name applied to container */ + className?: string; + /** + * @default 'React Flow controls' + */ + 'aria-label'?: string; + /** + * @default 'vertical' + */ + orientation?: 'horizontal' | 'vertical'; +}; +/** + * @expand + */ +export type ControlButtonProps = ButtonHTMLAttributes; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/Controls/types.d.ts.map b/node_modules/@xyflow/react/dist/umd/additional-components/Controls/types.d.ts.map new file mode 100644 index 0000000..664b48f --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/Controls/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/additional-components/Controls/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,uFAAuF;IACvF,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,wFAAwF;IACxF,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,4DAA4D;IAC5D,mBAAmB,CAAC,EAAE,CAAC,iBAAiB,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3D;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,iCAAiC;IACjC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;CACzC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/MiniMap.d.ts b/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/MiniMap.d.ts new file mode 100644 index 0000000..1d1c2e6 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/MiniMap.d.ts @@ -0,0 +1,29 @@ +import type { Node } from '../../types'; +import type { MiniMapProps } from './types'; +declare function MiniMapComponent({ style, className, nodeStrokeColor, nodeColor, nodeClassName, nodeBorderRadius, nodeStrokeWidth, nodeComponent, bgColor, maskColor, maskStrokeColor, maskStrokeWidth, position, onClick, onNodeClick, pannable, zoomable, ariaLabel, inversePan, zoomStep, offsetScale, }: MiniMapProps): import("react/jsx-runtime").JSX.Element; +declare namespace MiniMapComponent { + var displayName: string; +} +/** + * The `` component can be used to render an overview of your flow. It + * renders each node as an SVG element and visualizes where the current viewport is + * in relation to the rest of the flow. + * + * @public + * @example + * + * ```jsx + *import { ReactFlow, MiniMap } from '@xyflow/react'; + * + *export default function Flow() { + * return ( + * + * + * + * ); + *} + *``` + */ +export declare const MiniMap: typeof MiniMapComponent; +export {}; +//# sourceMappingURL=MiniMap.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/MiniMap.d.ts.map b/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/MiniMap.d.ts.map new file mode 100644 index 0000000..18e06b0 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/MiniMap.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MiniMap.d.ts","sourceRoot":"","sources":["../../../src/additional-components/MiniMap/MiniMap.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAkB,IAAI,EAAE,MAAM,aAAa,CAAC;AAGxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AA+B5C,iBAAS,gBAAgB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,EACtD,KAAK,EACL,SAAS,EACT,eAAe,EACf,SAAS,EACT,aAAkB,EAClB,gBAAoB,EACpB,eAAe,EAKf,aAAa,EACb,OAAO,EACP,SAAS,EACT,eAAe,EACf,eAAe,EACf,QAAyB,EACzB,OAAO,EACP,WAAW,EACX,QAAgB,EAChB,QAAgB,EAChB,SAAS,EACT,UAAU,EACV,QAAa,EACb,WAAe,GAChB,EAAE,YAAY,CAAC,QAAQ,CAAC,2CAsHxB;kBAhJQ,gBAAgB;;;AAoJzB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,OAAO,EAA6B,OAAO,gBAAgB,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/MiniMapNode.d.ts b/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/MiniMapNode.d.ts new file mode 100644 index 0000000..54bddea --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/MiniMapNode.d.ts @@ -0,0 +1,5 @@ +import type { MiniMapNodeProps } from './types'; +declare function MiniMapNodeComponent({ id, x, y, width, height, style, color, strokeColor, strokeWidth, className, borderRadius, shapeRendering, selected, onClick, }: MiniMapNodeProps): import("react/jsx-runtime").JSX.Element; +export declare const MiniMapNode: import("react").MemoExoticComponent; +export {}; +//# sourceMappingURL=MiniMapNode.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/MiniMapNode.d.ts.map b/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/MiniMapNode.d.ts.map new file mode 100644 index 0000000..5e9d2ad --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/MiniMapNode.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MiniMapNode.d.ts","sourceRoot":"","sources":["../../../src/additional-components/MiniMap/MiniMapNode.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,iBAAS,oBAAoB,CAAC,EAC5B,EAAE,EACF,CAAC,EACD,CAAC,EACD,KAAK,EACL,MAAM,EACN,KAAK,EACL,KAAK,EACL,WAAW,EACX,WAAW,EACX,SAAS,EACT,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,OAAO,GACR,EAAE,gBAAgB,2CAsBlB;AAED,eAAO,MAAM,WAAW,kEAA6B,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/MiniMapNodes.d.ts b/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/MiniMapNodes.d.ts new file mode 100644 index 0000000..ca10305 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/MiniMapNodes.d.ts @@ -0,0 +1,6 @@ +import type { Node } from '../../types'; +import type { MiniMapNodes as MiniMapNodesProps } from './types'; +declare function MiniMapNodes({ nodeStrokeColor, nodeColor, nodeClassName, nodeBorderRadius, nodeStrokeWidth, nodeComponent: NodeComponent, onClick, }: MiniMapNodesProps): import("react/jsx-runtime").JSX.Element; +declare const _default: typeof MiniMapNodes; +export default _default; +//# sourceMappingURL=MiniMapNodes.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/MiniMapNodes.d.ts.map b/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/MiniMapNodes.d.ts.map new file mode 100644 index 0000000..a71f150 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/MiniMapNodes.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MiniMapNodes.d.ts","sourceRoot":"","sources":["../../../src/additional-components/MiniMap/MiniMapNodes.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAkB,IAAI,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,IAAI,iBAAiB,EAA6C,MAAM,SAAS,CAAC;AAQ5G,iBAAS,YAAY,CAAC,QAAQ,SAAS,IAAI,EAAE,EAC3C,eAAe,EACf,SAAS,EACT,aAAkB,EAClB,gBAAoB,EACpB,eAAe,EAKf,aAAa,EAAE,aAA2B,EAC1C,OAAO,GACR,EAAE,iBAAiB,CAAC,QAAQ,CAAC,2CAiC7B;wBAgEoC,OAAO,YAAY;AAAxD,wBAAyD"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/index.d.ts b/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/index.d.ts new file mode 100644 index 0000000..eeb5c18 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/index.d.ts @@ -0,0 +1,3 @@ +export { MiniMap } from './MiniMap'; +export * from './types'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/index.d.ts.map b/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/index.d.ts.map new file mode 100644 index 0000000..623c213 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/additional-components/MiniMap/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,cAAc,SAAS,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/types.d.ts b/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/types.d.ts new file mode 100644 index 0000000..4215867 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/types.d.ts @@ -0,0 +1,123 @@ +import type { ComponentType, CSSProperties, HTMLAttributes, MouseEvent } from 'react'; +import type { PanelPosition, XYPosition } from '@xyflow/system'; +import type { Node } from '../../types'; +export type GetMiniMapNodeAttribute = (node: NodeType) => string; +/** + * @expand + */ +export type MiniMapProps = Omit, 'onClick'> & { + /** + * Color of nodes on minimap. + * @default "#e2e2e2" + */ + nodeColor?: string | GetMiniMapNodeAttribute; + /** + * Stroke color of nodes on minimap. + * @default "transparent" + */ + nodeStrokeColor?: string | GetMiniMapNodeAttribute; + /** + * Class name applied to nodes on minimap. + * @default "" + */ + nodeClassName?: string | GetMiniMapNodeAttribute; + /** + * Border radius of nodes on minimap. + * @default 5 + */ + nodeBorderRadius?: number; + /** + * Stroke width of nodes on minimap. + * @default 2 + */ + nodeStrokeWidth?: number; + /** + * A custom component to render the nodes in the minimap. This component must render an SVG + * element! + */ + nodeComponent?: ComponentType; + /** Background color of minimap. */ + bgColor?: string; + /** + * The color of the mask that covers the portion of the minimap not currently visible in the + * viewport. + * @default "rgba(240, 240, 240, 0.6)" + */ + maskColor?: string; + /** + * Stroke color of mask representing viewport. + * @default transparent + */ + maskStrokeColor?: string; + /** + * Stroke width of mask representing viewport. + * @default 1 + */ + maskStrokeWidth?: number; + /** + * Position of minimap on pane. + * @default PanelPosition.BottomRight + * @example PanelPosition.TopLeft, PanelPosition.TopRight, + * PanelPosition.BottomLeft, PanelPosition.BottomRight + */ + position?: PanelPosition; + /** Callback called when minimap is clicked. */ + onClick?: (event: MouseEvent, position: XYPosition) => void; + /** Callback called when node on minimap is clicked. */ + onNodeClick?: (event: MouseEvent, node: NodeType) => void; + /** + * Determines whether you can pan the viewport by dragging inside the minimap. + * @default false + */ + pannable?: boolean; + /** + * Determines whether you can zoom the viewport by scrolling inside the minimap. + * @default false + */ + zoomable?: boolean; + /** + * There is no text inside the minimap for a screen reader to use as an accessible name, so it's + * important we provide one to make the minimap accessible. The default is sufficient, but you may + * want to replace it with something more relevant to your app or product. + * @default "Mini Map" + */ + ariaLabel?: string | null; + /** Invert direction when panning the minimap viewport. */ + inversePan?: boolean; + /** + * Step size for zooming in/out on minimap. + * @default 10 + */ + zoomStep?: number; + /** + * Offset the viewport on the minimap, acts like a padding. + * @default 5 + */ + offsetScale?: number; +}; +export type MiniMapNodes = Pick, 'nodeColor' | 'nodeStrokeColor' | 'nodeClassName' | 'nodeBorderRadius' | 'nodeStrokeWidth' | 'nodeComponent'> & { + onClick?: (event: MouseEvent, nodeId: string) => void; +}; +/** + * The props that are passed to the MiniMapNode component + * + * @public + * @expand + */ +export type MiniMapNodeProps = { + id: string; + x: number; + y: number; + width: number; + height: number; + borderRadius: number; + className: string; + color?: string; + shapeRendering: string; + strokeColor?: string; + strokeWidth?: number; + style?: CSSProperties; + selected: boolean; + onClick?: (event: MouseEvent, id: string) => void; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/types.d.ts.map b/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/types.d.ts.map new file mode 100644 index 0000000..50daa2b --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/MiniMap/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/additional-components/MiniMap/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACtF,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEhE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,MAAM,uBAAuB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,QAAQ,KAAK,MAAM,CAAC;AAE/F;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,EAAE,SAAS,CAAC,GAAG;IACxG;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,uBAAuB,CAAC,QAAQ,CAAC,CAAC;IACvD;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,uBAAuB,CAAC,QAAQ,CAAC,CAAC;IAC7D;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,uBAAuB,CAAC,QAAQ,CAAC,CAAC;IAC3D;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAChD,mCAAmC;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,KAAK,IAAI,CAAC;IAC5D,uDAAuD;IACvD,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC1D;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,0DAA0D;IAC1D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,YAAY,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,IAAI,CAC3D,YAAY,CAAC,QAAQ,CAAC,EACtB,WAAW,GAAG,iBAAiB,GAAG,eAAe,GAAG,kBAAkB,GAAG,iBAAiB,GAAG,eAAe,CAC7G,GAAG;IACF,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACvD,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACnD,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/NodeResizeControl.d.ts b/node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/NodeResizeControl.d.ts new file mode 100644 index 0000000..2c9a83b --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/NodeResizeControl.d.ts @@ -0,0 +1,11 @@ +import type { ResizeControlProps, ResizeControlLineProps } from './types'; +declare function ResizeControl({ nodeId, position, variant, className, style, children, color, minWidth, minHeight, maxWidth, maxHeight, keepAspectRatio, resizeDirection, autoScale, shouldResize, onResizeStart, onResize, onResizeEnd, }: ResizeControlProps): import("react/jsx-runtime").JSX.Element; +export declare function ResizeControlLine(props: ResizeControlLineProps): import("react/jsx-runtime").JSX.Element; +/** + * To create your own resizing UI, you can use the `NodeResizeControl` component where you can pass children (such as icons). + * @public + * + */ +export declare const NodeResizeControl: import("react").MemoExoticComponent; +export {}; +//# sourceMappingURL=NodeResizeControl.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/NodeResizeControl.d.ts.map b/node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/NodeResizeControl.d.ts.map new file mode 100644 index 0000000..75fd3a2 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/NodeResizeControl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"NodeResizeControl.d.ts","sourceRoot":"","sources":["../../../src/additional-components/NodeResizer/NodeResizeControl.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAW1E,iBAAS,aAAa,CAAC,EACrB,MAAM,EACN,QAAQ,EACR,OAAqC,EACrC,SAAS,EACT,KAAiB,EACjB,QAAQ,EACR,KAAK,EACL,QAAa,EACb,SAAc,EACd,QAA2B,EAC3B,SAA4B,EAC5B,eAAuB,EACvB,eAAe,EACf,SAAgB,EAChB,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,WAAW,GACZ,EAAE,kBAAkB,2CA4KpB;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,2CAE9D;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,2DAAsB,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/NodeResizer.d.ts b/node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/NodeResizer.d.ts new file mode 100644 index 0000000..bb00652 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/NodeResizer.d.ts @@ -0,0 +1,27 @@ +import type { NodeResizerProps } from './types'; +/** + * The `` component can be used to add a resize functionality to your + * nodes. It renders draggable controls around the node to resize in all directions. + * @public + * + * @example + *```jsx + *import { memo } from 'react'; + *import { Handle, Position, NodeResizer } from '@xyflow/react'; + * + *function ResizableNode({ data }) { + * return ( + * <> + * + * + *
{data.label}
+ * + * + * ); + *}; + * + *export default memo(ResizableNode); + *``` + */ +export declare function NodeResizer({ nodeId, isVisible, handleClassName, handleStyle, lineClassName, lineStyle, color, minWidth, minHeight, maxWidth, maxHeight, keepAspectRatio, autoScale, shouldResize, onResizeStart, onResize, onResizeEnd, }: NodeResizerProps): import("react/jsx-runtime").JSX.Element | null; +//# sourceMappingURL=NodeResizer.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/NodeResizer.d.ts.map b/node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/NodeResizer.d.ts.map new file mode 100644 index 0000000..22ce64e --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/NodeResizer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"NodeResizer.d.ts","sourceRoot":"","sources":["../../../src/additional-components/NodeResizer/NodeResizer.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,WAAW,CAAC,EAC1B,MAAM,EACN,SAAgB,EAChB,eAAe,EACf,WAAW,EACX,aAAa,EACb,SAAS,EACT,KAAK,EACL,QAAa,EACb,SAAc,EACd,QAA2B,EAC3B,SAA4B,EAC5B,eAAuB,EACvB,SAAgB,EAChB,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,WAAW,GACZ,EAAE,gBAAgB,kDAkDlB"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/index.d.ts b/node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/index.d.ts new file mode 100644 index 0000000..58c7e6a --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/index.d.ts @@ -0,0 +1,4 @@ +export { NodeResizer } from './NodeResizer'; +export { NodeResizeControl } from './NodeResizeControl'; +export * from './types'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/index.d.ts.map b/node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/index.d.ts.map new file mode 100644 index 0000000..8187fea --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/additional-components/NodeResizer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,cAAc,SAAS,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/types.d.ts b/node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/types.d.ts new file mode 100644 index 0000000..2e5d891 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/types.d.ts @@ -0,0 +1,97 @@ +import type { CSSProperties, ReactNode } from 'react'; +import type { ControlPosition, ControlLinePosition, ResizeControlVariant, ResizeControlDirection, ShouldResize, OnResizeStart, OnResize, OnResizeEnd } from '@xyflow/system'; +/** + * @expand + */ +export type NodeResizerProps = { + /** + * Id of the node it is resizing. + * @remarks optional if used inside custom node + */ + nodeId?: string; + /** Color of the resize handle. */ + color?: string; + /** Class name applied to handle. */ + handleClassName?: string; + /** Style applied to handle. */ + handleStyle?: CSSProperties; + /** Class name applied to line. */ + lineClassName?: string; + /** Style applied to line. */ + lineStyle?: CSSProperties; + /** + * Are the controls visible. + * @default true + */ + isVisible?: boolean; + /** + * Minimum width of node. + * @default 10 + */ + minWidth?: number; + /** + * Minimum height of node. + * @default 10 + */ + minHeight?: number; + /** + * Maximum width of node. + * @default Number.MAX_VALUE + */ + maxWidth?: number; + /** + * Maximum height of node. + * @default Number.MAX_VALUE + */ + maxHeight?: number; + /** + * Keep aspect ratio when resizing. + * @default false + */ + keepAspectRatio?: boolean; + /** + * Scale the controls with the zoom level. + * @default true + */ + autoScale?: boolean; + /** Callback to determine if node should resize. */ + shouldResize?: ShouldResize; + /** Callback called when resizing starts. */ + onResizeStart?: OnResizeStart; + /** Callback called when resizing. */ + onResize?: OnResize; + /** Callback called when resizing ends. */ + onResizeEnd?: OnResizeEnd; +}; +/** + * @expand + */ +export type ResizeControlProps = Pick & { + /** + * Position of the control. + * @example ControlPosition.TopLeft, ControlPosition.TopRight, + * ControlPosition.BottomLeft, ControlPosition.BottomRight + */ + position?: ControlPosition; + /** + * Variant of the control. + * @default "handle" + * @example ResizeControlVariant.Handle, ResizeControlVariant.Line + */ + variant?: ResizeControlVariant; + /** + * The direction the user can resize the node. + * If not provided, the user can resize in any direction. + */ + resizeDirection?: ResizeControlDirection; + className?: string; + style?: CSSProperties; + children?: ReactNode; +}; +/** + * @expand + */ +export type ResizeControlLineProps = Omit & { + position?: ControlLinePosition; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/types.d.ts.map b/node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/types.d.ts.map new file mode 100644 index 0000000..4fbe2cc --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/NodeResizer/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/additional-components/NodeResizer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACtB,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,WAAW,EACZ,MAAM,gBAAgB,CAAC;AAExB;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,+BAA+B;IAC/B,WAAW,CAAC,EAAE,aAAa,CAAC;IAC5B,kCAAkC;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mDAAmD;IACnD,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,4CAA4C;IAC5C,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,qCAAqC;IACrC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,0CAA0C;IAC1C,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,gBAAgB,EACd,QAAQ,GACR,OAAO,GACP,UAAU,GACV,WAAW,GACX,UAAU,GACV,WAAW,GACX,iBAAiB,GACjB,cAAc,GACd,WAAW,GACX,eAAe,GACf,UAAU,GACV,aAAa,CAChB,GAAG;IACF;;;;OAIG;IACH,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B;;;;OAIG;IACH,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B;;;OAGG;IACH,eAAe,CAAC,EAAE,sBAAsB,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,kBAAkB,EAAE,iBAAiB,CAAC,GAAG;IACjF,QAAQ,CAAC,EAAE,mBAAmB,CAAC;CAChC,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/NodeToolbar.d.ts b/node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/NodeToolbar.d.ts new file mode 100644 index 0000000..571b536 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/NodeToolbar.d.ts @@ -0,0 +1,38 @@ +import type { NodeToolbarProps } from './types'; +/** + * This component can render a toolbar or tooltip to one side of a custom node. This + * toolbar doesn't scale with the viewport so that the content is always visible. + * + * @public + * @example + * ```jsx + *import { memo } from 'react'; + *import { Handle, Position, NodeToolbar } from '@xyflow/react'; + * + *function CustomNode({ data }) { + * return ( + * <> + * + * + * + * + * + * + *
+ * {data.label} + *
+ * + * + * + * + * ); + *}; + * + *export default memo(CustomNode); + *``` + * @remarks By default, the toolbar is only visible when a node is selected. If multiple + * nodes are selected it will not be visible to prevent overlapping toolbars or + * clutter. You can override this behavior by setting the `isVisible` prop to `true`. + */ +export declare function NodeToolbar({ nodeId, children, className, style, isVisible, position, offset, align, ...rest }: NodeToolbarProps): import("react/jsx-runtime").JSX.Element | null; +//# sourceMappingURL=NodeToolbar.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/NodeToolbar.d.ts.map b/node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/NodeToolbar.d.ts.map new file mode 100644 index 0000000..960b0db --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/NodeToolbar.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"NodeToolbar.d.ts","sourceRoot":"","sources":["../../../src/additional-components/NodeToolbar/NodeToolbar.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AA+BhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,WAAW,CAAC,EAC1B,MAAM,EACN,QAAQ,EACR,SAAS,EACT,KAAK,EACL,SAAS,EACT,QAAuB,EACvB,MAAW,EACX,KAAgB,EAChB,GAAG,IAAI,EACR,EAAE,gBAAgB,kDAwDlB"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/NodeToolbarPortal.d.ts b/node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/NodeToolbarPortal.d.ts new file mode 100644 index 0000000..1036d76 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/NodeToolbarPortal.d.ts @@ -0,0 +1,5 @@ +import { ReactNode } from 'react'; +export declare function NodeToolbarPortal({ children }: { + children: ReactNode; +}): import("react").ReactPortal | null; +//# sourceMappingURL=NodeToolbarPortal.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/NodeToolbarPortal.d.ts.map b/node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/NodeToolbarPortal.d.ts.map new file mode 100644 index 0000000..ff908ea --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/NodeToolbarPortal.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"NodeToolbarPortal.d.ts","sourceRoot":"","sources":["../../../src/additional-components/NodeToolbar/NodeToolbarPortal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQlC,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,sCAQtE"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/index.d.ts b/node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/index.d.ts new file mode 100644 index 0000000..ae78d04 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/index.d.ts @@ -0,0 +1,3 @@ +export { NodeToolbar } from './NodeToolbar'; +export type { NodeToolbarProps } from './types'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/index.d.ts.map b/node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/index.d.ts.map new file mode 100644 index 0000000..300eba1 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/additional-components/NodeToolbar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/types.d.ts b/node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/types.d.ts new file mode 100644 index 0000000..0eedc02 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/types.d.ts @@ -0,0 +1,32 @@ +import type { HTMLAttributes } from 'react'; +import type { Position, Align } from '@xyflow/system'; +/** + * @expand + */ +export type NodeToolbarProps = HTMLAttributes & { + /** + * By passing in an array of node id's you can render a single tooltip for a group or collection + * of nodes. + */ + nodeId?: string | string[]; + /** If `true`, node toolbar is visible even if node is not selected. */ + isVisible?: boolean; + /** + * Position of the toolbar relative to the node. + * @default Position.Top + * @example Position.TopLeft, Position.TopRight, Position.BottomLeft, Position.BottomRight + */ + position?: Position; + /** + * The space between the node and the toolbar, measured in pixels. + * @default 10 + */ + offset?: number; + /** + * Align the toolbar relative to the node. + * @default "center" + * @example Align.Start, Align.Center, Align.End + */ + align?: Align; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/types.d.ts.map b/node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/types.d.ts.map new file mode 100644 index 0000000..6e8199f --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/NodeToolbar/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/additional-components/NodeToolbar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEtD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAC9D;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC3B,uEAAuE;IACvE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/index.d.ts b/node_modules/@xyflow/react/dist/umd/additional-components/index.d.ts new file mode 100644 index 0000000..4f53059 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/index.d.ts @@ -0,0 +1,6 @@ +export * from './Background'; +export * from './Controls'; +export * from './MiniMap'; +export * from './NodeResizer'; +export * from './NodeToolbar'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/additional-components/index.d.ts.map b/node_modules/@xyflow/react/dist/umd/additional-components/index.d.ts.map new file mode 100644 index 0000000..f16f262 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/additional-components/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/additional-components/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/A11yDescriptions/index.d.ts b/node_modules/@xyflow/react/dist/umd/components/A11yDescriptions/index.d.ts new file mode 100644 index 0000000..a8afaa3 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/A11yDescriptions/index.d.ts @@ -0,0 +1,8 @@ +export declare const ARIA_NODE_DESC_KEY = "react-flow__node-desc"; +export declare const ARIA_EDGE_DESC_KEY = "react-flow__edge-desc"; +export declare const ARIA_LIVE_MESSAGE = "react-flow__aria-live"; +export declare function A11yDescriptions({ rfId, disableKeyboardA11y }: { + rfId: string; + disableKeyboardA11y: boolean; +}): import("react/jsx-runtime").JSX.Element; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/A11yDescriptions/index.d.ts.map b/node_modules/@xyflow/react/dist/umd/components/A11yDescriptions/index.d.ts.map new file mode 100644 index 0000000..02a814c --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/A11yDescriptions/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/A11yDescriptions/index.tsx"],"names":[],"mappings":"AAkBA,eAAO,MAAM,kBAAkB,0BAA0B,CAAC;AAC1D,eAAO,MAAM,kBAAkB,0BAA0B,CAAC;AAC1D,eAAO,MAAM,iBAAiB,0BAA0B,CAAC;AAezD,wBAAgB,gBAAgB,CAAC,EAAE,IAAI,EAAE,mBAAmB,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,mBAAmB,EAAE,OAAO,CAAA;CAAE,2CAgB7G"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/Attribution/index.d.ts b/node_modules/@xyflow/react/dist/umd/components/Attribution/index.d.ts new file mode 100644 index 0000000..bf992f9 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/Attribution/index.d.ts @@ -0,0 +1,8 @@ +import type { PanelPosition, ProOptions } from '@xyflow/system'; +type AttributionProps = { + proOptions?: ProOptions; + position?: PanelPosition; +}; +export declare function Attribution({ proOptions, position }: AttributionProps): import("react/jsx-runtime").JSX.Element | null; +export {}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/Attribution/index.d.ts.map b/node_modules/@xyflow/react/dist/umd/components/Attribution/index.d.ts.map new file mode 100644 index 0000000..900ce33 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/Attribution/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Attribution/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAIhE,KAAK,gBAAgB,GAAG;IACtB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC,EAAE,aAAa,CAAC;CAC1B,CAAC;AAEF,wBAAgB,WAAW,CAAC,EAAE,UAAU,EAAE,QAAyB,EAAE,EAAE,gBAAgB,kDAgBtF"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/BatchProvider/index.d.ts b/node_modules/@xyflow/react/dist/umd/components/BatchProvider/index.d.ts new file mode 100644 index 0000000..42650c6 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/BatchProvider/index.d.ts @@ -0,0 +1,17 @@ +import { ReactNode } from 'react'; +import { Queue } from './types'; +import type { Edge, Node } from '../../types'; +/** + * This is a context provider that holds and processes the node and edge update queues + * that are needed to handle setNodes, addNodes, setEdges and addEdges. + * + * @internal + */ +export declare function BatchProvider({ children, }: { + children: ReactNode; +}): import("react/jsx-runtime").JSX.Element; +export declare function useBatchContext(): { + nodeQueue: Queue; + edgeQueue: Queue; +}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/BatchProvider/index.d.ts.map b/node_modules/@xyflow/react/dist/umd/components/BatchProvider/index.d.ts.map new file mode 100644 index 0000000..a42645f --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/BatchProvider/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/BatchProvider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAAoC,MAAM,OAAO,CAAC;AAKnF,OAAO,EAAE,KAAK,EAAa,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAU9C;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,EACxF,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;CACrB,2CAkEA;AAED,wBAAgB,eAAe;eAnFlB,KAAK,CAAC,GAAG,CAAC;eAEV,KAAK,CAAC,GAAG,CAAC;EAyFtB"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/BatchProvider/types.d.ts b/node_modules/@xyflow/react/dist/umd/components/BatchProvider/types.d.ts new file mode 100644 index 0000000..b96a61e --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/BatchProvider/types.d.ts @@ -0,0 +1,7 @@ +export type QueueItem = T[] | ((items: T[]) => T[]); +export type Queue = { + get: () => QueueItem[]; + reset: () => void; + push: (item: QueueItem) => void; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/BatchProvider/types.d.ts.map b/node_modules/@xyflow/react/dist/umd/components/BatchProvider/types.d.ts.map new file mode 100644 index 0000000..a5cb6b8 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/BatchProvider/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/BatchProvider/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;AAEvD,MAAM,MAAM,KAAK,CAAC,CAAC,IAAI;IACrB,GAAG,EAAE,MAAM,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1B,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,IAAI,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;CACpC,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/BatchProvider/useQueue.d.ts b/node_modules/@xyflow/react/dist/umd/components/BatchProvider/useQueue.d.ts new file mode 100644 index 0000000..f4842ba --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/BatchProvider/useQueue.d.ts @@ -0,0 +1,11 @@ +import { Queue, QueueItem } from './types'; +/** + * This hook returns a queue that can be used to batch updates. + * + * @param runQueue - a function that gets called when the queue is flushed + * @internal + * + * @returns a Queue object + */ +export declare function useQueue(runQueue: (items: QueueItem[]) => void): Queue; +//# sourceMappingURL=useQueue.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/BatchProvider/useQueue.d.ts.map b/node_modules/@xyflow/react/dist/umd/components/BatchProvider/useQueue.d.ts.map new file mode 100644 index 0000000..e195793 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/BatchProvider/useQueue.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useQueue.d.ts","sourceRoot":"","sources":["../../../src/components/BatchProvider/useQueue.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,YAiCpE"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/ConnectionLine/index.d.ts b/node_modules/@xyflow/react/dist/umd/components/ConnectionLine/index.d.ts new file mode 100644 index 0000000..8aff7b0 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/ConnectionLine/index.d.ts @@ -0,0 +1,12 @@ +import { CSSProperties } from 'react'; +import { ConnectionLineType } from '@xyflow/system'; +import type { ConnectionLineComponent, Node } from '../../types'; +type ConnectionLineWrapperProps = { + type: ConnectionLineType; + component?: ConnectionLineComponent; + containerStyle?: CSSProperties; + style?: CSSProperties; +}; +export declare function ConnectionLineWrapper({ containerStyle, style, type, component, }: ConnectionLineWrapperProps): import("react/jsx-runtime").JSX.Element | null; +export {}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/ConnectionLine/index.d.ts.map b/node_modules/@xyflow/react/dist/umd/components/ConnectionLine/index.d.ts.map new file mode 100644 index 0000000..90edd83 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/ConnectionLine/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ConnectionLine/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAGtC,OAAO,EACL,kBAAkB,EAKnB,MAAM,gBAAgB,CAAC;AAIxB,OAAO,KAAK,EAAE,uBAAuB,EAAE,IAAI,EAAkB,MAAM,aAAa,CAAC;AAGjF,KAAK,0BAA0B,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI;IAC9D,IAAI,EAAE,kBAAkB,CAAC;IACzB,SAAS,CAAC,EAAE,uBAAuB,CAAC,QAAQ,CAAC,CAAC;IAC9C,cAAc,CAAC,EAAE,aAAa,CAAC;IAC/B,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,CAAC;AAUF,wBAAgB,qBAAqB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,EAClE,cAAc,EACd,KAAK,EACL,IAAI,EACJ,SAAS,GACV,EAAE,0BAA0B,CAAC,QAAQ,CAAC,kDAoBtC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/EdgeLabelRenderer/index.d.ts b/node_modules/@xyflow/react/dist/umd/components/EdgeLabelRenderer/index.d.ts new file mode 100644 index 0000000..558f6ed --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/EdgeLabelRenderer/index.d.ts @@ -0,0 +1,47 @@ +import type { ReactNode } from 'react'; +export type EdgeLabelRendererProps = { + children: ReactNode; +}; +/** + * Edges are SVG-based. If you want to render more complex labels you can use the + * `` component to access a div based renderer. This component + * is a portal that renders the label in a `
` that is positioned on top of + * the edges. You can see an example usage of the component in the + * [edge label renderer example](/examples/edges/edge-label-renderer). + * @public + * + * @example + * ```jsx + * import React from 'react'; + * import { getBezierPath, EdgeLabelRenderer, BaseEdge } from '@xyflow/react'; + * + * export function CustomEdge({ id, data, ...props }) { + * const [edgePath, labelX, labelY] = getBezierPath(props); + * + * return ( + * <> + * + * + *
+ * {data.label} + *
+ *
+ * + * ); + * }; + * ``` + * + * @remarks The `` has no pointer events by default. If you want to + * add mouse interactions you need to set the style `pointerEvents: all` and add + * the `nopan` class on the label or the element you want to interact with. + */ +export declare function EdgeLabelRenderer({ children }: EdgeLabelRendererProps): import("react").ReactPortal | null; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/EdgeLabelRenderer/index.d.ts.map b/node_modules/@xyflow/react/dist/umd/components/EdgeLabelRenderer/index.d.ts.map new file mode 100644 index 0000000..836e3b8 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/EdgeLabelRenderer/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/EdgeLabelRenderer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQvC,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,EAAE,SAAS,CAAA;CACpB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,EAAE,sBAAsB,sCAQrE"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/EdgeWrapper/EdgeUpdateAnchors.d.ts b/node_modules/@xyflow/react/dist/umd/components/EdgeWrapper/EdgeUpdateAnchors.d.ts new file mode 100644 index 0000000..06c2cf6 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/EdgeWrapper/EdgeUpdateAnchors.d.ts @@ -0,0 +1,15 @@ +import { EdgePosition } from '@xyflow/system'; +import type { EdgeWrapperProps, Edge } from '../../types/edges'; +type EdgeUpdateAnchorsProps = { + edge: EdgeType; + isReconnectable: boolean | 'source' | 'target'; + reconnectRadius: EdgeWrapperProps['reconnectRadius']; + onReconnect: EdgeWrapperProps['onReconnect']; + onReconnectStart: EdgeWrapperProps['onReconnectStart']; + onReconnectEnd: EdgeWrapperProps['onReconnectEnd']; + setUpdateHover: (hover: boolean) => void; + setReconnecting: (updating: boolean) => void; +} & EdgePosition; +export declare function EdgeUpdateAnchors({ isReconnectable, reconnectRadius, edge, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, onReconnect, onReconnectStart, onReconnectEnd, setReconnecting, setUpdateHover, }: EdgeUpdateAnchorsProps): import("react/jsx-runtime").JSX.Element; +export {}; +//# sourceMappingURL=EdgeUpdateAnchors.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/EdgeWrapper/EdgeUpdateAnchors.d.ts.map b/node_modules/@xyflow/react/dist/umd/components/EdgeWrapper/EdgeUpdateAnchors.d.ts.map new file mode 100644 index 0000000..30f178f --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/EdgeWrapper/EdgeUpdateAnchors.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"EdgeUpdateAnchors.d.ts","sourceRoot":"","sources":["../../../src/components/EdgeWrapper/EdgeUpdateAnchors.tsx"],"names":[],"mappings":"AACA,OAAO,EAA6B,YAAY,EAAoC,MAAM,gBAAgB,CAAC;AAG3G,OAAO,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAGhE,KAAK,sBAAsB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI;IAC1D,IAAI,EAAE,QAAQ,CAAC;IACf,eAAe,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC/C,eAAe,EAAE,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;IACrD,WAAW,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC,CAAC;IACvD,gBAAgB,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC,kBAAkB,CAAC,CAAC;IACjE,cAAc,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC,gBAAgB,CAAC,CAAC;IAC7D,cAAc,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,eAAe,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;CAC9C,GAAG,YAAY,CAAC;AAEjB,wBAAgB,iBAAiB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,EAC9D,eAAe,EACf,eAAe,EACf,IAAI,EACJ,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,cAAc,EACd,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,cAAc,GACf,EAAE,sBAAsB,CAAC,QAAQ,CAAC,2CAmGlC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/EdgeWrapper/index.d.ts b/node_modules/@xyflow/react/dist/umd/components/EdgeWrapper/index.d.ts new file mode 100644 index 0000000..ba43841 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/EdgeWrapper/index.d.ts @@ -0,0 +1,4 @@ +import { JSX } from 'react'; +import type { Edge, EdgeWrapperProps } from '../../types'; +export declare function EdgeWrapper({ id, edgesFocusable, edgesReconnectable, elementsSelectable, onClick, onDoubleClick, onContextMenu, onMouseEnter, onMouseMove, onMouseLeave, reconnectRadius, onReconnect, onReconnectStart, onReconnectEnd, rfId, edgeTypes, noPanClassName, onError, disableKeyboardA11y, }: EdgeWrapperProps): JSX.Element | null; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/EdgeWrapper/index.d.ts.map b/node_modules/@xyflow/react/dist/umd/components/EdgeWrapper/index.d.ts.map new file mode 100644 index 0000000..d23d932 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/EdgeWrapper/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/EdgeWrapper/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA8D,GAAG,EAAE,MAAM,OAAO,CAAC;AAexF,OAAO,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE1D,wBAAgB,WAAW,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,EACxD,EAAE,EACF,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,OAAO,EACP,aAAa,EACb,aAAa,EACb,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,IAAI,EACJ,SAAS,EACT,cAAc,EACd,OAAO,EACP,mBAAmB,GACpB,EAAE,gBAAgB,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAmOjD"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/EdgeWrapper/utils.d.ts b/node_modules/@xyflow/react/dist/umd/components/EdgeWrapper/utils.d.ts new file mode 100644 index 0000000..8dfb923 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/EdgeWrapper/utils.d.ts @@ -0,0 +1,11 @@ +import type { EdgeTypes } from '../../types'; +export declare const builtinEdgeTypes: EdgeTypes; +export declare const nullPosition: { + sourceX: null; + sourceY: null; + targetX: null; + targetY: null; + sourcePosition: null; + targetPosition: null; +}; +//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/EdgeWrapper/utils.d.ts.map b/node_modules/@xyflow/react/dist/umd/components/EdgeWrapper/utils.d.ts.map new file mode 100644 index 0000000..e3f5a7e --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/EdgeWrapper/utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/EdgeWrapper/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAS7C,eAAO,MAAM,gBAAgB,EAAE,SAM9B,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;CAOxB,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/Edges/BaseEdge.d.ts b/node_modules/@xyflow/react/dist/umd/components/Edges/BaseEdge.d.ts new file mode 100644 index 0000000..328af2f --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/Edges/BaseEdge.d.ts @@ -0,0 +1,30 @@ +import type { BaseEdgeProps } from '../../types'; +/** + * The `` component gets used internally for all the edges. It can be + * used inside a custom edge and handles the invisible helper edge and the edge label + * for you. + * + * @public + * @example + * ```jsx + *import { BaseEdge } from '@xyflow/react'; + * + *export function CustomEdge({ sourceX, sourceY, targetX, targetY, ...props }) { + * const [edgePath] = getStraightPath({ + * sourceX, + * sourceY, + * targetX, + * targetY, + * }); + * + * return ; + *} + *``` + * + * @remarks If you want to use an edge marker with the [``](/api-reference/components/base-edge) component, + * you can pass the `markerStart` or `markerEnd` props passed to your custom edge + * through to the [``](/api-reference/components/base-edge) component. + * You can see all the props passed to a custom edge by looking at the [`EdgeProps`](/api-reference/types/edge-props) type. + */ +export declare function BaseEdge({ path, labelX, labelY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, interactionWidth, ...props }: BaseEdgeProps): import("react/jsx-runtime").JSX.Element; +//# sourceMappingURL=BaseEdge.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/Edges/BaseEdge.d.ts.map b/node_modules/@xyflow/react/dist/umd/components/Edges/BaseEdge.d.ts.map new file mode 100644 index 0000000..7e03035 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/Edges/BaseEdge.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"BaseEdge.d.ts","sourceRoot":"","sources":["../../../src/components/Edges/BaseEdge.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,QAAQ,CAAC,EACvB,IAAI,EACJ,MAAM,EACN,MAAM,EACN,KAAK,EACL,UAAU,EACV,WAAW,EACX,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,gBAAqB,EACrB,GAAG,KAAK,EACT,EAAE,aAAa,2CA2Bf"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/Edges/BezierEdge.d.ts b/node_modules/@xyflow/react/dist/umd/components/Edges/BezierEdge.d.ts new file mode 100644 index 0000000..d0570d5 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/Edges/BezierEdge.d.ts @@ -0,0 +1,31 @@ +import type { BezierEdgeProps } from '../../types'; +/** + * Component that can be used inside a custom edge to render a bezier curve. + * + * @public + * @example + * + * ```tsx + * import { BezierEdge } from '@xyflow/react'; + * + * function CustomEdge({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition }) { + * return ( + * + * ); + * } + * ``` + */ +declare const BezierEdge: import("react").MemoExoticComponent<({ id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, markerEnd, markerStart, pathOptions, interactionWidth, }: BezierEdgeProps) => import("react/jsx-runtime").JSX.Element>; +/** + * @internal + */ +declare const BezierEdgeInternal: import("react").MemoExoticComponent<({ id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, markerEnd, markerStart, pathOptions, interactionWidth, }: BezierEdgeProps) => import("react/jsx-runtime").JSX.Element>; +export { BezierEdge, BezierEdgeInternal }; +//# sourceMappingURL=BezierEdge.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/Edges/BezierEdge.d.ts.map b/node_modules/@xyflow/react/dist/umd/components/Edges/BezierEdge.d.ts.map new file mode 100644 index 0000000..60b5ae3 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/Edges/BezierEdge.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"BezierEdge.d.ts","sourceRoot":"","sources":["../../../src/components/Edges/BezierEdge.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AA2DnD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,QAAA,MAAM,UAAU,qQA1DT,eAAe,6CA0DoC,CAAC;AAE3D;;GAEG;AACH,QAAA,MAAM,kBAAkB,qQA/DjB,eAAe,6CA+D2C,CAAC;AAKlE,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/Edges/EdgeAnchor.d.ts b/node_modules/@xyflow/react/dist/umd/components/Edges/EdgeAnchor.d.ts new file mode 100644 index 0000000..a3465d4 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/Edges/EdgeAnchor.d.ts @@ -0,0 +1,17 @@ +import type { MouseEvent as ReactMouseEvent, SVGAttributes } from 'react'; +import { Position } from '@xyflow/system'; +export interface EdgeAnchorProps extends SVGAttributes { + position: Position; + centerX: number; + centerY: number; + radius?: number; + onMouseDown: (event: ReactMouseEvent) => void; + onMouseEnter: (event: ReactMouseEvent) => void; + onMouseOut: (event: ReactMouseEvent) => void; + type: string; +} +/** + * @internal + */ +export declare function EdgeAnchor({ position, centerX, centerY, radius, onMouseDown, onMouseEnter, onMouseOut, type, }: EdgeAnchorProps): import("react/jsx-runtime").JSX.Element; +//# sourceMappingURL=EdgeAnchor.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/Edges/EdgeAnchor.d.ts.map b/node_modules/@xyflow/react/dist/umd/components/Edges/EdgeAnchor.d.ts.map new file mode 100644 index 0000000..69cfdfe --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/Edges/EdgeAnchor.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"EdgeAnchor.d.ts","sourceRoot":"","sources":["../../../src/components/Edges/EdgeAnchor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,IAAI,eAAe,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE1E,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAc1C,MAAM,WAAW,eAAgB,SAAQ,aAAa,CAAC,WAAW,CAAC;IACjE,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,CAAC,KAAK,EAAE,eAAe,CAAC,WAAW,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IACvE,YAAY,EAAE,CAAC,KAAK,EAAE,eAAe,CAAC,WAAW,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IACxE,UAAU,EAAE,CAAC,KAAK,EAAE,eAAe,CAAC,WAAW,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IACtE,IAAI,EAAE,MAAM,CAAC;CACd;AAID;;GAEG;AACH,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,OAAO,EACP,OAAO,EACP,MAAW,EACX,WAAW,EACX,YAAY,EACZ,UAAU,EACV,IAAI,GACL,EAAE,eAAe,2CAcjB"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/Edges/EdgeText.d.ts b/node_modules/@xyflow/react/dist/umd/components/Edges/EdgeText.d.ts new file mode 100644 index 0000000..cab46cf --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/Edges/EdgeText.d.ts @@ -0,0 +1,34 @@ +import type { EdgeTextProps } from '../../types'; +declare function EdgeTextComponent({ x, y, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, children, className, ...rest }: EdgeTextProps): import("react/jsx-runtime").JSX.Element | null; +declare namespace EdgeTextComponent { + var displayName: string; +} +/** + * You can use the `` component as a helper component to display text + * within your custom edges. + * + * @public + * + * @example + * ```jsx + * import { EdgeText } from '@xyflow/react'; + * + * export function CustomEdgeLabel({ label }) { + * return ( + * + * ); + * } + *``` + */ +export declare const EdgeText: import("react").MemoExoticComponent; +export {}; +//# sourceMappingURL=EdgeText.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/Edges/EdgeText.d.ts.map b/node_modules/@xyflow/react/dist/umd/components/Edges/EdgeText.d.ts.map new file mode 100644 index 0000000..b151af5 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/Edges/EdgeText.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"EdgeText.d.ts","sourceRoot":"","sources":["../../../src/components/Edges/EdgeText.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,iBAAS,iBAAiB,CAAC,EACzB,CAAC,EACD,CAAC,EACD,KAAK,EACL,UAAU,EACV,WAAkB,EAClB,YAAY,EACZ,cAAuB,EACvB,mBAAuB,EACvB,QAAQ,EACR,SAAS,EACT,GAAG,IAAI,EACR,EAAE,aAAa,kDAqDf;kBAjEQ,iBAAiB;;;AAqE1B;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,QAAQ,+DAA0B,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/Edges/SimpleBezierEdge.d.ts b/node_modules/@xyflow/react/dist/umd/components/Edges/SimpleBezierEdge.d.ts new file mode 100644 index 0000000..7d39b01 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/Edges/SimpleBezierEdge.d.ts @@ -0,0 +1,30 @@ +import { Position } from '@xyflow/system'; +import type { SimpleBezierEdgeProps } from '../../types'; +export interface GetSimpleBezierPathParams { + sourceX: number; + sourceY: number; + /** @default Position.Bottom */ + sourcePosition?: Position; + targetX: number; + targetY: number; + /** @default Position.Top */ + targetPosition?: Position; +} +/** + * The `getSimpleBezierPath` util returns everything you need to render a simple + * bezier edge between two nodes. + * @public + * @returns + * - `path`: the path to use in an SVG `` element. + * - `labelX`: the `x` position you can use to render a label for this edge. + * - `labelY`: the `y` position you can use to render a label for this edge. + * - `offsetX`: the absolute difference between the source `x` position and the `x` position of the + * middle of this path. + * - `offsetY`: the absolute difference between the source `y` position and the `y` position of the + * middle of this path. + */ +export declare function getSimpleBezierPath({ sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition, }: GetSimpleBezierPathParams): [path: string, labelX: number, labelY: number, offsetX: number, offsetY: number]; +declare const SimpleBezierEdge: import("react").MemoExoticComponent<({ id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, markerEnd, markerStart, interactionWidth, }: SimpleBezierEdgeProps) => import("react/jsx-runtime").JSX.Element>; +declare const SimpleBezierEdgeInternal: import("react").MemoExoticComponent<({ id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, markerEnd, markerStart, interactionWidth, }: SimpleBezierEdgeProps) => import("react/jsx-runtime").JSX.Element>; +export { SimpleBezierEdge, SimpleBezierEdgeInternal }; +//# sourceMappingURL=SimpleBezierEdge.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/Edges/SimpleBezierEdge.d.ts.map b/node_modules/@xyflow/react/dist/umd/components/Edges/SimpleBezierEdge.d.ts.map new file mode 100644 index 0000000..43ba79b --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/Edges/SimpleBezierEdge.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"SimpleBezierEdge.d.ts","sourceRoot":"","sources":["../../../src/components/Edges/SimpleBezierEdge.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAuB,MAAM,gBAAgB,CAAC;AAG/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEzD,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,+BAA+B;IAC/B,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,4BAA4B;IAC5B,cAAc,CAAC,EAAE,QAAQ,CAAC;CAC3B;AAkBD;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,OAAO,EACP,OAAO,EACP,cAAgC,EAChC,OAAO,EACP,OAAO,EACP,cAA6B,GAC9B,EAAE,yBAAyB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAiC9G;AAyDD,QAAA,MAAM,gBAAgB,wPAlCf,qBAAqB,6CAkC0C,CAAC;AACvE,QAAA,MAAM,wBAAwB,wPAnCvB,qBAAqB,6CAmCiD,CAAC;AAK9E,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/Edges/SmoothStepEdge.d.ts b/node_modules/@xyflow/react/dist/umd/components/Edges/SmoothStepEdge.d.ts new file mode 100644 index 0000000..e6ac0cb --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/Edges/SmoothStepEdge.d.ts @@ -0,0 +1,31 @@ +import type { SmoothStepEdgeProps } from '../../types'; +/** + * Component that can be used inside a custom edge to render a smooth step edge. + * + * @public + * @example + * + * ```tsx + * import { SmoothStepEdge } from '@xyflow/react'; + * + * function CustomEdge({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition }) { + * return ( + * + * ); + * } + * ``` + */ +declare const SmoothStepEdge: import("react").MemoExoticComponent<({ id, sourceX, sourceY, targetX, targetY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, sourcePosition, targetPosition, markerEnd, markerStart, pathOptions, interactionWidth, }: SmoothStepEdgeProps) => import("react/jsx-runtime").JSX.Element>; +/** + * @internal + */ +declare const SmoothStepEdgeInternal: import("react").MemoExoticComponent<({ id, sourceX, sourceY, targetX, targetY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, sourcePosition, targetPosition, markerEnd, markerStart, pathOptions, interactionWidth, }: SmoothStepEdgeProps) => import("react/jsx-runtime").JSX.Element>; +export { SmoothStepEdge, SmoothStepEdgeInternal }; +//# sourceMappingURL=SmoothStepEdge.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/Edges/SmoothStepEdge.d.ts.map b/node_modules/@xyflow/react/dist/umd/components/Edges/SmoothStepEdge.d.ts.map new file mode 100644 index 0000000..097375a --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/Edges/SmoothStepEdge.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"SmoothStepEdge.d.ts","sourceRoot":"","sources":["../../../src/components/Edges/SmoothStepEdge.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AA4DvD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,QAAA,MAAM,cAAc,qQA3Db,mBAAmB,6CA2DwC,CAAC;AAEnE;;GAEG;AACH,QAAA,MAAM,sBAAsB,qQAhErB,mBAAmB,6CAgE+C,CAAC;AAK1E,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/Edges/StepEdge.d.ts b/node_modules/@xyflow/react/dist/umd/components/Edges/StepEdge.d.ts new file mode 100644 index 0000000..b335551 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/Edges/StepEdge.d.ts @@ -0,0 +1,31 @@ +import type { StepEdgeProps } from '../../types'; +/** + * Component that can be used inside a custom edge to render a step edge. + * + * @public + * @example + * + * ```tsx + * import { StepEdge } from '@xyflow/react'; + * + * function CustomEdge({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition }) { + * return ( + * + * ); + * } + * ``` + */ +declare const StepEdge: import("react").MemoExoticComponent<({ id, ...props }: StepEdgeProps) => import("react/jsx-runtime").JSX.Element>; +/** + * @internal + */ +declare const StepEdgeInternal: import("react").MemoExoticComponent<({ id, ...props }: StepEdgeProps) => import("react/jsx-runtime").JSX.Element>; +export { StepEdge, StepEdgeInternal }; +//# sourceMappingURL=StepEdge.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/Edges/StepEdge.d.ts.map b/node_modules/@xyflow/react/dist/umd/components/Edges/StepEdge.d.ts.map new file mode 100644 index 0000000..9fd57f9 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/Edges/StepEdge.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"StepEdge.d.ts","sourceRoot":"","sources":["../../../src/components/Edges/StepEdge.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAoBjD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,QAAA,MAAM,QAAQ,yDAvCmB,aAAa,6CAuCQ,CAAC;AAEvD;;GAEG;AACH,QAAA,MAAM,gBAAgB,yDA5CW,aAAa,6CA4Ce,CAAC;AAK9D,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/Edges/StraightEdge.d.ts b/node_modules/@xyflow/react/dist/umd/components/Edges/StraightEdge.d.ts new file mode 100644 index 0000000..0af4c28 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/Edges/StraightEdge.d.ts @@ -0,0 +1,29 @@ +import type { StraightEdgeProps } from '../../types'; +/** + * Component that can be used inside a custom edge to render a straight line. + * + * @public + * @example + * + * ```tsx + * import { StraightEdge } from '@xyflow/react'; + * + * function CustomEdge({ sourceX, sourceY, targetX, targetY }) { + * return ( + * + * ); + * } + * ``` + */ +declare const StraightEdge: import("react").MemoExoticComponent<({ id, sourceX, sourceY, targetX, targetY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, markerEnd, markerStart, interactionWidth, }: StraightEdgeProps) => import("react/jsx-runtime").JSX.Element>; +/** + * @internal + */ +declare const StraightEdgeInternal: import("react").MemoExoticComponent<({ id, sourceX, sourceY, targetX, targetY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, markerEnd, markerStart, interactionWidth, }: StraightEdgeProps) => import("react/jsx-runtime").JSX.Element>; +export { StraightEdge, StraightEdgeInternal }; +//# sourceMappingURL=StraightEdge.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/Edges/StraightEdge.d.ts.map b/node_modules/@xyflow/react/dist/umd/components/Edges/StraightEdge.d.ts.map new file mode 100644 index 0000000..4037d38 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/Edges/StraightEdge.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"StraightEdge.d.ts","sourceRoot":"","sources":["../../../src/components/Edges/StraightEdge.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAgDrD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,QAAA,MAAM,YAAY,wNAhDX,iBAAiB,6CAgDsC,CAAC;AAE/D;;GAEG;AACH,QAAA,MAAM,oBAAoB,wNArDnB,iBAAiB,6CAqD6C,CAAC;AAKtE,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/Edges/index.d.ts b/node_modules/@xyflow/react/dist/umd/components/Edges/index.d.ts new file mode 100644 index 0000000..d90e7ba --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/Edges/index.d.ts @@ -0,0 +1,6 @@ +export { SimpleBezierEdge, SimpleBezierEdgeInternal } from './SimpleBezierEdge'; +export { SmoothStepEdge, SmoothStepEdgeInternal } from './SmoothStepEdge'; +export { StepEdge, StepEdgeInternal } from './StepEdge'; +export { StraightEdge, StraightEdgeInternal } from './StraightEdge'; +export { BezierEdge, BezierEdgeInternal } from './BezierEdge'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/Edges/index.d.ts.map b/node_modules/@xyflow/react/dist/umd/components/Edges/index.d.ts.map new file mode 100644 index 0000000..b8fbaa2 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/Edges/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Edges/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/Handle/index.d.ts b/node_modules/@xyflow/react/dist/umd/components/Handle/index.d.ts new file mode 100644 index 0000000..40659a6 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/Handle/index.d.ts @@ -0,0 +1,39 @@ +import { type HTMLAttributes } from 'react'; +import { type HandleProps as HandlePropsSystem, OnConnect } from '@xyflow/system'; +/** + * @expand + */ +export type HandleProps = HandlePropsSystem & Omit, 'id'> & { + /** Callback called when connection is made */ + onConnect?: OnConnect; +}; +/** + * The `` component is used in your [custom nodes](/learn/customization/custom-nodes) + * to define connection points. + * + *@public + * + *@example + * + *```jsx + *import { Handle, Position } from '@xyflow/react'; + * + *export function CustomNode({ data }) { + * return ( + * <> + *
+ * {data.label} + *
+ * + * + * + * + * ); + *}; + *``` + */ +export declare const Handle: import("react").MemoExoticComponent<(props: HandlePropsSystem & Omit, "id"> & { + /** Callback called when connection is made */ + onConnect?: OnConnect; +} & import("react").RefAttributes) => import("react").JSX.Element>; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/Handle/index.d.ts.map b/node_modules/@xyflow/react/dist/umd/components/Handle/index.d.ts.map new file mode 100644 index 0000000..8ca09e9 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/Handle/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Handle/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EAKpB,MAAM,OAAO,CAAC;AAGf,OAAO,EAOL,KAAK,WAAW,IAAI,iBAAiB,EAIrC,SAAS,EAGV,MAAM,gBAAgB,CAAC;AAOxB;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,iBAAiB,GACzC,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,IAAI,CAAC,GAAG;IAC3C,8CAA8C;IAC9C,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AA6NJ;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,MAAM;IAxPf,8CAA8C;gBAClC,SAAS;kFAuPmC,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/NodeWrapper/index.d.ts b/node_modules/@xyflow/react/dist/umd/components/NodeWrapper/index.d.ts new file mode 100644 index 0000000..994b276 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/NodeWrapper/index.d.ts @@ -0,0 +1,3 @@ +import type { Node, NodeWrapperProps } from '../../types'; +export declare function NodeWrapper({ id, onClick, onMouseEnter, onMouseMove, onMouseLeave, onContextMenu, onDoubleClick, nodesDraggable, elementsSelectable, nodesConnectable, nodesFocusable, resizeObserver, noDragClassName, noPanClassName, disableKeyboardA11y, rfId, nodeTypes, nodeClickDistance, onError, }: NodeWrapperProps): import("react/jsx-runtime").JSX.Element | null; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/NodeWrapper/index.d.ts.map b/node_modules/@xyflow/react/dist/umd/components/NodeWrapper/index.d.ts.map new file mode 100644 index 0000000..7460e3a --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/NodeWrapper/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/NodeWrapper/index.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAgB,IAAI,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAExE,wBAAgB,WAAW,CAAC,QAAQ,SAAS,IAAI,EAAE,EACjD,EAAE,EACF,OAAO,EACP,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,aAAa,EACb,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,IAAI,EACJ,SAAS,EACT,iBAAiB,EACjB,OAAO,GACR,EAAE,gBAAgB,CAAC,QAAQ,CAAC,kDAgN5B"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/NodeWrapper/useNodeObserver.d.ts b/node_modules/@xyflow/react/dist/umd/components/NodeWrapper/useNodeObserver.d.ts new file mode 100644 index 0000000..457539f --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/NodeWrapper/useNodeObserver.d.ts @@ -0,0 +1,14 @@ +import type { InternalNode } from '../../types'; +/** + * Hook to handle the resize observation + internal updates for the passed node. + * + * @internal + * @returns nodeRef - reference to the node element + */ +export declare function useNodeObserver({ node, nodeType, hasDimensions, resizeObserver, }: { + node: InternalNode; + nodeType: string; + hasDimensions: boolean; + resizeObserver: ResizeObserver | null; +}): import("react").MutableRefObject; +//# sourceMappingURL=useNodeObserver.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/NodeWrapper/useNodeObserver.d.ts.map b/node_modules/@xyflow/react/dist/umd/components/NodeWrapper/useNodeObserver.d.ts.map new file mode 100644 index 0000000..34342f7 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/NodeWrapper/useNodeObserver.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useNodeObserver.d.ts","sourceRoot":"","sources":["../../../src/components/NodeWrapper/useNodeObserver.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,cAAc,GACf,EAAE;IACD,IAAI,EAAE,YAAY,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,OAAO,CAAC;IACvB,cAAc,EAAE,cAAc,GAAG,IAAI,CAAC;CACvC,2DAmDA"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/NodeWrapper/utils.d.ts b/node_modules/@xyflow/react/dist/umd/components/NodeWrapper/utils.d.ts new file mode 100644 index 0000000..ec4720e --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/NodeWrapper/utils.d.ts @@ -0,0 +1,9 @@ +import type { XYPosition } from '@xyflow/system'; +import type { InternalNode, Node, NodeTypes } from '../../types'; +export declare const arrowKeyDiffs: Record; +export declare const builtinNodeTypes: NodeTypes; +export declare function getNodeInlineStyleDimensions(node: InternalNode): { + width: number | string | undefined; + height: number | string | undefined; +}; +//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/NodeWrapper/utils.d.ts.map b/node_modules/@xyflow/react/dist/umd/components/NodeWrapper/utils.d.ts.map new file mode 100644 index 0000000..9450c4e --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/NodeWrapper/utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/NodeWrapper/utils.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAMjD,OAAO,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEjE,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAKpD,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,SAK9B,CAAC;AAEF,wBAAgB,4BAA4B,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EACvE,IAAI,EAAE,YAAY,CAAC,QAAQ,CAAC,GAC3B;IACD,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACnC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CACrC,CAYA"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/Nodes/DefaultNode.d.ts b/node_modules/@xyflow/react/dist/umd/components/Nodes/DefaultNode.d.ts new file mode 100644 index 0000000..c97468e --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/Nodes/DefaultNode.d.ts @@ -0,0 +1,3 @@ +import type { BuiltInNode, NodeProps } from '../../types/nodes'; +export declare function DefaultNode({ data, isConnectable, targetPosition, sourcePosition, }: NodeProps): import("react/jsx-runtime").JSX.Element; +//# sourceMappingURL=DefaultNode.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/Nodes/DefaultNode.d.ts.map b/node_modules/@xyflow/react/dist/umd/components/Nodes/DefaultNode.d.ts.map new file mode 100644 index 0000000..39117d0 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/Nodes/DefaultNode.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"DefaultNode.d.ts","sourceRoot":"","sources":["../../../src/components/Nodes/DefaultNode.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEhE,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,aAAa,EACb,cAA6B,EAC7B,cAAgC,GACjC,EAAE,SAAS,CAAC,WAAW,CAAC,2CAQxB"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/Nodes/GroupNode.d.ts b/node_modules/@xyflow/react/dist/umd/components/Nodes/GroupNode.d.ts new file mode 100644 index 0000000..901decc --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/Nodes/GroupNode.d.ts @@ -0,0 +1,2 @@ +export declare function GroupNode(): null; +//# sourceMappingURL=GroupNode.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/Nodes/GroupNode.d.ts.map b/node_modules/@xyflow/react/dist/umd/components/Nodes/GroupNode.d.ts.map new file mode 100644 index 0000000..8427516 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/Nodes/GroupNode.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"GroupNode.d.ts","sourceRoot":"","sources":["../../../src/components/Nodes/GroupNode.tsx"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,SAExB"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/Nodes/InputNode.d.ts b/node_modules/@xyflow/react/dist/umd/components/Nodes/InputNode.d.ts new file mode 100644 index 0000000..5f54760 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/Nodes/InputNode.d.ts @@ -0,0 +1,3 @@ +import type { BuiltInNode, NodeProps } from '../../types/nodes'; +export declare function InputNode({ data, isConnectable, sourcePosition }: NodeProps): import("react/jsx-runtime").JSX.Element; +//# sourceMappingURL=InputNode.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/Nodes/InputNode.d.ts.map b/node_modules/@xyflow/react/dist/umd/components/Nodes/InputNode.d.ts.map new file mode 100644 index 0000000..1b43a1c --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/Nodes/InputNode.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"InputNode.d.ts","sourceRoot":"","sources":["../../../src/components/Nodes/InputNode.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEhE,wBAAgB,SAAS,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,cAAgC,EAAE,EAAE,SAAS,CAAC,WAAW,CAAC,2CAO1G"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/Nodes/OutputNode.d.ts b/node_modules/@xyflow/react/dist/umd/components/Nodes/OutputNode.d.ts new file mode 100644 index 0000000..d66c1fb --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/Nodes/OutputNode.d.ts @@ -0,0 +1,3 @@ +import type { BuiltInNode, NodeProps } from '../../types/nodes'; +export declare function OutputNode({ data, isConnectable, targetPosition }: NodeProps): import("react/jsx-runtime").JSX.Element; +//# sourceMappingURL=OutputNode.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/Nodes/OutputNode.d.ts.map b/node_modules/@xyflow/react/dist/umd/components/Nodes/OutputNode.d.ts.map new file mode 100644 index 0000000..f53ab00 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/Nodes/OutputNode.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"OutputNode.d.ts","sourceRoot":"","sources":["../../../src/components/Nodes/OutputNode.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEhE,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,cAA6B,EAAE,EAAE,SAAS,CAAC,WAAW,CAAC,2CAOxG"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/Nodes/utils.d.ts b/node_modules/@xyflow/react/dist/umd/components/Nodes/utils.d.ts new file mode 100644 index 0000000..25d4ff1 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/Nodes/utils.d.ts @@ -0,0 +1,13 @@ +import type { RefObject } from 'react'; +import type { StoreApi } from 'zustand'; +import type { ReactFlowState } from '../../types'; +export declare function handleNodeClick({ id, store, unselect, nodeRef, }: { + id: string; + store: { + getState: StoreApi['getState']; + setState: StoreApi['setState']; + }; + unselect?: boolean; + nodeRef?: RefObject; +}): void; +//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/Nodes/utils.d.ts.map b/node_modules/@xyflow/react/dist/umd/components/Nodes/utils.d.ts.map new file mode 100644 index 0000000..84a7a1c --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/Nodes/utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/Nodes/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAQlD,wBAAgB,eAAe,CAAC,EAC9B,EAAE,EACF,KAAK,EACL,QAAgB,EAChB,OAAO,GACR,EAAE;IACD,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE;QACL,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,UAAU,CAAC,CAAC;QAC/C,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,UAAU,CAAC,CAAC;KAChD,CAAC;IACF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;CACrC,QAkBA"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/NodesSelection/index.d.ts b/node_modules/@xyflow/react/dist/umd/components/NodesSelection/index.d.ts new file mode 100644 index 0000000..0c09613 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/NodesSelection/index.d.ts @@ -0,0 +1,13 @@ +/** + * The nodes selection rectangle gets displayed when a user + * made a selection with on or several nodes + */ +import { type MouseEvent } from 'react'; +import type { Node } from '../../types'; +export type NodesSelectionProps = { + onSelectionContextMenu?: (event: MouseEvent, nodes: NodeType[]) => void; + noPanClassName?: string; + disableKeyboardA11y: boolean; +}; +export declare function NodesSelection({ onSelectionContextMenu, noPanClassName, disableKeyboardA11y, }: NodesSelectionProps): import("react/jsx-runtime").JSX.Element | null; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/NodesSelection/index.d.ts.map b/node_modules/@xyflow/react/dist/umd/components/NodesSelection/index.d.ts.map new file mode 100644 index 0000000..c1915c3 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/NodesSelection/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/NodesSelection/index.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAqB,KAAK,UAAU,EAAsB,MAAM,OAAO,CAAC;AAS/E,OAAO,KAAK,EAAE,IAAI,EAAkB,MAAM,aAAa,CAAC;AAExD,MAAM,MAAM,mBAAmB,CAAC,QAAQ,IAAI;IAC1C,sBAAsB,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;IACxE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mBAAmB,EAAE,OAAO,CAAC;CAC9B,CAAC;AAeF,wBAAgB,cAAc,CAAC,QAAQ,SAAS,IAAI,EAAE,EACpD,sBAAsB,EACtB,cAAc,EACd,mBAAmB,GACpB,EAAE,mBAAmB,CAAC,QAAQ,CAAC,kDA6D/B"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/Panel/index.d.ts b/node_modules/@xyflow/react/dist/umd/components/Panel/index.d.ts new file mode 100644 index 0000000..f9a8b24 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/Panel/index.d.ts @@ -0,0 +1,45 @@ +import { HTMLAttributes } from 'react'; +import type { PanelPosition } from '@xyflow/system'; +/** + * @expand + */ +export type PanelProps = HTMLAttributes & { + /** + * The position of the panel. + * @default "top-left" + */ + position?: PanelPosition; +}; +/** + * The `` component helps you position content above the viewport. + * It is used internally by the [``](/api-reference/components/minimap) + * and [``](/api-reference/components/controls) components. + * + * @public + * + * @example + * ```jsx + *import { ReactFlow, Background, Panel } from '@xyflow/react'; + * + *export default function Flow() { + * return ( + * + * top-left + * top-center + * top-right + * bottom-left + * bottom-center + * bottom-right + * + * ); + *} + *``` + */ +export declare const Panel: import("react").ForwardRefExoticComponent & { + /** + * The position of the panel. + * @default "top-left" + */ + position?: PanelPosition; +} & import("react").RefAttributes>; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/Panel/index.d.ts.map b/node_modules/@xyflow/react/dist/umd/components/Panel/index.d.ts.map new file mode 100644 index 0000000..42759ef --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/Panel/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Panel/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAc,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAKpD;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IACxD;;;OAGG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAC;CAC1B,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,KAAK;IAlChB;;;OAGG;eACQ,aAAa;kDA8CzB,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/ReactFlowProvider/index.d.ts b/node_modules/@xyflow/react/dist/umd/components/ReactFlowProvider/index.d.ts new file mode 100644 index 0000000..e5f5f35 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/ReactFlowProvider/index.d.ts @@ -0,0 +1,82 @@ +import { type ReactNode } from 'react'; +import type { Node, Edge, FitViewOptions } from '../../types'; +import { CoordinateExtent, NodeOrigin } from '@xyflow/system'; +export type ReactFlowProviderProps = { + /** These nodes are used to initialize the flow. They are not dynamic. */ + initialNodes?: Node[]; + /** These edges are used to initialize the flow. They are not dynamic. */ + initialEdges?: Edge[]; + /** These nodes are used to initialize the flow. They are not dynamic. */ + defaultNodes?: Node[]; + /** These edges are used to initialize the flow. They are not dynamic. */ + defaultEdges?: Edge[]; + /** The initial width is necessary to be able to use fitView on the server */ + initialWidth?: number; + /** The initial height is necessary to be able to use fitView on the server */ + initialHeight?: number; + /** When `true`, the flow will be zoomed and panned to fit all the nodes initially provided. */ + fitView?: boolean; + /** + * You can provide an object of options to customize the initial fitView behavior. + */ + initialFitViewOptions?: FitViewOptions; + /** Initial minimum zoom level */ + initialMinZoom?: number; + /** Initial maximum zoom level */ + initialMaxZoom?: number; + /** + * The origin of the node to use when placing it in the flow or looking up its `x` and `y` + * position. An origin of `[0, 0]` means that a node's top left corner will be placed at the `x` + * and `y` position. + * @default [0, 0] + * @example + * [0, 0] // default, top left + * [0.5, 0.5] // center + * [1, 1] // bottom right + */ + nodeOrigin?: NodeOrigin; + /** + * By default, nodes can be placed on an infinite flow. You can use this prop to set a boundary. + * + * The first pair of coordinates is the top left boundary and the second pair is the bottom right. + * @example [[-1000, -10000], [1000, 1000]] + */ + nodeExtent?: CoordinateExtent; + children: ReactNode; +}; +/** + * The `` component is a [context provider](https://react.dev/learn/passing-data-deeply-with-context#) + * that makes it possible to access a flow's internal state outside of the + * [``](/api-reference/react-flow) component. Many of the hooks we + * provide rely on this component to work. + * @public + * + * @example + * ```tsx + *import { ReactFlow, ReactFlowProvider, useNodes } from '@xyflow/react' + * + *export default function Flow() { + * return ( + * + * + * + * + * ); + *} + * + *function Sidebar() { + * // This hook will only work if the component it's used in is a child of a + * // . + * const nodes = useNodes() + * + * return ; + *} + *``` + * + * @remarks If you're using a router and want your flow's state to persist across routes, + * it's vital that you place the `` component _outside_ of + * your router. If you have multiple flows on the same page you will need to use a separate + * `` for each flow. + */ +export declare function ReactFlowProvider({ initialNodes: nodes, initialEdges: edges, defaultNodes, defaultEdges, initialWidth: width, initialHeight: height, initialMinZoom: minZoom, initialMaxZoom: maxZoom, initialFitViewOptions: fitViewOptions, fitView, nodeOrigin, nodeExtent, children, }: ReactFlowProviderProps): import("react/jsx-runtime").JSX.Element; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/ReactFlowProvider/index.d.ts.map b/node_modules/@xyflow/react/dist/umd/components/ReactFlowProvider/index.d.ts.map new file mode 100644 index 0000000..74bf151 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/ReactFlowProvider/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ReactFlowProvider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAKjD,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE9D,MAAM,MAAM,sBAAsB,GAAG;IACnC,yEAAyE;IACzE,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;IACtB,yEAAyE;IACzE,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;IACtB,yEAAyE;IACzE,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;IACtB,yEAAyE;IACzE,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;IACtB,6EAA6E;IAC7E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,8EAA8E;IAC9E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,+FAA+F;IAC/F,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,qBAAqB,CAAC,EAAE,cAAc,CAAC;IACvC,iCAAiC;IACjC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iCAAiC;IACjC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;;;;OASG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,YAAY,EAAE,KAAK,EACnB,YAAY,EAAE,KAAK,EACnB,YAAY,EACZ,YAAY,EACZ,YAAY,EAAE,KAAK,EACnB,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,OAAO,EACvB,cAAc,EAAE,OAAO,EACvB,qBAAqB,EAAE,cAAc,EACrC,OAAO,EACP,UAAU,EACV,UAAU,EACV,QAAQ,GACT,EAAE,sBAAsB,2CAuBxB"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/SelectionListener/index.d.ts b/node_modules/@xyflow/react/dist/umd/components/SelectionListener/index.d.ts new file mode 100644 index 0000000..2eb1cb3 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/SelectionListener/index.d.ts @@ -0,0 +1,7 @@ +import type { OnSelectionChangeFunc, Node, Edge } from '../../types'; +type SelectionListenerProps = { + onSelectionChange?: OnSelectionChangeFunc; +}; +export declare function SelectionListener({ onSelectionChange, }: SelectionListenerProps): import("react/jsx-runtime").JSX.Element | null; +export {}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/SelectionListener/index.d.ts.map b/node_modules/@xyflow/react/dist/umd/components/SelectionListener/index.d.ts.map new file mode 100644 index 0000000..ff248c3 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/SelectionListener/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SelectionListener/index.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAkB,qBAAqB,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAErF,KAAK,sBAAsB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI;IACxF,iBAAiB,CAAC,EAAE,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;CAC/D,CAAC;AAkDF,wBAAgB,iBAAiB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,EAC5F,iBAAiB,GAClB,EAAE,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,CAAC,kDAQ5C"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/StoreUpdater/index.d.ts b/node_modules/@xyflow/react/dist/umd/components/StoreUpdater/index.d.ts new file mode 100644 index 0000000..c9f4914 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/StoreUpdater/index.d.ts @@ -0,0 +1,9 @@ +import type { Node, Edge, ReactFlowProps } from '../../types'; +declare const reactFlowFieldsToTrack: readonly ["nodes", "edges", "defaultNodes", "defaultEdges", "onConnect", "onConnectStart", "onConnectEnd", "onClickConnectStart", "onClickConnectEnd", "nodesDraggable", "autoPanOnNodeFocus", "nodesConnectable", "nodesFocusable", "edgesFocusable", "edgesReconnectable", "elevateNodesOnSelect", "elevateEdgesOnSelect", "minZoom", "maxZoom", "nodeExtent", "onNodesChange", "onEdgesChange", "elementsSelectable", "connectionMode", "snapGrid", "snapToGrid", "translateExtent", "connectOnClick", "defaultEdgeOptions", "fitView", "fitViewOptions", "onNodesDelete", "onEdgesDelete", "onDelete", "onNodeDrag", "onNodeDragStart", "onNodeDragStop", "onSelectionDrag", "onSelectionDragStart", "onSelectionDragStop", "onMoveStart", "onMove", "onMoveEnd", "noPanClassName", "nodeOrigin", "autoPanOnConnect", "autoPanOnNodeDrag", "onError", "connectionRadius", "isValidConnection", "selectNodesOnDrag", "nodeDragThreshold", "onBeforeDelete", "debug", "autoPanSpeed", "paneClickDistance", "ariaLabelConfig"]; +type ReactFlowFieldsToTrack = (typeof reactFlowFieldsToTrack)[number]; +type StoreUpdaterProps = Pick, ReactFlowFieldsToTrack> & { + rfId: string; +}; +export declare function StoreUpdater(props: StoreUpdaterProps): null; +export {}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/StoreUpdater/index.d.ts.map b/node_modules/@xyflow/react/dist/umd/components/StoreUpdater/index.d.ts.map new file mode 100644 index 0000000..d96502f --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/StoreUpdater/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/StoreUpdater/index.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAkB,cAAc,EAAkB,MAAM,aAAa,CAAC;AAI9F,QAAA,MAAM,sBAAsB,i+BA0DlB,CAAC;AAEX,KAAK,sBAAsB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AACtE,KAAK,iBAAiB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,IAAI,CACvF,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAClC,sBAAsB,CACvB,GAAG;IACF,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAiCF,wBAAgB,YAAY,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,EACrF,KAAK,EAAE,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,CAAC,QA6D7C"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/UserSelection/index.d.ts b/node_modules/@xyflow/react/dist/umd/components/UserSelection/index.d.ts new file mode 100644 index 0000000..51a455d --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/UserSelection/index.d.ts @@ -0,0 +1,2 @@ +export declare function UserSelection(): import("react/jsx-runtime").JSX.Element | null; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/UserSelection/index.d.ts.map b/node_modules/@xyflow/react/dist/umd/components/UserSelection/index.d.ts.map new file mode 100644 index 0000000..ee199d0 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/UserSelection/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/UserSelection/index.tsx"],"names":[],"mappings":"AAUA,wBAAgB,aAAa,mDAkB5B"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/ViewportPortal/index.d.ts b/node_modules/@xyflow/react/dist/umd/components/ViewportPortal/index.d.ts new file mode 100644 index 0000000..2702355 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/ViewportPortal/index.d.ts @@ -0,0 +1,30 @@ +import type { ReactNode } from 'react'; +/** + * The `` component can be used to add components to the same viewport + * of the flow where nodes and edges are rendered. This is useful when you want to render + * your own components that are adhere to the same coordinate system as the nodes & edges + * and are also affected by zooming and panning + * @public + * @example + * + * ```jsx + *import React from 'react'; + *import { ViewportPortal } from '@xyflow/react'; + * + *export default function () { + * return ( + * + *
+ * This div is positioned at [100, 100] on the flow. + *
+ *
+ * ); + *} + *``` + */ +export declare function ViewportPortal({ children }: { + children: ReactNode; +}): import("react").ReactPortal | null; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/components/ViewportPortal/index.d.ts.map b/node_modules/@xyflow/react/dist/umd/components/ViewportPortal/index.d.ts.map new file mode 100644 index 0000000..439da41 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/components/ViewportPortal/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ViewportPortal/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQvC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,sCAQnE"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/container/EdgeRenderer/MarkerDefinitions.d.ts b/node_modules/@xyflow/react/dist/umd/container/EdgeRenderer/MarkerDefinitions.d.ts new file mode 100644 index 0000000..88986cd --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/container/EdgeRenderer/MarkerDefinitions.d.ts @@ -0,0 +1,10 @@ +type MarkerDefinitionsProps = { + defaultColor: string; + rfId?: string; +}; +declare const _default: import("react").MemoExoticComponent<{ + ({ defaultColor, rfId }: MarkerDefinitionsProps): import("react/jsx-runtime").JSX.Element | null; + displayName: string; +}>; +export default _default; +//# sourceMappingURL=MarkerDefinitions.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/container/EdgeRenderer/MarkerDefinitions.d.ts.map b/node_modules/@xyflow/react/dist/umd/container/EdgeRenderer/MarkerDefinitions.d.ts.map new file mode 100644 index 0000000..94bed4a --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/container/EdgeRenderer/MarkerDefinitions.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MarkerDefinitions.d.ts","sourceRoot":"","sources":["../../../src/container/EdgeRenderer/MarkerDefinitions.tsx"],"names":[],"mappings":"AAMA,KAAK,sBAAsB,GAAG;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;;6BAwCiD,sBAAsB;;;AA0CzE,wBAAuC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/container/EdgeRenderer/MarkerSymbols.d.ts b/node_modules/@xyflow/react/dist/umd/container/EdgeRenderer/MarkerSymbols.d.ts new file mode 100644 index 0000000..07d19a9 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/container/EdgeRenderer/MarkerSymbols.d.ts @@ -0,0 +1,9 @@ +import { MarkerType, type EdgeMarker } from '@xyflow/system'; +type SymbolProps = Omit; +export declare const MarkerSymbols: { + arrow: ({ color, strokeWidth }: SymbolProps) => import("react/jsx-runtime").JSX.Element; + arrowclosed: ({ color, strokeWidth }: SymbolProps) => import("react/jsx-runtime").JSX.Element; +}; +export declare function useMarkerSymbol(type: MarkerType): (({ color, strokeWidth }: SymbolProps) => import("react/jsx-runtime").JSX.Element) | null; +export {}; +//# sourceMappingURL=MarkerSymbols.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/container/EdgeRenderer/MarkerSymbols.d.ts.map b/node_modules/@xyflow/react/dist/umd/container/EdgeRenderer/MarkerSymbols.d.ts.map new file mode 100644 index 0000000..9cdfd16 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/container/EdgeRenderer/MarkerSymbols.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MarkerSymbols.d.ts","sourceRoot":"","sources":["../../../src/container/EdgeRenderer/MarkerSymbols.tsx"],"names":[],"mappings":"AACA,OAAO,EAAiB,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAI5E,KAAK,WAAW,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;AAgC5C,eAAO,MAAM,aAAa;oCA9BgC,WAAW;0CAeL,WAAW;CAkB1E,CAAC;AAEF,wBAAgB,eAAe,CAAC,IAAI,EAAE,UAAU,6BAnCU,WAAW,qDAmDpE"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/container/EdgeRenderer/index.d.ts b/node_modules/@xyflow/react/dist/umd/container/EdgeRenderer/index.d.ts new file mode 100644 index 0000000..ee91865 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/container/EdgeRenderer/index.d.ts @@ -0,0 +1,13 @@ +import { ReactNode } from 'react'; +import { GraphViewProps } from '../GraphView'; +import type { Edge, Node } from '../../types'; +type EdgeRendererProps = Pick, 'onEdgeClick' | 'onEdgeDoubleClick' | 'defaultMarkerColor' | 'onlyRenderVisibleElements' | 'onReconnect' | 'onEdgeContextMenu' | 'onEdgeMouseEnter' | 'onEdgeMouseMove' | 'onEdgeMouseLeave' | 'onReconnectStart' | 'onReconnectEnd' | 'reconnectRadius' | 'noPanClassName' | 'rfId' | 'disableKeyboardA11y' | 'edgeTypes'> & { + children?: ReactNode; +}; +declare function EdgeRendererComponent({ defaultMarkerColor, onlyRenderVisibleElements, rfId, edgeTypes, noPanClassName, onReconnect, onEdgeContextMenu, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, onEdgeClick, reconnectRadius, onEdgeDoubleClick, onReconnectStart, onReconnectEnd, disableKeyboardA11y, }: EdgeRendererProps): import("react/jsx-runtime").JSX.Element; +declare namespace EdgeRendererComponent { + var displayName: string; +} +export declare const EdgeRenderer: typeof EdgeRendererComponent; +export {}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/container/EdgeRenderer/index.d.ts.map b/node_modules/@xyflow/react/dist/umd/container/EdgeRenderer/index.d.ts.map new file mode 100644 index 0000000..d3a1f62 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/container/EdgeRenderer/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/container/EdgeRenderer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,SAAS,EAAE,MAAM,OAAO,CAAC;AAMxC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EAAE,IAAI,EAAkB,IAAI,EAAE,MAAM,aAAa,CAAC;AAE9D,KAAK,iBAAiB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,IAAI,CACzD,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAC,EAC5B,aAAa,GACb,mBAAmB,GACnB,oBAAoB,GACpB,2BAA2B,GAC3B,aAAa,GACb,mBAAmB,GACnB,kBAAkB,GAClB,iBAAiB,GACjB,kBAAkB,GAClB,kBAAkB,GAClB,gBAAgB,GAChB,iBAAiB,GACjB,gBAAgB,GAChB,MAAM,GACN,qBAAqB,GACrB,WAAW,CACd,GAAG;IACF,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAUF,iBAAS,qBAAqB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,EAC3D,kBAAkB,EAClB,yBAAyB,EACzB,IAAI,EACJ,SAAS,EACT,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,mBAAmB,GACpB,EAAE,iBAAiB,CAAC,QAAQ,CAAC,2CAoC7B;kBArDQ,qBAAqB;;;AAyD9B,eAAO,MAAM,YAAY,EAAkC,OAAO,qBAAqB,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/container/FlowRenderer/index.d.ts b/node_modules/@xyflow/react/dist/umd/container/FlowRenderer/index.d.ts new file mode 100644 index 0000000..655c5a3 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/container/FlowRenderer/index.d.ts @@ -0,0 +1,14 @@ +import { type ReactNode } from 'react'; +import { GraphViewProps } from '../GraphView'; +import type { Node } from '../../types'; +export type FlowRendererProps = Omit, 'snapToGrid' | 'nodeTypes' | 'edgeTypes' | 'snapGrid' | 'connectionLineType' | 'connectionLineContainerStyle' | 'arrowHeadColor' | 'onlyRenderVisibleElements' | 'selectNodesOnDrag' | 'defaultMarkerColor' | 'rfId' | 'nodeClickDistance'> & { + isControlledViewport: boolean; + children: ReactNode; +}; +declare function FlowRendererComponent({ children, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneContextMenu, onPaneScroll, paneClickDistance, deleteKeyCode, selectionKeyCode, selectionOnDrag, selectionMode, onSelectionStart, onSelectionEnd, multiSelectionKeyCode, panActivationKeyCode, zoomActivationKeyCode, elementsSelectable, zoomOnScroll, zoomOnPinch, panOnScroll: _panOnScroll, panOnScrollSpeed, panOnScrollMode, zoomOnDoubleClick, panOnDrag: _panOnDrag, defaultViewport, translateExtent, minZoom, maxZoom, preventScrolling, onSelectionContextMenu, noWheelClassName, noPanClassName, disableKeyboardA11y, onViewportChange, isControlledViewport, }: FlowRendererProps): import("react/jsx-runtime").JSX.Element; +declare namespace FlowRendererComponent { + var displayName: string; +} +export declare const FlowRenderer: typeof FlowRendererComponent; +export {}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/container/FlowRenderer/index.d.ts.map b/node_modules/@xyflow/react/dist/umd/container/FlowRenderer/index.d.ts.map new file mode 100644 index 0000000..1ee1826 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/container/FlowRenderer/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/container/FlowRenderer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAK7C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAI9C,OAAO,KAAK,EAAkB,IAAI,EAAE,MAAM,aAAa,CAAC;AAExD,MAAM,MAAM,iBAAiB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,IAAI,CAChE,cAAc,CAAC,QAAQ,CAAC,EACtB,YAAY,GACZ,WAAW,GACX,WAAW,GACX,UAAU,GACV,oBAAoB,GACpB,8BAA8B,GAC9B,gBAAgB,GAChB,2BAA2B,GAC3B,mBAAmB,GACnB,oBAAoB,GACpB,MAAM,GACN,mBAAmB,CACtB,GAAG;IACF,oBAAoB,EAAE,OAAO,CAAC;IAC9B,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAQF,iBAAS,qBAAqB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,EAC3D,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,YAAY,EACZ,WAAW,EACX,WAAW,EAAE,YAAY,EACzB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,SAAS,EAAE,UAAU,EACrB,eAAe,EACf,eAAe,EACf,OAAO,EACP,OAAO,EACP,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,GACrB,EAAE,iBAAiB,CAAC,QAAQ,CAAC,2CA6D7B;kBAlGQ,qBAAqB;;;AAsG9B,eAAO,MAAM,YAAY,EAAkC,OAAO,qBAAqB,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/container/GraphView/index.d.ts b/node_modules/@xyflow/react/dist/umd/container/GraphView/index.d.ts new file mode 100644 index 0000000..9b1cd31 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/container/GraphView/index.d.ts @@ -0,0 +1,11 @@ +import type { Edge, Node, ReactFlowProps } from '../../types'; +export type GraphViewProps = Omit, 'onSelectionChange' | 'nodes' | 'edges' | 'onMove' | 'onMoveStart' | 'onMoveEnd' | 'elevateEdgesOnSelect'> & Required, 'selectionKeyCode' | 'deleteKeyCode' | 'multiSelectionKeyCode' | 'connectionLineType' | 'onlyRenderVisibleElements' | 'translateExtent' | 'minZoom' | 'maxZoom' | 'defaultMarkerColor' | 'noDragClassName' | 'noWheelClassName' | 'noPanClassName' | 'defaultViewport' | 'disableKeyboardA11y' | 'paneClickDistance' | 'nodeClickDistance'>> & { + rfId: string; +}; +declare function GraphViewComponent({ nodeTypes, edgeTypes, onInit, onNodeClick, onEdgeClick, onNodeDoubleClick, onEdgeDoubleClick, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave, onNodeContextMenu, onSelectionContextMenu, onSelectionStart, onSelectionEnd, connectionLineType, connectionLineStyle, connectionLineComponent, connectionLineContainerStyle, selectionKeyCode, selectionOnDrag, selectionMode, multiSelectionKeyCode, panActivationKeyCode, zoomActivationKeyCode, deleteKeyCode, onlyRenderVisibleElements, elementsSelectable, defaultViewport, translateExtent, minZoom, maxZoom, preventScrolling, defaultMarkerColor, zoomOnScroll, zoomOnPinch, panOnScroll, panOnScrollSpeed, panOnScrollMode, zoomOnDoubleClick, panOnDrag, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneScroll, onPaneContextMenu, paneClickDistance, nodeClickDistance, onEdgeContextMenu, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, reconnectRadius, onReconnect, onReconnectStart, onReconnectEnd, noDragClassName, noWheelClassName, noPanClassName, disableKeyboardA11y, nodeExtent, rfId, viewport, onViewportChange, }: GraphViewProps): import("react/jsx-runtime").JSX.Element; +declare namespace GraphViewComponent { + var displayName: string; +} +export declare const GraphView: typeof GraphViewComponent; +export {}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/container/GraphView/index.d.ts.map b/node_modules/@xyflow/react/dist/umd/container/GraphView/index.d.ts.map new file mode 100644 index 0000000..f94f3ab --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/container/GraphView/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/container/GraphView/index.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG9D,MAAM,MAAM,cAAc,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,IAAI,CAC3F,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAClC,mBAAmB,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,aAAa,GAAG,WAAW,GAAG,sBAAsB,CAC1G,GACC,QAAQ,CACN,IAAI,CACF,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAChC,kBAAkB,GAClB,eAAe,GACf,uBAAuB,GACvB,oBAAoB,GACpB,2BAA2B,GAC3B,iBAAiB,GACjB,SAAS,GACT,SAAS,GACT,oBAAoB,GACpB,iBAAiB,GACjB,kBAAkB,GAClB,gBAAgB,GAChB,iBAAiB,GACjB,qBAAqB,GACrB,mBAAmB,GACnB,mBAAmB,CACtB,CACF,GAAG;IACF,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEJ,iBAAS,kBAAkB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,EACtF,SAAS,EACT,SAAS,EACT,MAAM,EACN,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,4BAA4B,EAC5B,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,aAAa,EACb,yBAAyB,EACzB,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,OAAO,EACP,OAAO,EACP,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,gBAAgB,GACjB,EAAE,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,2CA6FpC;kBA9JQ,kBAAkB;;;AAkK3B,eAAO,MAAM,SAAS,EAA+B,OAAO,kBAAkB,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/container/GraphView/useNodeOrEdgeTypesWarning.d.ts b/node_modules/@xyflow/react/dist/umd/container/GraphView/useNodeOrEdgeTypesWarning.d.ts new file mode 100644 index 0000000..601d170 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/container/GraphView/useNodeOrEdgeTypesWarning.d.ts @@ -0,0 +1,10 @@ +import type { EdgeTypes, NodeTypes } from '../../types'; +/** + * This hook warns the user if nodeTypes or edgeTypes changed. + * It is only used in development mode. + * + * @internal + */ +export declare function useNodeOrEdgeTypesWarning(nodeOrEdgeTypes?: NodeTypes): void; +export declare function useNodeOrEdgeTypesWarning(nodeOrEdgeTypes?: EdgeTypes): void; +//# sourceMappingURL=useNodeOrEdgeTypesWarning.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/container/GraphView/useNodeOrEdgeTypesWarning.d.ts.map b/node_modules/@xyflow/react/dist/umd/container/GraphView/useNodeOrEdgeTypesWarning.d.ts.map new file mode 100644 index 0000000..52c6320 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/container/GraphView/useNodeOrEdgeTypesWarning.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useNodeOrEdgeTypesWarning.d.ts","sourceRoot":"","sources":["../../../src/container/GraphView/useNodeOrEdgeTypesWarning.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAIxD;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,eAAe,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;AAC7E,wBAAgB,yBAAyB,CAAC,eAAe,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/container/GraphView/useStylesLoadedWarning.d.ts b/node_modules/@xyflow/react/dist/umd/container/GraphView/useStylesLoadedWarning.d.ts new file mode 100644 index 0000000..736e3be --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/container/GraphView/useStylesLoadedWarning.d.ts @@ -0,0 +1,2 @@ +export declare function useStylesLoadedWarning(): void; +//# sourceMappingURL=useStylesLoadedWarning.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/container/GraphView/useStylesLoadedWarning.d.ts.map b/node_modules/@xyflow/react/dist/umd/container/GraphView/useStylesLoadedWarning.d.ts.map new file mode 100644 index 0000000..f7c8afb --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/container/GraphView/useStylesLoadedWarning.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useStylesLoadedWarning.d.ts","sourceRoot":"","sources":["../../../src/container/GraphView/useStylesLoadedWarning.ts"],"names":[],"mappings":"AAKA,wBAAgB,sBAAsB,SAiBrC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/container/NodeRenderer/index.d.ts b/node_modules/@xyflow/react/dist/umd/container/NodeRenderer/index.d.ts new file mode 100644 index 0000000..3686e1e --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/container/NodeRenderer/index.d.ts @@ -0,0 +1,10 @@ +import { GraphViewProps } from '../GraphView'; +import type { Node } from '../../types'; +export type NodeRendererProps = Pick, 'onNodeClick' | 'onNodeDoubleClick' | 'onNodeMouseEnter' | 'onNodeMouseMove' | 'onNodeMouseLeave' | 'onNodeContextMenu' | 'onlyRenderVisibleElements' | 'noPanClassName' | 'noDragClassName' | 'rfId' | 'disableKeyboardA11y' | 'nodeExtent' | 'nodeTypes' | 'nodeClickDistance'>; +declare function NodeRendererComponent(props: NodeRendererProps): import("react/jsx-runtime").JSX.Element; +declare namespace NodeRendererComponent { + var displayName: string; +} +export declare const NodeRenderer: typeof NodeRendererComponent; +export {}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/container/NodeRenderer/index.d.ts.map b/node_modules/@xyflow/react/dist/umd/container/NodeRenderer/index.d.ts.map new file mode 100644 index 0000000..4f5f0e3 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/container/NodeRenderer/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/container/NodeRenderer/index.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAG9C,OAAO,KAAK,EAAE,IAAI,EAAkB,MAAM,aAAa,CAAC;AAExD,MAAM,MAAM,iBAAiB,CAAC,QAAQ,SAAS,IAAI,IAAI,IAAI,CACzD,cAAc,CAAC,QAAQ,CAAC,EACtB,aAAa,GACb,mBAAmB,GACnB,kBAAkB,GAClB,iBAAiB,GACjB,kBAAkB,GAClB,mBAAmB,GACnB,2BAA2B,GAC3B,gBAAgB,GAChB,iBAAiB,GACjB,MAAM,GACN,qBAAqB,GACrB,YAAY,GACZ,WAAW,GACX,mBAAmB,CACtB,CAAC;AAUF,iBAAS,qBAAqB,CAAC,QAAQ,SAAS,IAAI,EAAE,KAAK,EAAE,iBAAiB,CAAC,QAAQ,CAAC,2CA6DvF;kBA7DQ,qBAAqB;;;AAiE9B,eAAO,MAAM,YAAY,EAAkC,OAAO,qBAAqB,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/container/NodeRenderer/useResizeObserver.d.ts b/node_modules/@xyflow/react/dist/umd/container/NodeRenderer/useResizeObserver.d.ts new file mode 100644 index 0000000..cfb3b54 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/container/NodeRenderer/useResizeObserver.d.ts @@ -0,0 +1,2 @@ +export declare function useResizeObserver(): ResizeObserver | null; +//# sourceMappingURL=useResizeObserver.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/container/NodeRenderer/useResizeObserver.d.ts.map b/node_modules/@xyflow/react/dist/umd/container/NodeRenderer/useResizeObserver.d.ts.map new file mode 100644 index 0000000..7fbcf4e --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/container/NodeRenderer/useResizeObserver.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useResizeObserver.d.ts","sourceRoot":"","sources":["../../../src/container/NodeRenderer/useResizeObserver.ts"],"names":[],"mappings":"AAQA,wBAAgB,iBAAiB,0BA6BhC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/container/Pane/index.d.ts b/node_modules/@xyflow/react/dist/umd/container/Pane/index.d.ts new file mode 100644 index 0000000..1b42e6f --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/container/Pane/index.d.ts @@ -0,0 +1,13 @@ +/** + * The user selection rectangle gets displayed when a user drags the mouse while pressing shift + */ +import { type ReactNode } from 'react'; +import type { ReactFlowProps } from '../../types'; +type PaneProps = { + isSelecting: boolean; + selectionKeyPressed: boolean; + children: ReactNode; +} & Partial>; +export declare function Pane({ isSelecting, selectionKeyPressed, selectionMode, panOnDrag, selectionOnDrag, onSelectionStart, onSelectionEnd, onPaneClick, onPaneContextMenu, onPaneScroll, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, children, }: PaneProps): import("react/jsx-runtime").JSX.Element; +export {}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/container/Pane/index.d.ts.map b/node_modules/@xyflow/react/dist/umd/container/Pane/index.d.ts.map new file mode 100644 index 0000000..cc5a9c6 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/container/Pane/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/container/Pane/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAIL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAgBf,OAAO,KAAK,EAAE,cAAc,EAAkB,MAAM,aAAa,CAAC;AAElE,KAAK,SAAS,GAAG;IACf,WAAW,EAAE,OAAO,CAAC;IACrB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,OAAO,CACT,IAAI,CACF,cAAc,EACZ,eAAe,GACf,WAAW,GACX,kBAAkB,GAClB,gBAAgB,GAChB,aAAa,GACb,mBAAmB,GACnB,cAAc,GACd,kBAAkB,GAClB,iBAAiB,GACjB,kBAAkB,GAClB,iBAAiB,CACpB,CACF,CAAC;AAqBF,wBAAgB,IAAI,CAAC,EACnB,WAAW,EACX,mBAAmB,EACnB,aAAkC,EAClC,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,QAAQ,GACT,EAAE,SAAS,2CAyMX"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/container/ReactFlow/Wrapper.d.ts b/node_modules/@xyflow/react/dist/umd/container/ReactFlow/Wrapper.d.ts new file mode 100644 index 0000000..f00aeeb --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/container/ReactFlow/Wrapper.d.ts @@ -0,0 +1,19 @@ +import { type ReactNode } from 'react'; +import type { Node, Edge, FitViewOptions } from '../../types'; +import { CoordinateExtent, NodeOrigin } from '@xyflow/system'; +export declare function Wrapper({ children, nodes, edges, defaultNodes, defaultEdges, width, height, fitView, fitViewOptions, minZoom, maxZoom, nodeOrigin, nodeExtent, }: { + children: ReactNode; + nodes?: Node[]; + edges?: Edge[]; + defaultNodes?: Node[]; + defaultEdges?: Edge[]; + width?: number; + height?: number; + fitView?: boolean; + fitViewOptions?: FitViewOptions; + minZoom?: number; + maxZoom?: number; + nodeOrigin?: NodeOrigin; + nodeExtent?: CoordinateExtent; +}): import("react/jsx-runtime").JSX.Element; +//# sourceMappingURL=Wrapper.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/container/ReactFlow/Wrapper.d.ts.map b/node_modules/@xyflow/react/dist/umd/container/ReactFlow/Wrapper.d.ts.map new file mode 100644 index 0000000..cfae5bc --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/container/ReactFlow/Wrapper.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Wrapper.d.ts","sourceRoot":"","sources":["../../../src/container/ReactFlow/Wrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAInD,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE9D,wBAAgB,OAAO,CAAC,EACtB,QAAQ,EACR,KAAK,EACL,KAAK,EACL,YAAY,EACZ,YAAY,EACZ,KAAK,EACL,MAAM,EACN,OAAO,EACP,cAAc,EACd,OAAO,EACP,OAAO,EACP,UAAU,EACV,UAAU,GACX,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;IACtB,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,UAAU,CAAC,EAAE,gBAAgB,CAAC;CAC/B,2CA6BA"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/container/ReactFlow/index.d.ts b/node_modules/@xyflow/react/dist/umd/container/ReactFlow/index.d.ts new file mode 100644 index 0000000..3c796a9 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/container/ReactFlow/index.d.ts @@ -0,0 +1,24 @@ +import type { Edge, Node, ReactFlowProps } from '../../types'; +/** + * The `` component is the heart of your React Flow application. + * It renders your nodes and edges and handles user interaction + * + * @public + * + * @example + * ```tsx + *import { ReactFlow } from '@xyflow/react' + * + *export default function Flow() { + * return (); + *} + *``` + */ +declare const _default: (props: ReactFlowProps & import("react").RefAttributes) => import("react").JSX.Element; +export default _default; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/container/ReactFlow/index.d.ts.map b/node_modules/@xyflow/react/dist/umd/container/ReactFlow/index.d.ts.map new file mode 100644 index 0000000..e45fb7c --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/container/ReactFlow/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/container/ReactFlow/index.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAuT9D;;;;;;;;;;;;;;;;;;;GAmBG;yBA9TgB,QAAQ,SAAS,IAAI,SAAS,QAAQ,SAAS,IAAI;AA+TtE,wBAA0C"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/container/ReactFlow/init-values.d.ts b/node_modules/@xyflow/react/dist/umd/container/ReactFlow/init-values.d.ts new file mode 100644 index 0000000..683999a --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/container/ReactFlow/init-values.d.ts @@ -0,0 +1,4 @@ +import { type NodeOrigin, Viewport } from '@xyflow/system'; +export declare const defaultNodeOrigin: NodeOrigin; +export declare const defaultViewport: Viewport; +//# sourceMappingURL=init-values.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/container/ReactFlow/init-values.d.ts.map b/node_modules/@xyflow/react/dist/umd/container/ReactFlow/init-values.d.ts.map new file mode 100644 index 0000000..4f68c0a --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/container/ReactFlow/init-values.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"init-values.d.ts","sourceRoot":"","sources":["../../../src/container/ReactFlow/init-values.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE3D,eAAO,MAAM,iBAAiB,EAAE,UAAmB,CAAC;AACpD,eAAO,MAAM,eAAe,EAAE,QAAkC,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/container/Viewport/index.d.ts b/node_modules/@xyflow/react/dist/umd/container/Viewport/index.d.ts new file mode 100644 index 0000000..e0d0cec --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/container/Viewport/index.d.ts @@ -0,0 +1,7 @@ +import type { ReactNode } from 'react'; +type ViewportProps = { + children: ReactNode; +}; +export declare function Viewport({ children }: ViewportProps): import("react/jsx-runtime").JSX.Element; +export {}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/container/Viewport/index.d.ts.map b/node_modules/@xyflow/react/dist/umd/container/Viewport/index.d.ts.map new file mode 100644 index 0000000..79d6f12 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/container/Viewport/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/container/Viewport/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOvC,KAAK,aAAa,GAAG;IACnB,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,EAAE,aAAa,2CAQnD"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/container/ZoomPane/index.d.ts b/node_modules/@xyflow/react/dist/umd/container/ZoomPane/index.d.ts new file mode 100644 index 0000000..ca8edb4 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/container/ZoomPane/index.d.ts @@ -0,0 +1,7 @@ +import type { FlowRendererProps } from '../FlowRenderer'; +type ZoomPaneProps = Omit & { + isControlledViewport: boolean; +}; +export declare function ZoomPane({ onPaneContextMenu, zoomOnScroll, zoomOnPinch, panOnScroll, panOnScrollSpeed, panOnScrollMode, zoomOnDoubleClick, panOnDrag, defaultViewport, translateExtent, minZoom, maxZoom, zoomActivationKeyCode, preventScrolling, children, noWheelClassName, noPanClassName, onViewportChange, isControlledViewport, paneClickDistance, }: ZoomPaneProps): import("react/jsx-runtime").JSX.Element; +export {}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/container/ZoomPane/index.d.ts.map b/node_modules/@xyflow/react/dist/umd/container/ZoomPane/index.d.ts.map new file mode 100644 index 0000000..6674f9b --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/container/ZoomPane/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/container/ZoomPane/index.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGzD,KAAK,aAAa,GAAG,IAAI,CACvB,iBAAiB,EACf,eAAe,GACf,kBAAkB,GAClB,uBAAuB,GACvB,iBAAiB,GACjB,qBAAqB,GACrB,iBAAiB,CACpB,GAAG;IACF,oBAAoB,EAAE,OAAO,CAAC;CAC/B,CAAC;AAOF,wBAAgB,QAAQ,CAAC,EACvB,iBAAiB,EACjB,YAAmB,EACnB,WAAkB,EAClB,WAAmB,EACnB,gBAAsB,EACtB,eAAsC,EACtC,iBAAwB,EACxB,SAAgB,EAChB,eAAe,EACf,eAAe,EACf,OAAO,EACP,OAAO,EACP,qBAAqB,EACrB,gBAAuB,EACvB,QAAQ,EACR,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,GAClB,EAAE,aAAa,2CAsGf"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/contexts/NodeIdContext.d.ts b/node_modules/@xyflow/react/dist/umd/contexts/NodeIdContext.d.ts new file mode 100644 index 0000000..516f33a --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/contexts/NodeIdContext.d.ts @@ -0,0 +1,34 @@ +export declare const NodeIdContext: import("react").Context; +export declare const Provider: import("react").Provider; +export declare const Consumer: import("react").Consumer; +/** + * You can use this hook to get the id of the node it is used inside. It is useful + * if you need the node's id deeper in the render tree but don't want to manually + * drill down the id as a prop. + * + * @public + * @returns The id for a node in the flow. + * + * @example + *```jsx + *import { useNodeId } from '@xyflow/react'; + * + *export default function CustomNode() { + * return ( + *
+ * This node has an id of + * + *
+ * ); + *} + * + *function NodeIdDisplay() { + * const nodeId = useNodeId(); + * + * return {nodeId}; + *} + *``` + */ +export declare const useNodeId: () => string | null; +export default NodeIdContext; +//# sourceMappingURL=NodeIdContext.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/contexts/NodeIdContext.d.ts.map b/node_modules/@xyflow/react/dist/umd/contexts/NodeIdContext.d.ts.map new file mode 100644 index 0000000..5118ac8 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/contexts/NodeIdContext.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"NodeIdContext.d.ts","sourceRoot":"","sources":["../../src/contexts/NodeIdContext.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,wCAAqC,CAAC;AAChE,eAAO,MAAM,QAAQ,yCAAyB,CAAC;AAC/C,eAAO,MAAM,QAAQ,yCAAyB,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,SAAS,QAAO,MAAM,GAAG,IAGrC,CAAC;AAEF,eAAe,aAAa,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/contexts/StoreContext.d.ts b/node_modules/@xyflow/react/dist/umd/contexts/StoreContext.d.ts new file mode 100644 index 0000000..f83f503 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/contexts/StoreContext.d.ts @@ -0,0 +1,4 @@ +declare const StoreContext: import("react").Context> | null>; +export declare const Provider: import("react").Provider> | null>; +export default StoreContext; +//# sourceMappingURL=StoreContext.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/contexts/StoreContext.d.ts.map b/node_modules/@xyflow/react/dist/umd/contexts/StoreContext.d.ts.map new file mode 100644 index 0000000..8ad90d4 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/contexts/StoreContext.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"StoreContext.d.ts","sourceRoot":"","sources":["../../src/contexts/StoreContext.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,YAAY,oJAA6D,CAAC;AAEhF,eAAO,MAAM,QAAQ,qJAAwB,CAAC;AAC9C,eAAe,YAAY,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useColorModeClass.d.ts b/node_modules/@xyflow/react/dist/umd/hooks/useColorModeClass.d.ts new file mode 100644 index 0000000..7053d2c --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useColorModeClass.d.ts @@ -0,0 +1,9 @@ +import type { ColorMode, ColorModeClass } from '@xyflow/system'; +/** + * Hook for receiving the current color mode class 'dark' or 'light'. + * + * @internal + * @param colorMode - The color mode to use ('dark', 'light' or 'system') + */ +export declare function useColorModeClass(colorMode: ColorMode): ColorModeClass; +//# sourceMappingURL=useColorModeClass.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useColorModeClass.d.ts.map b/node_modules/@xyflow/react/dist/umd/hooks/useColorModeClass.d.ts.map new file mode 100644 index 0000000..630898f --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useColorModeClass.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useColorModeClass.d.ts","sourceRoot":"","sources":["../../src/hooks/useColorModeClass.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAUhE;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,GAAG,cAAc,CAuBtE"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useConnection.d.ts b/node_modules/@xyflow/react/dist/umd/hooks/useConnection.d.ts new file mode 100644 index 0000000..13d3f7c --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useConnection.d.ts @@ -0,0 +1,33 @@ +import { ConnectionState } from '@xyflow/system'; +import type { InternalNode, Node } from '../types'; +/** + * The `useConnection` hook returns the current connection when there is an active + * connection interaction. If no connection interaction is active, it returns null + * for every property. A typical use case for this hook is to colorize handles + * based on a certain condition (e.g. if the connection is valid or not). + * + * @public + * @param connectionSelector - An optional selector function used to extract a slice of the + * `ConnectionState` data. Using a selector can prevent component re-renders where data you don't + * otherwise care about might change. If a selector is not provided, the entire `ConnectionState` + * object is returned unchanged. + * @example + * + * ```tsx + *import { useConnection } from '@xyflow/react'; + * + *function App() { + * const connection = useConnection(); + * + * return ( + *
{connection ? `Someone is trying to make a connection from ${connection.fromNode} to this one.` : 'There are currently no incoming connections!'} + * + *
+ * ); + * } + * ``` + * + * @returns ConnectionState + */ +export declare function useConnection>>(connectionSelector?: (connection: ConnectionState>) => SelectorReturn): SelectorReturn; +//# sourceMappingURL=useConnection.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useConnection.d.ts.map b/node_modules/@xyflow/react/dist/umd/hooks/useConnection.d.ts.map new file mode 100644 index 0000000..4e00752 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useConnection.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useConnection.d.ts","sourceRoot":"","sources":["../../src/hooks/useConnection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAwB,MAAM,gBAAgB,CAAC;AAGvE,OAAO,KAAK,EAAE,YAAY,EAAE,IAAI,EAAkB,MAAM,UAAU,CAAC;AAqBnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,aAAa,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,cAAc,GAAG,eAAe,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,EAClH,kBAAkB,CAAC,EAAE,CAAC,UAAU,EAAE,eAAe,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,KAAK,cAAc,GAC3F,cAAc,CAGhB"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useDrag.d.ts b/node_modules/@xyflow/react/dist/umd/hooks/useDrag.d.ts new file mode 100644 index 0000000..dc85f00 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useDrag.d.ts @@ -0,0 +1,18 @@ +import { type RefObject } from 'react'; +type UseDragParams = { + nodeRef: RefObject; + disabled?: boolean; + noDragClassName?: string; + handleSelector?: string; + nodeId?: string; + isSelectable?: boolean; + nodeClickDistance?: number; +}; +/** + * Hook for calling XYDrag helper from @xyflow/system. + * + * @internal + */ +export declare function useDrag({ nodeRef, disabled, noDragClassName, handleSelector, nodeId, isSelectable, nodeClickDistance, }: UseDragParams): boolean; +export {}; +//# sourceMappingURL=useDrag.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useDrag.d.ts.map b/node_modules/@xyflow/react/dist/umd/hooks/useDrag.d.ts.map new file mode 100644 index 0000000..3b42f97 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useDrag.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useDrag.d.ts","sourceRoot":"","sources":["../../src/hooks/useDrag.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAMpE,KAAK,aAAa,GAAG;IACnB,OAAO,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,EACtB,OAAO,EACP,QAAgB,EAChB,eAAe,EACf,cAAc,EACd,MAAM,EACN,YAAY,EACZ,iBAAiB,GAClB,EAAE,aAAa,WA2Cf"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useEdges.d.ts b/node_modules/@xyflow/react/dist/umd/hooks/useEdges.d.ts new file mode 100644 index 0000000..dd8579f --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useEdges.d.ts @@ -0,0 +1,21 @@ +import type { Edge } from '../types'; +/** + * This hook returns an array of the current edges. Components that use this hook + * will re-render **whenever any edge changes**. + * + * @public + * @returns An array of all edges currently in the flow. + * + * @example + * ```tsx + *import { useEdges } from '@xyflow/react'; + * + *export default function () { + * const edges = useEdges(); + * + * return
There are currently {edges.length} edges!
; + *} + *``` + */ +export declare function useEdges(): EdgeType[]; +//# sourceMappingURL=useEdges.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useEdges.d.ts.map b/node_modules/@xyflow/react/dist/umd/hooks/useEdges.d.ts.map new file mode 100644 index 0000000..914f004 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useEdges.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useEdges.d.ts","sourceRoot":"","sources":["../../src/hooks/useEdges.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAkB,MAAM,UAAU,CAAC;AAIrD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,EAAE,CAInE"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useGlobalKeyHandler.d.ts b/node_modules/@xyflow/react/dist/umd/hooks/useGlobalKeyHandler.d.ts new file mode 100644 index 0000000..619d3e3 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useGlobalKeyHandler.d.ts @@ -0,0 +1,11 @@ +import type { KeyCode } from '@xyflow/system'; +/** + * Hook for handling global key events. + * + * @internal + */ +export declare function useGlobalKeyHandler({ deleteKeyCode, multiSelectionKeyCode, }: { + deleteKeyCode: KeyCode | null; + multiSelectionKeyCode: KeyCode | null; +}): void; +//# sourceMappingURL=useGlobalKeyHandler.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useGlobalKeyHandler.d.ts.map b/node_modules/@xyflow/react/dist/umd/hooks/useGlobalKeyHandler.d.ts.map new file mode 100644 index 0000000..573f15b --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useGlobalKeyHandler.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useGlobalKeyHandler.d.ts","sourceRoot":"","sources":["../../src/hooks/useGlobalKeyHandler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAW9C;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,aAAa,EACb,qBAAqB,GACtB,EAAE;IACD,aAAa,EAAE,OAAO,GAAG,IAAI,CAAC;IAC9B,qBAAqB,EAAE,OAAO,GAAG,IAAI,CAAC;CACvC,GAAG,IAAI,CAkBP"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useHandleConnections.d.ts b/node_modules/@xyflow/react/dist/umd/hooks/useHandleConnections.d.ts new file mode 100644 index 0000000..33231ca --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useHandleConnections.d.ts @@ -0,0 +1,23 @@ +import { Connection, HandleConnection, HandleType } from '@xyflow/system'; +type UseHandleConnectionsParams = { + /** What type of handle connections do you want to observe? */ + type: HandleType; + /** The handle id (this is only needed if the node has multiple handles of the same type). */ + id?: string | null; + /** If node id is not provided, the node id from the `NodeIdContext` is used. */ + nodeId?: string; + /** Gets called when a connection is established. */ + onConnect?: (connections: Connection[]) => void; + /** Gets called when a connection is removed. */ + onDisconnect?: (connections: Connection[]) => void; +}; +/** + * Hook to check if a is connected to another and get the connections. + * + * @public + * @deprecated Use `useNodeConnections` instead. + * @returns An array with handle connections. + */ +export declare function useHandleConnections({ type, id, nodeId, onConnect, onDisconnect, }: UseHandleConnectionsParams): HandleConnection[]; +export {}; +//# sourceMappingURL=useHandleConnections.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useHandleConnections.d.ts.map b/node_modules/@xyflow/react/dist/umd/hooks/useHandleConnections.d.ts.map new file mode 100644 index 0000000..43d849a --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useHandleConnections.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useHandleConnections.d.ts","sourceRoot":"","sources":["../../src/hooks/useHandleConnections.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,UAAU,EAGX,MAAM,gBAAgB,CAAC;AAKxB,KAAK,0BAA0B,GAAG;IAChC,8DAA8D;IAC9D,IAAI,EAAE,UAAU,CAAC;IACjB,6FAA6F;IAC7F,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,gFAAgF;IAChF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oDAAoD;IACpD,SAAS,CAAC,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;IAChD,gDAAgD;IAChD,YAAY,CAAC,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;CACpD,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,IAAI,EACJ,EAAE,EACF,MAAM,EACN,SAAS,EACT,YAAY,GACb,EAAE,0BAA0B,GAAG,gBAAgB,EAAE,CA2BjD"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useInternalNode.d.ts b/node_modules/@xyflow/react/dist/umd/hooks/useInternalNode.d.ts new file mode 100644 index 0000000..f661522 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useInternalNode.d.ts @@ -0,0 +1,30 @@ +import type { InternalNode, Node } from '../types'; +/** + * This hook returns the internal representation of a specific node. + * Components that use this hook will re-render **whenever the node changes**, + * including when a node is selected or moved. + * + * @public + * @param id - The ID of a node you want to observe. + * @returns The `InternalNode` object for the node with the given ID. + * + * @example + * ```tsx + *import { useInternalNode } from '@xyflow/react'; + * + *export default function () { + * const internalNode = useInternalNode('node-1'); + * const absolutePosition = internalNode.internals.positionAbsolute; + * + * return ( + *
+ * The absolute position of the node is at: + *

x: {absolutePosition.x}

+ *

y: {absolutePosition.y}

+ *
+ * ); + *} + *``` + */ +export declare function useInternalNode(id: string): InternalNode | undefined; +//# sourceMappingURL=useInternalNode.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useInternalNode.d.ts.map b/node_modules/@xyflow/react/dist/umd/hooks/useInternalNode.d.ts.map new file mode 100644 index 0000000..4688719 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useInternalNode.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useInternalNode.d.ts","sourceRoot":"","sources":["../../src/hooks/useInternalNode.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,eAAe,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,EAAE,EAAE,MAAM,GAAG,YAAY,CAAC,QAAQ,CAAC,GAAG,SAAS,CAO5G"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useIsomorphicLayoutEffect.d.ts b/node_modules/@xyflow/react/dist/umd/hooks/useIsomorphicLayoutEffect.d.ts new file mode 100644 index 0000000..5c1131b --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useIsomorphicLayoutEffect.d.ts @@ -0,0 +1,3 @@ +import { useEffect } from 'react'; +export declare const useIsomorphicLayoutEffect: typeof useEffect; +//# sourceMappingURL=useIsomorphicLayoutEffect.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useIsomorphicLayoutEffect.d.ts.map b/node_modules/@xyflow/react/dist/umd/hooks/useIsomorphicLayoutEffect.d.ts.map new file mode 100644 index 0000000..073e997 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useIsomorphicLayoutEffect.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useIsomorphicLayoutEffect.d.ts","sourceRoot":"","sources":["../../src/hooks/useIsomorphicLayoutEffect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmB,MAAM,OAAO,CAAC;AAGnD,eAAO,MAAM,yBAAyB,kBAA8D,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useKeyPress.d.ts b/node_modules/@xyflow/react/dist/umd/hooks/useKeyPress.d.ts new file mode 100644 index 0000000..63cd825 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useKeyPress.d.ts @@ -0,0 +1,53 @@ +import { type KeyCode } from '@xyflow/system'; +export type UseKeyPressOptions = { + /** + * Listen to key presses on a specific element. + * @default document + */ + target?: Window | Document | HTMLElement | ShadowRoot | null; + /** + * You can use this flag to prevent triggering the key press hook when an input field is focused. + * @default true + */ + actInsideInputWithModifier?: boolean; + preventDefault?: boolean; +}; +/** + * This hook lets you listen for specific key codes and tells you whether they are + * currently pressed or not. + * + * @public + * @param options - Options + * + * @example + * ```tsx + *import { useKeyPress } from '@xyflow/react'; + * + *export default function () { + * const spacePressed = useKeyPress('Space'); + * const cmdAndSPressed = useKeyPress(['Meta+s', 'Strg+s']); + * + * return ( + *
+ * {spacePressed &&

Space pressed!

} + * {cmdAndSPressed &&

Cmd + S pressed!

} + *
+ * ); + *} + *``` + */ +export declare function useKeyPress( +/** + * The key code (string or array of strings) specifies which key(s) should trigger + * an action. + * + * A **string** can represent: + * - A **single key**, e.g. `'a'` + * - A **key combination**, using `'+'` to separate keys, e.g. `'a+d'` + * + * An **array of strings** represents **multiple possible key inputs**. For example, `['a', 'd+s']` + * means the user can press either the single key `'a'` or the combination of `'d'` and `'s'`. + * @default null + */ +keyCode?: KeyCode | null, options?: UseKeyPressOptions): boolean; +//# sourceMappingURL=useKeyPress.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useKeyPress.d.ts.map b/node_modules/@xyflow/react/dist/umd/hooks/useKeyPress.d.ts.map new file mode 100644 index 0000000..347fb0f --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useKeyPress.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useKeyPress.d.ts","sourceRoot":"","sources":["../../src/hooks/useKeyPress.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAM9D,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,WAAW,GAAG,UAAU,GAAG,IAAI,CAAC;IAC7D;;;OAGG;IACH,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,WAAW;AACzB;;;;;;;;;;;GAWG;AACH,OAAO,GAAE,OAAO,GAAG,IAAW,EAC9B,OAAO,GAAE,kBAA6E,GACrF,OAAO,CAuGT"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useMoveSelectedNodes.d.ts b/node_modules/@xyflow/react/dist/umd/hooks/useMoveSelectedNodes.d.ts new file mode 100644 index 0000000..24389ec --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useMoveSelectedNodes.d.ts @@ -0,0 +1,12 @@ +import { type XYPosition } from '@xyflow/system'; +/** + * Hook for updating node positions by passing a direction and factor + * + * @internal + * @returns function for updating node positions + */ +export declare function useMoveSelectedNodes(): (params: { + direction: XYPosition; + factor: number; +}) => void; +//# sourceMappingURL=useMoveSelectedNodes.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useMoveSelectedNodes.d.ts.map b/node_modules/@xyflow/react/dist/umd/hooks/useMoveSelectedNodes.d.ts.map new file mode 100644 index 0000000..34c5829 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useMoveSelectedNodes.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useMoveSelectedNodes.d.ts","sourceRoot":"","sources":["../../src/hooks/useMoveSelectedNodes.ts"],"names":[],"mappings":"AACA,OAAO,EAAuC,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAQtF;;;;;GAKG;AACH,wBAAgB,oBAAoB,aAGa;IAAE,SAAS,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,UAiDzF"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useNodeConnections.d.ts b/node_modules/@xyflow/react/dist/umd/hooks/useNodeConnections.d.ts new file mode 100644 index 0000000..c36fa0c --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useNodeConnections.d.ts @@ -0,0 +1,38 @@ +import { Connection, NodeConnection, HandleType } from '@xyflow/system'; +type UseNodeConnectionsParams = { + /** ID of the node, filled in automatically if used inside custom node. */ + id?: string; + /** What type of handle connections do you want to observe? */ + handleType?: HandleType; + /** Filter by handle id (this is only needed if the node has multiple handles of the same type). */ + handleId?: string; + /** Gets called when a connection is established. */ + onConnect?: (connections: Connection[]) => void; + /** Gets called when a connection is removed. */ + onDisconnect?: (connections: Connection[]) => void; +}; +/** + * This hook returns an array of connections on a specific node, handle type ('source', 'target') or handle ID. + * + * @public + * @returns An array with connections. + * + * @example + * ```jsx + *import { useNodeConnections } from '@xyflow/react'; + * + *export default function () { + * const connections = useNodeConnections({ + * handleType: 'target', + * handleId: 'my-handle', + * }); + * + * return ( + *
There are currently {connections.length} incoming connections!
+ * ); + *} + *``` + */ +export declare function useNodeConnections({ id, handleType, handleId, onConnect, onDisconnect, }?: UseNodeConnectionsParams): NodeConnection[]; +export {}; +//# sourceMappingURL=useNodeConnections.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useNodeConnections.d.ts.map b/node_modules/@xyflow/react/dist/umd/hooks/useNodeConnections.d.ts.map new file mode 100644 index 0000000..5285c01 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useNodeConnections.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useNodeConnections.d.ts","sourceRoot":"","sources":["../../src/hooks/useNodeConnections.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,cAAc,EACd,UAAU,EAIX,MAAM,gBAAgB,CAAC;AAOxB,KAAK,wBAAwB,GAAG;IAC9B,0EAA0E;IAC1E,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,8DAA8D;IAC9D,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,mGAAmG;IACnG,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,SAAS,CAAC,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;IAChD,gDAAgD;IAChD,YAAY,CAAC,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;CACpD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,EAAE,EACF,UAAU,EACV,QAAQ,EACR,SAAS,EACT,YAAY,GACb,GAAE,wBAA6B,GAAG,cAAc,EAAE,CA8BlD"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useNodes.d.ts b/node_modules/@xyflow/react/dist/umd/hooks/useNodes.d.ts new file mode 100644 index 0000000..e3fc0d9 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useNodes.d.ts @@ -0,0 +1,22 @@ +import type { Node } from '../types'; +/** + * This hook returns an array of the current nodes. Components that use this hook + * will re-render **whenever any node changes**, including when a node is selected + * or moved. + * + * @public + * @returns An array of all nodes currently in the flow. + * + * @example + * ```jsx + *import { useNodes } from '@xyflow/react'; + * + *export default function() { + * const nodes = useNodes(); + * + * return
There are currently {nodes.length} nodes!
; + *} + *``` + */ +export declare function useNodes(): NodeType[]; +//# sourceMappingURL=useNodes.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useNodes.d.ts.map b/node_modules/@xyflow/react/dist/umd/hooks/useNodes.d.ts.map new file mode 100644 index 0000000..c27f37a --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useNodes.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useNodes.d.ts","sourceRoot":"","sources":["../../src/hooks/useNodes.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAkB,MAAM,UAAU,CAAC;AAIrD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,EAAE,CAInE"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useNodesData.d.ts b/node_modules/@xyflow/react/dist/umd/hooks/useNodesData.d.ts new file mode 100644 index 0000000..4430a6e --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useNodesData.d.ts @@ -0,0 +1,26 @@ +import type { Node } from '../types'; +/** + * This hook lets you subscribe to changes of a specific nodes `data` object. + * + * @public + * @returns An object (or array of object) with `id`, `type`, `data` representing each node. + * + * @example + *```jsx + *import { useNodesData } from '@xyflow/react'; + * + *export default function() { + * const nodeData = useNodesData('nodeId-1'); + * const nodesData = useNodesData(['nodeId-1', 'nodeId-2']); + * + * return null; + *} + *``` + */ +export declare function useNodesData( +/** The id of the node to get the data from. */ +nodeId: string): Pick | null; +export declare function useNodesData( +/** The ids of the nodes to get the data from. */ +nodeIds: string[]): Pick[]; +//# sourceMappingURL=useNodesData.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useNodesData.d.ts.map b/node_modules/@xyflow/react/dist/umd/hooks/useNodesData.d.ts.map new file mode 100644 index 0000000..71698db --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useNodesData.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useNodesData.d.ts","sourceRoot":"","sources":["../../src/hooks/useNodesData.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAErC;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI;AACvD,+CAA+C;AAC/C,MAAM,EAAE,MAAM,GACb,IAAI,CAAC,QAAQ,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC,GAAG,IAAI,CAAC;AACjD,wBAAgB,YAAY,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI;AACvD,iDAAiD;AACjD,OAAO,EAAE,MAAM,EAAE,GAChB,IAAI,CAAC,QAAQ,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useNodesEdgesState.d.ts b/node_modules/@xyflow/react/dist/umd/hooks/useNodesEdgesState.d.ts new file mode 100644 index 0000000..8ae95ad --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useNodesEdgesState.d.ts @@ -0,0 +1,105 @@ +import { type Dispatch, type SetStateAction } from 'react'; +import type { Node, Edge, OnNodesChange, OnEdgesChange } from '../types'; +/** + * This hook makes it easy to prototype a controlled flow where you manage the + * state of nodes and edges outside the `ReactFlowInstance`. You can think of it + * like React's `useState` hook with an additional helper callback. + * + * @public + * @returns + * - `nodes`: The current array of nodes. You might pass this directly to the `nodes` prop of your + * `` component, or you may want to manipulate it first to perform some layouting, + * for example. + * - `setNodes`: A function that you can use to update the nodes. You can pass it a new array of + * nodes or a callback that receives the current array of nodes and returns a new array of nodes. + * This is the same as the second element of the tuple returned by React's `useState` hook. + * - `onNodesChange`: A handy callback that can take an array of `NodeChanges` and update the nodes + * state accordingly. You'll typically pass this directly to the `onNodesChange` prop of your + * `` component. + * @example + * + *```tsx + *import { ReactFlow, useNodesState, useEdgesState } from '@xyflow/react'; + * + *const initialNodes = []; + *const initialEdges = []; + * + *export default function () { + * const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes); + * const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges); + * + * return ( + * + * ); + *} + *``` + * + * @remarks This hook was created to make prototyping easier and our documentation + * examples clearer. Although it is OK to use this hook in production, in + * practice you may want to use a more sophisticated state management solution + * like Zustand {@link https://reactflow.dev/docs/guides/state-management/} instead. + * + */ +export declare function useNodesState(initialNodes: NodeType[]): [ + nodes: NodeType[], + setNodes: Dispatch>, + onNodesChange: OnNodesChange +]; +/** + * This hook makes it easy to prototype a controlled flow where you manage the + * state of nodes and edges outside the `ReactFlowInstance`. You can think of it + * like React's `useState` hook with an additional helper callback. + * + * @public + * @returns + * - `edges`: The current array of edges. You might pass this directly to the `edges` prop of your + * `` component, or you may want to manipulate it first to perform some layouting, + * for example. + * + * - `setEdges`: A function that you can use to update the edges. You can pass it a new array of + * edges or a callback that receives the current array of edges and returns a new array of edges. + * This is the same as the second element of the tuple returned by React's `useState` hook. + * + * - `onEdgesChange`: A handy callback that can take an array of `EdgeChanges` and update the edges + * state accordingly. You'll typically pass this directly to the `onEdgesChange` prop of your + * `` component. + * @example + * + *```tsx + *import { ReactFlow, useNodesState, useEdgesState } from '@xyflow/react'; + * + *const initialNodes = []; + *const initialEdges = []; + * + *export default function () { + * const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes); + * const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges); + * + * return ( + * + * ); + *} + *``` + * + * @remarks This hook was created to make prototyping easier and our documentation + * examples clearer. Although it is OK to use this hook in production, in + * practice you may want to use a more sophisticated state management solution + * like Zustand {@link https://reactflow.dev/docs/guides/state-management/} instead. + * + */ +export declare function useEdgesState(initialEdges: EdgeType[]): [ + edges: EdgeType[], + setEdges: Dispatch>, + onEdgesChange: OnEdgesChange +]; +//# sourceMappingURL=useNodesEdgesState.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useNodesEdgesState.d.ts.map b/node_modules/@xyflow/react/dist/umd/hooks/useNodesEdgesState.d.ts.map new file mode 100644 index 0000000..d0d00ce --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useNodesEdgesState.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useNodesEdgesState.d.ts","sourceRoot":"","sources":["../../src/hooks/useNodesEdgesState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAGlF,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,aAAa,CAAC,QAAQ,SAAS,IAAI,EACjD,YAAY,EAAE,QAAQ,EAAE,GACvB;IAED,KAAK,EAAE,QAAQ,EAAE;IACjB,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC9C,aAAa,EAAE,aAAa,CAAC,QAAQ,CAAC;CACvC,CAQA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,aAAa,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EACxD,YAAY,EAAE,QAAQ,EAAE,GACvB;IAED,KAAK,EAAE,QAAQ,EAAE;IACjB,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC9C,aAAa,EAAE,aAAa,CAAC,QAAQ,CAAC;CACvC,CAQA"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useNodesInitialized.d.ts b/node_modules/@xyflow/react/dist/umd/hooks/useNodesInitialized.d.ts new file mode 100644 index 0000000..2cab0f3 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useNodesInitialized.d.ts @@ -0,0 +1,39 @@ +export type UseNodesInitializedOptions = { + /** @default false */ + includeHiddenNodes?: boolean; +}; +/** + * This hook tells you whether all the nodes in a flow have been measured and given + *a width and height. When you add a node to the flow, this hook will return + *`false` and then `true` again once the node has been measured. + * + * @public + * @returns Whether or not the nodes have been initialized by the `` component and + * given a width and height. + * + * @example + * ```jsx + *import { useReactFlow, useNodesInitialized } from '@xyflow/react'; + *import { useEffect, useState } from 'react'; + * + *const options = { + * includeHiddenNodes: false, + *}; + * + *export default function useLayout() { + * const { getNodes } = useReactFlow(); + * const nodesInitialized = useNodesInitialized(options); + * const [layoutedNodes, setLayoutedNodes] = useState(getNodes()); + * + * useEffect(() => { + * if (nodesInitialized) { + * setLayoutedNodes(yourLayoutingFunction(getNodes())); + * } + * }, [nodesInitialized]); + * + * return layoutedNodes; + *} + *``` + */ +export declare function useNodesInitialized(options?: UseNodesInitializedOptions): boolean; +//# sourceMappingURL=useNodesInitialized.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useNodesInitialized.d.ts.map b/node_modules/@xyflow/react/dist/umd/hooks/useNodesInitialized.d.ts.map new file mode 100644 index 0000000..4faa85a --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useNodesInitialized.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useNodesInitialized.d.ts","sourceRoot":"","sources":["../../src/hooks/useNodesInitialized.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,0BAA0B,GAAG;IACvC,qBAAqB;IACrB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAoBF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,GAAE,0BAER,GACA,OAAO,CAIT"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useOnInitHandler.d.ts b/node_modules/@xyflow/react/dist/umd/hooks/useOnInitHandler.d.ts new file mode 100644 index 0000000..95b04fe --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useOnInitHandler.d.ts @@ -0,0 +1,8 @@ +import type { OnInit, Node, Edge } from '../types'; +/** + * Hook for calling onInit handler. + * + * @internal + */ +export declare function useOnInitHandler(onInit: OnInit | undefined): void; +//# sourceMappingURL=useOnInitHandler.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useOnInitHandler.d.ts.map b/node_modules/@xyflow/react/dist/umd/hooks/useOnInitHandler.d.ts.map new file mode 100644 index 0000000..9fa9e56 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useOnInitHandler.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useOnInitHandler.d.ts","sourceRoot":"","sources":["../../src/hooks/useOnInitHandler.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEnD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,EACzF,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,SAAS,QAW/C"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useOnSelectionChange.d.ts b/node_modules/@xyflow/react/dist/umd/hooks/useOnSelectionChange.d.ts new file mode 100644 index 0000000..d28e602 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useOnSelectionChange.d.ts @@ -0,0 +1,43 @@ +import type { OnSelectionChangeFunc, Node, Edge } from '../types'; +export type UseOnSelectionChangeOptions = { + /** The handler to register. */ + onChange: OnSelectionChangeFunc; +}; +/** + * This hook lets you listen for changes to both node and edge selection. As the + *name implies, the callback you provide will be called whenever the selection of + *_either_ nodes or edges changes. + * + * @public + * @example + * ```jsx + *import { useState } from 'react'; + *import { ReactFlow, useOnSelectionChange } from '@xyflow/react'; + * + *function SelectionDisplay() { + * const [selectedNodes, setSelectedNodes] = useState([]); + * const [selectedEdges, setSelectedEdges] = useState([]); + * + * // the passed handler has to be memoized, otherwise the hook will not work correctly + * const onChange = useCallback(({ nodes, edges }) => { + * setSelectedNodes(nodes.map((node) => node.id)); + * setSelectedEdges(edges.map((edge) => edge.id)); + * }, []); + * + * useOnSelectionChange({ + * onChange, + * }); + * + * return ( + *
+ *

Selected nodes: {selectedNodes.join(', ')}

+ *

Selected edges: {selectedEdges.join(', ')}

+ *
+ * ); + *} + *``` + * + * @remarks You need to memoize the passed `onChange` handler, otherwise the hook will not work correctly. + */ +export declare function useOnSelectionChange({ onChange, }: UseOnSelectionChangeOptions): void; +//# sourceMappingURL=useOnSelectionChange.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useOnSelectionChange.d.ts.map b/node_modules/@xyflow/react/dist/umd/hooks/useOnSelectionChange.d.ts.map new file mode 100644 index 0000000..5c7645c --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useOnSelectionChange.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useOnSelectionChange.d.ts","sourceRoot":"","sources":["../../src/hooks/useOnSelectionChange.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAElE,MAAM,MAAM,2BAA2B,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI;IACpG,+BAA+B;IAC/B,QAAQ,EAAE,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;CACrD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,EAC/F,QAAQ,GACT,EAAE,2BAA2B,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAYjD"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useOnViewportChange.d.ts b/node_modules/@xyflow/react/dist/umd/hooks/useOnViewportChange.d.ts new file mode 100644 index 0000000..b0843b0 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useOnViewportChange.d.ts @@ -0,0 +1,33 @@ +import type { OnViewportChange } from '@xyflow/system'; +export type UseOnViewportChangeOptions = { + /** Gets called when the viewport starts changing. */ + onStart?: OnViewportChange; + /** Gets called when the viewport changes. */ + onChange?: OnViewportChange; + /** Gets called when the viewport stops changing. */ + onEnd?: OnViewportChange; +}; +/** + * The `useOnViewportChange` hook lets you listen for changes to the viewport such + * as panning and zooming. You can provide a callback for each phase of a viewport + * change: `onStart`, `onChange`, and `onEnd`. + * + * @public + * @example + * ```jsx + *import { useCallback } from 'react'; + *import { useOnViewportChange } from '@xyflow/react'; + * + *function ViewportChangeLogger() { + * useOnViewportChange({ + * onStart: (viewport: Viewport) => console.log('start', viewport), + * onChange: (viewport: Viewport) => console.log('change', viewport), + * onEnd: (viewport: Viewport) => console.log('end', viewport), + * }); + * + * return null; + *} + *``` + */ +export declare function useOnViewportChange({ onStart, onChange, onEnd }: UseOnViewportChangeOptions): void; +//# sourceMappingURL=useOnViewportChange.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useOnViewportChange.d.ts.map b/node_modules/@xyflow/react/dist/umd/hooks/useOnViewportChange.d.ts.map new file mode 100644 index 0000000..dc42277 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useOnViewportChange.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useOnViewportChange.d.ts","sourceRoot":"","sources":["../../src/hooks/useOnViewportChange.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAIvD,MAAM,MAAM,0BAA0B,GAAG;IACvC,qDAAqD;IACrD,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,oDAAoD;IACpD,KAAK,CAAC,EAAE,gBAAgB,CAAC;CAC1B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,0BAA0B,QAc3F"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useReactFlow.d.ts b/node_modules/@xyflow/react/dist/umd/hooks/useReactFlow.d.ts new file mode 100644 index 0000000..6ed8bc2 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useReactFlow.d.ts @@ -0,0 +1,30 @@ +import type { ReactFlowInstance, Node, Edge } from '../types'; +/** + * This hook returns a ReactFlowInstance that can be used to update nodes and edges, manipulate the viewport, or query the current state of the flow. + * + * @public + * @example + * ```jsx + *import { useCallback, useState } from 'react'; + *import { useReactFlow } from '@xyflow/react'; + * + *export function NodeCounter() { + * const reactFlow = useReactFlow(); + * const [count, setCount] = useState(0); + * const countNodes = useCallback(() => { + * setCount(reactFlow.getNodes().length); + * // you need to pass it as a dependency if you are using it with useEffect or useCallback + * // because at the first render, it's not initialized yet and some functions might not work. + * }, [reactFlow]); + * + * return ( + *
+ * + *

There are {count} nodes in the flow.

+ *
+ * ); + *} + *``` + */ +export declare function useReactFlow(): ReactFlowInstance; +//# sourceMappingURL=useReactFlow.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useReactFlow.d.ts.map b/node_modules/@xyflow/react/dist/umd/hooks/useReactFlow.d.ts.map new file mode 100644 index 0000000..50847a2 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useReactFlow.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useReactFlow.d.ts","sourceRoot":"","sources":["../../src/hooks/useReactFlow.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EACV,iBAAiB,EACjB,IAAI,EACJ,IAAI,EAKL,MAAM,UAAU,CAAC;AAIlB;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,YAAY,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,KAAK,iBAAiB,CAC3G,QAAQ,EACR,QAAQ,CACT,CAiPA"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useResizeHandler.d.ts b/node_modules/@xyflow/react/dist/umd/hooks/useResizeHandler.d.ts new file mode 100644 index 0000000..23199fc --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useResizeHandler.d.ts @@ -0,0 +1,8 @@ +import { type MutableRefObject } from 'react'; +/** + * Hook for handling resize events. + * + * @internal + */ +export declare function useResizeHandler(domNode: MutableRefObject): void; +//# sourceMappingURL=useResizeHandler.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useResizeHandler.d.ts.map b/node_modules/@xyflow/react/dist/umd/hooks/useResizeHandler.d.ts.map new file mode 100644 index 0000000..021d0be --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useResizeHandler.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useResizeHandler.d.ts","sourceRoot":"","sources":["../../src/hooks/useResizeHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAKzD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,CAAC,cAAc,GAAG,IAAI,CAAC,GAAG,IAAI,CAiCvF"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useStore.d.ts b/node_modules/@xyflow/react/dist/umd/hooks/useStore.d.ts new file mode 100644 index 0000000..a4ad5c9 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useStore.d.ts @@ -0,0 +1,45 @@ +import type { Edge, Node, ReactFlowState } from '../types'; +/** + * This hook can be used to subscribe to internal state changes of the React Flow + * component. The `useStore` hook is re-exported from the [Zustand](https://github.com/pmndrs/zustand) + * state management library, so you should check out their docs for more details. + * + * @public + * @param selector - A selector function that returns a slice of the flow's internal state. + * Extracting or transforming just the state you need is a good practice to avoid unnecessary + * re-renders. + * @param equalityFn - A function to compare the previous and next value. This is incredibly useful + * for preventing unnecessary re-renders. Good sensible defaults are using `Object.is` or importing + * `zustand/shallow`, but you can be as granular as you like. + * @returns The selected state slice. + * + * @example + * ```ts + * const nodes = useStore((state) => state.nodes); + * ``` + * + * @remarks This hook should only be used if there is no other way to access the internal + * state. For many of the common use cases, there are dedicated hooks available + * such as {@link useReactFlow}, {@link useViewport}, etc. + */ +declare function useStore(selector: (state: ReactFlowState) => StateSlice, equalityFn?: (a: StateSlice, b: StateSlice) => boolean): StateSlice; +/** + * In some cases, you might need to access the store directly. This hook returns the store object which can be used on demand to access the state or dispatch actions. + * + * @returns The store object. + * @example + * ```ts + * const store = useStoreApi(); + * ``` + * + * @remarks This hook should only be used if there is no other way to access the internal + * state. For many of the common use cases, there are dedicated hooks available + * such as {@link useReactFlow}, {@link useViewport}, etc. + */ +declare function useStoreApi(): { + getState: () => ReactFlowState; + setState: (partial: ReactFlowState | Partial> | ((state: ReactFlowState) => ReactFlowState | Partial>), replace?: boolean | undefined) => void; + subscribe: (listener: (state: ReactFlowState, prevState: ReactFlowState) => void) => () => void; +}; +export { useStore, useStoreApi }; +//# sourceMappingURL=useStore.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useStore.d.ts.map b/node_modules/@xyflow/react/dist/umd/hooks/useStore.d.ts.map new file mode 100644 index 0000000..d3d1213 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useStore.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useStore.d.ts","sourceRoot":"","sources":["../../src/hooks/useStore.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAI3D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,iBAAS,QAAQ,CAAC,UAAU,GAAG,OAAO,EACpC,QAAQ,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,UAAU,EAC/C,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,KAAK,OAAO,cASvD;AAED;;;;;;;;;;;;GAYG;AACH,iBAAS,WAAW,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI;;;;EAiB9E;AAED,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useUpdateNodeInternals.d.ts b/node_modules/@xyflow/react/dist/umd/hooks/useUpdateNodeInternals.d.ts new file mode 100644 index 0000000..fb78ea9 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useUpdateNodeInternals.d.ts @@ -0,0 +1,48 @@ +import type { UpdateNodeInternals } from '@xyflow/system'; +/** + * When you programmatically add or remove handles to a node or update a node's + * handle position, you need to let React Flow know about it using this hook. This + * will update the internal dimensions of the node and properly reposition handles + * on the canvas if necessary. + * + * @public + * @returns Use this function to tell React Flow to update the internal state of one or more nodes + * that you have changed programmatically. + * + * @example + * ```jsx + *import { useCallback, useState } from 'react'; + *import { Handle, useUpdateNodeInternals } from '@xyflow/react'; + * + *export default function RandomHandleNode({ id }) { + * const updateNodeInternals = useUpdateNodeInternals(); + * const [handleCount, setHandleCount] = useState(0); + * const randomizeHandleCount = useCallback(() => { + * setHandleCount(Math.floor(Math.random() * 10)); + * updateNodeInternals(id); + * }, [id, updateNodeInternals]); + * + * return ( + * <> + * {Array.from({ length: handleCount }).map((_, index) => ( + * + * ))} + * + *
+ * + *

There are {handleCount} handles on this node.

+ *
+ * + * ); + *} + *``` + * @remarks This hook can only be used in a component that is a child of a + *{@link ReactFlowProvider} or a {@link ReactFlow} component. + */ +export declare function useUpdateNodeInternals(): UpdateNodeInternals; +//# sourceMappingURL=useUpdateNodeInternals.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useUpdateNodeInternals.d.ts.map b/node_modules/@xyflow/react/dist/umd/hooks/useUpdateNodeInternals.d.ts.map new file mode 100644 index 0000000..4f5a18f --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useUpdateNodeInternals.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useUpdateNodeInternals.d.ts","sourceRoot":"","sources":["../../src/hooks/useUpdateNodeInternals.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAsB,MAAM,gBAAgB,CAAC;AAI9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,sBAAsB,IAAI,mBAAmB,CAkB5D"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useViewport.d.ts b/node_modules/@xyflow/react/dist/umd/hooks/useViewport.d.ts new file mode 100644 index 0000000..428255f --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useViewport.d.ts @@ -0,0 +1,32 @@ +import type { Viewport } from '@xyflow/system'; +/** + * The `useViewport` hook is a convenient way to read the current state of the + * {@link Viewport} in a component. Components that use this hook + * will re-render **whenever the viewport changes**. + * + * @public + * @returns The current viewport. + * + * @example + * + *```jsx + *import { useViewport } from '@xyflow/react'; + * + *export default function ViewportDisplay() { + * const { x, y, zoom } = useViewport(); + * + * return ( + *
+ *

+ * The viewport is currently at ({x}, {y}) and zoomed to {zoom}. + *

+ *
+ * ); + *} + *``` + * + * @remarks This hook can only be used in a component that is a child of a + *{@link ReactFlowProvider} or a {@link ReactFlow} component. + */ +export declare function useViewport(): Viewport; +//# sourceMappingURL=useViewport.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useViewport.d.ts.map b/node_modules/@xyflow/react/dist/umd/hooks/useViewport.d.ts.map new file mode 100644 index 0000000..19e207a --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useViewport.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useViewport.d.ts","sourceRoot":"","sources":["../../src/hooks/useViewport.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAW/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,WAAW,IAAI,QAAQ,CAItC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useViewportHelper.d.ts b/node_modules/@xyflow/react/dist/umd/hooks/useViewportHelper.d.ts new file mode 100644 index 0000000..bab517a --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useViewportHelper.d.ts @@ -0,0 +1,10 @@ +import type { ViewportHelperFunctions } from '../types'; +/** + * Hook for getting viewport helper functions. + * + * @internal + * @returns viewport helper functions + */ +declare const useViewportHelper: () => ViewportHelperFunctions; +export default useViewportHelper; +//# sourceMappingURL=useViewportHelper.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useViewportHelper.d.ts.map b/node_modules/@xyflow/react/dist/umd/hooks/useViewportHelper.d.ts.map new file mode 100644 index 0000000..7c4a669 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useViewportHelper.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useViewportHelper.d.ts","sourceRoot":"","sources":["../../src/hooks/useViewportHelper.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExD;;;;;GAKG;AACH,QAAA,MAAM,iBAAiB,QAAO,uBAsG7B,CAAC;AAEF,eAAe,iBAAiB,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useViewportSync.d.ts b/node_modules/@xyflow/react/dist/umd/hooks/useViewportSync.d.ts new file mode 100644 index 0000000..d810354 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useViewportSync.d.ts @@ -0,0 +1,9 @@ +import type { Viewport } from '@xyflow/system'; +/** + * Hook for syncing the viewport with the panzoom instance. + * + * @internal + * @param viewport + */ +export declare function useViewportSync(viewport?: Viewport): null; +//# sourceMappingURL=useViewportSync.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useViewportSync.d.ts.map b/node_modules/@xyflow/react/dist/umd/hooks/useViewportSync.d.ts.map new file mode 100644 index 0000000..d2e3395 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useViewportSync.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useViewportSync.d.ts","sourceRoot":"","sources":["../../src/hooks/useViewportSync.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAO/C;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,QAAQ,CAAC,EAAE,QAAQ,QAYlD"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useVisibleEdgeIds.d.ts b/node_modules/@xyflow/react/dist/umd/hooks/useVisibleEdgeIds.d.ts new file mode 100644 index 0000000..cab1370 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useVisibleEdgeIds.d.ts @@ -0,0 +1,9 @@ +/** + * Hook for getting the visible edge ids from the store. + * + * @internal + * @param onlyRenderVisible + * @returns array with visible edge ids + */ +export declare function useVisibleEdgeIds(onlyRenderVisible: boolean): string[]; +//# sourceMappingURL=useVisibleEdgeIds.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useVisibleEdgeIds.d.ts.map b/node_modules/@xyflow/react/dist/umd/hooks/useVisibleEdgeIds.d.ts.map new file mode 100644 index 0000000..fcd115a --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useVisibleEdgeIds.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useVisibleEdgeIds.d.ts","sourceRoot":"","sources":["../../src/hooks/useVisibleEdgeIds.ts"],"names":[],"mappings":"AAOA;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,iBAAiB,EAAE,OAAO,GAAG,MAAM,EAAE,CAuCtE"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useVisibleNodeIds.d.ts b/node_modules/@xyflow/react/dist/umd/hooks/useVisibleNodeIds.d.ts new file mode 100644 index 0000000..67bbac1 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useVisibleNodeIds.d.ts @@ -0,0 +1,9 @@ +/** + * Hook for getting the visible node ids from the store. + * + * @internal + * @param onlyRenderVisible + * @returns array with visible node ids + */ +export declare function useVisibleNodeIds(onlyRenderVisible: boolean): string[]; +//# sourceMappingURL=useVisibleNodeIds.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/hooks/useVisibleNodeIds.d.ts.map b/node_modules/@xyflow/react/dist/umd/hooks/useVisibleNodeIds.d.ts.map new file mode 100644 index 0000000..5fe24da --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/hooks/useVisibleNodeIds.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"useVisibleNodeIds.d.ts","sourceRoot":"","sources":["../../src/hooks/useVisibleNodeIds.ts"],"names":[],"mappings":"AAeA;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,iBAAiB,EAAE,OAAO,YAI3D"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/index.d.ts b/node_modules/@xyflow/react/dist/umd/index.d.ts new file mode 100644 index 0000000..0748bfd --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/index.d.ts @@ -0,0 +1,39 @@ +export { default as ReactFlow } from './container/ReactFlow'; +export { Handle, type HandleProps } from './components/Handle'; +export { EdgeText } from './components/Edges/EdgeText'; +export { StraightEdge } from './components/Edges/StraightEdge'; +export { StepEdge } from './components/Edges/StepEdge'; +export { BezierEdge } from './components/Edges/BezierEdge'; +export { SimpleBezierEdge, getSimpleBezierPath } from './components/Edges/SimpleBezierEdge'; +export { SmoothStepEdge } from './components/Edges/SmoothStepEdge'; +export { BaseEdge } from './components/Edges/BaseEdge'; +export { ReactFlowProvider } from './components/ReactFlowProvider'; +export { Panel, type PanelProps } from './components/Panel'; +export { EdgeLabelRenderer, type EdgeLabelRendererProps } from './components/EdgeLabelRenderer'; +export { ViewportPortal } from './components/ViewportPortal'; +export { useReactFlow } from './hooks/useReactFlow'; +export { useUpdateNodeInternals } from './hooks/useUpdateNodeInternals'; +export { useNodes } from './hooks/useNodes'; +export { useEdges } from './hooks/useEdges'; +export { useViewport } from './hooks/useViewport'; +export { useKeyPress } from './hooks/useKeyPress'; +export { useNodesState, useEdgesState } from './hooks/useNodesEdgesState'; +export { useStore, useStoreApi } from './hooks/useStore'; +export { useOnViewportChange, type UseOnViewportChangeOptions } from './hooks/useOnViewportChange'; +export { useOnSelectionChange, type UseOnSelectionChangeOptions } from './hooks/useOnSelectionChange'; +export { useNodesInitialized, type UseNodesInitializedOptions } from './hooks/useNodesInitialized'; +export { useHandleConnections } from './hooks/useHandleConnections'; +export { useNodeConnections } from './hooks/useNodeConnections'; +export { useNodesData } from './hooks/useNodesData'; +export { useConnection } from './hooks/useConnection'; +export { useInternalNode } from './hooks/useInternalNode'; +export { useNodeId } from './contexts/NodeIdContext'; +export { applyNodeChanges, applyEdgeChanges } from './utils/changes'; +export { isNode, isEdge } from './utils/general'; +export * from './additional-components'; +export * from './types'; +export { type Align, type SmoothStepPathOptions, type BezierPathOptions, ConnectionLineType, type EdgeMarker, type EdgeMarkerType, MarkerType, type OnMove, type OnMoveStart, type OnMoveEnd, type Connection, ConnectionMode, type OnConnectStartParams, type OnConnectStart, type OnConnect, type OnConnectEnd, type Viewport, type SnapGrid, PanOnScrollMode, type ViewportHelperFunctionOptions, type SetCenterOptions, type FitBoundsOptions, type PanelPosition, type ProOptions, SelectionMode, type SelectionRect, type OnError, type NodeOrigin, type OnSelectionDrag, Position, type XYPosition, type XYZPosition, type Dimensions, type Rect, type Box, type Transform, type CoordinateExtent, type ColorMode, type ColorModeClass, type HandleType, type ShouldResize, type OnResizeStart, type OnResize, type OnResizeEnd, type ControlPosition, type ControlLinePosition, ResizeControlVariant, type ResizeParams, type ResizeParamsWithDirection, type ResizeDragEvent, type NodeChange, type NodeDimensionChange, type NodePositionChange, type NodeSelectionChange, type NodeRemoveChange, type NodeAddChange, type NodeReplaceChange, type EdgeChange, type EdgeSelectionChange, type EdgeRemoveChange, type EdgeAddChange, type EdgeReplaceChange, type KeyCode, type ConnectionState, type FinalConnectionState, type ConnectionInProgress, type NoConnection, type NodeConnection, type OnReconnect, type AriaLabelConfig, } from '@xyflow/system'; +import { type Handle as HandleBound } from '@xyflow/system'; +export type Handle = HandleBound; +export { type GetBezierPathParams, getBezierEdgeCenter, getBezierPath, getEdgeCenter, type GetSmoothStepPathParams, getSmoothStepPath, type GetStraightPathParams, getStraightPath, getViewportForBounds, getNodesBounds, getIncomers, getOutgoers, addEdge, reconnectEdge, getConnectedEdges, } from '@xyflow/system'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/index.d.ts.map b/node_modules/@xyflow/react/dist/umd/index.d.ts.map new file mode 100644 index 0000000..4ddf055 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC5F,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAChG,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,KAAK,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACnG,OAAO,EAAE,oBAAoB,EAAE,KAAK,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AACtG,OAAO,EAAE,mBAAmB,EAAE,KAAK,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACnG,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEjD,cAAc,yBAAyB,CAAC;AAExC,cAAc,SAAS,CAAC;AAGxB,OAAO,EACL,KAAK,KAAK,EACV,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,kBAAkB,EAClB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,UAAU,EACV,KAAK,MAAM,EACX,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,UAAU,EACf,cAAc,EACd,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,eAAe,EACf,KAAK,6BAA6B,EAClC,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,aAAa,EACb,KAAK,aAAa,EAClB,KAAK,OAAO,EACZ,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,QAAQ,EACR,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,IAAI,EACT,KAAK,GAAG,EACR,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,oBAAoB,EACpB,KAAK,YAAY,EACjB,KAAK,yBAAyB,EAC9B,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,OAAO,EACZ,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,eAAe,GACrB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,KAAK,MAAM,IAAI,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC5D,MAAM,MAAM,MAAM,GAAG,WAAW,CAAC;AAGjC,OAAO,EACL,KAAK,mBAAmB,EACxB,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,KAAK,uBAAuB,EAC5B,iBAAiB,EACjB,KAAK,qBAAqB,EAC1B,eAAe,EACf,oBAAoB,EACpB,cAAc,EACd,WAAW,EACX,WAAW,EACX,OAAO,EACP,aAAa,EACb,iBAAiB,GAClB,MAAM,gBAAgB,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/index.js b/node_modules/@xyflow/react/dist/umd/index.js new file mode 100644 index 0000000..e2b8471 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/index.js @@ -0,0 +1,10 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactFlow={},e.jsxRuntime,e.React,e.ReactDOM)}(this,(function(e,t,n,o){"use strict";function r(e){if("string"==typeof e||"number"==typeof e)return""+e;let t="";if(Array.isArray(e))for(let n,o=0;o{}};function a(){for(var e,t=0,n=arguments.length,o={};t=0&&(t=e.slice(n+1),e=e.slice(0,n)),e&&!o.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}}))),a=-1,s=i.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++a0)for(var n,o,r=new Array(n),i=0;i=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),d.hasOwnProperty(t)?{space:d[t],local:e}:e}function f(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===u&&t.documentElement.namespaceURI===u?t.createElement(e):t.createElementNS(n,e)}}function g(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function p(e){var t=h(e);return(t.local?g:f)(t)}function m(){}function y(e){return null==e?m:function(){return this.querySelector(e)}}function v(){return[]}function x(e){return null==e?v:function(){return this.querySelectorAll(e)}}function w(e){return function(){return null==(t=e.apply(this,arguments))?[]:Array.isArray(t)?t:Array.from(t);var t}}function b(e){return function(){return this.matches(e)}}function S(e){return function(t){return t.matches(e)}}var C=Array.prototype.find;function E(){return this.firstElementChild}var k=Array.prototype.filter;function M(){return Array.from(this.children)}function N(e){return new Array(e.length)}function _(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function P(e,t,n,o,r,i){for(var a,s=0,l=t.length,c=i.length;st?1:e>=t?0:NaN}function R(e){return function(){this.removeAttribute(e)}}function D(e){return function(){this.removeAttributeNS(e.space,e.local)}}function L(e,t){return function(){this.setAttribute(e,t)}}function $(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function V(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function B(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function T(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function j(e){return function(){this.style.removeProperty(e)}}function H(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Z(e,t,n){return function(){var o=t.apply(this,arguments);null==o?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function X(e,t){return e.style.getPropertyValue(t)||T(e).getComputedStyle(e,null).getPropertyValue(t)}function Y(e){return function(){delete this[e]}}function F(e,t){return function(){this[e]=t}}function W(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function K(e){return e.trim().split(/^|\s+/)}function G(e){return e.classList||new q(e)}function q(e){this._node=e,this._names=K(e.getAttribute("class")||"")}function U(e,t){for(var n=G(e),o=-1,r=t.length;++o=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var xe=[null];function we(e,t){this._groups=e,this._parents=t}function be(){return new we([[document.documentElement]],xe)}function Se(e){return"string"==typeof e?new we([[document.querySelector(e)]],[document.documentElement]):new we([[e]],xe)}function Ce(e,t){if(e=function(e){let t;for(;t=e.sourceEvent;)e=t;return e}(e),void 0===t&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,[(o=o.matrixTransform(t.getScreenCTM().inverse())).x,o.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}we.prototype=be.prototype={constructor:we,select:function(e){"function"!=typeof e&&(e=y(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r=b&&(b=w+1);!(x=y[b])&&++b=0;)(o=r[i])&&(a&&4^o.compareDocumentPosition(a)&&a.parentNode.insertBefore(o,a),a=o);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=I);for(var n=this._groups,o=n.length,r=new Array(o),i=0;i1?this.each((null==t?j:"function"==typeof t?Z:H)(e,t,null==n?"":n)):X(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?Y:"function"==typeof t?W:F)(e,t)):this.node()[e]},classed:function(e,t){var n=K(e+"");if(arguments.length<2){for(var o=G(this.node()),r=-1,i=n.length;++r=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}}))}(e+""),a=i.length;if(!(arguments.length<2)){for(s=t?pe:ge,o=0;o()=>e;function Oe(e,{sourceEvent:t,subject:n,target:o,identifier:r,active:i,x:a,y:s,dx:l,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}function Ae(e){return!e.ctrlKey&&!e.button}function Ie(){return this.parentNode}function Re(e,t){return null==t?{x:e.x,y:e.y}:t}function De(){return navigator.maxTouchPoints||"ontouchstart"in this}function Le(){var e,t,n,o,r=Ae,i=Ie,s=Re,l=De,c={},u=a("start","drag","end"),d=0,h=0;function f(e){e.on("mousedown.drag",g).filter(l).on("touchstart.drag",y).on("touchmove.drag",v,Ee).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(a,s){if(!o&&r.call(this,a,s)){var l=w(this,i.call(this,a,s),a,s,"mouse");l&&(Se(a.view).on("mousemove.drag",p,ke).on("mouseup.drag",m,ke),_e(a.view),Me(a),n=!1,e=a.clientX,t=a.clientY,l("start",a))}}function p(o){if(Ne(o),!n){var r=o.clientX-e,i=o.clientY-t;n=r*r+i*i>h}c.mouse("drag",o)}function m(e){Se(e.view).on("mousemove.drag mouseup.drag",null),Pe(e.view,n),Ne(e),c.mouse("end",e)}function y(e,t){if(r.call(this,e,t)){var n,o,a=e.changedTouches,s=i.call(this,e,t),l=a.length;for(n=0;n>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?ot(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?ot(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Fe.exec(e))?new it(t[1],t[2],t[3],1):(t=We.exec(e))?new it(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Ke.exec(e))?ot(t[1],t[2],t[3],t[4]):(t=Ge.exec(e))?ot(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=qe.exec(e))?dt(t[1],t[2]/100,t[3]/100,1):(t=Ue.exec(e))?dt(t[1],t[2]/100,t[3]/100,t[4]):Qe.hasOwnProperty(e)?nt(Qe[e]):"transparent"===e?new it(NaN,NaN,NaN,0):null}function nt(e){return new it(e>>16&255,e>>8&255,255&e,1)}function ot(e,t,n,o){return o<=0&&(e=t=n=NaN),new it(e,t,n,o)}function rt(e,t,n,o){return 1===arguments.length?((r=e)instanceof Be||(r=tt(r)),r?new it((r=r.rgb()).r,r.g,r.b,r.opacity):new it):new it(e,t,n,null==o?1:o);var r}function it(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}function at(){return`#${ut(this.r)}${ut(this.g)}${ut(this.b)}`}function st(){const e=lt(this.opacity);return`${1===e?"rgb(":"rgba("}${ct(this.r)}, ${ct(this.g)}, ${ct(this.b)}${1===e?")":`, ${e})`}`}function lt(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ct(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ut(e){return((e=ct(e))<16?"0":"")+e.toString(16)}function dt(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ft(e,t,n,o)}function ht(e){if(e instanceof ft)return new ft(e.h,e.s,e.l,e.opacity);if(e instanceof Be||(e=tt(e)),!e)return new ft;if(e instanceof ft)return e;var t=(e=e.rgb()).r/255,n=e.g/255,o=e.b/255,r=Math.min(t,n,o),i=Math.max(t,n,o),a=NaN,s=i-r,l=(i+r)/2;return s?(a=t===i?(n-o)/s+6*(n0&&l<1?0:a,new ft(a,s,l,e.opacity)}function ft(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}function gt(e){return(e=(e||0)%360)<0?e+360:e}function pt(e){return Math.max(0,Math.min(1,e||0))}function mt(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}$e(Be,tt,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Je,formatHex:Je,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return ht(this).formatHsl()},formatRgb:et,toString:et}),$e(it,rt,Ve(Be,{brighter(e){return e=null==e?je:Math.pow(je,e),new it(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Te:Math.pow(Te,e),new it(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new it(ct(this.r),ct(this.g),ct(this.b),lt(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:at,formatHex:at,formatHex8:function(){return`#${ut(this.r)}${ut(this.g)}${ut(this.b)}${ut(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:st,toString:st})),$e(ft,(function(e,t,n,o){return 1===arguments.length?ht(e):new ft(e,t,n,null==o?1:o)}),Ve(Be,{brighter(e){return e=null==e?je:Math.pow(je,e),new ft(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Te:Math.pow(Te,e),new ft(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,r=2*n-o;return new it(mt(e>=240?e-240:e+120,r,o),mt(e,r,o),mt(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new ft(gt(this.h),pt(this.s),pt(this.l),lt(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=lt(this.opacity);return`${1===e?"hsl(":"hsla("}${gt(this.h)}, ${100*pt(this.s)}%, ${100*pt(this.l)}%${1===e?")":`, ${e})`}`}}));var yt=e=>()=>e;function vt(e){return 1==(e=+e)?xt:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}(t,n,e):yt(isNaN(t)?n:t)}}function xt(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):yt(isNaN(e)?t:e)}var wt=function e(t){var n=vt(t);function o(e,t){var o=n((e=rt(e)).r,(t=rt(t)).r),r=n(e.g,t.g),i=n(e.b,t.b),a=xt(e.opacity,t.opacity);return function(t){return e.r=o(t),e.g=r(t),e.b=i(t),e.opacity=a(t),e+""}}return o.gamma=e,o}(1);function bt(e,t){t||(t=[]);var n,o=e?Math.min(t.length,e.length):0,r=t.slice();return function(i){for(n=0;ni&&(r=t.slice(i,r),s[a]?s[a]+=r:s[++a]=r),(n=n[0])===(o=o[0])?s[a]?s[a]+=o:s[++a]=o:(s[++a]=null,l.push({i:a,x:Et(n,o)})),i=Nt.lastIndex;return i180?t+=360:t-e>180&&(e+=360),i.push({i:n.push(r(n)+"rotate(",null,o)-2,x:Et(e,t)})):t&&n.push(r(n)+"rotate("+t+o)}(i.rotate,a.rotate,s,l),function(e,t,n,i){e!==t?i.push({i:n.push(r(n)+"skewX(",null,o)-2,x:Et(e,t)}):t&&n.push(r(n)+"skewX("+t+o)}(i.skewX,a.skewX,s,l),function(e,t,n,o,i,a){if(e!==n||t!==o){var s=i.push(r(i)+"scale(",null,",",null,")");a.push({i:s-4,x:Et(e,n)},{i:s-2,x:Et(t,o)})}else 1===n&&1===o||i.push(r(i)+"scale("+n+","+o+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,s,l),i=a=null,function(e){for(var t,n=-1,o=l.length;++n=0&&t._call.call(void 0,e),t=t._next;--jt}()}finally{jt=0,function(){var e,t,n=Vt,o=1/0;for(;n;)n._call?(o>n._time&&(o=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:Vt=t);Bt=e,nn(o)}(),Ft=0}}function tn(){var e=Kt.now(),t=e-Yt;t>Xt&&(Wt-=t,Yt=e)}function nn(e){jt||(Ht&&(Ht=clearTimeout(Ht)),e-Ft>24?(e<1/0&&(Ht=setTimeout(en,e-Kt.now()-Wt)),Zt&&(Zt=clearInterval(Zt))):(Zt||(Yt=Kt.now(),Zt=setInterval(tn,Xt)),jt=1,Gt(en)))}function on(e,t,n){var o=new Qt;return t=null==t?0:+t,o.restart((n=>{o.stop(),e(n+t)}),t,n),o}Qt.prototype=Jt.prototype={constructor:Qt,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?qt():+n)+(null==t?0:+t),this._next||Bt===this||(Bt?Bt._next=this:Vt=this,Bt=this),this._call=e,this._time=n,nn()},stop:function(){this._call&&(this._call=null,this._time=1/0,nn())}};var rn=a("start","end","cancel","interrupt"),an=[],sn=0,ln=1,cn=2,un=3,dn=4,hn=5,fn=6;function gn(e,t,n,o,r,i){var a=e.__transition;if(a){if(n in a)return}else e.__transition={};!function(e,t,n){var o,r=e.__transition;function i(e){n.state=ln,n.timer.restart(a,n.delay,n.time),n.delay<=e&&a(e-n.delay)}function a(i){var c,u,d,h;if(n.state!==ln)return l();for(c in r)if((h=r[c]).name===n.name){if(h.state===un)return on(a);h.state===dn?(h.state=fn,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[c]):+csn)throw new Error("too late; already scheduled");return n}function mn(e,t){var n=yn(e,t);if(n.state>un)throw new Error("too late; already running");return n}function yn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function vn(e,t){var n,o,r,i=e.__transition,a=!0;if(i){for(r in t=null==t?null:t+"",i)(n=i[r]).name===t?(o=n.state>cn&&n.state=0&&(e=e.slice(0,t)),!e||"start"===e}))}(t)?pn:mn;return function(){var a=i(this,e),s=a.on;s!==o&&(r=(o=s).copy()).on(t,n),a.on=r}}(n,e,t))},attr:function(e,t){var n=h(e),o="transform"===n?Lt:Sn;return this.attrTween(e,"function"==typeof t?(n.local?_n:Nn)(n,o,bn(this,"attr."+e,t)):null==t?(n.local?En:Cn)(n):(n.local?Mn:kn)(n,o,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;var o=h(e);return this.tween(n,(o.local?Pn:zn)(o,t))},style:function(e,t,n){var o="transform"==(e+="")?Dt:Sn;return null==t?this.styleTween(e,function(e,t){var n,o,r;return function(){var i=X(this,e),a=(this.style.removeProperty(e),X(this,e));return i===a?null:i===n&&a===o?r:r=t(n=i,o=a)}}(e,o)).on("end.style."+e,Ln(e)):"function"==typeof t?this.styleTween(e,function(e,t,n){var o,r,i;return function(){var a=X(this,e),s=n(this),l=s+"";return null==s&&(this.style.removeProperty(e),l=s=X(this,e)),a===l?null:a===o&&l===r?i:(r=l,i=t(o=a,s))}}(e,o,bn(this,"style."+e,t))).each(function(e,t){var n,o,r,i,a="style."+t,s="end."+a;return function(){var l=mn(this,e),c=l.on,u=null==l.value[a]?i||(i=Ln(t)):void 0;c===n&&r===u||(o=(n=c).copy()).on(s,r=u),l.on=o}}(this._id,e)):this.styleTween(e,function(e,t,n){var o,r,i=n+"";return function(){var a=X(this,e);return a===i?null:a===o?r:r=t(o=a,n)}}(e,o,t),n).on("end.style."+e,null)},styleTween:function(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(null==t)return this.tween(o,null);if("function"!=typeof t)throw new Error;return this.tween(o,function(e,t,n){var o,r;function i(){var i=t.apply(this,arguments);return i!==r&&(o=(r=i)&&function(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}(e,i,n)),o}return i._value=t,i}(e,t,null==n?"":n))},text:function(e){return this.tween("text","function"==typeof e?function(e){return function(){var t=e(this);this.textContent=null==t?"":t}}(bn(this,"text",e)):function(e){return function(){this.textContent=e}}(null==e?"":e+""))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;return this.tween(t,function(e){var t,n;function o(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&function(e){return function(t){this.textContent=e.call(this,t)}}(o)),t}return o._value=e,o}(e))},remove:function(){return this.on("end.remove",function(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}(this._id))},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o,r=yn(this.node(),n).tween,i=0,a=r.length;i()=>e;function Xn(e,{sourceEvent:t,target:n,transform:o,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:r}})}function Yn(e,t,n){this.k=e,this.x=t,this.y=n}Yn.prototype={constructor:Yn,scale:function(e){return 1===e?this:new Yn(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new Yn(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Fn=new Yn(1,0,0);function Wn(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Fn;return e.__zoom}function Kn(e){e.stopImmediatePropagation()}function Gn(e){e.preventDefault(),e.stopImmediatePropagation()}function qn(e){return!(e.ctrlKey&&"wheel"!==e.type||e.button)}function Un(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).x,e.y],[e.x+e.width,e.y+e.height]]:[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]:[[0,0],[e.clientWidth,e.clientHeight]]}function Qn(){return this.__zoom||Fn}function Jn(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function eo(){return navigator.maxTouchPoints||"ontouchstart"in this}function to(e,t,n){var o=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function no(){var e,t,n,o=qn,r=Un,i=to,s=Jn,l=eo,c=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],d=250,h=Tt,f=a("start","zoom","end"),g=500,p=150,m=0,y=10;function v(e){e.property("__zoom",Qn).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",N).filter(l).on("touchstart.zoom",_).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(e,t){return(t=Math.max(c[0],Math.min(c[1],t)))===e.k?e:new Yn(t,e.x,e.y)}function w(e,t,n){var o=t[0]-n[0]*e.k,r=t[1]-n[1]*e.k;return o===e.x&&r===e.y?e:new Yn(e.k,o,r)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function S(e,t,n,o){e.on("start.zoom",(function(){C(this,arguments).event(o).start()})).on("interrupt.zoom end.zoom",(function(){C(this,arguments).event(o).end()})).tween("zoom",(function(){var e=this,i=arguments,a=C(e,i).event(o),s=r.apply(e,i),l=null==n?b(s):"function"==typeof n?n.apply(e,i):n,c=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),u=e.__zoom,d="function"==typeof t?t.apply(e,i):t,f=h(u.invert(l).concat(c/u.k),d.invert(l).concat(c/d.k));return function(e){if(1===e)e=d;else{var t=f(e),n=c/t[2];e=new Yn(n,l[0]-t[0]*n,l[1]-t[1]*n)}a.zoom(null,e)}}))}function C(e,t,n){return!n&&e.__zooming||new E(e,t)}function E(e,t){this.that=e,this.args=t,this.active=0,this.sourceEvent=null,this.extent=r.apply(e,t),this.taps=0}function k(e,...t){if(o.apply(this,arguments)){var n=C(this,t).event(e),r=this.__zoom,a=Math.max(c[0],Math.min(c[1],r.k*Math.pow(2,s.apply(this,arguments)))),l=Ce(e);if(n.wheel)n.mouse[0][0]===l[0]&&n.mouse[0][1]===l[1]||(n.mouse[1]=r.invert(n.mouse[0]=l)),clearTimeout(n.wheel);else{if(r.k===a)return;n.mouse=[l,r.invert(l)],vn(this),n.start()}Gn(e),n.wheel=setTimeout((function(){n.wheel=null,n.end()}),p),n.zoom("mouse",i(w(x(r,a),n.mouse[0],n.mouse[1]),n.extent,u))}}function M(e,...t){if(!n&&o.apply(this,arguments)){var r=e.currentTarget,a=C(this,t,!0).event(e),s=Se(e.view).on("mousemove.zoom",(function(e){if(Gn(e),!a.moved){var t=e.clientX-c,n=e.clientY-d;a.moved=t*t+n*n>m}a.event(e).zoom("mouse",i(w(a.that.__zoom,a.mouse[0]=Ce(e,r),a.mouse[1]),a.extent,u))}),!0).on("mouseup.zoom",(function(e){s.on("mousemove.zoom mouseup.zoom",null),Pe(e.view,a.moved),Gn(e),a.event(e).end()}),!0),l=Ce(e,r),c=e.clientX,d=e.clientY;_e(e.view),Kn(e),a.mouse=[l,this.__zoom.invert(l)],vn(this),a.start()}}function N(e,...t){if(o.apply(this,arguments)){var n=this.__zoom,a=Ce(e.changedTouches?e.changedTouches[0]:e,this),s=n.invert(a),l=n.k*(e.shiftKey?.5:2),c=i(w(x(n,l),a,s),r.apply(this,t),u);Gn(e),d>0?Se(this).transition().duration(d).call(S,c,a,e):Se(this).call(v.transform,c,a,e)}}function _(n,...r){if(o.apply(this,arguments)){var i,a,s,l,c=n.touches,u=c.length,d=C(this,r,n.changedTouches.length===u).event(n);for(Kn(n),a=0;a"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:o})=>`Couldn't create edge for ${e} handle id: "${"source"===e?n:o}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},ro=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],io=["Enter"," ","Escape"],ao={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var so,lo,co;e.ConnectionMode=void 0,(so=e.ConnectionMode||(e.ConnectionMode={})).Strict="strict",so.Loose="loose",e.PanOnScrollMode=void 0,(lo=e.PanOnScrollMode||(e.PanOnScrollMode={})).Free="free",lo.Vertical="vertical",lo.Horizontal="horizontal",e.SelectionMode=void 0,(co=e.SelectionMode||(e.SelectionMode={})).Partial="partial",co.Full="full";const uo={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var ho,fo,go;e.ConnectionLineType=void 0,(ho=e.ConnectionLineType||(e.ConnectionLineType={})).Bezier="default",ho.Straight="straight",ho.Step="step",ho.SmoothStep="smoothstep",ho.SimpleBezier="simplebezier",e.MarkerType=void 0,(fo=e.MarkerType||(e.MarkerType={})).Arrow="arrow",fo.ArrowClosed="arrowclosed",e.Position=void 0,(go=e.Position||(e.Position={})).Left="left",go.Top="top",go.Right="right",go.Bottom="bottom";const po={[e.Position.Left]:e.Position.Right,[e.Position.Right]:e.Position.Left,[e.Position.Top]:e.Position.Bottom,[e.Position.Bottom]:e.Position.Top};function mo(e,t){if(!e&&!t)return!0;if(!e||!t||e.size!==t.size)return!1;if(!e.size&&!t.size)return!0;for(const n of e.keys())if(!t.has(n))return!1;return!0}function yo(e,t,n){if(!n)return;const o=[];e.forEach(((e,n)=>{t?.has(n)||o.push(e)})),o.length&&n(o)}function vo(e){return null===e?null:e?"valid":"invalid"}const xo=e=>"id"in e&&"source"in e&&"target"in e,wo=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),bo=(e,t=[0,0])=>{const{width:n,height:o}=qo(e),r=e.origin??t,i=n*r[0],a=o*r[1];return{x:e.position.x-i,y:e.position.y-a}},So=(e,t={nodeOrigin:[0,0]})=>{if(0===e.length)return{x:0,y:0,width:0,height:0};const n=e.reduce(((e,n)=>{const o="string"==typeof n;let r=t.nodeLookup||o?void 0:n;t.nodeLookup&&(r=o?t.nodeLookup.get(n):wo(n)?n:t.nodeLookup.get(n.id));const i=r?$o(r,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Io(e,i)}),{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Do(n)},Co=(e,t={})=>{if(0===e.size)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach((e=>{if(void 0===t.filter||t.filter(e)){const t=$o(e);n=Io(n,t)}})),Do(n)},Eo=(e,t,[n,o,r]=[0,0,1],i=!1,a=!1)=>{const s={...Xo(t,[n,o,r]),width:t.width/r,height:t.height/r},l=[];for(const t of e.values()){const{measured:e,selectable:n=!0,hidden:o=!1}=t;if(a&&!n||o)continue;const r=e.width??t.width??t.initialWidth??null,c=e.height??t.height??t.initialHeight??null,u=Bo(s,Lo(t)),d=(r??0)*(c??0),h=i&&u>0;(!t.internals.handleBounds||h||u>=d||t.dragging)&&l.push(t)}return l},ko=(e,t)=>{const n=new Set;return e.forEach((e=>{n.add(e.id)})),t.filter((e=>n.has(e.source)||n.has(e.target)))};async function Mo({nodes:e,width:t,height:n,panZoom:o,minZoom:r,maxZoom:i},a){if(0===e.size)return Promise.resolve(!0);const s=function(e,t){const n=new Map,o=t?.nodes?new Set(t.nodes.map((e=>e.id))):null;return e.forEach((e=>{!e.measured.width||!e.measured.height||!t?.includeHiddenNodes&&e.hidden||o&&!o.has(e.id)||n.set(e.id,e)})),n}(e,a),l=Co(s),c=Wo(l,t,n,a?.minZoom??r,a?.maxZoom??i,a?.padding??.1);return await o.setViewport(c,{duration:a?.duration,ease:a?.ease,interpolate:a?.interpolate}),Promise.resolve(!0)}function No({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:o=[0,0],nodeExtent:r,onError:i}){const a=n.get(e),s=a.parentId?n.get(a.parentId):void 0,{x:l,y:c}=s?s.internals.positionAbsolute:{x:0,y:0},u=a.origin??o;let d=r;if("parent"!==a.extent||a.expandParent)s&&Go(a.extent)&&(d=[[a.extent[0][0]+l,a.extent[0][1]+c],[a.extent[1][0]+l,a.extent[1][1]+c]]);else if(s){const e=s.measured.width,t=s.measured.height;e&&t&&(d=[[l,c],[l+e,c+t]])}else i?.("005",oo.error005());const h=Go(d)?Po(t,d,a.measured):t;return void 0!==a.measured.width&&void 0!==a.measured.height||i?.("015",oo.error015()),{position:{x:h.x-l+(a.measured.width??0)*u[0],y:h.y-c+(a.measured.height??0)*u[1]},positionAbsolute:h}}const _o=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Po=(e={x:0,y:0},t,n)=>({x:_o(e.x,t[0][0],t[1][0]-(n?.width??0)),y:_o(e.y,t[0][1],t[1][1]-(n?.height??0))});function zo(e,t,n){const{width:o,height:r}=qo(n),{x:i,y:a}=n.internals.positionAbsolute;return Po(e,[[i,a],[i+o,a+r]],t)}const Oo=(e,t,n)=>en?-_o(Math.abs(e-n),1,t)/t:0,Ao=(e,t,n=15,o=40)=>[Oo(e.x,o,t.width-o)*n,Oo(e.y,o,t.height-o)*n],Io=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Ro=({x:e,y:t,width:n,height:o})=>({x:e,y:t,x2:e+n,y2:t+o}),Do=({x:e,y:t,x2:n,y2:o})=>({x:e,y:t,width:n-e,height:o-t}),Lo=(e,t=[0,0])=>{const{x:n,y:o}=wo(e)?e.internals.positionAbsolute:bo(e,t);return{x:n,y:o,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},$o=(e,t=[0,0])=>{const{x:n,y:o}=wo(e)?e.internals.positionAbsolute:bo(e,t);return{x:n,y:o,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:o+(e.measured?.height??e.height??e.initialHeight??0)}},Vo=(e,t)=>Do(Io(Ro(e),Ro(t))),Bo=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),o=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*o)},To=e=>jo(e.width)&&jo(e.height)&&jo(e.x)&&jo(e.y),jo=e=>!isNaN(e)&&isFinite(e),Ho=(e,t)=>{},Zo=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Xo=({x:e,y:t},[n,o,r],i=!1,a=[1,1])=>{const s={x:(e-n)/r,y:(t-o)/r};return i?Zo(s,a):s},Yo=({x:e,y:t},[n,o,r])=>({x:e*r+n,y:t*r+o});function Fo(e,t){if("number"==typeof e)return Math.floor(.5*(t-t/(1+e)));if("string"==typeof e&&e.endsWith("px")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if("string"==typeof e&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}const Wo=(e,t,n,o,r,i)=>{const a=function(e,t,n){if("string"==typeof e||"number"==typeof e){const o=Fo(e,n),r=Fo(e,t);return{top:o,right:r,bottom:o,left:r,x:2*r,y:2*o}}if("object"==typeof e){const o=Fo(e.top??e.y??0,n),r=Fo(e.bottom??e.y??0,n),i=Fo(e.left??e.x??0,t),a=Fo(e.right??e.x??0,t);return{top:o,right:a,bottom:r,left:i,x:i+a,y:o+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}(i,t,n),s=(t-a.x)/e.width,l=(n-a.y)/e.height,c=Math.min(s,l),u=_o(c,o,r),d=t/2-(e.x+e.width/2)*u,h=n/2-(e.y+e.height/2)*u,f=function(e,t,n,o,r,i){const{x:a,y:s}=Yo(e,[t,n,o]),{x:l,y:c}=Yo({x:e.x+e.width,y:e.y+e.height},[t,n,o]),u=r-l,d=i-c;return{left:Math.floor(a),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(d)}}(e,d,h,u,t,n),g=Math.min(f.left-a.left,0),p=Math.min(f.top-a.top,0);return{x:d-g+Math.min(f.right-a.right,0),y:h-p+Math.min(f.bottom-a.bottom,0),zoom:u}},Ko=()=>"undefined"!=typeof navigator&&navigator?.userAgent?.indexOf("Mac")>=0;function Go(e){return void 0!==e&&"parent"!==e}function qo(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Uo(e){return void 0!==(e.measured?.width??e.width??e.initialWidth)&&void 0!==(e.measured?.height??e.height??e.initialHeight)}function Qo(e,t={width:0,height:0},n,o,r){const i={...e},a=o.get(n);if(a){const e=a.origin||r;i.x+=a.internals.positionAbsolute.x-(t.width??0)*e[0],i.y+=a.internals.positionAbsolute.y-(t.height??0)*e[1]}return i}function Jo(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function er(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:o,containerBounds:r}){const{x:i,y:a}=ar(e),s=Xo({x:i-(r?.left??0),y:a-(r?.top??0)},o),{x:l,y:c}=n?Zo(s,t):s;return{xSnapped:l,ySnapped:c,...s}}const tr=e=>({width:e.offsetWidth,height:e.offsetHeight}),nr=e=>e?.getRootNode?.()||window?.document,or=["INPUT","SELECT","TEXTAREA"];function rr(e){const t=e.composedPath?.()?.[0]||e.target;if(1!==t?.nodeType)return!1;return or.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const ir=e=>"clientX"in e,ar=(e,t)=>{const n=ir(e),o=n?e.clientX:e.touches?.[0].clientX,r=n?e.clientY:e.touches?.[0].clientY;return{x:o-(t?.left??0),y:r-(t?.top??0)}},sr=(e,t,n,o,r)=>{const i=t.querySelectorAll(`.${e}`);return i&&i.length?Array.from(i).map((t=>{const i=t.getBoundingClientRect();return{id:t.getAttribute("data-handleid"),type:e,nodeId:r,position:t.getAttribute("data-handlepos"),x:(i.left-n.left)/o,y:(i.top-n.top)/o,...tr(t)}})):null};function lr({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:r,sourceControlY:i,targetControlX:a,targetControlY:s}){const l=.125*e+.375*r+.375*a+.125*n,c=.125*t+.375*i+.375*s+.125*o;return[l,c,Math.abs(l-e),Math.abs(c-t)]}function cr(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function ur({pos:t,x1:n,y1:o,x2:r,y2:i,c:a}){switch(t){case e.Position.Left:return[n-cr(n-r,a),o];case e.Position.Right:return[n+cr(r-n,a),o];case e.Position.Top:return[n,o-cr(o-i,a)];case e.Position.Bottom:return[n,o+cr(i-o,a)]}}function dr({sourceX:t,sourceY:n,sourcePosition:o=e.Position.Bottom,targetX:r,targetY:i,targetPosition:a=e.Position.Top,curvature:s=.25}){const[l,c]=ur({pos:o,x1:t,y1:n,x2:r,y2:i,c:s}),[u,d]=ur({pos:a,x1:r,y1:i,x2:t,y2:n,c:s}),[h,f,g,p]=lr({sourceX:t,sourceY:n,targetX:r,targetY:i,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${t},${n} C${l},${c} ${u},${d} ${r},${i}`,h,f,g,p]}function hr({sourceX:e,sourceY:t,targetX:n,targetY:o}){const r=Math.abs(n-e)/2,i=n0}const gr=({source:e,sourceHandle:t,target:n,targetHandle:o})=>`xy-edge__${e}${t||""}-${n}${o||""}`,pr=(e,t)=>{if(!e.source||!e.target)return t;let n;return n=xo(e)?{...e}:{...e,id:gr(e)},((e,t)=>t.some((t=>!(t.source!==e.source||t.target!==e.target||t.sourceHandle!==e.sourceHandle&&(t.sourceHandle||e.sourceHandle)||t.targetHandle!==e.targetHandle&&(t.targetHandle||e.targetHandle)))))(n,t)?t:(null===n.sourceHandle&&delete n.sourceHandle,null===n.targetHandle&&delete n.targetHandle,t.concat(n))};function mr({sourceX:e,sourceY:t,targetX:n,targetY:o}){const[r,i,a,s]=hr({sourceX:e,sourceY:t,targetX:n,targetY:o});return[`M ${e},${t}L ${n},${o}`,r,i,a,s]}const yr={[e.Position.Left]:{x:-1,y:0},[e.Position.Right]:{x:1,y:0},[e.Position.Top]:{x:0,y:-1},[e.Position.Bottom]:{x:0,y:1}},vr=({source:t,sourcePosition:n=e.Position.Bottom,target:o})=>n===e.Position.Left||n===e.Position.Right?t.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function wr({sourceX:t,sourceY:n,sourcePosition:o=e.Position.Bottom,targetX:r,targetY:i,targetPosition:a=e.Position.Top,borderRadius:s=5,centerX:l,centerY:c,offset:u=20}){const[d,h,f,g,p]=function({source:t,sourcePosition:n=e.Position.Bottom,target:o,targetPosition:r=e.Position.Top,center:i,offset:a}){const s=yr[n],l=yr[r],c={x:t.x+s.x*a,y:t.y+s.y*a},u={x:o.x+l.x*a,y:o.y+l.y*a},d=vr({source:c,sourcePosition:n,target:u}),h=0!==d.x?"x":"y",f=d[h];let g,p,m=[];const y={x:0,y:0},v={x:0,y:0},[x,w,b,S]=hr({sourceX:t.x,sourceY:t.y,targetX:o.x,targetY:o.y});if(s[h]*l[h]==-1){g=i.x??x,p=i.y??w;const e=[{x:g,y:c.y},{x:g,y:u.y}],t=[{x:c.x,y:p},{x:u.x,y:p}];m=s[h]===f?"x"===h?e:t:"x"===h?t:e}else{const e=[{x:c.x,y:u.y}],i=[{x:u.x,y:c.y}];if(m="x"===h?s.x===f?i:e:s.y===f?e:i,n===r){const e=Math.abs(t[h]-o[h]);if(e<=a){const n=Math.min(a-1,a-e);s[h]===f?y[h]=(c[h]>t[h]?-1:1)*n:v[h]=(u[h]>o[h]?-1:1)*n}}if(n!==r){const t="x"===h?"y":"x",n=s[h]===l[t],o=c[t]>u[t],r=c[t]=Math.max(Math.abs(d.y-m[0].y),Math.abs(x.y-m[0].y))?(g=(d.x+x.x)/2,p=m[0].y):(g=m[0].x,p=(d.y+x.y)/2)}return[[t,{x:c.x+y.x,y:c.y+y.y},...m,{x:u.x+v.x,y:u.y+v.y},o],g,p,b,S]}({source:{x:t,y:n},sourcePosition:o,target:{x:r,y:i},targetPosition:a,center:{x:l,y:c},offset:u});return[d.reduce(((e,t,n)=>{let o="";return o=n>0&&ne.id===t)):e[0])||null}function kr(e,t){if(!e)return"";if("string"==typeof e)return e;return`${t?`${t}__`:""}${Object.keys(e).sort().map((t=>`${t}=${e[t]}`)).join("&")}`}function Mr(t,n,o,r,i){let a=.5;"start"===i?a=0:"end"===i&&(a=1);let s=[(t.x+t.width*a)*n.zoom+n.x,t.y*n.zoom+n.y-r],l=[-100*a,-100];switch(o){case e.Position.Right:s=[(t.x+t.width)*n.zoom+n.x+r,(t.y+t.height*a)*n.zoom+n.y],l=[0,-100*a];break;case e.Position.Bottom:s[1]=(t.y+t.height)*n.zoom+n.y+r,l[1]=0;break;case e.Position.Left:s=[t.x*n.zoom+n.x-r,(t.y+t.height*a)*n.zoom+n.y],l=[-100,-100*a]}return`translate(${s[0]}px, ${s[1]}px) translate(${l[0]}%, ${l[1]}%)`}const Nr={nodeOrigin:[0,0],nodeExtent:ro,elevateNodesOnSelect:!0,defaults:{}},_r={...Nr,checkEquality:!0};function Pr(e,t){const n={...e};for(const e in t)void 0!==t[e]&&(n[e]=t[e]);return n}function zr(e,t,n,o){const r=Pr(_r,o);let i=e.length>0;const a=new Map(t),s=r?.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const l of e){let e=a.get(l.id);if(r.checkEquality&&l===e?.internals.userNode)t.set(l.id,e);else{const n=bo(l,r.nodeOrigin),o=Go(l.extent)?l.extent:r.nodeExtent,i=Po(n,o,qo(l));e={...r.defaults,...l,measured:{width:l.measured?.width,height:l.measured?.height},internals:{positionAbsolute:i,handleBounds:l.measured?e?.internals.handleBounds:void 0,z:Ar(l,s),userNode:l}},t.set(l.id,e)}void 0!==e.measured&&void 0!==e.measured.width&&void 0!==e.measured.height||e.hidden||(i=!1),l.parentId&&Or(e,t,n,o)}return i}function Or(e,t,n,o){const{elevateNodesOnSelect:r,nodeOrigin:i,nodeExtent:a}=Pr(Nr,o),s=e.parentId,l=t.get(s);if(!l)return void console.warn(`Parent node ${s} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);!function(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}(e,n);const c=r?1e3:0,{x:u,y:d,z:h}=function(e,t,n,o,r){const{x:i,y:a}=t.internals.positionAbsolute,s=qo(e),l=bo(e,n),c=Go(e.extent)?Po(l,e.extent,s):l;let u=Po({x:i+c.x,y:a+c.y},o,s);"parent"===e.extent&&(u=zo(u,s,t));const d=Ar(e,r),h=t.internals.z??0;return{x:u.x,y:u.y,z:h>d?h:d}}(e,l,i,a,c),{positionAbsolute:f}=e.internals,g=u!==f.x||d!==f.y;(g||h!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:g?{x:u,y:d}:f,z:h}})}function Ar(e,t){return(jo(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function Ir(e,t,n,o=[0,0]){const r=[],i=new Map;for(const n of e){const e=t.get(n.parentId);if(!e)continue;const o=i.get(n.parentId)?.expandedRect??Lo(e),r=Vo(o,n.rect);i.set(n.parentId,{expandedRect:r,parent:e})}return i.size>0&&i.forEach((({expandedRect:t,parent:i},a)=>{const s=i.internals.positionAbsolute,l=qo(i),c=i.origin??o,u=t.x0||d>0||g||p)&&(r.push({id:a,type:"position",position:{x:i.position.x-u+g,y:i.position.y-d+p}}),n.get(a)?.forEach((t=>{e.some((e=>e.id===t.id))||r.push({id:t.id,type:"position",position:{x:t.position.x+u,y:t.position.y+d}})}))),(l.width1&&l){const e=Co(s);y=Ro(e)}for(const[t,o]of s){if(!a.has(t))continue;let r={x:e-o.distance.x,y:n-o.distance.y};u&&(r=Zo(r,c));let i=[[l[0][0],l[0][1]],[l[1][0],l[1][1]]];if(s.size>1&&l&&!o.extent){const{positionAbsolute:e}=o.internals,t=e.x-y.x+l[0][0],n=e.x+o.measured.width-y.x2+l[1][0];i=[[t,e.y-y.y+l[0][1]],[n,e.y+o.measured.height-y.y2+l[1][1]]]}const{position:h,positionAbsolute:f}=No({nodeId:t,nextPosition:r,nodeLookup:a,nodeExtent:i,nodeOrigin:d,onError:g});m=m||o.position.x!==h.x||o.position.y!==h.y,o.position=h,o.internals.positionAbsolute=f}if(m&&(p(s,!0),r&&(o||h||!v&&f))){const[e,t]=Br({nodeId:v,dragItems:s,nodeLookup:a});o?.(r,s,e,t),h?.(r,e,t),v||f?.(r,t)}}async function b(){if(!u)return;const{transform:e,panBy:n,autoPanSpeed:o,autoPanOnNodeDrag:r}=t();if(!r)return l=!1,void cancelAnimationFrame(a);const[s,d]=Ao(c,u,o);0===s&&0===d||(i.x=(i.x??0)-s/e[2],i.y=(i.y??0)-d/e[2],await n({x:s,y:d})&&w(i,null)),a=requestAnimationFrame(b)}function S(o){const{nodeLookup:r,multiSelectionActive:a,nodesDraggable:l,transform:c,snapGrid:h,snapToGrid:f,selectNodesOnDrag:g,onNodeDragStart:p,onSelectionDragStart:m,unselectNodesAndEdges:x}=t();d=!0,g&&y||a||!v||r.get(v)?.selected||x(),y&&g&&v&&e?.(v);const w=er(o.sourceEvent,{transform:c,snapGrid:h,snapToGrid:f,containerBounds:u});if(i=w,s=function(e,t,n,o){const r=new Map;for(const[i,a]of e)if((a.selected||a.id===o)&&(!a.parentId||!$r(a,e))&&(a.draggable||t&&void 0===a.draggable)){const t=e.get(i);t&&r.set(i,{id:i,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return r}(r,l,w,v),s.size>0&&(n||p||!v&&m)){const[e,t]=Br({nodeId:v,dragItems:s,nodeLookup:r});n?.(o.sourceEvent,s,e,t),p?.(o.sourceEvent,e,t),v||m?.(o.sourceEvent,t)}}h=Se(m);const C=Le().clickDistance(x).on("start",(e=>{const{domNode:n,nodeDragThreshold:o,transform:r,snapGrid:a,snapToGrid:s}=t();u=n?.getBoundingClientRect()||null,f=!1,0===o&&S(e);const l=er(e.sourceEvent,{transform:r,snapGrid:a,snapToGrid:s,containerBounds:u});i=l,c=ar(e.sourceEvent,u)})).on("drag",(e=>{const{autoPanOnNodeDrag:n,transform:o,snapGrid:r,snapToGrid:a,nodeDragThreshold:h,nodeLookup:g}=t(),p=er(e.sourceEvent,{transform:o,snapGrid:r,snapToGrid:a,containerBounds:u});if(("touchmove"===e.sourceEvent.type&&e.sourceEvent.touches.length>1||v&&!g.has(v))&&(f=!0),!f){if(!l&&n&&d&&(l=!0,b()),!d){const t=p.xSnapped-(i.x??0),n=p.ySnapped-(i.y??0);Math.sqrt(t*t+n*n)>h&&S(e)}(i.x!==p.xSnapped||i.y!==p.ySnapped)&&s&&d&&(c=ar(e.sourceEvent,u),w(p,e.sourceEvent))}})).on("end",(e=>{if(d&&!f&&(l=!1,d=!1,cancelAnimationFrame(a),s.size>0)){const{nodeLookup:n,updateNodePositions:o,onNodeDragStop:i,onSelectionDragStop:a}=t();if(o(s,!1),r||i||!v&&a){const[t,o]=Br({nodeId:v,dragItems:s,nodeLookup:n,dragging:!1});r?.(e.sourceEvent,s,t,o),i?.(e.sourceEvent,t,o),v||a?.(e.sourceEvent,o)}}})).filter((e=>{const t=e.target;return!e.button&&(!g||!Vr(t,`.${g}`,m))&&(!p||Vr(t,p,m))}));h.call(C)},destroy:function(){h?.on(".drag",null)}}}const jr=250;function Hr(e,t,n,o){let r=[],i=1/0;const a=function(e,t,n){const o=[],r={x:e.x-n,y:e.y-n,width:2*n,height:2*n};for(const e of t.values())Bo(r,Lo(e))>0&&o.push(e);return o}(e,n,t+jr);for(const n of a){const a=[...n.internals.handleBounds?.source??[],...n.internals.handleBounds?.target??[]];for(const s of a){if(o.nodeId===s.nodeId&&o.type===s.type&&o.id===s.id)continue;const{x:a,y:l}=Cr(n,s,s.position,!0),c=Math.sqrt(Math.pow(a-e.x,2)+Math.pow(l-e.y,2));c>t||(c1){const e="source"===o.type?"target":"source";return r.find((t=>t.type===e))??r[0]}return r[0]}function Zr(e,t,n,o,r,i=!1){const a=o.get(e);if(!a)return null;const s="strict"===r?a.internals.handleBounds?.[t]:[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]],l=(n?s?.find((e=>e.id===n)):s?.[0])??null;return l&&i?{...l,...Cr(a,l,l.position,!0)}:l}function Xr(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}const Yr=()=>!0;function Fr(t,{handle:n,connectionMode:o,fromNodeId:r,fromHandleId:i,fromType:a,doc:s,lib:l,flowId:c,isValidConnection:u=Yr,nodeLookup:d}){const h="target"===a,f=n?s.querySelector(`.${l}-flow__handle[data-id="${c}-${n?.nodeId}-${n?.id}-${n?.type}"]`):null,{x:g,y:p}=ar(t),m=s.elementFromPoint(g,p),y=m?.classList.contains(`${l}-flow__handle`)?m:f,v={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){const t=Xr(void 0,y),n=y.getAttribute("data-nodeid"),a=y.getAttribute("data-handleid"),s=y.classList.contains("connectable"),l=y.classList.contains("connectableend");if(!n||!t)return v;const c={source:h?n:r,sourceHandle:h?a:i,target:h?r:n,targetHandle:h?i:a};v.connection=c;const f=s&&l&&(o===e.ConnectionMode.Strict?h&&"source"===t||!h&&"target"===t:n!==r||a!==i);v.isValid=f&&u(c),v.toHandle=Zr(n,t,a,d,o,!0)}return v}const Wr={onPointerDown:function(t,{connectionMode:n,connectionRadius:o,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:s,domNode:l,nodeLookup:c,lib:u,autoPanOnConnect:d,flowId:h,panBy:f,cancelConnection:g,onConnectStart:p,onConnect:m,onConnectEnd:y,isValidConnection:v=Yr,onReconnectEnd:x,updateConnection:w,getTransform:b,getFromHandle:S,autoPanSpeed:C}){const E=nr(t.target);let k,M=0;const{x:N,y:_}=ar(t),P=E?.elementFromPoint(N,_),z=Xr(a,P),O=l?.getBoundingClientRect();if(!O||!z)return;const A=Zr(i,z,r,c,n);if(!A)return;let I=ar(t,O),R=!1,D=null,L=!1,$=null;function V(){if(!d||!O)return;const[e,t]=Ao(I,O,C);f({x:e,y:t}),M=requestAnimationFrame(V)}const B={...A,nodeId:i,type:z,position:A.position},T=c.get(i),j={inProgress:!0,isValid:null,from:Cr(T,B,e.Position.Left,!0),fromHandle:B,fromPosition:B.position,fromNode:T,to:I,toHandle:null,toPosition:po[B.position],toNode:null};w(j);let H=j;function Z(e){if(!S()||!B)return void X(e);const t=b();I=ar(e,O),k=Hr(Xo(I,t,!1,[1,1]),o,c,B),R||(V(),R=!0);const a=Fr(e,{handle:k,connectionMode:n,fromNodeId:i,fromHandleId:r,fromType:s?"target":"source",isValidConnection:v,doc:E,lib:u,flowId:h,nodeLookup:c});$=a.handleDomNode,D=a.connection,L=function(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}(!!k,a.isValid);const l={...H,isValid:L,to:a.toHandle&&L?Yo({x:a.toHandle.x,y:a.toHandle.y},t):I,toHandle:a.toHandle,toPosition:L&&a.toHandle?a.toHandle.position:po[B.position],toNode:a.toHandle?c.get(a.toHandle.nodeId):null};L&&k&&H.toHandle&&l.toHandle&&H.toHandle.type===l.toHandle.type&&H.toHandle.nodeId===l.toHandle.nodeId&&H.toHandle.id===l.toHandle.id&&H.to.x===l.to.x&&H.to.y===l.to.y||(w(l),H=l)}function X(e){(k||$)&&D&&L&&m?.(D);const{inProgress:t,...n}=H,o={...n,toPosition:H.toHandle?H.toPosition:null};y?.(e,o),a&&x?.(e,o),g(),cancelAnimationFrame(M),R=!1,L=!1,D=null,$=null,E.removeEventListener("mousemove",Z),E.removeEventListener("mouseup",X),E.removeEventListener("touchmove",Z),E.removeEventListener("touchend",X)}p?.(t,{nodeId:i,handleId:r,handleType:z}),E.addEventListener("mousemove",Z),E.addEventListener("mouseup",X),E.addEventListener("touchmove",Z),E.addEventListener("touchend",X)},isValid:Fr};const Kr=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Gr=e=>({x:e.x,y:e.y,zoom:e.k}),qr=({x:e,y:t,zoom:n})=>Fn.translate(e,t).scale(n),Ur=(e,t)=>e.target.closest(`.${t}`),Qr=(e,t)=>2===t&&Array.isArray(e)&&e.includes(2),Jr=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,ei=(e,t=0,n=Jr,o=(()=>{}))=>{const r="number"==typeof t&&t>0;return r||o(),r?e.transition().duration(t).ease(n).on("end",o):e},ti=e=>{const t=e.ctrlKey&&Ko()?10:1;return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*t};function ni({domNode:t,minZoom:n,maxZoom:o,paneClickDistance:r,translateExtent:i,viewport:a,onPanZoom:s,onPanZoomStart:l,onPanZoomEnd:c,onDraggingChange:u}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=t.getBoundingClientRect(),f=no().clickDistance(!jo(r)||r<0?0:r).scaleExtent([n,o]).translateExtent(i),g=Se(t).call(f);x({x:a.x,y:a.y,zoom:_o(a.zoom,n,o)},[[0,0],[h.width,h.height]],i);const p=g.on("wheel.zoom"),m=g.on("dblclick.zoom");function y(e,t){return g?new Promise((n=>{f?.interpolate("linear"===t?.interpolate?Pt:Tt).transform(ei(g,t?.duration,t?.ease,(()=>n(!0))),e)})):Promise.resolve(!1)}function v(){f.on("zoom",null)}async function x(e,t,n){const o=qr(e),r=f?.constrain()(o,t,n);return r&&await y(r),new Promise((e=>e(r)))}return f.wheelDelta(ti),{update:function({noWheelClassName:t,noPanClassName:n,onPaneContextMenu:o,userSelectionActive:r,panOnScroll:i,panOnDrag:a,panOnScrollMode:h,panOnScrollSpeed:y,preventScrolling:x,zoomOnPinch:w,zoomOnScroll:b,zoomOnDoubleClick:S,zoomActivationKeyPressed:C,lib:E,onTransformChange:k}){r&&!d.isZoomingOrPanning&&v();const M=i&&!C&&!r?function({zoomPanValues:t,noWheelClassName:n,d3Selection:o,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:s,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:u}){return d=>{if(Ur(d,n))return!1;d.preventDefault(),d.stopImmediatePropagation();const h=o.property("__zoom").k||1;if(d.ctrlKey&&s){const e=Ce(d),t=ti(d),n=h*Math.pow(2,t);return void r.scaleTo(o,n,e,d)}const f=1===d.deltaMode?20:1;let g=i===e.PanOnScrollMode.Vertical?0:d.deltaX*f,p=i===e.PanOnScrollMode.Horizontal?0:d.deltaY*f;!Ko()&&d.shiftKey&&i!==e.PanOnScrollMode.Vertical&&(g=d.deltaY*f,p=0),r.translateBy(o,-g/h*a,-p/h*a,{internal:!0});const m=Gr(o.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling||(t.isPanScrolling=!0,l?.(d,m)),t.isPanScrolling&&(c?.(d,m),t.panScrollTimeout=setTimeout((()=>{u?.(d,m),t.isPanScrolling=!1}),150))}}({zoomPanValues:d,noWheelClassName:t,d3Selection:g,d3Zoom:f,panOnScrollMode:h,panOnScrollSpeed:y,zoomOnPinch:w,onPanZoomStart:l,onPanZoom:s,onPanZoomEnd:c}):function({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(o,r){const i="wheel"===o.type,a=!t&&i&&!o.ctrlKey,s=Ur(o,e);if(o.ctrlKey&&i&&s&&o.preventDefault(),a||s)return null;o.preventDefault(),n.call(this,o,r)}}({noWheelClassName:t,preventScrolling:x,d3ZoomHandler:p});if(g.on("wheel.zoom",M,{passive:!1}),!r){const e=function({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return o=>{if(o.sourceEvent?.internal)return;const r=Gr(o.transform);e.mouseButton=o.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=r,"mousedown"===o.sourceEvent?.type&&t(!0),n&&n?.(o.sourceEvent,r)}}({zoomPanValues:d,onDraggingChange:u,onPanZoomStart:l});f.on("start",e);const t=function({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:o,onPanZoom:r}){return i=>{e.usedRightMouseButton=!(!n||!Qr(t,e.mouseButton??0)),i.sourceEvent?.sync||o([i.transform.x,i.transform.y,i.transform.k]),r&&!i.sourceEvent?.internal&&r?.(i.sourceEvent,Gr(i.transform))}}({zoomPanValues:d,panOnDrag:a,onPaneContextMenu:!!o,onPanZoom:s,onTransformChange:k});f.on("zoom",t);const n=function({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:o,onPanZoomEnd:r,onPaneContextMenu:i}){return a=>{if(!a.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,i&&Qr(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,o(!1),r&&Kr(e.prevViewport,a.transform))){const t=Gr(a.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout((()=>{r?.(a.sourceEvent,t)}),n?150:0)}}}({zoomPanValues:d,panOnDrag:a,panOnScroll:i,onPaneContextMenu:o,onPanZoomEnd:c,onDraggingChange:u});f.on("end",n)}const N=function({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:o,panOnScroll:r,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:s,noPanClassName:l,lib:c}){return u=>{const d=e||t,h=n&&u.ctrlKey;if(1===u.button&&"mousedown"===u.type&&(Ur(u,`${c}-flow__node`)||Ur(u,`${c}-flow__edge`)))return!0;if(!(o||d||r||i||n))return!1;if(a)return!1;if(Ur(u,s)&&"wheel"===u.type)return!1;if(Ur(u,l)&&("wheel"!==u.type||r&&"wheel"===u.type&&!e))return!1;if(!n&&u.ctrlKey&&"wheel"===u.type)return!1;if(!n&&"touchstart"===u.type&&u.touches?.length>1)return u.preventDefault(),!1;if(!d&&!r&&!h&&"wheel"===u.type)return!1;if(!o&&("mousedown"===u.type||"touchstart"===u.type))return!1;if(Array.isArray(o)&&!o.includes(u.button)&&"mousedown"===u.type)return!1;const f=Array.isArray(o)&&o.includes(u.button)||!u.button||u.button<=1;return(!u.ctrlKey||"wheel"===u.type)&&f}}({zoomActivationKeyPressed:C,panOnDrag:a,zoomOnScroll:b,panOnScroll:i,zoomOnDoubleClick:S,zoomOnPinch:w,userSelectionActive:r,noPanClassName:n,noWheelClassName:t,lib:E});f.filter(N),S?g.on("dblclick.zoom",m):g.on("dblclick.zoom",null)},destroy:v,setViewport:async function(e,t){const n=qr(e);return await y(n,t),new Promise((e=>e(n)))},setViewportConstrained:x,getViewport:function(){const e=g?Wn(g.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}},scaleTo:function(e,t){return g?new Promise((n=>{f?.interpolate("linear"===t?.interpolate?Pt:Tt).scaleTo(ei(g,t?.duration,t?.ease,(()=>n(!0))),e)})):Promise.resolve(!1)},scaleBy:function(e,t){return g?new Promise((n=>{f?.interpolate("linear"===t?.interpolate?Pt:Tt).scaleBy(ei(g,t?.duration,t?.ease,(()=>n(!0))),e)})):Promise.resolve(!1)},setScaleExtent:function(e){f?.scaleExtent(e)},setTranslateExtent:function(e){f?.translateExtent(e)},syncViewport:function(e){if(g){const t=qr(e),n=g.property("__zoom");n.k===e.zoom&&n.x===e.x&&n.y===e.y||f?.transform(g,t,null,{sync:!0})}},setClickDistance:function(e){const t=!jo(e)||e<0?0:e;f?.clickDistance(t)}}}var oi;e.ResizeControlVariant=void 0,(oi=e.ResizeControlVariant||(e.ResizeControlVariant={})).Line="line",oi.Handle="handle";const ri=["top-left","top-right","bottom-left","bottom-right"],ii=["top","right","bottom","left"];function ai(e,t){return Math.max(0,t-e)}function si(e,t){return Math.max(0,e-t)}function li(e,t,n){return Math.max(0,t-e,e-n)}function ci(e,t){return e?!t:t}const ui={width:0,height:0,x:0,y:0},di={...ui,pointerX:0,pointerY:0,aspectRatio:1};function hi(e,t,n){const o=t.position.x+e.position.x,r=t.position.y+e.position.y,i=e.measured.width??0,a=e.measured.height??0,s=n[0]*i,l=n[1]*a;return[[o-s,r-l],[o+i-s,r+a-l]]}function fi({domNode:e,nodeId:t,getStoreItems:n,onChange:o,onEnd:r}){const i=Se(e);return{update:function({controlPosition:e,boundaries:a,keepAspectRatio:s,resizeDirection:l,onResizeStart:c,onResize:u,onResizeEnd:d,shouldResize:h}){let f={...ui},g={...di};const p=function(e){return{isHorizontal:e.includes("right")||e.includes("left"),isVertical:e.includes("bottom")||e.includes("top"),affectsX:e.includes("left"),affectsY:e.includes("top")}}(e);let m,y,v,x,w=null,b=[];const S=Le().on("start",(e=>{const{nodeLookup:o,transform:r,snapGrid:i,snapToGrid:a,nodeOrigin:s,paneDomNode:l}=n();if(m=o.get(t),!m)return;w=l?.getBoundingClientRect()??null;const{xSnapped:u,ySnapped:d}=er(e.sourceEvent,{transform:r,snapGrid:i,snapToGrid:a,containerBounds:w});f={width:m.measured.width??0,height:m.measured.height??0,x:m.position.x??0,y:m.position.y??0},g={...f,pointerX:u,pointerY:d,aspectRatio:f.width/f.height},y=void 0,m.parentId&&("parent"===m.extent||m.expandParent)&&(y=o.get(m.parentId),v=y&&"parent"===m.extent?function(e){return[[0,0],[e.measured.width,e.measured.height]]}(y):void 0),b=[],x=void 0;for(const[e,n]of o)if(n.parentId===t&&(b.push({id:e,position:{...n.position},extent:n.extent}),"parent"===n.extent||n.expandParent)){const e=hi(n,m,n.origin??s);x=x?[[Math.min(e[0][0],x[0][0]),Math.min(e[0][1],x[0][1])],[Math.max(e[1][0],x[1][0]),Math.max(e[1][1],x[1][1])]]:e}c?.(e,{...f})})).on("drag",(e=>{const{transform:t,snapGrid:r,snapToGrid:i,nodeOrigin:c}=n(),d=er(e.sourceEvent,{transform:t,snapGrid:r,snapToGrid:i,containerBounds:w}),S=[];if(!m)return;const{x:C,y:E,width:k,height:M}=f,N={},_=m.origin??c,{width:P,height:z,x:O,y:A}=function(e,t,n,o,r,i,a,s){let{affectsX:l,affectsY:c}=t;const{isHorizontal:u,isVertical:d}=t,h=u&&d,{xSnapped:f,ySnapped:g}=n,{minWidth:p,maxWidth:m,minHeight:y,maxHeight:v}=o,{x:x,y:w,width:b,height:S,aspectRatio:C}=e;let E=Math.floor(u?f-e.pointerX:0),k=Math.floor(d?g-e.pointerY:0);const M=b+(l?-E:E),N=S+(c?-k:k),_=-i[0]*b,P=-i[1]*S;let z=li(M,p,m),O=li(N,y,v);if(a){let e=0,t=0;l&&E<0?e=ai(x+E+_,a[0][0]):!l&&E>0&&(e=si(x+M+_,a[1][0])),c&&k<0?t=ai(w+k+P,a[0][1]):!c&&k>0&&(t=si(w+N+P,a[1][1])),z=Math.max(z,e),O=Math.max(O,t)}if(s){let e=0,t=0;l&&E>0?e=si(x+E,s[0][0]):!l&&E<0&&(e=ai(x+M,s[1][0])),c&&k>0?t=si(w+k,s[0][1]):!c&&k<0&&(t=ai(w+N,s[1][1])),z=Math.max(z,e),O=Math.max(O,t)}if(r){if(u){const e=li(M/C,y,v)*C;if(z=Math.max(z,e),a){let e=0;e=!l&&!c||l&&!c&&h?si(w+P+M/C,a[1][1])*C:ai(w+P+(l?E:-E)/C,a[0][1])*C,z=Math.max(z,e)}if(s){let e=0;e=!l&&!c||l&&!c&&h?ai(w+M/C,s[1][1])*C:si(w+(l?E:-E)/C,s[0][1])*C,z=Math.max(z,e)}}if(d){const e=li(N*C,p,m)/C;if(O=Math.max(O,e),a){let e=0;e=!l&&!c||c&&!l&&h?si(x+N*C+_,a[1][0])/C:ai(x+(c?k:-k)*C+_,a[0][0])/C,O=Math.max(O,e)}if(s){let e=0;e=!l&&!c||c&&!l&&h?ai(x+N*C,s[1][0])/C:si(x+(c?k:-k)*C,s[0][0])/C,O=Math.max(O,e)}}}k+=k<0?O:-O,E+=E<0?z:-z,r&&(h?M>N*C?k=(ci(l,c)?-E:E)/C:E=(ci(l,c)?-k:k)*C:u?(k=E/C,c=l):(E=k*C,l=c));const A=l?x+E:x,I=c?w+k:w;return{width:b+(l?-E:E),height:S+(c?-k:k),x:i[0]*E*(l?-1:1)+A,y:i[1]*k*(c?-1:1)+I}}(g,p,d,a,s,_,v,x),I=P!==k,R=z!==M,D=O!==C&&I,L=A!==E&&R;if(!(D||L||I||R))return;if((D||L||1===_[0]||1===_[1])&&(N.x=D?O:f.x,N.y=L?A:f.y,f.x=N.x,f.y=N.y,b.length>0)){const e=O-C,t=A-E;for(const n of b)n.position={x:n.position.x-e+_[0]*(P-k),y:n.position.y-t+_[1]*(z-M)},S.push(n)}if((I||R)&&(N.width=!I||l&&"horizontal"!==l?f.width:P,N.height=!R||l&&"vertical"!==l?f.height:z,f.width=N.width,f.height=N.height),y&&m.expandParent){const e=_[0]*(N.width??0);N.x&&N.x0?1:a<0?-1:0,s>0?1:s<0?-1:0];return a&&r&&(l[0]=-1*l[0]),s&&i&&(l[1]=-1*l[1]),l}({width:f.width,prevWidth:k,height:f.height,prevHeight:M,affectsX:p.affectsX,affectsY:p.affectsY}),V={...f,direction:$},B=h?.(e,V);!1!==B&&(u?.(e,V),o(N,S))})).on("end",(e=>{d?.(e,{...f}),r?.({...f})}));i.call(S)},destroy:function(){i.on(".drag",null)}}}function gi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var pi,mi,yi,vi={exports:{}},xi={},wi={exports:{}},bi={};function Si(){return mi||(mi=1,wi.exports=function(){if(pi)return bi;pi=1;var e=n,t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=e.useState,r=e.useEffect,i=e.useLayoutEffect,a=e.useDebugValue;function s(e){var n=e.getSnapshot;e=e.value;try{var o=n();return!t(e,o)}catch(e){return!0}}var l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),l=o({inst:{value:n,getSnapshot:t}}),c=l[0].inst,u=l[1];return i((function(){c.value=n,c.getSnapshot=t,s(c)&&u({inst:c})}),[e,n,t]),r((function(){return s(c)&&u({inst:c}),e((function(){s(c)&&u({inst:c})}))}),[e]),a(n),n};return bi.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:l,bi}()),wi.exports} +/** + * @license React + * use-sync-external-store-shim/with-selector.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */vi.exports=function(){if(yi)return xi;yi=1;var e=n,t=Si(),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=t.useSyncExternalStore,i=e.useRef,a=e.useEffect,s=e.useMemo,l=e.useDebugValue;return xi.useSyncExternalStoreWithSelector=function(e,t,n,c,u){var d=i(null);if(null===d.current){var h={hasValue:!1,value:null};d.current=h}else h=d.current;d=s((function(){function e(e){if(!a){if(a=!0,r=e,e=c(e),void 0!==u&&h.hasValue){var t=h.value;if(u(t,e))return i=t}return i=e}if(t=i,o(r,e))return t;var n=c(e);return void 0!==u&&u(t,n)?t:(r=e,i=n)}var r,i,a=!1,s=void 0===n?null:n;return[function(){return e(t())},null===s?void 0:function(){return e(s())}]}),[t,n,c,u]);var f=r(e,d[0],d[1]);return a((function(){h.hasValue=!0,h.value=f}),[f]),l(f),f},xi}();var Ci=gi(vi.exports);const Ei=e=>{let t;const n=new Set,o=(e,o)=>{const r="function"==typeof e?e(t):e;if(!Object.is(r,t)){const e=t;t=(null!=o?o:"object"!=typeof r)?r:Object.assign({},t,r),n.forEach((n=>n(t,e)))}},r=()=>t,i={setState:o,getState:r,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(o,r,i),i},{useSyncExternalStoreWithSelector:ki}=Ci;function Mi(e,t=e.getState,o){const r=ki(e.subscribe,e.getState,e.getServerState||e.getState,t,o);return n.useDebugValue(r),r}const Ni=(e,t)=>{const n=(e=>e?Ei(e):Ei)(e),o=(e,o=t)=>Mi(n,e,o);return Object.assign(o,n),o},_i=n.createContext(null),Pi=_i.Provider,zi=oo.error001();function Oi(e,t){const o=n.useContext(_i);if(null===o)throw new Error(zi);return Mi(o,e,t)}function Ai(){const e=n.useContext(_i);if(null===e)throw new Error(zi);return n.useMemo((()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe})),[e])}const Ii={display:"none"},Ri={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Di="react-flow__node-desc",Li="react-flow__edge-desc",$i="react-flow__aria-live",Vi=e=>e.ariaLiveMessage,Bi=e=>e.ariaLabelConfig;function Ti({rfId:e}){const n=Oi(Vi);return t.jsx("div",{id:`${$i}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Ri,children:n})}function ji({rfId:e,disableKeyboardA11y:n}){const o=Oi(Bi);return t.jsxs(t.Fragment,{children:[t.jsx("div",{id:`${Di}-${e}`,style:Ii,children:n?o["node.a11yDescription.default"]:o["node.a11yDescription.keyboardDisabled"]}),t.jsx("div",{id:`${Li}-${e}`,style:Ii,children:o["edge.a11yDescription.default"]}),!n&&t.jsx(Ti,{rfId:e})]})}const Hi=e=>e.userSelectionActive?"none":"all",Zi=n.forwardRef((({position:e="top-left",children:n,className:o,style:i,...a},s)=>{const l=Oi(Hi),c=`${e}`.split("-");return t.jsx("div",{className:r(["react-flow__panel",o,...c]),style:{...i,pointerEvents:l},ref:s,...a,children:n})}));function Xi({proOptions:e,position:n="bottom-right"}){return e?.hideAttribution?null:t.jsx(Zi,{position:n,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:t.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}function Yi(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[n,o]of e)if(!Object.is(o,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let o=0;o{const t=[],n=[];for(const[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(const[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},Wi=e=>e.id;function Ki(e,t){return Yi(e.selectedNodes.map(Wi),t.selectedNodes.map(Wi))&&Yi(e.selectedEdges.map(Wi),t.selectedEdges.map(Wi))}function Gi({onSelectionChange:e}){const t=Ai(),{selectedNodes:o,selectedEdges:r}=Oi(Fi,Ki);return n.useEffect((()=>{const n={nodes:o,edges:r};e?.(n),t.getState().onSelectionChangeHandlers.forEach((e=>e(n)))}),[o,r,e]),null}const qi=e=>!!e.onSelectionChangeHandlers;function Ui({onSelectionChange:e}){const n=Oi(qi);return e||n?t.jsx(Gi,{onSelectionChange:e}):null}const Qi=[0,0],Ji={x:0,y:0,zoom:1},ea=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","onBeforeDelete","debug","autoPanSpeed","paneClickDistance","ariaLabelConfig","rfId"],ta=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setPaneClickDistance:e.setPaneClickDistance}),na={translateExtent:ro,nodeOrigin:Qi,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function oa(e){const{setNodes:t,setEdges:o,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:s,reset:l,setDefaultNodesAndEdges:c,setPaneClickDistance:u}=Oi(ta,Yi),d=Ai();n.useEffect((()=>(c(e.defaultNodes,e.defaultEdges),()=>{h.current=na,l()})),[]);const h=n.useRef(na);return n.useEffect((()=>{for(const l of ea){const c=e[l];c!==h.current[l]&&(void 0!==e[l]&&("nodes"===l?t(c):"edges"===l?o(c):"minZoom"===l?r(c):"maxZoom"===l?i(c):"translateExtent"===l?a(c):"nodeExtent"===l?s(c):"paneClickDistance"===l?u(c):"fitView"===l?d.setState({fitViewQueued:c}):"fitViewOptions"===l&&d.setState({fitViewOptions:c}),"ariaLabelConfig"===l?d.setState({ariaLabelConfig:(n=c,{...ao,...n||{}})}):d.setState({[l]:c})))}var n;h.current=e}),ea.map((t=>e[t]))),null}function ra(){return"undefined"!=typeof window&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}const ia="undefined"!=typeof document?document:null;function aa(e=null,t={target:ia,actInsideInputWithModifier:!0}){const[o,r]=n.useState(!1),i=n.useRef(!1),a=n.useRef(new Set([])),[s,l]=n.useMemo((()=>{if(null!==e){const t=(Array.isArray(e)?e:[e]).filter((e=>"string"==typeof e)).map((e=>e.replace("+","\n").replace("\n\n","\n+").split("\n"))),n=t.reduce(((e,t)=>e.concat(...t)),[]);return[t,n]}return[[],[]]}),[e]);return n.useEffect((()=>{const n=t?.target??ia,o=t?.actInsideInputWithModifier??!0;if(null!==e){const e=e=>{i.current=e.ctrlKey||e.metaKey||e.shiftKey||e.altKey;if((!i.current||i.current&&!o)&&rr(e))return!1;const n=la(e.code,l);if(a.current.add(e[n]),sa(s,a.current,!1)){const n=e.composedPath?.()?.[0]||e.target,o="BUTTON"===n?.nodeName||"A"===n?.nodeName;!1===t.preventDefault||!i.current&&o||e.preventDefault(),r(!0)}},c=e=>{const t=la(e.code,l);sa(s,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(e[t]),"Meta"===e.key&&a.current.clear(),i.current=!1},u=()=>{a.current.clear(),r(!1)};return n?.addEventListener("keydown",e),n?.addEventListener("keyup",c),window.addEventListener("blur",u),window.addEventListener("contextmenu",u),()=>{n?.removeEventListener("keydown",e),n?.removeEventListener("keyup",c),window.removeEventListener("blur",u),window.removeEventListener("contextmenu",u)}}}),[e,r]),o}function sa(e,t,n){return e.filter((e=>n||e.length===t.size)).some((e=>e.every((e=>t.has(e)))))}function la(e,t){return t.includes(e)?"code":"key"}const ca=()=>{const e=Ai();return n.useMemo((()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:o}=e.getState();return o?o.scaleTo(t,{duration:n?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[o,r,i],panZoom:a}=e.getState();return a?(await a.setViewport({x:t.x??o,y:t.y??r,zoom:t.zoom??i},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,o]=e.getState().transform;return{x:t,y:n,zoom:o}},setCenter:async(t,n,o)=>e.getState().setCenter(t,n,o),fitBounds:async(t,n)=>{const{width:o,height:r,minZoom:i,maxZoom:a,panZoom:s}=e.getState(),l=Wo(t,o,r,i,a,n?.padding??.1);return s?(await s.setViewport(l,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:o,snapGrid:r,snapToGrid:i,domNode:a}=e.getState();if(!a)return t;const{x:s,y:l}=a.getBoundingClientRect(),c={x:t.x-s,y:t.y-l},u=n.snapGrid??r,d=n.snapToGrid??i;return Xo(c,o,d,u)},flowToScreenPosition:t=>{const{transform:n,domNode:o}=e.getState();if(!o)return t;const{x:r,y:i}=o.getBoundingClientRect(),a=Yo(t,n);return{x:a.x+r,y:a.y+i}}})),[])};function ua(e,t){const n=[],o=new Map,r=[];for(const t of e)if("add"!==t.type)if("remove"===t.type||"replace"===t.type)o.set(t.id,[t]);else{const e=o.get(t.id);e?e.push(t):o.set(t.id,[t])}else r.push(t);for(const e of t){const t=o.get(e.id);if(!t){n.push(e);continue}if("remove"===t[0].type)continue;if("replace"===t[0].type){n.push({...t[0].item});continue}const r={...e};for(const e of t)da(e,r);n.push(r)}return r.length&&r.forEach((e=>{void 0!==e.index?n.splice(e.index,0,{...e.item}):n.push({...e.item})})),n}function da(e,t){switch(e.type){case"select":t.selected=e.selected;break;case"position":void 0!==e.position&&(t.position=e.position),void 0!==e.dragging&&(t.dragging=e.dragging);break;case"dimensions":void 0!==e.dimensions&&(t.measured??={},t.measured.width=e.dimensions.width,t.measured.height=e.dimensions.height,e.setAttributes&&(!0!==e.setAttributes&&"width"!==e.setAttributes||(t.width=e.dimensions.width),!0!==e.setAttributes&&"height"!==e.setAttributes||(t.height=e.dimensions.height))),"boolean"==typeof e.resizing&&(t.resizing=e.resizing)}}function ha(e,t){return ua(e,t)}function fa(e,t){return ua(e,t)}function ga(e,t){return{id:e,type:"select",selected:t}}function pa(e,t=new Set,n=!1){const o=[];for(const[r,i]of e){const e=t.has(r);void 0===i.selected&&!e||i.selected===e||(n&&(i.selected=e),o.push(ga(i.id,e)))}return o}function ma({items:e=[],lookup:t}){const n=[],o=new Map(e.map((e=>[e.id,e])));for(const[o,r]of e.entries()){const e=t.get(r.id),i=e?.internals?.userNode??e;void 0!==i&&i!==r&&n.push({id:r.id,item:r,type:"replace"}),void 0===i&&n.push({item:r,type:"add",index:o})}for(const[e]of t){void 0===o.get(e)&&n.push({id:e,type:"remove"})}return n}function ya(e){return{id:e.id,type:"remove"}}const va=e=>(e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e))(e),xa=e=>xo(e);function wa(e){return n.forwardRef(e)}const ba="undefined"!=typeof window?n.useLayoutEffect:n.useEffect;function Sa(e){const[t,o]=n.useState(BigInt(0)),[r]=n.useState((()=>function(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}((()=>o((e=>e+BigInt(1)))))));return ba((()=>{const t=r.get();t.length&&(e(t),r.reset())}),[t]),r}const Ca=n.createContext(null);function Ea({children:e}){const o=Ai(),r=Sa(n.useCallback((e=>{const{nodes:t=[],setNodes:n,hasDefaultNodes:r,onNodesChange:i,nodeLookup:a,fitViewQueued:s}=o.getState();let l=t;for(const t of e)l="function"==typeof t?t(l):t;const c=ma({items:l,lookup:a});r&&n(l),c.length>0?i?.(c):s&&window.requestAnimationFrame((()=>{const{fitViewQueued:e,nodes:t,setNodes:n}=o.getState();e&&n(t)}))}),[])),i=Sa(n.useCallback((e=>{const{edges:t=[],setEdges:n,hasDefaultEdges:r,onEdgesChange:i,edgeLookup:a}=o.getState();let s=t;for(const t of e)s="function"==typeof t?t(s):t;r?n(s):i&&i(ma({items:s,lookup:a}))}),[])),a=n.useMemo((()=>({nodeQueue:r,edgeQueue:i})),[]);return t.jsx(Ca.Provider,{value:a,children:e})}const ka=e=>!!e.panZoom;function Ma(){const e=ca(),t=Ai(),o=function(){const e=n.useContext(Ca);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}(),r=Oi(ka),i=n.useMemo((()=>{const e=e=>t.getState().nodeLookup.get(e),n=e=>{o.nodeQueue.push(e)},r=e=>{o.edgeQueue.push(e)},i=e=>{const{nodeLookup:n,nodeOrigin:o}=t.getState(),r=va(e)?e:n.get(e.id),i=r.parentId?Qo(r.position,r.measured,r.parentId,n,o):r.position,a={...r,position:i,width:r.measured?.width??r.width,height:r.measured?.height??r.height};return Lo(a)},a=(e,t,o={replace:!1})=>{n((n=>n.map((n=>{if(n.id===e){const e="function"==typeof t?t(n):t;return o.replace&&va(e)?e:{...n,...e}}return n}))))},s=(e,t,n={replace:!1})=>{r((o=>o.map((o=>{if(o.id===e){const e="function"==typeof t?t(o):t;return n.replace&&xa(e)?e:{...o,...e}}return o}))))};return{getNodes:()=>t.getState().nodes.map((e=>({...e}))),getNode:t=>e(t)?.internals.userNode,getInternalNode:e,getEdges:()=>{const{edges:e=[]}=t.getState();return e.map((e=>({...e})))},getEdge:e=>t.getState().edgeLookup.get(e),setNodes:n,setEdges:r,addNodes:e=>{const t=Array.isArray(e)?e:[e];o.nodeQueue.push((e=>[...e,...t]))},addEdges:e=>{const t=Array.isArray(e)?e:[e];o.edgeQueue.push((e=>[...e,...t]))},toObject:()=>{const{nodes:e=[],edges:n=[],transform:o}=t.getState(),[r,i,a]=o;return{nodes:e.map((e=>({...e}))),edges:n.map((e=>({...e}))),viewport:{x:r,y:i,zoom:a}}},deleteElements:async({nodes:e=[],edges:n=[]})=>{const{nodes:o,edges:r,onNodesDelete:i,onEdgesDelete:a,triggerNodeChanges:s,triggerEdgeChanges:l,onDelete:c,onBeforeDelete:u}=t.getState(),{nodes:d,edges:h}=await async function({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:o,onBeforeDelete:r}){const i=new Set(e.map((e=>e.id))),a=[];for(const e of n){if(!1===e.deletable)continue;const t=i.has(e.id),n=!t&&e.parentId&&a.find((t=>t.id===e.parentId));(t||n)&&a.push(e)}const s=new Set(t.map((e=>e.id))),l=o.filter((e=>!1!==e.deletable)),c=ko(a,l);for(const e of l)s.has(e.id)&&!c.find((t=>t.id===e.id))&&c.push(e);if(!r)return{edges:c,nodes:a};const u=await r({nodes:a,edges:c});return"boolean"==typeof u?u?{edges:c,nodes:a}:{edges:[],nodes:[]}:u}({nodesToRemove:e,edgesToRemove:n,nodes:o,edges:r,onBeforeDelete:u}),f=h.length>0,g=d.length>0;if(f){const e=h.map(ya);a?.(h),l(e)}if(g){const e=d.map(ya);i?.(d),s(e)}return(g||f)&&c?.({nodes:d,edges:h}),{deletedNodes:d,deletedEdges:h}},getIntersectingNodes:(e,n=!0,o)=>{const r=To(e),a=r?e:i(e),s=void 0!==o;return a?(o||t.getState().nodes).filter((o=>{const i=t.getState().nodeLookup.get(o.id);if(i&&!r&&(o.id===e.id||!i.internals.positionAbsolute))return!1;const l=Lo(s?o:i),c=Bo(l,a);return n&&c>0||c>=a.width*a.height})):[]},isNodeIntersecting:(e,t,n=!0)=>{const o=To(e)?e:i(e);if(!o)return!1;const r=Bo(o,t);return n&&r>0||r>=o.width*o.height},updateNode:a,updateNodeData:(e,t,n={replace:!1})=>{a(e,(e=>{const o="function"==typeof t?t(e):t;return n.replace?{...e,data:o}:{...e,data:{...e.data,...o}}}),n)},updateEdge:s,updateEdgeData:(e,t,n={replace:!1})=>{s(e,(e=>{const o="function"==typeof t?t(e):t;return n.replace?{...e,data:o}:{...e,data:{...e.data,...o}}}),n)},getNodesBounds:e=>{const{nodeLookup:n,nodeOrigin:o}=t.getState();return So(e,{nodeLookup:n,nodeOrigin:o})},getHandleConnections:({type:e,id:n,nodeId:o})=>Array.from(t.getState().connectionLookup.get(`${o}-${e}${n?`-${n}`:""}`)?.values()??[]),getNodeConnections:({type:e,handleId:n,nodeId:o})=>Array.from(t.getState().connectionLookup.get(`${o}${e?n?`-${e}-${n}`:`-${e}`:""}`)?.values()??[]),fitView:async e=>{const n=t.getState().fitViewResolver??function(){let e,t;return{promise:new Promise(((n,o)=>{e=n,t=o})),resolve:e,reject:t}}();return t.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:n}),o.nodeQueue.push((e=>[...e])),n.promise}}}),[]);return n.useMemo((()=>({...i,...e,viewportInitialized:r})),[r])}const Na=e=>e.selected,_a="undefined"!=typeof window?window:void 0;const Pa={position:"absolute",width:"100%",height:"100%",top:0,left:0},za=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function Oa({onPaneContextMenu:o,zoomOnScroll:r=!0,zoomOnPinch:i=!0,panOnScroll:a=!1,panOnScrollSpeed:s=.5,panOnScrollMode:l=e.PanOnScrollMode.Free,zoomOnDoubleClick:c=!0,panOnDrag:u=!0,defaultViewport:d,translateExtent:h,minZoom:f,maxZoom:g,zoomActivationKeyCode:p,preventScrolling:m=!0,children:y,noWheelClassName:v,noPanClassName:x,onViewportChange:w,isControlledViewport:b,paneClickDistance:S}){const C=Ai(),E=n.useRef(null),{userSelectionActive:k,lib:M}=Oi(za,Yi),N=aa(p),_=n.useRef();!function(e){const t=Ai();n.useEffect((()=>{const n=()=>{if(!e.current)return!1;const n=tr(e.current);0!==n.height&&0!==n.width||t.getState().onError?.("004",oo.error004()),t.setState({width:n.width||500,height:n.height||500})};if(e.current){n(),window.addEventListener("resize",n);const t=new ResizeObserver((()=>n()));return t.observe(e.current),()=>{window.removeEventListener("resize",n),t&&e.current&&t.unobserve(e.current)}}}),[])}(E);const P=n.useCallback((e=>{w?.({x:e[0],y:e[1],zoom:e[2]}),b||C.setState({transform:e})}),[w,b]);return n.useEffect((()=>{if(E.current){_.current=ni({domNode:E.current,minZoom:f,maxZoom:g,translateExtent:h,viewport:d,paneClickDistance:S,onDraggingChange:e=>C.setState({paneDragging:e}),onPanZoomStart:(e,t)=>{const{onViewportChangeStart:n,onMoveStart:o}=C.getState();o?.(e,t),n?.(t)},onPanZoom:(e,t)=>{const{onViewportChange:n,onMove:o}=C.getState();o?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{const{onViewportChangeEnd:n,onMoveEnd:o}=C.getState();o?.(e,t),n?.(t)}});const{x:e,y:t,zoom:n}=_.current.getViewport();return C.setState({panZoom:_.current,transform:[e,t,n],domNode:E.current.closest(".react-flow")}),()=>{_.current?.destroy()}}}),[]),n.useEffect((()=>{_.current?.update({onPaneContextMenu:o,zoomOnScroll:r,zoomOnPinch:i,panOnScroll:a,panOnScrollSpeed:s,panOnScrollMode:l,zoomOnDoubleClick:c,panOnDrag:u,zoomActivationKeyPressed:N,preventScrolling:m,noPanClassName:x,userSelectionActive:k,noWheelClassName:v,lib:M,onTransformChange:P})}),[o,r,i,a,s,l,c,u,N,m,x,k,v,M,P]),t.jsx("div",{className:"react-flow__renderer",ref:E,style:Pa,children:y})}const Aa=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Ia(){const{userSelectionActive:e,userSelectionRect:n}=Oi(Aa,Yi);return e&&n?t.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}const Ra=(e,t)=>n=>{n.target===t.current&&e?.(n)},Da=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function La({isSelecting:o,selectionKeyPressed:i,selectionMode:a=e.SelectionMode.Full,panOnDrag:s,selectionOnDrag:l,onSelectionStart:c,onSelectionEnd:u,onPaneClick:d,onPaneContextMenu:h,onPaneScroll:f,onPaneMouseEnter:g,onPaneMouseMove:p,onPaneMouseLeave:m,children:y}){const v=Ai(),{userSelectionActive:x,elementsSelectable:w,dragging:b,connectionInProgress:S}=Oi(Da,Yi),C=w&&(o||x),E=n.useRef(null),k=n.useRef(),M=n.useRef(new Set),N=n.useRef(new Set),_=n.useRef(!1),P=n.useRef(!1),z=e=>{_.current||S?_.current=!1:(d?.(e),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1}))},O=f?e=>f(e):void 0,A=!0===s||Array.isArray(s)&&s.includes(0);return t.jsxs("div",{className:r(["react-flow__pane",{draggable:A,dragging:b,selection:o}]),onClick:C?void 0:Ra(z,E),onContextMenu:Ra((e=>{Array.isArray(s)&&s?.includes(2)?e.preventDefault():h?.(e)}),E),onWheel:Ra(O,E),onPointerEnter:C?void 0:g,onPointerDown:C?e=>{const{resetSelectedElements:t,domNode:n}=v.getState();if(k.current=n?.getBoundingClientRect(),!w||!o||0!==e.button||e.target!==E.current||!k.current)return;e.target?.setPointerCapture?.(e.pointerId),P.current=!0,_.current=!1;const{x:r,y:i}=ar(e.nativeEvent,k.current);t(),v.setState({userSelectionRect:{width:0,height:0,startX:r,startY:i,x:r,y:i}}),c?.(e)}:p,onPointerMove:C?t=>{const{userSelectionRect:n,transform:o,nodeLookup:r,edgeLookup:i,connectionLookup:s,triggerNodeChanges:l,triggerEdgeChanges:c,defaultEdgeOptions:u}=v.getState();if(!k.current||!n)return;_.current=!0;const{x:d,y:h}=ar(t.nativeEvent,k.current),{startX:f,startY:g}=n,p={startX:f,startY:g,x:de.id))),N.current=new Set;const x=u?.selectable??!0;for(const e of M.current){const t=s.get(e);if(t)for(const{edgeId:e}of t.values()){const t=i.get(e);t&&(t.selectable??x)&&N.current.add(e)}}if(!Jo(m,M.current)){l(pa(r,M.current,!0))}if(!Jo(y,N.current)){c(pa(i,N.current))}v.setState({userSelectionRect:p,userSelectionActive:!0,nodesSelectionActive:!1})}:p,onPointerUp:C?e=>{if(0!==e.button||!P.current)return;e.target?.releasePointerCapture?.(e.pointerId);const{userSelectionRect:t}=v.getState();!x&&t&&e.target===E.current&&z?.(e),v.setState({userSelectionActive:!1,userSelectionRect:null,nodesSelectionActive:M.current.size>0}),u?.(e),(i||l)&&(_.current=!1),P.current=!1}:void 0,onPointerLeave:m,ref:E,style:Pa,children:[y,t.jsx(Ia,{})]})}function $a({id:e,store:t,unselect:n=!1,nodeRef:o}){const{addSelectedNodes:r,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:s,onError:l}=t.getState(),c=s.get(e);c?(t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&a)&&(i({nodes:[c],edges:[]}),requestAnimationFrame((()=>o?.current?.blur()))):r([e])):l?.("012",oo.error012(e))}function Va({nodeRef:e,disabled:t=!1,noDragClassName:o,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:s}){const l=Ai(),[c,u]=n.useState(!1),d=n.useRef();return n.useEffect((()=>{d.current=Tr({getStoreItems:()=>l.getState(),onNodeMouseDown:t=>{$a({id:t,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})}),[]),n.useEffect((()=>{if(t)d.current?.destroy();else if(e.current)return d.current?.update({noDragClassName:o,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:s}),()=>{d.current?.destroy()}}),[o,r,t,a,e,i]),c}const Ba=e=>t=>t.selected&&(t.draggable||e&&void 0===t.draggable);function Ta(){const e=Ai();return n.useCallback((t=>{const{nodeExtent:n,snapToGrid:o,snapGrid:r,nodesDraggable:i,onError:a,updateNodePositions:s,nodeLookup:l,nodeOrigin:c}=e.getState(),u=new Map,d=Ba(i),h=o?r[0]:5,f=o?r[1]:5,g=t.direction.x*h*t.factor,p=t.direction.y*f*t.factor;for(const[,e]of l){if(!d(e))continue;let t={x:e.internals.positionAbsolute.x+g,y:e.internals.positionAbsolute.y+p};o&&(t=Zo(t,r));const{position:i,positionAbsolute:s}=No({nodeId:e.id,nextPosition:t,nodeLookup:l,nodeExtent:n,nodeOrigin:c,onError:a});e.position=i,e.internals.positionAbsolute=s,u.set(e.id,e)}s(u)}),[])}const ja=n.createContext(null),Ha=ja.Provider;ja.Consumer;const Za=()=>n.useContext(ja),Xa=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId});const Ya=n.memo(wa((function({type:n="source",position:o=e.Position.Top,isValidConnection:i,isConnectable:a=!0,isConnectableStart:s=!0,isConnectableEnd:l=!0,id:c,onConnect:u,children:d,className:h,onMouseDown:f,onTouchStart:g,...p},m){const y=c||null,v="target"===n,x=Ai(),w=Za(),{connectOnClick:b,noPanClassName:S,rfId:C}=Oi(Xa,Yi),{connectingFrom:E,connectingTo:k,clickConnecting:M,isPossibleEndHandle:N,connectionInProcess:_,clickConnectionInProcess:P,valid:z}=Oi(((t,n,o)=>r=>{const{connectionClickStartHandle:i,connectionMode:a,connection:s}=r,{fromHandle:l,toHandle:c,isValid:u}=s,d=c?.nodeId===t&&c?.id===n&&c?.type===o;return{connectingFrom:l?.nodeId===t&&l?.id===n&&l?.type===o,connectingTo:d,clickConnecting:i?.nodeId===t&&i?.id===n&&i?.type===o,isPossibleEndHandle:a===e.ConnectionMode.Strict?l?.type!==o:t!==l?.nodeId||n!==l?.id,connectionInProcess:!!l,clickConnectionInProcess:!!i,valid:d&&u}})(w,y,n),Yi);w||x.getState().onError?.("010",oo.error010());const O=e=>{const{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:o}=x.getState(),r={...t,...e};if(o){const{edges:e,setEdges:t}=x.getState();t(pr(r,e))}n?.(r),u?.(r)},A=e=>{if(!w)return;const t=ir(e.nativeEvent);if(s&&(t&&0===e.button||!t)){const t=x.getState();Wr.onPointerDown(e.nativeEvent,{autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:v,handleId:y,nodeId:w,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:t.onConnectEnd,updateConnection:t.updateConnection,onConnect:O,isValidConnection:i||t.isValidConnection,getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed})}t?f?.(e):g?.(e)};return t.jsx("div",{"data-handleid":y,"data-nodeid":w,"data-handlepos":o,"data-id":`${C}-${w}-${y}-${n}`,className:r(["react-flow__handle",`react-flow__handle-${o}`,"nodrag",S,h,{source:!v,target:v,connectable:a,connectablestart:s,connectableend:l,clickconnecting:M,connectingfrom:E,connectingto:k,valid:z,connectionindicator:a&&(!_||N)&&(_||P?l:s)}]),onMouseDown:A,onTouchStart:A,onClick:b?e=>{const{onClickConnectStart:t,onClickConnectEnd:o,connectionClickStartHandle:r,connectionMode:a,isValidConnection:l,lib:c,rfId:u,nodeLookup:d,connection:h}=x.getState();if(!w||!r&&!s)return;if(!r)return t?.(e.nativeEvent,{nodeId:w,handleId:y,handleType:n}),void x.setState({connectionClickStartHandle:{nodeId:w,type:n,id:y}});const f=nr(e.target),g=i||l,{connection:p,isValid:m}=Wr.isValid(e.nativeEvent,{handle:{nodeId:w,id:y,type:n},connectionMode:a,fromNodeId:r.nodeId,fromHandleId:r.id||null,fromType:r.type,isValidConnection:g,flowId:u,doc:f,lib:c,nodeLookup:d});m&&p&&O(p);const v=structuredClone(h);delete v.inProgress,v.toPosition=v.toHandle?v.toHandle.position:null,o?.(e,v),x.setState({connectionClickStartHandle:null})}:void 0,ref:m,...p,children:d})})));const Fa={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Wa={input:function({data:n,isConnectable:o,sourcePosition:r=e.Position.Bottom}){return t.jsxs(t.Fragment,{children:[n?.label,t.jsx(Ya,{type:"source",position:r,isConnectable:o})]})},default:function({data:n,isConnectable:o,targetPosition:r=e.Position.Top,sourcePosition:i=e.Position.Bottom}){return t.jsxs(t.Fragment,{children:[t.jsx(Ya,{type:"target",position:r,isConnectable:o}),n?.label,t.jsx(Ya,{type:"source",position:i,isConnectable:o})]})},output:function({data:n,isConnectable:o,targetPosition:r=e.Position.Top}){return t.jsxs(t.Fragment,{children:[t.jsx(Ya,{type:"target",position:r,isConnectable:o}),n?.label]})},group:function(){return null}};const Ka=e=>{const{width:t,height:n,x:o,y:r}=Co(e.nodeLookup,{filter:e=>!!e.selected});return{width:jo(t)?t:null,height:jo(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${o}px,${r}px)`}};function Ga({onSelectionContextMenu:e,noPanClassName:o,disableKeyboardA11y:i}){const a=Ai(),{width:s,height:l,transformString:c,userSelectionActive:u}=Oi(Ka,Yi),d=Ta(),h=n.useRef(null);if(n.useEffect((()=>{i||h.current?.focus({preventScroll:!0})}),[i]),Va({nodeRef:h}),u||!s||!l)return null;const f=e?t=>{const n=a.getState().nodes.filter((e=>e.selected));e(t,n)}:void 0;return t.jsx("div",{className:r(["react-flow__nodesselection","react-flow__container",o]),style:{transform:c},children:t.jsx("div",{ref:h,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:i?void 0:-1,onKeyDown:i?void 0:e=>{Object.prototype.hasOwnProperty.call(Fa,e.key)&&(e.preventDefault(),d({direction:Fa[e.key],factor:e.shiftKey?4:1}))},style:{width:s,height:l}})})}const qa="undefined"!=typeof window?window:void 0,Ua=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Qa({children:e,onPaneClick:o,onPaneMouseEnter:r,onPaneMouseMove:i,onPaneMouseLeave:a,onPaneContextMenu:s,onPaneScroll:l,paneClickDistance:c,deleteKeyCode:u,selectionKeyCode:d,selectionOnDrag:h,selectionMode:f,onSelectionStart:g,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:y,zoomActivationKeyCode:v,elementsSelectable:x,zoomOnScroll:w,zoomOnPinch:b,panOnScroll:S,panOnScrollSpeed:C,panOnScrollMode:E,zoomOnDoubleClick:k,panOnDrag:M,defaultViewport:N,translateExtent:_,minZoom:P,maxZoom:z,preventScrolling:O,onSelectionContextMenu:A,noWheelClassName:I,noPanClassName:R,disableKeyboardA11y:D,onViewportChange:L,isControlledViewport:$}){const{nodesSelectionActive:V,userSelectionActive:B}=Oi(Ua),T=aa(d,{target:qa}),j=aa(y,{target:qa}),H=j||M,Z=j||S,X=h&&!0!==H,Y=T||B||X;return function({deleteKeyCode:e,multiSelectionKeyCode:t}){const o=Ai(),{deleteElements:r}=Ma(),i=aa(e,{actInsideInputWithModifier:!1}),a=aa(t,{target:_a});n.useEffect((()=>{if(i){const{edges:e,nodes:t}=o.getState();r({nodes:t.filter(Na),edges:e.filter(Na)}),o.setState({nodesSelectionActive:!1})}}),[i]),n.useEffect((()=>{o.setState({multiSelectionActive:a})}),[a])}({deleteKeyCode:u,multiSelectionKeyCode:m}),t.jsx(Oa,{onPaneContextMenu:s,elementsSelectable:x,zoomOnScroll:w,zoomOnPinch:b,panOnScroll:Z,panOnScrollSpeed:C,panOnScrollMode:E,zoomOnDoubleClick:k,panOnDrag:!T&&H,defaultViewport:N,translateExtent:_,minZoom:P,maxZoom:z,zoomActivationKeyCode:v,preventScrolling:O,noWheelClassName:I,noPanClassName:R,onViewportChange:L,isControlledViewport:$,paneClickDistance:c,children:t.jsxs(La,{onSelectionStart:g,onSelectionEnd:p,onPaneClick:o,onPaneMouseEnter:r,onPaneMouseMove:i,onPaneMouseLeave:a,onPaneContextMenu:s,onPaneScroll:l,panOnDrag:H,isSelecting:!!Y,selectionMode:f,selectionKeyPressed:T,selectionOnDrag:X,children:[e,V&&t.jsx(Ga,{onSelectionContextMenu:A,noPanClassName:R,disableKeyboardA11y:D})]})})}Qa.displayName="FlowRenderer";const Ja=n.memo(Qa),es=e=>t=>e?Eo(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map((e=>e.id)):Array.from(t.nodeLookup.keys());const ts=e=>e.updateNodeInternals;function ns({id:e,onClick:o,onMouseEnter:i,onMouseMove:a,onMouseLeave:s,onContextMenu:l,onDoubleClick:c,nodesDraggable:u,elementsSelectable:d,nodesConnectable:h,nodesFocusable:f,resizeObserver:g,noDragClassName:p,noPanClassName:m,disableKeyboardA11y:y,rfId:v,nodeTypes:x,nodeClickDistance:w,onError:b}){const{node:S,internals:C,isParent:E}=Oi((t=>{const n=t.nodeLookup.get(e),o=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:o}}),Yi);let k=S.type||"default",M=x?.[k]||Wa[k];void 0===M&&(b?.("003",oo.error003(k)),k="default",M=Wa.default);const N=!!(S.draggable||u&&void 0===S.draggable),_=!!(S.selectable||d&&void 0===S.selectable),P=!!(S.connectable||h&&void 0===S.connectable),z=!!(S.focusable||f&&void 0===S.focusable),O=Ai(),A=Uo(S),I=function({node:e,nodeType:t,hasDimensions:o,resizeObserver:r}){const i=Ai(),a=n.useRef(null),s=n.useRef(null),l=n.useRef(e.sourcePosition),c=n.useRef(e.targetPosition),u=n.useRef(t),d=o&&!!e.internals.handleBounds;return n.useEffect((()=>{!a.current||e.hidden||d&&s.current===a.current||(s.current&&r?.unobserve(s.current),r?.observe(a.current),s.current=a.current)}),[d,e.hidden]),n.useEffect((()=>()=>{s.current&&(r?.unobserve(s.current),s.current=null)}),[]),n.useEffect((()=>{if(a.current){const n=u.current!==t,o=l.current!==e.sourcePosition,r=c.current!==e.targetPosition;(n||o||r)&&(u.current=t,l.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}}),[e.id,t,e.sourcePosition,e.targetPosition]),a}({node:S,nodeType:k,hasDimensions:A,resizeObserver:g}),R=Va({nodeRef:I,disabled:S.hidden||!N,noDragClassName:p,handleSelector:S.dragHandle,nodeId:e,isSelectable:_,nodeClickDistance:w}),D=Ta();if(S.hidden)return null;const L=qo(S),$=function(e){return void 0===e.internals.handleBounds?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}(S),V=_||N||o||i||a||s,B=i?e=>i(e,{...C.userNode}):void 0,T=a?e=>a(e,{...C.userNode}):void 0,j=s?e=>s(e,{...C.userNode}):void 0,H=l?e=>l(e,{...C.userNode}):void 0,Z=c?e=>c(e,{...C.userNode}):void 0;return t.jsx("div",{className:r(["react-flow__node",`react-flow__node-${k}`,{[m]:N},S.className,{selected:S.selected,selectable:_,parent:E,draggable:N,dragging:R}]),ref:I,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:V?"all":"none",visibility:A?"visible":"hidden",...S.style,...$},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:B,onMouseMove:T,onMouseLeave:j,onContextMenu:H,onClick:t=>{const{selectNodesOnDrag:n,nodeDragThreshold:r}=O.getState();_&&(!n||!N||r>0)&&$a({id:e,store:O,nodeRef:I}),o&&o(t,{...C.userNode})},onDoubleClick:Z,onKeyDown:z?t=>{if(!rr(t.nativeEvent)&&!y)if(io.includes(t.key)&&_){const n="Escape"===t.key;$a({id:e,store:O,unselect:n,nodeRef:I})}else if(N&&S.selected&&Object.prototype.hasOwnProperty.call(Fa,t.key)){t.preventDefault();const{ariaLabelConfig:e}=O.getState();O.setState({ariaLiveMessage:e["node.a11yDescription.ariaLiveMessage"]({direction:t.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),D({direction:Fa[t.key],factor:t.shiftKey?4:1})}}:void 0,tabIndex:z?0:void 0,onFocus:z?()=>{if(y||!I.current?.matches(":focus-visible"))return;const{transform:t,width:n,height:o,autoPanOnNodeFocus:r,setCenter:i}=O.getState();if(!r)return;Eo(new Map([[e,S]]),{x:0,y:0,width:n,height:o},t,!0).length>0||i(S.position.x+L.width/2,S.position.y+L.height/2,{zoom:t[2]})}:void 0,role:S.ariaRole??(z?"group":void 0),"aria-roledescription":"node","aria-describedby":y?void 0:`${Di}-${v}`,"aria-label":S.ariaLabel,...S.domAttributes,children:t.jsx(Ha,{value:e,children:t.jsx(M,{id:e,data:S.data,type:k,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:S.selected??!1,selectable:_,draggable:N,deletable:S.deletable??!0,isConnectable:P,sourcePosition:S.sourcePosition,targetPosition:S.targetPosition,dragging:R,dragHandle:S.dragHandle,zIndex:C.z,parentId:S.parentId,...L})})})}const os=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function rs(e){const{nodesDraggable:o,nodesConnectable:r,nodesFocusable:i,elementsSelectable:a,onError:s}=Oi(os,Yi),l=(c=e.onlyRenderVisibleElements,Oi(n.useCallback(es(c),[c]),Yi));var c;const u=function(){const e=Oi(ts),[t]=n.useState((()=>"undefined"==typeof ResizeObserver?null:new ResizeObserver((t=>{const n=new Map;t.forEach((e=>{const t=e.target.getAttribute("data-id");n.set(t,{id:t,nodeElement:e.target,force:!0})})),e(n)}))));return n.useEffect((()=>()=>{t?.disconnect()}),[t]),t}();return t.jsx("div",{className:"react-flow__nodes",style:Pa,children:l.map((n=>t.jsx(ns,{id:n,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:u,nodesDraggable:o,nodesConnectable:r,nodesFocusable:i,elementsSelectable:a,nodeClickDistance:e.nodeClickDistance,onError:s},n)))})}rs.displayName="NodeRenderer";const is=n.memo(rs);const as={[e.MarkerType.Arrow]:({color:e="none",strokeWidth:n=1})=>t.jsx("polyline",{style:{stroke:e,strokeWidth:n},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),[e.MarkerType.ArrowClosed]:({color:e="none",strokeWidth:n=1})=>t.jsx("polyline",{style:{stroke:e,fill:e,strokeWidth:n},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})};const ss=({id:e,type:o,color:r,width:i=12.5,height:a=12.5,markerUnits:s="strokeWidth",strokeWidth:l,orient:c="auto-start-reverse"})=>{const u=function(e){const t=Ai();return n.useMemo((()=>Object.prototype.hasOwnProperty.call(as,e)?as[e]:(t.getState().onError?.("009",oo.error009(e)),null)),[e])}(o);return u?t.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${i}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:c,refX:"0",refY:"0",children:t.jsx(u,{color:r,strokeWidth:l})}):null},ls=({defaultColor:e,rfId:o})=>{const r=Oi((e=>e.edges)),i=Oi((e=>e.defaultEdgeOptions)),a=n.useMemo((()=>{const t=function(e,{id:t,defaultColor:n,defaultMarkerStart:o,defaultMarkerEnd:r}){const i=new Set;return e.reduce(((e,a)=>([a.markerStart||o,a.markerEnd||r].forEach((o=>{if(o&&"object"==typeof o){const r=kr(o,t);i.has(r)||(e.push({id:r,color:o.color||n,...o}),i.add(r))}})),e)),[]).sort(((e,t)=>e.id.localeCompare(t.id)))}(r,{id:o,defaultColor:e,defaultMarkerStart:i?.markerStart,defaultMarkerEnd:i?.markerEnd});return t}),[r,i,o,e]);return a.length?t.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:t.jsx("defs",{children:a.map((e=>t.jsx(ss,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id)))})}):null};ls.displayName="MarkerDefinitions";var cs=n.memo(ls);function us({x:e,y:o,label:i,labelStyle:a,labelShowBg:s=!0,labelBgStyle:l,labelBgPadding:c=[2,4],labelBgBorderRadius:u=2,children:d,className:h,...f}){const[g,p]=n.useState({x:1,y:0,width:0,height:0}),m=r(["react-flow__edge-textwrapper",h]),y=n.useRef(null);return n.useEffect((()=>{if(y.current){const e=y.current.getBBox();p({x:e.x,y:e.y,width:e.width,height:e.height})}}),[i]),i?t.jsxs("g",{transform:`translate(${e-g.width/2} ${o-g.height/2})`,className:m,visibility:g.width?"visible":"hidden",...f,children:[s&&t.jsx("rect",{width:g.width+2*c[0],x:-c[0],y:-c[1],height:g.height+2*c[1],className:"react-flow__edge-textbg",style:l,rx:u,ry:u}),t.jsx("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:y,style:a,children:i}),d]}):null}us.displayName="EdgeText";const ds=n.memo(us);function hs({path:e,labelX:n,labelY:o,label:i,labelStyle:a,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,interactionWidth:d=20,...h}){return t.jsxs(t.Fragment,{children:[t.jsx("path",{...h,d:e,fill:"none",className:r(["react-flow__edge-path",h.className])}),d&&t.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}),i&&jo(n)&&jo(o)?t.jsx(ds,{x:n,y:o,label:i,labelStyle:a,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u}):null]})}function fs({pos:t,x1:n,y1:o,x2:r,y2:i}){return t===e.Position.Left||t===e.Position.Right?[.5*(n+r),o]:[n,.5*(o+i)]}function gs({sourceX:t,sourceY:n,sourcePosition:o=e.Position.Bottom,targetX:r,targetY:i,targetPosition:a=e.Position.Top}){const[s,l]=fs({pos:o,x1:t,y1:n,x2:r,y2:i}),[c,u]=fs({pos:a,x1:r,y1:i,x2:t,y2:n}),[d,h,f,g]=lr({sourceX:t,sourceY:n,targetX:r,targetY:i,sourceControlX:s,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${t},${n} C${s},${l} ${c},${u} ${r},${i}`,d,h,f,g]}function ps(e){return n.memo((({id:n,sourceX:o,sourceY:r,targetX:i,targetY:a,sourcePosition:s,targetPosition:l,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:h,labelBgPadding:f,labelBgBorderRadius:g,style:p,markerEnd:m,markerStart:y,interactionWidth:v})=>{const[x,w,b]=gs({sourceX:o,sourceY:r,sourcePosition:s,targetX:i,targetY:a,targetPosition:l}),S=e.isInternal?void 0:n;return t.jsx(hs,{id:S,path:x,labelX:w,labelY:b,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:h,labelBgPadding:f,labelBgBorderRadius:g,style:p,markerEnd:m,markerStart:y,interactionWidth:v})}))}const ms=ps({isInternal:!1}),ys=ps({isInternal:!0});function vs(o){return n.memo((({id:n,sourceX:r,sourceY:i,targetX:a,targetY:s,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:f,style:g,sourcePosition:p=e.Position.Bottom,targetPosition:m=e.Position.Top,markerEnd:y,markerStart:v,pathOptions:x,interactionWidth:w})=>{const[b,S,C]=wr({sourceX:r,sourceY:i,sourcePosition:p,targetX:a,targetY:s,targetPosition:m,borderRadius:x?.borderRadius,offset:x?.offset}),E=o.isInternal?void 0:n;return t.jsx(hs,{id:E,path:b,labelX:S,labelY:C,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:f,style:g,markerEnd:y,markerStart:v,interactionWidth:w})}))}ms.displayName="SimpleBezierEdge",ys.displayName="SimpleBezierEdgeInternal";const xs=vs({isInternal:!1}),ws=vs({isInternal:!0});function bs(e){return n.memo((({id:o,...r})=>{const i=e.isInternal?void 0:o;return t.jsx(xs,{...r,id:i,pathOptions:n.useMemo((()=>({borderRadius:0,offset:r.pathOptions?.offset})),[r.pathOptions?.offset])})}))}xs.displayName="SmoothStepEdge",ws.displayName="SmoothStepEdgeInternal";const Ss=bs({isInternal:!1}),Cs=bs({isInternal:!0});function Es(e){return n.memo((({id:n,sourceX:o,sourceY:r,targetX:i,targetY:a,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:h,style:f,markerEnd:g,markerStart:p,interactionWidth:m})=>{const[y,v,x]=mr({sourceX:o,sourceY:r,targetX:i,targetY:a}),w=e.isInternal?void 0:n;return t.jsx(hs,{id:w,path:y,labelX:v,labelY:x,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:h,style:f,markerEnd:g,markerStart:p,interactionWidth:m})}))}Ss.displayName="StepEdge",Cs.displayName="StepEdgeInternal";const ks=Es({isInternal:!1}),Ms=Es({isInternal:!0});function Ns(o){return n.memo((({id:n,sourceX:r,sourceY:i,targetX:a,targetY:s,sourcePosition:l=e.Position.Bottom,targetPosition:c=e.Position.Top,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:p,style:m,markerEnd:y,markerStart:v,pathOptions:x,interactionWidth:w})=>{const[b,S,C]=dr({sourceX:r,sourceY:i,sourcePosition:l,targetX:a,targetY:s,targetPosition:c,curvature:x?.curvature}),E=o.isInternal?void 0:n;return t.jsx(hs,{id:E,path:b,labelX:S,labelY:C,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:p,style:m,markerEnd:y,markerStart:v,interactionWidth:w})}))}ks.displayName="StraightEdge",Ms.displayName="StraightEdgeInternal";const _s=Ns({isInternal:!1}),Ps=Ns({isInternal:!0});_s.displayName="BezierEdge",Ps.displayName="BezierEdgeInternal";const zs={default:Ps,straight:Ms,step:Cs,smoothstep:ws,simplebezier:ys},Os={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},As=(t,n,o)=>o===e.Position.Left?t-n:o===e.Position.Right?t+n:t,Is=(t,n,o)=>o===e.Position.Top?t-n:o===e.Position.Bottom?t+n:t,Rs="react-flow__edgeupdater";function Ds({position:e,centerX:n,centerY:o,radius:i=10,onMouseDown:a,onMouseEnter:s,onMouseOut:l,type:c}){return t.jsx("circle",{onMouseDown:a,onMouseEnter:s,onMouseOut:l,className:r([Rs,`${Rs}-${c}`]),cx:As(n,i,e),cy:Is(o,i,e),r:i,stroke:"transparent",fill:"transparent"})}function Ls({isReconnectable:e,reconnectRadius:n,edge:o,sourceX:r,sourceY:i,targetX:a,targetY:s,sourcePosition:l,targetPosition:c,onReconnect:u,onReconnectStart:d,onReconnectEnd:h,setReconnecting:f,setUpdateHover:g}){const p=Ai(),m=(e,t)=>{if(0!==e.button)return;const{autoPanOnConnect:n,domNode:r,isValidConnection:i,connectionMode:a,connectionRadius:s,lib:l,onConnectStart:c,onConnectEnd:g,cancelConnection:m,nodeLookup:y,rfId:v,panBy:x,updateConnection:w}=p.getState(),b="target"===t.type;f(!0),d?.(e,o,t.type);Wr.onPointerDown(e.nativeEvent,{autoPanOnConnect:n,connectionMode:a,connectionRadius:s,domNode:r,handleId:t.id,nodeId:t.nodeId,nodeLookup:y,isTarget:b,edgeUpdaterType:t.type,lib:l,flowId:v,cancelConnection:m,panBy:x,isValidConnection:i,onConnect:e=>u?.(o,e),onConnectStart:c,onConnectEnd:g,onReconnectEnd:(e,n)=>{f(!1),h?.(e,o,t.type,n)},updateConnection:w,getTransform:()=>p.getState().transform,getFromHandle:()=>p.getState().connection.fromHandle})},y=()=>g(!0),v=()=>g(!1);return t.jsxs(t.Fragment,{children:[(!0===e||"source"===e)&&t.jsx(Ds,{position:l,centerX:r,centerY:i,radius:n,onMouseDown:e=>m(e,{nodeId:o.target,id:o.targetHandle??null,type:"target"}),onMouseEnter:y,onMouseOut:v,type:"source"}),(!0===e||"target"===e)&&t.jsx(Ds,{position:c,centerX:a,centerY:s,radius:n,onMouseDown:e=>m(e,{nodeId:o.source,id:o.sourceHandle??null,type:"source"}),onMouseEnter:y,onMouseOut:v,type:"target"})]})}function $s({id:o,edgesFocusable:i,edgesReconnectable:a,elementsSelectable:s,onClick:l,onDoubleClick:c,onContextMenu:u,onMouseEnter:d,onMouseMove:h,onMouseLeave:f,reconnectRadius:g,onReconnect:p,onReconnectStart:m,onReconnectEnd:y,rfId:v,edgeTypes:x,noPanClassName:w,onError:b,disableKeyboardA11y:S}){let C=Oi((e=>e.edgeLookup.get(o)));const E=Oi((e=>e.defaultEdgeOptions));C=E?{...E,...C}:C;let k=C.type||"default",M=x?.[k]||zs[k];void 0===M&&(b?.("011",oo.error011(k)),k="default",M=zs.default);const N=!!(C.focusable||i&&void 0===C.focusable),_=void 0!==p&&(C.reconnectable||a&&void 0===C.reconnectable),P=!!(C.selectable||s&&void 0===C.selectable),z=n.useRef(null),[O,A]=n.useState(!1),[I,R]=n.useState(!1),D=Ai(),{zIndex:L,sourceX:$,sourceY:V,targetX:B,targetY:T,sourcePosition:j,targetPosition:H}=Oi(n.useCallback((t=>{const n=t.nodeLookup.get(C.source),r=t.nodeLookup.get(C.target);if(!n||!r)return{zIndex:C.zIndex,...Os};const i=function(t){const{sourceNode:n,targetNode:o}=t;if(!br(n)||!br(o))return null;const r=n.internals.handleBounds||Sr(n.handles),i=o.internals.handleBounds||Sr(o.handles),a=Er(r?.source??[],t.sourceHandle),s=Er(t.connectionMode===e.ConnectionMode.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),t.targetHandle);if(!a||!s)return t.onError?.("008",oo.error008(a?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const l=a?.position||e.Position.Bottom,c=s?.position||e.Position.Top,u=Cr(n,a,l),d=Cr(o,s,c);return{sourceX:u.x,sourceY:u.y,targetX:d.x,targetY:d.y,sourcePosition:l,targetPosition:c}}({id:o,sourceNode:n,targetNode:r,sourceHandle:C.sourceHandle||null,targetHandle:C.targetHandle||null,connectionMode:t.connectionMode,onError:b}),a=function({sourceNode:e,targetNode:t,selected:n=!1,zIndex:o=0,elevateOnSelect:r=!1}){if(!r)return o;const i=n||t.selected||e.selected,a=Math.max(e.internals.z||0,t.internals.z||0,1e3);return o+(i?a:0)}({selected:C.selected,zIndex:C.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect});return{zIndex:a,...i||Os}}),[C.source,C.target,C.sourceHandle,C.targetHandle,C.selected,C.zIndex]),Yi),Z=n.useMemo((()=>C.markerStart?`url('#${kr(C.markerStart,v)}')`:void 0),[C.markerStart,v]),X=n.useMemo((()=>C.markerEnd?`url('#${kr(C.markerEnd,v)}')`:void 0),[C.markerEnd,v]);if(C.hidden||null===$||null===V||null===B||null===T)return null;const Y=c?e=>{c(e,{...C})}:void 0,F=u?e=>{u(e,{...C})}:void 0,W=d?e=>{d(e,{...C})}:void 0,K=h?e=>{h(e,{...C})}:void 0,G=f?e=>{f(e,{...C})}:void 0;return t.jsx("svg",{style:{zIndex:L},children:t.jsxs("g",{className:r(["react-flow__edge",`react-flow__edge-${k}`,C.className,w,{selected:C.selected,animated:C.animated,inactive:!P&&!l,updating:O,selectable:P}]),onClick:e=>{const{addSelectedEdges:t,unselectNodesAndEdges:n,multiSelectionActive:r}=D.getState();P&&(D.setState({nodesSelectionActive:!1}),C.selected&&r?(n({nodes:[],edges:[C]}),z.current?.blur()):t([o])),l&&l(e,C)},onDoubleClick:Y,onContextMenu:F,onMouseEnter:W,onMouseMove:K,onMouseLeave:G,onKeyDown:N?e=>{if(!S&&io.includes(e.key)&&P){const{unselectNodesAndEdges:t,addSelectedEdges:n}=D.getState();"Escape"===e.key?(z.current?.blur(),t({edges:[C]})):n([o])}}:void 0,tabIndex:N?0:void 0,role:C.ariaRole??(N?"group":"img"),"aria-roledescription":"edge","data-id":o,"data-testid":`rf__edge-${o}`,"aria-label":null===C.ariaLabel?void 0:C.ariaLabel||`Edge from ${C.source} to ${C.target}`,"aria-describedby":N?`${Li}-${v}`:void 0,ref:z,...C.domAttributes,children:[!I&&t.jsx(M,{id:o,source:C.source,target:C.target,type:C.type,selected:C.selected,animated:C.animated,selectable:P,deletable:C.deletable??!0,label:C.label,labelStyle:C.labelStyle,labelShowBg:C.labelShowBg,labelBgStyle:C.labelBgStyle,labelBgPadding:C.labelBgPadding,labelBgBorderRadius:C.labelBgBorderRadius,sourceX:$,sourceY:V,targetX:B,targetY:T,sourcePosition:j,targetPosition:H,data:C.data,style:C.style,sourceHandleId:C.sourceHandle,targetHandleId:C.targetHandle,markerStart:Z,markerEnd:X,pathOptions:"pathOptions"in C?C.pathOptions:void 0,interactionWidth:C.interactionWidth}),_&&t.jsx(Ls,{edge:C,isReconnectable:_,reconnectRadius:g,onReconnect:p,onReconnectStart:m,onReconnectEnd:y,sourceX:$,sourceY:V,targetX:B,targetY:T,sourcePosition:j,targetPosition:H,setUpdateHover:A,setReconnecting:R})]})})}const Vs=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Bs({defaultMarkerColor:e,onlyRenderVisibleElements:o,rfId:r,edgeTypes:i,noPanClassName:a,onReconnect:s,onEdgeContextMenu:l,onEdgeMouseEnter:c,onEdgeMouseMove:u,onEdgeMouseLeave:d,onEdgeClick:h,reconnectRadius:f,onEdgeDoubleClick:g,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:y}){const{edgesFocusable:v,edgesReconnectable:x,elementsSelectable:w,onError:b}=Oi(Vs,Yi),S=(C=o,Oi(n.useCallback((e=>{if(!C)return e.edges.map((e=>e.id));const t=[];if(e.width&&e.height)for(const n of e.edges){const o=e.nodeLookup.get(n.source),r=e.nodeLookup.get(n.target);o&&r&&fr({sourceNode:o,targetNode:r,width:e.width,height:e.height,transform:e.transform})&&t.push(n.id)}return t}),[C]),Yi));var C;return t.jsxs("div",{className:"react-flow__edges",children:[t.jsx(cs,{defaultColor:e,rfId:r}),S.map((e=>t.jsx($s,{id:e,edgesFocusable:v,edgesReconnectable:x,elementsSelectable:w,noPanClassName:a,onReconnect:s,onContextMenu:l,onMouseEnter:c,onMouseMove:u,onMouseLeave:d,onClick:h,reconnectRadius:f,onDoubleClick:g,onReconnectStart:p,onReconnectEnd:m,rfId:r,onError:b,edgeTypes:i,disableKeyboardA11y:y},e)))]})}Bs.displayName="EdgeRenderer";const Ts=n.memo(Bs),js=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Hs({children:e}){const n=Oi(js);return t.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}const Zs=e=>e.panZoom?.syncViewport;function Xs(e){return e.connection.inProgress?{...e.connection,to:Xo(e.connection.to,e.transform)}:{...e.connection}}function Ys(e){const t=function(e){if(e)return t=>{const n=Xs(t);return e(n)};return Xs}(e);return Oi(t,Yi)}const Fs=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Ws({containerStyle:e,style:n,type:o,component:i}){const{nodesConnectable:a,width:s,height:l,isValid:c,inProgress:u}=Oi(Fs,Yi);return!!(s&&a&&u)?t.jsx("svg",{style:e,width:s,height:l,className:"react-flow__connectionline react-flow__container",children:t.jsx("g",{className:r(["react-flow__connection",vo(c)]),children:t.jsx(Ks,{style:n,type:o,CustomComponent:i,isValid:c})})}):null}const Ks=({style:n,type:o=e.ConnectionLineType.Bezier,CustomComponent:r,isValid:i})=>{const{inProgress:a,from:s,fromNode:l,fromHandle:c,fromPosition:u,to:d,toNode:h,toHandle:f,toPosition:g}=Ys();if(!a)return;if(r)return t.jsx(r,{connectionLineType:o,connectionLineStyle:n,fromNode:l,fromHandle:c,fromX:s.x,fromY:s.y,toX:d.x,toY:d.y,fromPosition:u,toPosition:g,connectionStatus:vo(i),toNode:h,toHandle:f});let p="";const m={sourceX:s.x,sourceY:s.y,sourcePosition:u,targetX:d.x,targetY:d.y,targetPosition:g};switch(o){case e.ConnectionLineType.Bezier:[p]=dr(m);break;case e.ConnectionLineType.SimpleBezier:[p]=gs(m);break;case e.ConnectionLineType.Step:[p]=wr({...m,borderRadius:0});break;case e.ConnectionLineType.SmoothStep:[p]=wr(m);break;default:[p]=mr(m)}return t.jsx("path",{d:p,fill:"none",className:"react-flow__connection-path",style:n})};Ks.displayName="ConnectionLine";const Gs={};function qs(e=Gs){n.useRef(e),Ai(),n.useEffect((()=>{}),[e])}function Us({nodeTypes:e,edgeTypes:o,onInit:r,onNodeClick:i,onEdgeClick:a,onNodeDoubleClick:s,onEdgeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:u,onNodeMouseLeave:d,onNodeContextMenu:h,onSelectionContextMenu:f,onSelectionStart:g,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:y,connectionLineComponent:v,connectionLineContainerStyle:x,selectionKeyCode:w,selectionOnDrag:b,selectionMode:S,multiSelectionKeyCode:C,panActivationKeyCode:E,zoomActivationKeyCode:k,deleteKeyCode:M,onlyRenderVisibleElements:N,elementsSelectable:_,defaultViewport:P,translateExtent:z,minZoom:O,maxZoom:A,preventScrolling:I,defaultMarkerColor:R,zoomOnScroll:D,zoomOnPinch:L,panOnScroll:$,panOnScrollSpeed:V,panOnScrollMode:B,zoomOnDoubleClick:T,panOnDrag:j,onPaneClick:H,onPaneMouseEnter:Z,onPaneMouseMove:X,onPaneMouseLeave:Y,onPaneScroll:F,onPaneContextMenu:W,paneClickDistance:K,nodeClickDistance:G,onEdgeContextMenu:q,onEdgeMouseEnter:U,onEdgeMouseMove:Q,onEdgeMouseLeave:J,reconnectRadius:ee,onReconnect:te,onReconnectStart:ne,onReconnectEnd:oe,noDragClassName:re,noWheelClassName:ie,noPanClassName:ae,disableKeyboardA11y:se,nodeExtent:le,rfId:ce,viewport:ue,onViewportChange:de}){return qs(e),qs(o),Ai(),n.useRef(!1),n.useEffect((()=>{}),[]),function(e){const t=Ma(),o=n.useRef(!1);n.useEffect((()=>{!o.current&&t.viewportInitialized&&e&&(setTimeout((()=>e(t)),1),o.current=!0)}),[e,t.viewportInitialized])}(r),function(e){const t=Oi(Zs),o=Ai();n.useEffect((()=>{e&&(t?.(e),o.setState({transform:[e.x,e.y,e.zoom]}))}),[e,t])}(ue),t.jsx(Ja,{onPaneClick:H,onPaneMouseEnter:Z,onPaneMouseMove:X,onPaneMouseLeave:Y,onPaneContextMenu:W,onPaneScroll:F,paneClickDistance:K,deleteKeyCode:M,selectionKeyCode:w,selectionOnDrag:b,selectionMode:S,onSelectionStart:g,onSelectionEnd:p,multiSelectionKeyCode:C,panActivationKeyCode:E,zoomActivationKeyCode:k,elementsSelectable:_,zoomOnScroll:D,zoomOnPinch:L,zoomOnDoubleClick:T,panOnScroll:$,panOnScrollSpeed:V,panOnScrollMode:B,panOnDrag:j,defaultViewport:P,translateExtent:z,minZoom:O,maxZoom:A,onSelectionContextMenu:f,preventScrolling:I,noDragClassName:re,noWheelClassName:ie,noPanClassName:ae,disableKeyboardA11y:se,onViewportChange:de,isControlledViewport:!!ue,children:t.jsxs(Hs,{children:[t.jsx(Ts,{edgeTypes:o,onEdgeClick:a,onEdgeDoubleClick:l,onReconnect:te,onReconnectStart:ne,onReconnectEnd:oe,onlyRenderVisibleElements:N,onEdgeContextMenu:q,onEdgeMouseEnter:U,onEdgeMouseMove:Q,onEdgeMouseLeave:J,reconnectRadius:ee,defaultMarkerColor:R,noPanClassName:ae,disableKeyboardA11y:se,rfId:ce}),t.jsx(Ws,{style:y,type:m,component:v,containerStyle:x}),t.jsx("div",{className:"react-flow__edgelabel-renderer"}),t.jsx(is,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:s,onNodeMouseEnter:c,onNodeMouseMove:u,onNodeMouseLeave:d,onNodeContextMenu:h,nodeClickDistance:G,onlyRenderVisibleElements:N,noPanClassName:ae,noDragClassName:re,disableKeyboardA11y:se,nodeExtent:le,rfId:ce}),t.jsx("div",{className:"react-flow__viewport-portal"})]})})}Us.displayName="GraphView";const Qs=n.memo(Us),Js=({nodes:t,edges:n,defaultNodes:o,defaultEdges:r,width:i,height:a,fitView:s,fitViewOptions:l,minZoom:c=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:h}={})=>{const f=new Map,g=new Map,p=new Map,m=new Map,y=r??n??[],v=o??t??[],x=d??[0,0],w=h??ro;Dr(p,m,y);const b=zr(v,f,g,{nodeOrigin:x,nodeExtent:w,elevateNodesOnSelect:!1});let S=[0,0,1];if(s&&i&&a){const e=Co(f,{filter:e=>!(!e.width&&!e.initialWidth||!e.height&&!e.initialHeight)}),{x:t,y:n,zoom:o}=Wo(e,i,a,c,u,l?.padding??.1);S=[t,n,o]}return{rfId:"1",width:0,height:0,transform:S,nodes:v,nodesInitialized:b,nodeLookup:f,parentLookup:g,edges:y,edgeLookup:m,connectionLookup:p,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:void 0!==o,hasDefaultEdges:void 0!==r,panZoom:null,minZoom:c,maxZoom:u,translateExtent:ro,nodeExtent:w,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:e.ConnectionMode.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:x,nodeDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:s??!1,fitViewOptions:l,fitViewResolver:null,connection:{...uo},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Ho,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:ao}},el=({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:a,fitViewOptions:s,minZoom:l,maxZoom:c,nodeOrigin:u,nodeExtent:d})=>{return h=(h,f)=>{async function g(){const{nodeLookup:e,panZoom:t,fitViewOptions:n,fitViewResolver:o,width:r,height:i,minZoom:a,maxZoom:s}=f();t&&(await Mo({nodes:e,width:r,height:i,panZoom:t,minZoom:a,maxZoom:s},n),o?.resolve(!0),h({fitViewResolver:null}))}return{...Js({nodes:e,edges:t,width:r,height:i,fitView:a,fitViewOptions:s,minZoom:l,maxZoom:c,nodeOrigin:u,nodeExtent:d,defaultNodes:n,defaultEdges:o}),setNodes:e=>{const{nodeLookup:t,parentLookup:n,nodeOrigin:o,elevateNodesOnSelect:r,fitViewQueued:i}=f(),a=zr(e,t,n,{nodeOrigin:o,nodeExtent:d,elevateNodesOnSelect:r,checkEquality:!0});i&&a?(g(),h({nodes:e,nodesInitialized:a,fitViewQueued:!1,fitViewOptions:void 0})):h({nodes:e,nodesInitialized:a})},setEdges:e=>{const{connectionLookup:t,edgeLookup:n}=f();Dr(t,n,e),h({edges:e})},setDefaultNodesAndEdges:(e,t)=>{if(e){const{setNodes:t}=f();t(e),h({hasDefaultNodes:!0})}if(t){const{setEdges:e}=f();e(t),h({hasDefaultEdges:!0})}},updateNodeInternals:e=>{const{triggerNodeChanges:t,nodeLookup:n,parentLookup:o,domNode:r,nodeOrigin:i,nodeExtent:a,debug:s,fitViewQueued:l}=f(),{changes:c,updatedInternals:u}=function(e,t,n,o,r,i){const a=o?.querySelector(".xyflow__viewport");let s=!1;if(!a)return{changes:[],updatedInternals:s};const l=[],c=window.getComputedStyle(a),{m22:u}=new window.DOMMatrixReadOnly(c.transform),d=[];for(const o of e.values()){const e=t.get(o.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),s=!0;continue}const a=tr(o.nodeElement),c=e.measured.width!==a.width||e.measured.height!==a.height;if(a.width&&a.height&&(c||!e.internals.handleBounds||o.force)){const h=o.nodeElement.getBoundingClientRect(),f=Go(e.extent)?e.extent:i;let{positionAbsolute:g}=e.internals;e.parentId&&"parent"===e.extent?g=zo(g,a,t.get(e.parentId)):f&&(g=Po(g,f,a));const p={...e,measured:a,internals:{...e.internals,positionAbsolute:g,handleBounds:{source:sr("source",o.nodeElement,h,u,e.id),target:sr("target",o.nodeElement,h,u,e.id)}}};t.set(e.id,p),e.parentId&&Or(p,t,n,{nodeOrigin:r}),s=!0,c&&(l.push({id:e.id,type:"dimensions",dimensions:a}),e.expandParent&&e.parentId&&d.push({id:e.id,parentId:e.parentId,rect:Lo(p,r)}))}}if(d.length>0){const e=Ir(d,t,n,r);l.push(...e)}return{changes:l,updatedInternals:s}}(e,n,o,r,i,a);u&&(function(e,t,n){const o=Pr(Nr,n);for(const n of e.values())if(n.parentId)Or(n,e,t,o);else{const e=bo(n,o.nodeOrigin),t=Go(n.extent)?n.extent:o.nodeExtent,r=Po(e,t,qo(n));n.internals.positionAbsolute=r}}(n,o,{nodeOrigin:i,nodeExtent:a}),l?(g(),h({fitViewQueued:!1,fitViewOptions:void 0})):h({}),c?.length>0&&(s&&console.log("React Flow: trigger node changes",c),t?.(c)))},updateNodePositions:(e,t=!1)=>{const n=[],o=[],{nodeLookup:r,triggerNodeChanges:i}=f();for(const[i,a]of e){const e=r.get(i),s=!!(e?.expandParent&&e?.parentId&&a?.position),l={id:i,type:"position",position:s?{x:Math.max(0,a.position.x),y:Math.max(0,a.position.y)}:a.position,dragging:t};s&&e.parentId&&n.push({id:i,parentId:e.parentId,rect:{...a.internals.positionAbsolute,width:a.measured.width??0,height:a.measured.height??0}}),o.push(l)}if(n.length>0){const{parentLookup:e,nodeOrigin:t}=f(),i=Ir(n,r,e,t);o.push(...i)}i(o)},triggerNodeChanges:e=>{const{onNodesChange:t,setNodes:n,nodes:o,hasDefaultNodes:r,debug:i}=f();e?.length&&(r&&n(ha(e,o)),i&&console.log("React Flow: trigger node changes",e),t?.(e))},triggerEdgeChanges:e=>{const{onEdgesChange:t,setEdges:n,edges:o,hasDefaultEdges:r,debug:i}=f();e?.length&&(r&&n(fa(e,o)),i&&console.log("React Flow: trigger edge changes",e),t?.(e))},addSelectedNodes:e=>{const{multiSelectionActive:t,edgeLookup:n,nodeLookup:o,triggerNodeChanges:r,triggerEdgeChanges:i}=f();t?r(e.map((e=>ga(e,!0)))):(r(pa(o,new Set([...e]),!0)),i(pa(n)))},addSelectedEdges:e=>{const{multiSelectionActive:t,edgeLookup:n,nodeLookup:o,triggerNodeChanges:r,triggerEdgeChanges:i}=f();t?i(e.map((e=>ga(e,!0)))):(i(pa(n,new Set([...e]))),r(pa(o,new Set,!0)))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{const{edges:n,nodes:o,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=f(),s=t||n,l=(e||o).map((e=>{const t=r.get(e.id);return t&&(t.selected=!1),ga(e.id,!1)})),c=s.map((e=>ga(e.id,!1)));i(l),a(c)},setMinZoom:e=>{const{panZoom:t,maxZoom:n}=f();t?.setScaleExtent([e,n]),h({minZoom:e})},setMaxZoom:e=>{const{panZoom:t,minZoom:n}=f();t?.setScaleExtent([n,e]),h({maxZoom:e})},setTranslateExtent:e=>{f().panZoom?.setTranslateExtent(e),h({translateExtent:e})},setPaneClickDistance:e=>{f().panZoom?.setClickDistance(e)},resetSelectedElements:()=>{const{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:o,elementsSelectable:r}=f();if(!r)return;const i=t.reduce(((e,t)=>t.selected?[...e,ga(t.id,!1)]:e),[]),a=e.reduce(((e,t)=>t.selected?[...e,ga(t.id,!1)]:e),[]);n(i),o(a)},setNodeExtent:e=>{const{nodes:t,nodeLookup:n,parentLookup:o,nodeOrigin:r,elevateNodesOnSelect:i,nodeExtent:a}=f();e[0][0]===a[0][0]&&e[0][1]===a[0][1]&&e[1][0]===a[1][0]&&e[1][1]===a[1][1]||(zr(t,n,o,{nodeOrigin:r,nodeExtent:e,elevateNodesOnSelect:i,checkEquality:!1}),h({nodeExtent:e}))},panBy:e=>{const{transform:t,width:n,height:o,panZoom:r,translateExtent:i}=f();return async function({delta:e,panZoom:t,transform:n,translateExtent:o,width:r,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const a=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,i]],o),s=!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2]);return Promise.resolve(s)}({delta:e,panZoom:r,transform:t,translateExtent:i,width:n,height:o})},setCenter:async(e,t,n)=>{const{width:o,height:r,maxZoom:i,panZoom:a}=f();if(!a)return Promise.resolve(!1);const s=void 0!==n?.zoom?n.zoom:i;return await a.setViewport({x:o/2-e*s,y:r/2-t*s,zoom:s},{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{h({connection:{...uo}})},updateConnection:e=>{h({connection:e})},reset:()=>h({...Js()})}},f=Object.is,h?Ni(h,f):Ni;var h,f};function tl({initialNodes:e,initialEdges:o,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:s,initialMinZoom:l,initialMaxZoom:c,initialFitViewOptions:u,fitView:d,nodeOrigin:h,nodeExtent:f,children:g}){const[p]=n.useState((()=>el({nodes:e,edges:o,defaultNodes:r,defaultEdges:i,width:a,height:s,fitView:d,minZoom:l,maxZoom:c,fitViewOptions:u,nodeOrigin:h,nodeExtent:f})));return t.jsx(Pi,{value:p,children:t.jsx(Ea,{children:g})})}function nl({children:e,nodes:o,edges:r,defaultNodes:i,defaultEdges:a,width:s,height:l,fitView:c,fitViewOptions:u,minZoom:d,maxZoom:h,nodeOrigin:f,nodeExtent:g}){return n.useContext(_i)?t.jsx(t.Fragment,{children:e}):t.jsx(tl,{initialNodes:o,initialEdges:r,defaultNodes:i,defaultEdges:a,initialWidth:s,initialHeight:l,fitView:c,initialFitViewOptions:u,initialMinZoom:d,initialMaxZoom:h,nodeOrigin:f,nodeExtent:g,children:e})}const ol={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};var rl=wa((function({nodes:o,edges:i,defaultNodes:a,defaultEdges:s,className:l,nodeTypes:c,edgeTypes:u,onNodeClick:d,onEdgeClick:h,onInit:f,onMove:g,onMoveStart:p,onMoveEnd:m,onConnect:y,onConnectStart:v,onConnectEnd:x,onClickConnectStart:w,onClickConnectEnd:b,onNodeMouseEnter:S,onNodeMouseMove:C,onNodeMouseLeave:E,onNodeContextMenu:k,onNodeDoubleClick:M,onNodeDragStart:N,onNodeDrag:_,onNodeDragStop:P,onNodesDelete:z,onEdgesDelete:O,onDelete:A,onSelectionChange:I,onSelectionDragStart:R,onSelectionDrag:D,onSelectionDragStop:L,onSelectionContextMenu:$,onSelectionStart:V,onSelectionEnd:B,onBeforeDelete:T,connectionMode:j,connectionLineType:H=e.ConnectionLineType.Bezier,connectionLineStyle:Z,connectionLineComponent:X,connectionLineContainerStyle:Y,deleteKeyCode:F="Backspace",selectionKeyCode:W="Shift",selectionOnDrag:K=!1,selectionMode:G=e.SelectionMode.Full,panActivationKeyCode:q="Space",multiSelectionKeyCode:U=(Ko()?"Meta":"Control"),zoomActivationKeyCode:Q=(Ko()?"Meta":"Control"),snapToGrid:J,snapGrid:ee,onlyRenderVisibleElements:te=!1,selectNodesOnDrag:ne,nodesDraggable:oe,autoPanOnNodeFocus:re,nodesConnectable:ie,nodesFocusable:ae,nodeOrigin:se=Qi,edgesFocusable:le,edgesReconnectable:ce,elementsSelectable:ue=!0,defaultViewport:de=Ji,minZoom:he=.5,maxZoom:fe=2,translateExtent:ge=ro,preventScrolling:pe=!0,nodeExtent:me,defaultMarkerColor:ye="#b1b1b7",zoomOnScroll:ve=!0,zoomOnPinch:xe=!0,panOnScroll:we=!1,panOnScrollSpeed:be=.5,panOnScrollMode:Se=e.PanOnScrollMode.Free,zoomOnDoubleClick:Ce=!0,panOnDrag:Ee=!0,onPaneClick:ke,onPaneMouseEnter:Me,onPaneMouseMove:Ne,onPaneMouseLeave:_e,onPaneScroll:Pe,onPaneContextMenu:ze,paneClickDistance:Oe=0,nodeClickDistance:Ae=0,children:Ie,onReconnect:Re,onReconnectStart:De,onReconnectEnd:Le,onEdgeContextMenu:$e,onEdgeDoubleClick:Ve,onEdgeMouseEnter:Be,onEdgeMouseMove:Te,onEdgeMouseLeave:je,reconnectRadius:He=10,onNodesChange:Ze,onEdgesChange:Xe,noDragClassName:Ye="nodrag",noWheelClassName:Fe="nowheel",noPanClassName:We="nopan",fitView:Ke,fitViewOptions:Ge,connectOnClick:qe,attributionPosition:Ue,proOptions:Qe,defaultEdgeOptions:Je,elevateNodesOnSelect:et,elevateEdgesOnSelect:tt,disableKeyboardA11y:nt=!1,autoPanOnConnect:ot,autoPanOnNodeDrag:rt,autoPanSpeed:it,connectionRadius:at,isValidConnection:st,onError:lt,style:ct,id:ut,nodeDragThreshold:dt,viewport:ht,onViewportChange:ft,width:gt,height:pt,colorMode:mt="light",debug:yt,onScroll:vt,ariaLabelConfig:xt,...wt},bt){const St=ut||"1",Ct=function(e){const[t,o]=n.useState("system"===e?null:e);return n.useEffect((()=>{if("system"!==e)return void o(e);const t=ra(),n=()=>o(t?.matches?"dark":"light");return n(),t?.addEventListener("change",n),()=>{t?.removeEventListener("change",n)}}),[e]),null!==t?t:ra()?.matches?"dark":"light"}(mt),Et=n.useCallback((e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),vt?.(e)}),[vt]);return t.jsx("div",{"data-testid":"rf__wrapper",...wt,onScroll:Et,style:{...ct,...ol},ref:bt,className:r(["react-flow",l,Ct]),id:ut,role:"application",children:t.jsxs(nl,{nodes:o,edges:i,width:gt,height:pt,fitView:Ke,fitViewOptions:Ge,minZoom:he,maxZoom:fe,nodeOrigin:se,nodeExtent:me,children:[t.jsx(Qs,{onInit:f,onNodeClick:d,onEdgeClick:h,onNodeMouseEnter:S,onNodeMouseMove:C,onNodeMouseLeave:E,onNodeContextMenu:k,onNodeDoubleClick:M,nodeTypes:c,edgeTypes:u,connectionLineType:H,connectionLineStyle:Z,connectionLineComponent:X,connectionLineContainerStyle:Y,selectionKeyCode:W,selectionOnDrag:K,selectionMode:G,deleteKeyCode:F,multiSelectionKeyCode:U,panActivationKeyCode:q,zoomActivationKeyCode:Q,onlyRenderVisibleElements:te,defaultViewport:de,translateExtent:ge,minZoom:he,maxZoom:fe,preventScrolling:pe,zoomOnScroll:ve,zoomOnPinch:xe,zoomOnDoubleClick:Ce,panOnScroll:we,panOnScrollSpeed:be,panOnScrollMode:Se,panOnDrag:Ee,onPaneClick:ke,onPaneMouseEnter:Me,onPaneMouseMove:Ne,onPaneMouseLeave:_e,onPaneScroll:Pe,onPaneContextMenu:ze,paneClickDistance:Oe,nodeClickDistance:Ae,onSelectionContextMenu:$,onSelectionStart:V,onSelectionEnd:B,onReconnect:Re,onReconnectStart:De,onReconnectEnd:Le,onEdgeContextMenu:$e,onEdgeDoubleClick:Ve,onEdgeMouseEnter:Be,onEdgeMouseMove:Te,onEdgeMouseLeave:je,reconnectRadius:He,defaultMarkerColor:ye,noDragClassName:Ye,noWheelClassName:Fe,noPanClassName:We,rfId:St,disableKeyboardA11y:nt,nodeExtent:me,viewport:ht,onViewportChange:ft}),t.jsx(oa,{nodes:o,edges:i,defaultNodes:a,defaultEdges:s,onConnect:y,onConnectStart:v,onConnectEnd:x,onClickConnectStart:w,onClickConnectEnd:b,nodesDraggable:oe,autoPanOnNodeFocus:re,nodesConnectable:ie,nodesFocusable:ae,edgesFocusable:le,edgesReconnectable:ce,elementsSelectable:ue,elevateNodesOnSelect:et,elevateEdgesOnSelect:tt,minZoom:he,maxZoom:fe,nodeExtent:me,onNodesChange:Ze,onEdgesChange:Xe,snapToGrid:J,snapGrid:ee,connectionMode:j,translateExtent:ge,connectOnClick:qe,defaultEdgeOptions:Je,fitView:Ke,fitViewOptions:Ge,onNodesDelete:z,onEdgesDelete:O,onDelete:A,onNodeDragStart:N,onNodeDrag:_,onNodeDragStop:P,onSelectionDrag:D,onSelectionDragStart:R,onSelectionDragStop:L,onMove:g,onMoveStart:p,onMoveEnd:m,noPanClassName:We,nodeOrigin:se,rfId:St,autoPanOnConnect:ot,autoPanOnNodeDrag:rt,autoPanSpeed:it,onError:lt,connectionRadius:at,isValidConnection:st,selectNodesOnDrag:ne,nodeDragThreshold:dt,onBeforeDelete:T,paneClickDistance:Oe,debug:yt,ariaLabelConfig:xt}),t.jsx(Ui,{onSelectionChange:I}),Ie,t.jsx(Xi,{proOptions:Qe,position:Ue}),t.jsx(ji,{rfId:St,disableKeyboardA11y:nt})]})})}));const il=e=>e.domNode?.querySelector(".react-flow__edgelabel-renderer");const al=e=>e.domNode?.querySelector(".react-flow__viewport-portal");const sl=e=>e.nodes;const ll=e=>e.edges;const cl=e=>({x:e.transform[0],y:e.transform[1],zoom:e.transform[2]});const ul=oo.error014();function dl({dimensions:e,lineWidth:n,variant:o,className:i}){return t.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:r(["react-flow__background-pattern",o,i])})}function hl({radius:e,className:n}){return t.jsx("circle",{cx:e,cy:e,r:e,className:r(["react-flow__background-pattern","dots",n])})}var fl;e.BackgroundVariant=void 0,(fl=e.BackgroundVariant||(e.BackgroundVariant={})).Lines="lines",fl.Dots="dots",fl.Cross="cross";const gl={[e.BackgroundVariant.Dots]:1,[e.BackgroundVariant.Lines]:1,[e.BackgroundVariant.Cross]:6},pl=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function ml({id:o,variant:i=e.BackgroundVariant.Dots,gap:a=20,size:s,lineWidth:l=1,offset:c=0,color:u,bgColor:d,style:h,className:f,patternClassName:g}){const p=n.useRef(null),{transform:m,patternId:y}=Oi(pl,Yi),v=s||gl[i],x=i===e.BackgroundVariant.Dots,w=i===e.BackgroundVariant.Cross,b=Array.isArray(a)?a:[a,a],S=[b[0]*m[2]||1,b[1]*m[2]||1],C=v*m[2],E=Array.isArray(c)?c:[c,c],k=w?[C,C]:S,M=[E[0]*m[2]||1+k[0]/2,E[1]*m[2]||1+k[1]/2],N=`${y}${o||""}`;return t.jsxs("svg",{className:r(["react-flow__background",f]),style:{...h,...Pa,"--xy-background-color-props":d,"--xy-background-pattern-color-props":u},ref:p,"data-testid":"rf__background",children:[t.jsx("pattern",{id:N,x:m[0]%S[0],y:m[1]%S[1],width:S[0],height:S[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${M[0]},-${M[1]})`,children:x?t.jsx(hl,{radius:C/2,className:g}):t.jsx(dl,{dimensions:k,lineWidth:l,variant:i,className:g})}),t.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${N})`})]})}ml.displayName="Background";const yl=n.memo(ml);function vl(){return t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:t.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function xl(){return t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:t.jsx("path",{d:"M0 0h32v4.2H0z"})})}function wl(){return t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:t.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function bl(){return t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:t.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function Sl(){return t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:t.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Cl({children:e,className:n,...o}){return t.jsx("button",{type:"button",className:r(["react-flow__controls-button",n]),...o,children:e})}const El=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function kl({style:e,showZoom:n=!0,showFitView:o=!0,showInteractive:i=!0,fitViewOptions:a,onZoomIn:s,onZoomOut:l,onFitView:c,onInteractiveChange:u,className:d,children:h,position:f="bottom-left",orientation:g="vertical","aria-label":p}){const m=Ai(),{isInteractive:y,minZoomReached:v,maxZoomReached:x,ariaLabelConfig:w}=Oi(El,Yi),{zoomIn:b,zoomOut:S,fitView:C}=Ma(),E="horizontal"===g?"horizontal":"vertical";return t.jsxs(Zi,{className:r(["react-flow__controls",E,d]),position:f,style:e,"data-testid":"rf__controls","aria-label":p??w["controls.ariaLabel"],children:[n&&t.jsxs(t.Fragment,{children:[t.jsx(Cl,{onClick:()=>{b(),s?.()},className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:x,children:t.jsx(vl,{})}),t.jsx(Cl,{onClick:()=>{S(),l?.()},className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:v,children:t.jsx(xl,{})})]}),o&&t.jsx(Cl,{className:"react-flow__controls-fitview",onClick:()=>{C(a),c?.()},title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:t.jsx(wl,{})}),i&&t.jsx(Cl,{className:"react-flow__controls-interactive",onClick:()=>{m.setState({nodesDraggable:!y,nodesConnectable:!y,elementsSelectable:!y}),u?.(!y)},title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:y?t.jsx(Sl,{}):t.jsx(bl,{})}),h]})}kl.displayName="Controls";const Ml=n.memo(kl);const Nl=n.memo((function({id:e,x:n,y:o,width:i,height:a,style:s,color:l,strokeColor:c,strokeWidth:u,className:d,borderRadius:h,shapeRendering:f,selected:g,onClick:p}){const{background:m,backgroundColor:y}=s||{},v=l||m||y;return t.jsx("rect",{className:r(["react-flow__minimap-node",{selected:g},d]),x:n,y:o,rx:h,ry:h,width:i,height:a,style:{fill:v,stroke:c,strokeWidth:u},shapeRendering:f,onClick:p?t=>p(t,e):void 0})})),_l=e=>e.nodes.map((e=>e.id)),Pl=e=>e instanceof Function?e:()=>e;const zl=n.memo((function({id:e,nodeColorFunc:n,nodeStrokeColorFunc:o,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:s,NodeComponent:l,onClick:c}){const{node:u,x:d,y:h,width:f,height:g}=Oi((t=>{const{internals:n}=t.nodeLookup.get(e),o=n.userNode,{x:r,y:i}=n.positionAbsolute,{width:a,height:s}=qo(o);return{node:o,x:r,y:i,width:a,height:s}}),Yi);return u&&!u.hidden&&Uo(u)?t.jsx(l,{x:d,y:h,width:f,height:g,style:u.style,selected:!!u.selected,className:r(u),color:n(u),borderRadius:i,strokeColor:o(u),strokeWidth:a,shapeRendering:s,onClick:c,id:u.id}):null}));var Ol=n.memo((function({nodeStrokeColor:e,nodeColor:n,nodeClassName:o="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=Nl,onClick:s}){const l=Oi(_l,Yi),c=Pl(n),u=Pl(e),d=Pl(o),h="undefined"==typeof window||window.chrome?"crispEdges":"geometricPrecision";return t.jsx(t.Fragment,{children:l.map((e=>t.jsx(zl,{id:e,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:s,shapeRendering:h},e)))})}));const Al=e=>!e.hidden,Il=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?Vo(Co(e.nodeLookup,{filter:Al}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}};function Rl({style:e,className:o,nodeStrokeColor:i,nodeColor:a,nodeClassName:s="",nodeBorderRadius:l=5,nodeStrokeWidth:c,nodeComponent:u,bgColor:d,maskColor:h,maskStrokeColor:f,maskStrokeWidth:g,position:p="bottom-right",onClick:m,onNodeClick:y,pannable:v=!1,zoomable:x=!1,ariaLabel:w,inversePan:b,zoomStep:S=10,offsetScale:C=5}){const E=Ai(),k=n.useRef(null),{boundingRect:M,viewBB:N,rfId:_,panZoom:P,translateExtent:z,flowWidth:O,flowHeight:A,ariaLabelConfig:I}=Oi(Il,Yi),R=e?.width??200,D=e?.height??150,L=M.width/R,$=M.height/D,V=Math.max(L,$),B=V*R,T=V*D,j=C*V,H=M.x-(B-M.width)/2-j,Z=M.y-(T-M.height)/2-j,X=B+2*j,Y=T+2*j,F=`react-flow__minimap-desc-${_}`,W=n.useRef(0),K=n.useRef();W.current=V,n.useEffect((()=>{if(k.current&&P)return K.current=function({domNode:e,panZoom:t,getTransform:n,getViewScale:o}){const r=Se(e);return{update:function({translateExtent:e,width:i,height:a,zoomStep:s=10,pannable:l=!0,zoomable:c=!0,inversePan:u=!1}){let d=[0,0];const h=no().on("start",(e=>{"mousedown"!==e.sourceEvent.type&&"touchstart"!==e.sourceEvent.type||(d=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])})).on("zoom",l?r=>{const s=n();if("mousemove"!==r.sourceEvent.type&&"touchmove"!==r.sourceEvent.type||!t)return;const l=[r.sourceEvent.clientX??r.sourceEvent.touches[0].clientX,r.sourceEvent.clientY??r.sourceEvent.touches[0].clientY],c=[l[0]-d[0],l[1]-d[1]];d=l;const h=o()*Math.max(s[2],Math.log(s[2]))*(u?-1:1),f={x:s[0]-c[0]*h,y:s[1]-c[1]*h},g=[[0,0],[i,a]];t.setViewportConstrained({x:f.x,y:f.y,zoom:s[2]},g,e)}:null).on("zoom.wheel",c?e=>{const o=n();if("wheel"!==e.sourceEvent.type||!t)return;const r=-e.sourceEvent.deltaY*(1===e.sourceEvent.deltaMode?.05:e.sourceEvent.deltaMode?1:.002)*s,i=o[2]*Math.pow(2,r);t.scaleTo(i)}:null);r.call(h,{})},destroy:function(){r.on("zoom",null)},pointer:Ce}}({domNode:k.current,panZoom:P,getTransform:()=>E.getState().transform,getViewScale:()=>W.current}),()=>{K.current?.destroy()}}),[P]),n.useEffect((()=>{K.current?.update({translateExtent:z,width:O,height:A,inversePan:b,pannable:v,zoomStep:S,zoomable:x})}),[v,x,b,S,z,O,A]);const G=m?e=>{const[t,n]=K.current?.pointer(e)||[0,0];m(e,{x:t,y:n})}:void 0,q=y?n.useCallback(((e,t)=>{const n=E.getState().nodeLookup.get(t).internals.userNode;y(e,n)}),[]):void 0,U=w??I["minimap.ariaLabel"];return t.jsx(Zi,{position:p,style:{...e,"--xy-minimap-background-color-props":"string"==typeof d?d:void 0,"--xy-minimap-mask-background-color-props":"string"==typeof h?h:void 0,"--xy-minimap-mask-stroke-color-props":"string"==typeof f?f:void 0,"--xy-minimap-mask-stroke-width-props":"number"==typeof g?g*V:void 0,"--xy-minimap-node-background-color-props":"string"==typeof a?a:void 0,"--xy-minimap-node-stroke-color-props":"string"==typeof i?i:void 0,"--xy-minimap-node-stroke-width-props":"number"==typeof c?c:void 0},className:r(["react-flow__minimap",o]),"data-testid":"rf__minimap",children:t.jsxs("svg",{width:R,height:D,viewBox:`${H} ${Z} ${X} ${Y}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":F,ref:k,onClick:G,children:[U&&t.jsx("title",{id:F,children:U}),t.jsx(Ol,{onClick:q,nodeColor:a,nodeStrokeColor:i,nodeBorderRadius:l,nodeClassName:s,nodeStrokeWidth:c,nodeComponent:u}),t.jsx("path",{className:"react-flow__minimap-mask",d:`M${H-j},${Z-j}h${X+2*j}v${Y+2*j}h${-X-2*j}z\n M${N.x},${N.y}h${N.width}v${N.height}h${-N.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Rl.displayName="MiniMap";const Dl=n.memo(Rl),Ll={[e.ResizeControlVariant.Line]:"right",[e.ResizeControlVariant.Handle]:"bottom-right"};const $l=n.memo((function({nodeId:o,position:i,variant:a=e.ResizeControlVariant.Handle,className:s,style:l,children:c,color:u,minWidth:d=10,minHeight:h=10,maxWidth:f=Number.MAX_VALUE,maxHeight:g=Number.MAX_VALUE,keepAspectRatio:p=!1,resizeDirection:m,autoScale:y=!0,shouldResize:v,onResizeStart:x,onResize:w,onResizeEnd:b}){const S=Za(),C="string"==typeof o?o:S,E=Ai(),k=n.useRef(null),M=a===e.ResizeControlVariant.Handle,N=Oi(n.useCallback((_=M&&y,e=>_?`${Math.max(1/e.transform[2],1)}`:void 0),[M,y]),Yi);var _;const P=n.useRef(null),z=i??Ll[a];n.useEffect((()=>{if(k.current&&C)return P.current||(P.current=fi({domNode:k.current,nodeId:C,getStoreItems:()=>{const{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:o,nodeOrigin:r,domNode:i}=E.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:o,nodeOrigin:r,paneDomNode:i}},onChange:(e,t)=>{const{triggerNodeChanges:n,nodeLookup:o,parentLookup:r,nodeOrigin:i}=E.getState(),a=[],s={x:e.x,y:e.y},l=o.get(C);if(l&&l.expandParent&&l.parentId){const t=l.origin??i,n=e.width??l.measured.width??0,c=e.height??l.measured.height??0,u=Ir([{id:l.id,parentId:l.parentId,rect:{width:n,height:c,...Qo({x:e.x??l.position.x,y:e.y??l.position.y},{width:n,height:c},l.parentId,o,t)}}],o,r,i);a.push(...u),s.x=e.x?Math.max(t[0]*n,e.x):void 0,s.y=e.y?Math.max(t[1]*c,e.y):void 0}if(void 0!==s.x&&void 0!==s.y){const e={id:C,type:"position",position:{...s}};a.push(e)}if(void 0!==e.width&&void 0!==e.height){const t={id:C,type:"dimensions",resizing:!0,setAttributes:!m||("horizontal"===m?"width":"height"),dimensions:{width:e.width,height:e.height}};a.push(t)}for(const e of t){const t={...e,type:"position"};a.push(t)}n(a)},onEnd:({width:e,height:t})=>{const n={id:C,type:"dimensions",resizing:!1,dimensions:{width:e,height:t}};E.getState().triggerNodeChanges([n])}})),P.current.update({controlPosition:z,boundaries:{minWidth:d,minHeight:h,maxWidth:f,maxHeight:g},keepAspectRatio:p,resizeDirection:m,onResizeStart:x,onResize:w,onResizeEnd:b,shouldResize:v}),()=>{P.current?.destroy()}}),[z,d,h,f,g,p,x,w,b,v]);const O=z.split("-");return t.jsx("div",{className:r(["react-flow__resize-control","nodrag",...O,a,s]),ref:k,style:{...l,scale:N,...u&&{[M?"backgroundColor":"borderColor"]:u}},children:c})}));const Vl=e=>e.domNode?.querySelector(".react-flow__renderer");function Bl({children:e}){const t=Oi(Vl);return t?o.createPortal(e,t):null}const Tl=(e,t)=>e?.internals.positionAbsolute.x!==t?.internals.positionAbsolute.x||e?.internals.positionAbsolute.y!==t?.internals.positionAbsolute.y||e?.measured.width!==t?.measured.width||e?.measured.height!==t?.measured.height||e?.selected!==t?.selected||e?.internals.z!==t?.internals.z,jl=(e,t)=>{if(e.size!==t.size)return!1;for(const[n,o]of e)if(Tl(o,t.get(n)))return!1;return!0},Hl=e=>({x:e.transform[0],y:e.transform[1],zoom:e.transform[2],selectedNodesCount:e.nodes.filter((e=>e.selected)).length});e.Background=yl,e.BaseEdge=hs,e.BezierEdge=_s,e.ControlButton=Cl,e.Controls=Ml,e.EdgeLabelRenderer=function({children:e}){const t=Oi(il);return t?o.createPortal(e,t):null},e.EdgeText=ds,e.Handle=Ya,e.MiniMap=Dl,e.NodeResizeControl=$l,e.NodeResizer=function({nodeId:n,isVisible:o=!0,handleClassName:r,handleStyle:i,lineClassName:a,lineStyle:s,color:l,minWidth:c=10,minHeight:u=10,maxWidth:d=Number.MAX_VALUE,maxHeight:h=Number.MAX_VALUE,keepAspectRatio:f=!1,autoScale:g=!0,shouldResize:p,onResizeStart:m,onResize:y,onResizeEnd:v}){return o?t.jsxs(t.Fragment,{children:[ii.map((o=>t.jsx($l,{className:a,style:s,nodeId:n,position:o,variant:e.ResizeControlVariant.Line,color:l,minWidth:c,minHeight:u,maxWidth:d,maxHeight:h,onResizeStart:m,keepAspectRatio:f,autoScale:g,shouldResize:p,onResize:y,onResizeEnd:v},o))),ri.map((e=>t.jsx($l,{className:r,style:i,nodeId:n,position:e,color:l,minWidth:c,minHeight:u,maxWidth:d,maxHeight:h,onResizeStart:m,keepAspectRatio:f,autoScale:g,shouldResize:p,onResize:y,onResizeEnd:v},e)))]}):null},e.NodeToolbar=function({nodeId:o,children:i,className:a,style:s,isVisible:l,position:c=e.Position.Top,offset:u=10,align:d="center",...h}){const f=Za(),g=n.useCallback((e=>{const t=(Array.isArray(o)?o:[o||f||""]).reduce(((t,n)=>{const o=e.nodeLookup.get(n);return o&&t.set(o.id,o),t}),new Map);return t}),[o,f]),p=Oi(g,jl),{x:m,y:y,zoom:v,selectedNodesCount:x}=Oi(Hl,Yi);if(!("boolean"==typeof l?l:1===p.size&&p.values().next().value?.selected&&1===x)||!p.size)return null;const w=Co(p),b=Array.from(p.values()),S=Math.max(...b.map((e=>e.internals.z+1))),C={position:"absolute",transform:Mr(w,{x:m,y:y,zoom:v},c,u,d),zIndex:S,...s};return t.jsx(Bl,{children:t.jsx("div",{style:C,className:r(["react-flow__node-toolbar",a]),...h,"data-id":b.reduce(((e,t)=>`${e}${t.id} `),"").trim(),children:i})})},e.Panel=Zi,e.ReactFlow=rl,e.ReactFlowProvider=tl,e.SimpleBezierEdge=ms,e.SmoothStepEdge=xs,e.StepEdge=Ss,e.StraightEdge=ks,e.ViewportPortal=function({children:e}){const t=Oi(al);return t?o.createPortal(e,t):null},e.addEdge=pr,e.applyEdgeChanges=fa,e.applyNodeChanges=ha,e.getBezierEdgeCenter=lr,e.getBezierPath=dr,e.getConnectedEdges=ko,e.getEdgeCenter=hr,e.getIncomers=(e,t,n)=>{if(!e.id)return[];const o=new Set;return n.forEach((t=>{t.target===e.id&&o.add(t.source)})),t.filter((e=>o.has(e.id)))},e.getNodesBounds=So,e.getOutgoers=(e,t,n)=>{if(!e.id)return[];const o=new Set;return n.forEach((t=>{t.source===e.id&&o.add(t.target)})),t.filter((e=>o.has(e.id)))},e.getSimpleBezierPath=gs,e.getSmoothStepPath=wr,e.getStraightPath=mr,e.getViewportForBounds=Wo,e.isEdge=xa,e.isNode=va,e.reconnectEdge=(e,t,n,o={shouldReplaceId:!0})=>{const{id:r,...i}=e;if(!t.source||!t.target)return n;if(!n.find((t=>t.id===e.id)))return n;const a={...i,id:o.shouldReplaceId?gr(t):r,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.filter((e=>e.id!==r)).concat(a)},e.useConnection=Ys,e.useEdges=function(){return Oi(ll,Yi)},e.useEdgesState=function(e){const[t,o]=n.useState(e),r=n.useCallback((e=>o((t=>fa(e,t)))),[]);return[t,o,r]},e.useHandleConnections=function({type:e,id:t,nodeId:o,onConnect:r,onDisconnect:i}){console.warn("[DEPRECATED] `useHandleConnections` is deprecated. Instead use `useNodeConnections` https://reactflow.dev/api-reference/hooks/useNodeConnections");const a=Za(),s=o??a,l=n.useRef(null),c=Oi((n=>n.connectionLookup.get(`${s}-${e}${t?`-${t}`:""}`)),mo);return n.useEffect((()=>{if(l.current&&l.current!==c){const e=c??new Map;yo(l.current,e,i),yo(e,l.current,r)}l.current=c??new Map}),[c,r,i]),n.useMemo((()=>Array.from(c?.values()??[])),[c])},e.useInternalNode=function(e){return Oi(n.useCallback((t=>t.nodeLookup.get(e)),[e]),Yi)},e.useKeyPress=aa,e.useNodeConnections=function({id:e,handleType:t,handleId:o,onConnect:r,onDisconnect:i}={}){const a=Za(),s=e??a;if(!s)throw new Error(ul);const l=n.useRef(null),c=Oi((e=>e.connectionLookup.get(`${s}${t?o?`-${t}-${o}`:`-${t}`:""}`)),mo);return n.useEffect((()=>{if(l.current&&l.current!==c){const e=c??new Map;yo(l.current,e,i),yo(e,l.current,r)}l.current=c??new Map}),[c,r,i]),n.useMemo((()=>Array.from(c?.values()??[])),[c])},e.useNodeId=Za,e.useNodes=function(){return Oi(sl,Yi)},e.useNodesData=function(e){return Oi(n.useCallback((t=>{const n=[],o=Array.isArray(e),r=o?e:[e];for(const e of r){const o=t.nodeLookup.get(e);o&&n.push({id:o.id,type:o.type,data:o.data})}return o?n:n[0]??null}),[e]),Lr)},e.useNodesInitialized=function(e={includeHiddenNodes:!1}){return Oi((e=>t=>{if(!e.includeHiddenNodes)return t.nodesInitialized;if(0===t.nodeLookup.size)return!1;for(const[,{internals:e}]of t.nodeLookup)if(void 0===e.handleBounds||!Uo(e.userNode))return!1;return!0})(e))},e.useNodesState=function(e){const[t,o]=n.useState(e),r=n.useCallback((e=>o((t=>ha(e,t)))),[]);return[t,o,r]},e.useOnSelectionChange=function({onChange:e}){const t=Ai();n.useEffect((()=>{const n=[...t.getState().onSelectionChangeHandlers,e];return t.setState({onSelectionChangeHandlers:n}),()=>{const n=t.getState().onSelectionChangeHandlers.filter((t=>t!==e));t.setState({onSelectionChangeHandlers:n})}}),[e])},e.useOnViewportChange=function({onStart:e,onChange:t,onEnd:o}){const r=Ai();n.useEffect((()=>{r.setState({onViewportChangeStart:e})}),[e]),n.useEffect((()=>{r.setState({onViewportChange:t})}),[t]),n.useEffect((()=>{r.setState({onViewportChangeEnd:o})}),[o])},e.useReactFlow=Ma,e.useStore=Oi,e.useStoreApi=Ai,e.useUpdateNodeInternals=function(){const e=Ai();return n.useCallback((t=>{const{domNode:n,updateNodeInternals:o}=e.getState(),r=Array.isArray(t)?t:[t],i=new Map;r.forEach((e=>{const t=n?.querySelector(`.react-flow__node[data-id="${e}"]`);t&&i.set(e,{id:e,nodeElement:t,force:!0})})),requestAnimationFrame((()=>o(i,{triggerFitView:!1})))}),[])},e.useViewport=function(){return Oi(cl,Yi)}})); diff --git a/node_modules/@xyflow/react/dist/umd/store/index.d.ts b/node_modules/@xyflow/react/dist/umd/store/index.d.ts new file mode 100644 index 0000000..6594c7d --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/store/index.d.ts @@ -0,0 +1,18 @@ +import { NodeOrigin, CoordinateExtent } from '@xyflow/system'; +import type { ReactFlowState, Node, Edge, FitViewOptions } from '../types'; +declare const createStore: ({ nodes, edges, defaultNodes, defaultEdges, width, height, fitView, fitViewOptions, minZoom, maxZoom, nodeOrigin, nodeExtent, }: { + nodes?: Node[]; + edges?: Edge[]; + defaultNodes?: Node[]; + defaultEdges?: Edge[]; + width?: number; + height?: number; + fitView?: boolean; + fitViewOptions?: FitViewOptions; + minZoom?: number; + maxZoom?: number; + nodeOrigin?: NodeOrigin; + nodeExtent?: CoordinateExtent; +}) => import("zustand/traditional").UseBoundStoreWithEqualityFn>; +export { createStore }; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/store/index.d.ts.map b/node_modules/@xyflow/react/dist/umd/store/index.d.ts.map new file mode 100644 index 0000000..d32299c --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/store/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":"AACA,OAAO,EAYL,UAAU,EACV,gBAAgB,EAEjB,MAAM,gBAAgB,CAAC;AAIxB,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,EAA+B,cAAc,EAAE,MAAM,UAAU,CAAC;AAExG,QAAA,MAAM,WAAW,oIAad;IACD,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;IACtB,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,UAAU,CAAC,EAAE,gBAAgB,CAAC;CAC/B,0GAyVc,CAAC;AAEhB,OAAO,EAAE,WAAW,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/store/initialState.d.ts b/node_modules/@xyflow/react/dist/umd/store/initialState.d.ts new file mode 100644 index 0000000..82c940e --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/store/initialState.d.ts @@ -0,0 +1,18 @@ +import { NodeOrigin, CoordinateExtent } from '@xyflow/system'; +import type { Edge, FitViewOptions, Node, ReactFlowStore } from '../types'; +declare const getInitialState: ({ nodes, edges, defaultNodes, defaultEdges, width, height, fitView, fitViewOptions, minZoom, maxZoom, nodeOrigin, nodeExtent, }?: { + nodes?: Node[]; + edges?: Edge[]; + defaultNodes?: Node[]; + defaultEdges?: Edge[]; + width?: number; + height?: number; + fitView?: boolean; + fitViewOptions?: FitViewOptions; + minZoom?: number; + maxZoom?: number; + nodeOrigin?: NodeOrigin; + nodeExtent?: CoordinateExtent; +}) => ReactFlowStore; +export default getInitialState; +//# sourceMappingURL=initialState.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/store/initialState.d.ts.map b/node_modules/@xyflow/react/dist/umd/store/initialState.d.ts.map new file mode 100644 index 0000000..013842a --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/store/initialState.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"initialState.d.ts","sourceRoot":"","sources":["../../src/store/initialState.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,UAAU,EAEV,gBAAgB,EAEjB,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,IAAI,EAAE,cAAc,EAAgB,IAAI,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEzF,QAAA,MAAM,eAAe,qIAalB;IACD,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;IACtB,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,UAAU,CAAC,EAAE,gBAAgB,CAAC;CAC/B,KAAQ,cAyGR,CAAC;AAEF,eAAe,eAAe,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/styles/utils.d.ts b/node_modules/@xyflow/react/dist/umd/styles/utils.d.ts new file mode 100644 index 0000000..014d140 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/styles/utils.d.ts @@ -0,0 +1,3 @@ +import type { CSSProperties } from 'react'; +export declare const containerStyle: CSSProperties; +//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/styles/utils.d.ts.map b/node_modules/@xyflow/react/dist/umd/styles/utils.d.ts.map new file mode 100644 index 0000000..b6dc952 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/styles/utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/styles/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,eAAO,MAAM,cAAc,EAAE,aAM5B,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/types/component-props.d.ts b/node_modules/@xyflow/react/dist/umd/types/component-props.d.ts new file mode 100644 index 0000000..8e53ff4 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/types/component-props.d.ts @@ -0,0 +1,634 @@ +import type { CSSProperties, HTMLAttributes, MouseEvent as ReactMouseEvent, WheelEvent } from 'react'; +import type { ConnectionMode, ConnectionLineType, OnConnect, OnConnectStart, OnConnectEnd, CoordinateExtent, KeyCode, PanOnScrollMode, ProOptions, PanelPosition, OnMove, OnMoveStart, OnMoveEnd, Viewport, NodeOrigin, HandleType, SelectionMode, OnError, ColorMode, SnapGrid, OnReconnect, AriaLabelConfig } from '@xyflow/system'; +import type { OnSelectionChangeFunc, NodeTypes, EdgeTypes, Node, Edge, ConnectionLineComponent, OnInit, DefaultEdgeOptions, FitViewOptions, OnNodesDelete, OnEdgesDelete, OnDelete, OnNodesChange, OnEdgesChange, NodeMouseHandler, SelectionDragHandler, EdgeMouseHandler, OnNodeDrag, OnBeforeDelete, IsValidConnection } from '.'; +/** + * ReactFlow component props. + * @public + */ +export interface ReactFlowProps extends Omit, 'onError'> { + /** + * An array of nodes to render in a controlled flow. + * @default [] + * @example + * const nodes = [ + * { + * id: 'node-1', + * type: 'input', + * data: { label: 'Node 1' }, + * position: { x: 250, y: 50 } + * } + * ]; + */ + nodes?: NodeType[]; + /** + * An array of edges to render in a controlled flow. + * @default [] + * @example + * const edges = [ + * { + * id: 'edge-1-2', + * source: 'node-1', + * target: 'node-2', + * } + * ]; + */ + edges?: EdgeType[]; + /** The initial nodes to render in an uncontrolled flow. */ + defaultNodes?: NodeType[]; + /** The initial edges to render in an uncontrolled flow. */ + defaultEdges?: EdgeType[]; + /** + * Defaults to be applied to all new edges that are added to the flow. + * Properties on a new edge will override these defaults if they exist. + * @example + * const defaultEdgeOptions = { + * type: 'customEdgeType', + * animated: true + * } + */ + defaultEdgeOptions?: DefaultEdgeOptions; + /** This event handler is called when a user clicks on a node. */ + onNodeClick?: NodeMouseHandler; + /** This event handler is called when a user double-clicks on a node. */ + onNodeDoubleClick?: NodeMouseHandler; + /** This event handler is called when mouse of a user enters a node. */ + onNodeMouseEnter?: NodeMouseHandler; + /** This event handler is called when mouse of a user moves over a node. */ + onNodeMouseMove?: NodeMouseHandler; + /** This event handler is called when mouse of a user leaves a node. */ + onNodeMouseLeave?: NodeMouseHandler; + /** This event handler is called when a user right-clicks on a node. */ + onNodeContextMenu?: NodeMouseHandler; + /** This event handler is called when a user starts to drag a node. */ + onNodeDragStart?: OnNodeDrag; + /** This event handler is called when a user drags a node. */ + onNodeDrag?: OnNodeDrag; + /** This event handler is called when a user stops dragging a node. */ + onNodeDragStop?: OnNodeDrag; + /** This event handler is called when a user clicks on an edge. */ + onEdgeClick?: (event: ReactMouseEvent, edge: EdgeType) => void; + /** This event handler is called when a user right-clicks on an edge. */ + onEdgeContextMenu?: EdgeMouseHandler; + /** This event handler is called when mouse of a user enters an edge. */ + onEdgeMouseEnter?: EdgeMouseHandler; + /** This event handler is called when mouse of a user moves over an edge. */ + onEdgeMouseMove?: EdgeMouseHandler; + /** This event handler is called when mouse of a user leaves an edge. */ + onEdgeMouseLeave?: EdgeMouseHandler; + /** This event handler is called when a user double-clicks on an edge. */ + onEdgeDoubleClick?: EdgeMouseHandler; + /** + * This handler is called when the source or target of a reconnectable edge is dragged from the + * current node. It will fire even if the edge's source or target do not end up changing. + * You can use the `reconnectEdge` utility to convert the connection to a new edge. + */ + onReconnect?: OnReconnect; + /** + * This event fires when the user begins dragging the source or target of an editable edge. + */ + onReconnectStart?: (event: ReactMouseEvent, edge: EdgeType, handleType: HandleType) => void; + /** + * This event fires when the user releases the source or target of an editable edge. It is called + * even if an edge update does not occur. + */ + onReconnectEnd?: (event: MouseEvent | TouchEvent, edge: EdgeType, handleType: HandleType) => void; + /** + * Use this event handler to add interactivity to a controlled flow. + * It is called on node drag, select, and move. + * @example // Use NodesState hook to create edges and get onNodesChange handler + * import ReactFlow, { useNodesState } from '@xyflow/react'; + * const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes); + * + * return () + * @example // Use helper function to update node + * import ReactFlow, { applyNodeChanges } from '@xyflow/react'; + * + * const onNodeChange = useCallback( + * (changes) => setNode((nds) => applyNodeChanges(changes, nds)), + * [], + * ); + * + * return () + */ + onNodesChange?: OnNodesChange; + /** + * Use this event handler to add interactivity to a controlled flow. It is called on edge select + * and remove. + * @example // Use EdgesState hook to create edges and get onEdgesChange handler + * import ReactFlow, { useEdgesState } from '@xyflow/react'; + * const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges); + * + * return () + * @example // Use helper function to update edge + * import ReactFlow, { applyEdgeChanges } from '@xyflow/react'; + * + * const onEdgesChange = useCallback( + * (changes) => setEdges((eds) => applyEdgeChanges(changes, eds)), + * [], + * ); + * + * return () + */ + onEdgesChange?: OnEdgesChange; + /** This event handler gets called when a node is deleted. */ + onNodesDelete?: OnNodesDelete; + /** This event handler gets called when an edge is deleted. */ + onEdgesDelete?: OnEdgesDelete; + /** This event handler gets called when a node or edge is deleted. */ + onDelete?: OnDelete; + /** This event handler gets called when a user starts to drag a selection box. */ + onSelectionDragStart?: SelectionDragHandler; + /** This event handler gets called when a user drags a selection box. */ + onSelectionDrag?: SelectionDragHandler; + /** This event handler gets called when a user stops dragging a selection box. */ + onSelectionDragStop?: SelectionDragHandler; + onSelectionStart?: (event: ReactMouseEvent) => void; + onSelectionEnd?: (event: ReactMouseEvent) => void; + /** + * This event handler is called when a user right-clicks on a node selection. + */ + onSelectionContextMenu?: (event: ReactMouseEvent, nodes: NodeType[]) => void; + /** + * When a connection line is completed and two nodes are connected by the user, this event fires with the new connection. + * You can use the `addEdge` utility to convert the connection to a complete edge. + * @example // Use helper function to update edges onConnect + * import ReactFlow, { addEdge } from '@xyflow/react'; + * + * const onConnect = useCallback( + * (params) => setEdges((eds) => addEdge(params, eds)), + * [], + * ); + * + * return () + */ + onConnect?: OnConnect; + /** This event handler gets called when a user starts to drag a connection line. */ + onConnectStart?: OnConnectStart; + /** + * This callback will fire regardless of whether a valid connection could be made or not. You can + * use the second `connectionState` parameter to have different behavior when a connection was + * unsuccessful. + */ + onConnectEnd?: OnConnectEnd; + onClickConnectStart?: OnConnectStart; + onClickConnectEnd?: OnConnectEnd; + /** + * The `onInit` callback is called when the viewport is initialized. At this point you can use the + * instance to call methods like `fitView` or `zoomTo`. + */ + onInit?: OnInit; + /** This event handler is called while the user is either panning or zooming the viewport. */ + onMove?: OnMove; + /** This event handler is called when the user begins to pan or zoom the viewport. */ + onMoveStart?: OnMoveStart; + /** + * This event handler is called when panning or zooming viewport movement stops. + * If the movement is not user-initiated, the event parameter will be `null`. + */ + onMoveEnd?: OnMoveEnd; + /** This event handler gets called when a user changes group of selected elements in the flow. */ + onSelectionChange?: OnSelectionChangeFunc; + /** This event handler gets called when user scroll inside the pane. */ + onPaneScroll?: (event?: WheelEvent) => void; + /** This event handler gets called when user clicks inside the pane. */ + onPaneClick?: (event: ReactMouseEvent) => void; + /** This event handler gets called when user right clicks inside the pane. */ + onPaneContextMenu?: (event: ReactMouseEvent | MouseEvent) => void; + /** This event handler gets called when mouse enters the pane. */ + onPaneMouseEnter?: (event: ReactMouseEvent) => void; + /** This event handler gets called when mouse moves over the pane. */ + onPaneMouseMove?: (event: ReactMouseEvent) => void; + /** This event handler gets called when mouse leaves the pane. */ + onPaneMouseLeave?: (event: ReactMouseEvent) => void; + /** + * Distance that the mouse can move between mousedown/up that will trigger a click. + * @default 0 + */ + paneClickDistance?: number; + /** + * Distance that the mouse can move between mousedown/up that will trigger a click. + * @default 0 + */ + nodeClickDistance?: number; + /** + * This handler is called before nodes or edges are deleted, allowing the deletion to be aborted + * by returning `false` or modified by returning updated nodes and edges. + */ + onBeforeDelete?: OnBeforeDelete; + /** + * Custom node types to be available in a flow. + * React Flow matches a node's type to a component in the `nodeTypes` object. + * @default { + * input: InputNode, + * default: DefaultNode, + * output: OutputNode, + * group: GroupNode + * } + * @example + * import CustomNode from './CustomNode'; + * + * const nodeTypes = { nameOfNodeType: CustomNode }; + */ + nodeTypes?: NodeTypes; + /** + * Custom edge types to be available in a flow. + * React Flow matches an edge's type to a component in the `edgeTypes` object. + * @default { + * default: BezierEdge, + * straight: StraightEdge, + * step: StepEdge, + * smoothstep: SmoothStepEdge, + * simplebezier: SimpleBezier + * } + * @example + * import CustomEdge from './CustomEdge'; + * + * const edgeTypes = { nameOfEdgeType: CustomEdge }; + */ + edgeTypes?: EdgeTypes; + /** + * The type of edge path to use for connection lines. + * Although created edges can be of any type, React Flow needs to know what type of path to render for the connection line before the edge is created! + * @default ConnectionLineType.Bezier + */ + connectionLineType?: ConnectionLineType; + /** Styles to be applied to the connection line. */ + connectionLineStyle?: CSSProperties; + /** React Component to be used as a connection line. */ + connectionLineComponent?: ConnectionLineComponent; + /** Styles to be applied to the container of the connection line. */ + connectionLineContainerStyle?: CSSProperties; + /** + * A loose connection mode will allow you to connect handles with differing types, including + * source-to-source connections. However, it does not support target-to-target connections. Strict + * mode allows only connections between source handles and target handles. + * @default 'strict' + */ + connectionMode?: ConnectionMode; + /** + * If set, pressing the key or chord will delete any selected nodes and edges. Passing an array + * represents multiple keys that can be pressed. + + * For example, `["Delete", "Backspace"]` will delete selected elements when either key is pressed. + * @default 'Backspace' + */ + deleteKeyCode?: KeyCode | null; + /** + * If set, holding this key will let you click and drag to draw a selection box around multiple + * nodes and edges. Passing an array represents multiple keys that can be pressed. + * + * For example, `["Shift", "Meta"]` will allow you to draw a selection box when either key is + * pressed. + * @default 'Shift' + */ + selectionKeyCode?: KeyCode | null; + /** + * Select multiple elements with a selection box, without pressing down `selectionKey`. + * @default false + */ + selectionOnDrag?: boolean; + /** + * When set to `"partial"`, when the user creates a selection box by click and dragging nodes that + * are only partially in the box are still selected. + * @default 'full' + */ + selectionMode?: SelectionMode; + /** + * If a key is set, you can pan the viewport while that key is held down even if `panOnScroll` + * is set to `false`. + * + * By setting this prop to `null` you can disable this functionality. + * @default 'Space' + */ + panActivationKeyCode?: KeyCode | null; + /** + * Pressing down this key you can select multiple elements by clicking. + * @default "Meta" for macOS, "Control" for other systems + */ + multiSelectionKeyCode?: KeyCode | null; + /** + * If a key is set, you can zoom the viewport while that key is held down even if `panOnScroll` + * is set to `false`. + * + * By setting this prop to `null` you can disable this functionality. + * @default "Meta" for macOS, "Control" for other systems + * + */ + zoomActivationKeyCode?: KeyCode | null; + /** When enabled, nodes will snap to the grid when dragged. */ + snapToGrid?: boolean; + /** + * If `snapToGrid` is enabled, this prop configures the grid that nodes will snap to. + * @example [20, 20] + */ + snapGrid?: SnapGrid; + /** + * You can enable this optimisation to instruct React Flow to only render nodes and edges that would be visible in the viewport. + * + * This might improve performance when you have a large number of nodes and edges but also adds an overhead. + * @default false + */ + onlyRenderVisibleElements?: boolean; + /** + * Controls whether all nodes should be draggable or not. Individual nodes can override this + * setting by setting their `draggable` prop. If you want to use the mouse handlers on + * non-draggable nodes, you need to add the `"nopan"` class to those nodes. + * @default true + */ + nodesDraggable?: boolean; + /** + * When `true`, the viewport will pan when a node is focused. + * @default true + */ + autoPanOnNodeFocus?: boolean; + /** + * Controls whether all nodes should be connectable or not. Individual nodes can override this + * setting by setting their `connectable` prop. + * @default true + */ + nodesConnectable?: boolean; + /** + * When `true`, focus between nodes can be cycled with the `Tab` key and selected with the `Enter` + * key. This option can be overridden by individual nodes by setting their `focusable` prop. + * @default true + */ + nodesFocusable?: boolean; + /** + * The origin of the node to use when placing it in the flow or looking up its `x` and `y` + * position. An origin of `[0, 0]` means that a node's top left corner will be placed at the `x` + * and `y` position. + * @default [0, 0] + * @example + * [0, 0] // default, top left + * [0.5, 0.5] // center + * [1, 1] // bottom right + */ + nodeOrigin?: NodeOrigin; + /** + * When `true`, focus between edges can be cycled with the `Tab` key and selected with the `Enter` + * key. This option can be overridden by individual edges by setting their `focusable` prop. + * @default true + */ + edgesFocusable?: boolean; + /** + * Whether edges can be updated once they are created. When both this prop is `true` and an + * `onReconnect` handler is provided, the user can drag an existing edge to a new source or + * target. Individual edges can override this value with their reconnectable property. + * @default true + */ + edgesReconnectable?: boolean; + /** + * When `true`, elements (nodes and edges) can be selected by clicking on them. This option can be + * overridden by individual elements by setting their `selectable` prop. + * @default true + */ + elementsSelectable?: boolean; + /** + * If `true`, nodes get selected on drag. + * @default true + */ + selectNodesOnDrag?: boolean; + /** + * Enabling this prop allows users to pan the viewport by clicking and dragging. + * You can also set this prop to an array of numbers to limit which mouse buttons can activate panning. + * @default true + * @example [0, 2] // allows panning with the left and right mouse buttons + * [0, 1, 2, 3, 4] // allows panning with all mouse buttons + */ + panOnDrag?: boolean | number[]; + /** + * Minimum zoom level. + * @default 0.5 + */ + minZoom?: number; + /** + * Maximum zoom level. + * @default 2 + */ + maxZoom?: number; + /** + * When you pass a `viewport` prop, it's controlled, and you also need to pass `onViewportChange` + * to handle internal changes. + */ + viewport?: Viewport; + /** + * Sets the initial position and zoom of the viewport. If a default viewport is provided but + * `fitView` is enabled, the default viewport will be ignored. + * @default { x: 0, y: 0, zoom: 1 } + * @example + * const initialViewport = { + * zoom: 0.5, + * position: { x: 0, y: 0 } + * }; + */ + defaultViewport?: Viewport; + /** + * Used when working with a controlled viewport for updating the user viewport state. + */ + onViewportChange?: (viewport: Viewport) => void; + /** + * By default, the viewport extends infinitely. You can use this prop to set a boundary. + * The first pair of coordinates is the top left boundary and the second pair is the bottom right. + * @default [[-∞, -∞], [+∞, +∞]] + * @example [[-1000, -10000], [1000, 1000]] + */ + translateExtent?: CoordinateExtent; + /** + * Disabling this prop will allow the user to scroll the page even when their pointer is over the flow. + * @default true + */ + preventScrolling?: boolean; + /** + * By default, nodes can be placed on an infinite flow. You can use this prop to set a boundary. + * The first pair of coordinates is the top left boundary and the second pair is the bottom right. + * @example [[-1000, -10000], [1000, 1000]] + */ + nodeExtent?: CoordinateExtent; + /** + * Color of edge markers. + * @default '#b1b1b7' + */ + defaultMarkerColor?: string; + /** + * Controls if the viewport should zoom by scrolling inside the container. + * @default true + */ + zoomOnScroll?: boolean; + /** + * Controls if the viewport should zoom by pinching on a touch screen. + * @default true + */ + zoomOnPinch?: boolean; + /** + * Controls if the viewport should pan by scrolling inside the container. + * Can be limited to a specific direction with `panOnScrollMode`. + * @default false + */ + panOnScroll?: boolean; + /** + * Controls how fast viewport should be panned on scroll. + * Use together with `panOnScroll` prop. + * @default 0.5 + */ + panOnScrollSpeed?: number; + /** + * This prop is used to limit the direction of panning when `panOnScroll` is enabled. + * The `"free"` option allows panning in any direction. + * @default "free" + * @example "horizontal" | "vertical" + */ + panOnScrollMode?: PanOnScrollMode; + /** + * Controls if the viewport should zoom by double-clicking somewhere on the flow. + * @default true + */ + zoomOnDoubleClick?: boolean; + /** + * The radius around an edge connection that can trigger an edge reconnection. + * @default 10 + */ + reconnectRadius?: number; + /** + * If a node is draggable, clicking and dragging that node will move it around the canvas. Adding + * the `"nodrag"` class prevents this behavior and this prop allows you to change the name of that + * class. + * @default "nodrag" + */ + noDragClassName?: string; + /** + * Typically, scrolling the mouse wheel when the mouse is over the canvas will zoom the viewport. + * Adding the `"nowheel"` class to an element n the canvas will prevent this behavior and this prop + * allows you to change the name of that class. + * @default "nowheel" + */ + noWheelClassName?: string; + /** + * If an element in the canvas does not stop mouse events from propagating, clicking and dragging + * that element will pan the viewport. Adding the `"nopan"` class prevents this behavior and this + * prop allows you to change the name of that class. + * @default "nopan" + */ + noPanClassName?: string; + /** When `true`, the flow will be zoomed and panned to fit all the nodes initially provided. */ + fitView?: boolean; + /** + * When you typically call `fitView` on a `ReactFlowInstance`, you can provide an object of + * options to customize its behavior. This prop lets you do the same for the initial `fitView` + * call. + * @example + * const fitViewOptions = { + * padding: 0.1, + * includeHiddenNodes: false, + * minZoom: 0.1, + * maxZoom: 1, + * duration: 200, + * nodes: [{id: 'node-1'}, {id: 'node-2'}], // nodes to fit + * }; + */ + fitViewOptions?: FitViewOptions; + /** + * The `connectOnClick` option lets you click or tap on a source handle to start a connection + * and then click on a target handle to complete the connection. + * + * If you set this option to `false`, users will need to drag the connection line to the target + * handle to create a connection. + * @default true + */ + connectOnClick?: boolean; + /** + * By default, React Flow will render a small attribution in the bottom right corner of the flow. + * + * You can use this prop to change its position in case you want to place something else there. + * @default 'bottom-right' + * @example 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' + */ + attributionPosition?: PanelPosition; + /** + * By default, we render a small attribution in the corner of your flows that links back to the project. + * + * Anyone is free to remove this attribution whether they're a Pro subscriber or not + * but we ask that you take a quick look at our {@link https://reactflow.dev/learn/troubleshooting/remove-attribution | removing attribution guide} + * before doing so. + */ + proOptions?: ProOptions; + /** + * Enabling this option will raise the z-index of nodes when they are selected. + * @default true + */ + elevateNodesOnSelect?: boolean; + /** + * Enabling this option will raise the z-index of edges when they are selected. + */ + elevateEdgesOnSelect?: boolean; + /** + * You can use this prop to disable keyboard accessibility features such as selecting nodes or + * moving selected nodes with the arrow keys. + * @default false + */ + disableKeyboardA11y?: boolean; + /** + * When `true`, the viewport will pan automatically when the cursor moves to the edge of the + * viewport while dragging a node. + * @default true + */ + autoPanOnNodeDrag?: boolean; + /** + * When `true`, the viewport will pan automatically when the cursor moves to the edge of the + * viewport while creating a connection. + * @default true + */ + autoPanOnConnect?: boolean; + /** + * The speed at which the viewport pans while dragging a node or a selection box. + * @default 15 + */ + autoPanSpeed?: number; + /** + * The radius around a handle where you drop a connection line to create a new edge. + * @default 20 + */ + connectionRadius?: number; + /** + * Occasionally something may happen that causes React Flow to throw an error. + * + * Instead of exploding your application, we log a message to the console and then call this event handler. + * You might use it for additional logging or to show a message to the user. + */ + onError?: OnError; + /** + * This callback can be used to validate a new connection + * + * If you return `false`, the edge will not be added to your flow. + * If you have custom connection logic its preferred to use this callback over the + * `isValidConnection` prop on the handle component for performance reasons. + */ + isValidConnection?: IsValidConnection; + /** + * With a threshold greater than zero you can delay node drag events. + * If threshold equals 1, you need to drag the node 1 pixel before a drag event is fired. + * 1 is the default value, so that clicks don't trigger drag events. + * @default 1 + */ + nodeDragThreshold?: number; + /** Sets a fixed width for the flow. */ + width?: number; + /** Sets a fixed height for the flow. */ + height?: number; + /** + * Controls color scheme used for styling the flow. + * @default 'light' + * @example 'system' | 'light' | 'dark' + */ + colorMode?: ColorMode; + /** + * If set `true`, some debug information will be logged to the console like which events are fired. + * @default false + */ + debug?: boolean; + /** + * Configuration for customizable labels, descriptions, and UI text. Provided keys will override the corresponding defaults. + * Allows localization, customization of ARIA descriptions, control labels, minimap labels, and other UI strings. + */ + ariaLabelConfig?: Partial; +} +//# sourceMappingURL=component-props.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/types/component-props.d.ts.map b/node_modules/@xyflow/react/dist/umd/types/component-props.d.ts.map new file mode 100644 index 0000000..6b9f25d --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/types/component-props.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"component-props.d.ts","sourceRoot":"","sources":["../../src/types/component-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,IAAI,eAAe,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACtG,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,SAAS,EACT,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,OAAO,EACP,eAAe,EACf,UAAU,EACV,aAAa,EACb,MAAM,EACN,WAAW,EACX,SAAS,EACT,QAAQ,EACR,UAAU,EACV,UAAU,EACV,aAAa,EACb,OAAO,EACP,SAAS,EACT,QAAQ,EACR,WAAW,EACX,eAAe,EAChB,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EACV,qBAAqB,EACrB,SAAS,EACT,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,uBAAuB,EACvB,MAAM,EACN,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,aAAa,EACb,QAAQ,EACR,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,iBAAiB,EAClB,MAAM,GAAG,CAAC;AAEX;;;GAGG;AACH,MAAM,WAAW,cAAc,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,CACxF,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,SAAS,CAAC;IACvD;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IACnB;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IACnB,2DAA2D;IAC3D,YAAY,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC1B,2DAA2D;IAC3D,YAAY,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC1B;;;;;;;;OAQG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,iEAAiE;IACjE,WAAW,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACzC,wEAAwE;IACxE,iBAAiB,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC/C,uEAAuE;IACvE,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC9C,2EAA2E;IAC3E,eAAe,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC7C,uEAAuE;IACvE,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC9C,uEAAuE;IACvE,iBAAiB,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC/C,sEAAsE;IACtE,eAAe,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IACvC,6DAA6D;IAC7D,UAAU,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IAClC,sEAAsE;IACtE,cAAc,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IACtC,kEAAkE;IAClE,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC/D,wEAAwE;IACxE,iBAAiB,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC/C,wEAAwE;IACxE,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC9C,4EAA4E;IAC5E,eAAe,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC7C,wEAAwE;IACxE,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC9C,yEAAyE;IACzE,iBAAiB,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC/C;;;;OAIG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;IACpC;;OAEG;IACH,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IAC5F;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IAClG;;;;;;;;;;;;;;;;;OAiBG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IACxC;;;;;;;;;;;;;;;;;OAiBG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IACxC,6DAA6D;IAC7D,aAAa,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IACxC,8DAA8D;IAC9D,aAAa,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IACxC,qEAAqE;IACrE,QAAQ,CAAC,EAAE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACxC,iFAAiF;IACjF,oBAAoB,CAAC,EAAE,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IACtD,wEAAwE;IACxE,eAAe,CAAC,EAAE,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IACjD,iFAAiF;IACjF,mBAAmB,CAAC,EAAE,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IACrD,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IACpD,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IAClD;;OAEG;IACH,sBAAsB,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;IAC7E;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,mFAAmF;IACnF,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;;;OAIG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,mBAAmB,CAAC,EAAE,cAAc,CAAC;IACrC,iBAAiB,CAAC,EAAE,YAAY,CAAC;IACjC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACpC,6FAA6F;IAC7F,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qFAAqF;IACrF,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,iGAAiG;IACjG,iBAAiB,CAAC,EAAE,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC9D,uEAAuE;IACvE,YAAY,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IAC5C,uEAAuE;IACvE,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IAC/C,6EAA6E;IAC7E,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,GAAG,UAAU,KAAK,IAAI,CAAC;IAClE,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IACpD,qEAAqE;IACrE,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IACnD,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IACpD;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACpD;;;;;;;;;;;;;OAaG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;;;;;;;;;;;OAcG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,mDAAmD;IACnD,mBAAmB,CAAC,EAAE,aAAa,CAAC;IACpC,uDAAuD;IACvD,uBAAuB,CAAC,EAAE,uBAAuB,CAAC,QAAQ,CAAC,CAAC;IAC5D,oEAAoE;IACpE,4BAA4B,CAAC,EAAE,aAAa,CAAC;IAC7C;;;;;OAKG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC/B;;;;;;;OAOG;IACH,gBAAgB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAClC;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;;;;;OAMG;IACH,oBAAoB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACtC;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACvC;;;;;;;OAOG;IACH,qBAAqB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACvC,8DAA8D;IAC9D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB;;;;;OAKG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;;;;;;OASG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAC;IAC/B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB;;;;;;;;;OASG;IACH,eAAe,CAAC,EAAE,QAAQ,CAAC;IAC3B;;OAEG;IACH,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;IAChD;;;;;OAKG;IACH,eAAe,CAAC,EAAE,gBAAgB,CAAC;IACnC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;OAIG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;;OAKG;IACH,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,+FAA+F;IAC/F,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;;;;;;;OAaG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,aAAa,CAAC;IACpC;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAChD;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CAC5C"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/types/edges.d.ts b/node_modules/@xyflow/react/dist/umd/types/edges.d.ts new file mode 100644 index 0000000..62778d3 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/types/edges.d.ts @@ -0,0 +1,216 @@ +import type { CSSProperties, SVGAttributes, ReactNode, MouseEvent as ReactMouseEvent, ComponentType, AriaRole } from 'react'; +import type { EdgeBase, BezierPathOptions, Position, SmoothStepPathOptions, DefaultEdgeOptionsBase, HandleType, ConnectionLineType, Handle, EdgePosition, StepPathOptions, OnError, OnReconnect, FinalConnectionState } from '@xyflow/system'; +import { EdgeTypes, InternalNode, Node } from '.'; +/** + * @inline + */ +export type EdgeLabelOptions = { + /** + * The label or custom element to render along the edge. This is commonly a text label or some + * custom controls. + */ + label?: ReactNode; + /** + * Custom styles to apply to the label. + */ + labelStyle?: CSSProperties; + labelShowBg?: boolean; + labelBgStyle?: CSSProperties; + labelBgPadding?: [number, number]; + labelBgBorderRadius?: number; +}; +/** + * An `Edge` is the complete description with everything React Flow needs + * to know in order to render it. + * @public + */ +export type Edge = Record, EdgeType extends string | undefined = string | undefined> = EdgeBase & EdgeLabelOptions & { + style?: CSSProperties; + className?: string; + /** + * Determines whether the edge can be updated by dragging the source or target to a new node. + * This property will override the default set by the `edgesReconnectable` prop on the + * `` component. + */ + reconnectable?: boolean | HandleType; + focusable?: boolean; + /** + * The ARIA role attribute for the edge, used for accessibility. + * @default "group" + */ + ariaRole?: AriaRole; + /** + * General escape hatch for adding custom attributes to the edge's DOM element. + */ + domAttributes?: Omit, 'id' | 'style' | 'className' | 'role' | 'aria-label'>; +}; +type SmoothStepEdge = Record> = Edge & { + pathOptions?: SmoothStepPathOptions; +}; +type BezierEdge = Record> = Edge & { + pathOptions?: BezierPathOptions; +}; +type StepEdge = Record> = Edge & { + pathOptions?: StepPathOptions; +}; +type StraightEdge = Record> = Edge; +export type BuiltInEdge = SmoothStepEdge | BezierEdge | StepEdge | StraightEdge; +export type EdgeMouseHandler = (event: ReactMouseEvent, edge: EdgeType) => void; +export type EdgeWrapperProps = { + id: string; + edgesFocusable: boolean; + edgesReconnectable: boolean; + elementsSelectable: boolean; + noPanClassName: string; + onClick?: EdgeMouseHandler; + onDoubleClick?: EdgeMouseHandler; + onReconnect?: OnReconnect; + onContextMenu?: EdgeMouseHandler; + onMouseEnter?: EdgeMouseHandler; + onMouseMove?: EdgeMouseHandler; + onMouseLeave?: EdgeMouseHandler; + reconnectRadius?: number; + onReconnectStart?: (event: ReactMouseEvent, edge: EdgeType, handleType: HandleType) => void; + onReconnectEnd?: (event: MouseEvent | TouchEvent, edge: EdgeType, handleType: HandleType, connectionState: FinalConnectionState) => void; + rfId?: string; + edgeTypes?: EdgeTypes; + onError?: OnError; + disableKeyboardA11y?: boolean; +}; +/** + * Many properties on an [`Edge`](/api-reference/types/edge) are optional. When a new edge is created, + * the properties that are not provided will be filled in with the default values + * passed to the `defaultEdgeOptions` prop of the [``](/api-reference/react-flow#defaultedgeoptions) component. + */ +export type DefaultEdgeOptions = DefaultEdgeOptionsBase; +export type EdgeTextProps = Omit, 'x' | 'y'> & EdgeLabelOptions & { + /** The x position where the label should be rendered. */ + x: number; + /** The y position where the label should be rendered. */ + y: number; +}; +/** + * When you implement a custom edge it is wrapped in a component that enables some + * basic functionality. The `EdgeProps` type is the props that are passed to this. + * @public + * @expand + */ +export type EdgeProps = Pick & EdgePosition & EdgeLabelOptions & { + sourceHandleId?: string | null; + targetHandleId?: string | null; + markerStart?: string; + markerEnd?: string; + pathOptions?: any; + interactionWidth?: number; +}; +/** + * BaseEdge component props + * @public + * @expand + */ +export type BaseEdgeProps = Omit, 'd' | 'path' | 'markerStart' | 'markerEnd'> & EdgeLabelOptions & { + /** + * The width of the invisible area around the edge that the user can interact with. This is + * useful for making the edge easier to click or hover over. + * @default 20 + */ + interactionWidth?: number; + /** The x position of edge label */ + labelX?: number; + /** The y position of edge label */ + labelY?: number; + /** + * The SVG path string that defines the edge. This should look something like + * `'M 0 0 L 100 100'` for a simple line. The utility functions like `getSimpleBezierEdge` can + * be used to generate this string for you. + */ + path: string; + /** + * The id of the SVG marker to use at the start of the edge. This should be defined in a + * `` element in a separate SVG document or element. + */ + markerStart?: string; + /** + * The id of the SVG marker to use at the end of the edge. This should be defined in a `` + * element in a separate SVG document or element. + */ + markerEnd?: string; +}; +/** + * Helper type for edge components that get exported by the library + * @public + * @expand + */ +export type EdgeComponentProps = EdgePosition & EdgeLabelOptions & { + id?: EdgeProps['id']; + markerStart?: EdgeProps['markerStart']; + markerEnd?: EdgeProps['markerEnd']; + interactionWidth?: EdgeProps['interactionWidth']; + style?: EdgeProps['style']; + sourceHandleId?: EdgeProps['sourceHandleId']; + targetHandleId?: EdgeProps['targetHandleId']; +}; +export type EdgeComponentWithPathOptions = EdgeComponentProps & { + pathOptions?: PathOptions; +}; +/** + * BezierEdge component props + * @public + * @expand + */ +export type BezierEdgeProps = EdgeComponentWithPathOptions; +/** + * SmoothStepEdge component props + * @public + * @expand + */ +export type SmoothStepEdgeProps = EdgeComponentWithPathOptions; +/** + * StepEdge component props + * @public + * @expand + */ +export type StepEdgeProps = EdgeComponentWithPathOptions; +/** + * StraightEdge component props + * @public + * @expand + */ +export type StraightEdgeProps = Omit; +/** + * SimpleBezier component props + * @public + * @expand + */ +export type SimpleBezierEdgeProps = EdgeComponentProps; +/** + * If you want to render a custom component for connection lines, you can set the + * `connectionLineComponent` prop on the [``](/api-reference/react-flow#connection-connectionLineComponent) + * component. The `ConnectionLineComponentProps` are passed to your custom component. + * + * @public + */ +export type ConnectionLineComponentProps = { + connectionLineStyle?: CSSProperties; + connectionLineType: ConnectionLineType; + /** The node the connection line originates from. */ + fromNode: InternalNode; + /** The handle on the `fromNode` that the connection line originates from. */ + fromHandle: Handle; + fromX: number; + fromY: number; + toX: number; + toY: number; + fromPosition: Position; + toPosition: Position; + /** + * If there is an `isValidConnection` callback, this prop will be set to `"valid"` or `"invalid"` + * based on the return value of that callback. Otherwise, it will be `null`. + */ + connectionStatus: 'valid' | 'invalid' | null; + toNode: InternalNode | null; + toHandle: Handle | null; +}; +export type ConnectionLineComponent = ComponentType>; +export {}; +//# sourceMappingURL=edges.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/types/edges.d.ts.map b/node_modules/@xyflow/react/dist/umd/types/edges.d.ts.map new file mode 100644 index 0000000..7c36d7d --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/types/edges.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"edges.d.ts","sourceRoot":"","sources":["../../src/types/edges.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,SAAS,EACT,UAAU,IAAI,eAAe,EAC7B,aAAa,EACb,QAAQ,EACT,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EACV,QAAQ,EACR,iBAAiB,EACjB,QAAQ,EACR,qBAAqB,EACrB,sBAAsB,EACtB,UAAU,EACV,kBAAkB,EAClB,MAAM,EACN,YAAY,EACZ,eAAe,EACf,OAAO,EACP,WAAW,EACX,oBAAoB,EACrB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,IAAI,CACd,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClE,QAAQ,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,IACtD,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAC9B,gBAAgB,GAAG;IACjB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IACrC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,EAAE,IAAI,GAAG,OAAO,GAAG,WAAW,GAAG,MAAM,GAAG,YAAY,CAAC,CAAC;CACxG,CAAC;AAEJ,KAAK,cAAc,CAAC,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,IAAI,CAC5F,QAAQ,EACR,YAAY,CACb,GAAG;IACF,WAAW,CAAC,EAAE,qBAAqB,CAAC;CACrC,CAAC;AAEF,KAAK,UAAU,CAAC,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,GAAG;IAChH,WAAW,CAAC,EAAE,iBAAiB,CAAC;CACjC,CAAC;AAEF,KAAK,QAAQ,CAAC,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG;IAC3G,WAAW,CAAC,EAAE,eAAe,CAAC;CAC/B,CAAC;AAEF,KAAK,YAAY,CAAC,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;AAEnH,MAAM,MAAM,WAAW,GAAG,cAAc,GAAG,UAAU,GAAG,QAAQ,GAAG,YAAY,CAAC;AAEhF,MAAM,MAAM,gBAAgB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;AAE9G,MAAM,MAAM,gBAAgB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI;IAC3D,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,OAAO,CAAC;IACxB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACrC,aAAa,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC3C,WAAW,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;IACpC,aAAa,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC3C,YAAY,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC1C,WAAW,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACzC,YAAY,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC1C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IAC5F,cAAc,CAAC,EAAE,CACf,KAAK,EAAE,UAAU,GAAG,UAAU,EAC9B,IAAI,EAAE,QAAQ,EACd,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,oBAAoB,KAClC,IAAI,CAAC;IACV,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,sBAAsB,CAAC,IAAI,CAAC,CAAC;AAE9D,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC,GACpE,gBAAgB,GAAG;IACjB,yDAAyD;IACzD,CAAC,EAAE,MAAM,CAAC;IACV,yDAAyD;IACzD,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEJ;;;;;GAKG;AACH,MAAM,MAAM,SAAS,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,IAAI,CACxD,QAAQ,EACR,IAAI,GAAG,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,YAAY,GAAG,WAAW,CACrG,GACC,YAAY,GACZ,gBAAgB,GAAG;IACjB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEJ;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,EAAE,GAAG,GAAG,MAAM,GAAG,aAAa,GAAG,WAAW,CAAC,GACzG,gBAAgB,GAAG;IACjB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mCAAmC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mCAAmC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEJ;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAC3C,gBAAgB,GAAG;IACjB,EAAE,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;IACrB,WAAW,CAAC,EAAE,SAAS,CAAC,aAAa,CAAC,CAAC;IACvC,SAAS,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IACnC,gBAAgB,CAAC,EAAE,SAAS,CAAC,kBAAkB,CAAC,CAAC;IACjD,KAAK,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC3B,cAAc,CAAC,EAAE,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC7C,cAAc,CAAC,EAAE,SAAS,CAAC,gBAAgB,CAAC,CAAC;CAC9C,CAAC;AAEJ,MAAM,MAAM,4BAA4B,CAAC,WAAW,IAAI,kBAAkB,GAAG;IAC3E,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,4BAA4B,CAAC,iBAAiB,CAAC,CAAC;AAE9E;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,4BAA4B,CAAC,qBAAqB,CAAC,CAAC;AAEtF;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,4BAA4B,CAAC,eAAe,CAAC,CAAC;AAE1E;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,kBAAkB,EAAE,gBAAgB,GAAG,gBAAgB,CAAC,CAAC;AAE9F;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;AAEvD;;;;;;GAMG;AACH,MAAM,MAAM,4BAA4B,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI;IACvE,mBAAmB,CAAC,EAAE,aAAa,CAAC;IACpC,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,oDAAoD;IACpD,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;IACjC,6EAA6E;IAC7E,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,QAAQ,CAAC;IACvB,UAAU,EAAE,QAAQ,CAAC;IACrB;;;OAGG;IACH,gBAAgB,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC;IAC7C,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;IACtC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,uBAAuB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,aAAa,CAC/E,4BAA4B,CAAC,QAAQ,CAAC,CACvC,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/types/general.d.ts b/node_modules/@xyflow/react/dist/umd/types/general.d.ts new file mode 100644 index 0000000..7ef83e6 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/types/general.d.ts @@ -0,0 +1,164 @@ +import { ComponentType } from 'react'; +import { FitViewParamsBase, FitViewOptionsBase, ZoomInOut, ZoomTo, SetViewport, GetZoom, GetViewport, SetCenter, FitBounds, XYPosition, OnBeforeDeleteBase, Connection, NodeChange, EdgeChange } from '@xyflow/system'; +import type { Node, Edge, ReactFlowInstance, EdgeProps, NodeProps } from '.'; +/** + * This type can be used to type the `onNodesChange` function with a custom node type. + * + * @public + * + * @example + * + * ```ts + * const onNodesChange: OnNodesChange = useCallback((changes) => { + * setNodes((nodes) => applyNodeChanges(nodes, changes)); + * },[]); + * ``` + */ +export type OnNodesChange = (changes: NodeChange[]) => void; +/** + * This type can be used to type the `onEdgesChange` function with a custom edge type. + * + * @public + * + * @example + * + * ```ts + * const onEdgesChange: OnEdgesChange = useCallback((changes) => { + * setEdges((edges) => applyEdgeChanges(edges, changes)); + * },[]); + * ``` + */ +export type OnEdgesChange = (changes: EdgeChange[]) => void; +export type OnNodesDelete = (nodes: NodeType[]) => void; +export type OnEdgesDelete = (edges: EdgeType[]) => void; +/** + * This type can be used to type the `onDelete` function with a custom node and edge type. + * + * @public + */ +export type OnDelete = (params: { + nodes: NodeType[]; + edges: EdgeType[]; +}) => void; +export type NodeTypes = Record>; +export type EdgeTypes = Record>; +export type UnselectNodesAndEdgesParams = { + nodes?: NodeType[]; + edges?: EdgeType[]; +}; +export type OnSelectionChangeParams = { + nodes: NodeType[]; + edges: EdgeType[]; +}; +export type OnSelectionChangeFunc = (params: OnSelectionChangeParams) => void; +export type FitViewParams = FitViewParamsBase; +/** + * When calling [`fitView`](/api-reference/types/react-flow-instance#fitview) these options + * can be used to customize the behaviour. For example, the `duration` option can be used to + * transform the viewport smoothly over a given amount of time. + * + * @public + */ +export type FitViewOptions = FitViewOptionsBase; +export type FitView = (fitViewOptions?: FitViewOptions) => Promise; +export type OnInit = (reactFlowInstance: ReactFlowInstance) => void; +/** + * @inline + */ +export type ViewportHelperFunctions = { + /** + * Zooms viewport in by 1.2. + * + * @param options.duration - optional duration. If set, a transition will be applied + */ + zoomIn: ZoomInOut; + /** + * Zooms viewport out by 1 / 1.2. + * + * @param options.duration - optional duration. If set, a transition will be applied + */ + zoomOut: ZoomInOut; + /** + * Zoom the viewport to a given zoom level. Passing in a `duration` will animate the viewport to + * the new zoom level. + * + * @param zoomLevel - the zoom level to set + * @param options.duration - optional duration. If set, a transition will be applied + */ + zoomTo: ZoomTo; + /** + * Get the current zoom level of the viewport. + * + * @returns current zoom as a number + */ + getZoom: GetZoom; + /** + * Sets the current viewport. + * + * @param viewport - the viewport to set + * @param options.duration - optional duration. If set, a transition will be applied + * @param options.ease - optional ease function. + */ + setViewport: SetViewport; + /** + * Returns the current viewport. + * + * @returns Viewport + */ + getViewport: GetViewport; + /** + * Center the viewport on a given position. Passing in a `duration` will animate the viewport to + * the new position. + * + * @param x - x position + * @param y - y position + * @param options.zoom - optional zoom + * @param options.duration - optional duration. If set, a transition will be applied + * @param options.ease - optional ease function. + */ + setCenter: SetCenter; + /** + * A low-level utility function to fit the viewport to a given rectangle. By passing in a + * `duration`, the viewport will animate from its current position to the new position. The + * `padding` option can be used to add space around the bounds. + * + * @param bounds - the bounds ({ x: number, y: number, width: number, height: number }) to fit the view to + * @param options.padding - optional padding + * @param options.duration - optional duration. If set, a transition will be applied + * @param options.ease - optional ease function. + */ + fitBounds: FitBounds; + /** + * With this function you can translate a screen pixel position to a flow position. It is useful + * for implementing drag and drop from a sidebar for example. + * + * @param clientPosition - the screen / client position. When you are working with events you can use event.clientX and event.clientY + * @param options.snapToGrid - if true, the converted position will be snapped to the grid + * @returns position as { x: number, y: number } + * + * @example + * const flowPosition = screenToFlowPosition({ x: event.clientX, y: event.clientY }) + */ + screenToFlowPosition: (clientPosition: XYPosition, options?: { + snapToGrid: boolean; + }) => XYPosition; + /** + * Translate a position inside the flow's canvas to a screen pixel position. + * + * @param flowPosition - the screen / client position. When you are working with events you can use event.clientX and event.clientY + * @returns position as { x: number, y: number } + * + * @example + * const clientPosition = flowToScreenPosition({ x: node.position.x, y: node.position.y }) + */ + flowToScreenPosition: (flowPosition: XYPosition) => XYPosition; +}; +export type OnBeforeDelete = OnBeforeDeleteBase; +export type IsValidConnection = (edge: EdgeType | Connection) => boolean; +//# sourceMappingURL=general.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/types/general.d.ts.map b/node_modules/@xyflow/react/dist/umd/types/general.d.ts.map new file mode 100644 index 0000000..32e6a98 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/types/general.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../src/types/general.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,MAAM,EACN,WAAW,EACX,OAAO,EACP,WAAW,EACX,SAAS,EACT,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,UAAU,EACV,UAAU,EACV,UAAU,EACX,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,iBAAiB,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,CAAC;AAE7E;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,aAAa,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE,KAAK,IAAI,CAAC;AAEpG;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,aAAa,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE,KAAK,IAAI,CAAC;AAEpG,MAAM,MAAM,aAAa,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;AACtF,MAAM,MAAM,aAAa,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;AAEtF;;;;GAIG;AACH,MAAM,MAAM,QAAQ,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CAAC,MAAM,EAAE;IAC1F,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB,KAAK,IAAI,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,MAAM,CAC5B,MAAM,EACN,aAAa,CACX,SAAS,GAAG;IAEV,IAAI,EAAE,GAAG,CAAC;IAEV,IAAI,EAAE,GAAG,CAAC;CACX,CACF,CACF,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,MAAM,CAC5B,MAAM,EACN,aAAa,CACX,SAAS,GAAG;IAEV,IAAI,EAAE,GAAG,CAAC;IAEV,IAAI,EAAE,GAAG,CAAC;CACX,CACF,CACF,CAAC;AAEF,MAAM,MAAM,2BAA2B,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI;IACpG,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,uBAAuB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI;IAChG,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,qBAAqB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CAC9F,MAAM,EAAE,uBAAuB,CAAC,QAAQ,EAAE,QAAQ,CAAC,KAChD,IAAI,CAAC;AAEV,MAAM,MAAM,aAAa,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AAEtF;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,kBAAkB,CAAC,QAAQ,CAAC,CAAC;AACxF,MAAM,MAAM,OAAO,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AACpH,MAAM,MAAM,MAAM,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CAC/E,iBAAiB,EAAE,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,CAAC,KACrD,IAAI,CAAC;AAEV;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC;;;;OAIG;IACH,MAAM,EAAE,SAAS,CAAC;IAClB;;;;OAIG;IACH,OAAO,EAAE,SAAS,CAAC;IACnB;;;;;;OAMG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;;;;OAMG;IACH,WAAW,EAAE,WAAW,CAAC;IACzB;;;;OAIG;IACH,WAAW,EAAE,WAAW,CAAC;IACzB;;;;;;;;;OASG;IACH,SAAS,EAAE,SAAS,CAAC;IACrB;;;;;;;;;OASG;IACH,SAAS,EAAE,SAAS,CAAC;IACrB;;;;;;;;;;OAUG;IACH,oBAAoB,EAAE,CAAC,cAAc,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE;QAAE,UAAU,EAAE,OAAO,CAAA;KAAE,KAAK,UAAU,CAAC;IACpG;;;;;;;;OAQG;IACH,oBAAoB,EAAE,CAAC,YAAY,EAAE,UAAU,KAAK,UAAU,CAAC;CAChE,CAAC;AAEF,MAAM,MAAM,cAAc,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,kBAAkB,CACzG,QAAQ,EACR,QAAQ,CACT,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,QAAQ,GAAG,UAAU,KAAK,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/types/index.d.ts b/node_modules/@xyflow/react/dist/umd/types/index.d.ts new file mode 100644 index 0000000..93a5f0a --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/types/index.d.ts @@ -0,0 +1,7 @@ +export * from './nodes'; +export * from './edges'; +export * from './component-props'; +export * from './general'; +export * from './store'; +export * from './instance'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/types/index.d.ts.map b/node_modules/@xyflow/react/dist/umd/types/index.d.ts.map new file mode 100644 index 0000000..245cc19 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/types/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/types/instance.d.ts b/node_modules/@xyflow/react/dist/umd/types/instance.d.ts new file mode 100644 index 0000000..598377b --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/types/instance.d.ts @@ -0,0 +1,232 @@ +import type { HandleConnection, HandleType, NodeConnection, Rect, Viewport } from '@xyflow/system'; +import type { Node, Edge, ViewportHelperFunctions, InternalNode, FitView } from '.'; +export type ReactFlowJsonObject = { + nodes: NodeType[]; + edges: EdgeType[]; + viewport: Viewport; +}; +export type DeleteElementsOptions = { + nodes?: (Node | { + id: Node['id']; + })[]; + edges?: (Edge | { + id: Edge['id']; + })[]; +}; +/** + * @inline + */ +export type GeneralHelpers = { + /** + * Returns nodes. + * + * @returns nodes array + */ + getNodes: () => NodeType[]; + /** + * Set your nodes array to something else by either overwriting it with a new array or by passing + * in a function to update the existing array. If using a function, it is important to make sure a + * new array is returned instead of mutating the existing array. Calling this function will + * trigger the `onNodesChange` handler in a controlled flow. + * + * @param payload - the nodes to set or a function that receives the current nodes and returns the new nodes + */ + setNodes: (payload: NodeType[] | ((nodes: NodeType[]) => NodeType[])) => void; + /** + * Add one or many nodes to your existing nodes array. Calling this function will trigger the + * `onNodesChange` handler in a controlled flow. + * + * @param payload - the nodes to add + */ + addNodes: (payload: NodeType[] | NodeType) => void; + /** + * Returns a node by id. + * + * @param id - the node id + * @returns the node or undefined if no node was found + */ + getNode: (id: string) => NodeType | undefined; + /** + * Returns an internal node by id. + * + * @param id - the node id + * @returns the internal node or undefined if no node was found + */ + getInternalNode: (id: string) => InternalNode | undefined; + /** + * Returns edges. + * + * @returns edges array + */ + getEdges: () => EdgeType[]; + /** + * Set your edges array to something else by either overwriting it with a new array or by passing + * in a function to update the existing array. If using a function, it is important to make sure a + * new array is returned instead of mutating the existing array. Calling this function will + * trigger the `onEdgesChange` handler in a controlled flow. + * + * @param payload - the edges to set or a function that receives the current edges and returns the new edges + */ + setEdges: (payload: EdgeType[] | ((edges: EdgeType[]) => EdgeType[])) => void; + /** + * Add one or many edges to your existing edges array. Calling this function will trigger the + * `onEdgesChange` handler in a controlled flow. + * + * @param payload - the edges to add + */ + addEdges: (payload: EdgeType[] | EdgeType) => void; + /** + * Returns an edge by id. + * + * @param id - the edge id + * @returns the edge or undefined if no edge was found + */ + getEdge: (id: string) => EdgeType | undefined; + /** + * Returns the nodes, edges and the viewport as a JSON object. + * + * @returns the nodes, edges and the viewport as a JSON object + */ + toObject: () => ReactFlowJsonObject; + /** + * Deletes nodes and edges. + * + * @param params.nodes - optional nodes array to delete + * @param params.edges - optional edges array to delete + * + * @returns a promise that resolves with the deleted nodes and edges + */ + deleteElements: (params: DeleteElementsOptions) => Promise<{ + deletedNodes: Node[]; + deletedEdges: Edge[]; + }>; + /** + * Find all the nodes currently intersecting with a given node or rectangle. The `partially` + * parameter can be set to `true` to include nodes that are only partially intersecting. + * + * @param node - the node or rect to check for intersections + * @param partially - if true, the node is considered to be intersecting if it partially overlaps with the passed node or rect + * @param nodes - optional nodes array to check for intersections + * + * @returns an array of intersecting nodes + */ + getIntersectingNodes: (node: NodeType | { + id: Node['id']; + } | Rect, partially?: boolean, nodes?: NodeType[]) => NodeType[]; + /** + * Determine if a given node or rectangle is intersecting with another rectangle. The `partially` + * parameter can be set to true return `true` even if the node is only partially intersecting. + * + * @param node - the node or rect to check for intersections + * @param area - the rect to check for intersections + * @param partially - if true, the node is considered to be intersecting if it partially overlaps with the passed react + * + * @returns true if the node or rect intersects with the given area + */ + isNodeIntersecting: (node: NodeType | { + id: Node['id']; + } | Rect, area: Rect, partially?: boolean) => boolean; + /** + * Updates a node. + * + * @param id - id of the node to update + * @param nodeUpdate - the node update as an object or a function that receives the current node and returns the node update + * @param options.replace - if true, the node is replaced with the node update, otherwise the changes get merged + * + * @example + * updateNode('node-1', (node) => ({ position: { x: node.position.x + 10, y: node.position.y } })); + */ + updateNode: (id: string, nodeUpdate: Partial | ((node: NodeType) => Partial), options?: { + replace: boolean; + }) => void; + /** + * Updates the data attribute of a node. + * + * @param id - id of the node to update + * @param dataUpdate - the data update as an object or a function that receives the current data and returns the data update + * @param options.replace - if true, the data is replaced with the data update, otherwise the changes get merged + * + * @example + * updateNodeData('node-1', { label: 'A new label' }); + */ + updateNodeData: (id: string, dataUpdate: Partial | ((node: NodeType) => Partial), options?: { + replace: boolean; + }) => void; + /** + * Updates an edge. + * + * @param id - id of the edge to update + * @param edgeUpdate - the edge update as an object or a function that receives the current edge and returns the edge update + * @param options.replace - if true, the edge is replaced with the edge update, otherwise the changes get merged + * + * @example + * updateEdge('edge-1', (edge) => ({ label: 'A new label' })); + */ + updateEdge: (id: string, edgeUpdate: Partial | ((edge: EdgeType) => Partial), options?: { + replace: boolean; + }) => void; + /** + * Updates the data attribute of a edge. + * + * @param id - id of the edge to update + * @param dataUpdate - the data update as an object or a function that receives the current data and returns the data update + * @param options.replace - if true, the data is replaced with the data update, otherwise the changes get merged + * + * @example + * updateEdgeData('edge-1', { label: 'A new label' }); + */ + updateEdgeData: (id: string, dataUpdate: Partial | ((edge: EdgeType) => Partial), options?: { + replace: boolean; + }) => void; + /** + * Returns the bounds of the given nodes or node ids. + * + * @param nodes - the nodes or node ids to calculate the bounds for + * + * @returns the bounds of the given nodes + */ + getNodesBounds: (nodes: (NodeType | InternalNode | string)[]) => Rect; + /** + * Get all the connections of a handle belonging to a specific node. The type parameter be either + * `'source'` or `'target'`. + * @deprecated + * @param type - handle type 'source' or 'target' + * @param id - the handle id (this is only needed if you have multiple handles of the same type, meaning you have to provide a unique id for each handle) + * @param nodeId - the node id the handle belongs to + * @returns an array with handle connections + */ + getHandleConnections: ({ type, id, nodeId, }: { + type: HandleType; + nodeId: string; + id?: string | null; + }) => HandleConnection[]; + /** + * Gets all connections to a node. Can be filtered by handle type and id. + * @param type - handle type 'source' or 'target' + * @param handleId - the handle id (this is only needed if you have multiple handles of the same type, meaning you have to provide a unique id for each handle) + * @param nodeId - the node id the handle belongs to + * @returns an array with handle connections + */ + getNodeConnections: ({ type, handleId, nodeId, }: { + type?: HandleType; + nodeId: string; + handleId?: string | null; + }) => NodeConnection[]; + fitView: FitView; +}; +/** + * The `ReactFlowInstance` provides a collection of methods to query and manipulate + * the internal state of your flow. You can get an instance by using the + * [`useReactFlow`](/api-reference/hooks/use-react-flow) hook or attaching a listener + * to the [`onInit`](/api-reference/react-flow#event-oninit) event. + * + * @public + */ +export type ReactFlowInstance = GeneralHelpers & ViewportHelperFunctions & { + /** + * React Flow needs to mount the viewport to the DOM and initialize its zoom and pan behavior. + * This property tells you when viewport is initialized. + */ + viewportInitialized: boolean; +}; +//# sourceMappingURL=instance.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/types/instance.d.ts.map b/node_modules/@xyflow/react/dist/umd/types/instance.d.ts.map new file mode 100644 index 0000000..9e3bf67 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/types/instance.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"instance.d.ts","sourceRoot":"","sources":["../../src/types/instance.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,cAAc,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACnG,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,uBAAuB,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC;AAEpF,MAAM,MAAM,mBAAmB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI;IAC5F,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,CAAC,EAAE,CAAC,IAAI,GAAG;QAAE,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAA;KAAE,CAAC,EAAE,CAAC;IACtC,KAAK,CAAC,EAAE,CAAC,IAAI,GAAG;QAAE,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAA;KAAE,CAAC,EAAE,CAAC;CACvC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI;IACvF;;;;OAIG;IACH,QAAQ,EAAE,MAAM,QAAQ,EAAE,CAAC;IAC3B;;;;;;;OAOG;IACH,QAAQ,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,QAAQ,EAAE,CAAC,KAAK,IAAI,CAAC;IAC9E;;;;;OAKG;IACH,QAAQ,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,GAAG,QAAQ,KAAK,IAAI,CAAC;IACnD;;;;;OAKG;IACH,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,QAAQ,GAAG,SAAS,CAAC;IAC9C;;;;;OAKG;IACH,eAAe,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,YAAY,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC;IACpE;;;;OAIG;IACH,QAAQ,EAAE,MAAM,QAAQ,EAAE,CAAC;IAC3B;;;;;;;OAOG;IACH,QAAQ,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,QAAQ,EAAE,CAAC,KAAK,IAAI,CAAC;IAC9E;;;;;OAKG;IACH,QAAQ,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,GAAG,QAAQ,KAAK,IAAI,CAAC;IACnD;;;;;OAKG;IACH,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,QAAQ,GAAG,SAAS,CAAC;IAC9C;;;;OAIG;IACH,QAAQ,EAAE,MAAM,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACxD;;;;;;;OAOG;IACH,cAAc,EAAE,CAAC,MAAM,EAAE,qBAAqB,KAAK,OAAO,CAAC;QACzD,YAAY,EAAE,IAAI,EAAE,CAAC;QACrB,YAAY,EAAE,IAAI,EAAE,CAAC;KACtB,CAAC,CAAC;IACH;;;;;;;;;OASG;IACH,oBAAoB,EAAE,CACpB,IAAI,EAAE,QAAQ,GAAG;QAAE,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAA;KAAE,GAAG,IAAI,EAC1C,SAAS,CAAC,EAAE,OAAO,EACnB,KAAK,CAAC,EAAE,QAAQ,EAAE,KACf,QAAQ,EAAE,CAAC;IAChB;;;;;;;;;OASG;IACH,kBAAkB,EAAE,CAAC,IAAI,EAAE,QAAQ,GAAG;QAAE,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAA;KAAE,GAAG,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC;IAC7G;;;;;;;;;OASG;IACH,UAAU,EAAE,CACV,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC,EACvE,OAAO,CAAC,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,KAC3B,IAAI,CAAC;IACV;;;;;;;;;OASG;IACH,cAAc,EAAE,CACd,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EACvF,OAAO,CAAC,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,KAC3B,IAAI,CAAC;IACV;;;;;;;;;OASG;IACH,UAAU,EAAE,CACV,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC,EACvE,OAAO,CAAC,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,KAC3B,IAAI,CAAC;IACV;;;;;;;;;OASG;IACH,cAAc,EAAE,CACd,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EACvF,OAAO,CAAC,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,KAC3B,IAAI,CAAC;IACV;;;;;;OAMG;IACH,cAAc,EAAE,CAAC,KAAK,EAAE,CAAC,QAAQ,GAAG,YAAY,GAAG,MAAM,CAAC,EAAE,KAAK,IAAI,CAAC;IACtE;;;;;;;;OAQG;IACH,oBAAoB,EAAE,CAAC,EACrB,IAAI,EACJ,EAAE,EACF,MAAM,GACP,EAAE;QACD,IAAI,EAAE,UAAU,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC;QACf,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KACpB,KAAK,gBAAgB,EAAE,CAAC;IACzB;;;;;;OAMG;IACH,kBAAkB,EAAE,CAAC,EACnB,IAAI,EACJ,QAAQ,EACR,MAAM,GACP,EAAE;QACD,IAAI,CAAC,EAAE,UAAU,CAAC;QAClB,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAC1B,KAAK,cAAc,EAAE,CAAC;IAWvB,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC5B,CAAC;AACF;;;;;;;GAOG;AACH,MAAM,MAAM,iBAAiB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,cAAc,CACxG,QAAQ,EACR,QAAQ,CACT,GACE,uBAAuB,GAAG;IAC3B;;;OAGG;IACD,mBAAmB,EAAE,OAAO,CAAC;CAC9B,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/types/nodes.d.ts b/node_modules/@xyflow/react/dist/umd/types/nodes.d.ts new file mode 100644 index 0000000..46415c1 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/types/nodes.d.ts @@ -0,0 +1,101 @@ +import type { CSSProperties, MouseEvent as ReactMouseEvent, AriaRole, HTMLAttributes, DOMAttributes } from 'react'; +import type { CoordinateExtent, NodeBase, OnError, NodeProps as NodePropsBase, InternalNodeBase } from '@xyflow/system'; +import { NodeTypes } from './general'; +/** + * The `Node` type represents everything React Flow needs to know about a given node. + * Whenever you want to update a certain attribute of a node, you need to create a new + * node object. + * + * @public + */ +export type Node = Record, NodeType extends string | undefined = string | undefined> = NodeBase & { + style?: CSSProperties; + className?: string; + resizing?: boolean; + focusable?: boolean; + /** + * The ARIA role attribute for the node element, used for accessibility. + * @default "group" + */ + ariaRole?: AriaRole; + /** + * General escape hatch for adding custom attributes to the node's DOM element. + */ + domAttributes?: Omit, 'id' | 'style' | 'className' | 'draggable' | 'role' | 'aria-label' | keyof DOMAttributes>; +}; +/** + * The `InternalNode` type is identical to the base [`Node`](/api-references/types/node) + * type but is extended with some additional properties used internally. + * Some functions and callbacks that return nodes may return an `InternalNode`. + * + * @public + */ +export type InternalNode = InternalNodeBase; +export type NodeMouseHandler = (event: ReactMouseEvent, node: NodeType) => void; +export type SelectionDragHandler = (event: ReactMouseEvent, nodes: NodeType[]) => void; +export type OnNodeDrag = (event: ReactMouseEvent, node: NodeType, nodes: NodeType[]) => void; +export type NodeWrapperProps = { + id: string; + nodesConnectable: boolean; + elementsSelectable: boolean; + nodesDraggable: boolean; + nodesFocusable: boolean; + onClick?: NodeMouseHandler; + onDoubleClick?: NodeMouseHandler; + onMouseEnter?: NodeMouseHandler; + onMouseMove?: NodeMouseHandler; + onMouseLeave?: NodeMouseHandler; + onContextMenu?: NodeMouseHandler; + resizeObserver: ResizeObserver | null; + noDragClassName: string; + noPanClassName: string; + rfId: string; + disableKeyboardA11y: boolean; + nodeTypes?: NodeTypes; + nodeExtent?: CoordinateExtent; + onError?: OnError; + nodeClickDistance?: number; +}; +/** + * The `BuiltInNode` type represents the built-in node types that are available in React Flow. + * You can use this type to extend your custom node type if you still want ot use the built-in ones. + * + * @public + * @example + * ```ts + * type CustomNode = Node<{ value: number }, 'custom'>; + * type MyAppNode = CustomNode | BuiltInNode; + * ``` + */ +export type BuiltInNode = Node<{ + label: string; +}, 'input' | 'output' | 'default'> | Node, 'group'>; +/** + * When you implement a [custom node](/learn/customization/custom-nodes) it is + * wrapped in a component that enables basic functionality like selection and + * dragging. Your custom node receives `NodeProps` as props. + * + * @public + * @example + * ```tsx + *import { useState } from 'react'; + *import { NodeProps, Node } from '@xyflow/react'; + * + *export type CounterNode = Node<{ initialCount?: number }, 'counter'>; + * + *export default function CounterNode(props: NodeProps) { + * const [count, setCount] = useState(props.data?.initialCount ?? 0); + * + * return ( + *
+ *

Count: {count}

+ * + *
+ * ); + *} + *``` + */ +export type NodeProps = NodePropsBase; +//# sourceMappingURL=nodes.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/types/nodes.d.ts.map b/node_modules/@xyflow/react/dist/umd/types/nodes.d.ts.map new file mode 100644 index 0000000..a566f40 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/types/nodes.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../src/types/nodes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,IAAI,eAAe,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACnH,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAExH,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC;;;;;;GAMG;AACH,MAAM,MAAM,IAAI,CACd,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClE,QAAQ,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,IACtD,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG;IACjC,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB;;OAEG;IACH,aAAa,CAAC,EAAE,IAAI,CAClB,cAAc,CAAC,cAAc,CAAC,EAC9B,IAAI,GAAG,OAAO,GAAG,WAAW,GAAG,WAAW,GAAG,MAAM,GAAG,YAAY,GAAG,MAAM,aAAa,CAAC,cAAc,CAAC,CACzG,CAAC;CACH,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,gBAAgB,CAAC,QAAQ,CAAC,CAAC;AAEpF,MAAM,MAAM,gBAAgB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;AAC9G,MAAM,MAAM,oBAAoB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;AACrH,MAAM,MAAM,UAAU,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,CACrD,KAAK,EAAE,eAAe,EACtB,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,QAAQ,EAAE,KACd,IAAI,CAAC;AAEV,MAAM,MAAM,gBAAgB,CAAC,QAAQ,SAAS,IAAI,IAAI;IACpD,EAAE,EAAE,MAAM,CAAC;IACX,gBAAgB,EAAE,OAAO,CAAC;IAC1B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACrC,aAAa,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC3C,YAAY,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC1C,WAAW,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACzC,YAAY,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC1C,aAAa,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC3C,cAAc,EAAE,cAAc,GAAG,IAAI,CAAC;IACtC,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB,EAAE,OAAO,CAAC;IAC7B,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,WAAW,GACnB,IAAI,CAAC;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC,GACvD,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,MAAM,SAAS,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,aAAa,CAAC,QAAQ,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/types/store.d.ts b/node_modules/@xyflow/react/dist/umd/types/store.d.ts new file mode 100644 index 0000000..6c45205 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/types/store.d.ts @@ -0,0 +1,112 @@ +import { ConnectionMode, withResolvers, type ConnectionState, type CoordinateExtent, type InternalNodeUpdate, type UpdateNodePositions, type NodeOrigin, type OnConnect, type OnError, type OnViewportChange, type SelectionRect, type SnapGrid, type Handle, type Transform, type PanZoomInstance, type PanBy, type OnConnectStart, type OnConnectEnd, type OnSelectionDrag, type OnMoveStart, type OnMove, type OnMoveEnd, type UpdateConnection, type EdgeLookup, type ConnectionLookup, type NodeLookup, type NodeChange, type EdgeChange, type ParentLookup, type AriaLabelConfig, SetCenter } from '@xyflow/system'; +import type { Edge, Node, OnNodesChange, OnEdgesChange, DefaultEdgeOptions, FitViewOptions, OnNodesDelete, OnEdgesDelete, OnSelectionChangeFunc, UnselectNodesAndEdgesParams, OnDelete, OnNodeDrag, OnBeforeDelete, IsValidConnection, InternalNode } from '.'; +export type ReactFlowStore = { + rfId: string; + width: number; + height: number; + transform: Transform; + nodes: NodeType[]; + nodesInitialized: boolean; + nodeLookup: NodeLookup>; + parentLookup: ParentLookup>; + edges: EdgeType[]; + edgeLookup: EdgeLookup; + connectionLookup: ConnectionLookup; + onNodesChange: OnNodesChange | null; + onEdgesChange: OnEdgesChange | null; + hasDefaultNodes: boolean; + hasDefaultEdges: boolean; + domNode: HTMLDivElement | null; + paneDragging: boolean; + noPanClassName: string; + panZoom: PanZoomInstance | null; + minZoom: number; + maxZoom: number; + translateExtent: CoordinateExtent; + nodeExtent: CoordinateExtent; + nodeOrigin: NodeOrigin; + nodeDragThreshold: number; + nodesSelectionActive: boolean; + userSelectionActive: boolean; + userSelectionRect: SelectionRect | null; + connection: ConnectionState>; + connectionMode: ConnectionMode; + connectionClickStartHandle: (Pick & Required>) | null; + snapToGrid: boolean; + snapGrid: SnapGrid; + nodesDraggable: boolean; + autoPanOnNodeFocus: boolean; + nodesConnectable: boolean; + nodesFocusable: boolean; + edgesFocusable: boolean; + edgesReconnectable: boolean; + elementsSelectable: boolean; + elevateNodesOnSelect: boolean; + elevateEdgesOnSelect: boolean; + selectNodesOnDrag: boolean; + multiSelectionActive: boolean; + onNodeDragStart?: OnNodeDrag; + onNodeDrag?: OnNodeDrag; + onNodeDragStop?: OnNodeDrag; + onSelectionDragStart?: OnSelectionDrag; + onSelectionDrag?: OnSelectionDrag; + onSelectionDragStop?: OnSelectionDrag; + onMoveStart?: OnMoveStart; + onMove?: OnMove; + onMoveEnd?: OnMoveEnd; + onConnect?: OnConnect; + onConnectStart?: OnConnectStart; + onConnectEnd?: OnConnectEnd; + onClickConnectStart?: OnConnectStart; + onClickConnectEnd?: OnConnectEnd; + connectOnClick: boolean; + defaultEdgeOptions?: DefaultEdgeOptions; + fitViewQueued: boolean; + fitViewOptions: FitViewOptions | undefined; + fitViewResolver: ReturnType> | null; + onNodesDelete?: OnNodesDelete; + onEdgesDelete?: OnEdgesDelete; + onDelete?: OnDelete; + onError?: OnError; + onViewportChangeStart?: OnViewportChange; + onViewportChange?: OnViewportChange; + onViewportChangeEnd?: OnViewportChange; + onBeforeDelete?: OnBeforeDelete; + onSelectionChangeHandlers: OnSelectionChangeFunc[]; + ariaLiveMessage: string; + autoPanOnConnect: boolean; + autoPanOnNodeDrag: boolean; + autoPanSpeed: number; + connectionRadius: number; + isValidConnection?: IsValidConnection; + lib: string; + debug: boolean; + ariaLabelConfig: AriaLabelConfig; +}; +export type ReactFlowActions = { + setNodes: (nodes: NodeType[]) => void; + setEdges: (edges: EdgeType[]) => void; + setDefaultNodesAndEdges: (nodes?: NodeType[], edges?: EdgeType[]) => void; + updateNodeInternals: (updates: Map, params?: { + triggerFitView: boolean; + }) => void; + updateNodePositions: UpdateNodePositions; + resetSelectedElements: () => void; + unselectNodesAndEdges: (params?: UnselectNodesAndEdgesParams) => void; + addSelectedNodes: (nodeIds: string[]) => void; + addSelectedEdges: (edgeIds: string[]) => void; + setMinZoom: (minZoom: number) => void; + setMaxZoom: (maxZoom: number) => void; + setTranslateExtent: (translateExtent: CoordinateExtent) => void; + setNodeExtent: (nodeExtent: CoordinateExtent) => void; + cancelConnection: () => void; + updateConnection: UpdateConnection>; + reset: () => void; + triggerNodeChanges: (changes: NodeChange[]) => void; + triggerEdgeChanges: (changes: EdgeChange[]) => void; + panBy: PanBy; + setCenter: SetCenter; + setPaneClickDistance: (distance: number) => void; +}; +export type ReactFlowState = ReactFlowStore & ReactFlowActions; +//# sourceMappingURL=store.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/types/store.d.ts.map b/node_modules/@xyflow/react/dist/umd/types/store.d.ts.map new file mode 100644 index 0000000..8e3f564 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/types/store.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/types/store.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,aAAa,EACb,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,OAAO,EACZ,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,MAAM,EACX,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,KAAK,EACV,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,SAAS,EACV,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EACV,IAAI,EACJ,IAAI,EACJ,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,aAAa,EACb,qBAAqB,EACrB,2BAA2B,EAC3B,QAAQ,EACR,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,YAAY,EACb,MAAM,GAAG,CAAC;AAEX,MAAM,MAAM,cAAc,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI;IACvF,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,UAAU,EAAE,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC/C,YAAY,EAAE,YAAY,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;IACnD,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,UAAU,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IACjC,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,aAAa,EAAE,aAAa,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;IAC9C,aAAa,EAAE,aAAa,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;IAC9C,eAAe,EAAE,OAAO,CAAC;IACzB,eAAe,EAAE,OAAO,CAAC;IACzB,OAAO,EAAE,cAAc,GAAG,IAAI,CAAC;IAC/B,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,gBAAgB,CAAC;IAClC,UAAU,EAAE,gBAAgB,CAAC;IAC7B,UAAU,EAAE,UAAU,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAE1B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,iBAAiB,EAAE,aAAa,GAAG,IAAI,CAAC;IAExC,UAAU,EAAE,eAAe,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;IACpD,cAAc,EAAE,cAAc,CAAC;IAC/B,0BAA0B,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,GAAG,IAAI,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAEpG,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,QAAQ,CAAC;IAEnB,cAAc,EAAE,OAAO,CAAC;IACxB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,iBAAiB,EAAE,OAAO,CAAC;IAE3B,oBAAoB,EAAE,OAAO,CAAC;IAE9B,eAAe,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IACvC,UAAU,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IAClC,cAAc,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IAEtC,oBAAoB,CAAC,EAAE,eAAe,CAAC;IACvC,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,mBAAmB,CAAC,EAAE,eAAe,CAAC;IAEtC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,YAAY,CAAC,EAAE,YAAY,CAAC;IAE5B,mBAAmB,CAAC,EAAE,cAAc,CAAC;IACrC,iBAAiB,CAAC,EAAE,YAAY,CAAC;IAEjC,cAAc,EAAE,OAAO,CAAC;IACxB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IAExC,aAAa,EAAE,OAAO,CAAC;IACvB,cAAc,EAAE,cAAc,GAAG,SAAS,CAAC;IAC3C,eAAe,EAAE,UAAU,CAAC,OAAO,aAAa,CAAC,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAElE,aAAa,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IACxC,aAAa,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IACxC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAGlB,qBAAqB,CAAC,EAAE,gBAAgB,CAAC;IACzC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,mBAAmB,CAAC,EAAE,gBAAgB,CAAC;IACvC,cAAc,CAAC,EAAE,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAEpD,yBAAyB,EAAE,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC;IAEvE,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IAEzB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAEhD,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,OAAO,CAAC;IACf,eAAe,EAAE,eAAe,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,gBAAgB,CAAC,QAAQ,SAAS,IAAI,EAAE,QAAQ,SAAS,IAAI,IAAI;IAC3E,QAAQ,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;IACtC,QAAQ,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;IACtC,uBAAuB,EAAE,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,EAAE,KAAK,CAAC,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;IAC1E,mBAAmB,EAAE,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM,CAAC,EAAE;QAAE,cAAc,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IAC9G,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,qBAAqB,EAAE,MAAM,IAAI,CAAC;IAClC,qBAAqB,EAAE,CAAC,MAAM,CAAC,EAAE,2BAA2B,CAAC,QAAQ,EAAE,QAAQ,CAAC,KAAK,IAAI,CAAC;IAC1F,gBAAgB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC9C,gBAAgB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC9C,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,kBAAkB,EAAE,CAAC,eAAe,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAChE,aAAa,EAAE,CAAC,UAAU,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACtD,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,gBAAgB,EAAE,gBAAgB,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC3D,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,kBAAkB,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE,KAAK,IAAI,CAAC;IAC9D,kBAAkB,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE,KAAK,IAAI,CAAC;IAC9D,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,SAAS,CAAC;IACrB,oBAAoB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CAClD,CAAC;AAEF,MAAM,MAAM,cAAc,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,IAAI,cAAc,CACrG,QAAQ,EACR,QAAQ,CACT,GACC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/utils/changes.d.ts b/node_modules/@xyflow/react/dist/umd/utils/changes.d.ts new file mode 100644 index 0000000..f9e0936 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/utils/changes.d.ts @@ -0,0 +1,87 @@ +import { EdgeLookup, NodeLookup, EdgeChange, NodeChange, NodeSelectionChange, EdgeSelectionChange, NodeRemoveChange, EdgeRemoveChange } from '@xyflow/system'; +import type { Node, Edge, InternalNode } from '../types'; +/** + * Drop in function that applies node changes to an array of nodes. + * @public + * @param changes - Array of changes to apply. + * @param nodes - Array of nodes to apply the changes to. + * @returns Array of updated nodes. + * @example + *```tsx + *import { useState, useCallback } from 'react'; + *import { ReactFlow, applyNodeChanges, type Node, type Edge, type OnNodesChange } from '@xyflow/react'; + * + *export default function Flow() { + * const [nodes, setNodes] = useState([]); + * const [edges, setEdges] = useState([]); + * const onNodesChange: OnNodesChange = useCallback( + * (changes) => { + * setNodes((oldNodes) => applyNodeChanges(changes, oldNodes)); + * }, + * [setNodes], + * ); + * + * return ( + * + * ); + *} + *``` + * @remarks Various events on the component can produce an {@link NodeChange} + * that describes how to update the edges of your flow in some way. + * If you don't need any custom behaviour, this util can be used to take an array + * of these changes and apply them to your edges. + */ +export declare function applyNodeChanges(changes: NodeChange[], nodes: NodeType[]): NodeType[]; +/** + * Drop in function that applies edge changes to an array of edges. + * @public + * @param changes - Array of changes to apply. + * @param edges - Array of edge to apply the changes to. + * @returns Array of updated edges. + * @example + * ```tsx + *import { useState, useCallback } from 'react'; + *import { ReactFlow, applyEdgeChanges } from '@xyflow/react'; + * + *export default function Flow() { + * const [nodes, setNodes] = useState([]); + * const [edges, setEdges] = useState([]); + * const onEdgesChange = useCallback( + * (changes) => { + * setEdges((oldEdges) => applyEdgeChanges(changes, oldEdges)); + * }, + * [setEdges], + * ); + * + * return ( + * + * ); + *} + *``` + * @remarks Various events on the component can produce an {@link EdgeChange} + * that describes how to update the edges of your flow in some way. + * If you don't need any custom behaviour, this util can be used to take an array + * of these changes and apply them to your edges. + */ +export declare function applyEdgeChanges(changes: EdgeChange[], edges: EdgeType[]): EdgeType[]; +export declare function createSelectionChange(id: string, selected: boolean): NodeSelectionChange | EdgeSelectionChange; +export declare function getSelectionChanges(items: Map, selectedIds?: Set, mutateItem?: boolean): NodeSelectionChange[] | EdgeSelectionChange[]; +/** + * This function is used to find the changes between two sets of elements. + * It is used to determine which nodes or edges have been added, removed or replaced. + * + * @internal + * @param params.items = the next set of elements (nodes or edges) + * @param params.lookup = a lookup map of the current store elements + * @returns an array of changes + */ +export declare function getElementsDiffChanges({ items, lookup, }: { + items: Node[] | undefined; + lookup: NodeLookup>; +}): NodeChange[]; +export declare function getElementsDiffChanges({ items, lookup, }: { + items: Edge[] | undefined; + lookup: EdgeLookup; +}): EdgeChange[]; +export declare function elementToRemoveChange(item: T): NodeRemoveChange | EdgeRemoveChange; +//# sourceMappingURL=changes.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/utils/changes.d.ts.map b/node_modules/@xyflow/react/dist/umd/utils/changes.d.ts.map new file mode 100644 index 0000000..a0847ac --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/utils/changes.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"changes.d.ts","sourceRoot":"","sources":["../../src/utils/changes.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AA2IzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAC3D,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE,EAC/B,KAAK,EAAE,QAAQ,EAAE,GAChB,QAAQ,EAAE,CAEZ;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAC3D,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE,EAC/B,KAAK,EAAE,QAAQ,EAAE,GAChB,QAAQ,EAAE,CAEZ;AAED,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,mBAAmB,GAAG,mBAAmB,CAM9G;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,EACvB,WAAW,GAAE,GAAG,CAAC,MAAM,CAAa,EACpC,UAAU,UAAQ,GACjB,mBAAmB,EAAE,GAAG,mBAAmB,EAAE,CAqB/C;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,KAAK,EACL,MAAM,GACP,EAAE;IACD,KAAK,EAAE,IAAI,EAAE,GAAG,SAAS,CAAC;IAC1B,MAAM,EAAE,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;CACxC,GAAG,UAAU,EAAE,CAAC;AACjB,wBAAgB,sBAAsB,CAAC,EACrC,KAAK,EACL,MAAM,GACP,EAAE;IACD,KAAK,EAAE,IAAI,EAAE,GAAG,SAAS,CAAC;IAC1B,MAAM,EAAE,UAAU,CAAC;CACpB,GAAG,UAAU,EAAE,CAAC;AAmCjB,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,IAAI,GAAG,IAAI,EAAE,IAAI,EAAE,CAAC,GAAG,gBAAgB,GAAG,gBAAgB,CAKzG"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/utils/general.d.ts b/node_modules/@xyflow/react/dist/umd/utils/general.d.ts new file mode 100644 index 0000000..1bf6d18 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/utils/general.d.ts @@ -0,0 +1,48 @@ +import { type Ref, type RefAttributes, JSX } from 'react'; +import type { Edge, Node } from '../types'; +/** + * Test whether an object is usable as an [`Node`](/api-reference/types/node). + * In TypeScript this is a type guard that will narrow the type of whatever you pass in to + * [`Node`](/api-reference/types/node) if it returns `true`. + * + * @public + * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Node if it returns true + * @param element - The element to test. + * @returns Tests whether the provided value can be used as a `Node`. If you're using TypeScript, + * this function acts as a type guard and will narrow the type of the value to `Node` if it returns + * `true`. + * + * @example + * ```js + *import { isNode } from '@xyflow/react'; + * + *if (isNode(node)) { + * // ... + *} + *``` + */ +export declare const isNode: (element: unknown) => element is NodeType; +/** + * Test whether an object is usable as an [`Edge`](/api-reference/types/edge). + * In TypeScript this is a type guard that will narrow the type of whatever you pass in to + * [`Edge`](/api-reference/types/edge) if it returns `true`. + * + * @public + * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Edge if it returns true + * @param element - The element to test + * @returns Tests whether the provided value can be used as an `Edge`. If you're using TypeScript, + * this function acts as a type guard and will narrow the type of the value to `Edge` if it returns + * `true`. + * + * @example + * ```js + *import { isEdge } from '@xyflow/react'; + * + *if (isEdge(edge)) { + * // ... + *} + *``` + */ +export declare const isEdge: (element: unknown) => element is EdgeType; +export declare function fixedForwardRef(render: (props: P, ref: Ref) => JSX.Element): (props: P & RefAttributes) => JSX.Element; +//# sourceMappingURL=general.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/utils/general.d.ts.map b/node_modules/@xyflow/react/dist/umd/utils/general.d.ts.map new file mode 100644 index 0000000..7825da5 --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/utils/general.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../src/utils/general.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,aAAa,EAAc,GAAG,EAAE,MAAM,OAAO,CAAC;AAGtE,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,MAAM,GAAI,QAAQ,SAAS,IAAI,kBAAkB,OAAO,KAAG,OAAO,IAAI,QACpD,CAAC;AAEhC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,MAAM,GAAI,QAAQ,SAAS,IAAI,kBAAkB,OAAO,KAAG,OAAO,IAAI,QACpD,CAAC;AAGhC,wBAAgB,eAAe,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,EACvC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,OAAO,GAC7C,CAAC,KAAK,EAAE,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,OAAO,CAG9C"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/utils/index.d.ts b/node_modules/@xyflow/react/dist/umd/utils/index.d.ts new file mode 100644 index 0000000..21f04cb --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/utils/index.d.ts @@ -0,0 +1,3 @@ +export * from './changes'; +export * from './general'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/react/dist/umd/utils/index.d.ts.map b/node_modules/@xyflow/react/dist/umd/utils/index.d.ts.map new file mode 100644 index 0000000..95dc8ba --- /dev/null +++ b/node_modules/@xyflow/react/dist/umd/utils/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/react/package.json b/node_modules/@xyflow/react/package.json new file mode 100644 index 0000000..abd9b59 --- /dev/null +++ b/node_modules/@xyflow/react/package.json @@ -0,0 +1,98 @@ +{ + "name": "@xyflow/react", + "version": "12.7.0", + "description": "React Flow - A highly customizable React library for building node-based editors and interactive flow charts.", + "keywords": [ + "react", + "node-based UI", + "graph", + "diagram", + "workflow", + "react-flow", + "xyflow" + ], + "repository": { + "type": "git", + "url": "https://github.com/xyflow/xyflow.git", + "directory": "packages/react" + }, + "homepage": "https://reactflow.dev", + "bugs": { + "url": "https://github.com/xyflow/xyflow/issues" + }, + "files": [ + "dist" + ], + "source": "src/index.ts", + "main": "dist/umd/index.js", + "module": "dist/esm/index.js", + "types": "dist/esm/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "node": { + "types": "./dist/esm/index.d.ts", + "module": "./dist/esm/index.js", + "require": "./dist/umd/index.js", + "import": "./dist/esm/index.mjs" + }, + "browser": { + "import": "./dist/esm/index.js", + "require": "./dist/umd/index.js" + }, + "default": "./dist/esm/index.js" + }, + "./dist/base.css": "./dist/base.css", + "./dist/style.css": "./dist/style.css" + }, + "sideEffects": [ + "*.css" + ], + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "dependencies": { + "classcat": "^5.0.3", + "zustand": "^4.4.0", + "@xyflow/system": "0.0.62" + }, + "peerDependencies": { + "react": ">=17", + "react-dom": ">=17" + }, + "devDependencies": { + "@types/node": "^18.7.16", + "@types/react": ">=17", + "@types/react-dom": ">=17", + "autoprefixer": "^10.4.15", + "cssnano": "^6.0.1", + "postcss": "^8.4.21", + "postcss-cli": "^11.0.0", + "postcss-combine-duplicated-selectors": "^10.0.3", + "postcss-import": "^15.1.0", + "postcss-nested": "^6.0.0", + "postcss-rename": "^0.6.1", + "react": "^18.2.0", + "typescript": "5.4.5", + "@xyflow/rollup-config": "0.0.0", + "@xyflow/eslint-config": "0.0.1", + "@xyflow/tsconfig": "0.0.0" + }, + "rollup": { + "globals": { + "classcat": "cc", + "zustand": "zustand", + "zustand/shallow": "zustandShallow" + }, + "name": "ReactFlow" + }, + "scripts": { + "dev": "concurrently \"rollup --config node:@xyflow/rollup-config --watch\" pnpm:css-watch", + "build": "rollup --config node:@xyflow/rollup-config --environment NODE_ENV:production && npm run css", + "css": "postcss src/styles/{base,style}.css --config ./../../tooling/postcss-config/ --dir dist ", + "css-watch": "pnpm css --watch", + "lint": "eslint --ext .js,.jsx,.ts,.tsx src", + "typecheck": "tsc --noEmit" + } +} \ No newline at end of file diff --git a/node_modules/@xyflow/system/LICENSE b/node_modules/@xyflow/system/LICENSE new file mode 100644 index 0000000..8540abf --- /dev/null +++ b/node_modules/@xyflow/system/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019-2024 webkid GmbH + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@xyflow/system/README.md b/node_modules/@xyflow/system/README.md new file mode 100644 index 0000000..611e725 --- /dev/null +++ b/node_modules/@xyflow/system/README.md @@ -0,0 +1,47 @@ +# @xyflow/system + +Core system that powers React Flow and Svelte Flow. + +## Installation + +```sh +npm install @xyflow/system +``` + +## What is this package about? + +The @xyflow/system package was created to have a place for vanilla utils for React Flow and Svelte Flow. The package exports helpers for edge creation, pan and zoom, dragging of nodes, general utils and lots of types. All the helpers are specifically built for React Flow and Svelte Flow so it's probably not too interesting to use them with other libraries. + +### XYPanZoom + +Adds zoom and pan for the pane. + +### XYDrag + +Adds drag for nodes and selection. + +### XYHandle + +Adds connection line drawing. + +### XYMinimap + +Adds interactive mini map (zoom and pan). + +### Edge utils + +Util function for SVG edge path creating. + +### Store utils + +Helpers for store functions. + +### Dom utils + +### Marker utils + +### Graph utils + +### General utils + + diff --git a/node_modules/@xyflow/system/dist/esm/constants.d.ts b/node_modules/@xyflow/system/dist/esm/constants.d.ts new file mode 100644 index 0000000..5ba9496 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/constants.d.ts @@ -0,0 +1,43 @@ +import { CoordinateExtent, HandleType } from './types'; +export declare const errorMessages: { + error001: () => string; + error002: () => string; + error003: (nodeType: string) => string; + error004: () => string; + error005: () => string; + error006: () => string; + error007: (id: string) => string; + error009: (type: string) => string; + error008: (handleType: HandleType, { id, sourceHandle, targetHandle }: { + id: string; + sourceHandle: string | null; + targetHandle: string | null; + }) => string; + error010: () => string; + error011: (edgeType: string) => string; + error012: (id: string) => string; + error013: (lib?: string) => string; + error014: () => string; + error015: () => string; +}; +export declare const infiniteExtent: CoordinateExtent; +export declare const elementSelectionKeys: string[]; +export declare const defaultAriaLabelConfig: { + 'node.a11yDescription.default': string; + 'node.a11yDescription.keyboardDisabled': string; + 'node.a11yDescription.ariaLiveMessage': ({ direction, x, y }: { + direction: string; + x: number; + y: number; + }) => string; + 'edge.a11yDescription.default': string; + 'controls.ariaLabel': string; + 'controls.zoomIn.ariaLabel': string; + 'controls.zoomOut.ariaLabel': string; + 'controls.fitView.ariaLabel': string; + 'controls.interactive.ariaLabel': string; + 'minimap.ariaLabel': string; + 'handle.ariaLabel': string; +}; +export type AriaLabelConfig = typeof defaultAriaLabelConfig; +//# sourceMappingURL=constants.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/constants.d.ts.map b/node_modules/@xyflow/system/dist/esm/constants.d.ts.map new file mode 100644 index 0000000..9294a20 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/constants.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAEvD,eAAO,MAAM,aAAa;;;yBAKH,MAAM;;;;mBAIZ,MAAM;qBACJ,MAAM;2BAET,UAAU,sCACc;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE;;yBAMzF,MAAM;mBACZ,MAAM;qBAEL,MAAM;;;CAMvB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,gBAG5B,CAAC;AAEF,eAAO,MAAM,oBAAoB,UAA2B,CAAC;AAE7D,eAAO,MAAM,sBAAsB;;;kEAK6B;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE;;;;;;;;;CAiB1G,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,OAAO,sBAAsB,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/index.d.ts b/node_modules/@xyflow/system/dist/esm/index.d.ts new file mode 100644 index 0000000..74847ff --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/index.d.ts @@ -0,0 +1,9 @@ +export * from './constants'; +export * from './types'; +export * from './utils'; +export * from './xydrag'; +export * from './xyhandle'; +export * from './xyminimap'; +export * from './xypanzoom'; +export * from './xyresizer'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/index.d.ts.map b/node_modules/@xyflow/system/dist/esm/index.d.ts.map new file mode 100644 index 0000000..804a5e3 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/index.js b/node_modules/@xyflow/system/dist/esm/index.js new file mode 100644 index 0000000..297f9c7 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/index.js @@ -0,0 +1,3347 @@ +import { drag } from 'd3-drag'; +import { select, pointer } from 'd3-selection'; +import { zoom, zoomIdentity, zoomTransform } from 'd3-zoom'; +import { interpolateZoom, interpolate } from 'd3-interpolate'; + +const errorMessages = { + error001: () => '[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001', + error002: () => "It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.", + error003: (nodeType) => `Node type "${nodeType}" not found. Using fallback type "default".`, + error004: () => 'The React Flow parent container needs a width and a height to render the graph.', + error005: () => 'Only child nodes can use a parent extent.', + error006: () => "Can't create edge. An edge needs a source and a target.", + error007: (id) => `The old edge with id=${id} does not exist.`, + error009: (type) => `Marker type "${type}" doesn't exist.`, + error008: (handleType, { id, sourceHandle, targetHandle }) => `Couldn't create edge for ${handleType} handle id: "${handleType === 'source' ? sourceHandle : targetHandle}", edge id: ${id}.`, + error010: () => 'Handle: No node id found. Make sure to only use a Handle inside a custom Node.', + error011: (edgeType) => `Edge type "${edgeType}" not found. Using fallback type "default".`, + error012: (id) => `Node with id "${id}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`, + error013: (lib = 'react') => `It seems that you haven't loaded the styles. Please import '@xyflow/${lib}/dist/style.css' or base.css to make sure everything is working properly.`, + error014: () => 'useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.', + error015: () => 'It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.', +}; +const infiniteExtent = [ + [Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY], + [Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY], +]; +const elementSelectionKeys = ['Enter', ' ', 'Escape']; +const defaultAriaLabelConfig = { + 'node.a11yDescription.default': 'Press enter or space to select a node. Press delete to remove it and escape to cancel.', + 'node.a11yDescription.keyboardDisabled': 'Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.', + 'node.a11yDescription.ariaLiveMessage': ({ direction, x, y }) => `Moved selected node ${direction}. New position, x: ${x}, y: ${y}`, + 'edge.a11yDescription.default': 'Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.', + // Control elements + 'controls.ariaLabel': 'Control Panel', + 'controls.zoomIn.ariaLabel': 'Zoom In', + 'controls.zoomOut.ariaLabel': 'Zoom Out', + 'controls.fitView.ariaLabel': 'Fit View', + 'controls.interactive.ariaLabel': 'Toggle Interactivity', + // Mini map + 'minimap.ariaLabel': 'Mini Map', + // Handle + 'handle.ariaLabel': 'Handle', +}; + +/** + * The `ConnectionMode` is used to set the mode of connection between nodes. + * The `Strict` mode is the default one and only allows source to target edges. + * `Loose` mode allows source to source and target to target edges as well. + * + * @public + */ +var ConnectionMode; +(function (ConnectionMode) { + ConnectionMode["Strict"] = "strict"; + ConnectionMode["Loose"] = "loose"; +})(ConnectionMode || (ConnectionMode = {})); +/** + * This enum is used to set the different modes of panning the viewport when the + * user scrolls. The `Free` mode allows the user to pan in any direction by scrolling + * with a device like a trackpad. The `Vertical` and `Horizontal` modes restrict + * scroll panning to only the vertical or horizontal axis, respectively. + * + * @public + */ +var PanOnScrollMode; +(function (PanOnScrollMode) { + PanOnScrollMode["Free"] = "free"; + PanOnScrollMode["Vertical"] = "vertical"; + PanOnScrollMode["Horizontal"] = "horizontal"; +})(PanOnScrollMode || (PanOnScrollMode = {})); +var SelectionMode; +(function (SelectionMode) { + SelectionMode["Partial"] = "partial"; + SelectionMode["Full"] = "full"; +})(SelectionMode || (SelectionMode = {})); +const initialConnection = { + inProgress: false, + isValid: null, + from: null, + fromHandle: null, + fromPosition: null, + fromNode: null, + to: null, + toHandle: null, + toPosition: null, + toNode: null, +}; + +/** + * If you set the `connectionLineType` prop on your [``](/api-reference/react-flow#connection-connectionLineType) + *component, it will dictate the style of connection line rendered when creating + *new edges. + * + * @public + * + * @remarks If you choose to render a custom connection line component, this value will be + *passed to your component as part of its [`ConnectionLineComponentProps`](/api-reference/types/connection-line-component-props). + */ +var ConnectionLineType; +(function (ConnectionLineType) { + ConnectionLineType["Bezier"] = "default"; + ConnectionLineType["Straight"] = "straight"; + ConnectionLineType["Step"] = "step"; + ConnectionLineType["SmoothStep"] = "smoothstep"; + ConnectionLineType["SimpleBezier"] = "simplebezier"; +})(ConnectionLineType || (ConnectionLineType = {})); +/** + * Edges may optionally have a marker on either end. The MarkerType type enumerates + * the options available to you when configuring a given marker. + * + * @public + */ +var MarkerType; +(function (MarkerType) { + MarkerType["Arrow"] = "arrow"; + MarkerType["ArrowClosed"] = "arrowclosed"; +})(MarkerType || (MarkerType = {})); + +/** + * While [`PanelPosition`](/api-reference/types/panel-position) can be used to place a + * component in the corners of a container, the `Position` enum is less precise and used + * primarily in relation to edges and handles. + * + * @public + */ +var Position; +(function (Position) { + Position["Left"] = "left"; + Position["Top"] = "top"; + Position["Right"] = "right"; + Position["Bottom"] = "bottom"; +})(Position || (Position = {})); +const oppositePosition = { + [Position.Left]: Position.Right, + [Position.Right]: Position.Left, + [Position.Top]: Position.Bottom, + [Position.Bottom]: Position.Top, +}; + +/** + * @internal + */ +function areConnectionMapsEqual(a, b) { + if (!a && !b) { + return true; + } + if (!a || !b || a.size !== b.size) { + return false; + } + if (!a.size && !b.size) { + return true; + } + for (const key of a.keys()) { + if (!b.has(key)) { + return false; + } + } + return true; +} +/** + * We call the callback for all connections in a that are not in b + * + * @internal + */ +function handleConnectionChange(a, b, cb) { + if (!cb) { + return; + } + const diff = []; + a.forEach((connection, key) => { + if (!b?.has(key)) { + diff.push(connection); + } + }); + if (diff.length) { + cb(diff); + } +} +function getConnectionStatus(isValid) { + return isValid === null ? null : isValid ? 'valid' : 'invalid'; +} + +/* eslint-disable @typescript-eslint/no-explicit-any */ +/** + * Test whether an object is usable as an Edge + * @public + * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Edge if it returns true + * @param element - The element to test + * @returns A boolean indicating whether the element is an Edge + */ +const isEdgeBase = (element) => 'id' in element && 'source' in element && 'target' in element; +/** + * Test whether an object is usable as a Node + * @public + * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Node if it returns true + * @param element - The element to test + * @returns A boolean indicating whether the element is an Node + */ +const isNodeBase = (element) => 'id' in element && 'position' in element && !('source' in element) && !('target' in element); +const isInternalNodeBase = (element) => 'id' in element && 'internals' in element && !('source' in element) && !('target' in element); +/** + * This util is used to tell you what nodes, if any, are connected to the given node + * as the _target_ of an edge. + * @public + * @param node - The node to get the connected nodes from. + * @param nodes - The array of all nodes. + * @param edges - The array of all edges. + * @returns An array of nodes that are connected over edges where the source is the given node. + * + * @example + * ```ts + *import { getOutgoers } from '@xyflow/react'; + * + *const nodes = []; + *const edges = []; + * + *const outgoers = getOutgoers( + * { id: '1', position: { x: 0, y: 0 }, data: { label: 'node' } }, + * nodes, + * edges, + *); + *``` + */ +const getOutgoers = (node, nodes, edges) => { + if (!node.id) { + return []; + } + const outgoerIds = new Set(); + edges.forEach((edge) => { + if (edge.source === node.id) { + outgoerIds.add(edge.target); + } + }); + return nodes.filter((n) => outgoerIds.has(n.id)); +}; +/** + * This util is used to tell you what nodes, if any, are connected to the given node + * as the _source_ of an edge. + * @public + * @param node - The node to get the connected nodes from. + * @param nodes - The array of all nodes. + * @param edges - The array of all edges. + * @returns An array of nodes that are connected over edges where the target is the given node. + * + * @example + * ```ts + *import { getIncomers } from '@xyflow/react'; + * + *const nodes = []; + *const edges = []; + * + *const incomers = getIncomers( + * { id: '1', position: { x: 0, y: 0 }, data: { label: 'node' } }, + * nodes, + * edges, + *); + *``` + */ +const getIncomers = (node, nodes, edges) => { + if (!node.id) { + return []; + } + const incomersIds = new Set(); + edges.forEach((edge) => { + if (edge.target === node.id) { + incomersIds.add(edge.source); + } + }); + return nodes.filter((n) => incomersIds.has(n.id)); +}; +const getNodePositionWithOrigin = (node, nodeOrigin = [0, 0]) => { + const { width, height } = getNodeDimensions(node); + const origin = node.origin ?? nodeOrigin; + const offsetX = width * origin[0]; + const offsetY = height * origin[1]; + return { + x: node.position.x - offsetX, + y: node.position.y - offsetY, + }; +}; +/** + * Returns the bounding box that contains all the given nodes in an array. This can + * be useful when combined with [`getViewportForBounds`](/api-reference/utils/get-viewport-for-bounds) + * to calculate the correct transform to fit the given nodes in a viewport. + * @public + * @remarks Useful when combined with {@link getViewportForBounds} to calculate the correct transform to fit the given nodes in a viewport. + * @param nodes - Nodes to calculate the bounds for. + * @returns Bounding box enclosing all nodes. + * + * @remarks This function was previously called `getRectOfNodes` + * + * @example + * ```js + *import { getNodesBounds } from '@xyflow/react'; + * + *const nodes = [ + * { + * id: 'a', + * position: { x: 0, y: 0 }, + * data: { label: 'a' }, + * width: 50, + * height: 25, + * }, + * { + * id: 'b', + * position: { x: 100, y: 100 }, + * data: { label: 'b' }, + * width: 50, + * height: 25, + * }, + *]; + * + *const bounds = getNodesBounds(nodes); + *``` + */ +const getNodesBounds = (nodes, params = { nodeOrigin: [0, 0] }) => { + if (process.env.NODE_ENV === 'development' && !params.nodeLookup) { + console.warn('Please use `getNodesBounds` from `useReactFlow`/`useSvelteFlow` hook to ensure correct values for sub flows. If not possible, you have to provide a nodeLookup to support sub flows.'); + } + if (nodes.length === 0) { + return { x: 0, y: 0, width: 0, height: 0 }; + } + const box = nodes.reduce((currBox, nodeOrId) => { + const isId = typeof nodeOrId === 'string'; + let currentNode = !params.nodeLookup && !isId ? nodeOrId : undefined; + if (params.nodeLookup) { + currentNode = isId + ? params.nodeLookup.get(nodeOrId) + : !isInternalNodeBase(nodeOrId) + ? params.nodeLookup.get(nodeOrId.id) + : nodeOrId; + } + const nodeBox = currentNode ? nodeToBox(currentNode, params.nodeOrigin) : { x: 0, y: 0, x2: 0, y2: 0 }; + return getBoundsOfBoxes(currBox, nodeBox); + }, { x: Infinity, y: Infinity, x2: -Infinity, y2: -Infinity }); + return boxToRect(box); +}; +/** + * Determines a bounding box that contains all given nodes in an array + * @internal + */ +const getInternalNodesBounds = (nodeLookup, params = {}) => { + if (nodeLookup.size === 0) { + return { x: 0, y: 0, width: 0, height: 0 }; + } + let box = { x: Infinity, y: Infinity, x2: -Infinity, y2: -Infinity }; + nodeLookup.forEach((node) => { + if (params.filter === undefined || params.filter(node)) { + const nodeBox = nodeToBox(node); + box = getBoundsOfBoxes(box, nodeBox); + } + }); + return boxToRect(box); +}; +const getNodesInside = (nodes, rect, [tx, ty, tScale] = [0, 0, 1], partially = false, +// set excludeNonSelectableNodes if you want to pay attention to the nodes "selectable" attribute +excludeNonSelectableNodes = false) => { + const paneRect = { + ...pointToRendererPoint(rect, [tx, ty, tScale]), + width: rect.width / tScale, + height: rect.height / tScale, + }; + const visibleNodes = []; + for (const node of nodes.values()) { + const { measured, selectable = true, hidden = false } = node; + if ((excludeNonSelectableNodes && !selectable) || hidden) { + continue; + } + const width = measured.width ?? node.width ?? node.initialWidth ?? null; + const height = measured.height ?? node.height ?? node.initialHeight ?? null; + const overlappingArea = getOverlappingArea(paneRect, nodeToRect(node)); + const area = (width ?? 0) * (height ?? 0); + const partiallyVisible = partially && overlappingArea > 0; + const forceInitialRender = !node.internals.handleBounds; + const isVisible = forceInitialRender || partiallyVisible || overlappingArea >= area; + if (isVisible || node.dragging) { + visibleNodes.push(node); + } + } + return visibleNodes; +}; +/** + * This utility filters an array of edges, keeping only those where either the source or target + * node is present in the given array of nodes. + * @public + * @param nodes - Nodes you want to get the connected edges for. + * @param edges - All edges. + * @returns Array of edges that connect any of the given nodes with each other. + * + * @example + * ```js + *import { getConnectedEdges } from '@xyflow/react'; + * + *const nodes = [ + * { id: 'a', position: { x: 0, y: 0 } }, + * { id: 'b', position: { x: 100, y: 0 } }, + *]; + * + *const edges = [ + * { id: 'a->c', source: 'a', target: 'c' }, + * { id: 'c->d', source: 'c', target: 'd' }, + *]; + * + *const connectedEdges = getConnectedEdges(nodes, edges); + * // => [{ id: 'a->c', source: 'a', target: 'c' }] + *``` + */ +const getConnectedEdges = (nodes, edges) => { + const nodeIds = new Set(); + nodes.forEach((node) => { + nodeIds.add(node.id); + }); + return edges.filter((edge) => nodeIds.has(edge.source) || nodeIds.has(edge.target)); +}; +function getFitViewNodes(nodeLookup, options) { + const fitViewNodes = new Map(); + const optionNodeIds = options?.nodes ? new Set(options.nodes.map((node) => node.id)) : null; + nodeLookup.forEach((n) => { + const isVisible = n.measured.width && n.measured.height && (options?.includeHiddenNodes || !n.hidden); + if (isVisible && (!optionNodeIds || optionNodeIds.has(n.id))) { + fitViewNodes.set(n.id, n); + } + }); + return fitViewNodes; +} +async function fitViewport({ nodes, width, height, panZoom, minZoom, maxZoom }, options) { + if (nodes.size === 0) { + return Promise.resolve(true); + } + const nodesToFit = getFitViewNodes(nodes, options); + const bounds = getInternalNodesBounds(nodesToFit); + const viewport = getViewportForBounds(bounds, width, height, options?.minZoom ?? minZoom, options?.maxZoom ?? maxZoom, options?.padding ?? 0.1); + await panZoom.setViewport(viewport, { + duration: options?.duration, + ease: options?.ease, + interpolate: options?.interpolate, + }); + return Promise.resolve(true); +} +/** + * This function calculates the next position of a node, taking into account the node's extent, parent node, and origin. + * + * @internal + * @returns position, positionAbsolute + */ +function calculateNodePosition({ nodeId, nextPosition, nodeLookup, nodeOrigin = [0, 0], nodeExtent, onError, }) { + const node = nodeLookup.get(nodeId); + const parentNode = node.parentId ? nodeLookup.get(node.parentId) : undefined; + const { x: parentX, y: parentY } = parentNode ? parentNode.internals.positionAbsolute : { x: 0, y: 0 }; + const origin = node.origin ?? nodeOrigin; + let extent = nodeExtent; + if (node.extent === 'parent' && !node.expandParent) { + if (!parentNode) { + onError?.('005', errorMessages['error005']()); + } + else { + const parentWidth = parentNode.measured.width; + const parentHeight = parentNode.measured.height; + if (parentWidth && parentHeight) { + extent = [ + [parentX, parentY], + [parentX + parentWidth, parentY + parentHeight], + ]; + } + } + } + else if (parentNode && isCoordinateExtent(node.extent)) { + extent = [ + [node.extent[0][0] + parentX, node.extent[0][1] + parentY], + [node.extent[1][0] + parentX, node.extent[1][1] + parentY], + ]; + } + const positionAbsolute = isCoordinateExtent(extent) + ? clampPosition(nextPosition, extent, node.measured) + : nextPosition; + if (node.measured.width === undefined || node.measured.height === undefined) { + onError?.('015', errorMessages['error015']()); + } + return { + position: { + x: positionAbsolute.x - parentX + (node.measured.width ?? 0) * origin[0], + y: positionAbsolute.y - parentY + (node.measured.height ?? 0) * origin[1], + }, + positionAbsolute, + }; +} +/** + * Pass in nodes & edges to delete, get arrays of nodes and edges that actually can be deleted + * @internal + * @param param.nodesToRemove - The nodes to remove + * @param param.edgesToRemove - The edges to remove + * @param param.nodes - All nodes + * @param param.edges - All edges + * @param param.onBeforeDelete - Callback to check which nodes and edges can be deleted + * @returns nodes: nodes that can be deleted, edges: edges that can be deleted + */ +async function getElementsToRemove({ nodesToRemove = [], edgesToRemove = [], nodes, edges, onBeforeDelete, }) { + const nodeIds = new Set(nodesToRemove.map((node) => node.id)); + const matchingNodes = []; + for (const node of nodes) { + if (node.deletable === false) { + continue; + } + const isIncluded = nodeIds.has(node.id); + const parentHit = !isIncluded && node.parentId && matchingNodes.find((n) => n.id === node.parentId); + if (isIncluded || parentHit) { + matchingNodes.push(node); + } + } + const edgeIds = new Set(edgesToRemove.map((edge) => edge.id)); + const deletableEdges = edges.filter((edge) => edge.deletable !== false); + const connectedEdges = getConnectedEdges(matchingNodes, deletableEdges); + const matchingEdges = connectedEdges; + for (const edge of deletableEdges) { + const isIncluded = edgeIds.has(edge.id); + if (isIncluded && !matchingEdges.find((e) => e.id === edge.id)) { + matchingEdges.push(edge); + } + } + if (!onBeforeDelete) { + return { + edges: matchingEdges, + nodes: matchingNodes, + }; + } + const onBeforeDeleteResult = await onBeforeDelete({ + nodes: matchingNodes, + edges: matchingEdges, + }); + if (typeof onBeforeDeleteResult === 'boolean') { + return onBeforeDeleteResult ? { edges: matchingEdges, nodes: matchingNodes } : { edges: [], nodes: [] }; + } + return onBeforeDeleteResult; +} + +const clamp = (val, min = 0, max = 1) => Math.min(Math.max(val, min), max); +const clampPosition = (position = { x: 0, y: 0 }, extent, dimensions) => ({ + x: clamp(position.x, extent[0][0], extent[1][0] - (dimensions?.width ?? 0)), + y: clamp(position.y, extent[0][1], extent[1][1] - (dimensions?.height ?? 0)), +}); +function clampPositionToParent(childPosition, childDimensions, parent) { + const { width: parentWidth, height: parentHeight } = getNodeDimensions(parent); + const { x: parentX, y: parentY } = parent.internals.positionAbsolute; + return clampPosition(childPosition, [ + [parentX, parentY], + [parentX + parentWidth, parentY + parentHeight], + ], childDimensions); +} +/** + * Calculates the velocity of panning when the mouse is close to the edge of the canvas + * @internal + * @param value - One dimensional poition of the mouse (x or y) + * @param min - Minimal position on canvas before panning starts + * @param max - Maximal position on canvas before panning starts + * @returns - A number between 0 and 1 that represents the velocity of panning + */ +const calcAutoPanVelocity = (value, min, max) => { + if (value < min) { + return clamp(Math.abs(value - min), 1, min) / min; + } + else if (value > max) { + return -clamp(Math.abs(value - max), 1, min) / min; + } + return 0; +}; +const calcAutoPan = (pos, bounds, speed = 15, distance = 40) => { + const xMovement = calcAutoPanVelocity(pos.x, distance, bounds.width - distance) * speed; + const yMovement = calcAutoPanVelocity(pos.y, distance, bounds.height - distance) * speed; + return [xMovement, yMovement]; +}; +const getBoundsOfBoxes = (box1, box2) => ({ + x: Math.min(box1.x, box2.x), + y: Math.min(box1.y, box2.y), + x2: Math.max(box1.x2, box2.x2), + y2: Math.max(box1.y2, box2.y2), +}); +const rectToBox = ({ x, y, width, height }) => ({ + x, + y, + x2: x + width, + y2: y + height, +}); +const boxToRect = ({ x, y, x2, y2 }) => ({ + x, + y, + width: x2 - x, + height: y2 - y, +}); +const nodeToRect = (node, nodeOrigin = [0, 0]) => { + const { x, y } = isInternalNodeBase(node) + ? node.internals.positionAbsolute + : getNodePositionWithOrigin(node, nodeOrigin); + return { + x, + y, + width: node.measured?.width ?? node.width ?? node.initialWidth ?? 0, + height: node.measured?.height ?? node.height ?? node.initialHeight ?? 0, + }; +}; +const nodeToBox = (node, nodeOrigin = [0, 0]) => { + const { x, y } = isInternalNodeBase(node) + ? node.internals.positionAbsolute + : getNodePositionWithOrigin(node, nodeOrigin); + return { + x, + y, + x2: x + (node.measured?.width ?? node.width ?? node.initialWidth ?? 0), + y2: y + (node.measured?.height ?? node.height ?? node.initialHeight ?? 0), + }; +}; +const getBoundsOfRects = (rect1, rect2) => boxToRect(getBoundsOfBoxes(rectToBox(rect1), rectToBox(rect2))); +const getOverlappingArea = (rectA, rectB) => { + const xOverlap = Math.max(0, Math.min(rectA.x + rectA.width, rectB.x + rectB.width) - Math.max(rectA.x, rectB.x)); + const yOverlap = Math.max(0, Math.min(rectA.y + rectA.height, rectB.y + rectB.height) - Math.max(rectA.y, rectB.y)); + return Math.ceil(xOverlap * yOverlap); +}; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +const isRectObject = (obj) => isNumeric(obj.width) && isNumeric(obj.height) && isNumeric(obj.x) && isNumeric(obj.y); +/* eslint-disable-next-line @typescript-eslint/no-explicit-any */ +const isNumeric = (n) => !isNaN(n) && isFinite(n); +// used for a11y key board controls for nodes and edges +const devWarn = (id, message) => { + if (process.env.NODE_ENV === 'development') { + console.warn(`[React Flow]: ${message} Help: https://reactflow.dev/error#${id}`); + } +}; +const snapPosition = (position, snapGrid = [1, 1]) => { + return { + x: snapGrid[0] * Math.round(position.x / snapGrid[0]), + y: snapGrid[1] * Math.round(position.y / snapGrid[1]), + }; +}; +const pointToRendererPoint = ({ x, y }, [tx, ty, tScale], snapToGrid = false, snapGrid = [1, 1]) => { + const position = { + x: (x - tx) / tScale, + y: (y - ty) / tScale, + }; + return snapToGrid ? snapPosition(position, snapGrid) : position; +}; +const rendererPointToPoint = ({ x, y }, [tx, ty, tScale]) => { + return { + x: x * tScale + tx, + y: y * tScale + ty, + }; +}; +/** + * Parses a single padding value to a number + * @internal + * @param padding - Padding to parse + * @param viewport - Width or height of the viewport + * @returns The padding in pixels + */ +function parsePadding(padding, viewport) { + if (typeof padding === 'number') { + return Math.floor((viewport - viewport / (1 + padding)) * 0.5); + } + if (typeof padding === 'string' && padding.endsWith('px')) { + const paddingValue = parseFloat(padding); + if (!Number.isNaN(paddingValue)) { + return Math.floor(paddingValue); + } + } + if (typeof padding === 'string' && padding.endsWith('%')) { + const paddingValue = parseFloat(padding); + if (!Number.isNaN(paddingValue)) { + return Math.floor(viewport * paddingValue * 0.01); + } + } + console.error(`[React Flow] The padding value "${padding}" is invalid. Please provide a number or a string with a valid unit (px or %).`); + return 0; +} +/** + * Parses the paddings to an object with top, right, bottom, left, x and y paddings + * @internal + * @param padding - Padding to parse + * @param width - Width of the viewport + * @param height - Height of the viewport + * @returns An object with the paddings in pixels + */ +function parsePaddings(padding, width, height) { + if (typeof padding === 'string' || typeof padding === 'number') { + const paddingY = parsePadding(padding, height); + const paddingX = parsePadding(padding, width); + return { + top: paddingY, + right: paddingX, + bottom: paddingY, + left: paddingX, + x: paddingX * 2, + y: paddingY * 2, + }; + } + if (typeof padding === 'object') { + const top = parsePadding(padding.top ?? padding.y ?? 0, height); + const bottom = parsePadding(padding.bottom ?? padding.y ?? 0, height); + const left = parsePadding(padding.left ?? padding.x ?? 0, width); + const right = parsePadding(padding.right ?? padding.x ?? 0, width); + return { top, right, bottom, left, x: left + right, y: top + bottom }; + } + return { top: 0, right: 0, bottom: 0, left: 0, x: 0, y: 0 }; +} +/** + * Calculates the resulting paddings if the new viewport is applied + * @internal + * @param bounds - Bounds to fit inside viewport + * @param x - X position of the viewport + * @param y - Y position of the viewport + * @param zoom - Zoom level of the viewport + * @param width - Width of the viewport + * @param height - Height of the viewport + * @returns An object with the minimum padding required to fit the bounds inside the viewport + */ +function calculateAppliedPaddings(bounds, x, y, zoom, width, height) { + const { x: left, y: top } = rendererPointToPoint(bounds, [x, y, zoom]); + const { x: boundRight, y: boundBottom } = rendererPointToPoint({ x: bounds.x + bounds.width, y: bounds.y + bounds.height }, [x, y, zoom]); + const right = width - boundRight; + const bottom = height - boundBottom; + return { + left: Math.floor(left), + top: Math.floor(top), + right: Math.floor(right), + bottom: Math.floor(bottom), + }; +} +/** + * Returns a viewport that encloses the given bounds with padding. + * @public + * @remarks You can determine bounds of nodes with {@link getNodesBounds} and {@link getBoundsOfRects} + * @param bounds - Bounds to fit inside viewport. + * @param width - Width of the viewport. + * @param height - Height of the viewport. + * @param minZoom - Minimum zoom level of the resulting viewport. + * @param maxZoom - Maximum zoom level of the resulting viewport. + * @param padding - Padding around the bounds. + * @returns A transformed {@link Viewport} that encloses the given bounds which you can pass to e.g. {@link setViewport}. + * @example + * const { x, y, zoom } = getViewportForBounds( + * { x: 0, y: 0, width: 100, height: 100}, + * 1200, 800, 0.5, 2); + */ +const getViewportForBounds = (bounds, width, height, minZoom, maxZoom, padding) => { + // First we resolve all the paddings to actual pixel values + const p = parsePaddings(padding, width, height); + const xZoom = (width - p.x) / bounds.width; + const yZoom = (height - p.y) / bounds.height; + // We calculate the new x, y, zoom for a centered view + const zoom = Math.min(xZoom, yZoom); + const clampedZoom = clamp(zoom, minZoom, maxZoom); + const boundsCenterX = bounds.x + bounds.width / 2; + const boundsCenterY = bounds.y + bounds.height / 2; + const x = width / 2 - boundsCenterX * clampedZoom; + const y = height / 2 - boundsCenterY * clampedZoom; + // Then we calculate the minimum padding, to respect asymmetric paddings + const newPadding = calculateAppliedPaddings(bounds, x, y, clampedZoom, width, height); + // We only want to have an offset if the newPadding is smaller than the required padding + const offset = { + left: Math.min(newPadding.left - p.left, 0), + top: Math.min(newPadding.top - p.top, 0), + right: Math.min(newPadding.right - p.right, 0), + bottom: Math.min(newPadding.bottom - p.bottom, 0), + }; + return { + x: x - offset.left + offset.right, + y: y - offset.top + offset.bottom, + zoom: clampedZoom, + }; +}; +const isMacOs = () => typeof navigator !== 'undefined' && navigator?.userAgent?.indexOf('Mac') >= 0; +function isCoordinateExtent(extent) { + return extent !== undefined && extent !== 'parent'; +} +function getNodeDimensions(node) { + return { + width: node.measured?.width ?? node.width ?? node.initialWidth ?? 0, + height: node.measured?.height ?? node.height ?? node.initialHeight ?? 0, + }; +} +function nodeHasDimensions(node) { + return ((node.measured?.width ?? node.width ?? node.initialWidth) !== undefined && + (node.measured?.height ?? node.height ?? node.initialHeight) !== undefined); +} +/** + * Convert child position to aboslute position + * + * @internal + * @param position + * @param parentId + * @param nodeLookup + * @param nodeOrigin + * @returns an internal node with an absolute position + */ +function evaluateAbsolutePosition(position, dimensions = { width: 0, height: 0 }, parentId, nodeLookup, nodeOrigin) { + const positionAbsolute = { ...position }; + const parent = nodeLookup.get(parentId); + if (parent) { + const origin = parent.origin || nodeOrigin; + positionAbsolute.x += parent.internals.positionAbsolute.x - (dimensions.width ?? 0) * origin[0]; + positionAbsolute.y += parent.internals.positionAbsolute.y - (dimensions.height ?? 0) * origin[1]; + } + return positionAbsolute; +} +function areSetsEqual(a, b) { + if (a.size !== b.size) { + return false; + } + for (const item of a) { + if (!b.has(item)) { + return false; + } + } + return true; +} +/** + * Polyfill for Promise.withResolvers until we can use it in all browsers + * @internal + */ +function withResolvers() { + let resolve; + let reject; + const promise = new Promise((res, rej) => { + resolve = res; + reject = rej; + }); + return { promise, resolve, reject }; +} +function mergeAriaLabelConfig(partial) { + return { ...defaultAriaLabelConfig, ...(partial || {}) }; +} + +function getPointerPosition(event, { snapGrid = [0, 0], snapToGrid = false, transform, containerBounds }) { + const { x, y } = getEventPosition(event); + const pointerPos = pointToRendererPoint({ x: x - (containerBounds?.left ?? 0), y: y - (containerBounds?.top ?? 0) }, transform); + const { x: xSnapped, y: ySnapped } = snapToGrid ? snapPosition(pointerPos, snapGrid) : pointerPos; + // we need the snapped position in order to be able to skip unnecessary drag events + return { + xSnapped, + ySnapped, + ...pointerPos, + }; +} +const getDimensions = (node) => ({ + width: node.offsetWidth, + height: node.offsetHeight, +}); +const getHostForElement = (element) => element?.getRootNode?.() || window?.document; +const inputTags = ['INPUT', 'SELECT', 'TEXTAREA']; +function isInputDOMNode(event) { + // using composed path for handling shadow dom + const target = (event.composedPath?.()?.[0] || event.target); + if (target?.nodeType !== 1 /* Node.ELEMENT_NODE */) + return false; + const isInput = inputTags.includes(target.nodeName) || target.hasAttribute('contenteditable'); + // when an input field is focused we don't want to trigger deletion or movement of nodes + return isInput || !!target.closest('.nokey'); +} +const isMouseEvent = (event) => 'clientX' in event; +const getEventPosition = (event, bounds) => { + const isMouse = isMouseEvent(event); + const evtX = isMouse ? event.clientX : event.touches?.[0].clientX; + const evtY = isMouse ? event.clientY : event.touches?.[0].clientY; + return { + x: evtX - (bounds?.left ?? 0), + y: evtY - (bounds?.top ?? 0), + }; +}; +/* + * The handle bounds are calculated relative to the node element. + * We store them in the internals object of the node in order to avoid + * unnecessary recalculations. + */ +const getHandleBounds = (type, nodeElement, nodeBounds, zoom, nodeId) => { + const handles = nodeElement.querySelectorAll(`.${type}`); + if (!handles || !handles.length) { + return null; + } + return Array.from(handles).map((handle) => { + const handleBounds = handle.getBoundingClientRect(); + return { + id: handle.getAttribute('data-handleid'), + type, + nodeId, + position: handle.getAttribute('data-handlepos'), + x: (handleBounds.left - nodeBounds.left) / zoom, + y: (handleBounds.top - nodeBounds.top) / zoom, + ...getDimensions(handle), + }; + }); +}; + +function getBezierEdgeCenter({ sourceX, sourceY, targetX, targetY, sourceControlX, sourceControlY, targetControlX, targetControlY, }) { + /* + * cubic bezier t=0.5 mid point, not the actual mid point, but easy to calculate + * https://stackoverflow.com/questions/67516101/how-to-find-distance-mid-point-of-bezier-curve + */ + const centerX = sourceX * 0.125 + sourceControlX * 0.375 + targetControlX * 0.375 + targetX * 0.125; + const centerY = sourceY * 0.125 + sourceControlY * 0.375 + targetControlY * 0.375 + targetY * 0.125; + const offsetX = Math.abs(centerX - sourceX); + const offsetY = Math.abs(centerY - sourceY); + return [centerX, centerY, offsetX, offsetY]; +} +function calculateControlOffset(distance, curvature) { + if (distance >= 0) { + return 0.5 * distance; + } + return curvature * 25 * Math.sqrt(-distance); +} +function getControlWithCurvature({ pos, x1, y1, x2, y2, c }) { + switch (pos) { + case Position.Left: + return [x1 - calculateControlOffset(x1 - x2, c), y1]; + case Position.Right: + return [x1 + calculateControlOffset(x2 - x1, c), y1]; + case Position.Top: + return [x1, y1 - calculateControlOffset(y1 - y2, c)]; + case Position.Bottom: + return [x1, y1 + calculateControlOffset(y2 - y1, c)]; + } +} +/** + * The `getBezierPath` util returns everything you need to render a bezier edge + *between two nodes. + * @public + * @returns A path string you can use in an SVG, the `labelX` and `labelY` position (center of path) + * and `offsetX`, `offsetY` between source handle and label. + * - `path`: the path to use in an SVG `` element. + * - `labelX`: the `x` position you can use to render a label for this edge. + * - `labelY`: the `y` position you can use to render a label for this edge. + * - `offsetX`: the absolute difference between the source `x` position and the `x` position of the + * middle of this path. + * - `offsetY`: the absolute difference between the source `y` position and the `y` position of the + * middle of this path. + * @example + * ```js + * const source = { x: 0, y: 20 }; + * const target = { x: 150, y: 100 }; + * + * const [path, labelX, labelY, offsetX, offsetY] = getBezierPath({ + * sourceX: source.x, + * sourceY: source.y, + * sourcePosition: Position.Right, + * targetX: target.x, + * targetY: target.y, + * targetPosition: Position.Left, + *}); + *``` + * + * @remarks This function returns a tuple (aka a fixed-size array) to make it easier to + *work with multiple edge paths at once. + */ +function getBezierPath({ sourceX, sourceY, sourcePosition = Position.Bottom, targetX, targetY, targetPosition = Position.Top, curvature = 0.25, }) { + const [sourceControlX, sourceControlY] = getControlWithCurvature({ + pos: sourcePosition, + x1: sourceX, + y1: sourceY, + x2: targetX, + y2: targetY, + c: curvature, + }); + const [targetControlX, targetControlY] = getControlWithCurvature({ + pos: targetPosition, + x1: targetX, + y1: targetY, + x2: sourceX, + y2: sourceY, + c: curvature, + }); + const [labelX, labelY, offsetX, offsetY] = getBezierEdgeCenter({ + sourceX, + sourceY, + targetX, + targetY, + sourceControlX, + sourceControlY, + targetControlX, + targetControlY, + }); + return [ + `M${sourceX},${sourceY} C${sourceControlX},${sourceControlY} ${targetControlX},${targetControlY} ${targetX},${targetY}`, + labelX, + labelY, + offsetX, + offsetY, + ]; +} + +// this is used for straight edges and simple smoothstep edges (LTR, RTL, BTT, TTB) +function getEdgeCenter({ sourceX, sourceY, targetX, targetY, }) { + const xOffset = Math.abs(targetX - sourceX) / 2; + const centerX = targetX < sourceX ? targetX + xOffset : targetX - xOffset; + const yOffset = Math.abs(targetY - sourceY) / 2; + const centerY = targetY < sourceY ? targetY + yOffset : targetY - yOffset; + return [centerX, centerY, xOffset, yOffset]; +} +function getElevatedEdgeZIndex({ sourceNode, targetNode, selected = false, zIndex = 0, elevateOnSelect = false, }) { + if (!elevateOnSelect) { + return zIndex; + } + const edgeOrConnectedNodeSelected = selected || targetNode.selected || sourceNode.selected; + const selectedZIndex = Math.max(sourceNode.internals.z || 0, targetNode.internals.z || 0, 1000); + return zIndex + (edgeOrConnectedNodeSelected ? selectedZIndex : 0); +} +function isEdgeVisible({ sourceNode, targetNode, width, height, transform }) { + const edgeBox = getBoundsOfBoxes(nodeToBox(sourceNode), nodeToBox(targetNode)); + if (edgeBox.x === edgeBox.x2) { + edgeBox.x2 += 1; + } + if (edgeBox.y === edgeBox.y2) { + edgeBox.y2 += 1; + } + const viewRect = { + x: -transform[0] / transform[2], + y: -transform[1] / transform[2], + width: width / transform[2], + height: height / transform[2], + }; + return getOverlappingArea(viewRect, boxToRect(edgeBox)) > 0; +} +const getEdgeId = ({ source, sourceHandle, target, targetHandle }) => `xy-edge__${source}${sourceHandle || ''}-${target}${targetHandle || ''}`; +const connectionExists = (edge, edges) => { + return edges.some((el) => el.source === edge.source && + el.target === edge.target && + (el.sourceHandle === edge.sourceHandle || (!el.sourceHandle && !edge.sourceHandle)) && + (el.targetHandle === edge.targetHandle || (!el.targetHandle && !edge.targetHandle))); +}; +/** + * This util is a convenience function to add a new Edge to an array of edges. It also performs some validation to make sure you don't add an invalid edge or duplicate an existing one. + * @public + * @param edgeParams - Either an `Edge` or a `Connection` you want to add. + * @param edges - The array of all current edges. + * @returns A new array of edges with the new edge added. + * + * @remarks If an edge with the same `target` and `source` already exists (and the same + *`targetHandle` and `sourceHandle` if those are set), then this util won't add + *a new edge even if the `id` property is different. + * + */ +const addEdge = (edgeParams, edges) => { + if (!edgeParams.source || !edgeParams.target) { + devWarn('006', errorMessages['error006']()); + return edges; + } + let edge; + if (isEdgeBase(edgeParams)) { + edge = { ...edgeParams }; + } + else { + edge = { + ...edgeParams, + id: getEdgeId(edgeParams), + }; + } + if (connectionExists(edge, edges)) { + return edges; + } + if (edge.sourceHandle === null) { + delete edge.sourceHandle; + } + if (edge.targetHandle === null) { + delete edge.targetHandle; + } + return edges.concat(edge); +}; +/** + * A handy utility to update an existing [`Edge`](/api-reference/types/edge) with new properties. + *This searches your edge array for an edge with a matching `id` and updates its + *properties with the connection you provide. + * @public + * @param oldEdge - The edge you want to update. + * @param newConnection - The new connection you want to update the edge with. + * @param edges - The array of all current edges. + * @returns The updated edges array. + * + * @example + * ```js + *const onReconnect = useCallback( + * (oldEdge: Edge, newConnection: Connection) => setEdges((els) => reconnectEdge(oldEdge, newConnection, els)),[]); + *``` + */ +const reconnectEdge = (oldEdge, newConnection, edges, options = { shouldReplaceId: true }) => { + const { id: oldEdgeId, ...rest } = oldEdge; + if (!newConnection.source || !newConnection.target) { + devWarn('006', errorMessages['error006']()); + return edges; + } + const foundEdge = edges.find((e) => e.id === oldEdge.id); + if (!foundEdge) { + devWarn('007', errorMessages['error007'](oldEdgeId)); + return edges; + } + // Remove old edge and create the new edge with parameters of old edge. + const edge = { + ...rest, + id: options.shouldReplaceId ? getEdgeId(newConnection) : oldEdgeId, + source: newConnection.source, + target: newConnection.target, + sourceHandle: newConnection.sourceHandle, + targetHandle: newConnection.targetHandle, + }; + return edges.filter((e) => e.id !== oldEdgeId).concat(edge); +}; + +/** + * Calculates the straight line path between two points. + * @public + * @returns A path string you can use in an SVG, the `labelX` and `labelY` position (center of path) + * and `offsetX`, `offsetY` between source handle and label. + * + * - `path`: the path to use in an SVG `` element. + * - `labelX`: the `x` position you can use to render a label for this edge. + * - `labelY`: the `y` position you can use to render a label for this edge. + * - `offsetX`: the absolute difference between the source `x` position and the `x` position of the + * middle of this path. + * - `offsetY`: the absolute difference between the source `y` position and the `y` position of the + * middle of this path. + * @example + * ```js + * const source = { x: 0, y: 20 }; + * const target = { x: 150, y: 100 }; + * + * const [path, labelX, labelY, offsetX, offsetY] = getStraightPath({ + * sourceX: source.x, + * sourceY: source.y, + * sourcePosition: Position.Right, + * targetX: target.x, + * targetY: target.y, + * targetPosition: Position.Left, + * }); + * ``` + * @remarks This function returns a tuple (aka a fixed-size array) to make it easier to work with multiple edge paths at once. + */ +function getStraightPath({ sourceX, sourceY, targetX, targetY, }) { + const [labelX, labelY, offsetX, offsetY] = getEdgeCenter({ + sourceX, + sourceY, + targetX, + targetY, + }); + return [`M ${sourceX},${sourceY}L ${targetX},${targetY}`, labelX, labelY, offsetX, offsetY]; +} + +const handleDirections = { + [Position.Left]: { x: -1, y: 0 }, + [Position.Right]: { x: 1, y: 0 }, + [Position.Top]: { x: 0, y: -1 }, + [Position.Bottom]: { x: 0, y: 1 }, +}; +const getDirection = ({ source, sourcePosition = Position.Bottom, target, }) => { + if (sourcePosition === Position.Left || sourcePosition === Position.Right) { + return source.x < target.x ? { x: 1, y: 0 } : { x: -1, y: 0 }; + } + return source.y < target.y ? { x: 0, y: 1 } : { x: 0, y: -1 }; +}; +const distance = (a, b) => Math.sqrt(Math.pow(b.x - a.x, 2) + Math.pow(b.y - a.y, 2)); +/* + * With this function we try to mimic an orthogonal edge routing behaviour + * It's not as good as a real orthogonal edge routing, but it's faster and good enough as a default for step and smooth step edges + */ +function getPoints({ source, sourcePosition = Position.Bottom, target, targetPosition = Position.Top, center, offset, }) { + const sourceDir = handleDirections[sourcePosition]; + const targetDir = handleDirections[targetPosition]; + const sourceGapped = { x: source.x + sourceDir.x * offset, y: source.y + sourceDir.y * offset }; + const targetGapped = { x: target.x + targetDir.x * offset, y: target.y + targetDir.y * offset }; + const dir = getDirection({ + source: sourceGapped, + sourcePosition, + target: targetGapped, + }); + const dirAccessor = dir.x !== 0 ? 'x' : 'y'; + const currDir = dir[dirAccessor]; + let points = []; + let centerX, centerY; + const sourceGapOffset = { x: 0, y: 0 }; + const targetGapOffset = { x: 0, y: 0 }; + const [defaultCenterX, defaultCenterY, defaultOffsetX, defaultOffsetY] = getEdgeCenter({ + sourceX: source.x, + sourceY: source.y, + targetX: target.x, + targetY: target.y, + }); + // opposite handle positions, default case + if (sourceDir[dirAccessor] * targetDir[dirAccessor] === -1) { + centerX = center.x ?? defaultCenterX; + centerY = center.y ?? defaultCenterY; + /* + * ---> + * | + * >--- + */ + const verticalSplit = [ + { x: centerX, y: sourceGapped.y }, + { x: centerX, y: targetGapped.y }, + ]; + /* + * | + * --- + * | + */ + const horizontalSplit = [ + { x: sourceGapped.x, y: centerY }, + { x: targetGapped.x, y: centerY }, + ]; + if (sourceDir[dirAccessor] === currDir) { + points = dirAccessor === 'x' ? verticalSplit : horizontalSplit; + } + else { + points = dirAccessor === 'x' ? horizontalSplit : verticalSplit; + } + } + else { + // sourceTarget means we take x from source and y from target, targetSource is the opposite + const sourceTarget = [{ x: sourceGapped.x, y: targetGapped.y }]; + const targetSource = [{ x: targetGapped.x, y: sourceGapped.y }]; + // this handles edges with same handle positions + if (dirAccessor === 'x') { + points = sourceDir.x === currDir ? targetSource : sourceTarget; + } + else { + points = sourceDir.y === currDir ? sourceTarget : targetSource; + } + if (sourcePosition === targetPosition) { + const diff = Math.abs(source[dirAccessor] - target[dirAccessor]); + // if an edge goes from right to right for example (sourcePosition === targetPosition) and the distance between source.x and target.x is less than the offset, the added point and the gapped source/target will overlap. This leads to a weird edge path. To avoid this we add a gapOffset to the source/target + if (diff <= offset) { + const gapOffset = Math.min(offset - 1, offset - diff); + if (sourceDir[dirAccessor] === currDir) { + sourceGapOffset[dirAccessor] = (sourceGapped[dirAccessor] > source[dirAccessor] ? -1 : 1) * gapOffset; + } + else { + targetGapOffset[dirAccessor] = (targetGapped[dirAccessor] > target[dirAccessor] ? -1 : 1) * gapOffset; + } + } + } + // these are conditions for handling mixed handle positions like Right -> Bottom for example + if (sourcePosition !== targetPosition) { + const dirAccessorOpposite = dirAccessor === 'x' ? 'y' : 'x'; + const isSameDir = sourceDir[dirAccessor] === targetDir[dirAccessorOpposite]; + const sourceGtTargetOppo = sourceGapped[dirAccessorOpposite] > targetGapped[dirAccessorOpposite]; + const sourceLtTargetOppo = sourceGapped[dirAccessorOpposite] < targetGapped[dirAccessorOpposite]; + const flipSourceTarget = (sourceDir[dirAccessor] === 1 && ((!isSameDir && sourceGtTargetOppo) || (isSameDir && sourceLtTargetOppo))) || + (sourceDir[dirAccessor] !== 1 && ((!isSameDir && sourceLtTargetOppo) || (isSameDir && sourceGtTargetOppo))); + if (flipSourceTarget) { + points = dirAccessor === 'x' ? sourceTarget : targetSource; + } + } + const sourceGapPoint = { x: sourceGapped.x + sourceGapOffset.x, y: sourceGapped.y + sourceGapOffset.y }; + const targetGapPoint = { x: targetGapped.x + targetGapOffset.x, y: targetGapped.y + targetGapOffset.y }; + const maxXDistance = Math.max(Math.abs(sourceGapPoint.x - points[0].x), Math.abs(targetGapPoint.x - points[0].x)); + const maxYDistance = Math.max(Math.abs(sourceGapPoint.y - points[0].y), Math.abs(targetGapPoint.y - points[0].y)); + // we want to place the label on the longest segment of the edge + if (maxXDistance >= maxYDistance) { + centerX = (sourceGapPoint.x + targetGapPoint.x) / 2; + centerY = points[0].y; + } + else { + centerX = points[0].x; + centerY = (sourceGapPoint.y + targetGapPoint.y) / 2; + } + } + const pathPoints = [ + source, + { x: sourceGapped.x + sourceGapOffset.x, y: sourceGapped.y + sourceGapOffset.y }, + ...points, + { x: targetGapped.x + targetGapOffset.x, y: targetGapped.y + targetGapOffset.y }, + target, + ]; + return [pathPoints, centerX, centerY, defaultOffsetX, defaultOffsetY]; +} +function getBend(a, b, c, size) { + const bendSize = Math.min(distance(a, b) / 2, distance(b, c) / 2, size); + const { x, y } = b; + // no bend + if ((a.x === x && x === c.x) || (a.y === y && y === c.y)) { + return `L${x} ${y}`; + } + // first segment is horizontal + if (a.y === y) { + const xDir = a.x < c.x ? -1 : 1; + const yDir = a.y < c.y ? 1 : -1; + return `L ${x + bendSize * xDir},${y}Q ${x},${y} ${x},${y + bendSize * yDir}`; + } + const xDir = a.x < c.x ? 1 : -1; + const yDir = a.y < c.y ? -1 : 1; + return `L ${x},${y + bendSize * yDir}Q ${x},${y} ${x + bendSize * xDir},${y}`; +} +/** + * The `getSmoothStepPath` util returns everything you need to render a stepped path + * between two nodes. The `borderRadius` property can be used to choose how rounded + * the corners of those steps are. + * @public + * @returns A path string you can use in an SVG, the `labelX` and `labelY` position (center of path) + * and `offsetX`, `offsetY` between source handle and label. + * + * - `path`: the path to use in an SVG `` element. + * - `labelX`: the `x` position you can use to render a label for this edge. + * - `labelY`: the `y` position you can use to render a label for this edge. + * - `offsetX`: the absolute difference between the source `x` position and the `x` position of the + * middle of this path. + * - `offsetY`: the absolute difference between the source `y` position and the `y` position of the + * middle of this path. + * @example + * ```js + * const source = { x: 0, y: 20 }; + * const target = { x: 150, y: 100 }; + * + * const [path, labelX, labelY, offsetX, offsetY] = getSmoothStepPath({ + * sourceX: source.x, + * sourceY: source.y, + * sourcePosition: Position.Right, + * targetX: target.x, + * targetY: target.y, + * targetPosition: Position.Left, + * }); + * ``` + * @remarks This function returns a tuple (aka a fixed-size array) to make it easier to work with multiple edge paths at once. + */ +function getSmoothStepPath({ sourceX, sourceY, sourcePosition = Position.Bottom, targetX, targetY, targetPosition = Position.Top, borderRadius = 5, centerX, centerY, offset = 20, }) { + const [points, labelX, labelY, offsetX, offsetY] = getPoints({ + source: { x: sourceX, y: sourceY }, + sourcePosition, + target: { x: targetX, y: targetY }, + targetPosition, + center: { x: centerX, y: centerY }, + offset, + }); + const path = points.reduce((res, p, i) => { + let segment = ''; + if (i > 0 && i < points.length - 1) { + segment = getBend(points[i - 1], p, points[i + 1], borderRadius); + } + else { + segment = `${i === 0 ? 'M' : 'L'}${p.x} ${p.y}`; + } + res += segment; + return res; + }, ''); + return [path, labelX, labelY, offsetX, offsetY]; +} + +function isNodeInitialized(node) { + return (node && + !!(node.internals.handleBounds || node.handles?.length) && + !!(node.measured.width || node.width || node.initialWidth)); +} +function getEdgePosition(params) { + const { sourceNode, targetNode } = params; + if (!isNodeInitialized(sourceNode) || !isNodeInitialized(targetNode)) { + return null; + } + const sourceHandleBounds = sourceNode.internals.handleBounds || toHandleBounds(sourceNode.handles); + const targetHandleBounds = targetNode.internals.handleBounds || toHandleBounds(targetNode.handles); + const sourceHandle = getHandle$1(sourceHandleBounds?.source ?? [], params.sourceHandle); + const targetHandle = getHandle$1( + // when connection type is loose we can define all handles as sources and connect source -> source + params.connectionMode === ConnectionMode.Strict + ? targetHandleBounds?.target ?? [] + : (targetHandleBounds?.target ?? []).concat(targetHandleBounds?.source ?? []), params.targetHandle); + if (!sourceHandle || !targetHandle) { + params.onError?.('008', errorMessages['error008'](!sourceHandle ? 'source' : 'target', { + id: params.id, + sourceHandle: params.sourceHandle, + targetHandle: params.targetHandle, + })); + return null; + } + const sourcePosition = sourceHandle?.position || Position.Bottom; + const targetPosition = targetHandle?.position || Position.Top; + const source = getHandlePosition(sourceNode, sourceHandle, sourcePosition); + const target = getHandlePosition(targetNode, targetHandle, targetPosition); + return { + sourceX: source.x, + sourceY: source.y, + targetX: target.x, + targetY: target.y, + sourcePosition, + targetPosition, + }; +} +function toHandleBounds(handles) { + if (!handles) { + return null; + } + const source = []; + const target = []; + for (const handle of handles) { + handle.width = handle.width ?? 1; + handle.height = handle.height ?? 1; + if (handle.type === 'source') { + source.push(handle); + } + else if (handle.type === 'target') { + target.push(handle); + } + } + return { + source, + target, + }; +} +function getHandlePosition(node, handle, fallbackPosition = Position.Left, center = false) { + const x = (handle?.x ?? 0) + node.internals.positionAbsolute.x; + const y = (handle?.y ?? 0) + node.internals.positionAbsolute.y; + const { width, height } = handle ?? getNodeDimensions(node); + if (center) { + return { x: x + width / 2, y: y + height / 2 }; + } + const position = handle?.position ?? fallbackPosition; + switch (position) { + case Position.Top: + return { x: x + width / 2, y }; + case Position.Right: + return { x: x + width, y: y + height / 2 }; + case Position.Bottom: + return { x: x + width / 2, y: y + height }; + case Position.Left: + return { x, y: y + height / 2 }; + } +} +function getHandle$1(bounds, handleId) { + if (!bounds) { + return null; + } + // if no handleId is given, we use the first handle, otherwise we check for the id + return (!handleId ? bounds[0] : bounds.find((d) => d.id === handleId)) || null; +} + +function getMarkerId(marker, id) { + if (!marker) { + return ''; + } + if (typeof marker === 'string') { + return marker; + } + const idPrefix = id ? `${id}__` : ''; + return `${idPrefix}${Object.keys(marker) + .sort() + .map((key) => `${key}=${marker[key]}`) + .join('&')}`; +} +function createMarkerIds(edges, { id, defaultColor, defaultMarkerStart, defaultMarkerEnd, }) { + const ids = new Set(); + return edges + .reduce((markers, edge) => { + [edge.markerStart || defaultMarkerStart, edge.markerEnd || defaultMarkerEnd].forEach((marker) => { + if (marker && typeof marker === 'object') { + const markerId = getMarkerId(marker, id); + if (!ids.has(markerId)) { + markers.push({ id: markerId, color: marker.color || defaultColor, ...marker }); + ids.add(markerId); + } + } + }); + return markers; + }, []) + .sort((a, b) => a.id.localeCompare(b.id)); +} + +function getNodeToolbarTransform(nodeRect, viewport, position, offset, align) { + let alignmentOffset = 0.5; + if (align === 'start') { + alignmentOffset = 0; + } + else if (align === 'end') { + alignmentOffset = 1; + } + /* + * position === Position.Top + * we set the x any y position of the toolbar based on the nodes position + */ + let pos = [ + (nodeRect.x + nodeRect.width * alignmentOffset) * viewport.zoom + viewport.x, + nodeRect.y * viewport.zoom + viewport.y - offset, + ]; + // and than shift it based on the alignment. The shift values are in %. + let shift = [-100 * alignmentOffset, -100]; + switch (position) { + case Position.Right: + pos = [ + (nodeRect.x + nodeRect.width) * viewport.zoom + viewport.x + offset, + (nodeRect.y + nodeRect.height * alignmentOffset) * viewport.zoom + viewport.y, + ]; + shift = [0, -100 * alignmentOffset]; + break; + case Position.Bottom: + pos[1] = (nodeRect.y + nodeRect.height) * viewport.zoom + viewport.y + offset; + shift[1] = 0; + break; + case Position.Left: + pos = [ + nodeRect.x * viewport.zoom + viewport.x - offset, + (nodeRect.y + nodeRect.height * alignmentOffset) * viewport.zoom + viewport.y, + ]; + shift = [-100, -100 * alignmentOffset]; + break; + } + return `translate(${pos[0]}px, ${pos[1]}px) translate(${shift[0]}%, ${shift[1]}%)`; +} + +const defaultOptions = { + nodeOrigin: [0, 0], + nodeExtent: infiniteExtent, + elevateNodesOnSelect: true, + defaults: {}, +}; +const adoptUserNodesDefaultOptions = { + ...defaultOptions, + checkEquality: true, +}; +function mergeObjects(base, incoming) { + const result = { ...base }; + for (const key in incoming) { + if (incoming[key] !== undefined) { + // typecast is safe here, because we check for undefined + result[key] = incoming[key]; + } + } + return result; +} +function updateAbsolutePositions(nodeLookup, parentLookup, options) { + const _options = mergeObjects(defaultOptions, options); + for (const node of nodeLookup.values()) { + if (node.parentId) { + updateChildNode(node, nodeLookup, parentLookup, _options); + } + else { + const positionWithOrigin = getNodePositionWithOrigin(node, _options.nodeOrigin); + const extent = isCoordinateExtent(node.extent) ? node.extent : _options.nodeExtent; + const clampedPosition = clampPosition(positionWithOrigin, extent, getNodeDimensions(node)); + node.internals.positionAbsolute = clampedPosition; + } + } +} +function adoptUserNodes(nodes, nodeLookup, parentLookup, options) { + const _options = mergeObjects(adoptUserNodesDefaultOptions, options); + let nodesInitialized = nodes.length > 0; + const tmpLookup = new Map(nodeLookup); + const selectedNodeZ = _options?.elevateNodesOnSelect ? 1000 : 0; + nodeLookup.clear(); + parentLookup.clear(); + for (const userNode of nodes) { + let internalNode = tmpLookup.get(userNode.id); + if (_options.checkEquality && userNode === internalNode?.internals.userNode) { + nodeLookup.set(userNode.id, internalNode); + } + else { + const positionWithOrigin = getNodePositionWithOrigin(userNode, _options.nodeOrigin); + const extent = isCoordinateExtent(userNode.extent) ? userNode.extent : _options.nodeExtent; + const clampedPosition = clampPosition(positionWithOrigin, extent, getNodeDimensions(userNode)); + internalNode = { + ..._options.defaults, + ...userNode, + measured: { + width: userNode.measured?.width, + height: userNode.measured?.height, + }, + internals: { + positionAbsolute: clampedPosition, + // if user re-initializes the node or removes `measured` for whatever reason, we reset the handleBounds so that the node gets re-measured + handleBounds: !userNode.measured ? undefined : internalNode?.internals.handleBounds, + z: calculateZ(userNode, selectedNodeZ), + userNode, + }, + }; + nodeLookup.set(userNode.id, internalNode); + } + if ((internalNode.measured === undefined || + internalNode.measured.width === undefined || + internalNode.measured.height === undefined) && + !internalNode.hidden) { + nodesInitialized = false; + } + if (userNode.parentId) { + updateChildNode(internalNode, nodeLookup, parentLookup, options); + } + } + return nodesInitialized; +} +function updateParentLookup(node, parentLookup) { + if (!node.parentId) { + return; + } + const childNodes = parentLookup.get(node.parentId); + if (childNodes) { + childNodes.set(node.id, node); + } + else { + parentLookup.set(node.parentId, new Map([[node.id, node]])); + } +} +/** + * Updates positionAbsolute and zIndex of a child node and the parentLookup. + */ +function updateChildNode(node, nodeLookup, parentLookup, options) { + const { elevateNodesOnSelect, nodeOrigin, nodeExtent } = mergeObjects(defaultOptions, options); + const parentId = node.parentId; + const parentNode = nodeLookup.get(parentId); + if (!parentNode) { + console.warn(`Parent node ${parentId} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`); + return; + } + updateParentLookup(node, parentLookup); + const selectedNodeZ = elevateNodesOnSelect ? 1000 : 0; + const { x, y, z } = calculateChildXYZ(node, parentNode, nodeOrigin, nodeExtent, selectedNodeZ); + const { positionAbsolute } = node.internals; + const positionChanged = x !== positionAbsolute.x || y !== positionAbsolute.y; + if (positionChanged || z !== node.internals.z) { + // we create a new object to mark the node as updated + nodeLookup.set(node.id, { + ...node, + internals: { + ...node.internals, + positionAbsolute: positionChanged ? { x, y } : positionAbsolute, + z, + }, + }); + } +} +function calculateZ(node, selectedNodeZ) { + return (isNumeric(node.zIndex) ? node.zIndex : 0) + (node.selected ? selectedNodeZ : 0); +} +function calculateChildXYZ(childNode, parentNode, nodeOrigin, nodeExtent, selectedNodeZ) { + const { x: parentX, y: parentY } = parentNode.internals.positionAbsolute; + const childDimensions = getNodeDimensions(childNode); + const positionWithOrigin = getNodePositionWithOrigin(childNode, nodeOrigin); + const clampedPosition = isCoordinateExtent(childNode.extent) + ? clampPosition(positionWithOrigin, childNode.extent, childDimensions) + : positionWithOrigin; + let absolutePosition = clampPosition({ x: parentX + clampedPosition.x, y: parentY + clampedPosition.y }, nodeExtent, childDimensions); + if (childNode.extent === 'parent') { + absolutePosition = clampPositionToParent(absolutePosition, childDimensions, parentNode); + } + const childZ = calculateZ(childNode, selectedNodeZ); + const parentZ = parentNode.internals.z ?? 0; + return { + x: absolutePosition.x, + y: absolutePosition.y, + z: parentZ > childZ ? parentZ : childZ, + }; +} +function handleExpandParent(children, nodeLookup, parentLookup, nodeOrigin = [0, 0]) { + const changes = []; + const parentExpansions = new Map(); + // determine the expanded rectangle the child nodes would take for each parent + for (const child of children) { + const parent = nodeLookup.get(child.parentId); + if (!parent) { + continue; + } + const parentRect = parentExpansions.get(child.parentId)?.expandedRect ?? nodeToRect(parent); + const expandedRect = getBoundsOfRects(parentRect, child.rect); + parentExpansions.set(child.parentId, { expandedRect, parent }); + } + if (parentExpansions.size > 0) { + parentExpansions.forEach(({ expandedRect, parent }, parentId) => { + // determine the position & dimensions of the parent + const positionAbsolute = parent.internals.positionAbsolute; + const dimensions = getNodeDimensions(parent); + const origin = parent.origin ?? nodeOrigin; + // determine how much the parent expands in width and position + const xChange = expandedRect.x < positionAbsolute.x ? Math.round(Math.abs(positionAbsolute.x - expandedRect.x)) : 0; + const yChange = expandedRect.y < positionAbsolute.y ? Math.round(Math.abs(positionAbsolute.y - expandedRect.y)) : 0; + const newWidth = Math.max(dimensions.width, Math.round(expandedRect.width)); + const newHeight = Math.max(dimensions.height, Math.round(expandedRect.height)); + const widthChange = (newWidth - dimensions.width) * origin[0]; + const heightChange = (newHeight - dimensions.height) * origin[1]; + // We need to correct the position of the parent node if the origin is not [0,0] + if (xChange > 0 || yChange > 0 || widthChange || heightChange) { + changes.push({ + id: parentId, + type: 'position', + position: { + x: parent.position.x - xChange + widthChange, + y: parent.position.y - yChange + heightChange, + }, + }); + /* + * We move all child nodes in the oppsite direction + * so the x,y changes of the parent do not move the children + */ + parentLookup.get(parentId)?.forEach((childNode) => { + if (!children.some((child) => child.id === childNode.id)) { + changes.push({ + id: childNode.id, + type: 'position', + position: { + x: childNode.position.x + xChange, + y: childNode.position.y + yChange, + }, + }); + } + }); + } + // We need to correct the dimensions of the parent node if the origin is not [0,0] + if (dimensions.width < expandedRect.width || dimensions.height < expandedRect.height || xChange || yChange) { + changes.push({ + id: parentId, + type: 'dimensions', + setAttributes: true, + dimensions: { + width: newWidth + (xChange ? origin[0] * xChange - widthChange : 0), + height: newHeight + (yChange ? origin[1] * yChange - heightChange : 0), + }, + }); + } + }); + } + return changes; +} +function updateNodeInternals(updates, nodeLookup, parentLookup, domNode, nodeOrigin, nodeExtent) { + const viewportNode = domNode?.querySelector('.xyflow__viewport'); + let updatedInternals = false; + if (!viewportNode) { + return { changes: [], updatedInternals }; + } + const changes = []; + const style = window.getComputedStyle(viewportNode); + const { m22: zoom } = new window.DOMMatrixReadOnly(style.transform); + // in this array we collect nodes, that might trigger changes (like expanding parent) + const parentExpandChildren = []; + for (const update of updates.values()) { + const node = nodeLookup.get(update.id); + if (!node) { + continue; + } + if (node.hidden) { + nodeLookup.set(node.id, { + ...node, + internals: { + ...node.internals, + handleBounds: undefined, + }, + }); + updatedInternals = true; + continue; + } + const dimensions = getDimensions(update.nodeElement); + const dimensionChanged = node.measured.width !== dimensions.width || node.measured.height !== dimensions.height; + const doUpdate = !!(dimensions.width && + dimensions.height && + (dimensionChanged || !node.internals.handleBounds || update.force)); + if (doUpdate) { + const nodeBounds = update.nodeElement.getBoundingClientRect(); + const extent = isCoordinateExtent(node.extent) ? node.extent : nodeExtent; + let { positionAbsolute } = node.internals; + if (node.parentId && node.extent === 'parent') { + positionAbsolute = clampPositionToParent(positionAbsolute, dimensions, nodeLookup.get(node.parentId)); + } + else if (extent) { + positionAbsolute = clampPosition(positionAbsolute, extent, dimensions); + } + const newNode = { + ...node, + measured: dimensions, + internals: { + ...node.internals, + positionAbsolute, + handleBounds: { + source: getHandleBounds('source', update.nodeElement, nodeBounds, zoom, node.id), + target: getHandleBounds('target', update.nodeElement, nodeBounds, zoom, node.id), + }, + }, + }; + nodeLookup.set(node.id, newNode); + if (node.parentId) { + updateChildNode(newNode, nodeLookup, parentLookup, { nodeOrigin }); + } + updatedInternals = true; + if (dimensionChanged) { + changes.push({ + id: node.id, + type: 'dimensions', + dimensions, + }); + if (node.expandParent && node.parentId) { + parentExpandChildren.push({ + id: node.id, + parentId: node.parentId, + rect: nodeToRect(newNode, nodeOrigin), + }); + } + } + } + } + if (parentExpandChildren.length > 0) { + const parentExpandChanges = handleExpandParent(parentExpandChildren, nodeLookup, parentLookup, nodeOrigin); + changes.push(...parentExpandChanges); + } + return { changes, updatedInternals }; +} +async function panBy({ delta, panZoom, transform, translateExtent, width, height, }) { + if (!panZoom || (!delta.x && !delta.y)) { + return Promise.resolve(false); + } + const nextViewport = await panZoom.setViewportConstrained({ + x: transform[0] + delta.x, + y: transform[1] + delta.y, + zoom: transform[2], + }, [ + [0, 0], + [width, height], + ], translateExtent); + const transformChanged = !!nextViewport && + (nextViewport.x !== transform[0] || nextViewport.y !== transform[1] || nextViewport.k !== transform[2]); + return Promise.resolve(transformChanged); +} +/** + * this function adds the connection to the connectionLookup + * at the following keys: nodeId-type-handleId, nodeId-type and nodeId + * @param type type of the connection + * @param connection connection that should be added to the lookup + * @param connectionKey at which key the connection should be added + * @param connectionLookup reference to the connection lookup + * @param nodeId nodeId of the connection + * @param handleId handleId of the conneciton + */ +function addConnectionToLookup(type, connection, connectionKey, connectionLookup, nodeId, handleId) { + /* + * We add the connection to the connectionLookup at the following keys + * 1. nodeId, 2. nodeId-type, 3. nodeId-type-handleId + * If the key already exists, we add the connection to the existing map + */ + let key = nodeId; + const nodeMap = connectionLookup.get(key) || new Map(); + connectionLookup.set(key, nodeMap.set(connectionKey, connection)); + key = `${nodeId}-${type}`; + const typeMap = connectionLookup.get(key) || new Map(); + connectionLookup.set(key, typeMap.set(connectionKey, connection)); + if (handleId) { + key = `${nodeId}-${type}-${handleId}`; + const handleMap = connectionLookup.get(key) || new Map(); + connectionLookup.set(key, handleMap.set(connectionKey, connection)); + } +} +function updateConnectionLookup(connectionLookup, edgeLookup, edges) { + connectionLookup.clear(); + edgeLookup.clear(); + for (const edge of edges) { + const { source: sourceNode, target: targetNode, sourceHandle = null, targetHandle = null } = edge; + const connection = { edgeId: edge.id, source: sourceNode, target: targetNode, sourceHandle, targetHandle }; + const sourceKey = `${sourceNode}-${sourceHandle}--${targetNode}-${targetHandle}`; + const targetKey = `${targetNode}-${targetHandle}--${sourceNode}-${sourceHandle}`; + addConnectionToLookup('source', connection, targetKey, connectionLookup, sourceNode, sourceHandle); + addConnectionToLookup('target', connection, sourceKey, connectionLookup, targetNode, targetHandle); + edgeLookup.set(edge.id, edge); + } +} + +function shallowNodeData(a, b) { + if (a === null || b === null) { + return false; + } + const _a = Array.isArray(a) ? a : [a]; + const _b = Array.isArray(b) ? b : [b]; + if (_a.length !== _b.length) { + return false; + } + for (let i = 0; i < _a.length; i++) { + if (_a[i].id !== _b[i].id || _a[i].type !== _b[i].type || !Object.is(_a[i].data, _b[i].data)) { + return false; + } + } + return true; +} + +function isParentSelected(node, nodeLookup) { + if (!node.parentId) { + return false; + } + const parentNode = nodeLookup.get(node.parentId); + if (!parentNode) { + return false; + } + if (parentNode.selected) { + return true; + } + return isParentSelected(parentNode, nodeLookup); +} +function hasSelector(target, selector, domNode) { + let current = target; + do { + if (current?.matches?.(selector)) + return true; + if (current === domNode) + return false; + current = current?.parentElement; + } while (current); + return false; +} +// looks for all selected nodes and created a NodeDragItem for each of them +function getDragItems(nodeLookup, nodesDraggable, mousePos, nodeId) { + const dragItems = new Map(); + for (const [id, node] of nodeLookup) { + if ((node.selected || node.id === nodeId) && + (!node.parentId || !isParentSelected(node, nodeLookup)) && + (node.draggable || (nodesDraggable && typeof node.draggable === 'undefined'))) { + const internalNode = nodeLookup.get(id); + if (internalNode) { + dragItems.set(id, { + id, + position: internalNode.position || { x: 0, y: 0 }, + distance: { + x: mousePos.x - internalNode.internals.positionAbsolute.x, + y: mousePos.y - internalNode.internals.positionAbsolute.y, + }, + extent: internalNode.extent, + parentId: internalNode.parentId, + origin: internalNode.origin, + expandParent: internalNode.expandParent, + internals: { + positionAbsolute: internalNode.internals.positionAbsolute || { x: 0, y: 0 }, + }, + measured: { + width: internalNode.measured.width ?? 0, + height: internalNode.measured.height ?? 0, + }, + }); + } + } + } + return dragItems; +} +/* + * returns two params: + * 1. the dragged node (or the first of the list, if we are dragging a node selection) + * 2. array of selected nodes (for multi selections) + */ +function getEventHandlerParams({ nodeId, dragItems, nodeLookup, dragging = true, }) { + const nodesFromDragItems = []; + for (const [id, dragItem] of dragItems) { + const node = nodeLookup.get(id)?.internals.userNode; + if (node) { + nodesFromDragItems.push({ + ...node, + position: dragItem.position, + dragging, + }); + } + } + if (!nodeId) { + return [nodesFromDragItems[0], nodesFromDragItems]; + } + const node = nodeLookup.get(nodeId)?.internals.userNode; + return [ + !node + ? nodesFromDragItems[0] + : { + ...node, + position: dragItems.get(nodeId)?.position || node.position, + dragging, + }, + nodesFromDragItems, + ]; +} + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragStop, }) { + let lastPos = { x: null, y: null }; + let autoPanId = 0; + let dragItems = new Map(); + let autoPanStarted = false; + let mousePosition = { x: 0, y: 0 }; + let containerBounds = null; + let dragStarted = false; + let d3Selection = null; + let abortDrag = false; // prevents unintentional dragging on multitouch + // public functions + function update({ noDragClassName, handleSelector, domNode, isSelectable, nodeId, nodeClickDistance = 0, }) { + d3Selection = select(domNode); + function updateNodes({ x, y }, dragEvent) { + const { nodeLookup, nodeExtent, snapGrid, snapToGrid, nodeOrigin, onNodeDrag, onSelectionDrag, onError, updateNodePositions, } = getStoreItems(); + lastPos = { x, y }; + let hasChange = false; + let nodesBox = { x: 0, y: 0, x2: 0, y2: 0 }; + if (dragItems.size > 1 && nodeExtent) { + const rect = getInternalNodesBounds(dragItems); + nodesBox = rectToBox(rect); + } + for (const [id, dragItem] of dragItems) { + if (!nodeLookup.has(id)) { + /* + * if the node is not in the nodeLookup anymore, it was probably deleted while dragging + * and we don't need to update it anymore + */ + continue; + } + let nextPosition = { x: x - dragItem.distance.x, y: y - dragItem.distance.y }; + if (snapToGrid) { + nextPosition = snapPosition(nextPosition, snapGrid); + } + /* + * if there is selection with multiple nodes and a node extent is set, we need to adjust the node extent for each node + * based on its position so that the node stays at it's position relative to the selection. + */ + let adjustedNodeExtent = [ + [nodeExtent[0][0], nodeExtent[0][1]], + [nodeExtent[1][0], nodeExtent[1][1]], + ]; + if (dragItems.size > 1 && nodeExtent && !dragItem.extent) { + const { positionAbsolute } = dragItem.internals; + const x1 = positionAbsolute.x - nodesBox.x + nodeExtent[0][0]; + const x2 = positionAbsolute.x + dragItem.measured.width - nodesBox.x2 + nodeExtent[1][0]; + const y1 = positionAbsolute.y - nodesBox.y + nodeExtent[0][1]; + const y2 = positionAbsolute.y + dragItem.measured.height - nodesBox.y2 + nodeExtent[1][1]; + adjustedNodeExtent = [ + [x1, y1], + [x2, y2], + ]; + } + const { position, positionAbsolute } = calculateNodePosition({ + nodeId: id, + nextPosition, + nodeLookup, + nodeExtent: adjustedNodeExtent, + nodeOrigin, + onError, + }); + // we want to make sure that we only fire a change event when there is a change + hasChange = hasChange || dragItem.position.x !== position.x || dragItem.position.y !== position.y; + dragItem.position = position; + dragItem.internals.positionAbsolute = positionAbsolute; + } + if (!hasChange) { + return; + } + updateNodePositions(dragItems, true); + if (dragEvent && (onDrag || onNodeDrag || (!nodeId && onSelectionDrag))) { + const [currentNode, currentNodes] = getEventHandlerParams({ + nodeId, + dragItems, + nodeLookup, + }); + onDrag?.(dragEvent, dragItems, currentNode, currentNodes); + onNodeDrag?.(dragEvent, currentNode, currentNodes); + if (!nodeId) { + onSelectionDrag?.(dragEvent, currentNodes); + } + } + } + async function autoPan() { + if (!containerBounds) { + return; + } + const { transform, panBy, autoPanSpeed, autoPanOnNodeDrag } = getStoreItems(); + if (!autoPanOnNodeDrag) { + autoPanStarted = false; + cancelAnimationFrame(autoPanId); + return; + } + const [xMovement, yMovement] = calcAutoPan(mousePosition, containerBounds, autoPanSpeed); + if (xMovement !== 0 || yMovement !== 0) { + lastPos.x = (lastPos.x ?? 0) - xMovement / transform[2]; + lastPos.y = (lastPos.y ?? 0) - yMovement / transform[2]; + if (await panBy({ x: xMovement, y: yMovement })) { + updateNodes(lastPos, null); + } + } + autoPanId = requestAnimationFrame(autoPan); + } + function startDrag(event) { + const { nodeLookup, multiSelectionActive, nodesDraggable, transform, snapGrid, snapToGrid, selectNodesOnDrag, onNodeDragStart, onSelectionDragStart, unselectNodesAndEdges, } = getStoreItems(); + dragStarted = true; + if ((!selectNodesOnDrag || !isSelectable) && !multiSelectionActive && nodeId) { + if (!nodeLookup.get(nodeId)?.selected) { + // we need to reset selected nodes when selectNodesOnDrag=false + unselectNodesAndEdges(); + } + } + if (isSelectable && selectNodesOnDrag && nodeId) { + onNodeMouseDown?.(nodeId); + } + const pointerPos = getPointerPosition(event.sourceEvent, { transform, snapGrid, snapToGrid, containerBounds }); + lastPos = pointerPos; + dragItems = getDragItems(nodeLookup, nodesDraggable, pointerPos, nodeId); + if (dragItems.size > 0 && (onDragStart || onNodeDragStart || (!nodeId && onSelectionDragStart))) { + const [currentNode, currentNodes] = getEventHandlerParams({ + nodeId, + dragItems, + nodeLookup, + }); + onDragStart?.(event.sourceEvent, dragItems, currentNode, currentNodes); + onNodeDragStart?.(event.sourceEvent, currentNode, currentNodes); + if (!nodeId) { + onSelectionDragStart?.(event.sourceEvent, currentNodes); + } + } + } + const d3DragInstance = drag() + .clickDistance(nodeClickDistance) + .on('start', (event) => { + const { domNode, nodeDragThreshold, transform, snapGrid, snapToGrid } = getStoreItems(); + containerBounds = domNode?.getBoundingClientRect() || null; + abortDrag = false; + if (nodeDragThreshold === 0) { + startDrag(event); + } + const pointerPos = getPointerPosition(event.sourceEvent, { transform, snapGrid, snapToGrid, containerBounds }); + lastPos = pointerPos; + mousePosition = getEventPosition(event.sourceEvent, containerBounds); + }) + .on('drag', (event) => { + const { autoPanOnNodeDrag, transform, snapGrid, snapToGrid, nodeDragThreshold, nodeLookup } = getStoreItems(); + const pointerPos = getPointerPosition(event.sourceEvent, { transform, snapGrid, snapToGrid, containerBounds }); + if ((event.sourceEvent.type === 'touchmove' && event.sourceEvent.touches.length > 1) || + // if user deletes a node while dragging, we need to abort the drag to prevent errors + (nodeId && !nodeLookup.has(nodeId))) { + abortDrag = true; + } + if (abortDrag) { + return; + } + if (!autoPanStarted && autoPanOnNodeDrag && dragStarted) { + autoPanStarted = true; + autoPan(); + } + if (!dragStarted) { + const x = pointerPos.xSnapped - (lastPos.x ?? 0); + const y = pointerPos.ySnapped - (lastPos.y ?? 0); + const distance = Math.sqrt(x * x + y * y); + if (distance > nodeDragThreshold) { + startDrag(event); + } + } + // skip events without movement + if ((lastPos.x !== pointerPos.xSnapped || lastPos.y !== pointerPos.ySnapped) && dragItems && dragStarted) { + // dragEvent = event.sourceEvent as MouseEvent; + mousePosition = getEventPosition(event.sourceEvent, containerBounds); + updateNodes(pointerPos, event.sourceEvent); + } + }) + .on('end', (event) => { + if (!dragStarted || abortDrag) { + return; + } + autoPanStarted = false; + dragStarted = false; + cancelAnimationFrame(autoPanId); + if (dragItems.size > 0) { + const { nodeLookup, updateNodePositions, onNodeDragStop, onSelectionDragStop } = getStoreItems(); + updateNodePositions(dragItems, false); + if (onDragStop || onNodeDragStop || (!nodeId && onSelectionDragStop)) { + const [currentNode, currentNodes] = getEventHandlerParams({ + nodeId, + dragItems, + nodeLookup, + dragging: false, + }); + onDragStop?.(event.sourceEvent, dragItems, currentNode, currentNodes); + onNodeDragStop?.(event.sourceEvent, currentNode, currentNodes); + if (!nodeId) { + onSelectionDragStop?.(event.sourceEvent, currentNodes); + } + } + } + }) + .filter((event) => { + const target = event.target; + const isDraggable = !event.button && + (!noDragClassName || !hasSelector(target, `.${noDragClassName}`, domNode)) && + (!handleSelector || hasSelector(target, handleSelector, domNode)); + return isDraggable; + }); + d3Selection.call(d3DragInstance); + } + function destroy() { + d3Selection?.on('.drag', null); + } + return { + update, + destroy, + }; +} + +function getNodesWithinDistance(position, nodeLookup, distance) { + const nodes = []; + const rect = { + x: position.x - distance, + y: position.y - distance, + width: distance * 2, + height: distance * 2, + }; + for (const node of nodeLookup.values()) { + if (getOverlappingArea(rect, nodeToRect(node)) > 0) { + nodes.push(node); + } + } + return nodes; +} +/* + * this distance is used for the area around the user pointer + * while doing a connection for finding the closest nodes + */ +const ADDITIONAL_DISTANCE = 250; +function getClosestHandle(position, connectionRadius, nodeLookup, fromHandle) { + let closestHandles = []; + let minDistance = Infinity; + const closeNodes = getNodesWithinDistance(position, nodeLookup, connectionRadius + ADDITIONAL_DISTANCE); + for (const node of closeNodes) { + const allHandles = [...(node.internals.handleBounds?.source ?? []), ...(node.internals.handleBounds?.target ?? [])]; + for (const handle of allHandles) { + // if the handle is the same as the fromHandle we skip it + if (fromHandle.nodeId === handle.nodeId && fromHandle.type === handle.type && fromHandle.id === handle.id) { + continue; + } + // determine absolute position of the handle + const { x, y } = getHandlePosition(node, handle, handle.position, true); + const distance = Math.sqrt(Math.pow(x - position.x, 2) + Math.pow(y - position.y, 2)); + if (distance > connectionRadius) { + continue; + } + if (distance < minDistance) { + closestHandles = [{ ...handle, x, y }]; + minDistance = distance; + } + else if (distance === minDistance) { + // when multiple handles are on the same distance we collect all of them + closestHandles.push({ ...handle, x, y }); + } + } + } + if (!closestHandles.length) { + return null; + } + // when multiple handles overlay each other we prefer the opposite handle + if (closestHandles.length > 1) { + const oppositeHandleType = fromHandle.type === 'source' ? 'target' : 'source'; + return closestHandles.find((handle) => handle.type === oppositeHandleType) ?? closestHandles[0]; + } + return closestHandles[0]; +} +function getHandle(nodeId, handleType, handleId, nodeLookup, connectionMode, withAbsolutePosition = false) { + const node = nodeLookup.get(nodeId); + if (!node) { + return null; + } + const handles = connectionMode === 'strict' + ? node.internals.handleBounds?.[handleType] + : [...(node.internals.handleBounds?.source ?? []), ...(node.internals.handleBounds?.target ?? [])]; + const handle = (handleId ? handles?.find((h) => h.id === handleId) : handles?.[0]) ?? null; + return handle && withAbsolutePosition + ? { ...handle, ...getHandlePosition(node, handle, handle.position, true) } + : handle; +} +function getHandleType(edgeUpdaterType, handleDomNode) { + if (edgeUpdaterType) { + return edgeUpdaterType; + } + else if (handleDomNode?.classList.contains('target')) { + return 'target'; + } + else if (handleDomNode?.classList.contains('source')) { + return 'source'; + } + return null; +} +function isConnectionValid(isInsideConnectionRadius, isHandleValid) { + let isValid = null; + if (isHandleValid) { + isValid = true; + } + else if (isInsideConnectionRadius && !isHandleValid) { + isValid = false; + } + return isValid; +} + +const alwaysValid = () => true; +function onPointerDown(event, { connectionMode, connectionRadius, handleId, nodeId, edgeUpdaterType, isTarget, domNode, nodeLookup, lib, autoPanOnConnect, flowId, panBy, cancelConnection, onConnectStart, onConnect, onConnectEnd, isValidConnection = alwaysValid, onReconnectEnd, updateConnection, getTransform, getFromHandle, autoPanSpeed, }) { + // when xyflow is used inside a shadow root we can't use document + const doc = getHostForElement(event.target); + let autoPanId = 0; + let closestHandle; + const { x, y } = getEventPosition(event); + const clickedHandle = doc?.elementFromPoint(x, y); + const handleType = getHandleType(edgeUpdaterType, clickedHandle); + const containerBounds = domNode?.getBoundingClientRect(); + if (!containerBounds || !handleType) { + return; + } + const fromHandleInternal = getHandle(nodeId, handleType, handleId, nodeLookup, connectionMode); + if (!fromHandleInternal) { + return; + } + let position = getEventPosition(event, containerBounds); + let autoPanStarted = false; + let connection = null; + let isValid = false; + let handleDomNode = null; + // when the user is moving the mouse close to the edge of the canvas while connecting we move the canvas + function autoPan() { + if (!autoPanOnConnect || !containerBounds) { + return; + } + const [x, y] = calcAutoPan(position, containerBounds, autoPanSpeed); + panBy({ x, y }); + autoPanId = requestAnimationFrame(autoPan); + } + // Stays the same for all consecutive pointermove events + const fromHandle = { + ...fromHandleInternal, + nodeId, + type: handleType, + position: fromHandleInternal.position, + }; + const fromNodeInternal = nodeLookup.get(nodeId); + const from = getHandlePosition(fromNodeInternal, fromHandle, Position.Left, true); + const newConnection = { + inProgress: true, + isValid: null, + from, + fromHandle, + fromPosition: fromHandle.position, + fromNode: fromNodeInternal, + to: position, + toHandle: null, + toPosition: oppositePosition[fromHandle.position], + toNode: null, + }; + updateConnection(newConnection); + let previousConnection = newConnection; + onConnectStart?.(event, { nodeId, handleId, handleType }); + function onPointerMove(event) { + if (!getFromHandle() || !fromHandle) { + onPointerUp(event); + return; + } + const transform = getTransform(); + position = getEventPosition(event, containerBounds); + closestHandle = getClosestHandle(pointToRendererPoint(position, transform, false, [1, 1]), connectionRadius, nodeLookup, fromHandle); + if (!autoPanStarted) { + autoPan(); + autoPanStarted = true; + } + const result = isValidHandle(event, { + handle: closestHandle, + connectionMode, + fromNodeId: nodeId, + fromHandleId: handleId, + fromType: isTarget ? 'target' : 'source', + isValidConnection, + doc, + lib, + flowId, + nodeLookup, + }); + handleDomNode = result.handleDomNode; + connection = result.connection; + isValid = isConnectionValid(!!closestHandle, result.isValid); + const newConnection = { + // from stays the same + ...previousConnection, + isValid, + to: result.toHandle && isValid + ? rendererPointToPoint({ x: result.toHandle.x, y: result.toHandle.y }, transform) + : position, + toHandle: result.toHandle, + toPosition: isValid && result.toHandle ? result.toHandle.position : oppositePosition[fromHandle.position], + toNode: result.toHandle ? nodeLookup.get(result.toHandle.nodeId) : null, + }; + /* + * we don't want to trigger an update when the connection + * is snapped to the same handle as before + */ + if (isValid && + closestHandle && + previousConnection.toHandle && + newConnection.toHandle && + previousConnection.toHandle.type === newConnection.toHandle.type && + previousConnection.toHandle.nodeId === newConnection.toHandle.nodeId && + previousConnection.toHandle.id === newConnection.toHandle.id && + previousConnection.to.x === newConnection.to.x && + previousConnection.to.y === newConnection.to.y) { + return; + } + updateConnection(newConnection); + previousConnection = newConnection; + } + function onPointerUp(event) { + if ((closestHandle || handleDomNode) && connection && isValid) { + onConnect?.(connection); + } + /* + * it's important to get a fresh reference from the store here + * in order to get the latest state of onConnectEnd + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const { inProgress, ...connectionState } = previousConnection; + const finalConnectionState = { + ...connectionState, + toPosition: previousConnection.toHandle ? previousConnection.toPosition : null, + }; + onConnectEnd?.(event, finalConnectionState); + if (edgeUpdaterType) { + onReconnectEnd?.(event, finalConnectionState); + } + cancelConnection(); + cancelAnimationFrame(autoPanId); + autoPanStarted = false; + isValid = false; + connection = null; + handleDomNode = null; + doc.removeEventListener('mousemove', onPointerMove); + doc.removeEventListener('mouseup', onPointerUp); + doc.removeEventListener('touchmove', onPointerMove); + doc.removeEventListener('touchend', onPointerUp); + } + doc.addEventListener('mousemove', onPointerMove); + doc.addEventListener('mouseup', onPointerUp); + doc.addEventListener('touchmove', onPointerMove); + doc.addEventListener('touchend', onPointerUp); +} +// checks if and returns connection in fom of an object { source: 123, target: 312 } +function isValidHandle(event, { handle, connectionMode, fromNodeId, fromHandleId, fromType, doc, lib, flowId, isValidConnection = alwaysValid, nodeLookup, }) { + const isTarget = fromType === 'target'; + const handleDomNode = handle + ? doc.querySelector(`.${lib}-flow__handle[data-id="${flowId}-${handle?.nodeId}-${handle?.id}-${handle?.type}"]`) + : null; + const { x, y } = getEventPosition(event); + const handleBelow = doc.elementFromPoint(x, y); + /* + * we always want to prioritize the handle below the mouse cursor over the closest distance handle, + * because it could be that the center of another handle is closer to the mouse pointer than the handle below the cursor + */ + const handleToCheck = handleBelow?.classList.contains(`${lib}-flow__handle`) ? handleBelow : handleDomNode; + const result = { + handleDomNode: handleToCheck, + isValid: false, + connection: null, + toHandle: null, + }; + if (handleToCheck) { + const handleType = getHandleType(undefined, handleToCheck); + const handleNodeId = handleToCheck.getAttribute('data-nodeid'); + const handleId = handleToCheck.getAttribute('data-handleid'); + const connectable = handleToCheck.classList.contains('connectable'); + const connectableEnd = handleToCheck.classList.contains('connectableend'); + if (!handleNodeId || !handleType) { + return result; + } + const connection = { + source: isTarget ? handleNodeId : fromNodeId, + sourceHandle: isTarget ? handleId : fromHandleId, + target: isTarget ? fromNodeId : handleNodeId, + targetHandle: isTarget ? fromHandleId : handleId, + }; + result.connection = connection; + const isConnectable = connectable && connectableEnd; + // in strict mode we don't allow target to target or source to source connections + const isValid = isConnectable && + (connectionMode === ConnectionMode.Strict + ? (isTarget && handleType === 'source') || (!isTarget && handleType === 'target') + : handleNodeId !== fromNodeId || handleId !== fromHandleId); + result.isValid = isValid && isValidConnection(connection); + result.toHandle = getHandle(handleNodeId, handleType, handleId, nodeLookup, connectionMode, true); + } + return result; +} +const XYHandle = { + onPointerDown, + isValid: isValidHandle, +}; + +function XYMinimap({ domNode, panZoom, getTransform, getViewScale }) { + const selection = select(domNode); + function update({ translateExtent, width, height, zoomStep = 10, pannable = true, zoomable = true, inversePan = false, }) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const zoomHandler = (event) => { + const transform = getTransform(); + if (event.sourceEvent.type !== 'wheel' || !panZoom) { + return; + } + const pinchDelta = -event.sourceEvent.deltaY * + (event.sourceEvent.deltaMode === 1 ? 0.05 : event.sourceEvent.deltaMode ? 1 : 0.002) * + zoomStep; + const nextZoom = transform[2] * Math.pow(2, pinchDelta); + panZoom.scaleTo(nextZoom); + }; + let panStart = [0, 0]; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const panStartHandler = (event) => { + if (event.sourceEvent.type === 'mousedown' || event.sourceEvent.type === 'touchstart') { + panStart = [ + event.sourceEvent.clientX ?? event.sourceEvent.touches[0].clientX, + event.sourceEvent.clientY ?? event.sourceEvent.touches[0].clientY, + ]; + } + }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const panHandler = (event) => { + const transform = getTransform(); + if ((event.sourceEvent.type !== 'mousemove' && event.sourceEvent.type !== 'touchmove') || !panZoom) { + return; + } + const panCurrent = [ + event.sourceEvent.clientX ?? event.sourceEvent.touches[0].clientX, + event.sourceEvent.clientY ?? event.sourceEvent.touches[0].clientY, + ]; + const panDelta = [panCurrent[0] - panStart[0], panCurrent[1] - panStart[1]]; + panStart = panCurrent; + const moveScale = getViewScale() * Math.max(transform[2], Math.log(transform[2])) * (inversePan ? -1 : 1); + const position = { + x: transform[0] - panDelta[0] * moveScale, + y: transform[1] - panDelta[1] * moveScale, + }; + const extent = [ + [0, 0], + [width, height], + ]; + panZoom.setViewportConstrained({ + x: position.x, + y: position.y, + zoom: transform[2], + }, extent, translateExtent); + }; + const zoomAndPanHandler = zoom() + .on('start', panStartHandler) + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + .on('zoom', pannable ? panHandler : null) + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + .on('zoom.wheel', zoomable ? zoomHandler : null); + selection.call(zoomAndPanHandler, {}); + } + function destroy() { + selection.on('zoom', null); + } + return { + update, + destroy, + pointer, + }; +} + +/* eslint-disable @typescript-eslint/no-explicit-any */ +const viewChanged = (prevViewport, eventViewport) => prevViewport.x !== eventViewport.x || prevViewport.y !== eventViewport.y || prevViewport.zoom !== eventViewport.k; +const transformToViewport = (transform) => ({ + x: transform.x, + y: transform.y, + zoom: transform.k, +}); +const viewportToTransform = ({ x, y, zoom }) => zoomIdentity.translate(x, y).scale(zoom); +const isWrappedWithClass = (event, className) => event.target.closest(`.${className}`); +const isRightClickPan = (panOnDrag, usedButton) => usedButton === 2 && Array.isArray(panOnDrag) && panOnDrag.includes(2); +// taken from d3-ease: https://github.com/d3/d3-ease/blob/main/src/cubic.js +const defaultEase = (t) => ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; +const getD3Transition = (selection, duration = 0, ease = defaultEase, onEnd = () => { }) => { + const hasDuration = typeof duration === 'number' && duration > 0; + if (!hasDuration) { + onEnd(); + } + return hasDuration ? selection.transition().duration(duration).ease(ease).on('end', onEnd) : selection; +}; +const wheelDelta = (event) => { + const factor = event.ctrlKey && isMacOs() ? 10 : 1; + return -event.deltaY * (event.deltaMode === 1 ? 0.05 : event.deltaMode ? 1 : 0.002) * factor; +}; + +function createPanOnScrollHandler({ zoomPanValues, noWheelClassName, d3Selection, d3Zoom, panOnScrollMode, panOnScrollSpeed, zoomOnPinch, onPanZoomStart, onPanZoom, onPanZoomEnd, }) { + return (event) => { + if (isWrappedWithClass(event, noWheelClassName)) { + return false; + } + event.preventDefault(); + event.stopImmediatePropagation(); + const currentZoom = d3Selection.property('__zoom').k || 1; + // macos sets ctrlKey=true for pinch gesture on a trackpad + if (event.ctrlKey && zoomOnPinch) { + const point = pointer(event); + const pinchDelta = wheelDelta(event); + const zoom = currentZoom * Math.pow(2, pinchDelta); + // @ts-ignore + d3Zoom.scaleTo(d3Selection, zoom, point, event); + return; + } + /* + * increase scroll speed in firefox + * firefox: deltaMode === 1; chrome: deltaMode === 0 + */ + const deltaNormalize = event.deltaMode === 1 ? 20 : 1; + let deltaX = panOnScrollMode === PanOnScrollMode.Vertical ? 0 : event.deltaX * deltaNormalize; + let deltaY = panOnScrollMode === PanOnScrollMode.Horizontal ? 0 : event.deltaY * deltaNormalize; + // this enables vertical scrolling with shift + scroll on windows + if (!isMacOs() && event.shiftKey && panOnScrollMode !== PanOnScrollMode.Vertical) { + deltaX = event.deltaY * deltaNormalize; + deltaY = 0; + } + d3Zoom.translateBy(d3Selection, -(deltaX / currentZoom) * panOnScrollSpeed, -(deltaY / currentZoom) * panOnScrollSpeed, + // @ts-ignore + { internal: true }); + const nextViewport = transformToViewport(d3Selection.property('__zoom')); + clearTimeout(zoomPanValues.panScrollTimeout); + /* + * for pan on scroll we need to handle the event calls on our own + * we can't use the start, zoom and end events from d3-zoom + * because start and move gets called on every scroll event and not once at the beginning + */ + if (!zoomPanValues.isPanScrolling) { + zoomPanValues.isPanScrolling = true; + onPanZoomStart?.(event, nextViewport); + } + if (zoomPanValues.isPanScrolling) { + onPanZoom?.(event, nextViewport); + zoomPanValues.panScrollTimeout = setTimeout(() => { + onPanZoomEnd?.(event, nextViewport); + zoomPanValues.isPanScrolling = false; + }, 150); + } + }; +} +function createZoomOnScrollHandler({ noWheelClassName, preventScrolling, d3ZoomHandler }) { + return function (event, d) { + const isWheel = event.type === 'wheel'; + // we still want to enable pinch zooming even if preventScrolling is set to false + const preventZoom = !preventScrolling && isWheel && !event.ctrlKey; + const hasNoWheelClass = isWrappedWithClass(event, noWheelClassName); + // if user is pinch zooming above a nowheel element, we don't want the browser to zoom + if (event.ctrlKey && isWheel && hasNoWheelClass) { + event.preventDefault(); + } + if (preventZoom || hasNoWheelClass) { + return null; + } + event.preventDefault(); + d3ZoomHandler.call(this, event, d); + }; +} +function createPanZoomStartHandler({ zoomPanValues, onDraggingChange, onPanZoomStart }) { + return (event) => { + if (event.sourceEvent?.internal) { + return; + } + const viewport = transformToViewport(event.transform); + // we need to remember it here, because it's always 0 in the "zoom" event + zoomPanValues.mouseButton = event.sourceEvent?.button || 0; + zoomPanValues.isZoomingOrPanning = true; + zoomPanValues.prevViewport = viewport; + if (event.sourceEvent?.type === 'mousedown') { + onDraggingChange(true); + } + if (onPanZoomStart) { + onPanZoomStart?.(event.sourceEvent, viewport); + } + }; +} +function createPanZoomHandler({ zoomPanValues, panOnDrag, onPaneContextMenu, onTransformChange, onPanZoom, }) { + return (event) => { + zoomPanValues.usedRightMouseButton = !!(onPaneContextMenu && isRightClickPan(panOnDrag, zoomPanValues.mouseButton ?? 0)); + if (!event.sourceEvent?.sync) { + onTransformChange([event.transform.x, event.transform.y, event.transform.k]); + } + if (onPanZoom && !event.sourceEvent?.internal) { + onPanZoom?.(event.sourceEvent, transformToViewport(event.transform)); + } + }; +} +function createPanZoomEndHandler({ zoomPanValues, panOnDrag, panOnScroll, onDraggingChange, onPanZoomEnd, onPaneContextMenu, }) { + return (event) => { + if (event.sourceEvent?.internal) { + return; + } + zoomPanValues.isZoomingOrPanning = false; + if (onPaneContextMenu && + isRightClickPan(panOnDrag, zoomPanValues.mouseButton ?? 0) && + !zoomPanValues.usedRightMouseButton && + event.sourceEvent) { + onPaneContextMenu(event.sourceEvent); + } + zoomPanValues.usedRightMouseButton = false; + onDraggingChange(false); + if (onPanZoomEnd && viewChanged(zoomPanValues.prevViewport, event.transform)) { + const viewport = transformToViewport(event.transform); + zoomPanValues.prevViewport = viewport; + clearTimeout(zoomPanValues.timerId); + zoomPanValues.timerId = setTimeout(() => { + onPanZoomEnd?.(event.sourceEvent, viewport); + }, + // we need a setTimeout for panOnScroll to supress multiple end events fired during scroll + panOnScroll ? 150 : 0); + } + }; +} + +/* eslint-disable @typescript-eslint/no-explicit-any */ +function createFilter({ zoomActivationKeyPressed, zoomOnScroll, zoomOnPinch, panOnDrag, panOnScroll, zoomOnDoubleClick, userSelectionActive, noWheelClassName, noPanClassName, lib, }) { + return (event) => { + const zoomScroll = zoomActivationKeyPressed || zoomOnScroll; + const pinchZoom = zoomOnPinch && event.ctrlKey; + if (event.button === 1 && + event.type === 'mousedown' && + (isWrappedWithClass(event, `${lib}-flow__node`) || isWrappedWithClass(event, `${lib}-flow__edge`))) { + return true; + } + // if all interactions are disabled, we prevent all zoom events + if (!panOnDrag && !zoomScroll && !panOnScroll && !zoomOnDoubleClick && !zoomOnPinch) { + return false; + } + // during a selection we prevent all other interactions + if (userSelectionActive) { + return false; + } + // if the target element is inside an element with the nowheel class, we prevent zooming + if (isWrappedWithClass(event, noWheelClassName) && event.type === 'wheel') { + return false; + } + // if the target element is inside an element with the nopan class, we prevent panning + if (isWrappedWithClass(event, noPanClassName) && + (event.type !== 'wheel' || (panOnScroll && event.type === 'wheel' && !zoomActivationKeyPressed))) { + return false; + } + if (!zoomOnPinch && event.ctrlKey && event.type === 'wheel') { + return false; + } + if (!zoomOnPinch && event.type === 'touchstart' && event.touches?.length > 1) { + event.preventDefault(); // if you manage to start with 2 touches, we prevent native zoom + return false; + } + // when there is no scroll handling enabled, we prevent all wheel events + if (!zoomScroll && !panOnScroll && !pinchZoom && event.type === 'wheel') { + return false; + } + // if the pane is not movable, we prevent dragging it with mousestart or touchstart + if (!panOnDrag && (event.type === 'mousedown' || event.type === 'touchstart')) { + return false; + } + // if the pane is only movable using allowed clicks + if (Array.isArray(panOnDrag) && !panOnDrag.includes(event.button) && event.type === 'mousedown') { + return false; + } + // We only allow right clicks if pan on drag is set to right click + const buttonAllowed = (Array.isArray(panOnDrag) && panOnDrag.includes(event.button)) || !event.button || event.button <= 1; + // default filter for d3-zoom + return (!event.ctrlKey || event.type === 'wheel') && buttonAllowed; + }; +} + +function XYPanZoom({ domNode, minZoom, maxZoom, paneClickDistance, translateExtent, viewport, onPanZoom, onPanZoomStart, onPanZoomEnd, onDraggingChange, }) { + const zoomPanValues = { + isZoomingOrPanning: false, + usedRightMouseButton: false, + prevViewport: { x: 0, y: 0, zoom: 0 }, + mouseButton: 0, + timerId: undefined, + panScrollTimeout: undefined, + isPanScrolling: false, + }; + const bbox = domNode.getBoundingClientRect(); + const d3ZoomInstance = zoom() + .clickDistance(!isNumeric(paneClickDistance) || paneClickDistance < 0 ? 0 : paneClickDistance) + .scaleExtent([minZoom, maxZoom]) + .translateExtent(translateExtent); + const d3Selection = select(domNode).call(d3ZoomInstance); + setViewportConstrained({ + x: viewport.x, + y: viewport.y, + zoom: clamp(viewport.zoom, minZoom, maxZoom), + }, [ + [0, 0], + [bbox.width, bbox.height], + ], translateExtent); + const d3ZoomHandler = d3Selection.on('wheel.zoom'); + const d3DblClickZoomHandler = d3Selection.on('dblclick.zoom'); + d3ZoomInstance.wheelDelta(wheelDelta); + function setTransform(transform, options) { + if (d3Selection) { + return new Promise((resolve) => { + d3ZoomInstance?.interpolate(options?.interpolate === 'linear' ? interpolate : interpolateZoom).transform(getD3Transition(d3Selection, options?.duration, options?.ease, () => resolve(true)), transform); + }); + } + return Promise.resolve(false); + } + // public functions + function update({ noWheelClassName, noPanClassName, onPaneContextMenu, userSelectionActive, panOnScroll, panOnDrag, panOnScrollMode, panOnScrollSpeed, preventScrolling, zoomOnPinch, zoomOnScroll, zoomOnDoubleClick, zoomActivationKeyPressed, lib, onTransformChange, }) { + if (userSelectionActive && !zoomPanValues.isZoomingOrPanning) { + destroy(); + } + const isPanOnScroll = panOnScroll && !zoomActivationKeyPressed && !userSelectionActive; + const wheelHandler = isPanOnScroll + ? createPanOnScrollHandler({ + zoomPanValues, + noWheelClassName, + d3Selection, + d3Zoom: d3ZoomInstance, + panOnScrollMode, + panOnScrollSpeed, + zoomOnPinch, + onPanZoomStart, + onPanZoom, + onPanZoomEnd, + }) + : createZoomOnScrollHandler({ + noWheelClassName, + preventScrolling, + d3ZoomHandler, + }); + d3Selection.on('wheel.zoom', wheelHandler, { passive: false }); + if (!userSelectionActive) { + // pan zoom start + const startHandler = createPanZoomStartHandler({ + zoomPanValues, + onDraggingChange, + onPanZoomStart, + }); + d3ZoomInstance.on('start', startHandler); + // pan zoom + const panZoomHandler = createPanZoomHandler({ + zoomPanValues, + panOnDrag, + onPaneContextMenu: !!onPaneContextMenu, + onPanZoom, + onTransformChange, + }); + d3ZoomInstance.on('zoom', panZoomHandler); + // pan zoom end + const panZoomEndHandler = createPanZoomEndHandler({ + zoomPanValues, + panOnDrag, + panOnScroll, + onPaneContextMenu, + onPanZoomEnd, + onDraggingChange, + }); + d3ZoomInstance.on('end', panZoomEndHandler); + } + const filter = createFilter({ + zoomActivationKeyPressed, + panOnDrag, + zoomOnScroll, + panOnScroll, + zoomOnDoubleClick, + zoomOnPinch, + userSelectionActive, + noPanClassName, + noWheelClassName, + lib, + }); + d3ZoomInstance.filter(filter); + /* + * We cannot add zoomOnDoubleClick to the filter above because + * double tapping on touch screens circumvents the filter and + * dblclick.zoom is fired on the selection directly + */ + if (zoomOnDoubleClick) { + d3Selection.on('dblclick.zoom', d3DblClickZoomHandler); + } + else { + d3Selection.on('dblclick.zoom', null); + } + } + function destroy() { + d3ZoomInstance.on('zoom', null); + } + async function setViewportConstrained(viewport, extent, translateExtent) { + const nextTransform = viewportToTransform(viewport); + const contrainedTransform = d3ZoomInstance?.constrain()(nextTransform, extent, translateExtent); + if (contrainedTransform) { + await setTransform(contrainedTransform); + } + return new Promise((resolve) => resolve(contrainedTransform)); + } + async function setViewport(viewport, options) { + const nextTransform = viewportToTransform(viewport); + await setTransform(nextTransform, options); + return new Promise((resolve) => resolve(nextTransform)); + } + function syncViewport(viewport) { + if (d3Selection) { + const nextTransform = viewportToTransform(viewport); + const currentTransform = d3Selection.property('__zoom'); + if (currentTransform.k !== viewport.zoom || + currentTransform.x !== viewport.x || + currentTransform.y !== viewport.y) { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + d3ZoomInstance?.transform(d3Selection, nextTransform, null, { sync: true }); + } + } + } + function getViewport() { + const transform = d3Selection ? zoomTransform(d3Selection.node()) : { x: 0, y: 0, k: 1 }; + return { x: transform.x, y: transform.y, zoom: transform.k }; + } + function scaleTo(zoom, options) { + if (d3Selection) { + return new Promise((resolve) => { + d3ZoomInstance?.interpolate(options?.interpolate === 'linear' ? interpolate : interpolateZoom).scaleTo(getD3Transition(d3Selection, options?.duration, options?.ease, () => resolve(true)), zoom); + }); + } + return Promise.resolve(false); + } + function scaleBy(factor, options) { + if (d3Selection) { + return new Promise((resolve) => { + d3ZoomInstance?.interpolate(options?.interpolate === 'linear' ? interpolate : interpolateZoom).scaleBy(getD3Transition(d3Selection, options?.duration, options?.ease, () => resolve(true)), factor); + }); + } + return Promise.resolve(false); + } + function setScaleExtent(scaleExtent) { + d3ZoomInstance?.scaleExtent(scaleExtent); + } + function setTranslateExtent(translateExtent) { + d3ZoomInstance?.translateExtent(translateExtent); + } + function setClickDistance(distance) { + const validDistance = !isNumeric(distance) || distance < 0 ? 0 : distance; + d3ZoomInstance?.clickDistance(validDistance); + } + return { + update, + destroy, + setViewport, + setViewportConstrained, + getViewport, + scaleTo, + scaleBy, + setScaleExtent, + setTranslateExtent, + syncViewport, + setClickDistance, + }; +} + +/** + * Used to determine the variant of the resize control + * + * @public + */ +var ResizeControlVariant; +(function (ResizeControlVariant) { + ResizeControlVariant["Line"] = "line"; + ResizeControlVariant["Handle"] = "handle"; +})(ResizeControlVariant || (ResizeControlVariant = {})); +const XY_RESIZER_HANDLE_POSITIONS = ['top-left', 'top-right', 'bottom-left', 'bottom-right']; +const XY_RESIZER_LINE_POSITIONS = ['top', 'right', 'bottom', 'left']; + +/** + * Get all connecting edges for a given set of nodes + * @param width - new width of the node + * @param prevWidth - previous width of the node + * @param height - new height of the node + * @param prevHeight - previous height of the node + * @param affectsX - whether to invert the resize direction for the x axis + * @param affectsY - whether to invert the resize direction for the y axis + * @returns array of two numbers representing the direction of the resize for each axis, 0 = no change, 1 = increase, -1 = decrease + */ +function getResizeDirection({ width, prevWidth, height, prevHeight, affectsX, affectsY, }) { + const deltaWidth = width - prevWidth; + const deltaHeight = height - prevHeight; + const direction = [deltaWidth > 0 ? 1 : deltaWidth < 0 ? -1 : 0, deltaHeight > 0 ? 1 : deltaHeight < 0 ? -1 : 0]; + if (deltaWidth && affectsX) { + direction[0] = direction[0] * -1; + } + if (deltaHeight && affectsY) { + direction[1] = direction[1] * -1; + } + return direction; +} +/** + * Parses the control position that is being dragged to dimensions that are being resized + * @param controlPosition - position of the control that is being dragged + * @returns isHorizontal, isVertical, affectsX, affectsY, + */ +function getControlDirection(controlPosition) { + const isHorizontal = controlPosition.includes('right') || controlPosition.includes('left'); + const isVertical = controlPosition.includes('bottom') || controlPosition.includes('top'); + const affectsX = controlPosition.includes('left'); + const affectsY = controlPosition.includes('top'); + return { + isHorizontal, + isVertical, + affectsX, + affectsY, + }; +} +function getLowerExtentClamp(lowerExtent, lowerBound) { + return Math.max(0, lowerBound - lowerExtent); +} +function getUpperExtentClamp(upperExtent, upperBound) { + return Math.max(0, upperExtent - upperBound); +} +function getSizeClamp(size, minSize, maxSize) { + return Math.max(0, minSize - size, size - maxSize); +} +function xor(a, b) { + return a ? !b : b; +} +/** + * Calculates new width & height and x & y of node after resize based on pointer position + * @description - Buckle up, this is a chunky one... If you want to determine the new dimensions of a node after a resize, + * you have to account for all possible restrictions: min/max width/height of the node, the maximum extent the node is allowed + * to move in (in this case: resize into) determined by the parent node, the minimal extent determined by child nodes + * with expandParent or extent: 'parent' set and oh yeah, these things also have to work with keepAspectRatio! + * The way this is done is by determining how much each of these restricting actually restricts the resize and then applying the + * strongest restriction. Because the resize affects x, y and width, height and width, height of a opposing side with keepAspectRatio, + * the resize amount is always kept in distX & distY amount (the distance in mouse movement) + * Instead of clamping each value, we first calculate the biggest 'clamp' (for the lack of a better name) and then apply it to all values. + * To complicate things nodeOrigin has to be taken into account as well. This is done by offsetting the nodes as if their origin is [0, 0], + * then calculating the restrictions as usual + * @param startValues - starting values of resize + * @param controlDirection - dimensions affected by the resize + * @param pointerPosition - the current pointer position corrected for snapping + * @param boundaries - minimum and maximum dimensions of the node + * @param keepAspectRatio - prevent changes of asprect ratio + * @returns x, y, width and height of the node after resize + */ +function getDimensionsAfterResize(startValues, controlDirection, pointerPosition, boundaries, keepAspectRatio, nodeOrigin, extent, childExtent) { + let { affectsX, affectsY } = controlDirection; + const { isHorizontal, isVertical } = controlDirection; + const isDiagonal = isHorizontal && isVertical; + const { xSnapped, ySnapped } = pointerPosition; + const { minWidth, maxWidth, minHeight, maxHeight } = boundaries; + const { x: startX, y: startY, width: startWidth, height: startHeight, aspectRatio } = startValues; + let distX = Math.floor(isHorizontal ? xSnapped - startValues.pointerX : 0); + let distY = Math.floor(isVertical ? ySnapped - startValues.pointerY : 0); + const newWidth = startWidth + (affectsX ? -distX : distX); + const newHeight = startHeight + (affectsY ? -distY : distY); + const originOffsetX = -nodeOrigin[0] * startWidth; + const originOffsetY = -nodeOrigin[1] * startHeight; + // Check if maxWidth, minWWidth, maxHeight, minHeight are restricting the resize + let clampX = getSizeClamp(newWidth, minWidth, maxWidth); + let clampY = getSizeClamp(newHeight, minHeight, maxHeight); + // Check if extent is restricting the resize + if (extent) { + let xExtentClamp = 0; + let yExtentClamp = 0; + if (affectsX && distX < 0) { + xExtentClamp = getLowerExtentClamp(startX + distX + originOffsetX, extent[0][0]); + } + else if (!affectsX && distX > 0) { + xExtentClamp = getUpperExtentClamp(startX + newWidth + originOffsetX, extent[1][0]); + } + if (affectsY && distY < 0) { + yExtentClamp = getLowerExtentClamp(startY + distY + originOffsetY, extent[0][1]); + } + else if (!affectsY && distY > 0) { + yExtentClamp = getUpperExtentClamp(startY + newHeight + originOffsetY, extent[1][1]); + } + clampX = Math.max(clampX, xExtentClamp); + clampY = Math.max(clampY, yExtentClamp); + } + // Check if the child extent is restricting the resize + if (childExtent) { + let xExtentClamp = 0; + let yExtentClamp = 0; + if (affectsX && distX > 0) { + xExtentClamp = getUpperExtentClamp(startX + distX, childExtent[0][0]); + } + else if (!affectsX && distX < 0) { + xExtentClamp = getLowerExtentClamp(startX + newWidth, childExtent[1][0]); + } + if (affectsY && distY > 0) { + yExtentClamp = getUpperExtentClamp(startY + distY, childExtent[0][1]); + } + else if (!affectsY && distY < 0) { + yExtentClamp = getLowerExtentClamp(startY + newHeight, childExtent[1][1]); + } + clampX = Math.max(clampX, xExtentClamp); + clampY = Math.max(clampY, yExtentClamp); + } + // Check if the aspect ratio resizing of the other side is restricting the resize + if (keepAspectRatio) { + if (isHorizontal) { + // Check if the max dimensions might be restricting the resize + const aspectHeightClamp = getSizeClamp(newWidth / aspectRatio, minHeight, maxHeight) * aspectRatio; + clampX = Math.max(clampX, aspectHeightClamp); + // Check if the extent is restricting the resize + if (extent) { + let aspectExtentClamp = 0; + if ((!affectsX && !affectsY) || (affectsX && !affectsY && isDiagonal)) { + aspectExtentClamp = + getUpperExtentClamp(startY + originOffsetY + newWidth / aspectRatio, extent[1][1]) * aspectRatio; + } + else { + aspectExtentClamp = + getLowerExtentClamp(startY + originOffsetY + (affectsX ? distX : -distX) / aspectRatio, extent[0][1]) * + aspectRatio; + } + clampX = Math.max(clampX, aspectExtentClamp); + } + // Check if the child extent is restricting the resize + if (childExtent) { + let aspectExtentClamp = 0; + if ((!affectsX && !affectsY) || (affectsX && !affectsY && isDiagonal)) { + aspectExtentClamp = getLowerExtentClamp(startY + newWidth / aspectRatio, childExtent[1][1]) * aspectRatio; + } + else { + aspectExtentClamp = + getUpperExtentClamp(startY + (affectsX ? distX : -distX) / aspectRatio, childExtent[0][1]) * aspectRatio; + } + clampX = Math.max(clampX, aspectExtentClamp); + } + } + // Do the same thing for vertical resizing + if (isVertical) { + const aspectWidthClamp = getSizeClamp(newHeight * aspectRatio, minWidth, maxWidth) / aspectRatio; + clampY = Math.max(clampY, aspectWidthClamp); + if (extent) { + let aspectExtentClamp = 0; + if ((!affectsX && !affectsY) || (affectsY && !affectsX && isDiagonal)) { + aspectExtentClamp = + getUpperExtentClamp(startX + newHeight * aspectRatio + originOffsetX, extent[1][0]) / aspectRatio; + } + else { + aspectExtentClamp = + getLowerExtentClamp(startX + (affectsY ? distY : -distY) * aspectRatio + originOffsetX, extent[0][0]) / + aspectRatio; + } + clampY = Math.max(clampY, aspectExtentClamp); + } + if (childExtent) { + let aspectExtentClamp = 0; + if ((!affectsX && !affectsY) || (affectsY && !affectsX && isDiagonal)) { + aspectExtentClamp = getLowerExtentClamp(startX + newHeight * aspectRatio, childExtent[1][0]) / aspectRatio; + } + else { + aspectExtentClamp = + getUpperExtentClamp(startX + (affectsY ? distY : -distY) * aspectRatio, childExtent[0][0]) / aspectRatio; + } + clampY = Math.max(clampY, aspectExtentClamp); + } + } + } + distY = distY + (distY < 0 ? clampY : -clampY); + distX = distX + (distX < 0 ? clampX : -clampX); + if (keepAspectRatio) { + if (isDiagonal) { + if (newWidth > newHeight * aspectRatio) { + distY = (xor(affectsX, affectsY) ? -distX : distX) / aspectRatio; + } + else { + distX = (xor(affectsX, affectsY) ? -distY : distY) * aspectRatio; + } + } + else { + if (isHorizontal) { + distY = distX / aspectRatio; + affectsY = affectsX; + } + else { + distX = distY * aspectRatio; + affectsX = affectsY; + } + } + } + const x = affectsX ? startX + distX : startX; + const y = affectsY ? startY + distY : startY; + return { + width: startWidth + (affectsX ? -distX : distX), + height: startHeight + (affectsY ? -distY : distY), + x: nodeOrigin[0] * distX * (!affectsX ? 1 : -1) + x, + y: nodeOrigin[1] * distY * (!affectsY ? 1 : -1) + y, + }; +} + +const initPrevValues = { width: 0, height: 0, x: 0, y: 0 }; +const initStartValues = { + ...initPrevValues, + pointerX: 0, + pointerY: 0, + aspectRatio: 1, +}; +function nodeToParentExtent(node) { + return [ + [0, 0], + [node.measured.width, node.measured.height], + ]; +} +function nodeToChildExtent(child, parent, nodeOrigin) { + const x = parent.position.x + child.position.x; + const y = parent.position.y + child.position.y; + const width = child.measured.width ?? 0; + const height = child.measured.height ?? 0; + const originOffsetX = nodeOrigin[0] * width; + const originOffsetY = nodeOrigin[1] * height; + return [ + [x - originOffsetX, y - originOffsetY], + [x + width - originOffsetX, y + height - originOffsetY], + ]; +} +function XYResizer({ domNode, nodeId, getStoreItems, onChange, onEnd }) { + const selection = select(domNode); + function update({ controlPosition, boundaries, keepAspectRatio, resizeDirection, onResizeStart, onResize, onResizeEnd, shouldResize, }) { + let prevValues = { ...initPrevValues }; + let startValues = { ...initStartValues }; + const controlDirection = getControlDirection(controlPosition); + let node = undefined; + let containerBounds = null; + let childNodes = []; + let parentNode = undefined; // Needed to fix expandParent + let parentExtent = undefined; + let childExtent = undefined; + const dragHandler = drag() + .on('start', (event) => { + const { nodeLookup, transform, snapGrid, snapToGrid, nodeOrigin, paneDomNode } = getStoreItems(); + node = nodeLookup.get(nodeId); + if (!node) { + return; + } + containerBounds = paneDomNode?.getBoundingClientRect() ?? null; + const { xSnapped, ySnapped } = getPointerPosition(event.sourceEvent, { + transform, + snapGrid, + snapToGrid, + containerBounds, + }); + prevValues = { + width: node.measured.width ?? 0, + height: node.measured.height ?? 0, + x: node.position.x ?? 0, + y: node.position.y ?? 0, + }; + startValues = { + ...prevValues, + pointerX: xSnapped, + pointerY: ySnapped, + aspectRatio: prevValues.width / prevValues.height, + }; + parentNode = undefined; + if (node.parentId && (node.extent === 'parent' || node.expandParent)) { + parentNode = nodeLookup.get(node.parentId); + parentExtent = parentNode && node.extent === 'parent' ? nodeToParentExtent(parentNode) : undefined; + } + /* + * Collect all child nodes to correct their relative positions when top/left changes + * Determine largest minimal extent the parent node is allowed to resize to + */ + childNodes = []; + childExtent = undefined; + for (const [childId, child] of nodeLookup) { + if (child.parentId === nodeId) { + childNodes.push({ + id: childId, + position: { ...child.position }, + extent: child.extent, + }); + if (child.extent === 'parent' || child.expandParent) { + const extent = nodeToChildExtent(child, node, child.origin ?? nodeOrigin); + if (childExtent) { + childExtent = [ + [Math.min(extent[0][0], childExtent[0][0]), Math.min(extent[0][1], childExtent[0][1])], + [Math.max(extent[1][0], childExtent[1][0]), Math.max(extent[1][1], childExtent[1][1])], + ]; + } + else { + childExtent = extent; + } + } + } + } + onResizeStart?.(event, { ...prevValues }); + }) + .on('drag', (event) => { + const { transform, snapGrid, snapToGrid, nodeOrigin: storeNodeOrigin } = getStoreItems(); + const pointerPosition = getPointerPosition(event.sourceEvent, { + transform, + snapGrid, + snapToGrid, + containerBounds, + }); + const childChanges = []; + if (!node) { + return; + } + const { x: prevX, y: prevY, width: prevWidth, height: prevHeight } = prevValues; + const change = {}; + const nodeOrigin = node.origin ?? storeNodeOrigin; + const { width, height, x, y } = getDimensionsAfterResize(startValues, controlDirection, pointerPosition, boundaries, keepAspectRatio, nodeOrigin, parentExtent, childExtent); + const isWidthChange = width !== prevWidth; + const isHeightChange = height !== prevHeight; + const isXPosChange = x !== prevX && isWidthChange; + const isYPosChange = y !== prevY && isHeightChange; + if (!isXPosChange && !isYPosChange && !isWidthChange && !isHeightChange) { + return; + } + if (isXPosChange || isYPosChange || nodeOrigin[0] === 1 || nodeOrigin[1] === 1) { + change.x = isXPosChange ? x : prevValues.x; + change.y = isYPosChange ? y : prevValues.y; + prevValues.x = change.x; + prevValues.y = change.y; + /* + * when top/left changes, correct the relative positions of child nodes + * so that they stay in the same position + */ + if (childNodes.length > 0) { + const xChange = x - prevX; + const yChange = y - prevY; + for (const childNode of childNodes) { + childNode.position = { + x: childNode.position.x - xChange + nodeOrigin[0] * (width - prevWidth), + y: childNode.position.y - yChange + nodeOrigin[1] * (height - prevHeight), + }; + childChanges.push(childNode); + } + } + } + if (isWidthChange || isHeightChange) { + change.width = + isWidthChange && (!resizeDirection || resizeDirection === 'horizontal') ? width : prevValues.width; + change.height = + isHeightChange && (!resizeDirection || resizeDirection === 'vertical') ? height : prevValues.height; + prevValues.width = change.width; + prevValues.height = change.height; + } + // Fix expandParent when resizing from top/left + if (parentNode && node.expandParent) { + const xLimit = nodeOrigin[0] * (change.width ?? 0); + if (change.x && change.x < xLimit) { + prevValues.x = xLimit; + startValues.x = startValues.x - (change.x - xLimit); + } + const yLimit = nodeOrigin[1] * (change.height ?? 0); + if (change.y && change.y < yLimit) { + prevValues.y = yLimit; + startValues.y = startValues.y - (change.y - yLimit); + } + } + const direction = getResizeDirection({ + width: prevValues.width, + prevWidth, + height: prevValues.height, + prevHeight, + affectsX: controlDirection.affectsX, + affectsY: controlDirection.affectsY, + }); + const nextValues = { ...prevValues, direction }; + const callResize = shouldResize?.(event, nextValues); + if (callResize === false) { + return; + } + onResize?.(event, nextValues); + onChange(change, childChanges); + }) + .on('end', (event) => { + onResizeEnd?.(event, { ...prevValues }); + onEnd?.({ ...prevValues }); + }); + selection.call(dragHandler); + } + function destroy() { + selection.on('.drag', null); + } + return { + update, + destroy, + }; +} + +export { ConnectionLineType, ConnectionMode, MarkerType, PanOnScrollMode, Position, ResizeControlVariant, SelectionMode, XYDrag, XYHandle, XYMinimap, XYPanZoom, XYResizer, XY_RESIZER_HANDLE_POSITIONS, XY_RESIZER_LINE_POSITIONS, addEdge, adoptUserNodes, areConnectionMapsEqual, areSetsEqual, boxToRect, calcAutoPan, calculateNodePosition, clamp, clampPosition, clampPositionToParent, createMarkerIds, defaultAriaLabelConfig, devWarn, elementSelectionKeys, errorMessages, evaluateAbsolutePosition, fitViewport, getBezierEdgeCenter, getBezierPath, getBoundsOfBoxes, getBoundsOfRects, getConnectedEdges, getConnectionStatus, getDimensions, getEdgeCenter, getEdgePosition, getElementsToRemove, getElevatedEdgeZIndex, getEventPosition, getHandleBounds, getHandlePosition, getHostForElement, getIncomers, getInternalNodesBounds, getMarkerId, getNodeDimensions, getNodePositionWithOrigin, getNodeToolbarTransform, getNodesBounds, getNodesInside, getOutgoers, getOverlappingArea, getPointerPosition, getSmoothStepPath, getStraightPath, getViewportForBounds, handleConnectionChange, handleExpandParent, infiniteExtent, initialConnection, isCoordinateExtent, isEdgeBase, isEdgeVisible, isInputDOMNode, isInternalNodeBase, isMacOs, isMouseEvent, isNodeBase, isNumeric, isRectObject, mergeAriaLabelConfig, nodeHasDimensions, nodeToBox, nodeToRect, oppositePosition, panBy, pointToRendererPoint, reconnectEdge, rectToBox, rendererPointToPoint, shallowNodeData, snapPosition, updateAbsolutePositions, updateConnectionLookup, updateNodeInternals, withResolvers }; diff --git a/node_modules/@xyflow/system/dist/esm/index.mjs b/node_modules/@xyflow/system/dist/esm/index.mjs new file mode 100644 index 0000000..297f9c7 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/index.mjs @@ -0,0 +1,3347 @@ +import { drag } from 'd3-drag'; +import { select, pointer } from 'd3-selection'; +import { zoom, zoomIdentity, zoomTransform } from 'd3-zoom'; +import { interpolateZoom, interpolate } from 'd3-interpolate'; + +const errorMessages = { + error001: () => '[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001', + error002: () => "It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.", + error003: (nodeType) => `Node type "${nodeType}" not found. Using fallback type "default".`, + error004: () => 'The React Flow parent container needs a width and a height to render the graph.', + error005: () => 'Only child nodes can use a parent extent.', + error006: () => "Can't create edge. An edge needs a source and a target.", + error007: (id) => `The old edge with id=${id} does not exist.`, + error009: (type) => `Marker type "${type}" doesn't exist.`, + error008: (handleType, { id, sourceHandle, targetHandle }) => `Couldn't create edge for ${handleType} handle id: "${handleType === 'source' ? sourceHandle : targetHandle}", edge id: ${id}.`, + error010: () => 'Handle: No node id found. Make sure to only use a Handle inside a custom Node.', + error011: (edgeType) => `Edge type "${edgeType}" not found. Using fallback type "default".`, + error012: (id) => `Node with id "${id}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`, + error013: (lib = 'react') => `It seems that you haven't loaded the styles. Please import '@xyflow/${lib}/dist/style.css' or base.css to make sure everything is working properly.`, + error014: () => 'useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.', + error015: () => 'It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.', +}; +const infiniteExtent = [ + [Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY], + [Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY], +]; +const elementSelectionKeys = ['Enter', ' ', 'Escape']; +const defaultAriaLabelConfig = { + 'node.a11yDescription.default': 'Press enter or space to select a node. Press delete to remove it and escape to cancel.', + 'node.a11yDescription.keyboardDisabled': 'Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.', + 'node.a11yDescription.ariaLiveMessage': ({ direction, x, y }) => `Moved selected node ${direction}. New position, x: ${x}, y: ${y}`, + 'edge.a11yDescription.default': 'Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.', + // Control elements + 'controls.ariaLabel': 'Control Panel', + 'controls.zoomIn.ariaLabel': 'Zoom In', + 'controls.zoomOut.ariaLabel': 'Zoom Out', + 'controls.fitView.ariaLabel': 'Fit View', + 'controls.interactive.ariaLabel': 'Toggle Interactivity', + // Mini map + 'minimap.ariaLabel': 'Mini Map', + // Handle + 'handle.ariaLabel': 'Handle', +}; + +/** + * The `ConnectionMode` is used to set the mode of connection between nodes. + * The `Strict` mode is the default one and only allows source to target edges. + * `Loose` mode allows source to source and target to target edges as well. + * + * @public + */ +var ConnectionMode; +(function (ConnectionMode) { + ConnectionMode["Strict"] = "strict"; + ConnectionMode["Loose"] = "loose"; +})(ConnectionMode || (ConnectionMode = {})); +/** + * This enum is used to set the different modes of panning the viewport when the + * user scrolls. The `Free` mode allows the user to pan in any direction by scrolling + * with a device like a trackpad. The `Vertical` and `Horizontal` modes restrict + * scroll panning to only the vertical or horizontal axis, respectively. + * + * @public + */ +var PanOnScrollMode; +(function (PanOnScrollMode) { + PanOnScrollMode["Free"] = "free"; + PanOnScrollMode["Vertical"] = "vertical"; + PanOnScrollMode["Horizontal"] = "horizontal"; +})(PanOnScrollMode || (PanOnScrollMode = {})); +var SelectionMode; +(function (SelectionMode) { + SelectionMode["Partial"] = "partial"; + SelectionMode["Full"] = "full"; +})(SelectionMode || (SelectionMode = {})); +const initialConnection = { + inProgress: false, + isValid: null, + from: null, + fromHandle: null, + fromPosition: null, + fromNode: null, + to: null, + toHandle: null, + toPosition: null, + toNode: null, +}; + +/** + * If you set the `connectionLineType` prop on your [``](/api-reference/react-flow#connection-connectionLineType) + *component, it will dictate the style of connection line rendered when creating + *new edges. + * + * @public + * + * @remarks If you choose to render a custom connection line component, this value will be + *passed to your component as part of its [`ConnectionLineComponentProps`](/api-reference/types/connection-line-component-props). + */ +var ConnectionLineType; +(function (ConnectionLineType) { + ConnectionLineType["Bezier"] = "default"; + ConnectionLineType["Straight"] = "straight"; + ConnectionLineType["Step"] = "step"; + ConnectionLineType["SmoothStep"] = "smoothstep"; + ConnectionLineType["SimpleBezier"] = "simplebezier"; +})(ConnectionLineType || (ConnectionLineType = {})); +/** + * Edges may optionally have a marker on either end. The MarkerType type enumerates + * the options available to you when configuring a given marker. + * + * @public + */ +var MarkerType; +(function (MarkerType) { + MarkerType["Arrow"] = "arrow"; + MarkerType["ArrowClosed"] = "arrowclosed"; +})(MarkerType || (MarkerType = {})); + +/** + * While [`PanelPosition`](/api-reference/types/panel-position) can be used to place a + * component in the corners of a container, the `Position` enum is less precise and used + * primarily in relation to edges and handles. + * + * @public + */ +var Position; +(function (Position) { + Position["Left"] = "left"; + Position["Top"] = "top"; + Position["Right"] = "right"; + Position["Bottom"] = "bottom"; +})(Position || (Position = {})); +const oppositePosition = { + [Position.Left]: Position.Right, + [Position.Right]: Position.Left, + [Position.Top]: Position.Bottom, + [Position.Bottom]: Position.Top, +}; + +/** + * @internal + */ +function areConnectionMapsEqual(a, b) { + if (!a && !b) { + return true; + } + if (!a || !b || a.size !== b.size) { + return false; + } + if (!a.size && !b.size) { + return true; + } + for (const key of a.keys()) { + if (!b.has(key)) { + return false; + } + } + return true; +} +/** + * We call the callback for all connections in a that are not in b + * + * @internal + */ +function handleConnectionChange(a, b, cb) { + if (!cb) { + return; + } + const diff = []; + a.forEach((connection, key) => { + if (!b?.has(key)) { + diff.push(connection); + } + }); + if (diff.length) { + cb(diff); + } +} +function getConnectionStatus(isValid) { + return isValid === null ? null : isValid ? 'valid' : 'invalid'; +} + +/* eslint-disable @typescript-eslint/no-explicit-any */ +/** + * Test whether an object is usable as an Edge + * @public + * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Edge if it returns true + * @param element - The element to test + * @returns A boolean indicating whether the element is an Edge + */ +const isEdgeBase = (element) => 'id' in element && 'source' in element && 'target' in element; +/** + * Test whether an object is usable as a Node + * @public + * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Node if it returns true + * @param element - The element to test + * @returns A boolean indicating whether the element is an Node + */ +const isNodeBase = (element) => 'id' in element && 'position' in element && !('source' in element) && !('target' in element); +const isInternalNodeBase = (element) => 'id' in element && 'internals' in element && !('source' in element) && !('target' in element); +/** + * This util is used to tell you what nodes, if any, are connected to the given node + * as the _target_ of an edge. + * @public + * @param node - The node to get the connected nodes from. + * @param nodes - The array of all nodes. + * @param edges - The array of all edges. + * @returns An array of nodes that are connected over edges where the source is the given node. + * + * @example + * ```ts + *import { getOutgoers } from '@xyflow/react'; + * + *const nodes = []; + *const edges = []; + * + *const outgoers = getOutgoers( + * { id: '1', position: { x: 0, y: 0 }, data: { label: 'node' } }, + * nodes, + * edges, + *); + *``` + */ +const getOutgoers = (node, nodes, edges) => { + if (!node.id) { + return []; + } + const outgoerIds = new Set(); + edges.forEach((edge) => { + if (edge.source === node.id) { + outgoerIds.add(edge.target); + } + }); + return nodes.filter((n) => outgoerIds.has(n.id)); +}; +/** + * This util is used to tell you what nodes, if any, are connected to the given node + * as the _source_ of an edge. + * @public + * @param node - The node to get the connected nodes from. + * @param nodes - The array of all nodes. + * @param edges - The array of all edges. + * @returns An array of nodes that are connected over edges where the target is the given node. + * + * @example + * ```ts + *import { getIncomers } from '@xyflow/react'; + * + *const nodes = []; + *const edges = []; + * + *const incomers = getIncomers( + * { id: '1', position: { x: 0, y: 0 }, data: { label: 'node' } }, + * nodes, + * edges, + *); + *``` + */ +const getIncomers = (node, nodes, edges) => { + if (!node.id) { + return []; + } + const incomersIds = new Set(); + edges.forEach((edge) => { + if (edge.target === node.id) { + incomersIds.add(edge.source); + } + }); + return nodes.filter((n) => incomersIds.has(n.id)); +}; +const getNodePositionWithOrigin = (node, nodeOrigin = [0, 0]) => { + const { width, height } = getNodeDimensions(node); + const origin = node.origin ?? nodeOrigin; + const offsetX = width * origin[0]; + const offsetY = height * origin[1]; + return { + x: node.position.x - offsetX, + y: node.position.y - offsetY, + }; +}; +/** + * Returns the bounding box that contains all the given nodes in an array. This can + * be useful when combined with [`getViewportForBounds`](/api-reference/utils/get-viewport-for-bounds) + * to calculate the correct transform to fit the given nodes in a viewport. + * @public + * @remarks Useful when combined with {@link getViewportForBounds} to calculate the correct transform to fit the given nodes in a viewport. + * @param nodes - Nodes to calculate the bounds for. + * @returns Bounding box enclosing all nodes. + * + * @remarks This function was previously called `getRectOfNodes` + * + * @example + * ```js + *import { getNodesBounds } from '@xyflow/react'; + * + *const nodes = [ + * { + * id: 'a', + * position: { x: 0, y: 0 }, + * data: { label: 'a' }, + * width: 50, + * height: 25, + * }, + * { + * id: 'b', + * position: { x: 100, y: 100 }, + * data: { label: 'b' }, + * width: 50, + * height: 25, + * }, + *]; + * + *const bounds = getNodesBounds(nodes); + *``` + */ +const getNodesBounds = (nodes, params = { nodeOrigin: [0, 0] }) => { + if (process.env.NODE_ENV === 'development' && !params.nodeLookup) { + console.warn('Please use `getNodesBounds` from `useReactFlow`/`useSvelteFlow` hook to ensure correct values for sub flows. If not possible, you have to provide a nodeLookup to support sub flows.'); + } + if (nodes.length === 0) { + return { x: 0, y: 0, width: 0, height: 0 }; + } + const box = nodes.reduce((currBox, nodeOrId) => { + const isId = typeof nodeOrId === 'string'; + let currentNode = !params.nodeLookup && !isId ? nodeOrId : undefined; + if (params.nodeLookup) { + currentNode = isId + ? params.nodeLookup.get(nodeOrId) + : !isInternalNodeBase(nodeOrId) + ? params.nodeLookup.get(nodeOrId.id) + : nodeOrId; + } + const nodeBox = currentNode ? nodeToBox(currentNode, params.nodeOrigin) : { x: 0, y: 0, x2: 0, y2: 0 }; + return getBoundsOfBoxes(currBox, nodeBox); + }, { x: Infinity, y: Infinity, x2: -Infinity, y2: -Infinity }); + return boxToRect(box); +}; +/** + * Determines a bounding box that contains all given nodes in an array + * @internal + */ +const getInternalNodesBounds = (nodeLookup, params = {}) => { + if (nodeLookup.size === 0) { + return { x: 0, y: 0, width: 0, height: 0 }; + } + let box = { x: Infinity, y: Infinity, x2: -Infinity, y2: -Infinity }; + nodeLookup.forEach((node) => { + if (params.filter === undefined || params.filter(node)) { + const nodeBox = nodeToBox(node); + box = getBoundsOfBoxes(box, nodeBox); + } + }); + return boxToRect(box); +}; +const getNodesInside = (nodes, rect, [tx, ty, tScale] = [0, 0, 1], partially = false, +// set excludeNonSelectableNodes if you want to pay attention to the nodes "selectable" attribute +excludeNonSelectableNodes = false) => { + const paneRect = { + ...pointToRendererPoint(rect, [tx, ty, tScale]), + width: rect.width / tScale, + height: rect.height / tScale, + }; + const visibleNodes = []; + for (const node of nodes.values()) { + const { measured, selectable = true, hidden = false } = node; + if ((excludeNonSelectableNodes && !selectable) || hidden) { + continue; + } + const width = measured.width ?? node.width ?? node.initialWidth ?? null; + const height = measured.height ?? node.height ?? node.initialHeight ?? null; + const overlappingArea = getOverlappingArea(paneRect, nodeToRect(node)); + const area = (width ?? 0) * (height ?? 0); + const partiallyVisible = partially && overlappingArea > 0; + const forceInitialRender = !node.internals.handleBounds; + const isVisible = forceInitialRender || partiallyVisible || overlappingArea >= area; + if (isVisible || node.dragging) { + visibleNodes.push(node); + } + } + return visibleNodes; +}; +/** + * This utility filters an array of edges, keeping only those where either the source or target + * node is present in the given array of nodes. + * @public + * @param nodes - Nodes you want to get the connected edges for. + * @param edges - All edges. + * @returns Array of edges that connect any of the given nodes with each other. + * + * @example + * ```js + *import { getConnectedEdges } from '@xyflow/react'; + * + *const nodes = [ + * { id: 'a', position: { x: 0, y: 0 } }, + * { id: 'b', position: { x: 100, y: 0 } }, + *]; + * + *const edges = [ + * { id: 'a->c', source: 'a', target: 'c' }, + * { id: 'c->d', source: 'c', target: 'd' }, + *]; + * + *const connectedEdges = getConnectedEdges(nodes, edges); + * // => [{ id: 'a->c', source: 'a', target: 'c' }] + *``` + */ +const getConnectedEdges = (nodes, edges) => { + const nodeIds = new Set(); + nodes.forEach((node) => { + nodeIds.add(node.id); + }); + return edges.filter((edge) => nodeIds.has(edge.source) || nodeIds.has(edge.target)); +}; +function getFitViewNodes(nodeLookup, options) { + const fitViewNodes = new Map(); + const optionNodeIds = options?.nodes ? new Set(options.nodes.map((node) => node.id)) : null; + nodeLookup.forEach((n) => { + const isVisible = n.measured.width && n.measured.height && (options?.includeHiddenNodes || !n.hidden); + if (isVisible && (!optionNodeIds || optionNodeIds.has(n.id))) { + fitViewNodes.set(n.id, n); + } + }); + return fitViewNodes; +} +async function fitViewport({ nodes, width, height, panZoom, minZoom, maxZoom }, options) { + if (nodes.size === 0) { + return Promise.resolve(true); + } + const nodesToFit = getFitViewNodes(nodes, options); + const bounds = getInternalNodesBounds(nodesToFit); + const viewport = getViewportForBounds(bounds, width, height, options?.minZoom ?? minZoom, options?.maxZoom ?? maxZoom, options?.padding ?? 0.1); + await panZoom.setViewport(viewport, { + duration: options?.duration, + ease: options?.ease, + interpolate: options?.interpolate, + }); + return Promise.resolve(true); +} +/** + * This function calculates the next position of a node, taking into account the node's extent, parent node, and origin. + * + * @internal + * @returns position, positionAbsolute + */ +function calculateNodePosition({ nodeId, nextPosition, nodeLookup, nodeOrigin = [0, 0], nodeExtent, onError, }) { + const node = nodeLookup.get(nodeId); + const parentNode = node.parentId ? nodeLookup.get(node.parentId) : undefined; + const { x: parentX, y: parentY } = parentNode ? parentNode.internals.positionAbsolute : { x: 0, y: 0 }; + const origin = node.origin ?? nodeOrigin; + let extent = nodeExtent; + if (node.extent === 'parent' && !node.expandParent) { + if (!parentNode) { + onError?.('005', errorMessages['error005']()); + } + else { + const parentWidth = parentNode.measured.width; + const parentHeight = parentNode.measured.height; + if (parentWidth && parentHeight) { + extent = [ + [parentX, parentY], + [parentX + parentWidth, parentY + parentHeight], + ]; + } + } + } + else if (parentNode && isCoordinateExtent(node.extent)) { + extent = [ + [node.extent[0][0] + parentX, node.extent[0][1] + parentY], + [node.extent[1][0] + parentX, node.extent[1][1] + parentY], + ]; + } + const positionAbsolute = isCoordinateExtent(extent) + ? clampPosition(nextPosition, extent, node.measured) + : nextPosition; + if (node.measured.width === undefined || node.measured.height === undefined) { + onError?.('015', errorMessages['error015']()); + } + return { + position: { + x: positionAbsolute.x - parentX + (node.measured.width ?? 0) * origin[0], + y: positionAbsolute.y - parentY + (node.measured.height ?? 0) * origin[1], + }, + positionAbsolute, + }; +} +/** + * Pass in nodes & edges to delete, get arrays of nodes and edges that actually can be deleted + * @internal + * @param param.nodesToRemove - The nodes to remove + * @param param.edgesToRemove - The edges to remove + * @param param.nodes - All nodes + * @param param.edges - All edges + * @param param.onBeforeDelete - Callback to check which nodes and edges can be deleted + * @returns nodes: nodes that can be deleted, edges: edges that can be deleted + */ +async function getElementsToRemove({ nodesToRemove = [], edgesToRemove = [], nodes, edges, onBeforeDelete, }) { + const nodeIds = new Set(nodesToRemove.map((node) => node.id)); + const matchingNodes = []; + for (const node of nodes) { + if (node.deletable === false) { + continue; + } + const isIncluded = nodeIds.has(node.id); + const parentHit = !isIncluded && node.parentId && matchingNodes.find((n) => n.id === node.parentId); + if (isIncluded || parentHit) { + matchingNodes.push(node); + } + } + const edgeIds = new Set(edgesToRemove.map((edge) => edge.id)); + const deletableEdges = edges.filter((edge) => edge.deletable !== false); + const connectedEdges = getConnectedEdges(matchingNodes, deletableEdges); + const matchingEdges = connectedEdges; + for (const edge of deletableEdges) { + const isIncluded = edgeIds.has(edge.id); + if (isIncluded && !matchingEdges.find((e) => e.id === edge.id)) { + matchingEdges.push(edge); + } + } + if (!onBeforeDelete) { + return { + edges: matchingEdges, + nodes: matchingNodes, + }; + } + const onBeforeDeleteResult = await onBeforeDelete({ + nodes: matchingNodes, + edges: matchingEdges, + }); + if (typeof onBeforeDeleteResult === 'boolean') { + return onBeforeDeleteResult ? { edges: matchingEdges, nodes: matchingNodes } : { edges: [], nodes: [] }; + } + return onBeforeDeleteResult; +} + +const clamp = (val, min = 0, max = 1) => Math.min(Math.max(val, min), max); +const clampPosition = (position = { x: 0, y: 0 }, extent, dimensions) => ({ + x: clamp(position.x, extent[0][0], extent[1][0] - (dimensions?.width ?? 0)), + y: clamp(position.y, extent[0][1], extent[1][1] - (dimensions?.height ?? 0)), +}); +function clampPositionToParent(childPosition, childDimensions, parent) { + const { width: parentWidth, height: parentHeight } = getNodeDimensions(parent); + const { x: parentX, y: parentY } = parent.internals.positionAbsolute; + return clampPosition(childPosition, [ + [parentX, parentY], + [parentX + parentWidth, parentY + parentHeight], + ], childDimensions); +} +/** + * Calculates the velocity of panning when the mouse is close to the edge of the canvas + * @internal + * @param value - One dimensional poition of the mouse (x or y) + * @param min - Minimal position on canvas before panning starts + * @param max - Maximal position on canvas before panning starts + * @returns - A number between 0 and 1 that represents the velocity of panning + */ +const calcAutoPanVelocity = (value, min, max) => { + if (value < min) { + return clamp(Math.abs(value - min), 1, min) / min; + } + else if (value > max) { + return -clamp(Math.abs(value - max), 1, min) / min; + } + return 0; +}; +const calcAutoPan = (pos, bounds, speed = 15, distance = 40) => { + const xMovement = calcAutoPanVelocity(pos.x, distance, bounds.width - distance) * speed; + const yMovement = calcAutoPanVelocity(pos.y, distance, bounds.height - distance) * speed; + return [xMovement, yMovement]; +}; +const getBoundsOfBoxes = (box1, box2) => ({ + x: Math.min(box1.x, box2.x), + y: Math.min(box1.y, box2.y), + x2: Math.max(box1.x2, box2.x2), + y2: Math.max(box1.y2, box2.y2), +}); +const rectToBox = ({ x, y, width, height }) => ({ + x, + y, + x2: x + width, + y2: y + height, +}); +const boxToRect = ({ x, y, x2, y2 }) => ({ + x, + y, + width: x2 - x, + height: y2 - y, +}); +const nodeToRect = (node, nodeOrigin = [0, 0]) => { + const { x, y } = isInternalNodeBase(node) + ? node.internals.positionAbsolute + : getNodePositionWithOrigin(node, nodeOrigin); + return { + x, + y, + width: node.measured?.width ?? node.width ?? node.initialWidth ?? 0, + height: node.measured?.height ?? node.height ?? node.initialHeight ?? 0, + }; +}; +const nodeToBox = (node, nodeOrigin = [0, 0]) => { + const { x, y } = isInternalNodeBase(node) + ? node.internals.positionAbsolute + : getNodePositionWithOrigin(node, nodeOrigin); + return { + x, + y, + x2: x + (node.measured?.width ?? node.width ?? node.initialWidth ?? 0), + y2: y + (node.measured?.height ?? node.height ?? node.initialHeight ?? 0), + }; +}; +const getBoundsOfRects = (rect1, rect2) => boxToRect(getBoundsOfBoxes(rectToBox(rect1), rectToBox(rect2))); +const getOverlappingArea = (rectA, rectB) => { + const xOverlap = Math.max(0, Math.min(rectA.x + rectA.width, rectB.x + rectB.width) - Math.max(rectA.x, rectB.x)); + const yOverlap = Math.max(0, Math.min(rectA.y + rectA.height, rectB.y + rectB.height) - Math.max(rectA.y, rectB.y)); + return Math.ceil(xOverlap * yOverlap); +}; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +const isRectObject = (obj) => isNumeric(obj.width) && isNumeric(obj.height) && isNumeric(obj.x) && isNumeric(obj.y); +/* eslint-disable-next-line @typescript-eslint/no-explicit-any */ +const isNumeric = (n) => !isNaN(n) && isFinite(n); +// used for a11y key board controls for nodes and edges +const devWarn = (id, message) => { + if (process.env.NODE_ENV === 'development') { + console.warn(`[React Flow]: ${message} Help: https://reactflow.dev/error#${id}`); + } +}; +const snapPosition = (position, snapGrid = [1, 1]) => { + return { + x: snapGrid[0] * Math.round(position.x / snapGrid[0]), + y: snapGrid[1] * Math.round(position.y / snapGrid[1]), + }; +}; +const pointToRendererPoint = ({ x, y }, [tx, ty, tScale], snapToGrid = false, snapGrid = [1, 1]) => { + const position = { + x: (x - tx) / tScale, + y: (y - ty) / tScale, + }; + return snapToGrid ? snapPosition(position, snapGrid) : position; +}; +const rendererPointToPoint = ({ x, y }, [tx, ty, tScale]) => { + return { + x: x * tScale + tx, + y: y * tScale + ty, + }; +}; +/** + * Parses a single padding value to a number + * @internal + * @param padding - Padding to parse + * @param viewport - Width or height of the viewport + * @returns The padding in pixels + */ +function parsePadding(padding, viewport) { + if (typeof padding === 'number') { + return Math.floor((viewport - viewport / (1 + padding)) * 0.5); + } + if (typeof padding === 'string' && padding.endsWith('px')) { + const paddingValue = parseFloat(padding); + if (!Number.isNaN(paddingValue)) { + return Math.floor(paddingValue); + } + } + if (typeof padding === 'string' && padding.endsWith('%')) { + const paddingValue = parseFloat(padding); + if (!Number.isNaN(paddingValue)) { + return Math.floor(viewport * paddingValue * 0.01); + } + } + console.error(`[React Flow] The padding value "${padding}" is invalid. Please provide a number or a string with a valid unit (px or %).`); + return 0; +} +/** + * Parses the paddings to an object with top, right, bottom, left, x and y paddings + * @internal + * @param padding - Padding to parse + * @param width - Width of the viewport + * @param height - Height of the viewport + * @returns An object with the paddings in pixels + */ +function parsePaddings(padding, width, height) { + if (typeof padding === 'string' || typeof padding === 'number') { + const paddingY = parsePadding(padding, height); + const paddingX = parsePadding(padding, width); + return { + top: paddingY, + right: paddingX, + bottom: paddingY, + left: paddingX, + x: paddingX * 2, + y: paddingY * 2, + }; + } + if (typeof padding === 'object') { + const top = parsePadding(padding.top ?? padding.y ?? 0, height); + const bottom = parsePadding(padding.bottom ?? padding.y ?? 0, height); + const left = parsePadding(padding.left ?? padding.x ?? 0, width); + const right = parsePadding(padding.right ?? padding.x ?? 0, width); + return { top, right, bottom, left, x: left + right, y: top + bottom }; + } + return { top: 0, right: 0, bottom: 0, left: 0, x: 0, y: 0 }; +} +/** + * Calculates the resulting paddings if the new viewport is applied + * @internal + * @param bounds - Bounds to fit inside viewport + * @param x - X position of the viewport + * @param y - Y position of the viewport + * @param zoom - Zoom level of the viewport + * @param width - Width of the viewport + * @param height - Height of the viewport + * @returns An object with the minimum padding required to fit the bounds inside the viewport + */ +function calculateAppliedPaddings(bounds, x, y, zoom, width, height) { + const { x: left, y: top } = rendererPointToPoint(bounds, [x, y, zoom]); + const { x: boundRight, y: boundBottom } = rendererPointToPoint({ x: bounds.x + bounds.width, y: bounds.y + bounds.height }, [x, y, zoom]); + const right = width - boundRight; + const bottom = height - boundBottom; + return { + left: Math.floor(left), + top: Math.floor(top), + right: Math.floor(right), + bottom: Math.floor(bottom), + }; +} +/** + * Returns a viewport that encloses the given bounds with padding. + * @public + * @remarks You can determine bounds of nodes with {@link getNodesBounds} and {@link getBoundsOfRects} + * @param bounds - Bounds to fit inside viewport. + * @param width - Width of the viewport. + * @param height - Height of the viewport. + * @param minZoom - Minimum zoom level of the resulting viewport. + * @param maxZoom - Maximum zoom level of the resulting viewport. + * @param padding - Padding around the bounds. + * @returns A transformed {@link Viewport} that encloses the given bounds which you can pass to e.g. {@link setViewport}. + * @example + * const { x, y, zoom } = getViewportForBounds( + * { x: 0, y: 0, width: 100, height: 100}, + * 1200, 800, 0.5, 2); + */ +const getViewportForBounds = (bounds, width, height, minZoom, maxZoom, padding) => { + // First we resolve all the paddings to actual pixel values + const p = parsePaddings(padding, width, height); + const xZoom = (width - p.x) / bounds.width; + const yZoom = (height - p.y) / bounds.height; + // We calculate the new x, y, zoom for a centered view + const zoom = Math.min(xZoom, yZoom); + const clampedZoom = clamp(zoom, minZoom, maxZoom); + const boundsCenterX = bounds.x + bounds.width / 2; + const boundsCenterY = bounds.y + bounds.height / 2; + const x = width / 2 - boundsCenterX * clampedZoom; + const y = height / 2 - boundsCenterY * clampedZoom; + // Then we calculate the minimum padding, to respect asymmetric paddings + const newPadding = calculateAppliedPaddings(bounds, x, y, clampedZoom, width, height); + // We only want to have an offset if the newPadding is smaller than the required padding + const offset = { + left: Math.min(newPadding.left - p.left, 0), + top: Math.min(newPadding.top - p.top, 0), + right: Math.min(newPadding.right - p.right, 0), + bottom: Math.min(newPadding.bottom - p.bottom, 0), + }; + return { + x: x - offset.left + offset.right, + y: y - offset.top + offset.bottom, + zoom: clampedZoom, + }; +}; +const isMacOs = () => typeof navigator !== 'undefined' && navigator?.userAgent?.indexOf('Mac') >= 0; +function isCoordinateExtent(extent) { + return extent !== undefined && extent !== 'parent'; +} +function getNodeDimensions(node) { + return { + width: node.measured?.width ?? node.width ?? node.initialWidth ?? 0, + height: node.measured?.height ?? node.height ?? node.initialHeight ?? 0, + }; +} +function nodeHasDimensions(node) { + return ((node.measured?.width ?? node.width ?? node.initialWidth) !== undefined && + (node.measured?.height ?? node.height ?? node.initialHeight) !== undefined); +} +/** + * Convert child position to aboslute position + * + * @internal + * @param position + * @param parentId + * @param nodeLookup + * @param nodeOrigin + * @returns an internal node with an absolute position + */ +function evaluateAbsolutePosition(position, dimensions = { width: 0, height: 0 }, parentId, nodeLookup, nodeOrigin) { + const positionAbsolute = { ...position }; + const parent = nodeLookup.get(parentId); + if (parent) { + const origin = parent.origin || nodeOrigin; + positionAbsolute.x += parent.internals.positionAbsolute.x - (dimensions.width ?? 0) * origin[0]; + positionAbsolute.y += parent.internals.positionAbsolute.y - (dimensions.height ?? 0) * origin[1]; + } + return positionAbsolute; +} +function areSetsEqual(a, b) { + if (a.size !== b.size) { + return false; + } + for (const item of a) { + if (!b.has(item)) { + return false; + } + } + return true; +} +/** + * Polyfill for Promise.withResolvers until we can use it in all browsers + * @internal + */ +function withResolvers() { + let resolve; + let reject; + const promise = new Promise((res, rej) => { + resolve = res; + reject = rej; + }); + return { promise, resolve, reject }; +} +function mergeAriaLabelConfig(partial) { + return { ...defaultAriaLabelConfig, ...(partial || {}) }; +} + +function getPointerPosition(event, { snapGrid = [0, 0], snapToGrid = false, transform, containerBounds }) { + const { x, y } = getEventPosition(event); + const pointerPos = pointToRendererPoint({ x: x - (containerBounds?.left ?? 0), y: y - (containerBounds?.top ?? 0) }, transform); + const { x: xSnapped, y: ySnapped } = snapToGrid ? snapPosition(pointerPos, snapGrid) : pointerPos; + // we need the snapped position in order to be able to skip unnecessary drag events + return { + xSnapped, + ySnapped, + ...pointerPos, + }; +} +const getDimensions = (node) => ({ + width: node.offsetWidth, + height: node.offsetHeight, +}); +const getHostForElement = (element) => element?.getRootNode?.() || window?.document; +const inputTags = ['INPUT', 'SELECT', 'TEXTAREA']; +function isInputDOMNode(event) { + // using composed path for handling shadow dom + const target = (event.composedPath?.()?.[0] || event.target); + if (target?.nodeType !== 1 /* Node.ELEMENT_NODE */) + return false; + const isInput = inputTags.includes(target.nodeName) || target.hasAttribute('contenteditable'); + // when an input field is focused we don't want to trigger deletion or movement of nodes + return isInput || !!target.closest('.nokey'); +} +const isMouseEvent = (event) => 'clientX' in event; +const getEventPosition = (event, bounds) => { + const isMouse = isMouseEvent(event); + const evtX = isMouse ? event.clientX : event.touches?.[0].clientX; + const evtY = isMouse ? event.clientY : event.touches?.[0].clientY; + return { + x: evtX - (bounds?.left ?? 0), + y: evtY - (bounds?.top ?? 0), + }; +}; +/* + * The handle bounds are calculated relative to the node element. + * We store them in the internals object of the node in order to avoid + * unnecessary recalculations. + */ +const getHandleBounds = (type, nodeElement, nodeBounds, zoom, nodeId) => { + const handles = nodeElement.querySelectorAll(`.${type}`); + if (!handles || !handles.length) { + return null; + } + return Array.from(handles).map((handle) => { + const handleBounds = handle.getBoundingClientRect(); + return { + id: handle.getAttribute('data-handleid'), + type, + nodeId, + position: handle.getAttribute('data-handlepos'), + x: (handleBounds.left - nodeBounds.left) / zoom, + y: (handleBounds.top - nodeBounds.top) / zoom, + ...getDimensions(handle), + }; + }); +}; + +function getBezierEdgeCenter({ sourceX, sourceY, targetX, targetY, sourceControlX, sourceControlY, targetControlX, targetControlY, }) { + /* + * cubic bezier t=0.5 mid point, not the actual mid point, but easy to calculate + * https://stackoverflow.com/questions/67516101/how-to-find-distance-mid-point-of-bezier-curve + */ + const centerX = sourceX * 0.125 + sourceControlX * 0.375 + targetControlX * 0.375 + targetX * 0.125; + const centerY = sourceY * 0.125 + sourceControlY * 0.375 + targetControlY * 0.375 + targetY * 0.125; + const offsetX = Math.abs(centerX - sourceX); + const offsetY = Math.abs(centerY - sourceY); + return [centerX, centerY, offsetX, offsetY]; +} +function calculateControlOffset(distance, curvature) { + if (distance >= 0) { + return 0.5 * distance; + } + return curvature * 25 * Math.sqrt(-distance); +} +function getControlWithCurvature({ pos, x1, y1, x2, y2, c }) { + switch (pos) { + case Position.Left: + return [x1 - calculateControlOffset(x1 - x2, c), y1]; + case Position.Right: + return [x1 + calculateControlOffset(x2 - x1, c), y1]; + case Position.Top: + return [x1, y1 - calculateControlOffset(y1 - y2, c)]; + case Position.Bottom: + return [x1, y1 + calculateControlOffset(y2 - y1, c)]; + } +} +/** + * The `getBezierPath` util returns everything you need to render a bezier edge + *between two nodes. + * @public + * @returns A path string you can use in an SVG, the `labelX` and `labelY` position (center of path) + * and `offsetX`, `offsetY` between source handle and label. + * - `path`: the path to use in an SVG `` element. + * - `labelX`: the `x` position you can use to render a label for this edge. + * - `labelY`: the `y` position you can use to render a label for this edge. + * - `offsetX`: the absolute difference between the source `x` position and the `x` position of the + * middle of this path. + * - `offsetY`: the absolute difference between the source `y` position and the `y` position of the + * middle of this path. + * @example + * ```js + * const source = { x: 0, y: 20 }; + * const target = { x: 150, y: 100 }; + * + * const [path, labelX, labelY, offsetX, offsetY] = getBezierPath({ + * sourceX: source.x, + * sourceY: source.y, + * sourcePosition: Position.Right, + * targetX: target.x, + * targetY: target.y, + * targetPosition: Position.Left, + *}); + *``` + * + * @remarks This function returns a tuple (aka a fixed-size array) to make it easier to + *work with multiple edge paths at once. + */ +function getBezierPath({ sourceX, sourceY, sourcePosition = Position.Bottom, targetX, targetY, targetPosition = Position.Top, curvature = 0.25, }) { + const [sourceControlX, sourceControlY] = getControlWithCurvature({ + pos: sourcePosition, + x1: sourceX, + y1: sourceY, + x2: targetX, + y2: targetY, + c: curvature, + }); + const [targetControlX, targetControlY] = getControlWithCurvature({ + pos: targetPosition, + x1: targetX, + y1: targetY, + x2: sourceX, + y2: sourceY, + c: curvature, + }); + const [labelX, labelY, offsetX, offsetY] = getBezierEdgeCenter({ + sourceX, + sourceY, + targetX, + targetY, + sourceControlX, + sourceControlY, + targetControlX, + targetControlY, + }); + return [ + `M${sourceX},${sourceY} C${sourceControlX},${sourceControlY} ${targetControlX},${targetControlY} ${targetX},${targetY}`, + labelX, + labelY, + offsetX, + offsetY, + ]; +} + +// this is used for straight edges and simple smoothstep edges (LTR, RTL, BTT, TTB) +function getEdgeCenter({ sourceX, sourceY, targetX, targetY, }) { + const xOffset = Math.abs(targetX - sourceX) / 2; + const centerX = targetX < sourceX ? targetX + xOffset : targetX - xOffset; + const yOffset = Math.abs(targetY - sourceY) / 2; + const centerY = targetY < sourceY ? targetY + yOffset : targetY - yOffset; + return [centerX, centerY, xOffset, yOffset]; +} +function getElevatedEdgeZIndex({ sourceNode, targetNode, selected = false, zIndex = 0, elevateOnSelect = false, }) { + if (!elevateOnSelect) { + return zIndex; + } + const edgeOrConnectedNodeSelected = selected || targetNode.selected || sourceNode.selected; + const selectedZIndex = Math.max(sourceNode.internals.z || 0, targetNode.internals.z || 0, 1000); + return zIndex + (edgeOrConnectedNodeSelected ? selectedZIndex : 0); +} +function isEdgeVisible({ sourceNode, targetNode, width, height, transform }) { + const edgeBox = getBoundsOfBoxes(nodeToBox(sourceNode), nodeToBox(targetNode)); + if (edgeBox.x === edgeBox.x2) { + edgeBox.x2 += 1; + } + if (edgeBox.y === edgeBox.y2) { + edgeBox.y2 += 1; + } + const viewRect = { + x: -transform[0] / transform[2], + y: -transform[1] / transform[2], + width: width / transform[2], + height: height / transform[2], + }; + return getOverlappingArea(viewRect, boxToRect(edgeBox)) > 0; +} +const getEdgeId = ({ source, sourceHandle, target, targetHandle }) => `xy-edge__${source}${sourceHandle || ''}-${target}${targetHandle || ''}`; +const connectionExists = (edge, edges) => { + return edges.some((el) => el.source === edge.source && + el.target === edge.target && + (el.sourceHandle === edge.sourceHandle || (!el.sourceHandle && !edge.sourceHandle)) && + (el.targetHandle === edge.targetHandle || (!el.targetHandle && !edge.targetHandle))); +}; +/** + * This util is a convenience function to add a new Edge to an array of edges. It also performs some validation to make sure you don't add an invalid edge or duplicate an existing one. + * @public + * @param edgeParams - Either an `Edge` or a `Connection` you want to add. + * @param edges - The array of all current edges. + * @returns A new array of edges with the new edge added. + * + * @remarks If an edge with the same `target` and `source` already exists (and the same + *`targetHandle` and `sourceHandle` if those are set), then this util won't add + *a new edge even if the `id` property is different. + * + */ +const addEdge = (edgeParams, edges) => { + if (!edgeParams.source || !edgeParams.target) { + devWarn('006', errorMessages['error006']()); + return edges; + } + let edge; + if (isEdgeBase(edgeParams)) { + edge = { ...edgeParams }; + } + else { + edge = { + ...edgeParams, + id: getEdgeId(edgeParams), + }; + } + if (connectionExists(edge, edges)) { + return edges; + } + if (edge.sourceHandle === null) { + delete edge.sourceHandle; + } + if (edge.targetHandle === null) { + delete edge.targetHandle; + } + return edges.concat(edge); +}; +/** + * A handy utility to update an existing [`Edge`](/api-reference/types/edge) with new properties. + *This searches your edge array for an edge with a matching `id` and updates its + *properties with the connection you provide. + * @public + * @param oldEdge - The edge you want to update. + * @param newConnection - The new connection you want to update the edge with. + * @param edges - The array of all current edges. + * @returns The updated edges array. + * + * @example + * ```js + *const onReconnect = useCallback( + * (oldEdge: Edge, newConnection: Connection) => setEdges((els) => reconnectEdge(oldEdge, newConnection, els)),[]); + *``` + */ +const reconnectEdge = (oldEdge, newConnection, edges, options = { shouldReplaceId: true }) => { + const { id: oldEdgeId, ...rest } = oldEdge; + if (!newConnection.source || !newConnection.target) { + devWarn('006', errorMessages['error006']()); + return edges; + } + const foundEdge = edges.find((e) => e.id === oldEdge.id); + if (!foundEdge) { + devWarn('007', errorMessages['error007'](oldEdgeId)); + return edges; + } + // Remove old edge and create the new edge with parameters of old edge. + const edge = { + ...rest, + id: options.shouldReplaceId ? getEdgeId(newConnection) : oldEdgeId, + source: newConnection.source, + target: newConnection.target, + sourceHandle: newConnection.sourceHandle, + targetHandle: newConnection.targetHandle, + }; + return edges.filter((e) => e.id !== oldEdgeId).concat(edge); +}; + +/** + * Calculates the straight line path between two points. + * @public + * @returns A path string you can use in an SVG, the `labelX` and `labelY` position (center of path) + * and `offsetX`, `offsetY` between source handle and label. + * + * - `path`: the path to use in an SVG `` element. + * - `labelX`: the `x` position you can use to render a label for this edge. + * - `labelY`: the `y` position you can use to render a label for this edge. + * - `offsetX`: the absolute difference between the source `x` position and the `x` position of the + * middle of this path. + * - `offsetY`: the absolute difference between the source `y` position and the `y` position of the + * middle of this path. + * @example + * ```js + * const source = { x: 0, y: 20 }; + * const target = { x: 150, y: 100 }; + * + * const [path, labelX, labelY, offsetX, offsetY] = getStraightPath({ + * sourceX: source.x, + * sourceY: source.y, + * sourcePosition: Position.Right, + * targetX: target.x, + * targetY: target.y, + * targetPosition: Position.Left, + * }); + * ``` + * @remarks This function returns a tuple (aka a fixed-size array) to make it easier to work with multiple edge paths at once. + */ +function getStraightPath({ sourceX, sourceY, targetX, targetY, }) { + const [labelX, labelY, offsetX, offsetY] = getEdgeCenter({ + sourceX, + sourceY, + targetX, + targetY, + }); + return [`M ${sourceX},${sourceY}L ${targetX},${targetY}`, labelX, labelY, offsetX, offsetY]; +} + +const handleDirections = { + [Position.Left]: { x: -1, y: 0 }, + [Position.Right]: { x: 1, y: 0 }, + [Position.Top]: { x: 0, y: -1 }, + [Position.Bottom]: { x: 0, y: 1 }, +}; +const getDirection = ({ source, sourcePosition = Position.Bottom, target, }) => { + if (sourcePosition === Position.Left || sourcePosition === Position.Right) { + return source.x < target.x ? { x: 1, y: 0 } : { x: -1, y: 0 }; + } + return source.y < target.y ? { x: 0, y: 1 } : { x: 0, y: -1 }; +}; +const distance = (a, b) => Math.sqrt(Math.pow(b.x - a.x, 2) + Math.pow(b.y - a.y, 2)); +/* + * With this function we try to mimic an orthogonal edge routing behaviour + * It's not as good as a real orthogonal edge routing, but it's faster and good enough as a default for step and smooth step edges + */ +function getPoints({ source, sourcePosition = Position.Bottom, target, targetPosition = Position.Top, center, offset, }) { + const sourceDir = handleDirections[sourcePosition]; + const targetDir = handleDirections[targetPosition]; + const sourceGapped = { x: source.x + sourceDir.x * offset, y: source.y + sourceDir.y * offset }; + const targetGapped = { x: target.x + targetDir.x * offset, y: target.y + targetDir.y * offset }; + const dir = getDirection({ + source: sourceGapped, + sourcePosition, + target: targetGapped, + }); + const dirAccessor = dir.x !== 0 ? 'x' : 'y'; + const currDir = dir[dirAccessor]; + let points = []; + let centerX, centerY; + const sourceGapOffset = { x: 0, y: 0 }; + const targetGapOffset = { x: 0, y: 0 }; + const [defaultCenterX, defaultCenterY, defaultOffsetX, defaultOffsetY] = getEdgeCenter({ + sourceX: source.x, + sourceY: source.y, + targetX: target.x, + targetY: target.y, + }); + // opposite handle positions, default case + if (sourceDir[dirAccessor] * targetDir[dirAccessor] === -1) { + centerX = center.x ?? defaultCenterX; + centerY = center.y ?? defaultCenterY; + /* + * ---> + * | + * >--- + */ + const verticalSplit = [ + { x: centerX, y: sourceGapped.y }, + { x: centerX, y: targetGapped.y }, + ]; + /* + * | + * --- + * | + */ + const horizontalSplit = [ + { x: sourceGapped.x, y: centerY }, + { x: targetGapped.x, y: centerY }, + ]; + if (sourceDir[dirAccessor] === currDir) { + points = dirAccessor === 'x' ? verticalSplit : horizontalSplit; + } + else { + points = dirAccessor === 'x' ? horizontalSplit : verticalSplit; + } + } + else { + // sourceTarget means we take x from source and y from target, targetSource is the opposite + const sourceTarget = [{ x: sourceGapped.x, y: targetGapped.y }]; + const targetSource = [{ x: targetGapped.x, y: sourceGapped.y }]; + // this handles edges with same handle positions + if (dirAccessor === 'x') { + points = sourceDir.x === currDir ? targetSource : sourceTarget; + } + else { + points = sourceDir.y === currDir ? sourceTarget : targetSource; + } + if (sourcePosition === targetPosition) { + const diff = Math.abs(source[dirAccessor] - target[dirAccessor]); + // if an edge goes from right to right for example (sourcePosition === targetPosition) and the distance between source.x and target.x is less than the offset, the added point and the gapped source/target will overlap. This leads to a weird edge path. To avoid this we add a gapOffset to the source/target + if (diff <= offset) { + const gapOffset = Math.min(offset - 1, offset - diff); + if (sourceDir[dirAccessor] === currDir) { + sourceGapOffset[dirAccessor] = (sourceGapped[dirAccessor] > source[dirAccessor] ? -1 : 1) * gapOffset; + } + else { + targetGapOffset[dirAccessor] = (targetGapped[dirAccessor] > target[dirAccessor] ? -1 : 1) * gapOffset; + } + } + } + // these are conditions for handling mixed handle positions like Right -> Bottom for example + if (sourcePosition !== targetPosition) { + const dirAccessorOpposite = dirAccessor === 'x' ? 'y' : 'x'; + const isSameDir = sourceDir[dirAccessor] === targetDir[dirAccessorOpposite]; + const sourceGtTargetOppo = sourceGapped[dirAccessorOpposite] > targetGapped[dirAccessorOpposite]; + const sourceLtTargetOppo = sourceGapped[dirAccessorOpposite] < targetGapped[dirAccessorOpposite]; + const flipSourceTarget = (sourceDir[dirAccessor] === 1 && ((!isSameDir && sourceGtTargetOppo) || (isSameDir && sourceLtTargetOppo))) || + (sourceDir[dirAccessor] !== 1 && ((!isSameDir && sourceLtTargetOppo) || (isSameDir && sourceGtTargetOppo))); + if (flipSourceTarget) { + points = dirAccessor === 'x' ? sourceTarget : targetSource; + } + } + const sourceGapPoint = { x: sourceGapped.x + sourceGapOffset.x, y: sourceGapped.y + sourceGapOffset.y }; + const targetGapPoint = { x: targetGapped.x + targetGapOffset.x, y: targetGapped.y + targetGapOffset.y }; + const maxXDistance = Math.max(Math.abs(sourceGapPoint.x - points[0].x), Math.abs(targetGapPoint.x - points[0].x)); + const maxYDistance = Math.max(Math.abs(sourceGapPoint.y - points[0].y), Math.abs(targetGapPoint.y - points[0].y)); + // we want to place the label on the longest segment of the edge + if (maxXDistance >= maxYDistance) { + centerX = (sourceGapPoint.x + targetGapPoint.x) / 2; + centerY = points[0].y; + } + else { + centerX = points[0].x; + centerY = (sourceGapPoint.y + targetGapPoint.y) / 2; + } + } + const pathPoints = [ + source, + { x: sourceGapped.x + sourceGapOffset.x, y: sourceGapped.y + sourceGapOffset.y }, + ...points, + { x: targetGapped.x + targetGapOffset.x, y: targetGapped.y + targetGapOffset.y }, + target, + ]; + return [pathPoints, centerX, centerY, defaultOffsetX, defaultOffsetY]; +} +function getBend(a, b, c, size) { + const bendSize = Math.min(distance(a, b) / 2, distance(b, c) / 2, size); + const { x, y } = b; + // no bend + if ((a.x === x && x === c.x) || (a.y === y && y === c.y)) { + return `L${x} ${y}`; + } + // first segment is horizontal + if (a.y === y) { + const xDir = a.x < c.x ? -1 : 1; + const yDir = a.y < c.y ? 1 : -1; + return `L ${x + bendSize * xDir},${y}Q ${x},${y} ${x},${y + bendSize * yDir}`; + } + const xDir = a.x < c.x ? 1 : -1; + const yDir = a.y < c.y ? -1 : 1; + return `L ${x},${y + bendSize * yDir}Q ${x},${y} ${x + bendSize * xDir},${y}`; +} +/** + * The `getSmoothStepPath` util returns everything you need to render a stepped path + * between two nodes. The `borderRadius` property can be used to choose how rounded + * the corners of those steps are. + * @public + * @returns A path string you can use in an SVG, the `labelX` and `labelY` position (center of path) + * and `offsetX`, `offsetY` between source handle and label. + * + * - `path`: the path to use in an SVG `` element. + * - `labelX`: the `x` position you can use to render a label for this edge. + * - `labelY`: the `y` position you can use to render a label for this edge. + * - `offsetX`: the absolute difference between the source `x` position and the `x` position of the + * middle of this path. + * - `offsetY`: the absolute difference between the source `y` position and the `y` position of the + * middle of this path. + * @example + * ```js + * const source = { x: 0, y: 20 }; + * const target = { x: 150, y: 100 }; + * + * const [path, labelX, labelY, offsetX, offsetY] = getSmoothStepPath({ + * sourceX: source.x, + * sourceY: source.y, + * sourcePosition: Position.Right, + * targetX: target.x, + * targetY: target.y, + * targetPosition: Position.Left, + * }); + * ``` + * @remarks This function returns a tuple (aka a fixed-size array) to make it easier to work with multiple edge paths at once. + */ +function getSmoothStepPath({ sourceX, sourceY, sourcePosition = Position.Bottom, targetX, targetY, targetPosition = Position.Top, borderRadius = 5, centerX, centerY, offset = 20, }) { + const [points, labelX, labelY, offsetX, offsetY] = getPoints({ + source: { x: sourceX, y: sourceY }, + sourcePosition, + target: { x: targetX, y: targetY }, + targetPosition, + center: { x: centerX, y: centerY }, + offset, + }); + const path = points.reduce((res, p, i) => { + let segment = ''; + if (i > 0 && i < points.length - 1) { + segment = getBend(points[i - 1], p, points[i + 1], borderRadius); + } + else { + segment = `${i === 0 ? 'M' : 'L'}${p.x} ${p.y}`; + } + res += segment; + return res; + }, ''); + return [path, labelX, labelY, offsetX, offsetY]; +} + +function isNodeInitialized(node) { + return (node && + !!(node.internals.handleBounds || node.handles?.length) && + !!(node.measured.width || node.width || node.initialWidth)); +} +function getEdgePosition(params) { + const { sourceNode, targetNode } = params; + if (!isNodeInitialized(sourceNode) || !isNodeInitialized(targetNode)) { + return null; + } + const sourceHandleBounds = sourceNode.internals.handleBounds || toHandleBounds(sourceNode.handles); + const targetHandleBounds = targetNode.internals.handleBounds || toHandleBounds(targetNode.handles); + const sourceHandle = getHandle$1(sourceHandleBounds?.source ?? [], params.sourceHandle); + const targetHandle = getHandle$1( + // when connection type is loose we can define all handles as sources and connect source -> source + params.connectionMode === ConnectionMode.Strict + ? targetHandleBounds?.target ?? [] + : (targetHandleBounds?.target ?? []).concat(targetHandleBounds?.source ?? []), params.targetHandle); + if (!sourceHandle || !targetHandle) { + params.onError?.('008', errorMessages['error008'](!sourceHandle ? 'source' : 'target', { + id: params.id, + sourceHandle: params.sourceHandle, + targetHandle: params.targetHandle, + })); + return null; + } + const sourcePosition = sourceHandle?.position || Position.Bottom; + const targetPosition = targetHandle?.position || Position.Top; + const source = getHandlePosition(sourceNode, sourceHandle, sourcePosition); + const target = getHandlePosition(targetNode, targetHandle, targetPosition); + return { + sourceX: source.x, + sourceY: source.y, + targetX: target.x, + targetY: target.y, + sourcePosition, + targetPosition, + }; +} +function toHandleBounds(handles) { + if (!handles) { + return null; + } + const source = []; + const target = []; + for (const handle of handles) { + handle.width = handle.width ?? 1; + handle.height = handle.height ?? 1; + if (handle.type === 'source') { + source.push(handle); + } + else if (handle.type === 'target') { + target.push(handle); + } + } + return { + source, + target, + }; +} +function getHandlePosition(node, handle, fallbackPosition = Position.Left, center = false) { + const x = (handle?.x ?? 0) + node.internals.positionAbsolute.x; + const y = (handle?.y ?? 0) + node.internals.positionAbsolute.y; + const { width, height } = handle ?? getNodeDimensions(node); + if (center) { + return { x: x + width / 2, y: y + height / 2 }; + } + const position = handle?.position ?? fallbackPosition; + switch (position) { + case Position.Top: + return { x: x + width / 2, y }; + case Position.Right: + return { x: x + width, y: y + height / 2 }; + case Position.Bottom: + return { x: x + width / 2, y: y + height }; + case Position.Left: + return { x, y: y + height / 2 }; + } +} +function getHandle$1(bounds, handleId) { + if (!bounds) { + return null; + } + // if no handleId is given, we use the first handle, otherwise we check for the id + return (!handleId ? bounds[0] : bounds.find((d) => d.id === handleId)) || null; +} + +function getMarkerId(marker, id) { + if (!marker) { + return ''; + } + if (typeof marker === 'string') { + return marker; + } + const idPrefix = id ? `${id}__` : ''; + return `${idPrefix}${Object.keys(marker) + .sort() + .map((key) => `${key}=${marker[key]}`) + .join('&')}`; +} +function createMarkerIds(edges, { id, defaultColor, defaultMarkerStart, defaultMarkerEnd, }) { + const ids = new Set(); + return edges + .reduce((markers, edge) => { + [edge.markerStart || defaultMarkerStart, edge.markerEnd || defaultMarkerEnd].forEach((marker) => { + if (marker && typeof marker === 'object') { + const markerId = getMarkerId(marker, id); + if (!ids.has(markerId)) { + markers.push({ id: markerId, color: marker.color || defaultColor, ...marker }); + ids.add(markerId); + } + } + }); + return markers; + }, []) + .sort((a, b) => a.id.localeCompare(b.id)); +} + +function getNodeToolbarTransform(nodeRect, viewport, position, offset, align) { + let alignmentOffset = 0.5; + if (align === 'start') { + alignmentOffset = 0; + } + else if (align === 'end') { + alignmentOffset = 1; + } + /* + * position === Position.Top + * we set the x any y position of the toolbar based on the nodes position + */ + let pos = [ + (nodeRect.x + nodeRect.width * alignmentOffset) * viewport.zoom + viewport.x, + nodeRect.y * viewport.zoom + viewport.y - offset, + ]; + // and than shift it based on the alignment. The shift values are in %. + let shift = [-100 * alignmentOffset, -100]; + switch (position) { + case Position.Right: + pos = [ + (nodeRect.x + nodeRect.width) * viewport.zoom + viewport.x + offset, + (nodeRect.y + nodeRect.height * alignmentOffset) * viewport.zoom + viewport.y, + ]; + shift = [0, -100 * alignmentOffset]; + break; + case Position.Bottom: + pos[1] = (nodeRect.y + nodeRect.height) * viewport.zoom + viewport.y + offset; + shift[1] = 0; + break; + case Position.Left: + pos = [ + nodeRect.x * viewport.zoom + viewport.x - offset, + (nodeRect.y + nodeRect.height * alignmentOffset) * viewport.zoom + viewport.y, + ]; + shift = [-100, -100 * alignmentOffset]; + break; + } + return `translate(${pos[0]}px, ${pos[1]}px) translate(${shift[0]}%, ${shift[1]}%)`; +} + +const defaultOptions = { + nodeOrigin: [0, 0], + nodeExtent: infiniteExtent, + elevateNodesOnSelect: true, + defaults: {}, +}; +const adoptUserNodesDefaultOptions = { + ...defaultOptions, + checkEquality: true, +}; +function mergeObjects(base, incoming) { + const result = { ...base }; + for (const key in incoming) { + if (incoming[key] !== undefined) { + // typecast is safe here, because we check for undefined + result[key] = incoming[key]; + } + } + return result; +} +function updateAbsolutePositions(nodeLookup, parentLookup, options) { + const _options = mergeObjects(defaultOptions, options); + for (const node of nodeLookup.values()) { + if (node.parentId) { + updateChildNode(node, nodeLookup, parentLookup, _options); + } + else { + const positionWithOrigin = getNodePositionWithOrigin(node, _options.nodeOrigin); + const extent = isCoordinateExtent(node.extent) ? node.extent : _options.nodeExtent; + const clampedPosition = clampPosition(positionWithOrigin, extent, getNodeDimensions(node)); + node.internals.positionAbsolute = clampedPosition; + } + } +} +function adoptUserNodes(nodes, nodeLookup, parentLookup, options) { + const _options = mergeObjects(adoptUserNodesDefaultOptions, options); + let nodesInitialized = nodes.length > 0; + const tmpLookup = new Map(nodeLookup); + const selectedNodeZ = _options?.elevateNodesOnSelect ? 1000 : 0; + nodeLookup.clear(); + parentLookup.clear(); + for (const userNode of nodes) { + let internalNode = tmpLookup.get(userNode.id); + if (_options.checkEquality && userNode === internalNode?.internals.userNode) { + nodeLookup.set(userNode.id, internalNode); + } + else { + const positionWithOrigin = getNodePositionWithOrigin(userNode, _options.nodeOrigin); + const extent = isCoordinateExtent(userNode.extent) ? userNode.extent : _options.nodeExtent; + const clampedPosition = clampPosition(positionWithOrigin, extent, getNodeDimensions(userNode)); + internalNode = { + ..._options.defaults, + ...userNode, + measured: { + width: userNode.measured?.width, + height: userNode.measured?.height, + }, + internals: { + positionAbsolute: clampedPosition, + // if user re-initializes the node or removes `measured` for whatever reason, we reset the handleBounds so that the node gets re-measured + handleBounds: !userNode.measured ? undefined : internalNode?.internals.handleBounds, + z: calculateZ(userNode, selectedNodeZ), + userNode, + }, + }; + nodeLookup.set(userNode.id, internalNode); + } + if ((internalNode.measured === undefined || + internalNode.measured.width === undefined || + internalNode.measured.height === undefined) && + !internalNode.hidden) { + nodesInitialized = false; + } + if (userNode.parentId) { + updateChildNode(internalNode, nodeLookup, parentLookup, options); + } + } + return nodesInitialized; +} +function updateParentLookup(node, parentLookup) { + if (!node.parentId) { + return; + } + const childNodes = parentLookup.get(node.parentId); + if (childNodes) { + childNodes.set(node.id, node); + } + else { + parentLookup.set(node.parentId, new Map([[node.id, node]])); + } +} +/** + * Updates positionAbsolute and zIndex of a child node and the parentLookup. + */ +function updateChildNode(node, nodeLookup, parentLookup, options) { + const { elevateNodesOnSelect, nodeOrigin, nodeExtent } = mergeObjects(defaultOptions, options); + const parentId = node.parentId; + const parentNode = nodeLookup.get(parentId); + if (!parentNode) { + console.warn(`Parent node ${parentId} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`); + return; + } + updateParentLookup(node, parentLookup); + const selectedNodeZ = elevateNodesOnSelect ? 1000 : 0; + const { x, y, z } = calculateChildXYZ(node, parentNode, nodeOrigin, nodeExtent, selectedNodeZ); + const { positionAbsolute } = node.internals; + const positionChanged = x !== positionAbsolute.x || y !== positionAbsolute.y; + if (positionChanged || z !== node.internals.z) { + // we create a new object to mark the node as updated + nodeLookup.set(node.id, { + ...node, + internals: { + ...node.internals, + positionAbsolute: positionChanged ? { x, y } : positionAbsolute, + z, + }, + }); + } +} +function calculateZ(node, selectedNodeZ) { + return (isNumeric(node.zIndex) ? node.zIndex : 0) + (node.selected ? selectedNodeZ : 0); +} +function calculateChildXYZ(childNode, parentNode, nodeOrigin, nodeExtent, selectedNodeZ) { + const { x: parentX, y: parentY } = parentNode.internals.positionAbsolute; + const childDimensions = getNodeDimensions(childNode); + const positionWithOrigin = getNodePositionWithOrigin(childNode, nodeOrigin); + const clampedPosition = isCoordinateExtent(childNode.extent) + ? clampPosition(positionWithOrigin, childNode.extent, childDimensions) + : positionWithOrigin; + let absolutePosition = clampPosition({ x: parentX + clampedPosition.x, y: parentY + clampedPosition.y }, nodeExtent, childDimensions); + if (childNode.extent === 'parent') { + absolutePosition = clampPositionToParent(absolutePosition, childDimensions, parentNode); + } + const childZ = calculateZ(childNode, selectedNodeZ); + const parentZ = parentNode.internals.z ?? 0; + return { + x: absolutePosition.x, + y: absolutePosition.y, + z: parentZ > childZ ? parentZ : childZ, + }; +} +function handleExpandParent(children, nodeLookup, parentLookup, nodeOrigin = [0, 0]) { + const changes = []; + const parentExpansions = new Map(); + // determine the expanded rectangle the child nodes would take for each parent + for (const child of children) { + const parent = nodeLookup.get(child.parentId); + if (!parent) { + continue; + } + const parentRect = parentExpansions.get(child.parentId)?.expandedRect ?? nodeToRect(parent); + const expandedRect = getBoundsOfRects(parentRect, child.rect); + parentExpansions.set(child.parentId, { expandedRect, parent }); + } + if (parentExpansions.size > 0) { + parentExpansions.forEach(({ expandedRect, parent }, parentId) => { + // determine the position & dimensions of the parent + const positionAbsolute = parent.internals.positionAbsolute; + const dimensions = getNodeDimensions(parent); + const origin = parent.origin ?? nodeOrigin; + // determine how much the parent expands in width and position + const xChange = expandedRect.x < positionAbsolute.x ? Math.round(Math.abs(positionAbsolute.x - expandedRect.x)) : 0; + const yChange = expandedRect.y < positionAbsolute.y ? Math.round(Math.abs(positionAbsolute.y - expandedRect.y)) : 0; + const newWidth = Math.max(dimensions.width, Math.round(expandedRect.width)); + const newHeight = Math.max(dimensions.height, Math.round(expandedRect.height)); + const widthChange = (newWidth - dimensions.width) * origin[0]; + const heightChange = (newHeight - dimensions.height) * origin[1]; + // We need to correct the position of the parent node if the origin is not [0,0] + if (xChange > 0 || yChange > 0 || widthChange || heightChange) { + changes.push({ + id: parentId, + type: 'position', + position: { + x: parent.position.x - xChange + widthChange, + y: parent.position.y - yChange + heightChange, + }, + }); + /* + * We move all child nodes in the oppsite direction + * so the x,y changes of the parent do not move the children + */ + parentLookup.get(parentId)?.forEach((childNode) => { + if (!children.some((child) => child.id === childNode.id)) { + changes.push({ + id: childNode.id, + type: 'position', + position: { + x: childNode.position.x + xChange, + y: childNode.position.y + yChange, + }, + }); + } + }); + } + // We need to correct the dimensions of the parent node if the origin is not [0,0] + if (dimensions.width < expandedRect.width || dimensions.height < expandedRect.height || xChange || yChange) { + changes.push({ + id: parentId, + type: 'dimensions', + setAttributes: true, + dimensions: { + width: newWidth + (xChange ? origin[0] * xChange - widthChange : 0), + height: newHeight + (yChange ? origin[1] * yChange - heightChange : 0), + }, + }); + } + }); + } + return changes; +} +function updateNodeInternals(updates, nodeLookup, parentLookup, domNode, nodeOrigin, nodeExtent) { + const viewportNode = domNode?.querySelector('.xyflow__viewport'); + let updatedInternals = false; + if (!viewportNode) { + return { changes: [], updatedInternals }; + } + const changes = []; + const style = window.getComputedStyle(viewportNode); + const { m22: zoom } = new window.DOMMatrixReadOnly(style.transform); + // in this array we collect nodes, that might trigger changes (like expanding parent) + const parentExpandChildren = []; + for (const update of updates.values()) { + const node = nodeLookup.get(update.id); + if (!node) { + continue; + } + if (node.hidden) { + nodeLookup.set(node.id, { + ...node, + internals: { + ...node.internals, + handleBounds: undefined, + }, + }); + updatedInternals = true; + continue; + } + const dimensions = getDimensions(update.nodeElement); + const dimensionChanged = node.measured.width !== dimensions.width || node.measured.height !== dimensions.height; + const doUpdate = !!(dimensions.width && + dimensions.height && + (dimensionChanged || !node.internals.handleBounds || update.force)); + if (doUpdate) { + const nodeBounds = update.nodeElement.getBoundingClientRect(); + const extent = isCoordinateExtent(node.extent) ? node.extent : nodeExtent; + let { positionAbsolute } = node.internals; + if (node.parentId && node.extent === 'parent') { + positionAbsolute = clampPositionToParent(positionAbsolute, dimensions, nodeLookup.get(node.parentId)); + } + else if (extent) { + positionAbsolute = clampPosition(positionAbsolute, extent, dimensions); + } + const newNode = { + ...node, + measured: dimensions, + internals: { + ...node.internals, + positionAbsolute, + handleBounds: { + source: getHandleBounds('source', update.nodeElement, nodeBounds, zoom, node.id), + target: getHandleBounds('target', update.nodeElement, nodeBounds, zoom, node.id), + }, + }, + }; + nodeLookup.set(node.id, newNode); + if (node.parentId) { + updateChildNode(newNode, nodeLookup, parentLookup, { nodeOrigin }); + } + updatedInternals = true; + if (dimensionChanged) { + changes.push({ + id: node.id, + type: 'dimensions', + dimensions, + }); + if (node.expandParent && node.parentId) { + parentExpandChildren.push({ + id: node.id, + parentId: node.parentId, + rect: nodeToRect(newNode, nodeOrigin), + }); + } + } + } + } + if (parentExpandChildren.length > 0) { + const parentExpandChanges = handleExpandParent(parentExpandChildren, nodeLookup, parentLookup, nodeOrigin); + changes.push(...parentExpandChanges); + } + return { changes, updatedInternals }; +} +async function panBy({ delta, panZoom, transform, translateExtent, width, height, }) { + if (!panZoom || (!delta.x && !delta.y)) { + return Promise.resolve(false); + } + const nextViewport = await panZoom.setViewportConstrained({ + x: transform[0] + delta.x, + y: transform[1] + delta.y, + zoom: transform[2], + }, [ + [0, 0], + [width, height], + ], translateExtent); + const transformChanged = !!nextViewport && + (nextViewport.x !== transform[0] || nextViewport.y !== transform[1] || nextViewport.k !== transform[2]); + return Promise.resolve(transformChanged); +} +/** + * this function adds the connection to the connectionLookup + * at the following keys: nodeId-type-handleId, nodeId-type and nodeId + * @param type type of the connection + * @param connection connection that should be added to the lookup + * @param connectionKey at which key the connection should be added + * @param connectionLookup reference to the connection lookup + * @param nodeId nodeId of the connection + * @param handleId handleId of the conneciton + */ +function addConnectionToLookup(type, connection, connectionKey, connectionLookup, nodeId, handleId) { + /* + * We add the connection to the connectionLookup at the following keys + * 1. nodeId, 2. nodeId-type, 3. nodeId-type-handleId + * If the key already exists, we add the connection to the existing map + */ + let key = nodeId; + const nodeMap = connectionLookup.get(key) || new Map(); + connectionLookup.set(key, nodeMap.set(connectionKey, connection)); + key = `${nodeId}-${type}`; + const typeMap = connectionLookup.get(key) || new Map(); + connectionLookup.set(key, typeMap.set(connectionKey, connection)); + if (handleId) { + key = `${nodeId}-${type}-${handleId}`; + const handleMap = connectionLookup.get(key) || new Map(); + connectionLookup.set(key, handleMap.set(connectionKey, connection)); + } +} +function updateConnectionLookup(connectionLookup, edgeLookup, edges) { + connectionLookup.clear(); + edgeLookup.clear(); + for (const edge of edges) { + const { source: sourceNode, target: targetNode, sourceHandle = null, targetHandle = null } = edge; + const connection = { edgeId: edge.id, source: sourceNode, target: targetNode, sourceHandle, targetHandle }; + const sourceKey = `${sourceNode}-${sourceHandle}--${targetNode}-${targetHandle}`; + const targetKey = `${targetNode}-${targetHandle}--${sourceNode}-${sourceHandle}`; + addConnectionToLookup('source', connection, targetKey, connectionLookup, sourceNode, sourceHandle); + addConnectionToLookup('target', connection, sourceKey, connectionLookup, targetNode, targetHandle); + edgeLookup.set(edge.id, edge); + } +} + +function shallowNodeData(a, b) { + if (a === null || b === null) { + return false; + } + const _a = Array.isArray(a) ? a : [a]; + const _b = Array.isArray(b) ? b : [b]; + if (_a.length !== _b.length) { + return false; + } + for (let i = 0; i < _a.length; i++) { + if (_a[i].id !== _b[i].id || _a[i].type !== _b[i].type || !Object.is(_a[i].data, _b[i].data)) { + return false; + } + } + return true; +} + +function isParentSelected(node, nodeLookup) { + if (!node.parentId) { + return false; + } + const parentNode = nodeLookup.get(node.parentId); + if (!parentNode) { + return false; + } + if (parentNode.selected) { + return true; + } + return isParentSelected(parentNode, nodeLookup); +} +function hasSelector(target, selector, domNode) { + let current = target; + do { + if (current?.matches?.(selector)) + return true; + if (current === domNode) + return false; + current = current?.parentElement; + } while (current); + return false; +} +// looks for all selected nodes and created a NodeDragItem for each of them +function getDragItems(nodeLookup, nodesDraggable, mousePos, nodeId) { + const dragItems = new Map(); + for (const [id, node] of nodeLookup) { + if ((node.selected || node.id === nodeId) && + (!node.parentId || !isParentSelected(node, nodeLookup)) && + (node.draggable || (nodesDraggable && typeof node.draggable === 'undefined'))) { + const internalNode = nodeLookup.get(id); + if (internalNode) { + dragItems.set(id, { + id, + position: internalNode.position || { x: 0, y: 0 }, + distance: { + x: mousePos.x - internalNode.internals.positionAbsolute.x, + y: mousePos.y - internalNode.internals.positionAbsolute.y, + }, + extent: internalNode.extent, + parentId: internalNode.parentId, + origin: internalNode.origin, + expandParent: internalNode.expandParent, + internals: { + positionAbsolute: internalNode.internals.positionAbsolute || { x: 0, y: 0 }, + }, + measured: { + width: internalNode.measured.width ?? 0, + height: internalNode.measured.height ?? 0, + }, + }); + } + } + } + return dragItems; +} +/* + * returns two params: + * 1. the dragged node (or the first of the list, if we are dragging a node selection) + * 2. array of selected nodes (for multi selections) + */ +function getEventHandlerParams({ nodeId, dragItems, nodeLookup, dragging = true, }) { + const nodesFromDragItems = []; + for (const [id, dragItem] of dragItems) { + const node = nodeLookup.get(id)?.internals.userNode; + if (node) { + nodesFromDragItems.push({ + ...node, + position: dragItem.position, + dragging, + }); + } + } + if (!nodeId) { + return [nodesFromDragItems[0], nodesFromDragItems]; + } + const node = nodeLookup.get(nodeId)?.internals.userNode; + return [ + !node + ? nodesFromDragItems[0] + : { + ...node, + position: dragItems.get(nodeId)?.position || node.position, + dragging, + }, + nodesFromDragItems, + ]; +} + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragStop, }) { + let lastPos = { x: null, y: null }; + let autoPanId = 0; + let dragItems = new Map(); + let autoPanStarted = false; + let mousePosition = { x: 0, y: 0 }; + let containerBounds = null; + let dragStarted = false; + let d3Selection = null; + let abortDrag = false; // prevents unintentional dragging on multitouch + // public functions + function update({ noDragClassName, handleSelector, domNode, isSelectable, nodeId, nodeClickDistance = 0, }) { + d3Selection = select(domNode); + function updateNodes({ x, y }, dragEvent) { + const { nodeLookup, nodeExtent, snapGrid, snapToGrid, nodeOrigin, onNodeDrag, onSelectionDrag, onError, updateNodePositions, } = getStoreItems(); + lastPos = { x, y }; + let hasChange = false; + let nodesBox = { x: 0, y: 0, x2: 0, y2: 0 }; + if (dragItems.size > 1 && nodeExtent) { + const rect = getInternalNodesBounds(dragItems); + nodesBox = rectToBox(rect); + } + for (const [id, dragItem] of dragItems) { + if (!nodeLookup.has(id)) { + /* + * if the node is not in the nodeLookup anymore, it was probably deleted while dragging + * and we don't need to update it anymore + */ + continue; + } + let nextPosition = { x: x - dragItem.distance.x, y: y - dragItem.distance.y }; + if (snapToGrid) { + nextPosition = snapPosition(nextPosition, snapGrid); + } + /* + * if there is selection with multiple nodes and a node extent is set, we need to adjust the node extent for each node + * based on its position so that the node stays at it's position relative to the selection. + */ + let adjustedNodeExtent = [ + [nodeExtent[0][0], nodeExtent[0][1]], + [nodeExtent[1][0], nodeExtent[1][1]], + ]; + if (dragItems.size > 1 && nodeExtent && !dragItem.extent) { + const { positionAbsolute } = dragItem.internals; + const x1 = positionAbsolute.x - nodesBox.x + nodeExtent[0][0]; + const x2 = positionAbsolute.x + dragItem.measured.width - nodesBox.x2 + nodeExtent[1][0]; + const y1 = positionAbsolute.y - nodesBox.y + nodeExtent[0][1]; + const y2 = positionAbsolute.y + dragItem.measured.height - nodesBox.y2 + nodeExtent[1][1]; + adjustedNodeExtent = [ + [x1, y1], + [x2, y2], + ]; + } + const { position, positionAbsolute } = calculateNodePosition({ + nodeId: id, + nextPosition, + nodeLookup, + nodeExtent: adjustedNodeExtent, + nodeOrigin, + onError, + }); + // we want to make sure that we only fire a change event when there is a change + hasChange = hasChange || dragItem.position.x !== position.x || dragItem.position.y !== position.y; + dragItem.position = position; + dragItem.internals.positionAbsolute = positionAbsolute; + } + if (!hasChange) { + return; + } + updateNodePositions(dragItems, true); + if (dragEvent && (onDrag || onNodeDrag || (!nodeId && onSelectionDrag))) { + const [currentNode, currentNodes] = getEventHandlerParams({ + nodeId, + dragItems, + nodeLookup, + }); + onDrag?.(dragEvent, dragItems, currentNode, currentNodes); + onNodeDrag?.(dragEvent, currentNode, currentNodes); + if (!nodeId) { + onSelectionDrag?.(dragEvent, currentNodes); + } + } + } + async function autoPan() { + if (!containerBounds) { + return; + } + const { transform, panBy, autoPanSpeed, autoPanOnNodeDrag } = getStoreItems(); + if (!autoPanOnNodeDrag) { + autoPanStarted = false; + cancelAnimationFrame(autoPanId); + return; + } + const [xMovement, yMovement] = calcAutoPan(mousePosition, containerBounds, autoPanSpeed); + if (xMovement !== 0 || yMovement !== 0) { + lastPos.x = (lastPos.x ?? 0) - xMovement / transform[2]; + lastPos.y = (lastPos.y ?? 0) - yMovement / transform[2]; + if (await panBy({ x: xMovement, y: yMovement })) { + updateNodes(lastPos, null); + } + } + autoPanId = requestAnimationFrame(autoPan); + } + function startDrag(event) { + const { nodeLookup, multiSelectionActive, nodesDraggable, transform, snapGrid, snapToGrid, selectNodesOnDrag, onNodeDragStart, onSelectionDragStart, unselectNodesAndEdges, } = getStoreItems(); + dragStarted = true; + if ((!selectNodesOnDrag || !isSelectable) && !multiSelectionActive && nodeId) { + if (!nodeLookup.get(nodeId)?.selected) { + // we need to reset selected nodes when selectNodesOnDrag=false + unselectNodesAndEdges(); + } + } + if (isSelectable && selectNodesOnDrag && nodeId) { + onNodeMouseDown?.(nodeId); + } + const pointerPos = getPointerPosition(event.sourceEvent, { transform, snapGrid, snapToGrid, containerBounds }); + lastPos = pointerPos; + dragItems = getDragItems(nodeLookup, nodesDraggable, pointerPos, nodeId); + if (dragItems.size > 0 && (onDragStart || onNodeDragStart || (!nodeId && onSelectionDragStart))) { + const [currentNode, currentNodes] = getEventHandlerParams({ + nodeId, + dragItems, + nodeLookup, + }); + onDragStart?.(event.sourceEvent, dragItems, currentNode, currentNodes); + onNodeDragStart?.(event.sourceEvent, currentNode, currentNodes); + if (!nodeId) { + onSelectionDragStart?.(event.sourceEvent, currentNodes); + } + } + } + const d3DragInstance = drag() + .clickDistance(nodeClickDistance) + .on('start', (event) => { + const { domNode, nodeDragThreshold, transform, snapGrid, snapToGrid } = getStoreItems(); + containerBounds = domNode?.getBoundingClientRect() || null; + abortDrag = false; + if (nodeDragThreshold === 0) { + startDrag(event); + } + const pointerPos = getPointerPosition(event.sourceEvent, { transform, snapGrid, snapToGrid, containerBounds }); + lastPos = pointerPos; + mousePosition = getEventPosition(event.sourceEvent, containerBounds); + }) + .on('drag', (event) => { + const { autoPanOnNodeDrag, transform, snapGrid, snapToGrid, nodeDragThreshold, nodeLookup } = getStoreItems(); + const pointerPos = getPointerPosition(event.sourceEvent, { transform, snapGrid, snapToGrid, containerBounds }); + if ((event.sourceEvent.type === 'touchmove' && event.sourceEvent.touches.length > 1) || + // if user deletes a node while dragging, we need to abort the drag to prevent errors + (nodeId && !nodeLookup.has(nodeId))) { + abortDrag = true; + } + if (abortDrag) { + return; + } + if (!autoPanStarted && autoPanOnNodeDrag && dragStarted) { + autoPanStarted = true; + autoPan(); + } + if (!dragStarted) { + const x = pointerPos.xSnapped - (lastPos.x ?? 0); + const y = pointerPos.ySnapped - (lastPos.y ?? 0); + const distance = Math.sqrt(x * x + y * y); + if (distance > nodeDragThreshold) { + startDrag(event); + } + } + // skip events without movement + if ((lastPos.x !== pointerPos.xSnapped || lastPos.y !== pointerPos.ySnapped) && dragItems && dragStarted) { + // dragEvent = event.sourceEvent as MouseEvent; + mousePosition = getEventPosition(event.sourceEvent, containerBounds); + updateNodes(pointerPos, event.sourceEvent); + } + }) + .on('end', (event) => { + if (!dragStarted || abortDrag) { + return; + } + autoPanStarted = false; + dragStarted = false; + cancelAnimationFrame(autoPanId); + if (dragItems.size > 0) { + const { nodeLookup, updateNodePositions, onNodeDragStop, onSelectionDragStop } = getStoreItems(); + updateNodePositions(dragItems, false); + if (onDragStop || onNodeDragStop || (!nodeId && onSelectionDragStop)) { + const [currentNode, currentNodes] = getEventHandlerParams({ + nodeId, + dragItems, + nodeLookup, + dragging: false, + }); + onDragStop?.(event.sourceEvent, dragItems, currentNode, currentNodes); + onNodeDragStop?.(event.sourceEvent, currentNode, currentNodes); + if (!nodeId) { + onSelectionDragStop?.(event.sourceEvent, currentNodes); + } + } + } + }) + .filter((event) => { + const target = event.target; + const isDraggable = !event.button && + (!noDragClassName || !hasSelector(target, `.${noDragClassName}`, domNode)) && + (!handleSelector || hasSelector(target, handleSelector, domNode)); + return isDraggable; + }); + d3Selection.call(d3DragInstance); + } + function destroy() { + d3Selection?.on('.drag', null); + } + return { + update, + destroy, + }; +} + +function getNodesWithinDistance(position, nodeLookup, distance) { + const nodes = []; + const rect = { + x: position.x - distance, + y: position.y - distance, + width: distance * 2, + height: distance * 2, + }; + for (const node of nodeLookup.values()) { + if (getOverlappingArea(rect, nodeToRect(node)) > 0) { + nodes.push(node); + } + } + return nodes; +} +/* + * this distance is used for the area around the user pointer + * while doing a connection for finding the closest nodes + */ +const ADDITIONAL_DISTANCE = 250; +function getClosestHandle(position, connectionRadius, nodeLookup, fromHandle) { + let closestHandles = []; + let minDistance = Infinity; + const closeNodes = getNodesWithinDistance(position, nodeLookup, connectionRadius + ADDITIONAL_DISTANCE); + for (const node of closeNodes) { + const allHandles = [...(node.internals.handleBounds?.source ?? []), ...(node.internals.handleBounds?.target ?? [])]; + for (const handle of allHandles) { + // if the handle is the same as the fromHandle we skip it + if (fromHandle.nodeId === handle.nodeId && fromHandle.type === handle.type && fromHandle.id === handle.id) { + continue; + } + // determine absolute position of the handle + const { x, y } = getHandlePosition(node, handle, handle.position, true); + const distance = Math.sqrt(Math.pow(x - position.x, 2) + Math.pow(y - position.y, 2)); + if (distance > connectionRadius) { + continue; + } + if (distance < minDistance) { + closestHandles = [{ ...handle, x, y }]; + minDistance = distance; + } + else if (distance === minDistance) { + // when multiple handles are on the same distance we collect all of them + closestHandles.push({ ...handle, x, y }); + } + } + } + if (!closestHandles.length) { + return null; + } + // when multiple handles overlay each other we prefer the opposite handle + if (closestHandles.length > 1) { + const oppositeHandleType = fromHandle.type === 'source' ? 'target' : 'source'; + return closestHandles.find((handle) => handle.type === oppositeHandleType) ?? closestHandles[0]; + } + return closestHandles[0]; +} +function getHandle(nodeId, handleType, handleId, nodeLookup, connectionMode, withAbsolutePosition = false) { + const node = nodeLookup.get(nodeId); + if (!node) { + return null; + } + const handles = connectionMode === 'strict' + ? node.internals.handleBounds?.[handleType] + : [...(node.internals.handleBounds?.source ?? []), ...(node.internals.handleBounds?.target ?? [])]; + const handle = (handleId ? handles?.find((h) => h.id === handleId) : handles?.[0]) ?? null; + return handle && withAbsolutePosition + ? { ...handle, ...getHandlePosition(node, handle, handle.position, true) } + : handle; +} +function getHandleType(edgeUpdaterType, handleDomNode) { + if (edgeUpdaterType) { + return edgeUpdaterType; + } + else if (handleDomNode?.classList.contains('target')) { + return 'target'; + } + else if (handleDomNode?.classList.contains('source')) { + return 'source'; + } + return null; +} +function isConnectionValid(isInsideConnectionRadius, isHandleValid) { + let isValid = null; + if (isHandleValid) { + isValid = true; + } + else if (isInsideConnectionRadius && !isHandleValid) { + isValid = false; + } + return isValid; +} + +const alwaysValid = () => true; +function onPointerDown(event, { connectionMode, connectionRadius, handleId, nodeId, edgeUpdaterType, isTarget, domNode, nodeLookup, lib, autoPanOnConnect, flowId, panBy, cancelConnection, onConnectStart, onConnect, onConnectEnd, isValidConnection = alwaysValid, onReconnectEnd, updateConnection, getTransform, getFromHandle, autoPanSpeed, }) { + // when xyflow is used inside a shadow root we can't use document + const doc = getHostForElement(event.target); + let autoPanId = 0; + let closestHandle; + const { x, y } = getEventPosition(event); + const clickedHandle = doc?.elementFromPoint(x, y); + const handleType = getHandleType(edgeUpdaterType, clickedHandle); + const containerBounds = domNode?.getBoundingClientRect(); + if (!containerBounds || !handleType) { + return; + } + const fromHandleInternal = getHandle(nodeId, handleType, handleId, nodeLookup, connectionMode); + if (!fromHandleInternal) { + return; + } + let position = getEventPosition(event, containerBounds); + let autoPanStarted = false; + let connection = null; + let isValid = false; + let handleDomNode = null; + // when the user is moving the mouse close to the edge of the canvas while connecting we move the canvas + function autoPan() { + if (!autoPanOnConnect || !containerBounds) { + return; + } + const [x, y] = calcAutoPan(position, containerBounds, autoPanSpeed); + panBy({ x, y }); + autoPanId = requestAnimationFrame(autoPan); + } + // Stays the same for all consecutive pointermove events + const fromHandle = { + ...fromHandleInternal, + nodeId, + type: handleType, + position: fromHandleInternal.position, + }; + const fromNodeInternal = nodeLookup.get(nodeId); + const from = getHandlePosition(fromNodeInternal, fromHandle, Position.Left, true); + const newConnection = { + inProgress: true, + isValid: null, + from, + fromHandle, + fromPosition: fromHandle.position, + fromNode: fromNodeInternal, + to: position, + toHandle: null, + toPosition: oppositePosition[fromHandle.position], + toNode: null, + }; + updateConnection(newConnection); + let previousConnection = newConnection; + onConnectStart?.(event, { nodeId, handleId, handleType }); + function onPointerMove(event) { + if (!getFromHandle() || !fromHandle) { + onPointerUp(event); + return; + } + const transform = getTransform(); + position = getEventPosition(event, containerBounds); + closestHandle = getClosestHandle(pointToRendererPoint(position, transform, false, [1, 1]), connectionRadius, nodeLookup, fromHandle); + if (!autoPanStarted) { + autoPan(); + autoPanStarted = true; + } + const result = isValidHandle(event, { + handle: closestHandle, + connectionMode, + fromNodeId: nodeId, + fromHandleId: handleId, + fromType: isTarget ? 'target' : 'source', + isValidConnection, + doc, + lib, + flowId, + nodeLookup, + }); + handleDomNode = result.handleDomNode; + connection = result.connection; + isValid = isConnectionValid(!!closestHandle, result.isValid); + const newConnection = { + // from stays the same + ...previousConnection, + isValid, + to: result.toHandle && isValid + ? rendererPointToPoint({ x: result.toHandle.x, y: result.toHandle.y }, transform) + : position, + toHandle: result.toHandle, + toPosition: isValid && result.toHandle ? result.toHandle.position : oppositePosition[fromHandle.position], + toNode: result.toHandle ? nodeLookup.get(result.toHandle.nodeId) : null, + }; + /* + * we don't want to trigger an update when the connection + * is snapped to the same handle as before + */ + if (isValid && + closestHandle && + previousConnection.toHandle && + newConnection.toHandle && + previousConnection.toHandle.type === newConnection.toHandle.type && + previousConnection.toHandle.nodeId === newConnection.toHandle.nodeId && + previousConnection.toHandle.id === newConnection.toHandle.id && + previousConnection.to.x === newConnection.to.x && + previousConnection.to.y === newConnection.to.y) { + return; + } + updateConnection(newConnection); + previousConnection = newConnection; + } + function onPointerUp(event) { + if ((closestHandle || handleDomNode) && connection && isValid) { + onConnect?.(connection); + } + /* + * it's important to get a fresh reference from the store here + * in order to get the latest state of onConnectEnd + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const { inProgress, ...connectionState } = previousConnection; + const finalConnectionState = { + ...connectionState, + toPosition: previousConnection.toHandle ? previousConnection.toPosition : null, + }; + onConnectEnd?.(event, finalConnectionState); + if (edgeUpdaterType) { + onReconnectEnd?.(event, finalConnectionState); + } + cancelConnection(); + cancelAnimationFrame(autoPanId); + autoPanStarted = false; + isValid = false; + connection = null; + handleDomNode = null; + doc.removeEventListener('mousemove', onPointerMove); + doc.removeEventListener('mouseup', onPointerUp); + doc.removeEventListener('touchmove', onPointerMove); + doc.removeEventListener('touchend', onPointerUp); + } + doc.addEventListener('mousemove', onPointerMove); + doc.addEventListener('mouseup', onPointerUp); + doc.addEventListener('touchmove', onPointerMove); + doc.addEventListener('touchend', onPointerUp); +} +// checks if and returns connection in fom of an object { source: 123, target: 312 } +function isValidHandle(event, { handle, connectionMode, fromNodeId, fromHandleId, fromType, doc, lib, flowId, isValidConnection = alwaysValid, nodeLookup, }) { + const isTarget = fromType === 'target'; + const handleDomNode = handle + ? doc.querySelector(`.${lib}-flow__handle[data-id="${flowId}-${handle?.nodeId}-${handle?.id}-${handle?.type}"]`) + : null; + const { x, y } = getEventPosition(event); + const handleBelow = doc.elementFromPoint(x, y); + /* + * we always want to prioritize the handle below the mouse cursor over the closest distance handle, + * because it could be that the center of another handle is closer to the mouse pointer than the handle below the cursor + */ + const handleToCheck = handleBelow?.classList.contains(`${lib}-flow__handle`) ? handleBelow : handleDomNode; + const result = { + handleDomNode: handleToCheck, + isValid: false, + connection: null, + toHandle: null, + }; + if (handleToCheck) { + const handleType = getHandleType(undefined, handleToCheck); + const handleNodeId = handleToCheck.getAttribute('data-nodeid'); + const handleId = handleToCheck.getAttribute('data-handleid'); + const connectable = handleToCheck.classList.contains('connectable'); + const connectableEnd = handleToCheck.classList.contains('connectableend'); + if (!handleNodeId || !handleType) { + return result; + } + const connection = { + source: isTarget ? handleNodeId : fromNodeId, + sourceHandle: isTarget ? handleId : fromHandleId, + target: isTarget ? fromNodeId : handleNodeId, + targetHandle: isTarget ? fromHandleId : handleId, + }; + result.connection = connection; + const isConnectable = connectable && connectableEnd; + // in strict mode we don't allow target to target or source to source connections + const isValid = isConnectable && + (connectionMode === ConnectionMode.Strict + ? (isTarget && handleType === 'source') || (!isTarget && handleType === 'target') + : handleNodeId !== fromNodeId || handleId !== fromHandleId); + result.isValid = isValid && isValidConnection(connection); + result.toHandle = getHandle(handleNodeId, handleType, handleId, nodeLookup, connectionMode, true); + } + return result; +} +const XYHandle = { + onPointerDown, + isValid: isValidHandle, +}; + +function XYMinimap({ domNode, panZoom, getTransform, getViewScale }) { + const selection = select(domNode); + function update({ translateExtent, width, height, zoomStep = 10, pannable = true, zoomable = true, inversePan = false, }) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const zoomHandler = (event) => { + const transform = getTransform(); + if (event.sourceEvent.type !== 'wheel' || !panZoom) { + return; + } + const pinchDelta = -event.sourceEvent.deltaY * + (event.sourceEvent.deltaMode === 1 ? 0.05 : event.sourceEvent.deltaMode ? 1 : 0.002) * + zoomStep; + const nextZoom = transform[2] * Math.pow(2, pinchDelta); + panZoom.scaleTo(nextZoom); + }; + let panStart = [0, 0]; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const panStartHandler = (event) => { + if (event.sourceEvent.type === 'mousedown' || event.sourceEvent.type === 'touchstart') { + panStart = [ + event.sourceEvent.clientX ?? event.sourceEvent.touches[0].clientX, + event.sourceEvent.clientY ?? event.sourceEvent.touches[0].clientY, + ]; + } + }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const panHandler = (event) => { + const transform = getTransform(); + if ((event.sourceEvent.type !== 'mousemove' && event.sourceEvent.type !== 'touchmove') || !panZoom) { + return; + } + const panCurrent = [ + event.sourceEvent.clientX ?? event.sourceEvent.touches[0].clientX, + event.sourceEvent.clientY ?? event.sourceEvent.touches[0].clientY, + ]; + const panDelta = [panCurrent[0] - panStart[0], panCurrent[1] - panStart[1]]; + panStart = panCurrent; + const moveScale = getViewScale() * Math.max(transform[2], Math.log(transform[2])) * (inversePan ? -1 : 1); + const position = { + x: transform[0] - panDelta[0] * moveScale, + y: transform[1] - panDelta[1] * moveScale, + }; + const extent = [ + [0, 0], + [width, height], + ]; + panZoom.setViewportConstrained({ + x: position.x, + y: position.y, + zoom: transform[2], + }, extent, translateExtent); + }; + const zoomAndPanHandler = zoom() + .on('start', panStartHandler) + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + .on('zoom', pannable ? panHandler : null) + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + .on('zoom.wheel', zoomable ? zoomHandler : null); + selection.call(zoomAndPanHandler, {}); + } + function destroy() { + selection.on('zoom', null); + } + return { + update, + destroy, + pointer, + }; +} + +/* eslint-disable @typescript-eslint/no-explicit-any */ +const viewChanged = (prevViewport, eventViewport) => prevViewport.x !== eventViewport.x || prevViewport.y !== eventViewport.y || prevViewport.zoom !== eventViewport.k; +const transformToViewport = (transform) => ({ + x: transform.x, + y: transform.y, + zoom: transform.k, +}); +const viewportToTransform = ({ x, y, zoom }) => zoomIdentity.translate(x, y).scale(zoom); +const isWrappedWithClass = (event, className) => event.target.closest(`.${className}`); +const isRightClickPan = (panOnDrag, usedButton) => usedButton === 2 && Array.isArray(panOnDrag) && panOnDrag.includes(2); +// taken from d3-ease: https://github.com/d3/d3-ease/blob/main/src/cubic.js +const defaultEase = (t) => ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; +const getD3Transition = (selection, duration = 0, ease = defaultEase, onEnd = () => { }) => { + const hasDuration = typeof duration === 'number' && duration > 0; + if (!hasDuration) { + onEnd(); + } + return hasDuration ? selection.transition().duration(duration).ease(ease).on('end', onEnd) : selection; +}; +const wheelDelta = (event) => { + const factor = event.ctrlKey && isMacOs() ? 10 : 1; + return -event.deltaY * (event.deltaMode === 1 ? 0.05 : event.deltaMode ? 1 : 0.002) * factor; +}; + +function createPanOnScrollHandler({ zoomPanValues, noWheelClassName, d3Selection, d3Zoom, panOnScrollMode, panOnScrollSpeed, zoomOnPinch, onPanZoomStart, onPanZoom, onPanZoomEnd, }) { + return (event) => { + if (isWrappedWithClass(event, noWheelClassName)) { + return false; + } + event.preventDefault(); + event.stopImmediatePropagation(); + const currentZoom = d3Selection.property('__zoom').k || 1; + // macos sets ctrlKey=true for pinch gesture on a trackpad + if (event.ctrlKey && zoomOnPinch) { + const point = pointer(event); + const pinchDelta = wheelDelta(event); + const zoom = currentZoom * Math.pow(2, pinchDelta); + // @ts-ignore + d3Zoom.scaleTo(d3Selection, zoom, point, event); + return; + } + /* + * increase scroll speed in firefox + * firefox: deltaMode === 1; chrome: deltaMode === 0 + */ + const deltaNormalize = event.deltaMode === 1 ? 20 : 1; + let deltaX = panOnScrollMode === PanOnScrollMode.Vertical ? 0 : event.deltaX * deltaNormalize; + let deltaY = panOnScrollMode === PanOnScrollMode.Horizontal ? 0 : event.deltaY * deltaNormalize; + // this enables vertical scrolling with shift + scroll on windows + if (!isMacOs() && event.shiftKey && panOnScrollMode !== PanOnScrollMode.Vertical) { + deltaX = event.deltaY * deltaNormalize; + deltaY = 0; + } + d3Zoom.translateBy(d3Selection, -(deltaX / currentZoom) * panOnScrollSpeed, -(deltaY / currentZoom) * panOnScrollSpeed, + // @ts-ignore + { internal: true }); + const nextViewport = transformToViewport(d3Selection.property('__zoom')); + clearTimeout(zoomPanValues.panScrollTimeout); + /* + * for pan on scroll we need to handle the event calls on our own + * we can't use the start, zoom and end events from d3-zoom + * because start and move gets called on every scroll event and not once at the beginning + */ + if (!zoomPanValues.isPanScrolling) { + zoomPanValues.isPanScrolling = true; + onPanZoomStart?.(event, nextViewport); + } + if (zoomPanValues.isPanScrolling) { + onPanZoom?.(event, nextViewport); + zoomPanValues.panScrollTimeout = setTimeout(() => { + onPanZoomEnd?.(event, nextViewport); + zoomPanValues.isPanScrolling = false; + }, 150); + } + }; +} +function createZoomOnScrollHandler({ noWheelClassName, preventScrolling, d3ZoomHandler }) { + return function (event, d) { + const isWheel = event.type === 'wheel'; + // we still want to enable pinch zooming even if preventScrolling is set to false + const preventZoom = !preventScrolling && isWheel && !event.ctrlKey; + const hasNoWheelClass = isWrappedWithClass(event, noWheelClassName); + // if user is pinch zooming above a nowheel element, we don't want the browser to zoom + if (event.ctrlKey && isWheel && hasNoWheelClass) { + event.preventDefault(); + } + if (preventZoom || hasNoWheelClass) { + return null; + } + event.preventDefault(); + d3ZoomHandler.call(this, event, d); + }; +} +function createPanZoomStartHandler({ zoomPanValues, onDraggingChange, onPanZoomStart }) { + return (event) => { + if (event.sourceEvent?.internal) { + return; + } + const viewport = transformToViewport(event.transform); + // we need to remember it here, because it's always 0 in the "zoom" event + zoomPanValues.mouseButton = event.sourceEvent?.button || 0; + zoomPanValues.isZoomingOrPanning = true; + zoomPanValues.prevViewport = viewport; + if (event.sourceEvent?.type === 'mousedown') { + onDraggingChange(true); + } + if (onPanZoomStart) { + onPanZoomStart?.(event.sourceEvent, viewport); + } + }; +} +function createPanZoomHandler({ zoomPanValues, panOnDrag, onPaneContextMenu, onTransformChange, onPanZoom, }) { + return (event) => { + zoomPanValues.usedRightMouseButton = !!(onPaneContextMenu && isRightClickPan(panOnDrag, zoomPanValues.mouseButton ?? 0)); + if (!event.sourceEvent?.sync) { + onTransformChange([event.transform.x, event.transform.y, event.transform.k]); + } + if (onPanZoom && !event.sourceEvent?.internal) { + onPanZoom?.(event.sourceEvent, transformToViewport(event.transform)); + } + }; +} +function createPanZoomEndHandler({ zoomPanValues, panOnDrag, panOnScroll, onDraggingChange, onPanZoomEnd, onPaneContextMenu, }) { + return (event) => { + if (event.sourceEvent?.internal) { + return; + } + zoomPanValues.isZoomingOrPanning = false; + if (onPaneContextMenu && + isRightClickPan(panOnDrag, zoomPanValues.mouseButton ?? 0) && + !zoomPanValues.usedRightMouseButton && + event.sourceEvent) { + onPaneContextMenu(event.sourceEvent); + } + zoomPanValues.usedRightMouseButton = false; + onDraggingChange(false); + if (onPanZoomEnd && viewChanged(zoomPanValues.prevViewport, event.transform)) { + const viewport = transformToViewport(event.transform); + zoomPanValues.prevViewport = viewport; + clearTimeout(zoomPanValues.timerId); + zoomPanValues.timerId = setTimeout(() => { + onPanZoomEnd?.(event.sourceEvent, viewport); + }, + // we need a setTimeout for panOnScroll to supress multiple end events fired during scroll + panOnScroll ? 150 : 0); + } + }; +} + +/* eslint-disable @typescript-eslint/no-explicit-any */ +function createFilter({ zoomActivationKeyPressed, zoomOnScroll, zoomOnPinch, panOnDrag, panOnScroll, zoomOnDoubleClick, userSelectionActive, noWheelClassName, noPanClassName, lib, }) { + return (event) => { + const zoomScroll = zoomActivationKeyPressed || zoomOnScroll; + const pinchZoom = zoomOnPinch && event.ctrlKey; + if (event.button === 1 && + event.type === 'mousedown' && + (isWrappedWithClass(event, `${lib}-flow__node`) || isWrappedWithClass(event, `${lib}-flow__edge`))) { + return true; + } + // if all interactions are disabled, we prevent all zoom events + if (!panOnDrag && !zoomScroll && !panOnScroll && !zoomOnDoubleClick && !zoomOnPinch) { + return false; + } + // during a selection we prevent all other interactions + if (userSelectionActive) { + return false; + } + // if the target element is inside an element with the nowheel class, we prevent zooming + if (isWrappedWithClass(event, noWheelClassName) && event.type === 'wheel') { + return false; + } + // if the target element is inside an element with the nopan class, we prevent panning + if (isWrappedWithClass(event, noPanClassName) && + (event.type !== 'wheel' || (panOnScroll && event.type === 'wheel' && !zoomActivationKeyPressed))) { + return false; + } + if (!zoomOnPinch && event.ctrlKey && event.type === 'wheel') { + return false; + } + if (!zoomOnPinch && event.type === 'touchstart' && event.touches?.length > 1) { + event.preventDefault(); // if you manage to start with 2 touches, we prevent native zoom + return false; + } + // when there is no scroll handling enabled, we prevent all wheel events + if (!zoomScroll && !panOnScroll && !pinchZoom && event.type === 'wheel') { + return false; + } + // if the pane is not movable, we prevent dragging it with mousestart or touchstart + if (!panOnDrag && (event.type === 'mousedown' || event.type === 'touchstart')) { + return false; + } + // if the pane is only movable using allowed clicks + if (Array.isArray(panOnDrag) && !panOnDrag.includes(event.button) && event.type === 'mousedown') { + return false; + } + // We only allow right clicks if pan on drag is set to right click + const buttonAllowed = (Array.isArray(panOnDrag) && panOnDrag.includes(event.button)) || !event.button || event.button <= 1; + // default filter for d3-zoom + return (!event.ctrlKey || event.type === 'wheel') && buttonAllowed; + }; +} + +function XYPanZoom({ domNode, minZoom, maxZoom, paneClickDistance, translateExtent, viewport, onPanZoom, onPanZoomStart, onPanZoomEnd, onDraggingChange, }) { + const zoomPanValues = { + isZoomingOrPanning: false, + usedRightMouseButton: false, + prevViewport: { x: 0, y: 0, zoom: 0 }, + mouseButton: 0, + timerId: undefined, + panScrollTimeout: undefined, + isPanScrolling: false, + }; + const bbox = domNode.getBoundingClientRect(); + const d3ZoomInstance = zoom() + .clickDistance(!isNumeric(paneClickDistance) || paneClickDistance < 0 ? 0 : paneClickDistance) + .scaleExtent([minZoom, maxZoom]) + .translateExtent(translateExtent); + const d3Selection = select(domNode).call(d3ZoomInstance); + setViewportConstrained({ + x: viewport.x, + y: viewport.y, + zoom: clamp(viewport.zoom, minZoom, maxZoom), + }, [ + [0, 0], + [bbox.width, bbox.height], + ], translateExtent); + const d3ZoomHandler = d3Selection.on('wheel.zoom'); + const d3DblClickZoomHandler = d3Selection.on('dblclick.zoom'); + d3ZoomInstance.wheelDelta(wheelDelta); + function setTransform(transform, options) { + if (d3Selection) { + return new Promise((resolve) => { + d3ZoomInstance?.interpolate(options?.interpolate === 'linear' ? interpolate : interpolateZoom).transform(getD3Transition(d3Selection, options?.duration, options?.ease, () => resolve(true)), transform); + }); + } + return Promise.resolve(false); + } + // public functions + function update({ noWheelClassName, noPanClassName, onPaneContextMenu, userSelectionActive, panOnScroll, panOnDrag, panOnScrollMode, panOnScrollSpeed, preventScrolling, zoomOnPinch, zoomOnScroll, zoomOnDoubleClick, zoomActivationKeyPressed, lib, onTransformChange, }) { + if (userSelectionActive && !zoomPanValues.isZoomingOrPanning) { + destroy(); + } + const isPanOnScroll = panOnScroll && !zoomActivationKeyPressed && !userSelectionActive; + const wheelHandler = isPanOnScroll + ? createPanOnScrollHandler({ + zoomPanValues, + noWheelClassName, + d3Selection, + d3Zoom: d3ZoomInstance, + panOnScrollMode, + panOnScrollSpeed, + zoomOnPinch, + onPanZoomStart, + onPanZoom, + onPanZoomEnd, + }) + : createZoomOnScrollHandler({ + noWheelClassName, + preventScrolling, + d3ZoomHandler, + }); + d3Selection.on('wheel.zoom', wheelHandler, { passive: false }); + if (!userSelectionActive) { + // pan zoom start + const startHandler = createPanZoomStartHandler({ + zoomPanValues, + onDraggingChange, + onPanZoomStart, + }); + d3ZoomInstance.on('start', startHandler); + // pan zoom + const panZoomHandler = createPanZoomHandler({ + zoomPanValues, + panOnDrag, + onPaneContextMenu: !!onPaneContextMenu, + onPanZoom, + onTransformChange, + }); + d3ZoomInstance.on('zoom', panZoomHandler); + // pan zoom end + const panZoomEndHandler = createPanZoomEndHandler({ + zoomPanValues, + panOnDrag, + panOnScroll, + onPaneContextMenu, + onPanZoomEnd, + onDraggingChange, + }); + d3ZoomInstance.on('end', panZoomEndHandler); + } + const filter = createFilter({ + zoomActivationKeyPressed, + panOnDrag, + zoomOnScroll, + panOnScroll, + zoomOnDoubleClick, + zoomOnPinch, + userSelectionActive, + noPanClassName, + noWheelClassName, + lib, + }); + d3ZoomInstance.filter(filter); + /* + * We cannot add zoomOnDoubleClick to the filter above because + * double tapping on touch screens circumvents the filter and + * dblclick.zoom is fired on the selection directly + */ + if (zoomOnDoubleClick) { + d3Selection.on('dblclick.zoom', d3DblClickZoomHandler); + } + else { + d3Selection.on('dblclick.zoom', null); + } + } + function destroy() { + d3ZoomInstance.on('zoom', null); + } + async function setViewportConstrained(viewport, extent, translateExtent) { + const nextTransform = viewportToTransform(viewport); + const contrainedTransform = d3ZoomInstance?.constrain()(nextTransform, extent, translateExtent); + if (contrainedTransform) { + await setTransform(contrainedTransform); + } + return new Promise((resolve) => resolve(contrainedTransform)); + } + async function setViewport(viewport, options) { + const nextTransform = viewportToTransform(viewport); + await setTransform(nextTransform, options); + return new Promise((resolve) => resolve(nextTransform)); + } + function syncViewport(viewport) { + if (d3Selection) { + const nextTransform = viewportToTransform(viewport); + const currentTransform = d3Selection.property('__zoom'); + if (currentTransform.k !== viewport.zoom || + currentTransform.x !== viewport.x || + currentTransform.y !== viewport.y) { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + d3ZoomInstance?.transform(d3Selection, nextTransform, null, { sync: true }); + } + } + } + function getViewport() { + const transform = d3Selection ? zoomTransform(d3Selection.node()) : { x: 0, y: 0, k: 1 }; + return { x: transform.x, y: transform.y, zoom: transform.k }; + } + function scaleTo(zoom, options) { + if (d3Selection) { + return new Promise((resolve) => { + d3ZoomInstance?.interpolate(options?.interpolate === 'linear' ? interpolate : interpolateZoom).scaleTo(getD3Transition(d3Selection, options?.duration, options?.ease, () => resolve(true)), zoom); + }); + } + return Promise.resolve(false); + } + function scaleBy(factor, options) { + if (d3Selection) { + return new Promise((resolve) => { + d3ZoomInstance?.interpolate(options?.interpolate === 'linear' ? interpolate : interpolateZoom).scaleBy(getD3Transition(d3Selection, options?.duration, options?.ease, () => resolve(true)), factor); + }); + } + return Promise.resolve(false); + } + function setScaleExtent(scaleExtent) { + d3ZoomInstance?.scaleExtent(scaleExtent); + } + function setTranslateExtent(translateExtent) { + d3ZoomInstance?.translateExtent(translateExtent); + } + function setClickDistance(distance) { + const validDistance = !isNumeric(distance) || distance < 0 ? 0 : distance; + d3ZoomInstance?.clickDistance(validDistance); + } + return { + update, + destroy, + setViewport, + setViewportConstrained, + getViewport, + scaleTo, + scaleBy, + setScaleExtent, + setTranslateExtent, + syncViewport, + setClickDistance, + }; +} + +/** + * Used to determine the variant of the resize control + * + * @public + */ +var ResizeControlVariant; +(function (ResizeControlVariant) { + ResizeControlVariant["Line"] = "line"; + ResizeControlVariant["Handle"] = "handle"; +})(ResizeControlVariant || (ResizeControlVariant = {})); +const XY_RESIZER_HANDLE_POSITIONS = ['top-left', 'top-right', 'bottom-left', 'bottom-right']; +const XY_RESIZER_LINE_POSITIONS = ['top', 'right', 'bottom', 'left']; + +/** + * Get all connecting edges for a given set of nodes + * @param width - new width of the node + * @param prevWidth - previous width of the node + * @param height - new height of the node + * @param prevHeight - previous height of the node + * @param affectsX - whether to invert the resize direction for the x axis + * @param affectsY - whether to invert the resize direction for the y axis + * @returns array of two numbers representing the direction of the resize for each axis, 0 = no change, 1 = increase, -1 = decrease + */ +function getResizeDirection({ width, prevWidth, height, prevHeight, affectsX, affectsY, }) { + const deltaWidth = width - prevWidth; + const deltaHeight = height - prevHeight; + const direction = [deltaWidth > 0 ? 1 : deltaWidth < 0 ? -1 : 0, deltaHeight > 0 ? 1 : deltaHeight < 0 ? -1 : 0]; + if (deltaWidth && affectsX) { + direction[0] = direction[0] * -1; + } + if (deltaHeight && affectsY) { + direction[1] = direction[1] * -1; + } + return direction; +} +/** + * Parses the control position that is being dragged to dimensions that are being resized + * @param controlPosition - position of the control that is being dragged + * @returns isHorizontal, isVertical, affectsX, affectsY, + */ +function getControlDirection(controlPosition) { + const isHorizontal = controlPosition.includes('right') || controlPosition.includes('left'); + const isVertical = controlPosition.includes('bottom') || controlPosition.includes('top'); + const affectsX = controlPosition.includes('left'); + const affectsY = controlPosition.includes('top'); + return { + isHorizontal, + isVertical, + affectsX, + affectsY, + }; +} +function getLowerExtentClamp(lowerExtent, lowerBound) { + return Math.max(0, lowerBound - lowerExtent); +} +function getUpperExtentClamp(upperExtent, upperBound) { + return Math.max(0, upperExtent - upperBound); +} +function getSizeClamp(size, minSize, maxSize) { + return Math.max(0, minSize - size, size - maxSize); +} +function xor(a, b) { + return a ? !b : b; +} +/** + * Calculates new width & height and x & y of node after resize based on pointer position + * @description - Buckle up, this is a chunky one... If you want to determine the new dimensions of a node after a resize, + * you have to account for all possible restrictions: min/max width/height of the node, the maximum extent the node is allowed + * to move in (in this case: resize into) determined by the parent node, the minimal extent determined by child nodes + * with expandParent or extent: 'parent' set and oh yeah, these things also have to work with keepAspectRatio! + * The way this is done is by determining how much each of these restricting actually restricts the resize and then applying the + * strongest restriction. Because the resize affects x, y and width, height and width, height of a opposing side with keepAspectRatio, + * the resize amount is always kept in distX & distY amount (the distance in mouse movement) + * Instead of clamping each value, we first calculate the biggest 'clamp' (for the lack of a better name) and then apply it to all values. + * To complicate things nodeOrigin has to be taken into account as well. This is done by offsetting the nodes as if their origin is [0, 0], + * then calculating the restrictions as usual + * @param startValues - starting values of resize + * @param controlDirection - dimensions affected by the resize + * @param pointerPosition - the current pointer position corrected for snapping + * @param boundaries - minimum and maximum dimensions of the node + * @param keepAspectRatio - prevent changes of asprect ratio + * @returns x, y, width and height of the node after resize + */ +function getDimensionsAfterResize(startValues, controlDirection, pointerPosition, boundaries, keepAspectRatio, nodeOrigin, extent, childExtent) { + let { affectsX, affectsY } = controlDirection; + const { isHorizontal, isVertical } = controlDirection; + const isDiagonal = isHorizontal && isVertical; + const { xSnapped, ySnapped } = pointerPosition; + const { minWidth, maxWidth, minHeight, maxHeight } = boundaries; + const { x: startX, y: startY, width: startWidth, height: startHeight, aspectRatio } = startValues; + let distX = Math.floor(isHorizontal ? xSnapped - startValues.pointerX : 0); + let distY = Math.floor(isVertical ? ySnapped - startValues.pointerY : 0); + const newWidth = startWidth + (affectsX ? -distX : distX); + const newHeight = startHeight + (affectsY ? -distY : distY); + const originOffsetX = -nodeOrigin[0] * startWidth; + const originOffsetY = -nodeOrigin[1] * startHeight; + // Check if maxWidth, minWWidth, maxHeight, minHeight are restricting the resize + let clampX = getSizeClamp(newWidth, minWidth, maxWidth); + let clampY = getSizeClamp(newHeight, minHeight, maxHeight); + // Check if extent is restricting the resize + if (extent) { + let xExtentClamp = 0; + let yExtentClamp = 0; + if (affectsX && distX < 0) { + xExtentClamp = getLowerExtentClamp(startX + distX + originOffsetX, extent[0][0]); + } + else if (!affectsX && distX > 0) { + xExtentClamp = getUpperExtentClamp(startX + newWidth + originOffsetX, extent[1][0]); + } + if (affectsY && distY < 0) { + yExtentClamp = getLowerExtentClamp(startY + distY + originOffsetY, extent[0][1]); + } + else if (!affectsY && distY > 0) { + yExtentClamp = getUpperExtentClamp(startY + newHeight + originOffsetY, extent[1][1]); + } + clampX = Math.max(clampX, xExtentClamp); + clampY = Math.max(clampY, yExtentClamp); + } + // Check if the child extent is restricting the resize + if (childExtent) { + let xExtentClamp = 0; + let yExtentClamp = 0; + if (affectsX && distX > 0) { + xExtentClamp = getUpperExtentClamp(startX + distX, childExtent[0][0]); + } + else if (!affectsX && distX < 0) { + xExtentClamp = getLowerExtentClamp(startX + newWidth, childExtent[1][0]); + } + if (affectsY && distY > 0) { + yExtentClamp = getUpperExtentClamp(startY + distY, childExtent[0][1]); + } + else if (!affectsY && distY < 0) { + yExtentClamp = getLowerExtentClamp(startY + newHeight, childExtent[1][1]); + } + clampX = Math.max(clampX, xExtentClamp); + clampY = Math.max(clampY, yExtentClamp); + } + // Check if the aspect ratio resizing of the other side is restricting the resize + if (keepAspectRatio) { + if (isHorizontal) { + // Check if the max dimensions might be restricting the resize + const aspectHeightClamp = getSizeClamp(newWidth / aspectRatio, minHeight, maxHeight) * aspectRatio; + clampX = Math.max(clampX, aspectHeightClamp); + // Check if the extent is restricting the resize + if (extent) { + let aspectExtentClamp = 0; + if ((!affectsX && !affectsY) || (affectsX && !affectsY && isDiagonal)) { + aspectExtentClamp = + getUpperExtentClamp(startY + originOffsetY + newWidth / aspectRatio, extent[1][1]) * aspectRatio; + } + else { + aspectExtentClamp = + getLowerExtentClamp(startY + originOffsetY + (affectsX ? distX : -distX) / aspectRatio, extent[0][1]) * + aspectRatio; + } + clampX = Math.max(clampX, aspectExtentClamp); + } + // Check if the child extent is restricting the resize + if (childExtent) { + let aspectExtentClamp = 0; + if ((!affectsX && !affectsY) || (affectsX && !affectsY && isDiagonal)) { + aspectExtentClamp = getLowerExtentClamp(startY + newWidth / aspectRatio, childExtent[1][1]) * aspectRatio; + } + else { + aspectExtentClamp = + getUpperExtentClamp(startY + (affectsX ? distX : -distX) / aspectRatio, childExtent[0][1]) * aspectRatio; + } + clampX = Math.max(clampX, aspectExtentClamp); + } + } + // Do the same thing for vertical resizing + if (isVertical) { + const aspectWidthClamp = getSizeClamp(newHeight * aspectRatio, minWidth, maxWidth) / aspectRatio; + clampY = Math.max(clampY, aspectWidthClamp); + if (extent) { + let aspectExtentClamp = 0; + if ((!affectsX && !affectsY) || (affectsY && !affectsX && isDiagonal)) { + aspectExtentClamp = + getUpperExtentClamp(startX + newHeight * aspectRatio + originOffsetX, extent[1][0]) / aspectRatio; + } + else { + aspectExtentClamp = + getLowerExtentClamp(startX + (affectsY ? distY : -distY) * aspectRatio + originOffsetX, extent[0][0]) / + aspectRatio; + } + clampY = Math.max(clampY, aspectExtentClamp); + } + if (childExtent) { + let aspectExtentClamp = 0; + if ((!affectsX && !affectsY) || (affectsY && !affectsX && isDiagonal)) { + aspectExtentClamp = getLowerExtentClamp(startX + newHeight * aspectRatio, childExtent[1][0]) / aspectRatio; + } + else { + aspectExtentClamp = + getUpperExtentClamp(startX + (affectsY ? distY : -distY) * aspectRatio, childExtent[0][0]) / aspectRatio; + } + clampY = Math.max(clampY, aspectExtentClamp); + } + } + } + distY = distY + (distY < 0 ? clampY : -clampY); + distX = distX + (distX < 0 ? clampX : -clampX); + if (keepAspectRatio) { + if (isDiagonal) { + if (newWidth > newHeight * aspectRatio) { + distY = (xor(affectsX, affectsY) ? -distX : distX) / aspectRatio; + } + else { + distX = (xor(affectsX, affectsY) ? -distY : distY) * aspectRatio; + } + } + else { + if (isHorizontal) { + distY = distX / aspectRatio; + affectsY = affectsX; + } + else { + distX = distY * aspectRatio; + affectsX = affectsY; + } + } + } + const x = affectsX ? startX + distX : startX; + const y = affectsY ? startY + distY : startY; + return { + width: startWidth + (affectsX ? -distX : distX), + height: startHeight + (affectsY ? -distY : distY), + x: nodeOrigin[0] * distX * (!affectsX ? 1 : -1) + x, + y: nodeOrigin[1] * distY * (!affectsY ? 1 : -1) + y, + }; +} + +const initPrevValues = { width: 0, height: 0, x: 0, y: 0 }; +const initStartValues = { + ...initPrevValues, + pointerX: 0, + pointerY: 0, + aspectRatio: 1, +}; +function nodeToParentExtent(node) { + return [ + [0, 0], + [node.measured.width, node.measured.height], + ]; +} +function nodeToChildExtent(child, parent, nodeOrigin) { + const x = parent.position.x + child.position.x; + const y = parent.position.y + child.position.y; + const width = child.measured.width ?? 0; + const height = child.measured.height ?? 0; + const originOffsetX = nodeOrigin[0] * width; + const originOffsetY = nodeOrigin[1] * height; + return [ + [x - originOffsetX, y - originOffsetY], + [x + width - originOffsetX, y + height - originOffsetY], + ]; +} +function XYResizer({ domNode, nodeId, getStoreItems, onChange, onEnd }) { + const selection = select(domNode); + function update({ controlPosition, boundaries, keepAspectRatio, resizeDirection, onResizeStart, onResize, onResizeEnd, shouldResize, }) { + let prevValues = { ...initPrevValues }; + let startValues = { ...initStartValues }; + const controlDirection = getControlDirection(controlPosition); + let node = undefined; + let containerBounds = null; + let childNodes = []; + let parentNode = undefined; // Needed to fix expandParent + let parentExtent = undefined; + let childExtent = undefined; + const dragHandler = drag() + .on('start', (event) => { + const { nodeLookup, transform, snapGrid, snapToGrid, nodeOrigin, paneDomNode } = getStoreItems(); + node = nodeLookup.get(nodeId); + if (!node) { + return; + } + containerBounds = paneDomNode?.getBoundingClientRect() ?? null; + const { xSnapped, ySnapped } = getPointerPosition(event.sourceEvent, { + transform, + snapGrid, + snapToGrid, + containerBounds, + }); + prevValues = { + width: node.measured.width ?? 0, + height: node.measured.height ?? 0, + x: node.position.x ?? 0, + y: node.position.y ?? 0, + }; + startValues = { + ...prevValues, + pointerX: xSnapped, + pointerY: ySnapped, + aspectRatio: prevValues.width / prevValues.height, + }; + parentNode = undefined; + if (node.parentId && (node.extent === 'parent' || node.expandParent)) { + parentNode = nodeLookup.get(node.parentId); + parentExtent = parentNode && node.extent === 'parent' ? nodeToParentExtent(parentNode) : undefined; + } + /* + * Collect all child nodes to correct their relative positions when top/left changes + * Determine largest minimal extent the parent node is allowed to resize to + */ + childNodes = []; + childExtent = undefined; + for (const [childId, child] of nodeLookup) { + if (child.parentId === nodeId) { + childNodes.push({ + id: childId, + position: { ...child.position }, + extent: child.extent, + }); + if (child.extent === 'parent' || child.expandParent) { + const extent = nodeToChildExtent(child, node, child.origin ?? nodeOrigin); + if (childExtent) { + childExtent = [ + [Math.min(extent[0][0], childExtent[0][0]), Math.min(extent[0][1], childExtent[0][1])], + [Math.max(extent[1][0], childExtent[1][0]), Math.max(extent[1][1], childExtent[1][1])], + ]; + } + else { + childExtent = extent; + } + } + } + } + onResizeStart?.(event, { ...prevValues }); + }) + .on('drag', (event) => { + const { transform, snapGrid, snapToGrid, nodeOrigin: storeNodeOrigin } = getStoreItems(); + const pointerPosition = getPointerPosition(event.sourceEvent, { + transform, + snapGrid, + snapToGrid, + containerBounds, + }); + const childChanges = []; + if (!node) { + return; + } + const { x: prevX, y: prevY, width: prevWidth, height: prevHeight } = prevValues; + const change = {}; + const nodeOrigin = node.origin ?? storeNodeOrigin; + const { width, height, x, y } = getDimensionsAfterResize(startValues, controlDirection, pointerPosition, boundaries, keepAspectRatio, nodeOrigin, parentExtent, childExtent); + const isWidthChange = width !== prevWidth; + const isHeightChange = height !== prevHeight; + const isXPosChange = x !== prevX && isWidthChange; + const isYPosChange = y !== prevY && isHeightChange; + if (!isXPosChange && !isYPosChange && !isWidthChange && !isHeightChange) { + return; + } + if (isXPosChange || isYPosChange || nodeOrigin[0] === 1 || nodeOrigin[1] === 1) { + change.x = isXPosChange ? x : prevValues.x; + change.y = isYPosChange ? y : prevValues.y; + prevValues.x = change.x; + prevValues.y = change.y; + /* + * when top/left changes, correct the relative positions of child nodes + * so that they stay in the same position + */ + if (childNodes.length > 0) { + const xChange = x - prevX; + const yChange = y - prevY; + for (const childNode of childNodes) { + childNode.position = { + x: childNode.position.x - xChange + nodeOrigin[0] * (width - prevWidth), + y: childNode.position.y - yChange + nodeOrigin[1] * (height - prevHeight), + }; + childChanges.push(childNode); + } + } + } + if (isWidthChange || isHeightChange) { + change.width = + isWidthChange && (!resizeDirection || resizeDirection === 'horizontal') ? width : prevValues.width; + change.height = + isHeightChange && (!resizeDirection || resizeDirection === 'vertical') ? height : prevValues.height; + prevValues.width = change.width; + prevValues.height = change.height; + } + // Fix expandParent when resizing from top/left + if (parentNode && node.expandParent) { + const xLimit = nodeOrigin[0] * (change.width ?? 0); + if (change.x && change.x < xLimit) { + prevValues.x = xLimit; + startValues.x = startValues.x - (change.x - xLimit); + } + const yLimit = nodeOrigin[1] * (change.height ?? 0); + if (change.y && change.y < yLimit) { + prevValues.y = yLimit; + startValues.y = startValues.y - (change.y - yLimit); + } + } + const direction = getResizeDirection({ + width: prevValues.width, + prevWidth, + height: prevValues.height, + prevHeight, + affectsX: controlDirection.affectsX, + affectsY: controlDirection.affectsY, + }); + const nextValues = { ...prevValues, direction }; + const callResize = shouldResize?.(event, nextValues); + if (callResize === false) { + return; + } + onResize?.(event, nextValues); + onChange(change, childChanges); + }) + .on('end', (event) => { + onResizeEnd?.(event, { ...prevValues }); + onEnd?.({ ...prevValues }); + }); + selection.call(dragHandler); + } + function destroy() { + selection.on('.drag', null); + } + return { + update, + destroy, + }; +} + +export { ConnectionLineType, ConnectionMode, MarkerType, PanOnScrollMode, Position, ResizeControlVariant, SelectionMode, XYDrag, XYHandle, XYMinimap, XYPanZoom, XYResizer, XY_RESIZER_HANDLE_POSITIONS, XY_RESIZER_LINE_POSITIONS, addEdge, adoptUserNodes, areConnectionMapsEqual, areSetsEqual, boxToRect, calcAutoPan, calculateNodePosition, clamp, clampPosition, clampPositionToParent, createMarkerIds, defaultAriaLabelConfig, devWarn, elementSelectionKeys, errorMessages, evaluateAbsolutePosition, fitViewport, getBezierEdgeCenter, getBezierPath, getBoundsOfBoxes, getBoundsOfRects, getConnectedEdges, getConnectionStatus, getDimensions, getEdgeCenter, getEdgePosition, getElementsToRemove, getElevatedEdgeZIndex, getEventPosition, getHandleBounds, getHandlePosition, getHostForElement, getIncomers, getInternalNodesBounds, getMarkerId, getNodeDimensions, getNodePositionWithOrigin, getNodeToolbarTransform, getNodesBounds, getNodesInside, getOutgoers, getOverlappingArea, getPointerPosition, getSmoothStepPath, getStraightPath, getViewportForBounds, handleConnectionChange, handleExpandParent, infiniteExtent, initialConnection, isCoordinateExtent, isEdgeBase, isEdgeVisible, isInputDOMNode, isInternalNodeBase, isMacOs, isMouseEvent, isNodeBase, isNumeric, isRectObject, mergeAriaLabelConfig, nodeHasDimensions, nodeToBox, nodeToRect, oppositePosition, panBy, pointToRendererPoint, reconnectEdge, rectToBox, rendererPointToPoint, shallowNodeData, snapPosition, updateAbsolutePositions, updateConnectionLookup, updateNodeInternals, withResolvers }; diff --git a/node_modules/@xyflow/system/dist/esm/types/changes.d.ts b/node_modules/@xyflow/system/dist/esm/types/changes.d.ts new file mode 100644 index 0000000..2a81cda --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/types/changes.d.ts @@ -0,0 +1,64 @@ +import type { XYPosition, Dimensions, NodeBase, EdgeBase } from '.'; +export type NodeDimensionChange = { + id: string; + type: 'dimensions'; + dimensions?: Dimensions; + resizing?: boolean; + setAttributes?: boolean | 'width' | 'height'; +}; +export type NodePositionChange = { + id: string; + type: 'position'; + position?: XYPosition; + positionAbsolute?: XYPosition; + dragging?: boolean; +}; +export type NodeSelectionChange = { + id: string; + type: 'select'; + selected: boolean; +}; +export type NodeRemoveChange = { + id: string; + type: 'remove'; +}; +export type NodeAddChange = { + item: NodeType; + type: 'add'; + index?: number; +}; +export type NodeReplaceChange = { + id: string; + item: NodeType; + type: 'replace'; +}; +/** + * The [`onNodesChange`](/api-reference/react-flow#on-nodes-change) callback takes + *an array of `NodeChange` objects that you should use to update your flow's state. + *The `NodeChange` type is a union of six different object types that represent that + *various ways an node can change in a flow. + * @public + */ +export type NodeChange = NodeDimensionChange | NodePositionChange | NodeSelectionChange | NodeRemoveChange | NodeAddChange | NodeReplaceChange; +export type EdgeSelectionChange = NodeSelectionChange; +export type EdgeRemoveChange = NodeRemoveChange; +export type EdgeAddChange = { + item: EdgeType; + type: 'add'; + index?: number; +}; +export type EdgeReplaceChange = { + id: string; + item: EdgeType; + type: 'replace'; +}; +/** + * The [`onEdgesChange`](/api-reference/react-flow#on-edges-change) callback takes + *an array of `EdgeChange` objects that you should use to update your flow's state. + *The `EdgeChange` type is a union of four different object types that represent that + *various ways an edge can change in a flow. + * + * @public + */ +export type EdgeChange = EdgeSelectionChange | EdgeRemoveChange | EdgeAddChange | EdgeReplaceChange; +//# sourceMappingURL=changes.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/types/changes.d.ts.map b/node_modules/@xyflow/system/dist/esm/types/changes.d.ts.map new file mode 100644 index 0000000..cdded21 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/types/changes.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"changes.d.ts","sourceRoot":"","sources":["../../src/types/changes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC;AAEpE,MAAM,MAAM,mBAAmB,GAAG;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,YAAY,CAAC;IACnB,UAAU,CAAC,EAAE,UAAU,CAAC;IAExB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,aAAa,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC;CAC9C,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB,gBAAgB,CAAC,EAAE,UAAU,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,aAAa,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAAI;IAChE,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,KAAK,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAAI;IACpE,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IACvD,mBAAmB,GACnB,kBAAkB,GAClB,mBAAmB,GACnB,gBAAgB,GAChB,aAAa,CAAC,QAAQ,CAAC,GACvB,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AAEhC,MAAM,MAAM,mBAAmB,GAAG,mBAAmB,CAAC;AACtD,MAAM,MAAM,gBAAgB,GAAG,gBAAgB,CAAC;AAChD,MAAM,MAAM,aAAa,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAAI;IAChE,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,KAAK,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAAI;IACpE,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,UAAU,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IACvD,mBAAmB,GACnB,gBAAgB,GAChB,aAAa,CAAC,QAAQ,CAAC,GACvB,iBAAiB,CAAC,QAAQ,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/types/edges.d.ts b/node_modules/@xyflow/system/dist/esm/types/edges.d.ts new file mode 100644 index 0000000..b398198 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/types/edges.d.ts @@ -0,0 +1,113 @@ +import { Position } from './utils'; +export type EdgeBase = Record, EdgeType extends string | undefined = string | undefined> = { + /** Unique id of an edge. */ + id: string; + /** Type of edge defined in `edgeTypes`. */ + type?: EdgeType; + /** Id of source node. */ + source: string; + /** Id of target node. */ + target: string; + /** Id of source handle, only needed if there are multiple handles per node. */ + sourceHandle?: string | null; + /** Id of target handle, only needed if there are multiple handles per node. */ + targetHandle?: string | null; + animated?: boolean; + hidden?: boolean; + deletable?: boolean; + selectable?: boolean; + /** Arbitrary data passed to an edge. */ + data?: EdgeData; + selected?: boolean; + /** + * Set the marker on the beginning of an edge. + * @example 'arrow', 'arrowclosed' or custom marker + */ + markerStart?: EdgeMarkerType; + /** + * Set the marker on the end of an edge. + * @example 'arrow', 'arrowclosed' or custom marker + */ + markerEnd?: EdgeMarkerType; + zIndex?: number; + ariaLabel?: string; + /** + * ReactFlow renders an invisible path around each edge to make them easier to click or tap on. + * This property sets the width of that invisible path. + */ + interactionWidth?: number; +}; +export type SmoothStepPathOptions = { + offset?: number; + borderRadius?: number; +}; +export type StepPathOptions = { + offset?: number; +}; +export type BezierPathOptions = { + curvature?: number; +}; +/** + * @inline + */ +export type DefaultEdgeOptionsBase = Omit; +/** + * If you set the `connectionLineType` prop on your [``](/api-reference/react-flow#connection-connectionLineType) + *component, it will dictate the style of connection line rendered when creating + *new edges. + * + * @public + * + * @remarks If you choose to render a custom connection line component, this value will be + *passed to your component as part of its [`ConnectionLineComponentProps`](/api-reference/types/connection-line-component-props). + */ +export declare enum ConnectionLineType { + Bezier = "default", + Straight = "straight", + Step = "step", + SmoothStep = "smoothstep", + SimpleBezier = "simplebezier" +} +/** + * Edges can optionally have markers at the start and end of an edge. The `EdgeMarker` + *type is used to configure those markers! Check the docs for [`MarkerType`](/api-reference/types/marker-type) + *for details on what types of edge marker are available. + * + * @public + */ +export type EdgeMarker = { + type: MarkerType; + color?: string; + width?: number; + height?: number; + markerUnits?: string; + orient?: string; + strokeWidth?: number; +}; +export type EdgeMarkerType = string | EdgeMarker; +/** + * Edges may optionally have a marker on either end. The MarkerType type enumerates + * the options available to you when configuring a given marker. + * + * @public + */ +export declare enum MarkerType { + Arrow = "arrow", + ArrowClosed = "arrowclosed" +} +export type MarkerProps = EdgeMarker & { + id: string; +}; +/** + * @inline + */ +export type EdgePosition = { + sourceX: number; + sourceY: number; + targetX: number; + targetY: number; + sourcePosition: Position; + targetPosition: Position; +}; +export type EdgeLookup = Map; +//# sourceMappingURL=edges.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/types/edges.d.ts.map b/node_modules/@xyflow/system/dist/esm/types/edges.d.ts.map new file mode 100644 index 0000000..e466846 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/types/edges.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"edges.d.ts","sourceRoot":"","sources":["../../src/types/edges.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,MAAM,MAAM,QAAQ,CAClB,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClE,QAAQ,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,IACtD;IACF,4BAA4B;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,2CAA2C;IAC3C,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,yBAAyB;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,yBAAyB;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,+EAA+E;IAC/E,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,+EAA+E;IAC/E,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,wCAAwC;IACxC,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sBAAsB,CAAC,QAAQ,SAAS,QAAQ,IAAI,IAAI,CAClE,QAAQ,EACR,IAAI,GAAG,QAAQ,GAAG,QAAQ,GAAG,cAAc,GAAG,cAAc,GAAG,UAAU,CAC1E,CAAC;AAEF;;;;;;;;;GASG;AACH,oBAAY,kBAAkB;IAC5B,MAAM,YAAY;IAClB,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,UAAU,eAAe;IACzB,YAAY,iBAAiB;CAC9B;AAED;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,UAAU,CAAC;AAEjD;;;;;GAKG;AACH,oBAAY,UAAU;IACpB,KAAK,UAAU;IACf,WAAW,gBAAgB;CAC5B;AAED,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG;IACrC,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,QAAQ,CAAC;IACzB,cAAc,EAAE,QAAQ,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,UAAU,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAAI,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/types/general.d.ts b/node_modules/@xyflow/system/dist/esm/types/general.d.ts new file mode 100644 index 0000000..8727417 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/types/general.d.ts @@ -0,0 +1,241 @@ +import type { Selection as D3Selection } from 'd3-selection'; +import type { D3DragEvent, SubjectPosition } from 'd3-drag'; +import type { ZoomBehavior } from 'd3-zoom'; +import type { XYPosition, Rect, Position } from './utils'; +import type { InternalNodeBase, NodeBase, NodeDragItem } from './nodes'; +import type { Handle, HandleType } from './handles'; +import { PanZoomInstance } from './panzoom'; +import { EdgeBase } from '..'; +export type Project = (position: XYPosition) => XYPosition; +export type OnMove = (event: MouseEvent | TouchEvent | null, viewport: Viewport) => void; +export type OnMoveStart = OnMove; +export type OnMoveEnd = OnMove; +export type ZoomInOut = (options?: ViewportHelperFunctionOptions) => Promise; +export type ZoomTo = (zoomLevel: number, options?: ViewportHelperFunctionOptions) => Promise; +export type GetZoom = () => number; +export type GetViewport = () => Viewport; +export type SetViewport = (viewport: Viewport, options?: ViewportHelperFunctionOptions) => Promise; +export type SetCenter = (x: number, y: number, options?: SetCenterOptions) => Promise; +export type FitBounds = (bounds: Rect, options?: FitBoundsOptions) => Promise; +/** + * The `Connection` type is the basic minimal description of an [`Edge`](/api-reference/types/edge) + * between two nodes. The [`addEdge`](/api-reference/utils/add-edge) util can be used to upgrade + * a `Connection` to an [`Edge`](/api-reference/types/edge). + * + * @public + */ +export type Connection = { + /** The id of the node this connection originates from. */ + source: string; + /** The id of the node this connection terminates at. */ + target: string; + /** When not `null`, the id of the handle on the source node that this connection originates from. */ + sourceHandle: string | null; + /** When not `null`, the id of the handle on the target node that this connection terminates at. */ + targetHandle: string | null; +}; +/** + * The `HandleConnection` type is an extension of a basic [Connection](/api-reference/types/connection) that includes the `edgeId`. + */ +export type HandleConnection = Connection & { + edgeId: string; +}; +/** + * The `NodeConnection` type is an extension of a basic [Connection](/api-reference/types/connection) that includes the `edgeId`. + * + */ +export type NodeConnection = Connection & { + edgeId: string; +}; +/** + * The `ConnectionMode` is used to set the mode of connection between nodes. + * The `Strict` mode is the default one and only allows source to target edges. + * `Loose` mode allows source to source and target to target edges as well. + * + * @public + */ +export declare enum ConnectionMode { + Strict = "strict", + Loose = "loose" +} +export type OnConnectStartParams = { + nodeId: string | null; + handleId: string | null; + handleType: HandleType | null; +}; +export type OnConnectStart = (event: MouseEvent | TouchEvent, params: OnConnectStartParams) => void; +export type OnConnect = (connection: Connection) => void; +export type OnConnectEnd = (event: MouseEvent | TouchEvent, connectionState: FinalConnectionState) => void; +export type OnReconnect = (oldEdge: EdgeType, newConnection: Connection) => void; +export type OnReconnectStart = (event: MouseEvent | TouchEvent, edge: EdgeType, handleType: HandleType) => void; +export type OnReconnectEnd = (event: MouseEvent | TouchEvent, edge: EdgeType, handleType: HandleType, connectionState: FinalConnectionState) => void; +export type IsValidConnection = (edge: EdgeBase | Connection) => boolean; +/** + * @inline + */ +export type FitViewParamsBase = { + nodes: Map>; + width: number; + height: number; + panZoom: PanZoomInstance; + minZoom: number; + maxZoom: number; +}; +export type PaddingUnit = 'px' | '%'; +export type PaddingWithUnit = `${number}${PaddingUnit}` | number; +export type Padding = PaddingWithUnit | { + top?: PaddingWithUnit; + right?: PaddingWithUnit; + bottom?: PaddingWithUnit; + left?: PaddingWithUnit; + x?: PaddingWithUnit; + y?: PaddingWithUnit; +}; +/** + * @inline + */ +export type FitViewOptionsBase = { + padding?: Padding; + includeHiddenNodes?: boolean; + minZoom?: number; + maxZoom?: number; + duration?: number; + ease?: (t: number) => number; + interpolate?: 'smooth' | 'linear'; + nodes?: (NodeType | { + id: string; + })[]; +}; +/** + * Internally, React Flow maintains a coordinate system that is independent of the + * rest of the page. The `Viewport` type tells you where in that system your flow + * is currently being display at and how zoomed in or out it is. + * + * @public + * @remarks A `Transform` has the same properties as the viewport, but they represent + * different things. Make sure you don't get them muddled up or things will start + * to look weird! + * + */ +export type Viewport = { + x: number; + y: number; + zoom: number; +}; +export type KeyCode = string | Array; +export type SnapGrid = [number, number]; +/** + * This enum is used to set the different modes of panning the viewport when the + * user scrolls. The `Free` mode allows the user to pan in any direction by scrolling + * with a device like a trackpad. The `Vertical` and `Horizontal` modes restrict + * scroll panning to only the vertical or horizontal axis, respectively. + * + * @public + */ +export declare enum PanOnScrollMode { + Free = "free", + Vertical = "vertical", + Horizontal = "horizontal" +} +/** + * @inline + */ +export type ViewportHelperFunctionOptions = { + duration?: number; + ease?: (t: number) => number; + interpolate?: 'smooth' | 'linear'; +}; +export type SetCenterOptions = ViewportHelperFunctionOptions & { + zoom?: number; +}; +export type FitBoundsOptions = ViewportHelperFunctionOptions & { + padding?: number; +}; +export type OnViewportChange = (viewport: Viewport) => void; +export type D3ZoomInstance = ZoomBehavior; +export type D3SelectionInstance = D3Selection; +export type D3ZoomHandler = (this: Element, event: any, d: unknown) => void; +export type UpdateNodeInternals = (nodeId: string | string[]) => void; +/** + * This type is mostly used to help position things on top of the flow viewport. For + * example both the [``](/api-reference/components/minimap) and + * [``](/api-reference/components/controls) components take a `position` + * prop of this type. + * + * @public + */ +export type PanelPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' | 'center-left' | 'center-right'; +export type ProOptions = { + account?: string; + hideAttribution: boolean; +}; +export type UseDragEvent = D3DragEvent; +export declare enum SelectionMode { + Partial = "partial", + Full = "full" +} +export type SelectionRect = Rect & { + startX: number; + startY: number; +}; +export type OnError = (id: string, message: string) => void; +export type UpdateNodePositions = (dragItems: Map, dragging?: boolean) => void; +export type PanBy = (delta: XYPosition) => Promise; +export declare const initialConnection: NoConnection; +export type NoConnection = { + inProgress: false; + isValid: null; + from: null; + fromHandle: null; + fromPosition: null; + fromNode: null; + to: null; + toHandle: null; + toPosition: null; + toNode: null; +}; +export type ConnectionInProgress = { + /** Indicates whether a connection is currently in progress. */ + inProgress: true; + /** + * If an ongoing connection is above a handle or inside the connection radius, this will be `true` + * or `false`, otherwise `null`. + */ + isValid: boolean | null; + /** Returns the xy start position or `null` if no connection is in progress. */ + from: XYPosition; + /** Returns the start handle or `null` if no connection is in progress. */ + fromHandle: Handle; + /** Returns the side (called position) of the start handle or `null` if no connection is in progress. */ + fromPosition: Position; + /** Returns the start node or `null` if no connection is in progress. */ + fromNode: NodeType; + /** Returns the xy end position or `null` if no connection is in progress. */ + to: XYPosition; + /** Returns the end handle or `null` if no connection is in progress. */ + toHandle: Handle | null; + /** Returns the side (called position) of the end handle or `null` if no connection is in progress. */ + toPosition: Position; + /** Returns the end node or `null` if no connection is in progress. */ + toNode: NodeType | null; +}; +/** + * The `ConnectionState` type bundles all information about an ongoing connection. + * It is returned by the [`useConnection`](/api-reference/hooks/use-connection) hook. + * + * @public + */ +export type ConnectionState = ConnectionInProgress | NoConnection; +export type FinalConnectionState = Omit, 'inProgress'>; +export type UpdateConnection = (params: ConnectionState) => void; +export type ColorModeClass = 'light' | 'dark'; +export type ColorMode = ColorModeClass | 'system'; +export type ConnectionLookup = Map>; +export type OnBeforeDeleteBase = ({ nodes, edges, }: { + nodes: NodeType[]; + edges: EdgeType[]; +}) => Promise; +//# sourceMappingURL=general.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/types/general.d.ts.map b/node_modules/@xyflow/system/dist/esm/types/general.d.ts.map new file mode 100644 index 0000000..955b98d --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/types/general.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../src/types/general.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI5C,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACxE,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAE9B,MAAM,MAAM,OAAO,GAAG,CAAC,QAAQ,EAAE,UAAU,KAAK,UAAU,CAAC;AAE3D,MAAM,MAAM,MAAM,GAAG,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI,EAAE,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;AACzF,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AACjC,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,CAAC,EAAE,6BAA6B,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AACtF,MAAM,MAAM,MAAM,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,6BAA6B,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AACtG,MAAM,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC;AACnC,MAAM,MAAM,WAAW,GAAG,MAAM,QAAQ,CAAC;AACzC,MAAM,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,6BAA6B,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAC5G,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAC/F,MAAM,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,gBAAgB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAEvF;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,0DAA0D;IAC1D,MAAM,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,MAAM,EAAE,MAAM,CAAC;IACf,qGAAqG;IACrG,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,mGAAmG;IACnG,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG;IAC1C,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG;IACxC,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;;;GAMG;AACH,oBAAY,cAAc;IACxB,MAAM,WAAW;IACjB,KAAK,UAAU;CAChB;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,EAAE,MAAM,EAAE,oBAAoB,KAAK,IAAI,CAAC;AACpG,MAAM,MAAM,SAAS,GAAG,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;AACzD,MAAM,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,EAAE,eAAe,EAAE,oBAAoB,KAAK,IAAI,CAAC;AAE3G,MAAM,MAAM,WAAW,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,UAAU,KAAK,IAAI,CAAC;AACvH,MAAM,MAAM,gBAAgB,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAAI,CACnE,KAAK,EAAE,UAAU,GAAG,UAAU,EAC9B,IAAI,EAAE,QAAQ,EACd,UAAU,EAAE,UAAU,KACnB,IAAI,CAAC;AACV,MAAM,MAAM,cAAc,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAAI,CACjE,KAAK,EAAE,UAAU,GAAG,UAAU,EAC9B,IAAI,EAAE,QAAQ,EACd,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,oBAAoB,KAClC,IAAI,CAAC;AAEV,MAAM,MAAM,iBAAiB,GAAG,CAAC,IAAI,EAAE,QAAQ,GAAG,UAAU,KAAK,OAAO,CAAC;AAEzE;;GAEG;AACH,MAAM,MAAM,iBAAiB,CAAC,QAAQ,SAAS,QAAQ,IAAI;IACzD,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,eAAe,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,GAAG,CAAC;AACrC,MAAM,MAAM,eAAe,GAAG,GAAG,MAAM,GAAG,WAAW,EAAE,GAAG,MAAM,CAAC;AAEjE,MAAM,MAAM,OAAO,GACf,eAAe,GACf;IACE,GAAG,CAAC,EAAE,eAAe,CAAC;IACtB,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,CAAC,CAAC,EAAE,eAAe,CAAC;IACpB,CAAC,CAAC,EAAE,eAAe,CAAC;CACrB,CAAC;AAEN;;GAEG;AACH,MAAM,MAAM,kBAAkB,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAAI;IACrE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAClC,KAAK,CAAC,EAAE,CAAC,QAAQ,GAAG;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAC;CACvC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;AAE7C,MAAM,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAExC;;;;;;;GAOG;AACH,oBAAY,eAAe;IACzB,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,UAAU,eAAe;CAC1B;AAED;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,6BAA6B,GAAG;IAC7D,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,6BAA6B,GAAG;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;AAE5D,MAAM,MAAM,cAAc,GAAG,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC5D,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;AACjF,MAAM,MAAM,aAAa,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;AAE5E,MAAM,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAC;AAEtE;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GACrB,UAAU,GACV,YAAY,GACZ,WAAW,GACX,aAAa,GACb,eAAe,GACf,cAAc,GACd,aAAa,GACb,cAAc,CAAC;AAEnB,MAAM,MAAM,UAAU,GAAG;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC,cAAc,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC;AAE9E,oBAAY,aAAa;IACvB,OAAO,YAAY;IACnB,IAAI,SAAS;CACd;AAED,MAAM,MAAM,aAAa,GAAG,IAAI,GAAG;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;AAE5D,MAAM,MAAM,mBAAmB,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,GAAG,gBAAgB,CAAC,EAAE,QAAQ,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;AACxH,MAAM,MAAM,KAAK,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAE5D,eAAO,MAAM,iBAAiB,EAAE,YAW/B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,EAAE,KAAK,CAAC;IAClB,OAAO,EAAE,IAAI,CAAC;IACd,IAAI,EAAE,IAAI,CAAC;IACX,UAAU,EAAE,IAAI,CAAC;IACjB,YAAY,EAAE,IAAI,CAAC;IACnB,QAAQ,EAAE,IAAI,CAAC;IACf,EAAE,EAAE,IAAI,CAAC;IACT,QAAQ,EAAE,IAAI,CAAC;IACf,UAAU,EAAE,IAAI,CAAC;IACjB,MAAM,EAAE,IAAI,CAAC;CACd,CAAC;AACF,MAAM,MAAM,oBAAoB,CAAC,QAAQ,SAAS,gBAAgB,GAAG,gBAAgB,IAAI;IACvF,+DAA+D;IAC/D,UAAU,EAAE,IAAI,CAAC;IACjB;;;OAGG;IACH,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IACxB,+EAA+E;IAC/E,IAAI,EAAE,UAAU,CAAC;IACjB,0EAA0E;IAC1E,UAAU,EAAE,MAAM,CAAC;IACnB,wGAAwG;IACxG,YAAY,EAAE,QAAQ,CAAC;IACvB,wEAAwE;IACxE,QAAQ,EAAE,QAAQ,CAAC;IACnB,6EAA6E;IAC7E,EAAE,EAAE,UAAU,CAAC;IACf,wEAAwE;IACxE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,sGAAsG;IACtG,UAAU,EAAE,QAAQ,CAAC;IACrB,sEAAsE;IACtE,MAAM,EAAE,QAAQ,GAAG,IAAI,CAAC;CACzB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,eAAe,CAAC,QAAQ,SAAS,gBAAgB,GAAG,gBAAgB,IAC5E,oBAAoB,CAAC,QAAQ,CAAC,GAC9B,YAAY,CAAC;AAEjB,MAAM,MAAM,oBAAoB,CAAC,QAAQ,SAAS,gBAAgB,GAAG,gBAAgB,IAAI,IAAI,CAC3F,eAAe,CAAC,QAAQ,CAAC,EACzB,YAAY,CACb,CAAC;AAEF,MAAM,MAAM,gBAAgB,CAAC,QAAQ,SAAS,gBAAgB,GAAG,gBAAgB,IAAI,CACnF,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC,KAC9B,IAAI,CAAC;AAEV,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,MAAM,CAAC;AAC9C,MAAM,MAAM,SAAS,GAAG,cAAc,GAAG,QAAQ,CAAC;AAElD,MAAM,MAAM,gBAAgB,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAE1E,MAAM,MAAM,kBAAkB,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,EAAE,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAAI,CAAC,EAC5G,KAAK,EACL,KAAK,GACN,EAAE;IACD,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB,KAAK,OAAO,CAAC,OAAO,GAAG;IAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;IAAC,KAAK,EAAE,QAAQ,EAAE,CAAA;CAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/types/handles.d.ts b/node_modules/@xyflow/system/dist/esm/types/handles.d.ts new file mode 100644 index 0000000..af89fd6 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/types/handles.d.ts @@ -0,0 +1,56 @@ +import type { Position, IsValidConnection } from '.'; +export type HandleType = 'source' | 'target'; +export type Handle = { + id?: string | null; + nodeId: string; + x: number; + y: number; + position: Position; + type: HandleType; + width: number; + height: number; +}; +export type HandleProps = { + /** + * Type of the handle. + * @default "source" + * @example HandleType.Source, HandleType.Target + */ + type: HandleType; + /** + * The position of the handle relative to the node. In a horizontal flow source handles are + * typically `Position.Right` and in a vertical flow they are typically `Position.Top`. + * @default Position.Top + * @example Position.TopLeft, Position.TopRight, Position.BottomLeft, Position.BottomRight + */ + position: Position; + /** + * Should you be able to connect to/from this handle. + * @default true + */ + isConnectable?: boolean; + /** + * Dictates whether a connection can start from this handle. + * @default true + */ + isConnectableStart?: boolean; + /** + * Dictates whether a connection can end on this handle. + * @default true + */ + isConnectableEnd?: boolean; + /** + * Called when a connection is dragged to this handle. You can use this callback to perform some + * custom validation logic based on the connection target and source, for example. Where possible, + * we recommend you move this logic to the `isValidConnection` prop on the main ReactFlow + * component for performance reasons. + * @remarks connection becomes an edge if isValidConnection returns true + */ + isValidConnection?: IsValidConnection; + /** + * Id of the handle. + * @remarks optional if there is only one handle of this type + */ + id?: string | null; +}; +//# sourceMappingURL=handles.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/types/handles.d.ts.map b/node_modules/@xyflow/system/dist/esm/types/handles.d.ts.map new file mode 100644 index 0000000..fdb465b --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/types/handles.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"handles.d.ts","sourceRoot":"","sources":["../../src/types/handles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,GAAG,CAAC;AAErD,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE7C,MAAM,MAAM,MAAM,GAAG;IACnB,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB;;;;OAIG;IACH,IAAI,EAAE,UAAU,CAAC;IACjB;;;;;OAKG;IACH,QAAQ,EAAE,QAAQ,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACpB,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/types/index.d.ts b/node_modules/@xyflow/system/dist/esm/types/index.d.ts new file mode 100644 index 0000000..1a0bc5b --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/types/index.d.ts @@ -0,0 +1,8 @@ +export * from './changes'; +export * from './general'; +export * from './nodes'; +export * from './edges'; +export * from './handles'; +export * from './utils'; +export * from './panzoom'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/types/index.d.ts.map b/node_modules/@xyflow/system/dist/esm/types/index.d.ts.map new file mode 100644 index 0000000..cb2e378 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/types/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/types/nodes.d.ts b/node_modules/@xyflow/system/dist/esm/types/nodes.d.ts new file mode 100644 index 0000000..5551df9 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/types/nodes.d.ts @@ -0,0 +1,161 @@ +import type { XYPosition, Position, CoordinateExtent, Handle } from '.'; +import { Optional } from '../utils/types'; +/** + * Framework independent node data structure. + * + * @inline + * @typeParam NodeData - type of the node data + * @typeParam NodeType - type of the node + */ +export type NodeBase = Record, NodeType extends string | undefined = string | undefined> = { + /** Unique id of a node. */ + id: string; + /** + * Position of a node on the pane. + * @example { x: 0, y: 0 } + */ + position: XYPosition; + /** Arbitrary data passed to a node. */ + data: NodeData; + /** + * Only relevant for default, source, target nodeType. Controls source position. + * @example 'right', 'left', 'top', 'bottom' + */ + sourcePosition?: Position; + /** + * Only relevant for default, source, target nodeType. Controls target position. + * @example 'right', 'left', 'top', 'bottom' + */ + targetPosition?: Position; + /** Whether or not the node should be visible on the canvas. */ + hidden?: boolean; + selected?: boolean; + /** Whether or not the node is currently being dragged. */ + dragging?: boolean; + /** Whether or not the node is able to be dragged. */ + draggable?: boolean; + selectable?: boolean; + connectable?: boolean; + deletable?: boolean; + /** + * A class name that can be applied to elements inside the node that allows those elements to act + * as drag handles, letting the user drag the node by clicking and dragging on those elements. + */ + dragHandle?: string; + width?: number; + height?: number; + initialWidth?: number; + initialHeight?: number; + /** Parent node id, used for creating sub-flows. */ + parentId?: string; + zIndex?: number; + /** + * Boundary a node can be moved in. + * @example 'parent' or [[0, 0], [100, 100]] + */ + extent?: 'parent' | CoordinateExtent; + /** + * When `true`, the parent node will automatically expand if this node is dragged to the edge of + * the parent node's bounds. + */ + expandParent?: boolean; + ariaLabel?: string; + /** + * Origin of the node relative to its position. + * @example + * [0.5, 0.5] // centers the node + * [0, 0] // top left + * [1, 1] // bottom right + */ + origin?: NodeOrigin; + handles?: NodeHandle[]; + measured?: { + width?: number; + height?: number; + }; +} & (undefined extends NodeType ? { + /** Type of node defined in nodeTypes */ + type?: string | undefined; +} : { + /** Type of node defined in nodeTypes */ + type: NodeType; +}); +export type InternalNodeBase = Omit & { + measured: { + width?: number; + height?: number; + }; + internals: { + positionAbsolute: XYPosition; + z: number; + /** + * Holds a reference to the original node object provided by the user. + * Used as an optimization to avoid certain operations. + */ + userNode: NodeType; + handleBounds?: NodeHandleBounds; + bounds?: NodeBounds; + }; +}; +/** + * The node data structure that gets used for the custom nodes props. + * + * @public + */ +export type NodeProps = Pick & Required> & { + /** Whether a node is connectable or not. */ + isConnectable: boolean; + /** Position absolute x value. */ + positionAbsoluteX: number; + /** Position absolute y value. */ + positionAbsoluteY: number; +}; +export type NodeHandleBounds = { + source: Handle[] | null; + target: Handle[] | null; +}; +export type InternalNodeUpdate = { + id: string; + nodeElement: HTMLDivElement; + force?: boolean; +}; +export type NodeBounds = XYPosition & { + width: number | null; + height: number | null; +}; +export type NodeDragItem = { + id: string; + position: XYPosition; + distance: XYPosition; + measured: { + width: number; + height: number; + }; + internals: { + positionAbsolute: XYPosition; + }; + extent?: 'parent' | CoordinateExtent; + parentId?: string; + dragging?: boolean; + origin?: NodeOrigin; + expandParent?: boolean; +}; +/** + * The origin of a Node determines how it is placed relative to its own coordinates. + * `[0, 0]` places it at the top left corner, `[0.5, 0.5]` right in the center and + * `[1, 1]` at the bottom right of its position. + * + * @public + */ +export type NodeOrigin = [number, number]; +export type OnSelectionDrag = (event: MouseEvent, nodes: NodeBase[]) => void; +/** + * Type for the handles of a node + * + * @public + */ +export type NodeHandle = Omit, 'nodeId'>; +export type Align = 'center' | 'start' | 'end'; +export type NodeLookup = Map; +export type ParentLookup = Map>; +//# sourceMappingURL=nodes.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/types/nodes.d.ts.map b/node_modules/@xyflow/system/dist/esm/types/nodes.d.ts.map new file mode 100644 index 0000000..dd3ef9b --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/types/nodes.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../src/types/nodes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C;;;;;;GAMG;AACH,MAAM,MAAM,QAAQ,CAClB,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClE,QAAQ,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,IACtD;IACF,2BAA2B;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX;;;OAGG;IACH,QAAQ,EAAE,UAAU,CAAC;IACrB,uCAAuC;IACvC,IAAI,EAAE,QAAQ,CAAC;IACf;;;OAGG;IACH,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B;;;OAGG;IACH,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,+DAA+D;IAC/D,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qDAAqD;IACrD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mDAAmD;IACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,MAAM,CAAC,EAAE,QAAQ,GAAG,gBAAgB,CAAC;IACrC;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE;QACT,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;CACH,GAAG,CAAC,SAAS,SAAS,QAAQ,GAC3B;IACE,wCAAwC;IACxC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B,GACD;IACE,wCAAwC;IACxC,IAAI,EAAE,QAAQ,CAAC;CAChB,CAAC,CAAC;AAEP,MAAM,MAAM,gBAAgB,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAAI,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,GAAG;IAChG,QAAQ,EAAE;QACR,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,SAAS,EAAE;QACT,gBAAgB,EAAE,UAAU,CAAC;QAC7B,CAAC,EAAE,MAAM,CAAC;QACV;;;WAGG;QACH,QAAQ,EAAE,QAAQ,CAAC;QACnB,YAAY,CAAC,EAAE,gBAAgB,CAAC;QAChC,MAAM,CAAC,EAAE,UAAU,CAAC;KACrB,CAAC;CACH,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,SAAS,CAAC,QAAQ,SAAS,QAAQ,IAAI,IAAI,CACrD,QAAQ,EACR,IAAI,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,YAAY,GAAG,UAAU,CACrG,GACC,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,GAAG,QAAQ,GAAG,YAAY,GAAG,WAAW,GAAG,UAAU,GAAG,WAAW,CAAC,CAAC,GAAG;IACjH,4CAA4C;IAC5C,aAAa,EAAE,OAAO,CAAC;IACvB,iCAAiC;IACjC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iCAAiC;IACjC,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEJ,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,cAAc,CAAC;IAC5B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG;IACpC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,UAAU,CAAC;IAErB,QAAQ,EAAE,UAAU,CAAC;IACrB,QAAQ,EAAE;QACR,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,SAAS,EAAE;QACT,gBAAgB,EAAE,UAAU,CAAC;KAC9B,CAAC;IACF,MAAM,CAAC,EAAE,QAAQ,GAAG,gBAAgB,CAAC;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE1C,MAAM,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;AAE7E;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAC;AAE9E,MAAM,MAAM,KAAK,GAAG,QAAQ,GAAG,OAAO,GAAG,KAAK,CAAC;AAE/C,MAAM,MAAM,UAAU,CAAC,QAAQ,SAAS,gBAAgB,GAAG,gBAAgB,IAAI,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AACrG,MAAM,MAAM,YAAY,CAAC,QAAQ,SAAS,gBAAgB,GAAG,gBAAgB,IAAI,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/types/panzoom.d.ts b/node_modules/@xyflow/system/dist/esm/types/panzoom.d.ts new file mode 100644 index 0000000..ed4ee81 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/types/panzoom.d.ts @@ -0,0 +1,53 @@ +import type { ZoomTransform } from 'd3-zoom'; +import { PanOnScrollMode, type CoordinateExtent, type Transform, type Viewport } from './'; +export type OnDraggingChange = (dragging: boolean) => void; +export type OnTransformChange = (transform: Transform) => void; +export type PanZoomParams = { + domNode: Element; + minZoom: number; + maxZoom: number; + paneClickDistance: number; + viewport: Viewport; + translateExtent: CoordinateExtent; + onDraggingChange: OnDraggingChange; + onPanZoomStart?: OnPanZoom; + onPanZoom?: OnPanZoom; + onPanZoomEnd?: OnPanZoom; +}; +export type PanZoomTransformOptions = { + duration?: number; + ease?: (t: number) => number; + interpolate?: 'smooth' | 'linear'; +}; +export type OnPanZoom = (event: MouseEvent | TouchEvent | null, viewport: Viewport) => void; +export type PanZoomUpdateOptions = { + noWheelClassName: string; + noPanClassName: string; + onPaneContextMenu?: (event: MouseEvent) => void; + preventScrolling: boolean; + panOnScroll: boolean; + panOnDrag: boolean | number[]; + panOnScrollMode: PanOnScrollMode; + panOnScrollSpeed: number; + userSelectionActive: boolean; + zoomOnPinch: boolean; + zoomOnScroll: boolean; + zoomOnDoubleClick: boolean; + zoomActivationKeyPressed: boolean; + lib: string; + onTransformChange: OnTransformChange; +}; +export type PanZoomInstance = { + update: (params: PanZoomUpdateOptions) => void; + destroy: () => void; + getViewport: () => Viewport; + setViewport: (viewport: Viewport, options?: PanZoomTransformOptions) => Promise; + setViewportConstrained: (viewport: Viewport, extent: CoordinateExtent, translateExtent: CoordinateExtent) => Promise; + setScaleExtent: (scaleExtent: [number, number]) => void; + setTranslateExtent: (translateExtent: CoordinateExtent) => void; + scaleTo: (scale: number, options?: PanZoomTransformOptions) => Promise; + scaleBy: (factor: number, options?: PanZoomTransformOptions) => Promise; + syncViewport: (viewport: Viewport) => void; + setClickDistance: (distance: number) => void; +}; +//# sourceMappingURL=panzoom.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/types/panzoom.d.ts.map b/node_modules/@xyflow/system/dist/esm/types/panzoom.d.ts.map new file mode 100644 index 0000000..3b0599f --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/types/panzoom.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"panzoom.d.ts","sourceRoot":"","sources":["../../src/types/panzoom.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,OAAO,EAAE,eAAe,EAAE,KAAK,gBAAgB,EAAE,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAE,MAAM,IAAI,CAAC;AAE3F,MAAM,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;AAC3D,MAAM,MAAM,iBAAiB,GAAG,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,CAAC;AAE/D,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,QAAQ,CAAC;IACnB,eAAe,EAAE,gBAAgB,CAAC;IAClC,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,YAAY,CAAC,EAAE,SAAS,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI,EAAE,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;AAE5F,MAAM,MAAM,oBAAoB,GAAG;IACjC,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IAChD,gBAAgB,EAAE,OAAO,CAAC;IAC1B,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,GAAG,MAAM,EAAE,CAAC;IAC9B,eAAe,EAAE,eAAe,CAAC;IACjC,gBAAgB,EAAE,MAAM,CAAC;IACzB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,wBAAwB,EAAE,OAAO,CAAC;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,iBAAiB,EAAE,iBAAiB,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,CAAC,MAAM,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC/C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,EAAE,MAAM,QAAQ,CAAC;IAC5B,WAAW,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,uBAAuB,KAAK,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAAC;IAC3G,sBAAsB,EAAE,CACtB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,gBAAgB,EACxB,eAAe,EAAE,gBAAgB,KAC9B,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAAC;IACxC,cAAc,EAAE,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IACxD,kBAAkB,EAAE,CAAC,eAAe,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAChE,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,uBAAuB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAChF,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,uBAAuB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACjF,YAAY,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC3C,gBAAgB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/types/utils.d.ts b/node_modules/@xyflow/system/dist/esm/types/utils.d.ts new file mode 100644 index 0000000..dbca943 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/types/utils.d.ts @@ -0,0 +1,53 @@ +/** + * While [`PanelPosition`](/api-reference/types/panel-position) can be used to place a + * component in the corners of a container, the `Position` enum is less precise and used + * primarily in relation to edges and handles. + * + * @public + */ +export declare enum Position { + Left = "left", + Top = "top", + Right = "right", + Bottom = "bottom" +} +export declare const oppositePosition: { + left: Position; + right: Position; + top: Position; + bottom: Position; +}; +/** + * All positions are stored in an object with x and y coordinates. + * + * @public + */ +export type XYPosition = { + x: number; + y: number; +}; +export type XYZPosition = XYPosition & { + z: number; +}; +export type Dimensions = { + width: number; + height: number; +}; +export type Rect = Dimensions & XYPosition; +export type Box = XYPosition & { + x2: number; + y2: number; +}; +export type Transform = [number, number, number]; +/** + * A coordinate extent represents two points in a coordinate system: one in the top + * left corner and one in the bottom right corner. It is used to represent the + * bounds of nodes in the flow or the bounds of the viewport. + * + * @public + * + * @remarks Props that expect a `CoordinateExtent` usually default to `[[-∞, -∞], [+∞, +∞]]` + * to represent an unbounded extent. + */ +export type CoordinateExtent = [[number, number], [number, number]]; +//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/types/utils.d.ts.map b/node_modules/@xyflow/system/dist/esm/types/utils.d.ts.map new file mode 100644 index 0000000..5da3810 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/types/utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/types/utils.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,oBAAY,QAAQ;IAClB,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,MAAM,WAAW;CAClB;AAED,eAAO,MAAM,gBAAgB;;;;;CAK5B,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG;IAAE,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAErD,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,IAAI,GAAG,UAAU,GAAG,UAAU,CAAC;AAE3C,MAAM,MAAM,GAAG,GAAG,UAAU,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAEjD;;;;;;;;;GASG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/utils/connections.d.ts b/node_modules/@xyflow/system/dist/esm/utils/connections.d.ts new file mode 100644 index 0000000..03dc064 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/utils/connections.d.ts @@ -0,0 +1,13 @@ +import { HandleConnection } from '../types'; +/** + * @internal + */ +export declare function areConnectionMapsEqual(a?: Map, b?: Map): boolean; +/** + * We call the callback for all connections in a that are not in b + * + * @internal + */ +export declare function handleConnectionChange(a: Map, b: Map, cb?: (diff: HandleConnection[]) => void): void; +export declare function getConnectionStatus(isValid: boolean | null): "valid" | "invalid" | null; +//# sourceMappingURL=connections.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/utils/connections.d.ts.map b/node_modules/@xyflow/system/dist/esm/utils/connections.d.ts.map new file mode 100644 index 0000000..0688bcf --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/utils/connections.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"connections.d.ts","sourceRoot":"","sources":["../../src/utils/connections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,WAoB1G;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,EAChC,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,EAChC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,IAAI,QAiBxC;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,8BAE1D"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/utils/dom.d.ts b/node_modules/@xyflow/system/dist/esm/utils/dom.d.ts new file mode 100644 index 0000000..8677d65 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/utils/dom.d.ts @@ -0,0 +1,21 @@ +import type { Transform, XYPosition, SnapGrid, Dimensions, Handle } from '../types'; +export type GetPointerPositionParams = { + transform: Transform; + snapGrid?: SnapGrid; + snapToGrid?: boolean; + containerBounds: DOMRect | null; +}; +export declare function getPointerPosition(event: MouseEvent | TouchEvent, { snapGrid, snapToGrid, transform, containerBounds }: GetPointerPositionParams): XYPosition & { + xSnapped: number; + ySnapped: number; +}; +export declare const getDimensions: (node: HTMLDivElement) => Dimensions; +export declare const getHostForElement: (element: HTMLElement | EventTarget | null) => Document | ShadowRoot; +export declare function isInputDOMNode(event: KeyboardEvent): boolean; +export declare const isMouseEvent: (event: MouseEvent | TouchEvent) => event is MouseEvent; +export declare const getEventPosition: (event: MouseEvent | TouchEvent, bounds?: DOMRect) => { + x: number; + y: number; +}; +export declare const getHandleBounds: (type: "source" | "target", nodeElement: HTMLDivElement, nodeBounds: DOMRect, zoom: number, nodeId: string) => Handle[] | null; +//# sourceMappingURL=dom.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/utils/dom.d.ts.map b/node_modules/@xyflow/system/dist/esm/utils/dom.d.ts.map new file mode 100644 index 0000000..bd26c68 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/utils/dom.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/utils/dom.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAY,MAAM,EAAE,MAAM,UAAU,CAAC;AAG9F,MAAM,MAAM,wBAAwB,GAAG;IACrC,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,EAAE,OAAO,GAAG,IAAI,CAAC;CACjC,CAAC;AAEF,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,UAAU,GAAG,UAAU,EAC9B,EAAE,QAAiB,EAAE,UAAkB,EAAE,SAAS,EAAE,eAAe,EAAE,EAAE,wBAAwB,GAC9F,UAAU,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAcrD;AAED,eAAO,MAAM,aAAa,SAAU,cAAc,KAAG,UAGnD,CAAC;AAEH,eAAO,MAAM,iBAAiB,YAAa,WAAW,GAAG,WAAW,GAAG,IAAI,KAAG,QAAQ,GAAG,UACiB,CAAC;AAI3G,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAS5D;AAED,eAAO,MAAM,YAAY,UAAW,UAAU,GAAG,UAAU,KAAG,KAAK,IAAI,UAAgC,CAAC;AAExG,eAAO,MAAM,gBAAgB,UAAW,UAAU,GAAG,UAAU,WAAW,OAAO;;;CAShF,CAAC;AAOF,eAAO,MAAM,eAAe,SACpB,QAAQ,GAAG,QAAQ,eACZ,cAAc,cACf,OAAO,QACb,MAAM,UACJ,MAAM,KACb,MAAM,EAAE,GAAG,IAoBb,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/utils/edges/bezier-edge.d.ts b/node_modules/@xyflow/system/dist/esm/utils/edges/bezier-edge.d.ts new file mode 100644 index 0000000..2df99ce --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/utils/edges/bezier-edge.d.ts @@ -0,0 +1,77 @@ +import { Position } from '../../types'; +export type GetBezierPathParams = { + /** The `x` position of the source handle. */ + sourceX: number; + /** The `y` position of the source handle. */ + sourceY: number; + /** + * The position of the source handle. + * @default Position.Bottom + */ + sourcePosition?: Position; + /** The `x` position of the target handle. */ + targetX: number; + /** The `y` position of the target handle. */ + targetY: number; + /** + * The position of the target handle. + * @default Position.Top + */ + targetPosition?: Position; + /** + * The curvature of the bezier edge. + * @default 0.25 + */ + curvature?: number; +}; +export type GetControlWithCurvatureParams = { + pos: Position; + x1: number; + y1: number; + x2: number; + y2: number; + c: number; +}; +export declare function getBezierEdgeCenter({ sourceX, sourceY, targetX, targetY, sourceControlX, sourceControlY, targetControlX, targetControlY, }: { + sourceX: number; + sourceY: number; + targetX: number; + targetY: number; + sourceControlX: number; + sourceControlY: number; + targetControlX: number; + targetControlY: number; +}): [number, number, number, number]; +/** + * The `getBezierPath` util returns everything you need to render a bezier edge + *between two nodes. + * @public + * @returns A path string you can use in an SVG, the `labelX` and `labelY` position (center of path) + * and `offsetX`, `offsetY` between source handle and label. + * - `path`: the path to use in an SVG `` element. + * - `labelX`: the `x` position you can use to render a label for this edge. + * - `labelY`: the `y` position you can use to render a label for this edge. + * - `offsetX`: the absolute difference between the source `x` position and the `x` position of the + * middle of this path. + * - `offsetY`: the absolute difference between the source `y` position and the `y` position of the + * middle of this path. + * @example + * ```js + * const source = { x: 0, y: 20 }; + * const target = { x: 150, y: 100 }; + * + * const [path, labelX, labelY, offsetX, offsetY] = getBezierPath({ + * sourceX: source.x, + * sourceY: source.y, + * sourcePosition: Position.Right, + * targetX: target.x, + * targetY: target.y, + * targetPosition: Position.Left, + *}); + *``` + * + * @remarks This function returns a tuple (aka a fixed-size array) to make it easier to + *work with multiple edge paths at once. + */ +export declare function getBezierPath({ sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition, curvature, }: GetBezierPathParams): [path: string, labelX: number, labelY: number, offsetX: number, offsetY: number]; +//# sourceMappingURL=bezier-edge.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/utils/edges/bezier-edge.d.ts.map b/node_modules/@xyflow/system/dist/esm/utils/edges/bezier-edge.d.ts.map new file mode 100644 index 0000000..6ecc89b --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/utils/edges/bezier-edge.d.ts.map @@ -0,0 +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,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B;;;OAGG;IACH,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,CAWnC;AAuBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,OAAO,EACP,cAAgC,EAChC,OAAO,EACP,OAAO,EACP,cAA6B,EAC7B,SAAgB,GACjB,EAAE,mBAAmB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAmCxG"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/utils/edges/general.d.ts b/node_modules/@xyflow/system/dist/esm/utils/edges/general.d.ts new file mode 100644 index 0000000..0bfa24a --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/utils/edges/general.d.ts @@ -0,0 +1,62 @@ +import { Connection, InternalNodeBase, Transform, EdgeBase } from '../..'; +export declare function getEdgeCenter({ sourceX, sourceY, targetX, targetY, }: { + sourceX: number; + sourceY: number; + targetX: number; + targetY: number; +}): [number, number, number, number]; +export type GetEdgeZIndexParams = { + sourceNode: InternalNodeBase; + targetNode: InternalNodeBase; + selected?: boolean; + zIndex?: number; + elevateOnSelect?: boolean; +}; +export declare function getElevatedEdgeZIndex({ sourceNode, targetNode, selected, zIndex, elevateOnSelect, }: GetEdgeZIndexParams): number; +type IsEdgeVisibleParams = { + sourceNode: InternalNodeBase; + targetNode: InternalNodeBase; + width: number; + height: number; + transform: Transform; +}; +export declare function isEdgeVisible({ sourceNode, targetNode, width, height, transform }: IsEdgeVisibleParams): boolean; +/** + * This util is a convenience function to add a new Edge to an array of edges. It also performs some validation to make sure you don't add an invalid edge or duplicate an existing one. + * @public + * @param edgeParams - Either an `Edge` or a `Connection` you want to add. + * @param edges - The array of all current edges. + * @returns A new array of edges with the new edge added. + * + * @remarks If an edge with the same `target` and `source` already exists (and the same + *`targetHandle` and `sourceHandle` if those are set), then this util won't add + *a new edge even if the `id` property is different. + * + */ +export declare const addEdge: (edgeParams: EdgeType | Connection, edges: EdgeType[]) => EdgeType[]; +export type ReconnectEdgeOptions = { + /** + * Should the id of the old edge be replaced with the new connection id. + * @default true + */ + shouldReplaceId?: boolean; +}; +/** + * A handy utility to update an existing [`Edge`](/api-reference/types/edge) with new properties. + *This searches your edge array for an edge with a matching `id` and updates its + *properties with the connection you provide. + * @public + * @param oldEdge - The edge you want to update. + * @param newConnection - The new connection you want to update the edge with. + * @param edges - The array of all current edges. + * @returns The updated edges array. + * + * @example + * ```js + *const onReconnect = useCallback( + * (oldEdge: Edge, newConnection: Connection) => setEdges((els) => reconnectEdge(oldEdge, newConnection, els)),[]); + *``` + */ +export declare const reconnectEdge: (oldEdge: EdgeType, newConnection: Connection, edges: EdgeType[], options?: ReconnectEdgeOptions) => EdgeType[]; +export {}; +//# sourceMappingURL=general.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/utils/edges/general.d.ts.map b/node_modules/@xyflow/system/dist/esm/utils/edges/general.d.ts.map new file mode 100644 index 0000000..c93f63e --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/utils/edges/general.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../../src/utils/edges/general.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,SAAS,EAA6B,QAAQ,EAAE,MAAM,OAAO,CAAC;AAIrG,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;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,UAAU,EAAE,gBAAgB,CAAC;IAC7B,UAAU,EAAE,gBAAgB,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,EACpC,UAAU,EACV,UAAU,EACV,QAAgB,EAChB,MAAU,EACV,eAAuB,GACxB,EAAE,mBAAmB,GAAG,MAAM,CAS9B;AAED,KAAK,mBAAmB,GAAG;IACzB,UAAU,EAAE,gBAAgB,CAAC;IAC7B,UAAU,EAAE,gBAAgB,CAAC;IAC7B,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;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,OAAO,GAAI,QAAQ,SAAS,QAAQ,cACnC,QAAQ,GAAG,UAAU,SAC1B,QAAQ,EAAE,KAChB,QAAQ,EA8BV,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,aAAa,GAAI,QAAQ,SAAS,QAAQ,WAC5C,QAAQ,iBACF,UAAU,SAClB,QAAQ,EAAE,YACR,oBAAoB,KAC5B,QAAQ,EA4BV,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/utils/edges/index.d.ts b/node_modules/@xyflow/system/dist/esm/utils/edges/index.d.ts new file mode 100644 index 0000000..668a084 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/utils/edges/index.d.ts @@ -0,0 +1,6 @@ +export * from './bezier-edge'; +export * from './straight-edge'; +export * from './smoothstep-edge'; +export * from './general'; +export * from './positions'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/utils/edges/index.d.ts.map b/node_modules/@xyflow/system/dist/esm/utils/edges/index.d.ts.map new file mode 100644 index 0000000..0efd829 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/utils/edges/index.d.ts.map @@ -0,0 +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"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/utils/edges/positions.d.ts b/node_modules/@xyflow/system/dist/esm/utils/edges/positions.d.ts new file mode 100644 index 0000000..e0687d3 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/utils/edges/positions.d.ts @@ -0,0 +1,17 @@ +import { EdgePosition } from '../../types/edges'; +import { ConnectionMode, OnError } from '../../types/general'; +import { InternalNodeBase } from '../../types/nodes'; +import { Position, XYPosition } from '../../types/utils'; +import { Handle } from '../../types'; +export type GetEdgePositionParams = { + id: string; + sourceNode: InternalNodeBase; + sourceHandle: string | null; + targetNode: InternalNodeBase; + targetHandle: string | null; + connectionMode: ConnectionMode; + onError?: OnError; +}; +export declare function getEdgePosition(params: GetEdgePositionParams): EdgePosition | null; +export declare function getHandlePosition(node: InternalNodeBase, handle: Handle | null, fallbackPosition?: Position, center?: boolean): XYPosition; +//# sourceMappingURL=positions.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/utils/edges/positions.d.ts.map b/node_modules/@xyflow/system/dist/esm/utils/edges/positions.d.ts.map new file mode 100644 index 0000000..ac5deb6 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/utils/edges/positions.d.ts.map @@ -0,0 +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,gBAAgB,EAAc,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGrC,MAAM,MAAM,qBAAqB,GAAG;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,gBAAgB,CAAC;IAC7B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,EAAE,gBAAgB,CAAC;IAC7B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,cAAc,EAAE,cAAc,CAAC;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAUF,wBAAgB,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,YAAY,GAAG,IAAI,CA6ClF;AA2BD,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,gBAAgB,EACtB,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,gBAAgB,GAAE,QAAwB,EAC1C,MAAM,UAAQ,GACb,UAAU,CAqBZ"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/utils/edges/smoothstep-edge.d.ts b/node_modules/@xyflow/system/dist/esm/utils/edges/smoothstep-edge.d.ts new file mode 100644 index 0000000..40083d8 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/utils/edges/smoothstep-edge.d.ts @@ -0,0 +1,60 @@ +import { Position } from '../../types'; +export interface GetSmoothStepPathParams { + /** The `x` position of the source handle. */ + sourceX: number; + /** The `y` position of the source handle. */ + sourceY: number; + /** + * The position of the source handle. + * @default Position.Bottom + */ + sourcePosition?: Position; + /** The `x` position of the target handle. */ + targetX: number; + /** The `y` position of the target handle. */ + targetY: number; + /** + * The position of the target handle. + * @default Position.Top + */ + targetPosition?: Position; + /** @default 5 */ + borderRadius?: number; + centerX?: number; + centerY?: number; + /** @default 20 */ + offset?: number; +} +/** + * The `getSmoothStepPath` util returns everything you need to render a stepped path + * between two nodes. The `borderRadius` property can be used to choose how rounded + * the corners of those steps are. + * @public + * @returns A path string you can use in an SVG, the `labelX` and `labelY` position (center of path) + * and `offsetX`, `offsetY` between source handle and label. + * + * - `path`: the path to use in an SVG `` element. + * - `labelX`: the `x` position you can use to render a label for this edge. + * - `labelY`: the `y` position you can use to render a label for this edge. + * - `offsetX`: the absolute difference between the source `x` position and the `x` position of the + * middle of this path. + * - `offsetY`: the absolute difference between the source `y` position and the `y` position of the + * middle of this path. + * @example + * ```js + * const source = { x: 0, y: 20 }; + * const target = { x: 150, y: 100 }; + * + * const [path, labelX, labelY, offsetX, offsetY] = getSmoothStepPath({ + * sourceX: source.x, + * sourceY: source.y, + * sourcePosition: Position.Right, + * targetX: target.x, + * targetY: target.y, + * targetPosition: Position.Left, + * }); + * ``` + * @remarks This function returns a tuple (aka a fixed-size array) to make it easier to work with multiple edge paths at once. + */ +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]; +//# sourceMappingURL=smoothstep-edge.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/utils/edges/smoothstep-edge.d.ts.map b/node_modules/@xyflow/system/dist/esm/utils/edges/smoothstep-edge.d.ts.map new file mode 100644 index 0000000..a954bf4 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/utils/edges/smoothstep-edge.d.ts.map @@ -0,0 +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,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,iBAAiB;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAwLD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,OAAO,EACP,cAAgC,EAChC,OAAO,EACP,OAAO,EACP,cAA6B,EAC7B,YAAgB,EAChB,OAAO,EACP,OAAO,EACP,MAAW,GACZ,EAAE,uBAAuB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAyB5G"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/utils/edges/straight-edge.d.ts b/node_modules/@xyflow/system/dist/esm/utils/edges/straight-edge.d.ts new file mode 100644 index 0000000..bbb609b --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/utils/edges/straight-edge.d.ts @@ -0,0 +1,41 @@ +export type GetStraightPathParams = { + /** The `x` position of the source handle. */ + sourceX: number; + /** The `y` position of the source handle. */ + sourceY: number; + /** The `x` position of the target handle. */ + targetX: number; + /** The `y` position of the target handle. */ + targetY: number; +}; +/** + * Calculates the straight line path between two points. + * @public + * @returns A path string you can use in an SVG, the `labelX` and `labelY` position (center of path) + * and `offsetX`, `offsetY` between source handle and label. + * + * - `path`: the path to use in an SVG `` element. + * - `labelX`: the `x` position you can use to render a label for this edge. + * - `labelY`: the `y` position you can use to render a label for this edge. + * - `offsetX`: the absolute difference between the source `x` position and the `x` position of the + * middle of this path. + * - `offsetY`: the absolute difference between the source `y` position and the `y` position of the + * middle of this path. + * @example + * ```js + * const source = { x: 0, y: 20 }; + * const target = { x: 150, y: 100 }; + * + * const [path, labelX, labelY, offsetX, offsetY] = getStraightPath({ + * sourceX: source.x, + * sourceY: source.y, + * sourcePosition: Position.Right, + * targetX: target.x, + * targetY: target.y, + * targetPosition: Position.Left, + * }); + * ``` + * @remarks This function returns a tuple (aka a fixed-size array) to make it easier to work with multiple edge paths at once. + */ +export declare function getStraightPath({ sourceX, sourceY, targetX, targetY, }: GetStraightPathParams): [path: string, labelX: number, labelY: number, offsetX: number, offsetY: number]; +//# sourceMappingURL=straight-edge.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/utils/edges/straight-edge.d.ts.map b/node_modules/@xyflow/system/dist/esm/utils/edges/straight-edge.d.ts.map new file mode 100644 index 0000000..b25ad66 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/utils/edges/straight-edge.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"straight-edge.d.ts","sourceRoot":"","sources":["../../../src/utils/edges/straight-edge.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,qBAAqB,GAAG;IAClC,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,eAAe,CAAC,EAC9B,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,GACR,EAAE,qBAAqB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAS1G"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/utils/general.d.ts b/node_modules/@xyflow/system/dist/esm/utils/general.d.ts new file mode 100644 index 0000000..cddc570 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/utils/general.d.ts @@ -0,0 +1,85 @@ +import type { Dimensions, XYPosition, CoordinateExtent, Box, Rect, NodeBase, NodeOrigin, SnapGrid, Transform, InternalNodeBase, NodeLookup, Padding } from '../types'; +import { type Viewport } from '../types'; +import { type AriaLabelConfig } from '../constants'; +export declare const clamp: (val: number, min?: number, max?: number) => number; +export declare const clampPosition: (position: XYPosition | undefined, extent: CoordinateExtent, dimensions: Partial) => { + x: number; + y: number; +}; +export declare function clampPositionToParent(childPosition: XYPosition, childDimensions: Dimensions, parent: InternalNodeBase): { + x: number; + y: number; +}; +export declare const calcAutoPan: (pos: XYPosition, bounds: Dimensions, speed?: number, distance?: number) => number[]; +export declare const getBoundsOfBoxes: (box1: Box, box2: Box) => Box; +export declare const rectToBox: ({ x, y, width, height }: Rect) => Box; +export declare const boxToRect: ({ x, y, x2, y2 }: Box) => Rect; +export declare const nodeToRect: (node: InternalNodeBase | NodeBase, nodeOrigin?: NodeOrigin) => Rect; +export declare const nodeToBox: (node: InternalNodeBase | NodeBase, nodeOrigin?: NodeOrigin) => Box; +export declare const getBoundsOfRects: (rect1: Rect, rect2: Rect) => Rect; +export declare const getOverlappingArea: (rectA: Rect, rectB: Rect) => number; +export declare const isRectObject: (obj: any) => obj is Rect; +export declare const isNumeric: (n: any) => n is number; +export declare const devWarn: (id: string, message: string) => void; +export declare const snapPosition: (position: XYPosition, snapGrid?: SnapGrid) => XYPosition; +export declare const pointToRendererPoint: ({ x, y }: XYPosition, [tx, ty, tScale]: Transform, snapToGrid?: boolean, snapGrid?: SnapGrid) => XYPosition; +export declare const rendererPointToPoint: ({ x, y }: XYPosition, [tx, ty, tScale]: Transform) => XYPosition; +/** + * Returns a viewport that encloses the given bounds with padding. + * @public + * @remarks You can determine bounds of nodes with {@link getNodesBounds} and {@link getBoundsOfRects} + * @param bounds - Bounds to fit inside viewport. + * @param width - Width of the viewport. + * @param height - Height of the viewport. + * @param minZoom - Minimum zoom level of the resulting viewport. + * @param maxZoom - Maximum zoom level of the resulting viewport. + * @param padding - Padding around the bounds. + * @returns A transformed {@link Viewport} that encloses the given bounds which you can pass to e.g. {@link setViewport}. + * @example + * const { x, y, zoom } = getViewportForBounds( + * { x: 0, y: 0, width: 100, height: 100}, + * 1200, 800, 0.5, 2); + */ +export declare const getViewportForBounds: (bounds: Rect, width: number, height: number, minZoom: number, maxZoom: number, padding: Padding) => Viewport; +export declare const isMacOs: () => boolean; +export declare function isCoordinateExtent(extent?: CoordinateExtent | 'parent'): extent is CoordinateExtent; +export declare function getNodeDimensions(node: { + measured?: { + width?: number; + height?: number; + }; + width?: number; + height?: number; + initialWidth?: number; + initialHeight?: number; +}): { + width: number; + height: number; +}; +export declare function nodeHasDimensions(node: NodeType): boolean; +/** + * Convert child position to aboslute position + * + * @internal + * @param position + * @param parentId + * @param nodeLookup + * @param nodeOrigin + * @returns an internal node with an absolute position + */ +export declare function evaluateAbsolutePosition(position: XYPosition, dimensions: { + width?: number; + height?: number; +} | undefined, parentId: string, nodeLookup: NodeLookup, nodeOrigin: NodeOrigin): XYPosition; +export declare function areSetsEqual(a: Set, b: Set): boolean; +/** + * Polyfill for Promise.withResolvers until we can use it in all browsers + * @internal + */ +export declare function withResolvers(): { + promise: Promise; + resolve: (value: T | PromiseLike) => void; + reject: (reason?: unknown) => void; +}; +export declare function mergeAriaLabelConfig(partial?: Partial): AriaLabelConfig; +//# sourceMappingURL=general.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/utils/general.d.ts.map b/node_modules/@xyflow/system/dist/esm/utils/general.d.ts.map new file mode 100644 index 0000000..ca848c1 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/utils/general.d.ts.map @@ -0,0 +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,EACT,gBAAgB,EAChB,UAAU,EACV,OAAO,EAER,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGzC,OAAO,EAA0B,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAE5E,eAAO,MAAM,KAAK,QAAS,MAAM,iCAAqB,MAA2C,CAAC;AAElG,eAAO,MAAM,aAAa,aACd,UAAU,sBACZ,gBAAgB,cACZ,OAAO,CAAC,UAAU,CAAC;;;CAI/B,CAAC;AAEH,wBAAgB,qBAAqB,CAAC,QAAQ,SAAS,QAAQ,EAC7D,aAAa,EAAE,UAAU,EACzB,eAAe,EAAE,UAAU,EAC3B,MAAM,EAAE,gBAAgB,CAAC,QAAQ,CAAC;;;EAanC;AAoBD,eAAO,MAAM,WAAW,QACjB,UAAU,UACP,UAAU,UACX,MAAM,aACH,MAAM,KACf,MAAM,EAKR,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,gBAAgB,GAAG,QAAQ,eAAc,UAAU,KAAY,IAW/F,CAAC;AAEF,eAAO,MAAM,SAAS,SAAU,gBAAgB,GAAG,QAAQ,eAAc,UAAU,KAAY,GAW9F,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,KAAG,GAAG,IAAI,IACwC,CAAC;AAGxF,eAAO,MAAM,SAAS,MAAO,GAAG,KAAG,CAAC,IAAI,MAAkC,CAAC;AAI3E,eAAO,MAAM,OAAO,OAAQ,MAAM,WAAW,MAAM,SAIlD,CAAC;AAEF,eAAO,MAAM,YAAY,aAAc,UAAU,aAAY,QAAQ,KAAY,UAKhF,CAAC;AAEF,eAAO,MAAM,oBAAoB,aACrB,UAAU,oBACF,SAAS,mCAEjB,QAAQ,KACjB,UAOF,CAAC;AAEF,eAAO,MAAM,oBAAoB,aAAc,UAAU,oBAAoB,SAAS,KAAG,UAKxF,CAAC;AAqGF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,oBAAoB,WACvB,IAAI,SACL,MAAM,UACL,MAAM,WACL,MAAM,WACN,MAAM,WACN,OAAO,KACf,QAgCF,CAAC;AAEF,eAAO,MAAM,OAAO,eAAsF,CAAC;AAE3G,wBAAgB,kBAAkB,CAAC,MAAM,CAAC,EAAE,gBAAgB,GAAG,QAAQ,GAAG,MAAM,IAAI,gBAAgB,CAEnG;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE;IACtC,QAAQ,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAKpC;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,EAAE,IAAI,EAAE,QAAQ,GAAG,OAAO,CAK/F;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,UAAU,EACpB,UAAU,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,YAA0B,EACzE,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,GACrB,UAAU,CAWZ;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,WAY1D;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,CAAC,KAAK;IAClC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACpB,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IAC7C,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACpC,CASA;AAED,wBAAgB,oBAAoB,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,eAAe,CAExF"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/utils/graph.d.ts b/node_modules/@xyflow/system/dist/esm/utils/graph.d.ts new file mode 100644 index 0000000..f8b0239 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/utils/graph.d.ts @@ -0,0 +1,191 @@ +import { type Transform, type XYPosition, type Rect, type NodeOrigin, type NodeBase, type EdgeBase, type FitViewParamsBase, type FitViewOptionsBase, CoordinateExtent, OnError, OnBeforeDeleteBase, NodeLookup, InternalNodeBase, NodeDragItem } from '../types'; +/** + * Test whether an object is usable as an Edge + * @public + * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Edge if it returns true + * @param element - The element to test + * @returns A boolean indicating whether the element is an Edge + */ +export declare const isEdgeBase: (element: any) => element is EdgeType; +/** + * Test whether an object is usable as a Node + * @public + * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Node if it returns true + * @param element - The element to test + * @returns A boolean indicating whether the element is an Node + */ +export declare const isNodeBase: (element: any) => element is NodeType; +export declare const isInternalNodeBase: (element: any) => element is NodeType; +/** + * This util is used to tell you what nodes, if any, are connected to the given node + * as the _target_ of an edge. + * @public + * @param node - The node to get the connected nodes from. + * @param nodes - The array of all nodes. + * @param edges - The array of all edges. + * @returns An array of nodes that are connected over edges where the source is the given node. + * + * @example + * ```ts + *import { getOutgoers } from '@xyflow/react'; + * + *const nodes = []; + *const edges = []; + * + *const outgoers = getOutgoers( + * { id: '1', position: { x: 0, y: 0 }, data: { label: 'node' } }, + * nodes, + * edges, + *); + *``` + */ +export declare const getOutgoers: (node: NodeType | { + id: string; +}, nodes: NodeType[], edges: EdgeType[]) => NodeType[]; +/** + * This util is used to tell you what nodes, if any, are connected to the given node + * as the _source_ of an edge. + * @public + * @param node - The node to get the connected nodes from. + * @param nodes - The array of all nodes. + * @param edges - The array of all edges. + * @returns An array of nodes that are connected over edges where the target is the given node. + * + * @example + * ```ts + *import { getIncomers } from '@xyflow/react'; + * + *const nodes = []; + *const edges = []; + * + *const incomers = getIncomers( + * { id: '1', position: { x: 0, y: 0 }, data: { label: 'node' } }, + * nodes, + * edges, + *); + *``` + */ +export declare const getIncomers: (node: NodeType | { + id: string; +}, nodes: NodeType[], edges: EdgeType[]) => NodeType[]; +export declare const getNodePositionWithOrigin: (node: NodeBase, nodeOrigin?: NodeOrigin) => XYPosition; +export type GetNodesBoundsParams = { + /** + * Origin of the nodes: `[0, 0]` for top-left, `[0.5, 0.5]` for center. + * @default [0, 0] + */ + nodeOrigin?: NodeOrigin; + nodeLookup?: NodeLookup>; +}; +/** + * Returns the bounding box that contains all the given nodes in an array. This can + * be useful when combined with [`getViewportForBounds`](/api-reference/utils/get-viewport-for-bounds) + * to calculate the correct transform to fit the given nodes in a viewport. + * @public + * @remarks Useful when combined with {@link getViewportForBounds} to calculate the correct transform to fit the given nodes in a viewport. + * @param nodes - Nodes to calculate the bounds for. + * @returns Bounding box enclosing all nodes. + * + * @remarks This function was previously called `getRectOfNodes` + * + * @example + * ```js + *import { getNodesBounds } from '@xyflow/react'; + * + *const nodes = [ + * { + * id: 'a', + * position: { x: 0, y: 0 }, + * data: { label: 'a' }, + * width: 50, + * height: 25, + * }, + * { + * id: 'b', + * position: { x: 100, y: 100 }, + * data: { label: 'b' }, + * width: 50, + * height: 25, + * }, + *]; + * + *const bounds = getNodesBounds(nodes); + *``` + */ +export declare const getNodesBounds: (nodes: (NodeType | InternalNodeBase | string)[], params?: GetNodesBoundsParams) => Rect; +export type GetInternalNodesBoundsParams = { + useRelativePosition?: boolean; + filter?: (node: NodeType) => boolean; +}; +/** + * Determines a bounding box that contains all given nodes in an array + * @internal + */ +export declare const getInternalNodesBounds: (nodeLookup: Map, params?: GetInternalNodesBoundsParams) => Rect; +export declare const getNodesInside: (nodes: Map>, rect: Rect, [tx, ty, tScale]?: Transform, partially?: boolean, excludeNonSelectableNodes?: boolean) => InternalNodeBase[]; +/** + * This utility filters an array of edges, keeping only those where either the source or target + * node is present in the given array of nodes. + * @public + * @param nodes - Nodes you want to get the connected edges for. + * @param edges - All edges. + * @returns Array of edges that connect any of the given nodes with each other. + * + * @example + * ```js + *import { getConnectedEdges } from '@xyflow/react'; + * + *const nodes = [ + * { id: 'a', position: { x: 0, y: 0 } }, + * { id: 'b', position: { x: 100, y: 0 } }, + *]; + * + *const edges = [ + * { id: 'a->c', source: 'a', target: 'c' }, + * { id: 'c->d', source: 'c', target: 'd' }, + *]; + * + *const connectedEdges = getConnectedEdges(nodes, edges); + * // => [{ id: 'a->c', source: 'a', target: 'c' }] + *``` + */ +export declare const getConnectedEdges: (nodes: NodeType[], edges: EdgeType[]) => EdgeType[]; +export declare function fitViewport, Options extends FitViewOptionsBase>({ nodes, width, height, panZoom, minZoom, maxZoom }: Params, options?: Omit): Promise; +/** + * This function calculates the next position of a node, taking into account the node's extent, parent node, and origin. + * + * @internal + * @returns position, positionAbsolute + */ +export declare function calculateNodePosition({ nodeId, nextPosition, nodeLookup, nodeOrigin, nodeExtent, onError, }: { + nodeId: string; + nextPosition: XYPosition; + nodeLookup: NodeLookup>; + nodeOrigin?: NodeOrigin; + nodeExtent?: CoordinateExtent; + onError?: OnError; +}): { + position: XYPosition; + positionAbsolute: XYPosition; +}; +/** + * Pass in nodes & edges to delete, get arrays of nodes and edges that actually can be deleted + * @internal + * @param param.nodesToRemove - The nodes to remove + * @param param.edgesToRemove - The edges to remove + * @param param.nodes - All nodes + * @param param.edges - All edges + * @param param.onBeforeDelete - Callback to check which nodes and edges can be deleted + * @returns nodes: nodes that can be deleted, edges: edges that can be deleted + */ +export declare function getElementsToRemove({ nodesToRemove, edgesToRemove, nodes, edges, onBeforeDelete, }: { + nodesToRemove: Partial[]; + edgesToRemove: Partial[]; + nodes: NodeType[]; + edges: EdgeType[]; + onBeforeDelete?: OnBeforeDeleteBase; +}): Promise<{ + nodes: NodeType[]; + edges: EdgeType[]; +}>; +//# sourceMappingURL=graph.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/utils/graph.d.ts.map b/node_modules/@xyflow/system/dist/esm/utils/graph.d.ts.map new file mode 100644 index 0000000..5032edd --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/utils/graph.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../src/utils/graph.ts"],"names":[],"mappings":"AAaA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,IAAI,EACT,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,gBAAgB,EAChB,OAAO,EACP,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,YAAY,EACb,MAAM,UAAU,CAAC;AAGlB;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GAAI,QAAQ,SAAS,QAAQ,sBAAsB,GAAG,KAAG,OAAO,IAAI,QAC5B,CAAC;AAEhE;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GAAI,QAAQ,SAAS,QAAQ,sBAAsB,GAAG,KAAG,OAAO,IAAI,QACG,CAAC;AAE/F,eAAO,MAAM,kBAAkB,GAAI,QAAQ,SAAS,gBAAgB,8BACzD,GAAG,KACX,OAAO,IAAI,QAAyG,CAAC;AAExH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,WAAW,GAAI,QAAQ,SAAS,QAAQ,aAAa,QAAQ,SAAS,QAAQ,mBACnF,QAAQ,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,SACxB,QAAQ,EAAE,SACV,QAAQ,EAAE,KAChB,QAAQ,EAaV,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,WAAW,GAAI,QAAQ,SAAS,QAAQ,aAAa,QAAQ,SAAS,QAAQ,mBACnF,QAAQ,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,SACxB,QAAQ,EAAE,SACV,QAAQ,EAAE,KAChB,QAAQ,EAYV,CAAC;AAEF,eAAO,MAAM,yBAAyB,SAAU,QAAQ,eAAc,UAAU,KAAY,UAU3F,CAAC;AAEF,MAAM,MAAM,oBAAoB,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAAI;IACvE;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,UAAU,CAAC,EAAE,UAAU,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC;CACrD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,cAAc,GAAI,QAAQ,SAAS,QAAQ,oBAC/C,CAAC,QAAQ,GAAG,gBAAgB,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,EAAE,WACjD,oBAAoB,CAAC,QAAQ,CAAC,KACrC,IA+BF,CAAC;AAEF,MAAM,MAAM,4BAA4B,CAAC,QAAQ,IAAI;IACnD,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAC;CACtC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,GAAI,QAAQ,SAAS,gBAAgB,GAAG,YAAY,cACzE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,WACzB,4BAA4B,CAAC,QAAQ,CAAC,KAC7C,IAeF,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,QAAQ,SAAS,QAAQ,oBAC/C,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC,QACxC,IAAI,qBACQ,SAAS,+DAI1B,gBAAgB,CAAC,QAAQ,CAAC,EAgC5B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,iBAAiB,GAAI,QAAQ,SAAS,QAAQ,aAAa,QAAQ,SAAS,QAAQ,oBACxF,QAAQ,EAAE,SACV,QAAQ,EAAE,KAChB,QAAQ,EAOV,CAAC;AAoBF,wBAAsB,WAAW,CAC/B,MAAM,SAAS,iBAAiB,CAAC,QAAQ,CAAC,EAC1C,OAAO,SAAS,kBAAkB,CAAC,QAAQ,CAAC,EAE5C,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,MAAM,EAC3D,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,oBAAoB,CAAC,GACtD,OAAO,CAAC,OAAO,CAAC,CAyBlB;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,SAAS,QAAQ,EAAE,EAC/D,MAAM,EACN,YAAY,EACZ,UAAU,EACV,UAAmB,EACnB,UAAU,EACV,OAAO,GACR,EAAE;IACD,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,UAAU,CAAC;IACzB,UAAU,EAAE,UAAU,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC;IACnD,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG;IAAE,QAAQ,EAAE,UAAU,CAAC;IAAC,gBAAgB,EAAE,UAAU,CAAA;CAAE,CA4CzD;AAED;;;;;;;;;GASG;AACH,wBAAsB,mBAAmB,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,EAAE,QAAQ,SAAS,QAAQ,GAAG,QAAQ,EAAE,EACpH,aAAkB,EAClB,aAAkB,EAClB,KAAK,EACL,KAAK,EACL,cAAc,GACf,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;IAClB,cAAc,CAAC,EAAE,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;CACzD,GAAG,OAAO,CAAC;IACV,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB,CAAC,CA+CD"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/utils/index.d.ts b/node_modules/@xyflow/system/dist/esm/utils/index.d.ts new file mode 100644 index 0000000..ba212c0 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/utils/index.d.ts @@ -0,0 +1,11 @@ +export * from './connections'; +export * from './dom'; +export * from './edges'; +export * from './graph'; +export * from './general'; +export * from './marker'; +export * from './node-toolbar'; +export * from './store'; +export * from './types'; +export * from './shallow-node-data'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/utils/index.d.ts.map b/node_modules/@xyflow/system/dist/esm/utils/index.d.ts.map new file mode 100644 index 0000000..a0c74ca --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/utils/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,qBAAqB,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/utils/marker.d.ts b/node_modules/@xyflow/system/dist/esm/utils/marker.d.ts new file mode 100644 index 0000000..85eb740 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/utils/marker.d.ts @@ -0,0 +1,9 @@ +import type { EdgeBase, EdgeMarkerType, MarkerProps } from '../types'; +export declare function getMarkerId(marker: EdgeMarkerType | undefined, id?: string | null): string; +export declare function createMarkerIds(edges: EdgeBase[], { id, defaultColor, defaultMarkerStart, defaultMarkerEnd, }: { + id?: string | null; + defaultColor?: string; + defaultMarkerStart?: EdgeMarkerType; + defaultMarkerEnd?: EdgeMarkerType; +}): MarkerProps[]; +//# sourceMappingURL=marker.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/utils/marker.d.ts.map b/node_modules/@xyflow/system/dist/esm/utils/marker.d.ts.map new file mode 100644 index 0000000..5f2af5f --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/utils/marker.d.ts.map @@ -0,0 +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,EACE,EAAE,EACF,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,GACjB,EAAE;IACD,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,cAAc,CAAC;IACpC,gBAAgB,CAAC,EAAE,cAAc,CAAC;CACnC,iBAmBF"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/utils/node-toolbar.d.ts b/node_modules/@xyflow/system/dist/esm/utils/node-toolbar.d.ts new file mode 100644 index 0000000..d687f10 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/utils/node-toolbar.d.ts @@ -0,0 +1,3 @@ +import { Position, type Rect, type Viewport, type Align } from '../'; +export declare function getNodeToolbarTransform(nodeRect: Rect, viewport: Viewport, position: Position, offset: number, align: Align): string; +//# sourceMappingURL=node-toolbar.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/utils/node-toolbar.d.ts.map b/node_modules/@xyflow/system/dist/esm/utils/node-toolbar.d.ts.map new file mode 100644 index 0000000..35bada6 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/utils/node-toolbar.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"node-toolbar.d.ts","sourceRoot":"","sources":["../../src/utils/node-toolbar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,KAAK,KAAK,EAAE,MAAM,KAAK,CAAC;AAErE,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,IAAI,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,GACX,MAAM,CA0CR"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/utils/shallow-node-data.d.ts b/node_modules/@xyflow/system/dist/esm/utils/shallow-node-data.d.ts new file mode 100644 index 0000000..f3fcf5b --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/utils/shallow-node-data.d.ts @@ -0,0 +1,5 @@ +import { NodeBase } from '../types'; +type NodeData = Pick; +export declare function shallowNodeData(a: NodeData | NodeData[] | null, b: NodeData | NodeData[] | null): boolean; +export {}; +//# sourceMappingURL=shallow-node-data.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/utils/shallow-node-data.d.ts.map b/node_modules/@xyflow/system/dist/esm/utils/shallow-node-data.d.ts.map new file mode 100644 index 0000000..3555e64 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/utils/shallow-node-data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"shallow-node-data.d.ts","sourceRoot":"","sources":["../../src/utils/shallow-node-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,KAAK,QAAQ,GAAG,IAAI,CAAC,QAAQ,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC,CAAC;AAEvD,wBAAgB,eAAe,CAAC,CAAC,EAAE,QAAQ,GAAG,QAAQ,EAAE,GAAG,IAAI,EAAE,CAAC,EAAE,QAAQ,GAAG,QAAQ,EAAE,GAAG,IAAI,WAmB/F"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/utils/store.d.ts b/node_modules/@xyflow/system/dist/esm/utils/store.d.ts new file mode 100644 index 0000000..b7fefc5 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/utils/store.d.ts @@ -0,0 +1,27 @@ +import { NodeBase, CoordinateExtent, InternalNodeUpdate, NodeOrigin, PanZoomInstance, Transform, XYPosition, ConnectionLookup, EdgeBase, EdgeLookup, InternalNodeBase, NodeLookup, NodeDimensionChange, NodePositionChange, ParentLookup } from '../types'; +import { ParentExpandChild } from './types'; +export declare function updateAbsolutePositions(nodeLookup: NodeLookup>, parentLookup: ParentLookup>, options?: UpdateNodesOptions): void; +type UpdateNodesOptions = { + nodeOrigin?: NodeOrigin; + nodeExtent?: CoordinateExtent; + elevateNodesOnSelect?: boolean; + defaults?: Partial; + checkEquality?: boolean; +}; +export declare function adoptUserNodes(nodes: NodeType[], nodeLookup: NodeLookup>, parentLookup: ParentLookup>, options?: UpdateNodesOptions): boolean; +export declare function handleExpandParent(children: ParentExpandChild[], nodeLookup: NodeLookup, parentLookup: ParentLookup, nodeOrigin?: NodeOrigin): (NodeDimensionChange | NodePositionChange)[]; +export declare function updateNodeInternals(updates: Map, nodeLookup: NodeLookup, parentLookup: ParentLookup, domNode: HTMLElement | null, nodeOrigin?: NodeOrigin, nodeExtent?: CoordinateExtent): { + changes: (NodeDimensionChange | NodePositionChange)[]; + updatedInternals: boolean; +}; +export declare function panBy({ delta, panZoom, transform, translateExtent, width, height, }: { + delta: XYPosition; + panZoom: PanZoomInstance | null; + transform: Transform; + translateExtent: CoordinateExtent; + width: number; + height: number; +}): Promise; +export declare function updateConnectionLookup(connectionLookup: ConnectionLookup, edgeLookup: EdgeLookup, edges: EdgeBase[]): void; +export {}; +//# sourceMappingURL=store.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/utils/store.d.ts.map b/node_modules/@xyflow/system/dist/esm/utils/store.d.ts.map new file mode 100644 index 0000000..b0d003b --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/utils/store.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/utils/store.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,kBAAkB,EAClB,UAAU,EACV,eAAe,EACf,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,UAAU,EACV,gBAAgB,EAChB,UAAU,EAEV,mBAAmB,EACnB,kBAAkB,EAClB,YAAY,EACb,MAAM,UAAU,CAAC;AAYlB,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AA0B5C,wBAAgB,uBAAuB,CAAC,QAAQ,SAAS,QAAQ,EAC/D,UAAU,EAAE,UAAU,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,EAClD,YAAY,EAAE,YAAY,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,EACtD,OAAO,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC,QAavC;AAED,KAAK,kBAAkB,CAAC,QAAQ,SAAS,QAAQ,IAAI;IACnD,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC7B,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,wBAAgB,cAAc,CAAC,QAAQ,SAAS,QAAQ,EACtD,KAAK,EAAE,QAAQ,EAAE,EACjB,UAAU,EAAE,UAAU,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,EAClD,YAAY,EAAE,YAAY,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,EACtD,OAAO,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC,GACrC,OAAO,CAsDT;AAiGD,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,iBAAiB,EAAE,EAC7B,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,EAC1B,UAAU,GAAE,UAAmB,GAC9B,CAAC,mBAAmB,GAAG,kBAAkB,CAAC,EAAE,CAiF9C;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,SAAS,gBAAgB,EACnE,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,EACxC,UAAU,EAAE,UAAU,CAAC,QAAQ,CAAC,EAChC,YAAY,EAAE,YAAY,CAAC,QAAQ,CAAC,EACpC,OAAO,EAAE,WAAW,GAAG,IAAI,EAC3B,UAAU,CAAC,EAAE,UAAU,EACvB,UAAU,CAAC,EAAE,gBAAgB,GAC5B;IAAE,OAAO,EAAE,CAAC,mBAAmB,GAAG,kBAAkB,CAAC,EAAE,CAAC;IAAC,gBAAgB,EAAE,OAAO,CAAA;CAAE,CAgGtF;AAED,wBAAsB,KAAK,CAAC,EAC1B,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,GAAG,OAAO,CAAC,OAAO,CAAC,CAuBnB;AAwCD,wBAAgB,sBAAsB,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,QAgBnH"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/utils/types.d.ts b/node_modules/@xyflow/system/dist/esm/utils/types.d.ts new file mode 100644 index 0000000..b9dd111 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/utils/types.d.ts @@ -0,0 +1,8 @@ +import { Rect } from '../types'; +export type Optional = Pick, K> & Omit; +export type ParentExpandChild = { + id: string; + parentId: string; + rect: Rect; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/utils/types.d.ts.map b/node_modules/@xyflow/system/dist/esm/utils/types.d.ts.map new file mode 100644 index 0000000..c0f6120 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/utils/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,MAAM,MAAM,QAAQ,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAE9E,MAAM,MAAM,iBAAiB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/xydrag/XYDrag.d.ts b/node_modules/@xyflow/system/dist/esm/xydrag/XYDrag.d.ts new file mode 100644 index 0000000..9a7a665 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/xydrag/XYDrag.d.ts @@ -0,0 +1,55 @@ +import type { NodeBase, NodeDragItem, EdgeBase, CoordinateExtent, NodeOrigin, OnError, SnapGrid, Transform, PanBy, OnSelectionDrag, UpdateNodePositions, InternalNodeBase } from '../types'; +export type OnDrag = (event: MouseEvent, dragItems: Map, node: NodeBase, nodes: NodeBase[]) => void; +type StoreItems = { + nodes: NodeBase[]; + nodeLookup: Map; + edges: EdgeBase[]; + nodeExtent: CoordinateExtent; + snapGrid: SnapGrid; + snapToGrid: boolean; + nodeOrigin: NodeOrigin; + multiSelectionActive: boolean; + domNode?: Element | null; + transform: Transform; + autoPanOnNodeDrag: boolean; + nodesDraggable: boolean; + selectNodesOnDrag: boolean; + nodeDragThreshold: number; + panBy: PanBy; + unselectNodesAndEdges: (params?: { + nodes?: NodeBase[]; + edges?: EdgeBase[]; + }) => void; + onError?: OnError; + onNodeDragStart?: OnNodeDrag; + onNodeDrag?: OnNodeDrag; + onNodeDragStop?: OnNodeDrag; + onSelectionDragStart?: OnSelectionDrag; + onSelectionDrag?: OnSelectionDrag; + onSelectionDragStop?: OnSelectionDrag; + updateNodePositions: UpdateNodePositions; + autoPanSpeed?: number; +}; +export type XYDragParams = { + getStoreItems: () => StoreItems; + onDragStart?: OnDrag; + onDrag?: OnDrag; + onDragStop?: OnDrag; + onNodeMouseDown?: (id: string) => void; + autoPanSpeed?: number; +}; +export type XYDragInstance = { + update: (params: DragUpdateParams) => void; + destroy: () => void; +}; +export type DragUpdateParams = { + noDragClassName?: string; + handleSelector?: string; + isSelectable?: boolean; + nodeId?: string; + domNode: Element; + nodeClickDistance?: number; +}; +export declare function XYDrag void | undefined>({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragStop, }: XYDragParams): XYDragInstance; +export {}; +//# sourceMappingURL=XYDrag.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/xydrag/XYDrag.d.ts.map b/node_modules/@xyflow/system/dist/esm/xydrag/XYDrag.d.ts.map new file mode 100644 index 0000000..53c8bf9 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/xydrag/XYDrag.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"XYDrag.d.ts","sourceRoot":"","sources":["../../src/xydrag/XYDrag.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,QAAQ,EACR,YAAY,EAGZ,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,OAAO,EACP,QAAQ,EACR,SAAS,EACT,KAAK,EACL,eAAe,EACf,mBAAmB,EAEnB,gBAAgB,EACjB,MAAM,UAAU,CAAC;AAElB,MAAM,MAAM,MAAM,GAAG,CACnB,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,EACpC,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,QAAQ,EAAE,KACd,IAAI,CAAC;AAEV,KAAK,UAAU,CAAC,UAAU,IAAI;IAC5B,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC1C,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,UAAU,EAAE,gBAAgB,CAAC;IAC7B,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,UAAU,CAAC;IACvB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,SAAS,CAAC;IACrB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,cAAc,EAAE,OAAO,CAAC;IACxB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,KAAK,EAAE,KAAK,CAAC;IACb,qBAAqB,EAAE,CAAC,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;QAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAA;KAAE,KAAK,IAAI,CAAC;IACrF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,UAAU,CAAC;IAC7B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B,oBAAoB,CAAC,EAAE,eAAe,CAAC;IACvC,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,mBAAmB,CAAC,EAAE,eAAe,CAAC;IACtC,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,YAAY,CAAC,UAAU,IAAI;IACrC,aAAa,EAAE,MAAM,UAAU,CAAC,UAAU,CAAC,CAAC;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,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;IACjB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAGF,wBAAgB,MAAM,CAAC,UAAU,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,KAAK,IAAI,GAAG,SAAS,EAAE,EAC7F,eAAe,EACf,aAAa,EACb,WAAW,EACX,MAAM,EACN,UAAU,GACX,EAAE,YAAY,CAAC,UAAU,CAAC,GAAG,cAAc,CA4S3C"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/xydrag/index.d.ts b/node_modules/@xyflow/system/dist/esm/xydrag/index.d.ts new file mode 100644 index 0000000..48955a5 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/xydrag/index.d.ts @@ -0,0 +1,2 @@ +export * from './XYDrag'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/xydrag/index.d.ts.map b/node_modules/@xyflow/system/dist/esm/xydrag/index.d.ts.map new file mode 100644 index 0000000..6f23db8 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/xydrag/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/xydrag/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/xydrag/utils.d.ts b/node_modules/@xyflow/system/dist/esm/xydrag/utils.d.ts new file mode 100644 index 0000000..2be1962 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/xydrag/utils.d.ts @@ -0,0 +1,11 @@ +import { type NodeDragItem, type XYPosition, InternalNodeBase, NodeBase, NodeLookup } from '../types'; +export declare function isParentSelected(node: NodeType, nodeLookup: NodeLookup): boolean; +export declare function hasSelector(target: Element | EventTarget | null, selector: string, domNode: Element): boolean; +export declare function getDragItems(nodeLookup: Map>, nodesDraggable: boolean, mousePos: XYPosition, nodeId?: string): Map; +export declare function getEventHandlerParams({ nodeId, dragItems, nodeLookup, dragging, }: { + nodeId?: string; + dragItems: Map; + nodeLookup: Map; + dragging?: boolean; +}): [NodeBase, NodeBase[]]; +//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/xydrag/utils.d.ts.map b/node_modules/@xyflow/system/dist/esm/xydrag/utils.d.ts.map new file mode 100644 index 0000000..5f3d208 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/xydrag/utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/xydrag/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,UAAU,EAAE,gBAAgB,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtG,wBAAgB,gBAAgB,CAAC,QAAQ,SAAS,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,GAAG,OAAO,CAgB3G;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,OAAO,GAAG,WAAW,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAU7G;AAGD,wBAAgB,YAAY,CAAC,QAAQ,SAAS,QAAQ,EACpD,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC,EACnD,cAAc,EAAE,OAAO,EACvB,QAAQ,EAAE,UAAU,EACpB,MAAM,CAAC,EAAE,MAAM,GACd,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAoC3B;AAOD,wBAAgB,qBAAqB,CAAC,QAAQ,SAAS,gBAAgB,EAAE,EACvE,MAAM,EACN,SAAS,EACT,UAAU,EACV,QAAe,GAChB,EAAE;IACD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACrC,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,CAAC,CA+BzB"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/xyhandle/XYHandle.d.ts b/node_modules/@xyflow/system/dist/esm/xyhandle/XYHandle.d.ts new file mode 100644 index 0000000..1f5d45d --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/xyhandle/XYHandle.d.ts @@ -0,0 +1,3 @@ +import { XYHandleInstance } from './types'; +export declare const XYHandle: XYHandleInstance; +//# sourceMappingURL=XYHandle.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/xyhandle/XYHandle.d.ts.map b/node_modules/@xyflow/system/dist/esm/xyhandle/XYHandle.d.ts.map new file mode 100644 index 0000000..2fbfad1 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/xyhandle/XYHandle.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"XYHandle.d.ts","sourceRoot":"","sources":["../../src/xyhandle/XYHandle.ts"],"names":[],"mappings":"AAkBA,OAAO,EAA8C,gBAAgB,EAAE,MAAM,SAAS,CAAC;AA6RvF,eAAO,MAAM,QAAQ,EAAE,gBAGtB,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/xyhandle/index.d.ts b/node_modules/@xyflow/system/dist/esm/xyhandle/index.d.ts new file mode 100644 index 0000000..15994ac --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/xyhandle/index.d.ts @@ -0,0 +1,2 @@ +export * from './XYHandle'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/xyhandle/index.d.ts.map b/node_modules/@xyflow/system/dist/esm/xyhandle/index.d.ts.map new file mode 100644 index 0000000..a74366a --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/xyhandle/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/xyhandle/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/xyhandle/types.d.ts b/node_modules/@xyflow/system/dist/esm/xyhandle/types.d.ts new file mode 100644 index 0000000..9c19420 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/xyhandle/types.d.ts @@ -0,0 +1,48 @@ +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'; +export type OnPointerDownParams = { + autoPanOnConnect: boolean; + connectionMode: ConnectionMode; + connectionRadius: number; + domNode: HTMLDivElement | null; + handleId: string | null; + nodeId: string; + isTarget: boolean; + nodeLookup: NodeLookup; + lib: string; + flowId: string | null; + edgeUpdaterType?: HandleType; + updateConnection: UpdateConnection; + panBy: PanBy; + cancelConnection: () => void; + onConnectStart?: OnConnectStart; + onConnect?: OnConnect; + onConnectEnd?: OnConnectEnd; + isValidConnection?: IsValidConnection; + onReconnectEnd?: (evt: MouseEvent | TouchEvent, connectionState: FinalConnectionState) => void; + getTransform: () => Transform; + getFromHandle: () => Handle | null; + autoPanSpeed?: number; +}; +export type IsValidParams = { + handle: Pick | null; + connectionMode: ConnectionMode; + fromNodeId: string; + fromHandleId: string | null; + fromType: HandleType; + isValidConnection?: IsValidConnection; + doc: Document | ShadowRoot; + lib: string; + flowId: string | null; + nodeLookup: NodeLookup; +}; +export type XYHandleInstance = { + onPointerDown: (event: MouseEvent | TouchEvent, params: OnPointerDownParams) => void; + isValid: (event: MouseEvent | TouchEvent, params: IsValidParams) => Result; +}; +export type Result = { + handleDomNode: Element | null; + isValid: boolean; + connection: Connection | null; + toHandle: Handle | null; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/xyhandle/types.d.ts.map b/node_modules/@xyflow/system/dist/esm/xyhandle/types.d.ts.map new file mode 100644 index 0000000..613bcc2 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/xyhandle/types.d.ts.map @@ -0,0 +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,EACtB,UAAU,EACV,oBAAoB,EACrB,MAAM,UAAU,CAAC;AAElB,MAAM,MAAM,mBAAmB,GAAG;IAChC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,cAAc,CAAC;IAC/B,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,cAAc,GAAG,IAAI,CAAC;IAC/B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,UAAU,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,eAAe,CAAC,EAAE,UAAU,CAAC;IAC7B,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,KAAK,EAAE,KAAK,CAAC;IACb,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,UAAU,GAAG,UAAU,EAAE,eAAe,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC/F,YAAY,EAAE,MAAM,SAAS,CAAC;IAC9B,aAAa,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IACnC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,GAAG,IAAI,GAAG,MAAM,CAAC,GAAG,IAAI,CAAC;IACtD,cAAc,EAAE,cAAc,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,EAAE,UAAU,CAAC;IACrB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,GAAG,EAAE,QAAQ,GAAG,UAAU,CAAC;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,aAAa,EAAE,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,EAAE,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,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"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/xyhandle/utils.d.ts b/node_modules/@xyflow/system/dist/esm/xyhandle/utils.d.ts new file mode 100644 index 0000000..e14f655 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/xyhandle/utils.d.ts @@ -0,0 +1,10 @@ +import type { HandleType, XYPosition, Handle, NodeLookup, ConnectionMode } from '../types'; +export declare function getClosestHandle(position: XYPosition, connectionRadius: number, nodeLookup: NodeLookup, fromHandle: { + nodeId: string; + type: HandleType; + id?: string | null; +}): Handle | null; +export declare function getHandle(nodeId: string, handleType: HandleType, handleId: string | null, nodeLookup: NodeLookup, connectionMode: ConnectionMode, withAbsolutePosition?: boolean): Handle | null; +export declare function getHandleType(edgeUpdaterType: HandleType | undefined, handleDomNode: Element | null): HandleType | null; +export declare function isConnectionValid(isInsideConnectionRadius: boolean, isHandleValid: boolean): boolean | null; +//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/xyhandle/utils.d.ts.map b/node_modules/@xyflow/system/dist/esm/xyhandle/utils.d.ts.map new file mode 100644 index 0000000..18c448a --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/xyhandle/utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/xyhandle/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAoB,UAAU,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AA0B7G,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,UAAU,EACpB,gBAAgB,EAAE,MAAM,EACxB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,UAAU,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GACnE,MAAM,GAAG,IAAI,CA2Cf;AAED,wBAAgB,SAAS,CACvB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,MAAM,GAAG,IAAI,EACvB,UAAU,EAAE,UAAU,EACtB,cAAc,EAAE,cAAc,EAC9B,oBAAoB,UAAQ,GAC3B,MAAM,GAAG,IAAI,CAef;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"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/xyminimap/index.d.ts b/node_modules/@xyflow/system/dist/esm/xyminimap/index.d.ts new file mode 100644 index 0000000..b881bdf --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/xyminimap/index.d.ts @@ -0,0 +1,28 @@ +import { pointer } from 'd3-selection'; +import type { CoordinateExtent, PanZoomInstance, Transform } from '../types'; +export type XYMinimapInstance = { + update: (params: XYMinimapUpdate) => void; + destroy: () => void; + pointer: typeof pointer; +}; +export type XYMinimapParams = { + panZoom: PanZoomInstance; + domNode: Element; + getTransform: () => Transform; + getViewScale: () => number; +}; +export type XYMinimapUpdate = { + translateExtent: CoordinateExtent; + width: number; + height: number; + inversePan?: boolean; + zoomStep?: number; + pannable?: boolean; + zoomable?: boolean; +}; +export declare function XYMinimap({ domNode, panZoom, getTransform, getViewScale }: XYMinimapParams): { + update: ({ translateExtent, width, height, zoomStep, pannable, zoomable, inversePan, }: XYMinimapUpdate) => void; + destroy: () => void; + pointer: typeof pointer; +}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/xyminimap/index.d.ts.map b/node_modules/@xyflow/system/dist/esm/xyminimap/index.d.ts.map new file mode 100644 index 0000000..21b2e05 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/xyminimap/index.d.ts.map @@ -0,0 +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;;;EAsFnB"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/xypanzoom/XYPanZoom.d.ts b/node_modules/@xyflow/system/dist/esm/xypanzoom/XYPanZoom.d.ts new file mode 100644 index 0000000..89085c4 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/xypanzoom/XYPanZoom.d.ts @@ -0,0 +1,12 @@ +import { type Viewport, PanZoomParams, PanZoomInstance } from '../types'; +export type ZoomPanValues = { + isZoomingOrPanning: boolean; + usedRightMouseButton: boolean; + prevViewport: Viewport; + mouseButton: number; + timerId: ReturnType | undefined; + panScrollTimeout: ReturnType | undefined; + isPanScrolling: boolean; +}; +export declare function XYPanZoom({ domNode, minZoom, maxZoom, paneClickDistance, translateExtent, viewport, onPanZoom, onPanZoomStart, onPanZoomEnd, onDraggingChange, }: PanZoomParams): PanZoomInstance; +//# sourceMappingURL=XYPanZoom.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/xypanzoom/XYPanZoom.d.ts.map b/node_modules/@xyflow/system/dist/esm/xypanzoom/XYPanZoom.d.ts.map new file mode 100644 index 0000000..d3d61ee --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/xypanzoom/XYPanZoom.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"XYPanZoom.d.ts","sourceRoot":"","sources":["../../src/xypanzoom/XYPanZoom.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,QAAQ,EAGb,aAAa,EACb,eAAe,EAChB,MAAM,UAAU,CAAC;AAclB,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;IACnD,gBAAgB,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,GAAG,SAAS,CAAC;IAC5D,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,wBAAgB,SAAS,CAAC,EACxB,OAAO,EACP,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,eAAe,EACf,QAAQ,EACR,SAAS,EACT,cAAc,EACd,YAAY,EACZ,gBAAgB,GACjB,EAAE,aAAa,GAAG,eAAe,CA0PjC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/xypanzoom/eventhandler.d.ts b/node_modules/@xyflow/system/dist/esm/xypanzoom/eventhandler.d.ts new file mode 100644 index 0000000..42ee4f4 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/xypanzoom/eventhandler.d.ts @@ -0,0 +1,46 @@ +import type { D3ZoomEvent } from 'd3-zoom'; +import { PanOnScrollMode, type D3SelectionInstance, type D3ZoomHandler, type D3ZoomInstance, type OnPanZoom, type OnDraggingChange, type OnTransformChange } from '../types'; +import { ZoomPanValues } from './XYPanZoom'; +export type PanOnScrollParams = { + zoomPanValues: ZoomPanValues; + noWheelClassName: string; + d3Selection: D3SelectionInstance; + d3Zoom: D3ZoomInstance; + panOnScrollMode: PanOnScrollMode; + panOnScrollSpeed: number; + zoomOnPinch: boolean; + onPanZoomStart?: OnPanZoom; + onPanZoom?: OnPanZoom; + onPanZoomEnd?: OnPanZoom; +}; +export type ZoomOnScrollParams = { + noWheelClassName: string; + preventScrolling: boolean; + d3ZoomHandler: D3ZoomHandler; +}; +export type PanZoomStartParams = { + zoomPanValues: ZoomPanValues; + onDraggingChange: OnDraggingChange; + onPanZoomStart?: OnPanZoom; +}; +export type PanZoomParams = { + zoomPanValues: ZoomPanValues; + panOnDrag: boolean | number[]; + onPaneContextMenu: boolean; + onTransformChange: OnTransformChange; + onPanZoom?: OnPanZoom; +}; +export type PanZoomEndParams = { + zoomPanValues: ZoomPanValues; + panOnDrag: boolean | number[]; + panOnScroll: boolean; + onDraggingChange: (isDragging: boolean) => void; + onPanZoomEnd?: OnPanZoom; + onPaneContextMenu?: (event: any) => void; +}; +export declare function createPanOnScrollHandler({ zoomPanValues, noWheelClassName, d3Selection, d3Zoom, panOnScrollMode, panOnScrollSpeed, zoomOnPinch, onPanZoomStart, onPanZoom, onPanZoomEnd, }: PanOnScrollParams): (event: any) => false | undefined; +export declare function createZoomOnScrollHandler({ noWheelClassName, preventScrolling, d3ZoomHandler }: ZoomOnScrollParams): (this: Element, event: any, d: unknown) => null | undefined; +export declare function createPanZoomStartHandler({ zoomPanValues, onDraggingChange, onPanZoomStart }: PanZoomStartParams): (event: D3ZoomEvent) => void; +export declare function createPanZoomHandler({ zoomPanValues, panOnDrag, onPaneContextMenu, onTransformChange, onPanZoom, }: PanZoomParams): (event: D3ZoomEvent) => void; +export declare function createPanZoomEndHandler({ zoomPanValues, panOnDrag, panOnScroll, onDraggingChange, onPanZoomEnd, onPaneContextMenu, }: PanZoomEndParams): (event: D3ZoomEvent) => void; +//# sourceMappingURL=eventhandler.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/xypanzoom/eventhandler.d.ts.map b/node_modules/@xyflow/system/dist/esm/xypanzoom/eventhandler.d.ts.map new file mode 100644 index 0000000..51f6fd7 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/xypanzoom/eventhandler.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"eventhandler.d.ts","sourceRoot":"","sources":["../../src/xypanzoom/eventhandler.ts"],"names":[],"mappings":"AAEA,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,gBAAgB,EACrB,KAAK,iBAAiB,EACvB,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,aAAa,EAAE,aAAa,CAAC;IAC7B,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;IACrB,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,YAAY,CAAC,EAAE,SAAS,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,aAAa,EAAE,aAAa,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,aAAa,EAAE,aAAa,CAAC;IAC7B,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,cAAc,CAAC,EAAE,SAAS,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,aAAa,EAAE,aAAa,CAAC;IAC7B,SAAS,EAAE,OAAO,GAAG,MAAM,EAAE,CAAC;IAC9B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,aAAa,EAAE,aAAa,CAAC;IAC7B,SAAS,EAAE,OAAO,GAAG,MAAM,EAAE,CAAC;IAC9B,WAAW,EAAE,OAAO,CAAC;IACrB,gBAAgB,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;CAC1C,CAAC;AAEF,wBAAgB,wBAAwB,CAAC,EACvC,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,MAAM,EACN,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,cAAc,EACd,SAAS,EACT,YAAY,GACb,EAAE,iBAAiB,WACH,GAAG,uBAmEnB;AAED,wBAAgB,yBAAyB,CAAC,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,EAAE,kBAAkB,UAC1F,OAAO,SAAS,GAAG,KAAK,OAAO,sBAmBvD;AAED,wBAAgB,yBAAyB,CAAC,EAAE,aAAa,EAAE,gBAAgB,EAAE,cAAc,EAAE,EAAE,kBAAkB,WAChG,WAAW,CAAC,cAAc,EAAE,GAAG,CAAC,UAoBhD;AAED,wBAAgB,oBAAoB,CAAC,EACnC,aAAa,EACb,SAAS,EACT,iBAAiB,EACjB,iBAAiB,EACjB,SAAS,GACV,EAAE,aAAa,WACC,WAAW,CAAC,cAAc,EAAE,GAAG,CAAC,UAahD;AAED,wBAAgB,uBAAuB,CAAC,EACtC,aAAa,EACb,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,GAClB,EAAE,gBAAgB,WACF,WAAW,CAAC,cAAc,EAAE,GAAG,CAAC,UAiChD"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/xypanzoom/filter.d.ts b/node_modules/@xyflow/system/dist/esm/xypanzoom/filter.d.ts new file mode 100644 index 0000000..a4179f4 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/xypanzoom/filter.d.ts @@ -0,0 +1,14 @@ +export type FilterParams = { + zoomActivationKeyPressed: boolean; + zoomOnScroll: boolean; + zoomOnPinch: boolean; + panOnDrag: boolean | number[]; + panOnScroll: boolean; + zoomOnDoubleClick: boolean; + userSelectionActive: boolean; + noWheelClassName: string; + noPanClassName: string; + lib: string; +}; +export declare function createFilter({ zoomActivationKeyPressed, zoomOnScroll, zoomOnPinch, panOnDrag, panOnScroll, zoomOnDoubleClick, userSelectionActive, noWheelClassName, noPanClassName, lib, }: FilterParams): (event: any) => boolean; +//# sourceMappingURL=filter.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/xypanzoom/filter.d.ts.map b/node_modules/@xyflow/system/dist/esm/xypanzoom/filter.d.ts.map new file mode 100644 index 0000000..1fbd76e --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/xypanzoom/filter.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../src/xypanzoom/filter.ts"],"names":[],"mappings":"AAGA,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,CAkE7B"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/xypanzoom/index.d.ts b/node_modules/@xyflow/system/dist/esm/xypanzoom/index.d.ts new file mode 100644 index 0000000..eaeb1d6 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/xypanzoom/index.d.ts @@ -0,0 +1,2 @@ +export * from './XYPanZoom'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/xypanzoom/index.d.ts.map b/node_modules/@xyflow/system/dist/esm/xypanzoom/index.d.ts.map new file mode 100644 index 0000000..b4758d7 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/xypanzoom/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/xypanzoom/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/xypanzoom/utils.d.ts b/node_modules/@xyflow/system/dist/esm/xypanzoom/utils.d.ts new file mode 100644 index 0000000..ff0513c --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/xypanzoom/utils.d.ts @@ -0,0 +1,10 @@ +import { type ZoomTransform } from 'd3-zoom'; +import { type D3SelectionInstance, type Viewport } from '../types'; +export declare const viewChanged: (prevViewport: Viewport, eventViewport: any) => boolean; +export declare const transformToViewport: (transform: ZoomTransform) => Viewport; +export declare const viewportToTransform: ({ x, y, zoom }: Viewport) => ZoomTransform; +export declare const isWrappedWithClass: (event: any, className: string | undefined) => any; +export declare const isRightClickPan: (panOnDrag: boolean | number[], usedButton: number) => boolean; +export declare const getD3Transition: (selection: D3SelectionInstance, duration?: number, ease?: (t: number) => number, onEnd?: () => void) => D3SelectionInstance | import("d3-transition").Transition; +export declare const wheelDelta: (event: any) => number; +//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/xypanzoom/utils.d.ts.map b/node_modules/@xyflow/system/dist/esm/xypanzoom/utils.d.ts.map new file mode 100644 index 0000000..6a33daf --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/xypanzoom/utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/xypanzoom/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAgB,MAAM,SAAS,CAAC;AAI3D,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGnE,eAAO,MAAM,WAAW,iBAAkB,QAAQ,iBAAiB,GAAG,KAAG,OAC0C,CAAC;AAEpH,eAAO,MAAM,mBAAmB,cAAe,aAAa,KAAG,QAI7D,CAAC;AAEH,eAAO,MAAM,mBAAmB,mBAAoB,QAAQ,KAAG,aACrB,CAAC;AAE3C,eAAO,MAAM,kBAAkB,UAAW,GAAG,aAAa,MAAM,GAAG,SAAS,QAA0C,CAAC;AAEvH,eAAO,MAAM,eAAe,cAAe,OAAO,GAAG,MAAM,EAAE,cAAc,MAAM,YACV,CAAC;AAKxE,eAAO,MAAM,eAAe,cAAe,mBAAmB,gCAFtC,MAAM,+HAU7B,CAAC;AAEF,eAAO,MAAM,UAAU,UAAW,GAAG,WAIpC,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/xyresizer/XYResizer.d.ts b/node_modules/@xyflow/system/dist/esm/xyresizer/XYResizer.d.ts new file mode 100644 index 0000000..097ad19 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/xyresizer/XYResizer.d.ts @@ -0,0 +1,49 @@ +import type { CoordinateExtent, NodeLookup, NodeOrigin, Transform, XYPosition } from '../types'; +import type { OnResize, OnResizeEnd, OnResizeStart, ShouldResize, ControlPosition, ResizeControlDirection } from './types'; +export type XYResizerChange = { + x?: number; + y?: number; + width?: number; + height?: number; +}; +export type XYResizerChildChange = { + id: string; + position: XYPosition; + extent?: 'parent' | CoordinateExtent; +}; +type XYResizerParams = { + domNode: HTMLDivElement; + nodeId: string; + getStoreItems: () => { + nodeLookup: NodeLookup; + transform: Transform; + snapGrid?: [number, number]; + snapToGrid: boolean; + nodeOrigin: NodeOrigin; + paneDomNode: HTMLDivElement | null; + }; + onChange: (changes: XYResizerChange, childChanges: XYResizerChildChange[]) => void; + onEnd?: (change: Required) => void; +}; +type XYResizerUpdateParams = { + controlPosition: ControlPosition; + boundaries: { + minWidth: number; + minHeight: number; + maxWidth: number; + maxHeight: number; + }; + keepAspectRatio: boolean; + resizeDirection?: ResizeControlDirection; + onResizeStart: OnResizeStart | undefined; + onResize: OnResize | undefined; + onResizeEnd: OnResizeEnd | undefined; + shouldResize: ShouldResize | undefined; +}; +export type XYResizerInstance = { + update: (params: XYResizerUpdateParams) => void; + destroy: () => void; +}; +export declare function XYResizer({ domNode, nodeId, getStoreItems, onChange, onEnd }: XYResizerParams): XYResizerInstance; +export {}; +//# sourceMappingURL=XYResizer.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/xyresizer/XYResizer.d.ts.map b/node_modules/@xyflow/system/dist/esm/xyresizer/XYResizer.d.ts.map new file mode 100644 index 0000000..b37e0a8 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/xyresizer/XYResizer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"XYResizer.d.ts","sourceRoot":"","sources":["../../src/xyresizer/XYResizer.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,gBAAgB,EAGhB,UAAU,EACV,UAAU,EACV,SAAS,EACT,UAAU,EACX,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EACV,QAAQ,EACR,WAAW,EACX,aAAa,EAEb,YAAY,EACZ,eAAe,EACf,sBAAsB,EACvB,MAAM,SAAS,CAAC;AAWjB,MAAM,MAAM,eAAe,GAAG;IAC5B,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,UAAU,CAAC;IACrB,MAAM,CAAC,EAAE,QAAQ,GAAG,gBAAgB,CAAC;CACtC,CAAC;AAEF,KAAK,eAAe,GAAG;IACrB,OAAO,EAAE,cAAc,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM;QACnB,UAAU,EAAE,UAAU,CAAC;QACvB,SAAS,EAAE,SAAS,CAAC;QACrB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC5B,UAAU,EAAE,OAAO,CAAC;QACpB,UAAU,EAAE,UAAU,CAAC;QACvB,WAAW,EAAE,cAAc,GAAG,IAAI,CAAC;KACpC,CAAC;IACF,QAAQ,EAAE,CAAC,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,oBAAoB,EAAE,KAAK,IAAI,CAAC;IACnF,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC;CACrD,CAAC;AAEF,KAAK,qBAAqB,GAAG;IAC3B,eAAe,EAAE,eAAe,CAAC;IACjC,UAAU,EAAE;QACV,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,eAAe,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,sBAAsB,CAAC;IACzC,aAAa,EAAE,aAAa,GAAG,SAAS,CAAC;IACzC,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC/B,WAAW,EAAE,WAAW,GAAG,SAAS,CAAC;IACrC,YAAY,EAAE,YAAY,GAAG,SAAS,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,CAAC,MAAM,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAChD,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAuBF,wBAAgB,SAAS,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,eAAe,GAAG,iBAAiB,CAyNjH"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/xyresizer/index.d.ts b/node_modules/@xyflow/system/dist/esm/xyresizer/index.d.ts new file mode 100644 index 0000000..b26a0e6 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/xyresizer/index.d.ts @@ -0,0 +1,3 @@ +export * from './types'; +export * from './XYResizer'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/xyresizer/index.d.ts.map b/node_modules/@xyflow/system/dist/esm/xyresizer/index.d.ts.map new file mode 100644 index 0000000..aa841ae --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/xyresizer/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/xyresizer/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/xyresizer/types.d.ts b/node_modules/@xyflow/system/dist/esm/xyresizer/types.d.ts new file mode 100644 index 0000000..212e450 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/xyresizer/types.d.ts @@ -0,0 +1,46 @@ +import type { D3DragEvent, SubjectPosition } from 'd3-drag'; +export type ResizeParams = { + x: number; + y: number; + width: number; + height: number; +}; +export type ResizeParamsWithDirection = ResizeParams & { + direction: number[]; +}; +/** + * Used to determine the control line position of the NodeResizer + * + * @public + */ +export type ControlLinePosition = 'top' | 'bottom' | 'left' | 'right'; +/** + * Used to determine the control position of the NodeResizer + * + * @public + */ +export type ControlPosition = ControlLinePosition | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'; +/** + * Used to determine the variant of the resize control + * + * @public + */ +export declare enum ResizeControlVariant { + Line = "line", + Handle = "handle" +} +/** + * The direction the user can resize the node. + * @public + */ +export type ResizeControlDirection = 'horizontal' | 'vertical'; +export declare const XY_RESIZER_HANDLE_POSITIONS: ControlPosition[]; +export declare const XY_RESIZER_LINE_POSITIONS: ControlLinePosition[]; +type OnResizeHandler = (event: ResizeDragEvent, params: Params) => Result; +export type ResizeDragEvent = D3DragEvent; +export type ShouldResize = OnResizeHandler; +export type OnResizeStart = OnResizeHandler; +export type OnResize = OnResizeHandler; +export type OnResizeEnd = OnResizeHandler; +export {}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/xyresizer/types.d.ts.map b/node_modules/@xyflow/system/dist/esm/xyresizer/types.d.ts.map new file mode 100644 index 0000000..ec347bf --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/xyresizer/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/xyresizer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE5D,MAAM,MAAM,YAAY,GAAG;IACzB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,YAAY,GAAG;IACrD,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAEtE;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,mBAAmB,GAAG,UAAU,GAAG,WAAW,GAAG,aAAa,GAAG,cAAc,CAAC;AAE9G;;;;GAIG;AACH,oBAAY,oBAAoB;IAC9B,IAAI,SAAS;IACb,MAAM,WAAW;CAClB;AAED;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,YAAY,GAAG,UAAU,CAAC;AAE/D,eAAO,MAAM,2BAA2B,EAAE,eAAe,EAA6D,CAAC;AACvH,eAAO,MAAM,yBAAyB,EAAE,mBAAmB,EAAuC,CAAC;AAEnG,KAAK,eAAe,CAAC,MAAM,GAAG,YAAY,EAAE,MAAM,GAAG,IAAI,IAAI,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;AAChH,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC,cAAc,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC;AAEjF,MAAM,MAAM,YAAY,GAAG,eAAe,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC;AAC/E,MAAM,MAAM,aAAa,GAAG,eAAe,CAAC;AAC5C,MAAM,MAAM,QAAQ,GAAG,eAAe,CAAC,yBAAyB,CAAC,CAAC;AAClE,MAAM,MAAM,WAAW,GAAG,eAAe,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/xyresizer/utils.d.ts b/node_modules/@xyflow/system/dist/esm/xyresizer/utils.d.ts new file mode 100644 index 0000000..24a7f40 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/xyresizer/utils.d.ts @@ -0,0 +1,76 @@ +import { CoordinateExtent, NodeOrigin } from '../types'; +import { getPointerPosition } from '../utils'; +import { ControlPosition } from './types'; +type GetResizeDirectionParams = { + width: number; + prevWidth: number; + height: number; + prevHeight: number; + affectsX: boolean; + affectsY: boolean; +}; +/** + * Get all connecting edges for a given set of nodes + * @param width - new width of the node + * @param prevWidth - previous width of the node + * @param height - new height of the node + * @param prevHeight - previous height of the node + * @param affectsX - whether to invert the resize direction for the x axis + * @param affectsY - whether to invert the resize direction for the y axis + * @returns array of two numbers representing the direction of the resize for each axis, 0 = no change, 1 = increase, -1 = decrease + */ +export declare function getResizeDirection({ width, prevWidth, height, prevHeight, affectsX, affectsY, }: GetResizeDirectionParams): number[]; +/** + * Parses the control position that is being dragged to dimensions that are being resized + * @param controlPosition - position of the control that is being dragged + * @returns isHorizontal, isVertical, affectsX, affectsY, + */ +export declare function getControlDirection(controlPosition: ControlPosition): { + isHorizontal: boolean; + isVertical: boolean; + affectsX: boolean; + affectsY: boolean; +}; +type PrevValues = { + width: number; + height: number; + x: number; + y: number; +}; +type StartValues = PrevValues & { + pointerX: number; + pointerY: number; + aspectRatio: number; +}; +/** + * Calculates new width & height and x & y of node after resize based on pointer position + * @description - Buckle up, this is a chunky one... If you want to determine the new dimensions of a node after a resize, + * you have to account for all possible restrictions: min/max width/height of the node, the maximum extent the node is allowed + * to move in (in this case: resize into) determined by the parent node, the minimal extent determined by child nodes + * with expandParent or extent: 'parent' set and oh yeah, these things also have to work with keepAspectRatio! + * The way this is done is by determining how much each of these restricting actually restricts the resize and then applying the + * strongest restriction. Because the resize affects x, y and width, height and width, height of a opposing side with keepAspectRatio, + * the resize amount is always kept in distX & distY amount (the distance in mouse movement) + * Instead of clamping each value, we first calculate the biggest 'clamp' (for the lack of a better name) and then apply it to all values. + * To complicate things nodeOrigin has to be taken into account as well. This is done by offsetting the nodes as if their origin is [0, 0], + * then calculating the restrictions as usual + * @param startValues - starting values of resize + * @param controlDirection - dimensions affected by the resize + * @param pointerPosition - the current pointer position corrected for snapping + * @param boundaries - minimum and maximum dimensions of the node + * @param keepAspectRatio - prevent changes of asprect ratio + * @returns x, y, width and height of the node after resize + */ +export declare function getDimensionsAfterResize(startValues: StartValues, controlDirection: ReturnType, pointerPosition: ReturnType, boundaries: { + minWidth: number; + maxWidth: number; + minHeight: number; + maxHeight: number; +}, keepAspectRatio: boolean, nodeOrigin: NodeOrigin, extent?: CoordinateExtent, childExtent?: CoordinateExtent): { + width: number; + height: number; + x: number; + y: number; +}; +export {}; +//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/esm/xyresizer/utils.d.ts.map b/node_modules/@xyflow/system/dist/esm/xyresizer/utils.d.ts.map new file mode 100644 index 0000000..870b9c6 --- /dev/null +++ b/node_modules/@xyflow/system/dist/esm/xyresizer/utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/xyresizer/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,KAAK,wBAAwB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,SAAS,EACT,MAAM,EACN,UAAU,EACV,QAAQ,EACR,QAAQ,GACT,EAAE,wBAAwB,YAc1B;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,eAAe,EAAE,eAAe;;;;;EAYnE;AAED,KAAK,UAAU,GAAG;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,KAAK,WAAW,GAAG,UAAU,GAAG;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAkBF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,wBAAwB,CACtC,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,EACxD,eAAe,EAAE,UAAU,CAAC,OAAO,kBAAkB,CAAC,EACtD,UAAU,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,EACxF,eAAe,EAAE,OAAO,EACxB,UAAU,EAAE,UAAU,EACtB,MAAM,CAAC,EAAE,gBAAgB,EACzB,WAAW,CAAC,EAAE,gBAAgB;;;;;EA8J/B"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/constants.d.ts b/node_modules/@xyflow/system/dist/umd/constants.d.ts new file mode 100644 index 0000000..5ba9496 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/constants.d.ts @@ -0,0 +1,43 @@ +import { CoordinateExtent, HandleType } from './types'; +export declare const errorMessages: { + error001: () => string; + error002: () => string; + error003: (nodeType: string) => string; + error004: () => string; + error005: () => string; + error006: () => string; + error007: (id: string) => string; + error009: (type: string) => string; + error008: (handleType: HandleType, { id, sourceHandle, targetHandle }: { + id: string; + sourceHandle: string | null; + targetHandle: string | null; + }) => string; + error010: () => string; + error011: (edgeType: string) => string; + error012: (id: string) => string; + error013: (lib?: string) => string; + error014: () => string; + error015: () => string; +}; +export declare const infiniteExtent: CoordinateExtent; +export declare const elementSelectionKeys: string[]; +export declare const defaultAriaLabelConfig: { + 'node.a11yDescription.default': string; + 'node.a11yDescription.keyboardDisabled': string; + 'node.a11yDescription.ariaLiveMessage': ({ direction, x, y }: { + direction: string; + x: number; + y: number; + }) => string; + 'edge.a11yDescription.default': string; + 'controls.ariaLabel': string; + 'controls.zoomIn.ariaLabel': string; + 'controls.zoomOut.ariaLabel': string; + 'controls.fitView.ariaLabel': string; + 'controls.interactive.ariaLabel': string; + 'minimap.ariaLabel': string; + 'handle.ariaLabel': string; +}; +export type AriaLabelConfig = typeof defaultAriaLabelConfig; +//# sourceMappingURL=constants.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/constants.d.ts.map b/node_modules/@xyflow/system/dist/umd/constants.d.ts.map new file mode 100644 index 0000000..9294a20 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/constants.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAEvD,eAAO,MAAM,aAAa;;;yBAKH,MAAM;;;;mBAIZ,MAAM;qBACJ,MAAM;2BAET,UAAU,sCACc;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE;;yBAMzF,MAAM;mBACZ,MAAM;qBAEL,MAAM;;;CAMvB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,gBAG5B,CAAC;AAEF,eAAO,MAAM,oBAAoB,UAA2B,CAAC;AAE7D,eAAO,MAAM,sBAAsB;;;kEAK6B;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE;;;;;;;;;CAiB1G,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,OAAO,sBAAsB,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/index.d.ts b/node_modules/@xyflow/system/dist/umd/index.d.ts new file mode 100644 index 0000000..74847ff --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/index.d.ts @@ -0,0 +1,9 @@ +export * from './constants'; +export * from './types'; +export * from './utils'; +export * from './xydrag'; +export * from './xyhandle'; +export * from './xyminimap'; +export * from './xypanzoom'; +export * from './xyresizer'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/index.d.ts.map b/node_modules/@xyflow/system/dist/umd/index.d.ts.map new file mode 100644 index 0000000..804a5e3 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/index.js b/node_modules/@xyflow/system/dist/umd/index.js new file mode 100644 index 0000000..dd3897f --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/index.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).XYFlowSystem={})}(this,(function(t){"use strict";const e={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:t=>`Node type "${t}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:e,sourceHandle:n,targetHandle:o})=>`Couldn't create edge for ${t} handle id: "${"source"===t?n:o}", edge id: ${e}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},n=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],o={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:t,x:e,y:n})=>`Moved selected node ${t}. New position, x: ${e}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var r,i,a;t.ConnectionMode=void 0,(r=t.ConnectionMode||(t.ConnectionMode={})).Strict="strict",r.Loose="loose",t.PanOnScrollMode=void 0,(i=t.PanOnScrollMode||(t.PanOnScrollMode={})).Free="free",i.Vertical="vertical",i.Horizontal="horizontal",t.SelectionMode=void 0,(a=t.SelectionMode||(t.SelectionMode={})).Partial="partial",a.Full="full";var s,u,l;t.ConnectionLineType=void 0,(s=t.ConnectionLineType||(t.ConnectionLineType={})).Bezier="default",s.Straight="straight",s.Step="step",s.SmoothStep="smoothstep",s.SimpleBezier="simplebezier",t.MarkerType=void 0,(u=t.MarkerType||(t.MarkerType={})).Arrow="arrow",u.ArrowClosed="arrowclosed",t.Position=void 0,(l=t.Position||(t.Position={})).Left="left",l.Top="top",l.Right="right",l.Bottom="bottom";const c={[t.Position.Left]:t.Position.Right,[t.Position.Right]:t.Position.Left,[t.Position.Top]:t.Position.Bottom,[t.Position.Bottom]:t.Position.Top};const h=t=>"id"in t&&"source"in t&&"target"in t,d=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),f=(t,e=[0,0])=>{const{width:n,height:o}=D(t),r=t.origin??e,i=n*r[0],a=o*r[1];return{x:t.position.x-i,y:t.position.y-a}},p=(t,e={})=>{if(0===t.size)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return t.forEach((t=>{if(void 0===e.filter||e.filter(t)){const e=S(t);n=b(n,e)}})),P(n)},g=(t,e)=>{const n=new Set;return t.forEach((t=>{n.add(t.id)})),e.filter((t=>n.has(t.source)||n.has(t.target)))};function m({nodeId:t,nextPosition:n,nodeLookup:o,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){const s=o.get(t),u=s.parentId?o.get(s.parentId):void 0,{x:l,y:c}=u?u.internals.positionAbsolute:{x:0,y:0},h=s.origin??r;let d=i;if("parent"!==s.extent||s.expandParent)u&&B(s.extent)&&(d=[[s.extent[0][0]+l,s.extent[0][1]+c],[s.extent[1][0]+l,s.extent[1][1]+c]]);else if(u){const t=u.measured.width,e=u.measured.height;t&&e&&(d=[[l,c],[l+t,c+e]])}else a?.("005",e.error005());const f=B(d)?v(n,d,s.measured):n;return void 0!==s.measured.width&&void 0!==s.measured.height||a?.("015",e.error015()),{position:{x:f.x-l+(s.measured.width??0)*h[0],y:f.y-c+(s.measured.height??0)*h[1]},positionAbsolute:f}}const y=(t,e=0,n=1)=>Math.min(Math.max(t,e),n),v=(t={x:0,y:0},e,n)=>({x:y(t.x,e[0][0],e[1][0]-(n?.width??0)),y:y(t.y,e[0][1],e[1][1]-(n?.height??0))});function x(t,e,n){const{width:o,height:r}=D(n),{x:i,y:a}=n.internals.positionAbsolute;return v(t,[[i,a],[i+o,a+r]],e)}const w=(t,e,n)=>tn?-y(Math.abs(t-n),1,e)/e:0,_=(t,e,n=15,o=40)=>[w(t.x,o,e.width-o)*n,w(t.y,o,e.height-o)*n],b=(t,e)=>({x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x2,e.x2),y2:Math.max(t.y2,e.y2)}),M=({x:t,y:e,width:n,height:o})=>({x:t,y:e,x2:t+n,y2:e+o}),P=({x:t,y:e,x2:n,y2:o})=>({x:t,y:e,width:n-t,height:o-e}),E=(t,e=[0,0])=>{const{x:n,y:o}=d(t)?t.internals.positionAbsolute:f(t,e);return{x:n,y:o,width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}},S=(t,e=[0,0])=>{const{x:n,y:o}=d(t)?t.internals.positionAbsolute:f(t,e);return{x:n,y:o,x2:n+(t.measured?.width??t.width??t.initialWidth??0),y2:o+(t.measured?.height??t.height??t.initialHeight??0)}},N=(t,e)=>P(b(M(t),M(e))),z=(t,e)=>{const n=Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x)),o=Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y));return Math.ceil(n*o)},k=t=>!isNaN(t)&&isFinite(t),A=(t,e)=>{},T=(t,e=[1,1])=>({x:e[0]*Math.round(t.x/e[0]),y:e[1]*Math.round(t.y/e[1])}),I=({x:t,y:e},[n,o,r],i=!1,a=[1,1])=>{const s={x:(t-n)/r,y:(e-o)/r};return i?T(s,a):s},$=({x:t,y:e},[n,o,r])=>({x:t*r+n,y:e*r+o});function C(t,e){if("number"==typeof t)return Math.floor(.5*(e-e/(1+t)));if("string"==typeof t&&t.endsWith("px")){const e=parseFloat(t);if(!Number.isNaN(e))return Math.floor(e)}if("string"==typeof t&&t.endsWith("%")){const n=parseFloat(t);if(!Number.isNaN(n))return Math.floor(e*n*.01)}return console.error(`[React Flow] The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}const H=(t,e,n,o,r,i)=>{const a=function(t,e,n){if("string"==typeof t||"number"==typeof t){const o=C(t,n),r=C(t,e);return{top:o,right:r,bottom:o,left:r,x:2*r,y:2*o}}if("object"==typeof t){const o=C(t.top??t.y??0,n),r=C(t.bottom??t.y??0,n),i=C(t.left??t.x??0,e),a=C(t.right??t.x??0,e);return{top:o,right:a,bottom:r,left:i,x:i+a,y:o+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}(i,e,n),s=(e-a.x)/t.width,u=(n-a.y)/t.height,l=Math.min(s,u),c=y(l,o,r),h=e/2-(t.x+t.width/2)*c,d=n/2-(t.y+t.height/2)*c,f=function(t,e,n,o,r,i){const{x:a,y:s}=$(t,[e,n,o]),{x:u,y:l}=$({x:t.x+t.width,y:t.y+t.height},[e,n,o]),c=r-u,h=i-l;return{left:Math.floor(a),top:Math.floor(s),right:Math.floor(c),bottom:Math.floor(h)}}(t,h,d,c,e,n),p=Math.min(f.left-a.left,0),g=Math.min(f.top-a.top,0);return{x:h-p+Math.min(f.right-a.right,0),y:d-g+Math.min(f.bottom-a.bottom,0),zoom:c}},O=()=>"undefined"!=typeof navigator&&navigator?.userAgent?.indexOf("Mac")>=0;function B(t){return void 0!==t&&"parent"!==t}function D(t){return{width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}}function L(t,{snapGrid:e=[0,0],snapToGrid:n=!1,transform:o,containerBounds:r}){const{x:i,y:a}=q(t),s=I({x:i-(r?.left??0),y:a-(r?.top??0)},o),{x:u,y:l}=n?T(s,e):s;return{xSnapped:u,ySnapped:l,...s}}const Y=t=>({width:t.offsetWidth,height:t.offsetHeight}),X=t=>t?.getRootNode?.()||window?.document,R=["INPUT","SELECT","TEXTAREA"];const V=t=>"clientX"in t,q=(t,e)=>{const n=V(t),o=n?t.clientX:t.touches?.[0].clientX,r=n?t.clientY:t.touches?.[0].clientY;return{x:o-(e?.left??0),y:r-(e?.top??0)}},Z=(t,e,n,o,r)=>{const i=e.querySelectorAll(`.${t}`);return i&&i.length?Array.from(i).map((e=>{const i=e.getBoundingClientRect();return{id:e.getAttribute("data-handleid"),type:t,nodeId:r,position:e.getAttribute("data-handlepos"),x:(i.left-n.left)/o,y:(i.top-n.top)/o,...Y(e)}})):null};function G({sourceX:t,sourceY:e,targetX:n,targetY:o,sourceControlX:r,sourceControlY:i,targetControlX:a,targetControlY:s}){const u=.125*t+.375*r+.375*a+.125*n,l=.125*e+.375*i+.375*s+.125*o;return[u,l,Math.abs(u-t),Math.abs(l-e)]}function j(t,e){return t>=0?.5*t:25*e*Math.sqrt(-t)}function F({pos:e,x1:n,y1:o,x2:r,y2:i,c:a}){switch(e){case t.Position.Left:return[n-j(n-r,a),o];case t.Position.Right:return[n+j(r-n,a),o];case t.Position.Top:return[n,o-j(o-i,a)];case t.Position.Bottom:return[n,o+j(i-o,a)]}}function W({sourceX:t,sourceY:e,targetX:n,targetY:o}){const r=Math.abs(n-t)/2,i=n`xy-edge__${t}${e||""}-${n}${o||""}`;const U={[t.Position.Left]:{x:-1,y:0},[t.Position.Right]:{x:1,y:0},[t.Position.Top]:{x:0,y:-1},[t.Position.Bottom]:{x:0,y:1}},Q=({source:e,sourcePosition:n=t.Position.Bottom,target:o})=>n===t.Position.Left||n===t.Position.Right?e.xMath.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function tt(t){return t&&!(!t.internals.handleBounds&&!t.handles?.length)&&!!(t.measured.width||t.width||t.initialWidth)}function et(t){if(!t)return null;const e=[],n=[];for(const o of t)o.width=o.width??1,o.height=o.height??1,"source"===o.type?e.push(o):"target"===o.type&&n.push(o);return{source:e,target:n}}function nt(e,n,o=t.Position.Left,r=!1){const i=(n?.x??0)+e.internals.positionAbsolute.x,a=(n?.y??0)+e.internals.positionAbsolute.y,{width:s,height:u}=n??D(e);if(r)return{x:i+s/2,y:a+u/2};switch(n?.position??o){case t.Position.Top:return{x:i+s/2,y:a};case t.Position.Right:return{x:i+s,y:a+u/2};case t.Position.Bottom:return{x:i+s/2,y:a+u};case t.Position.Left:return{x:i,y:a+u/2}}}function ot(t,e){return t&&(e?t.find((t=>t.id===e)):t[0])||null}function rt(t,e){if(!t)return"";if("string"==typeof t)return t;return`${e?`${e}__`:""}${Object.keys(t).sort().map((e=>`${e}=${t[e]}`)).join("&")}`}const it={nodeOrigin:[0,0],nodeExtent:n,elevateNodesOnSelect:!0,defaults:{}},at={...it,checkEquality:!0};function st(t,e){const n={...t};for(const t in e)void 0!==e[t]&&(n[t]=e[t]);return n}function ut(t,e,n,o){const{elevateNodesOnSelect:r,nodeOrigin:i,nodeExtent:a}=st(it,o),s=t.parentId,u=e.get(s);if(!u)return void console.warn(`Parent node ${s} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);!function(t,e){if(!t.parentId)return;const n=e.get(t.parentId);n?n.set(t.id,t):e.set(t.parentId,new Map([[t.id,t]]))}(t,n);const l=r?1e3:0,{x:c,y:h,z:d}=function(t,e,n,o,r){const{x:i,y:a}=e.internals.positionAbsolute,s=D(t),u=f(t,n),l=B(t.extent)?v(u,t.extent,s):u;let c=v({x:i+l.x,y:a+l.y},o,s);"parent"===t.extent&&(c=x(c,s,e));const h=lt(t,r),d=e.internals.z??0;return{x:c.x,y:c.y,z:d>h?d:h}}(t,u,i,a,l),{positionAbsolute:p}=t.internals,g=c!==p.x||h!==p.y;(g||d!==t.internals.z)&&e.set(t.id,{...t,internals:{...t.internals,positionAbsolute:g?{x:c,y:h}:p,z:d}})}function lt(t,e){return(k(t.zIndex)?t.zIndex:0)+(t.selected?e:0)}function ct(t,e,n,o=[0,0]){const r=[],i=new Map;for(const n of t){const t=e.get(n.parentId);if(!t)continue;const o=i.get(n.parentId)?.expandedRect??E(t),r=N(o,n.rect);i.set(n.parentId,{expandedRect:r,parent:t})}return i.size>0&&i.forEach((({expandedRect:e,parent:i},a)=>{const s=i.internals.positionAbsolute,u=D(i),l=i.origin??o,c=e.x0||h>0||p||g)&&(r.push({id:a,type:"position",position:{x:i.position.x-c+p,y:i.position.y-h+g}}),n.get(a)?.forEach((e=>{t.some((t=>t.id===e.id))||r.push({id:e.id,type:"position",position:{x:e.position.x+c,y:e.position.y+h}})}))),(u.width{}};function ft(){for(var t,e=0,n=arguments.length,o={};e=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!o.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),a=-1,s=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a0)for(var n,o,r=new Array(n),i=0;i=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),vt.hasOwnProperty(e)?{space:vt[e],local:t}:t}function wt(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===yt&&e.documentElement.namespaceURI===yt?e.createElement(t):e.createElementNS(n,t)}}function _t(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function bt(t){var e=xt(t);return(e.local?_t:wt)(e)}function Mt(){}function Pt(t){return null==t?Mt:function(){return this.querySelector(t)}}function Et(){return[]}function St(t){return null==t?Et:function(){return this.querySelectorAll(t)}}function Nt(t){return function(){return null==(e=t.apply(this,arguments))?[]:Array.isArray(e)?e:Array.from(e);var e}}function zt(t){return function(){return this.matches(t)}}function kt(t){return function(e){return e.matches(t)}}var At=Array.prototype.find;function Tt(){return this.firstElementChild}var It=Array.prototype.filter;function $t(){return Array.from(this.children)}function Ct(t){return new Array(t.length)}function Ht(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function Ot(t,e,n,o,r,i){for(var a,s=0,u=e.length,l=i.length;se?1:t>=e?0:NaN}function Xt(t){return function(){this.removeAttribute(t)}}function Rt(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Vt(t,e){return function(){this.setAttribute(t,e)}}function qt(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Zt(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function Gt(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function jt(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Ft(t){return function(){this.style.removeProperty(t)}}function Wt(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Kt(t,e,n){return function(){var o=e.apply(this,arguments);null==o?this.style.removeProperty(t):this.style.setProperty(t,o,n)}}function Ut(t,e){return t.style.getPropertyValue(e)||jt(t).getComputedStyle(t,null).getPropertyValue(e)}function Qt(t){return function(){delete this[t]}}function Jt(t,e){return function(){this[t]=e}}function te(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function ee(t){return t.trim().split(/^|\s+/)}function ne(t){return t.classList||new oe(t)}function oe(t){this._node=t,this._names=ee(t.getAttribute("class")||"")}function re(t,e){for(var n=ne(t),o=-1,r=e.length;++o=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var Se=[null];function Ne(t,e){this._groups=t,this._parents=e}function ze(){return new Ne([[document.documentElement]],Se)}function ke(t){return"string"==typeof t?new Ne([[document.querySelector(t)]],[document.documentElement]):new Ne([[t]],Se)}function Ae(t,e){if(t=function(t){let e;for(;e=t.sourceEvent;)t=e;return t}(t),void 0===e&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=t.clientX,o.y=t.clientY,[(o=o.matrixTransform(e.getScreenCTM().inverse())).x,o.y]}if(e.getBoundingClientRect){var r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]}}return[t.pageX,t.pageY]}Ne.prototype=ze.prototype={constructor:Ne,select:function(t){"function"!=typeof t&&(t=Pt(t));for(var e=this._groups,n=e.length,o=new Array(n),r=0;r=_&&(_=w+1);!(x=y[_])&&++_=0;)(o=r[i])&&(a&&4^o.compareDocumentPosition(a)&&a.parentNode.insertBefore(o,a),a=o);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=Yt);for(var n=this._groups,o=n.length,r=new Array(o),i=0;i1?this.each((null==e?Ft:"function"==typeof e?Kt:Wt)(t,e,null==n?"":n)):Ut(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?Qt:"function"==typeof e?te:Jt)(t,e)):this.node()[t]},classed:function(t,e){var n=ee(t+"");if(arguments.length<2){for(var o=ne(this.node()),r=-1,i=n.length;++r=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}(t+""),a=i.length;if(!(arguments.length<2)){for(s=e?be:_e,o=0;o()=>t;function De(t,{sourceEvent:e,subject:n,target:o,identifier:r,active:i,x:a,y:s,dx:u,dy:l,dispatch:c}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:c}})}function Le(t){return!t.ctrlKey&&!t.button}function Ye(){return this.parentNode}function Xe(t,e){return null==e?{x:t.x,y:t.y}:e}function Re(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ve(){var t,e,n,o,r=Le,i=Ye,a=Xe,s=Re,u={},l=ft("start","drag","end"),c=0,h=0;function d(t){t.on("mousedown.drag",f).filter(s).on("touchstart.drag",m).on("touchmove.drag",y,Te).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(a,s){if(!o&&r.call(this,a,s)){var u=x(this,i.call(this,a,s),a,s,"mouse");u&&(ke(a.view).on("mousemove.drag",p,Ie).on("mouseup.drag",g,Ie),He(a.view),$e(a),n=!1,t=a.clientX,e=a.clientY,u("start",a))}}function p(o){if(Ce(o),!n){var r=o.clientX-t,i=o.clientY-e;n=r*r+i*i>h}u.mouse("drag",o)}function g(t){ke(t.view).on("mousemove.drag mouseup.drag",null),Oe(t.view,n),Ce(t),u.mouse("end",t)}function m(t,e){if(r.call(this,t,e)){var n,o,a=t.changedTouches,s=i.call(this,t,e),u=a.length;for(n=0;n0&&o.push(t);return o}(t,n,e+je);for(const n of a){const a=[...n.internals.handleBounds?.source??[],...n.internals.handleBounds?.target??[]];for(const s of a){if(o.nodeId===s.nodeId&&o.type===s.type&&o.id===s.id)continue;const{x:a,y:u}=nt(n,s,s.position,!0),l=Math.sqrt(Math.pow(a-t.x,2)+Math.pow(u-t.y,2));l>e||(l1){const t="source"===o.type?"target":"source";return r.find((e=>e.type===t))??r[0]}return r[0]}function We(t,e,n,o,r,i=!1){const a=o.get(t);if(!a)return null;const s="strict"===r?a.internals.handleBounds?.[e]:[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]],u=(n?s?.find((t=>t.id===n)):s?.[0])??null;return u&&i?{...u,...nt(a,u,u.position,!0)}:u}function Ke(t,e){return t||(e?.classList.contains("target")?"target":e?.classList.contains("source")?"source":null)}const Ue=()=>!0;function Qe(e,{handle:n,connectionMode:o,fromNodeId:r,fromHandleId:i,fromType:a,doc:s,lib:u,flowId:l,isValidConnection:c=Ue,nodeLookup:h}){const d="target"===a,f=n?s.querySelector(`.${u}-flow__handle[data-id="${l}-${n?.nodeId}-${n?.id}-${n?.type}"]`):null,{x:p,y:g}=q(e),m=s.elementFromPoint(p,g),y=m?.classList.contains(`${u}-flow__handle`)?m:f,v={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){const e=Ke(void 0,y),n=y.getAttribute("data-nodeid"),a=y.getAttribute("data-handleid"),s=y.classList.contains("connectable"),u=y.classList.contains("connectableend");if(!n||!e)return v;const l={source:d?n:r,sourceHandle:d?a:i,target:d?r:n,targetHandle:d?i:a};v.connection=l;const f=s&&u&&(o===t.ConnectionMode.Strict?d&&"source"===e||!d&&"target"===e:n!==r||a!==i);v.isValid=f&&c(l),v.toHandle=We(n,e,a,h,o,!0)}return v}const Je={onPointerDown:function(e,{connectionMode:n,connectionRadius:o,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:s,domNode:u,nodeLookup:l,lib:h,autoPanOnConnect:d,flowId:f,panBy:p,cancelConnection:g,onConnectStart:m,onConnect:y,onConnectEnd:v,isValidConnection:x=Ue,onReconnectEnd:w,updateConnection:b,getTransform:M,getFromHandle:P,autoPanSpeed:E}){const S=X(e.target);let N,z=0;const{x:k,y:A}=q(e),T=S?.elementFromPoint(k,A),C=Ke(a,T),H=u?.getBoundingClientRect();if(!H||!C)return;const O=We(i,C,r,l,n);if(!O)return;let B=q(e,H),D=!1,L=null,Y=!1,R=null;function V(){if(!d||!H)return;const[t,e]=_(B,H,E);p({x:t,y:e}),z=requestAnimationFrame(V)}const Z={...O,nodeId:i,type:C,position:O.position},G=l.get(i),j={inProgress:!0,isValid:null,from:nt(G,Z,t.Position.Left,!0),fromHandle:Z,fromPosition:Z.position,fromNode:G,to:B,toHandle:null,toPosition:c[Z.position],toNode:null};b(j);let F=j;function W(t){if(!P()||!Z)return void K(t);const e=M();B=q(t,H),N=Fe(I(B,e,!1,[1,1]),o,l,Z),D||(V(),D=!0);const a=Qe(t,{handle:N,connectionMode:n,fromNodeId:i,fromHandleId:r,fromType:s?"target":"source",isValidConnection:x,doc:S,lib:h,flowId:f,nodeLookup:l});R=a.handleDomNode,L=a.connection,Y=function(t,e){let n=null;return e?n=!0:t&&!e&&(n=!1),n}(!!N,a.isValid);const u={...F,isValid:Y,to:a.toHandle&&Y?$({x:a.toHandle.x,y:a.toHandle.y},e):B,toHandle:a.toHandle,toPosition:Y&&a.toHandle?a.toHandle.position:c[Z.position],toNode:a.toHandle?l.get(a.toHandle.nodeId):null};Y&&N&&F.toHandle&&u.toHandle&&F.toHandle.type===u.toHandle.type&&F.toHandle.nodeId===u.toHandle.nodeId&&F.toHandle.id===u.toHandle.id&&F.to.x===u.to.x&&F.to.y===u.to.y||(b(u),F=u)}function K(t){(N||R)&&L&&Y&&y?.(L);const{inProgress:e,...n}=F,o={...n,toPosition:F.toHandle?F.toPosition:null};v?.(t,o),a&&w?.(t,o),g(),cancelAnimationFrame(z),D=!1,Y=!1,L=null,R=null,S.removeEventListener("mousemove",W),S.removeEventListener("mouseup",K),S.removeEventListener("touchmove",W),S.removeEventListener("touchend",K)}m?.(e,{nodeId:i,handleId:r,handleType:C}),S.addEventListener("mousemove",W),S.addEventListener("mouseup",K),S.addEventListener("touchmove",W),S.addEventListener("touchend",K)},isValid:Qe};function tn(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function en(t,e){var n=Object.create(t.prototype);for(var o in e)n[o]=e[o];return n}function nn(){}var on=.7,rn=1/on,an="\\s*([+-]?\\d+)\\s*",sn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",un="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ln=/^#([0-9a-f]{3,8})$/,cn=new RegExp(`^rgb\\(${an},${an},${an}\\)$`),hn=new RegExp(`^rgb\\(${un},${un},${un}\\)$`),dn=new RegExp(`^rgba\\(${an},${an},${an},${sn}\\)$`),fn=new RegExp(`^rgba\\(${un},${un},${un},${sn}\\)$`),pn=new RegExp(`^hsl\\(${sn},${un},${un}\\)$`),gn=new RegExp(`^hsla\\(${sn},${un},${un},${sn}\\)$`),mn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function yn(){return this.rgb().formatHex()}function vn(){return this.rgb().formatRgb()}function xn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=ln.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?wn(e):3===n?new Mn(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?_n(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?_n(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=cn.exec(t))?new Mn(e[1],e[2],e[3],1):(e=hn.exec(t))?new Mn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=dn.exec(t))?_n(e[1],e[2],e[3],e[4]):(e=fn.exec(t))?_n(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=pn.exec(t))?kn(e[1],e[2]/100,e[3]/100,1):(e=gn.exec(t))?kn(e[1],e[2]/100,e[3]/100,e[4]):mn.hasOwnProperty(t)?wn(mn[t]):"transparent"===t?new Mn(NaN,NaN,NaN,0):null}function wn(t){return new Mn(t>>16&255,t>>8&255,255&t,1)}function _n(t,e,n,o){return o<=0&&(t=e=n=NaN),new Mn(t,e,n,o)}function bn(t,e,n,o){return 1===arguments.length?((r=t)instanceof nn||(r=xn(r)),r?new Mn((r=r.rgb()).r,r.g,r.b,r.opacity):new Mn):new Mn(t,e,n,null==o?1:o);var r}function Mn(t,e,n,o){this.r=+t,this.g=+e,this.b=+n,this.opacity=+o}function Pn(){return`#${zn(this.r)}${zn(this.g)}${zn(this.b)}`}function En(){const t=Sn(this.opacity);return`${1===t?"rgb(":"rgba("}${Nn(this.r)}, ${Nn(this.g)}, ${Nn(this.b)}${1===t?")":`, ${t})`}`}function Sn(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Nn(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function zn(t){return((t=Nn(t))<16?"0":"")+t.toString(16)}function kn(t,e,n,o){return o<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Tn(t,e,n,o)}function An(t){if(t instanceof Tn)return new Tn(t.h,t.s,t.l,t.opacity);if(t instanceof nn||(t=xn(t)),!t)return new Tn;if(t instanceof Tn)return t;var e=(t=t.rgb()).r/255,n=t.g/255,o=t.b/255,r=Math.min(e,n,o),i=Math.max(e,n,o),a=NaN,s=i-r,u=(i+r)/2;return s?(a=e===i?(n-o)/s+6*(n0&&u<1?0:a,new Tn(a,s,u,t.opacity)}function Tn(t,e,n,o){this.h=+t,this.s=+e,this.l=+n,this.opacity=+o}function In(t){return(t=(t||0)%360)<0?t+360:t}function $n(t){return Math.max(0,Math.min(1,t||0))}function Cn(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}tn(nn,xn,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:yn,formatHex:yn,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return An(this).formatHsl()},formatRgb:vn,toString:vn}),tn(Mn,bn,en(nn,{brighter(t){return t=null==t?rn:Math.pow(rn,t),new Mn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?on:Math.pow(on,t),new Mn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Mn(Nn(this.r),Nn(this.g),Nn(this.b),Sn(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Pn,formatHex:Pn,formatHex8:function(){return`#${zn(this.r)}${zn(this.g)}${zn(this.b)}${zn(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:En,toString:En})),tn(Tn,(function(t,e,n,o){return 1===arguments.length?An(t):new Tn(t,e,n,null==o?1:o)}),en(nn,{brighter(t){return t=null==t?rn:Math.pow(rn,t),new Tn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?on:Math.pow(on,t),new Tn(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*e,r=2*n-o;return new Mn(Cn(t>=240?t-240:t+120,r,o),Cn(t,r,o),Cn(t<120?t+240:t-120,r,o),this.opacity)},clamp(){return new Tn(In(this.h),$n(this.s),$n(this.l),Sn(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Sn(this.opacity);return`${1===t?"hsl(":"hsla("}${In(this.h)}, ${100*$n(this.s)}%, ${100*$n(this.l)}%${1===t?")":`, ${t})`}`}}));var Hn=t=>()=>t;function On(t){return 1==(t=+t)?Bn:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(o){return Math.pow(t+o*e,n)}}(e,n,t):Hn(isNaN(e)?n:e)}}function Bn(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):Hn(isNaN(t)?e:t)}var Dn=function t(e){var n=On(e);function o(t,e){var o=n((t=bn(t)).r,(e=bn(e)).r),r=n(t.g,e.g),i=n(t.b,e.b),a=Bn(t.opacity,e.opacity);return function(e){return t.r=o(e),t.g=r(e),t.b=i(e),t.opacity=a(e),t+""}}return o.gamma=t,o}(1);function Ln(t,e){e||(e=[]);var n,o=t?Math.min(e.length,t.length):0,r=e.slice();return function(i){for(n=0;ni&&(r=e.slice(i,r),s[a]?s[a]+=r:s[++a]=r),(n=n[0])===(o=o[0])?s[a]?s[a]+=o:s[++a]=o:(s[++a]=null,u.push({i:a,x:Rn(n,o)})),i=Zn.lastIndex;return i180?e+=360:e-t>180&&(t+=360),i.push({i:n.push(r(n)+"rotate(",null,o)-2,x:Rn(t,e)})):e&&n.push(r(n)+"rotate("+e+o)}(i.rotate,a.rotate,s,u),function(t,e,n,i){t!==e?i.push({i:n.push(r(n)+"skewX(",null,o)-2,x:Rn(t,e)}):e&&n.push(r(n)+"skewX("+e+o)}(i.skewX,a.skewX,s,u),function(t,e,n,o,i,a){if(t!==n||e!==o){var s=i.push(r(i)+"scale(",null,",",null,")");a.push({i:s-4,x:Rn(t,n)},{i:s-2,x:Rn(e,o)})}else 1===n&&1===o||i.push(r(i)+"scale("+n+","+o+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,s,u),i=a=null,function(t){for(var e,n=-1,o=u.length;++n=0&&e._call.call(void 0,t),e=e._next;--io}()}finally{io=0,function(){var t,e,n=no,o=1/0;for(;n;)n._call?(o>n._time&&(o=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:no=e);oo=t,_o(o)}(),co=0}}function wo(){var t=fo.now(),e=t-lo;e>uo&&(ho-=e,lo=t)}function _o(t){io||(ao&&(ao=clearTimeout(ao)),t-co>24?(t<1/0&&(ao=setTimeout(xo,t-fo.now()-ho)),so&&(so=clearInterval(so))):(so||(lo=fo.now(),so=setInterval(wo,uo)),io=1,po(xo)))}function bo(t,e,n){var o=new yo;return e=null==e?0:+e,o.restart((n=>{o.stop(),t(n+e)}),e,n),o}yo.prototype=vo.prototype={constructor:yo,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?go():+n)+(null==e?0:+e),this._next||oo===this||(oo?oo._next=this:no=this,oo=this),this._call=t,this._time=n,_o()},stop:function(){this._call&&(this._call=null,this._time=1/0,_o())}};var Mo=ft("start","end","cancel","interrupt"),Po=[],Eo=0,So=1,No=2,zo=3,ko=4,Ao=5,To=6;function Io(t,e,n,o,r,i){var a=t.__transition;if(a){if(n in a)return}else t.__transition={};!function(t,e,n){var o,r=t.__transition;function i(t){n.state=So,n.timer.restart(a,n.delay,n.time),n.delay<=t&&a(t-n.delay)}function a(i){var l,c,h,d;if(n.state!==So)return u();for(l in r)if((d=r[l]).name===n.name){if(d.state===zo)return bo(a);d.state===ko?(d.state=To,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[l]):+lEo)throw new Error("too late; already scheduled");return n}function Co(t,e){var n=Ho(t,e);if(n.state>zo)throw new Error("too late; already running");return n}function Ho(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Oo(t,e){var n,o,r,i=t.__transition,a=!0;if(i){for(r in e=null==e?null:e+"",i)(n=i[r]).name===e?(o=n.state>No&&n.state=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?$o:Co;return function(){var a=i(this,t),s=a.on;s!==o&&(r=(o=s).copy()).on(e,n),a.on=r}}(n,t,e))},attr:function(t,e){var n=xt(t),o="transform"===n?to:Yo;return this.attrTween(t,"function"==typeof e?(n.local?Go:Zo)(n,o,Lo(this,"attr."+t,e)):null==e?(n.local?Ro:Xo)(n):(n.local?qo:Vo)(n,o,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var o=xt(t);return this.tween(n,(o.local?jo:Fo)(o,e))},style:function(t,e,n){var o="transform"==(t+="")?Jn:Yo;return null==e?this.styleTween(t,function(t,e){var n,o,r;return function(){var i=Ut(this,t),a=(this.style.removeProperty(t),Ut(this,t));return i===a?null:i===n&&a===o?r:r=e(n=i,o=a)}}(t,o)).on("end.style."+t,tr(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var o,r,i;return function(){var a=Ut(this,t),s=n(this),u=s+"";return null==s&&(this.style.removeProperty(t),u=s=Ut(this,t)),a===u?null:a===o&&u===r?i:(r=u,i=e(o=a,s))}}(t,o,Lo(this,"style."+t,e))).each(function(t,e){var n,o,r,i,a="style."+e,s="end."+a;return function(){var u=Co(this,t),l=u.on,c=null==u.value[a]?i||(i=tr(e)):void 0;l===n&&r===c||(o=(n=l).copy()).on(s,r=c),u.on=o}}(this._id,t)):this.styleTween(t,function(t,e,n){var o,r,i=n+"";return function(){var a=Ut(this,t);return a===i?null:a===o?r:r=e(o=a,n)}}(t,o,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var o="style."+(t+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(null==e)return this.tween(o,null);if("function"!=typeof e)throw new Error;return this.tween(o,function(t,e,n){var o,r;function i(){var i=e.apply(this,arguments);return i!==r&&(o=(r=i)&&function(t,e,n){return function(o){this.style.setProperty(t,e.call(this,o),n)}}(t,i,n)),o}return i._value=e,i}(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(Lo(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,n;function o(){var o=t.apply(this,arguments);return o!==n&&(e=(n=o)&&function(t){return function(e){this.textContent=t.call(this,e)}}(o)),e}return o._value=t,o}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var o,r=Ho(this.node(),n).tween,i=0,a=r.length;i()=>t;function ur(t,{sourceEvent:e,target:n,transform:o,dispatch:r}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:r}})}function lr(t,e,n){this.k=t,this.x=e,this.y=n}lr.prototype={constructor:lr,scale:function(t){return 1===t?this:new lr(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new lr(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var cr=new lr(1,0,0);function hr(t){for(;!t.__zoom;)if(!(t=t.parentNode))return cr;return t.__zoom}function dr(t){t.stopImmediatePropagation()}function fr(t){t.preventDefault(),t.stopImmediatePropagation()}function pr(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function gr(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function mr(){return this.__zoom||cr}function yr(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function vr(){return navigator.maxTouchPoints||"ontouchstart"in this}function xr(t,e,n){var o=t.invertX(e[0][0])-n[0][0],r=t.invertX(e[1][0])-n[1][0],i=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function wr(){var t,e,n,o=pr,r=gr,i=xr,a=yr,s=vr,u=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,h=ro,d=ft("start","zoom","end"),f=500,p=150,g=0,m=10;function y(t){t.property("__zoom",mr).on("wheel.zoom",P,{passive:!1}).on("mousedown.zoom",E).on("dblclick.zoom",S).filter(s).on("touchstart.zoom",N).on("touchmove.zoom",z).on("touchend.zoom touchcancel.zoom",k).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(t,e){return(e=Math.max(u[0],Math.min(u[1],e)))===t.k?t:new lr(e,t.x,t.y)}function x(t,e,n){var o=e[0]-n[0]*t.k,r=e[1]-n[1]*t.k;return o===t.x&&r===t.y?t:new lr(t.k,o,r)}function w(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function _(t,e,n,o){t.on("start.zoom",(function(){b(this,arguments).event(o).start()})).on("interrupt.zoom end.zoom",(function(){b(this,arguments).event(o).end()})).tween("zoom",(function(){var t=this,i=arguments,a=b(t,i).event(o),s=r.apply(t,i),u=null==n?w(s):"function"==typeof n?n.apply(t,i):n,l=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),c=t.__zoom,d="function"==typeof e?e.apply(t,i):e,f=h(c.invert(u).concat(l/c.k),d.invert(u).concat(l/d.k));return function(t){if(1===t)t=d;else{var e=f(t),n=l/e[2];t=new lr(n,u[0]-e[0]*n,u[1]-e[1]*n)}a.zoom(null,t)}}))}function b(t,e,n){return!n&&t.__zooming||new M(t,e)}function M(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=r.apply(t,e),this.taps=0}function P(t,...e){if(o.apply(this,arguments)){var n=b(this,e).event(t),r=this.__zoom,s=Math.max(u[0],Math.min(u[1],r.k*Math.pow(2,a.apply(this,arguments)))),c=Ae(t);if(n.wheel)n.mouse[0][0]===c[0]&&n.mouse[0][1]===c[1]||(n.mouse[1]=r.invert(n.mouse[0]=c)),clearTimeout(n.wheel);else{if(r.k===s)return;n.mouse=[c,r.invert(c)],Oo(this),n.start()}fr(t),n.wheel=setTimeout((function(){n.wheel=null,n.end()}),p),n.zoom("mouse",i(x(v(r,s),n.mouse[0],n.mouse[1]),n.extent,l))}}function E(t,...e){if(!n&&o.apply(this,arguments)){var r=t.currentTarget,a=b(this,e,!0).event(t),s=ke(t.view).on("mousemove.zoom",(function(t){if(fr(t),!a.moved){var e=t.clientX-c,n=t.clientY-h;a.moved=e*e+n*n>g}a.event(t).zoom("mouse",i(x(a.that.__zoom,a.mouse[0]=Ae(t,r),a.mouse[1]),a.extent,l))}),!0).on("mouseup.zoom",(function(t){s.on("mousemove.zoom mouseup.zoom",null),Oe(t.view,a.moved),fr(t),a.event(t).end()}),!0),u=Ae(t,r),c=t.clientX,h=t.clientY;He(t.view),dr(t),a.mouse=[u,this.__zoom.invert(u)],Oo(this),a.start()}}function S(t,...e){if(o.apply(this,arguments)){var n=this.__zoom,a=Ae(t.changedTouches?t.changedTouches[0]:t,this),s=n.invert(a),u=n.k*(t.shiftKey?.5:2),h=i(x(v(n,u),a,s),r.apply(this,e),l);fr(t),c>0?ke(this).transition().duration(c).call(_,h,a,t):ke(this).call(y.transform,h,a,t)}}function N(n,...r){if(o.apply(this,arguments)){var i,a,s,u,l=n.touches,c=l.length,h=b(this,r,n.changedTouches.length===c).event(n);for(dr(n),a=0;at.x!==e.x||t.y!==e.y||t.zoom!==e.k,br=t=>({x:t.x,y:t.y,zoom:t.k}),Mr=({x:t,y:e,zoom:n})=>cr.translate(t,e).scale(n),Pr=(t,e)=>t.target.closest(`.${e}`),Er=(t,e)=>2===e&&Array.isArray(t)&&t.includes(2),Sr=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,Nr=(t,e=0,n=Sr,o=(()=>{}))=>{const r="number"==typeof e&&e>0;return r||o(),r?t.transition().duration(e).ease(n).on("end",o):t},zr=t=>{const e=t.ctrlKey&&O()?10:1;return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*e};var kr;t.ResizeControlVariant=void 0,(kr=t.ResizeControlVariant||(t.ResizeControlVariant={})).Line="line",kr.Handle="handle";function Ar(t,e){return Math.max(0,e-t)}function Tr(t,e){return Math.max(0,t-e)}function Ir(t,e,n){return Math.max(0,e-t,t-n)}function $r(t,e){return t?!e:e}const Cr={width:0,height:0,x:0,y:0},Hr={...Cr,pointerX:0,pointerY:0,aspectRatio:1};function Or(t,e,n){const o=e.position.x+t.position.x,r=e.position.y+t.position.y,i=t.measured.width??0,a=t.measured.height??0,s=n[0]*i,u=n[1]*a;return[[o-s,r-u],[o+i-s,r+a-u]]}t.XYDrag=function({onNodeMouseDown:t,getStoreItems:e,onDragStart:n,onDrag:o,onDragStop:r}){let i={x:null,y:null},a=0,s=new Map,u=!1,l={x:0,y:0},c=null,h=!1,d=null,f=!1;return{update:function({noDragClassName:g,handleSelector:y,domNode:v,isSelectable:x,nodeId:w,nodeClickDistance:b=0}){function P({x:t,y:n},r){const{nodeLookup:a,nodeExtent:u,snapGrid:l,snapToGrid:c,nodeOrigin:h,onNodeDrag:d,onSelectionDrag:f,onError:g,updateNodePositions:y}=e();i={x:t,y:n};let v=!1,x={x:0,y:0,x2:0,y2:0};if(s.size>1&&u){const t=p(s);x=M(t)}for(const[e,o]of s){if(!a.has(e))continue;let r={x:t-o.distance.x,y:n-o.distance.y};c&&(r=T(r,l));let i=[[u[0][0],u[0][1]],[u[1][0],u[1][1]]];if(s.size>1&&u&&!o.extent){const{positionAbsolute:t}=o.internals,e=t.x-x.x+u[0][0],n=t.x+o.measured.width-x.x2+u[1][0];i=[[e,t.y-x.y+u[0][1]],[n,t.y+o.measured.height-x.y2+u[1][1]]]}const{position:d,positionAbsolute:f}=m({nodeId:e,nextPosition:r,nodeLookup:a,nodeExtent:i,nodeOrigin:h,onError:g});v=v||o.position.x!==d.x||o.position.y!==d.y,o.position=d,o.internals.positionAbsolute=f}if(v&&(y(s,!0),r&&(o||d||!w&&f))){const[t,e]=Ge({nodeId:w,dragItems:s,nodeLookup:a});o?.(r,s,t,e),d?.(r,t,e),w||f?.(r,e)}}async function E(){if(!c)return;const{transform:t,panBy:n,autoPanSpeed:o,autoPanOnNodeDrag:r}=e();if(!r)return u=!1,void cancelAnimationFrame(a);const[s,h]=_(l,c,o);0===s&&0===h||(i.x=(i.x??0)-s/t[2],i.y=(i.y??0)-h/t[2],await n({x:s,y:h})&&P(i,null)),a=requestAnimationFrame(E)}function S(o){const{nodeLookup:r,multiSelectionActive:a,nodesDraggable:u,transform:l,snapGrid:d,snapToGrid:f,selectNodesOnDrag:p,onNodeDragStart:g,onSelectionDragStart:m,unselectNodesAndEdges:y}=e();h=!0,p&&x||a||!w||r.get(w)?.selected||y(),x&&p&&w&&t?.(w);const v=L(o.sourceEvent,{transform:l,snapGrid:d,snapToGrid:f,containerBounds:c});if(i=v,s=function(t,e,n,o){const r=new Map;for(const[i,a]of t)if((a.selected||a.id===o)&&(!a.parentId||!qe(a,t))&&(a.draggable||e&&void 0===a.draggable)){const e=t.get(i);e&&r.set(i,{id:i,position:e.position||{x:0,y:0},distance:{x:n.x-e.internals.positionAbsolute.x,y:n.y-e.internals.positionAbsolute.y},extent:e.extent,parentId:e.parentId,origin:e.origin,expandParent:e.expandParent,internals:{positionAbsolute:e.internals.positionAbsolute||{x:0,y:0}},measured:{width:e.measured.width??0,height:e.measured.height??0}})}return r}(r,u,v,w),s.size>0&&(n||g||!w&&m)){const[t,e]=Ge({nodeId:w,dragItems:s,nodeLookup:r});n?.(o.sourceEvent,s,t,e),g?.(o.sourceEvent,t,e),w||m?.(o.sourceEvent,e)}}d=ke(v);const N=Ve().clickDistance(b).on("start",(t=>{const{domNode:n,nodeDragThreshold:o,transform:r,snapGrid:a,snapToGrid:s}=e();c=n?.getBoundingClientRect()||null,f=!1,0===o&&S(t);const u=L(t.sourceEvent,{transform:r,snapGrid:a,snapToGrid:s,containerBounds:c});i=u,l=q(t.sourceEvent,c)})).on("drag",(t=>{const{autoPanOnNodeDrag:n,transform:o,snapGrid:r,snapToGrid:a,nodeDragThreshold:d,nodeLookup:p}=e(),g=L(t.sourceEvent,{transform:o,snapGrid:r,snapToGrid:a,containerBounds:c});if(("touchmove"===t.sourceEvent.type&&t.sourceEvent.touches.length>1||w&&!p.has(w))&&(f=!0),!f){if(!u&&n&&h&&(u=!0,E()),!h){const e=g.xSnapped-(i.x??0),n=g.ySnapped-(i.y??0);Math.sqrt(e*e+n*n)>d&&S(t)}(i.x!==g.xSnapped||i.y!==g.ySnapped)&&s&&h&&(l=q(t.sourceEvent,c),P(g,t.sourceEvent))}})).on("end",(t=>{if(h&&!f&&(u=!1,h=!1,cancelAnimationFrame(a),s.size>0)){const{nodeLookup:n,updateNodePositions:o,onNodeDragStop:i,onSelectionDragStop:a}=e();if(o(s,!1),r||i||!w&&a){const[e,o]=Ge({nodeId:w,dragItems:s,nodeLookup:n,dragging:!1});r?.(t.sourceEvent,s,e,o),i?.(t.sourceEvent,e,o),w||a?.(t.sourceEvent,o)}}})).filter((t=>{const e=t.target;return!t.button&&(!g||!Ze(e,`.${g}`,v))&&(!y||Ze(e,y,v))}));d.call(N)},destroy:function(){d?.on(".drag",null)}}},t.XYHandle=Je,t.XYMinimap=function({domNode:t,panZoom:e,getTransform:n,getViewScale:o}){const r=ke(t);return{update:function({translateExtent:t,width:i,height:a,zoomStep:s=10,pannable:u=!0,zoomable:l=!0,inversePan:c=!1}){let h=[0,0];const d=wr().on("start",(t=>{"mousedown"!==t.sourceEvent.type&&"touchstart"!==t.sourceEvent.type||(h=[t.sourceEvent.clientX??t.sourceEvent.touches[0].clientX,t.sourceEvent.clientY??t.sourceEvent.touches[0].clientY])})).on("zoom",u?r=>{const s=n();if("mousemove"!==r.sourceEvent.type&&"touchmove"!==r.sourceEvent.type||!e)return;const u=[r.sourceEvent.clientX??r.sourceEvent.touches[0].clientX,r.sourceEvent.clientY??r.sourceEvent.touches[0].clientY],l=[u[0]-h[0],u[1]-h[1]];h=u;const d=o()*Math.max(s[2],Math.log(s[2]))*(c?-1:1),f={x:s[0]-l[0]*d,y:s[1]-l[1]*d},p=[[0,0],[i,a]];e.setViewportConstrained({x:f.x,y:f.y,zoom:s[2]},p,t)}:null).on("zoom.wheel",l?t=>{const o=n();if("wheel"!==t.sourceEvent.type||!e)return;const r=-t.sourceEvent.deltaY*(1===t.sourceEvent.deltaMode?.05:t.sourceEvent.deltaMode?1:.002)*s,i=o[2]*Math.pow(2,r);e.scaleTo(i)}:null);r.call(d,{})},destroy:function(){r.on("zoom",null)},pointer:Ae}},t.XYPanZoom=function({domNode:e,minZoom:n,maxZoom:o,paneClickDistance:r,translateExtent:i,viewport:a,onPanZoom:s,onPanZoomStart:u,onPanZoomEnd:l,onDraggingChange:c}){const h={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=wr().clickDistance(!k(r)||r<0?0:r).scaleExtent([n,o]).translateExtent(i),p=ke(e).call(f);w({x:a.x,y:a.y,zoom:y(a.zoom,n,o)},[[0,0],[d.width,d.height]],i);const g=p.on("wheel.zoom"),m=p.on("dblclick.zoom");function v(t,e){return p?new Promise((n=>{f?.interpolate("linear"===e?.interpolate?jn:ro).transform(Nr(p,e?.duration,e?.ease,(()=>n(!0))),t)})):Promise.resolve(!1)}function x(){f.on("zoom",null)}async function w(t,e,n){const o=Mr(t),r=f?.constrain()(o,e,n);return r&&await v(r),new Promise((t=>t(r)))}return f.wheelDelta(zr),{update:function({noWheelClassName:e,noPanClassName:n,onPaneContextMenu:o,userSelectionActive:r,panOnScroll:i,panOnDrag:a,panOnScrollMode:d,panOnScrollSpeed:y,preventScrolling:v,zoomOnPinch:w,zoomOnScroll:_,zoomOnDoubleClick:b,zoomActivationKeyPressed:M,lib:P,onTransformChange:E}){r&&!h.isZoomingOrPanning&&x();const S=i&&!M&&!r?function({zoomPanValues:e,noWheelClassName:n,d3Selection:o,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:s,onPanZoomStart:u,onPanZoom:l,onPanZoomEnd:c}){return h=>{if(Pr(h,n))return!1;h.preventDefault(),h.stopImmediatePropagation();const d=o.property("__zoom").k||1;if(h.ctrlKey&&s){const t=Ae(h),e=zr(h),n=d*Math.pow(2,e);return void r.scaleTo(o,n,t,h)}const f=1===h.deltaMode?20:1;let p=i===t.PanOnScrollMode.Vertical?0:h.deltaX*f,g=i===t.PanOnScrollMode.Horizontal?0:h.deltaY*f;!O()&&h.shiftKey&&i!==t.PanOnScrollMode.Vertical&&(p=h.deltaY*f,g=0),r.translateBy(o,-p/d*a,-g/d*a,{internal:!0});const m=br(o.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,u?.(h,m)),e.isPanScrolling&&(l?.(h,m),e.panScrollTimeout=setTimeout((()=>{c?.(h,m),e.isPanScrolling=!1}),150))}}({zoomPanValues:h,noWheelClassName:e,d3Selection:p,d3Zoom:f,panOnScrollMode:d,panOnScrollSpeed:y,zoomOnPinch:w,onPanZoomStart:u,onPanZoom:s,onPanZoomEnd:l}):function({noWheelClassName:t,preventScrolling:e,d3ZoomHandler:n}){return function(o,r){const i="wheel"===o.type,a=!e&&i&&!o.ctrlKey,s=Pr(o,t);if(o.ctrlKey&&i&&s&&o.preventDefault(),a||s)return null;o.preventDefault(),n.call(this,o,r)}}({noWheelClassName:e,preventScrolling:v,d3ZoomHandler:g});if(p.on("wheel.zoom",S,{passive:!1}),!r){const t=function({zoomPanValues:t,onDraggingChange:e,onPanZoomStart:n}){return o=>{if(o.sourceEvent?.internal)return;const r=br(o.transform);t.mouseButton=o.sourceEvent?.button||0,t.isZoomingOrPanning=!0,t.prevViewport=r,"mousedown"===o.sourceEvent?.type&&e(!0),n&&n?.(o.sourceEvent,r)}}({zoomPanValues:h,onDraggingChange:c,onPanZoomStart:u});f.on("start",t);const e=function({zoomPanValues:t,panOnDrag:e,onPaneContextMenu:n,onTransformChange:o,onPanZoom:r}){return i=>{t.usedRightMouseButton=!(!n||!Er(e,t.mouseButton??0)),i.sourceEvent?.sync||o([i.transform.x,i.transform.y,i.transform.k]),r&&!i.sourceEvent?.internal&&r?.(i.sourceEvent,br(i.transform))}}({zoomPanValues:h,panOnDrag:a,onPaneContextMenu:!!o,onPanZoom:s,onTransformChange:E});f.on("zoom",e);const n=function({zoomPanValues:t,panOnDrag:e,panOnScroll:n,onDraggingChange:o,onPanZoomEnd:r,onPaneContextMenu:i}){return a=>{if(!a.sourceEvent?.internal&&(t.isZoomingOrPanning=!1,i&&Er(e,t.mouseButton??0)&&!t.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),t.usedRightMouseButton=!1,o(!1),r&&_r(t.prevViewport,a.transform))){const e=br(a.transform);t.prevViewport=e,clearTimeout(t.timerId),t.timerId=setTimeout((()=>{r?.(a.sourceEvent,e)}),n?150:0)}}}({zoomPanValues:h,panOnDrag:a,panOnScroll:i,onPaneContextMenu:o,onPanZoomEnd:l,onDraggingChange:c});f.on("end",n)}const N=function({zoomActivationKeyPressed:t,zoomOnScroll:e,zoomOnPinch:n,panOnDrag:o,panOnScroll:r,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:s,noPanClassName:u,lib:l}){return c=>{const h=t||e,d=n&&c.ctrlKey;if(1===c.button&&"mousedown"===c.type&&(Pr(c,`${l}-flow__node`)||Pr(c,`${l}-flow__edge`)))return!0;if(!(o||h||r||i||n))return!1;if(a)return!1;if(Pr(c,s)&&"wheel"===c.type)return!1;if(Pr(c,u)&&("wheel"!==c.type||r&&"wheel"===c.type&&!t))return!1;if(!n&&c.ctrlKey&&"wheel"===c.type)return!1;if(!n&&"touchstart"===c.type&&c.touches?.length>1)return c.preventDefault(),!1;if(!h&&!r&&!d&&"wheel"===c.type)return!1;if(!o&&("mousedown"===c.type||"touchstart"===c.type))return!1;if(Array.isArray(o)&&!o.includes(c.button)&&"mousedown"===c.type)return!1;const f=Array.isArray(o)&&o.includes(c.button)||!c.button||c.button<=1;return(!c.ctrlKey||"wheel"===c.type)&&f}}({zoomActivationKeyPressed:M,panOnDrag:a,zoomOnScroll:_,panOnScroll:i,zoomOnDoubleClick:b,zoomOnPinch:w,userSelectionActive:r,noPanClassName:n,noWheelClassName:e,lib:P});f.filter(N),b?p.on("dblclick.zoom",m):p.on("dblclick.zoom",null)},destroy:x,setViewport:async function(t,e){const n=Mr(t);return await v(n,e),new Promise((t=>t(n)))},setViewportConstrained:w,getViewport:function(){const t=p?hr(p.node()):{x:0,y:0,k:1};return{x:t.x,y:t.y,zoom:t.k}},scaleTo:function(t,e){return p?new Promise((n=>{f?.interpolate("linear"===e?.interpolate?jn:ro).scaleTo(Nr(p,e?.duration,e?.ease,(()=>n(!0))),t)})):Promise.resolve(!1)},scaleBy:function(t,e){return p?new Promise((n=>{f?.interpolate("linear"===e?.interpolate?jn:ro).scaleBy(Nr(p,e?.duration,e?.ease,(()=>n(!0))),t)})):Promise.resolve(!1)},setScaleExtent:function(t){f?.scaleExtent(t)},setTranslateExtent:function(t){f?.translateExtent(t)},syncViewport:function(t){if(p){const e=Mr(t),n=p.property("__zoom");n.k===t.zoom&&n.x===t.x&&n.y===t.y||f?.transform(p,e,null,{sync:!0})}},setClickDistance:function(t){const e=!k(t)||t<0?0:t;f?.clickDistance(e)}}},t.XYResizer=function({domNode:t,nodeId:e,getStoreItems:n,onChange:o,onEnd:r}){const i=ke(t);return{update:function({controlPosition:t,boundaries:a,keepAspectRatio:s,resizeDirection:u,onResizeStart:l,onResize:c,onResizeEnd:h,shouldResize:d}){let f={...Cr},p={...Hr};const g=function(t){return{isHorizontal:t.includes("right")||t.includes("left"),isVertical:t.includes("bottom")||t.includes("top"),affectsX:t.includes("left"),affectsY:t.includes("top")}}(t);let m,y,v,x,w=null,_=[];const b=Ve().on("start",(t=>{const{nodeLookup:o,transform:r,snapGrid:i,snapToGrid:a,nodeOrigin:s,paneDomNode:u}=n();if(m=o.get(e),!m)return;w=u?.getBoundingClientRect()??null;const{xSnapped:c,ySnapped:h}=L(t.sourceEvent,{transform:r,snapGrid:i,snapToGrid:a,containerBounds:w});f={width:m.measured.width??0,height:m.measured.height??0,x:m.position.x??0,y:m.position.y??0},p={...f,pointerX:c,pointerY:h,aspectRatio:f.width/f.height},y=void 0,m.parentId&&("parent"===m.extent||m.expandParent)&&(y=o.get(m.parentId),v=y&&"parent"===m.extent?function(t){return[[0,0],[t.measured.width,t.measured.height]]}(y):void 0),_=[],x=void 0;for(const[t,n]of o)if(n.parentId===e&&(_.push({id:t,position:{...n.position},extent:n.extent}),"parent"===n.extent||n.expandParent)){const t=Or(n,m,n.origin??s);x=x?[[Math.min(t[0][0],x[0][0]),Math.min(t[0][1],x[0][1])],[Math.max(t[1][0],x[1][0]),Math.max(t[1][1],x[1][1])]]:t}l?.(t,{...f})})).on("drag",(t=>{const{transform:e,snapGrid:r,snapToGrid:i,nodeOrigin:l}=n(),h=L(t.sourceEvent,{transform:e,snapGrid:r,snapToGrid:i,containerBounds:w}),b=[];if(!m)return;const{x:M,y:P,width:E,height:S}=f,N={},z=m.origin??l,{width:k,height:A,x:T,y:I}=function(t,e,n,o,r,i,a,s){let{affectsX:u,affectsY:l}=e;const{isHorizontal:c,isVertical:h}=e,d=c&&h,{xSnapped:f,ySnapped:p}=n,{minWidth:g,maxWidth:m,minHeight:y,maxHeight:v}=o,{x:x,y:w,width:_,height:b,aspectRatio:M}=t;let P=Math.floor(c?f-t.pointerX:0),E=Math.floor(h?p-t.pointerY:0);const S=_+(u?-P:P),N=b+(l?-E:E),z=-i[0]*_,k=-i[1]*b;let A=Ir(S,g,m),T=Ir(N,y,v);if(a){let t=0,e=0;u&&P<0?t=Ar(x+P+z,a[0][0]):!u&&P>0&&(t=Tr(x+S+z,a[1][0])),l&&E<0?e=Ar(w+E+k,a[0][1]):!l&&E>0&&(e=Tr(w+N+k,a[1][1])),A=Math.max(A,t),T=Math.max(T,e)}if(s){let t=0,e=0;u&&P>0?t=Tr(x+P,s[0][0]):!u&&P<0&&(t=Ar(x+S,s[1][0])),l&&E>0?e=Tr(w+E,s[0][1]):!l&&E<0&&(e=Ar(w+N,s[1][1])),A=Math.max(A,t),T=Math.max(T,e)}if(r){if(c){const t=Ir(S/M,y,v)*M;if(A=Math.max(A,t),a){let t=0;t=!u&&!l||u&&!l&&d?Tr(w+k+S/M,a[1][1])*M:Ar(w+k+(u?P:-P)/M,a[0][1])*M,A=Math.max(A,t)}if(s){let t=0;t=!u&&!l||u&&!l&&d?Ar(w+S/M,s[1][1])*M:Tr(w+(u?P:-P)/M,s[0][1])*M,A=Math.max(A,t)}}if(h){const t=Ir(N*M,g,m)/M;if(T=Math.max(T,t),a){let t=0;t=!u&&!l||l&&!u&&d?Tr(x+N*M+z,a[1][0])/M:Ar(x+(l?E:-E)*M+z,a[0][0])/M,T=Math.max(T,t)}if(s){let t=0;t=!u&&!l||l&&!u&&d?Ar(x+N*M,s[1][0])/M:Tr(x+(l?E:-E)*M,s[0][0])/M,T=Math.max(T,t)}}}E+=E<0?T:-T,P+=P<0?A:-A,r&&(d?S>N*M?E=($r(u,l)?-P:P)/M:P=($r(u,l)?-E:E)*M:c?(E=P/M,l=u):(P=E*M,u=l));const I=u?x+P:x,$=l?w+E:w;return{width:_+(u?-P:P),height:b+(l?-E:E),x:i[0]*P*(u?-1:1)+I,y:i[1]*E*(l?-1:1)+$}}(p,g,h,a,s,z,v,x),$=k!==E,C=A!==S,H=T!==M&&$,O=I!==P&&C;if(!(H||O||$||C))return;if((H||O||1===z[0]||1===z[1])&&(N.x=H?T:f.x,N.y=O?I:f.y,f.x=N.x,f.y=N.y,_.length>0)){const t=T-M,e=I-P;for(const n of _)n.position={x:n.position.x-t+z[0]*(k-E),y:n.position.y-e+z[1]*(A-S)},b.push(n)}if(($||C)&&(N.width=!$||u&&"horizontal"!==u?f.width:k,N.height=!C||u&&"vertical"!==u?f.height:A,f.width=N.width,f.height=N.height),y&&m.expandParent){const t=z[0]*(N.width??0);N.x&&N.x0?1:a<0?-1:0,s>0?1:s<0?-1:0];return a&&r&&(u[0]=-1*u[0]),s&&i&&(u[1]=-1*u[1]),u}({width:f.width,prevWidth:E,height:f.height,prevHeight:S,affectsX:g.affectsX,affectsY:g.affectsY}),D={...f,direction:B},Y=d?.(t,D);!1!==Y&&(c?.(t,D),o(N,b))})).on("end",(t=>{h?.(t,{...f}),r?.({...f})}));i.call(b)},destroy:function(){i.on(".drag",null)}}},t.XY_RESIZER_HANDLE_POSITIONS=["top-left","top-right","bottom-left","bottom-right"],t.XY_RESIZER_LINE_POSITIONS=["top","right","bottom","left"],t.addEdge=(t,n)=>{if(!t.source||!t.target)return e.error006(),n;let o;return o=h(t)?{...t}:{...t,id:K(t)},((t,e)=>e.some((e=>!(e.source!==t.source||e.target!==t.target||e.sourceHandle!==t.sourceHandle&&(e.sourceHandle||t.sourceHandle)||e.targetHandle!==t.targetHandle&&(e.targetHandle||t.targetHandle)))))(o,n)?n:(null===o.sourceHandle&&delete o.sourceHandle,null===o.targetHandle&&delete o.targetHandle,n.concat(o))},t.adoptUserNodes=function(t,e,n,o){const r=st(at,o);let i=t.length>0;const a=new Map(e),s=r?.elevateNodesOnSelect?1e3:0;e.clear(),n.clear();for(const u of t){let t=a.get(u.id);if(r.checkEquality&&u===t?.internals.userNode)e.set(u.id,t);else{const n=f(u,r.nodeOrigin),o=B(u.extent)?u.extent:r.nodeExtent,i=v(n,o,D(u));t={...r.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:i,handleBounds:u.measured?t?.internals.handleBounds:void 0,z:lt(u,s),userNode:u}},e.set(u.id,t)}void 0!==t.measured&&void 0!==t.measured.width&&void 0!==t.measured.height||t.hidden||(i=!1),u.parentId&&ut(t,e,n,o)}return i},t.areConnectionMapsEqual=function(t,e){if(!t&&!e)return!0;if(!t||!e||t.size!==e.size)return!1;if(!t.size&&!e.size)return!0;for(const n of t.keys())if(!e.has(n))return!1;return!0},t.areSetsEqual=function(t,e){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0},t.boxToRect=P,t.calcAutoPan=_,t.calculateNodePosition=m,t.clamp=y,t.clampPosition=v,t.clampPositionToParent=x,t.createMarkerIds=function(t,{id:e,defaultColor:n,defaultMarkerStart:o,defaultMarkerEnd:r}){const i=new Set;return t.reduce(((t,a)=>([a.markerStart||o,a.markerEnd||r].forEach((o=>{if(o&&"object"==typeof o){const r=rt(o,e);i.has(r)||(t.push({id:r,color:o.color||n,...o}),i.add(r))}})),t)),[]).sort(((t,e)=>t.id.localeCompare(e.id)))},t.defaultAriaLabelConfig=o,t.devWarn=A,t.elementSelectionKeys=["Enter"," ","Escape"],t.errorMessages=e,t.evaluateAbsolutePosition=function(t,e={width:0,height:0},n,o,r){const i={...t},a=o.get(n);if(a){const t=a.origin||r;i.x+=a.internals.positionAbsolute.x-(e.width??0)*t[0],i.y+=a.internals.positionAbsolute.y-(e.height??0)*t[1]}return i},t.fitViewport=async function({nodes:t,width:e,height:n,panZoom:o,minZoom:r,maxZoom:i},a){if(0===t.size)return Promise.resolve(!0);const s=function(t,e){const n=new Map,o=e?.nodes?new Set(e.nodes.map((t=>t.id))):null;return t.forEach((t=>{!t.measured.width||!t.measured.height||!e?.includeHiddenNodes&&t.hidden||o&&!o.has(t.id)||n.set(t.id,t)})),n}(t,a),u=p(s),l=H(u,e,n,a?.minZoom??r,a?.maxZoom??i,a?.padding??.1);return await o.setViewport(l,{duration:a?.duration,ease:a?.ease,interpolate:a?.interpolate}),Promise.resolve(!0)},t.getBezierEdgeCenter=G,t.getBezierPath=function({sourceX:e,sourceY:n,sourcePosition:o=t.Position.Bottom,targetX:r,targetY:i,targetPosition:a=t.Position.Top,curvature:s=.25}){const[u,l]=F({pos:o,x1:e,y1:n,x2:r,y2:i,c:s}),[c,h]=F({pos:a,x1:r,y1:i,x2:e,y2:n,c:s}),[d,f,p,g]=G({sourceX:e,sourceY:n,targetX:r,targetY:i,sourceControlX:u,sourceControlY:l,targetControlX:c,targetControlY:h});return[`M${e},${n} C${u},${l} ${c},${h} ${r},${i}`,d,f,p,g]},t.getBoundsOfBoxes=b,t.getBoundsOfRects=N,t.getConnectedEdges=g,t.getConnectionStatus=function(t){return null===t?null:t?"valid":"invalid"},t.getDimensions=Y,t.getEdgeCenter=W,t.getEdgePosition=function(n){const{sourceNode:o,targetNode:r}=n;if(!tt(o)||!tt(r))return null;const i=o.internals.handleBounds||et(o.handles),a=r.internals.handleBounds||et(r.handles),s=ot(i?.source??[],n.sourceHandle),u=ot(n.connectionMode===t.ConnectionMode.Strict?a?.target??[]:(a?.target??[]).concat(a?.source??[]),n.targetHandle);if(!s||!u)return n.onError?.("008",e.error008(s?"target":"source",{id:n.id,sourceHandle:n.sourceHandle,targetHandle:n.targetHandle})),null;const l=s?.position||t.Position.Bottom,c=u?.position||t.Position.Top,h=nt(o,s,l),d=nt(r,u,c);return{sourceX:h.x,sourceY:h.y,targetX:d.x,targetY:d.y,sourcePosition:l,targetPosition:c}},t.getElementsToRemove=async function({nodesToRemove:t=[],edgesToRemove:e=[],nodes:n,edges:o,onBeforeDelete:r}){const i=new Set(t.map((t=>t.id))),a=[];for(const t of n){if(!1===t.deletable)continue;const e=i.has(t.id),n=!e&&t.parentId&&a.find((e=>e.id===t.parentId));(e||n)&&a.push(t)}const s=new Set(e.map((t=>t.id))),u=o.filter((t=>!1!==t.deletable)),l=g(a,u);for(const t of u){s.has(t.id)&&!l.find((e=>e.id===t.id))&&l.push(t)}if(!r)return{edges:l,nodes:a};const c=await r({nodes:a,edges:l});return"boolean"==typeof c?c?{edges:l,nodes:a}:{edges:[],nodes:[]}:c},t.getElevatedEdgeZIndex=function({sourceNode:t,targetNode:e,selected:n=!1,zIndex:o=0,elevateOnSelect:r=!1}){if(!r)return o;const i=n||e.selected||t.selected,a=Math.max(t.internals.z||0,e.internals.z||0,1e3);return o+(i?a:0)},t.getEventPosition=q,t.getHandleBounds=Z,t.getHandlePosition=nt,t.getHostForElement=X,t.getIncomers=(t,e,n)=>{if(!t.id)return[];const o=new Set;return n.forEach((e=>{e.target===t.id&&o.add(e.source)})),e.filter((t=>o.has(t.id)))},t.getInternalNodesBounds=p,t.getMarkerId=rt,t.getNodeDimensions=D,t.getNodePositionWithOrigin=f,t.getNodeToolbarTransform=function(e,n,o,r,i){let a=.5;"start"===i?a=0:"end"===i&&(a=1);let s=[(e.x+e.width*a)*n.zoom+n.x,e.y*n.zoom+n.y-r],u=[-100*a,-100];switch(o){case t.Position.Right:s=[(e.x+e.width)*n.zoom+n.x+r,(e.y+e.height*a)*n.zoom+n.y],u=[0,-100*a];break;case t.Position.Bottom:s[1]=(e.y+e.height)*n.zoom+n.y+r,u[1]=0;break;case t.Position.Left:s=[e.x*n.zoom+n.x-r,(e.y+e.height*a)*n.zoom+n.y],u=[-100,-100*a]}return`translate(${s[0]}px, ${s[1]}px) translate(${u[0]}%, ${u[1]}%)`},t.getNodesBounds=(t,e={nodeOrigin:[0,0]})=>{if(0===t.length)return{x:0,y:0,width:0,height:0};const n=t.reduce(((t,n)=>{const o="string"==typeof n;let r=e.nodeLookup||o?void 0:n;e.nodeLookup&&(r=o?e.nodeLookup.get(n):d(n)?n:e.nodeLookup.get(n.id));const i=r?S(r,e.nodeOrigin):{x:0,y:0,x2:0,y2:0};return b(t,i)}),{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return P(n)},t.getNodesInside=(t,e,[n,o,r]=[0,0,1],i=!1,a=!1)=>{const s={...I(e,[n,o,r]),width:e.width/r,height:e.height/r},u=[];for(const e of t.values()){const{measured:t,selectable:n=!0,hidden:o=!1}=e;if(a&&!n||o)continue;const r=t.width??e.width??e.initialWidth??null,l=t.height??e.height??e.initialHeight??null,c=z(s,E(e)),h=(r??0)*(l??0),d=i&&c>0;(!e.internals.handleBounds||d||c>=h||e.dragging)&&u.push(e)}return u},t.getOutgoers=(t,e,n)=>{if(!t.id)return[];const o=new Set;return n.forEach((e=>{e.source===t.id&&o.add(e.target)})),e.filter((t=>o.has(t.id)))},t.getOverlappingArea=z,t.getPointerPosition=L,t.getSmoothStepPath=function({sourceX:e,sourceY:n,sourcePosition:o=t.Position.Bottom,targetX:r,targetY:i,targetPosition:a=t.Position.Top,borderRadius:s=5,centerX:u,centerY:l,offset:c=20}){const[h,d,f,p,g]=function({source:e,sourcePosition:n=t.Position.Bottom,target:o,targetPosition:r=t.Position.Top,center:i,offset:a}){const s=U[n],u=U[r],l={x:e.x+s.x*a,y:e.y+s.y*a},c={x:o.x+u.x*a,y:o.y+u.y*a},h=Q({source:l,sourcePosition:n,target:c}),d=0!==h.x?"x":"y",f=h[d];let p,g,m=[];const y={x:0,y:0},v={x:0,y:0},[x,w,_,b]=W({sourceX:e.x,sourceY:e.y,targetX:o.x,targetY:o.y});if(s[d]*u[d]==-1){p=i.x??x,g=i.y??w;const t=[{x:p,y:l.y},{x:p,y:c.y}],e=[{x:l.x,y:g},{x:c.x,y:g}];m=s[d]===f?"x"===d?t:e:"x"===d?e:t}else{const t=[{x:l.x,y:c.y}],i=[{x:c.x,y:l.y}];if(m="x"===d?s.x===f?i:t:s.y===f?t:i,n===r){const t=Math.abs(e[d]-o[d]);if(t<=a){const n=Math.min(a-1,a-t);s[d]===f?y[d]=(l[d]>e[d]?-1:1)*n:v[d]=(c[d]>o[d]?-1:1)*n}}if(n!==r){const e="x"===d?"y":"x",n=s[d]===u[e],o=l[e]>c[e],r=l[e]=Math.max(Math.abs(h.y-m[0].y),Math.abs(x.y-m[0].y))?(p=(h.x+x.x)/2,g=m[0].y):(p=m[0].x,g=(h.y+x.y)/2)}return[[e,{x:l.x+y.x,y:l.y+y.y},...m,{x:c.x+v.x,y:c.y+v.y},o],p,g,_,b]}({source:{x:e,y:n},sourcePosition:o,target:{x:r,y:i},targetPosition:a,center:{x:u,y:l},offset:c});return[h.reduce(((t,e,n)=>{let o="";return o=n>0&&n{e?.has(n)||o.push(t)})),o.length&&n(o)},t.handleExpandParent=ct,t.infiniteExtent=n,t.initialConnection={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null},t.isCoordinateExtent=B,t.isEdgeBase=h,t.isEdgeVisible=function({sourceNode:t,targetNode:e,width:n,height:o,transform:r}){const i=b(S(t),S(e));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const a={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:o/r[2]};return z(a,P(i))>0},t.isInputDOMNode=function(t){const e=t.composedPath?.()?.[0]||t.target;return 1===e?.nodeType&&(R.includes(e.nodeName)||e.hasAttribute("contenteditable")||!!e.closest(".nokey"))},t.isInternalNodeBase=d,t.isMacOs=O,t.isMouseEvent=V,t.isNodeBase=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),t.isNumeric=k,t.isRectObject=t=>k(t.width)&&k(t.height)&&k(t.x)&&k(t.y),t.mergeAriaLabelConfig=function(t){return{...o,...t||{}}},t.nodeHasDimensions=function(t){return void 0!==(t.measured?.width??t.width??t.initialWidth)&&void 0!==(t.measured?.height??t.height??t.initialHeight)},t.nodeToBox=S,t.nodeToRect=E,t.oppositePosition=c,t.panBy=async function({delta:t,panZoom:e,transform:n,translateExtent:o,width:r,height:i}){if(!e||!t.x&&!t.y)return Promise.resolve(!1);const a=await e.setViewportConstrained({x:n[0]+t.x,y:n[1]+t.y,zoom:n[2]},[[0,0],[r,i]],o),s=!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2]);return Promise.resolve(s)},t.pointToRendererPoint=I,t.reconnectEdge=(t,n,o,r={shouldReplaceId:!0})=>{const{id:i,...a}=t;if(!n.source||!n.target)return e.error006(),o;if(!o.find((e=>e.id===t.id)))return e.error007(i),o;const s={...a,id:r.shouldReplaceId?K(n):i,source:n.source,target:n.target,sourceHandle:n.sourceHandle,targetHandle:n.targetHandle};return o.filter((t=>t.id!==i)).concat(s)},t.rectToBox=M,t.rendererPointToPoint=$,t.shallowNodeData=function(t,e){if(null===t||null===e)return!1;const n=Array.isArray(t)?t:[t],o=Array.isArray(e)?e:[e];if(n.length!==o.length)return!1;for(let t=0;t0){const t=ct(h,e,n,r);u.push(...t)}return{changes:u,updatedInternals:s}},t.withResolvers=function(){let t,e;return{promise:new Promise(((n,o)=>{t=n,e=o})),resolve:t,reject:e}}})); diff --git a/node_modules/@xyflow/system/dist/umd/types/changes.d.ts b/node_modules/@xyflow/system/dist/umd/types/changes.d.ts new file mode 100644 index 0000000..2a81cda --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/types/changes.d.ts @@ -0,0 +1,64 @@ +import type { XYPosition, Dimensions, NodeBase, EdgeBase } from '.'; +export type NodeDimensionChange = { + id: string; + type: 'dimensions'; + dimensions?: Dimensions; + resizing?: boolean; + setAttributes?: boolean | 'width' | 'height'; +}; +export type NodePositionChange = { + id: string; + type: 'position'; + position?: XYPosition; + positionAbsolute?: XYPosition; + dragging?: boolean; +}; +export type NodeSelectionChange = { + id: string; + type: 'select'; + selected: boolean; +}; +export type NodeRemoveChange = { + id: string; + type: 'remove'; +}; +export type NodeAddChange = { + item: NodeType; + type: 'add'; + index?: number; +}; +export type NodeReplaceChange = { + id: string; + item: NodeType; + type: 'replace'; +}; +/** + * The [`onNodesChange`](/api-reference/react-flow#on-nodes-change) callback takes + *an array of `NodeChange` objects that you should use to update your flow's state. + *The `NodeChange` type is a union of six different object types that represent that + *various ways an node can change in a flow. + * @public + */ +export type NodeChange = NodeDimensionChange | NodePositionChange | NodeSelectionChange | NodeRemoveChange | NodeAddChange | NodeReplaceChange; +export type EdgeSelectionChange = NodeSelectionChange; +export type EdgeRemoveChange = NodeRemoveChange; +export type EdgeAddChange = { + item: EdgeType; + type: 'add'; + index?: number; +}; +export type EdgeReplaceChange = { + id: string; + item: EdgeType; + type: 'replace'; +}; +/** + * The [`onEdgesChange`](/api-reference/react-flow#on-edges-change) callback takes + *an array of `EdgeChange` objects that you should use to update your flow's state. + *The `EdgeChange` type is a union of four different object types that represent that + *various ways an edge can change in a flow. + * + * @public + */ +export type EdgeChange = EdgeSelectionChange | EdgeRemoveChange | EdgeAddChange | EdgeReplaceChange; +//# sourceMappingURL=changes.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/types/changes.d.ts.map b/node_modules/@xyflow/system/dist/umd/types/changes.d.ts.map new file mode 100644 index 0000000..cdded21 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/types/changes.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"changes.d.ts","sourceRoot":"","sources":["../../src/types/changes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC;AAEpE,MAAM,MAAM,mBAAmB,GAAG;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,YAAY,CAAC;IACnB,UAAU,CAAC,EAAE,UAAU,CAAC;IAExB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,aAAa,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC;CAC9C,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB,gBAAgB,CAAC,EAAE,UAAU,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,aAAa,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAAI;IAChE,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,KAAK,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAAI;IACpE,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IACvD,mBAAmB,GACnB,kBAAkB,GAClB,mBAAmB,GACnB,gBAAgB,GAChB,aAAa,CAAC,QAAQ,CAAC,GACvB,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AAEhC,MAAM,MAAM,mBAAmB,GAAG,mBAAmB,CAAC;AACtD,MAAM,MAAM,gBAAgB,GAAG,gBAAgB,CAAC;AAChD,MAAM,MAAM,aAAa,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAAI;IAChE,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,KAAK,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAAI;IACpE,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,UAAU,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IACvD,mBAAmB,GACnB,gBAAgB,GAChB,aAAa,CAAC,QAAQ,CAAC,GACvB,iBAAiB,CAAC,QAAQ,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/types/edges.d.ts b/node_modules/@xyflow/system/dist/umd/types/edges.d.ts new file mode 100644 index 0000000..b398198 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/types/edges.d.ts @@ -0,0 +1,113 @@ +import { Position } from './utils'; +export type EdgeBase = Record, EdgeType extends string | undefined = string | undefined> = { + /** Unique id of an edge. */ + id: string; + /** Type of edge defined in `edgeTypes`. */ + type?: EdgeType; + /** Id of source node. */ + source: string; + /** Id of target node. */ + target: string; + /** Id of source handle, only needed if there are multiple handles per node. */ + sourceHandle?: string | null; + /** Id of target handle, only needed if there are multiple handles per node. */ + targetHandle?: string | null; + animated?: boolean; + hidden?: boolean; + deletable?: boolean; + selectable?: boolean; + /** Arbitrary data passed to an edge. */ + data?: EdgeData; + selected?: boolean; + /** + * Set the marker on the beginning of an edge. + * @example 'arrow', 'arrowclosed' or custom marker + */ + markerStart?: EdgeMarkerType; + /** + * Set the marker on the end of an edge. + * @example 'arrow', 'arrowclosed' or custom marker + */ + markerEnd?: EdgeMarkerType; + zIndex?: number; + ariaLabel?: string; + /** + * ReactFlow renders an invisible path around each edge to make them easier to click or tap on. + * This property sets the width of that invisible path. + */ + interactionWidth?: number; +}; +export type SmoothStepPathOptions = { + offset?: number; + borderRadius?: number; +}; +export type StepPathOptions = { + offset?: number; +}; +export type BezierPathOptions = { + curvature?: number; +}; +/** + * @inline + */ +export type DefaultEdgeOptionsBase = Omit; +/** + * If you set the `connectionLineType` prop on your [``](/api-reference/react-flow#connection-connectionLineType) + *component, it will dictate the style of connection line rendered when creating + *new edges. + * + * @public + * + * @remarks If you choose to render a custom connection line component, this value will be + *passed to your component as part of its [`ConnectionLineComponentProps`](/api-reference/types/connection-line-component-props). + */ +export declare enum ConnectionLineType { + Bezier = "default", + Straight = "straight", + Step = "step", + SmoothStep = "smoothstep", + SimpleBezier = "simplebezier" +} +/** + * Edges can optionally have markers at the start and end of an edge. The `EdgeMarker` + *type is used to configure those markers! Check the docs for [`MarkerType`](/api-reference/types/marker-type) + *for details on what types of edge marker are available. + * + * @public + */ +export type EdgeMarker = { + type: MarkerType; + color?: string; + width?: number; + height?: number; + markerUnits?: string; + orient?: string; + strokeWidth?: number; +}; +export type EdgeMarkerType = string | EdgeMarker; +/** + * Edges may optionally have a marker on either end. The MarkerType type enumerates + * the options available to you when configuring a given marker. + * + * @public + */ +export declare enum MarkerType { + Arrow = "arrow", + ArrowClosed = "arrowclosed" +} +export type MarkerProps = EdgeMarker & { + id: string; +}; +/** + * @inline + */ +export type EdgePosition = { + sourceX: number; + sourceY: number; + targetX: number; + targetY: number; + sourcePosition: Position; + targetPosition: Position; +}; +export type EdgeLookup = Map; +//# sourceMappingURL=edges.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/types/edges.d.ts.map b/node_modules/@xyflow/system/dist/umd/types/edges.d.ts.map new file mode 100644 index 0000000..e466846 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/types/edges.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"edges.d.ts","sourceRoot":"","sources":["../../src/types/edges.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,MAAM,MAAM,QAAQ,CAClB,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClE,QAAQ,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,IACtD;IACF,4BAA4B;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,2CAA2C;IAC3C,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,yBAAyB;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,yBAAyB;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,+EAA+E;IAC/E,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,+EAA+E;IAC/E,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,wCAAwC;IACxC,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sBAAsB,CAAC,QAAQ,SAAS,QAAQ,IAAI,IAAI,CAClE,QAAQ,EACR,IAAI,GAAG,QAAQ,GAAG,QAAQ,GAAG,cAAc,GAAG,cAAc,GAAG,UAAU,CAC1E,CAAC;AAEF;;;;;;;;;GASG;AACH,oBAAY,kBAAkB;IAC5B,MAAM,YAAY;IAClB,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,UAAU,eAAe;IACzB,YAAY,iBAAiB;CAC9B;AAED;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,UAAU,CAAC;AAEjD;;;;;GAKG;AACH,oBAAY,UAAU;IACpB,KAAK,UAAU;IACf,WAAW,gBAAgB;CAC5B;AAED,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG;IACrC,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,QAAQ,CAAC;IACzB,cAAc,EAAE,QAAQ,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,UAAU,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAAI,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/types/general.d.ts b/node_modules/@xyflow/system/dist/umd/types/general.d.ts new file mode 100644 index 0000000..8727417 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/types/general.d.ts @@ -0,0 +1,241 @@ +import type { Selection as D3Selection } from 'd3-selection'; +import type { D3DragEvent, SubjectPosition } from 'd3-drag'; +import type { ZoomBehavior } from 'd3-zoom'; +import type { XYPosition, Rect, Position } from './utils'; +import type { InternalNodeBase, NodeBase, NodeDragItem } from './nodes'; +import type { Handle, HandleType } from './handles'; +import { PanZoomInstance } from './panzoom'; +import { EdgeBase } from '..'; +export type Project = (position: XYPosition) => XYPosition; +export type OnMove = (event: MouseEvent | TouchEvent | null, viewport: Viewport) => void; +export type OnMoveStart = OnMove; +export type OnMoveEnd = OnMove; +export type ZoomInOut = (options?: ViewportHelperFunctionOptions) => Promise; +export type ZoomTo = (zoomLevel: number, options?: ViewportHelperFunctionOptions) => Promise; +export type GetZoom = () => number; +export type GetViewport = () => Viewport; +export type SetViewport = (viewport: Viewport, options?: ViewportHelperFunctionOptions) => Promise; +export type SetCenter = (x: number, y: number, options?: SetCenterOptions) => Promise; +export type FitBounds = (bounds: Rect, options?: FitBoundsOptions) => Promise; +/** + * The `Connection` type is the basic minimal description of an [`Edge`](/api-reference/types/edge) + * between two nodes. The [`addEdge`](/api-reference/utils/add-edge) util can be used to upgrade + * a `Connection` to an [`Edge`](/api-reference/types/edge). + * + * @public + */ +export type Connection = { + /** The id of the node this connection originates from. */ + source: string; + /** The id of the node this connection terminates at. */ + target: string; + /** When not `null`, the id of the handle on the source node that this connection originates from. */ + sourceHandle: string | null; + /** When not `null`, the id of the handle on the target node that this connection terminates at. */ + targetHandle: string | null; +}; +/** + * The `HandleConnection` type is an extension of a basic [Connection](/api-reference/types/connection) that includes the `edgeId`. + */ +export type HandleConnection = Connection & { + edgeId: string; +}; +/** + * The `NodeConnection` type is an extension of a basic [Connection](/api-reference/types/connection) that includes the `edgeId`. + * + */ +export type NodeConnection = Connection & { + edgeId: string; +}; +/** + * The `ConnectionMode` is used to set the mode of connection between nodes. + * The `Strict` mode is the default one and only allows source to target edges. + * `Loose` mode allows source to source and target to target edges as well. + * + * @public + */ +export declare enum ConnectionMode { + Strict = "strict", + Loose = "loose" +} +export type OnConnectStartParams = { + nodeId: string | null; + handleId: string | null; + handleType: HandleType | null; +}; +export type OnConnectStart = (event: MouseEvent | TouchEvent, params: OnConnectStartParams) => void; +export type OnConnect = (connection: Connection) => void; +export type OnConnectEnd = (event: MouseEvent | TouchEvent, connectionState: FinalConnectionState) => void; +export type OnReconnect = (oldEdge: EdgeType, newConnection: Connection) => void; +export type OnReconnectStart = (event: MouseEvent | TouchEvent, edge: EdgeType, handleType: HandleType) => void; +export type OnReconnectEnd = (event: MouseEvent | TouchEvent, edge: EdgeType, handleType: HandleType, connectionState: FinalConnectionState) => void; +export type IsValidConnection = (edge: EdgeBase | Connection) => boolean; +/** + * @inline + */ +export type FitViewParamsBase = { + nodes: Map>; + width: number; + height: number; + panZoom: PanZoomInstance; + minZoom: number; + maxZoom: number; +}; +export type PaddingUnit = 'px' | '%'; +export type PaddingWithUnit = `${number}${PaddingUnit}` | number; +export type Padding = PaddingWithUnit | { + top?: PaddingWithUnit; + right?: PaddingWithUnit; + bottom?: PaddingWithUnit; + left?: PaddingWithUnit; + x?: PaddingWithUnit; + y?: PaddingWithUnit; +}; +/** + * @inline + */ +export type FitViewOptionsBase = { + padding?: Padding; + includeHiddenNodes?: boolean; + minZoom?: number; + maxZoom?: number; + duration?: number; + ease?: (t: number) => number; + interpolate?: 'smooth' | 'linear'; + nodes?: (NodeType | { + id: string; + })[]; +}; +/** + * Internally, React Flow maintains a coordinate system that is independent of the + * rest of the page. The `Viewport` type tells you where in that system your flow + * is currently being display at and how zoomed in or out it is. + * + * @public + * @remarks A `Transform` has the same properties as the viewport, but they represent + * different things. Make sure you don't get them muddled up or things will start + * to look weird! + * + */ +export type Viewport = { + x: number; + y: number; + zoom: number; +}; +export type KeyCode = string | Array; +export type SnapGrid = [number, number]; +/** + * This enum is used to set the different modes of panning the viewport when the + * user scrolls. The `Free` mode allows the user to pan in any direction by scrolling + * with a device like a trackpad. The `Vertical` and `Horizontal` modes restrict + * scroll panning to only the vertical or horizontal axis, respectively. + * + * @public + */ +export declare enum PanOnScrollMode { + Free = "free", + Vertical = "vertical", + Horizontal = "horizontal" +} +/** + * @inline + */ +export type ViewportHelperFunctionOptions = { + duration?: number; + ease?: (t: number) => number; + interpolate?: 'smooth' | 'linear'; +}; +export type SetCenterOptions = ViewportHelperFunctionOptions & { + zoom?: number; +}; +export type FitBoundsOptions = ViewportHelperFunctionOptions & { + padding?: number; +}; +export type OnViewportChange = (viewport: Viewport) => void; +export type D3ZoomInstance = ZoomBehavior; +export type D3SelectionInstance = D3Selection; +export type D3ZoomHandler = (this: Element, event: any, d: unknown) => void; +export type UpdateNodeInternals = (nodeId: string | string[]) => void; +/** + * This type is mostly used to help position things on top of the flow viewport. For + * example both the [``](/api-reference/components/minimap) and + * [``](/api-reference/components/controls) components take a `position` + * prop of this type. + * + * @public + */ +export type PanelPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' | 'center-left' | 'center-right'; +export type ProOptions = { + account?: string; + hideAttribution: boolean; +}; +export type UseDragEvent = D3DragEvent; +export declare enum SelectionMode { + Partial = "partial", + Full = "full" +} +export type SelectionRect = Rect & { + startX: number; + startY: number; +}; +export type OnError = (id: string, message: string) => void; +export type UpdateNodePositions = (dragItems: Map, dragging?: boolean) => void; +export type PanBy = (delta: XYPosition) => Promise; +export declare const initialConnection: NoConnection; +export type NoConnection = { + inProgress: false; + isValid: null; + from: null; + fromHandle: null; + fromPosition: null; + fromNode: null; + to: null; + toHandle: null; + toPosition: null; + toNode: null; +}; +export type ConnectionInProgress = { + /** Indicates whether a connection is currently in progress. */ + inProgress: true; + /** + * If an ongoing connection is above a handle or inside the connection radius, this will be `true` + * or `false`, otherwise `null`. + */ + isValid: boolean | null; + /** Returns the xy start position or `null` if no connection is in progress. */ + from: XYPosition; + /** Returns the start handle or `null` if no connection is in progress. */ + fromHandle: Handle; + /** Returns the side (called position) of the start handle or `null` if no connection is in progress. */ + fromPosition: Position; + /** Returns the start node or `null` if no connection is in progress. */ + fromNode: NodeType; + /** Returns the xy end position or `null` if no connection is in progress. */ + to: XYPosition; + /** Returns the end handle or `null` if no connection is in progress. */ + toHandle: Handle | null; + /** Returns the side (called position) of the end handle or `null` if no connection is in progress. */ + toPosition: Position; + /** Returns the end node or `null` if no connection is in progress. */ + toNode: NodeType | null; +}; +/** + * The `ConnectionState` type bundles all information about an ongoing connection. + * It is returned by the [`useConnection`](/api-reference/hooks/use-connection) hook. + * + * @public + */ +export type ConnectionState = ConnectionInProgress | NoConnection; +export type FinalConnectionState = Omit, 'inProgress'>; +export type UpdateConnection = (params: ConnectionState) => void; +export type ColorModeClass = 'light' | 'dark'; +export type ColorMode = ColorModeClass | 'system'; +export type ConnectionLookup = Map>; +export type OnBeforeDeleteBase = ({ nodes, edges, }: { + nodes: NodeType[]; + edges: EdgeType[]; +}) => Promise; +//# sourceMappingURL=general.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/types/general.d.ts.map b/node_modules/@xyflow/system/dist/umd/types/general.d.ts.map new file mode 100644 index 0000000..955b98d --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/types/general.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../src/types/general.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI5C,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACxE,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAE9B,MAAM,MAAM,OAAO,GAAG,CAAC,QAAQ,EAAE,UAAU,KAAK,UAAU,CAAC;AAE3D,MAAM,MAAM,MAAM,GAAG,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI,EAAE,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;AACzF,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AACjC,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,CAAC,EAAE,6BAA6B,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AACtF,MAAM,MAAM,MAAM,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,6BAA6B,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AACtG,MAAM,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC;AACnC,MAAM,MAAM,WAAW,GAAG,MAAM,QAAQ,CAAC;AACzC,MAAM,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,6BAA6B,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAC5G,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAC/F,MAAM,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,gBAAgB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAEvF;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,0DAA0D;IAC1D,MAAM,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,MAAM,EAAE,MAAM,CAAC;IACf,qGAAqG;IACrG,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,mGAAmG;IACnG,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG;IAC1C,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG;IACxC,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;;;GAMG;AACH,oBAAY,cAAc;IACxB,MAAM,WAAW;IACjB,KAAK,UAAU;CAChB;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,EAAE,MAAM,EAAE,oBAAoB,KAAK,IAAI,CAAC;AACpG,MAAM,MAAM,SAAS,GAAG,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;AACzD,MAAM,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,EAAE,eAAe,EAAE,oBAAoB,KAAK,IAAI,CAAC;AAE3G,MAAM,MAAM,WAAW,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,UAAU,KAAK,IAAI,CAAC;AACvH,MAAM,MAAM,gBAAgB,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAAI,CACnE,KAAK,EAAE,UAAU,GAAG,UAAU,EAC9B,IAAI,EAAE,QAAQ,EACd,UAAU,EAAE,UAAU,KACnB,IAAI,CAAC;AACV,MAAM,MAAM,cAAc,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAAI,CACjE,KAAK,EAAE,UAAU,GAAG,UAAU,EAC9B,IAAI,EAAE,QAAQ,EACd,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,oBAAoB,KAClC,IAAI,CAAC;AAEV,MAAM,MAAM,iBAAiB,GAAG,CAAC,IAAI,EAAE,QAAQ,GAAG,UAAU,KAAK,OAAO,CAAC;AAEzE;;GAEG;AACH,MAAM,MAAM,iBAAiB,CAAC,QAAQ,SAAS,QAAQ,IAAI;IACzD,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,eAAe,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,GAAG,CAAC;AACrC,MAAM,MAAM,eAAe,GAAG,GAAG,MAAM,GAAG,WAAW,EAAE,GAAG,MAAM,CAAC;AAEjE,MAAM,MAAM,OAAO,GACf,eAAe,GACf;IACE,GAAG,CAAC,EAAE,eAAe,CAAC;IACtB,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,CAAC,CAAC,EAAE,eAAe,CAAC;IACpB,CAAC,CAAC,EAAE,eAAe,CAAC;CACrB,CAAC;AAEN;;GAEG;AACH,MAAM,MAAM,kBAAkB,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAAI;IACrE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAClC,KAAK,CAAC,EAAE,CAAC,QAAQ,GAAG;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAC;CACvC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;AAE7C,MAAM,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAExC;;;;;;;GAOG;AACH,oBAAY,eAAe;IACzB,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,UAAU,eAAe;CAC1B;AAED;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,6BAA6B,GAAG;IAC7D,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,6BAA6B,GAAG;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;AAE5D,MAAM,MAAM,cAAc,GAAG,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC5D,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;AACjF,MAAM,MAAM,aAAa,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;AAE5E,MAAM,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAC;AAEtE;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GACrB,UAAU,GACV,YAAY,GACZ,WAAW,GACX,aAAa,GACb,eAAe,GACf,cAAc,GACd,aAAa,GACb,cAAc,CAAC;AAEnB,MAAM,MAAM,UAAU,GAAG;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC,cAAc,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC;AAE9E,oBAAY,aAAa;IACvB,OAAO,YAAY;IACnB,IAAI,SAAS;CACd;AAED,MAAM,MAAM,aAAa,GAAG,IAAI,GAAG;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;AAE5D,MAAM,MAAM,mBAAmB,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,GAAG,gBAAgB,CAAC,EAAE,QAAQ,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;AACxH,MAAM,MAAM,KAAK,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAE5D,eAAO,MAAM,iBAAiB,EAAE,YAW/B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,EAAE,KAAK,CAAC;IAClB,OAAO,EAAE,IAAI,CAAC;IACd,IAAI,EAAE,IAAI,CAAC;IACX,UAAU,EAAE,IAAI,CAAC;IACjB,YAAY,EAAE,IAAI,CAAC;IACnB,QAAQ,EAAE,IAAI,CAAC;IACf,EAAE,EAAE,IAAI,CAAC;IACT,QAAQ,EAAE,IAAI,CAAC;IACf,UAAU,EAAE,IAAI,CAAC;IACjB,MAAM,EAAE,IAAI,CAAC;CACd,CAAC;AACF,MAAM,MAAM,oBAAoB,CAAC,QAAQ,SAAS,gBAAgB,GAAG,gBAAgB,IAAI;IACvF,+DAA+D;IAC/D,UAAU,EAAE,IAAI,CAAC;IACjB;;;OAGG;IACH,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IACxB,+EAA+E;IAC/E,IAAI,EAAE,UAAU,CAAC;IACjB,0EAA0E;IAC1E,UAAU,EAAE,MAAM,CAAC;IACnB,wGAAwG;IACxG,YAAY,EAAE,QAAQ,CAAC;IACvB,wEAAwE;IACxE,QAAQ,EAAE,QAAQ,CAAC;IACnB,6EAA6E;IAC7E,EAAE,EAAE,UAAU,CAAC;IACf,wEAAwE;IACxE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,sGAAsG;IACtG,UAAU,EAAE,QAAQ,CAAC;IACrB,sEAAsE;IACtE,MAAM,EAAE,QAAQ,GAAG,IAAI,CAAC;CACzB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,eAAe,CAAC,QAAQ,SAAS,gBAAgB,GAAG,gBAAgB,IAC5E,oBAAoB,CAAC,QAAQ,CAAC,GAC9B,YAAY,CAAC;AAEjB,MAAM,MAAM,oBAAoB,CAAC,QAAQ,SAAS,gBAAgB,GAAG,gBAAgB,IAAI,IAAI,CAC3F,eAAe,CAAC,QAAQ,CAAC,EACzB,YAAY,CACb,CAAC;AAEF,MAAM,MAAM,gBAAgB,CAAC,QAAQ,SAAS,gBAAgB,GAAG,gBAAgB,IAAI,CACnF,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC,KAC9B,IAAI,CAAC;AAEV,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,MAAM,CAAC;AAC9C,MAAM,MAAM,SAAS,GAAG,cAAc,GAAG,QAAQ,CAAC;AAElD,MAAM,MAAM,gBAAgB,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAE1E,MAAM,MAAM,kBAAkB,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,EAAE,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAAI,CAAC,EAC5G,KAAK,EACL,KAAK,GACN,EAAE;IACD,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB,KAAK,OAAO,CAAC,OAAO,GAAG;IAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;IAAC,KAAK,EAAE,QAAQ,EAAE,CAAA;CAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/types/handles.d.ts b/node_modules/@xyflow/system/dist/umd/types/handles.d.ts new file mode 100644 index 0000000..af89fd6 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/types/handles.d.ts @@ -0,0 +1,56 @@ +import type { Position, IsValidConnection } from '.'; +export type HandleType = 'source' | 'target'; +export type Handle = { + id?: string | null; + nodeId: string; + x: number; + y: number; + position: Position; + type: HandleType; + width: number; + height: number; +}; +export type HandleProps = { + /** + * Type of the handle. + * @default "source" + * @example HandleType.Source, HandleType.Target + */ + type: HandleType; + /** + * The position of the handle relative to the node. In a horizontal flow source handles are + * typically `Position.Right` and in a vertical flow they are typically `Position.Top`. + * @default Position.Top + * @example Position.TopLeft, Position.TopRight, Position.BottomLeft, Position.BottomRight + */ + position: Position; + /** + * Should you be able to connect to/from this handle. + * @default true + */ + isConnectable?: boolean; + /** + * Dictates whether a connection can start from this handle. + * @default true + */ + isConnectableStart?: boolean; + /** + * Dictates whether a connection can end on this handle. + * @default true + */ + isConnectableEnd?: boolean; + /** + * Called when a connection is dragged to this handle. You can use this callback to perform some + * custom validation logic based on the connection target and source, for example. Where possible, + * we recommend you move this logic to the `isValidConnection` prop on the main ReactFlow + * component for performance reasons. + * @remarks connection becomes an edge if isValidConnection returns true + */ + isValidConnection?: IsValidConnection; + /** + * Id of the handle. + * @remarks optional if there is only one handle of this type + */ + id?: string | null; +}; +//# sourceMappingURL=handles.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/types/handles.d.ts.map b/node_modules/@xyflow/system/dist/umd/types/handles.d.ts.map new file mode 100644 index 0000000..fdb465b --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/types/handles.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"handles.d.ts","sourceRoot":"","sources":["../../src/types/handles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,GAAG,CAAC;AAErD,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE7C,MAAM,MAAM,MAAM,GAAG;IACnB,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB;;;;OAIG;IACH,IAAI,EAAE,UAAU,CAAC;IACjB;;;;;OAKG;IACH,QAAQ,EAAE,QAAQ,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACpB,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/types/index.d.ts b/node_modules/@xyflow/system/dist/umd/types/index.d.ts new file mode 100644 index 0000000..1a0bc5b --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/types/index.d.ts @@ -0,0 +1,8 @@ +export * from './changes'; +export * from './general'; +export * from './nodes'; +export * from './edges'; +export * from './handles'; +export * from './utils'; +export * from './panzoom'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/types/index.d.ts.map b/node_modules/@xyflow/system/dist/umd/types/index.d.ts.map new file mode 100644 index 0000000..cb2e378 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/types/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/types/nodes.d.ts b/node_modules/@xyflow/system/dist/umd/types/nodes.d.ts new file mode 100644 index 0000000..5551df9 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/types/nodes.d.ts @@ -0,0 +1,161 @@ +import type { XYPosition, Position, CoordinateExtent, Handle } from '.'; +import { Optional } from '../utils/types'; +/** + * Framework independent node data structure. + * + * @inline + * @typeParam NodeData - type of the node data + * @typeParam NodeType - type of the node + */ +export type NodeBase = Record, NodeType extends string | undefined = string | undefined> = { + /** Unique id of a node. */ + id: string; + /** + * Position of a node on the pane. + * @example { x: 0, y: 0 } + */ + position: XYPosition; + /** Arbitrary data passed to a node. */ + data: NodeData; + /** + * Only relevant for default, source, target nodeType. Controls source position. + * @example 'right', 'left', 'top', 'bottom' + */ + sourcePosition?: Position; + /** + * Only relevant for default, source, target nodeType. Controls target position. + * @example 'right', 'left', 'top', 'bottom' + */ + targetPosition?: Position; + /** Whether or not the node should be visible on the canvas. */ + hidden?: boolean; + selected?: boolean; + /** Whether or not the node is currently being dragged. */ + dragging?: boolean; + /** Whether or not the node is able to be dragged. */ + draggable?: boolean; + selectable?: boolean; + connectable?: boolean; + deletable?: boolean; + /** + * A class name that can be applied to elements inside the node that allows those elements to act + * as drag handles, letting the user drag the node by clicking and dragging on those elements. + */ + dragHandle?: string; + width?: number; + height?: number; + initialWidth?: number; + initialHeight?: number; + /** Parent node id, used for creating sub-flows. */ + parentId?: string; + zIndex?: number; + /** + * Boundary a node can be moved in. + * @example 'parent' or [[0, 0], [100, 100]] + */ + extent?: 'parent' | CoordinateExtent; + /** + * When `true`, the parent node will automatically expand if this node is dragged to the edge of + * the parent node's bounds. + */ + expandParent?: boolean; + ariaLabel?: string; + /** + * Origin of the node relative to its position. + * @example + * [0.5, 0.5] // centers the node + * [0, 0] // top left + * [1, 1] // bottom right + */ + origin?: NodeOrigin; + handles?: NodeHandle[]; + measured?: { + width?: number; + height?: number; + }; +} & (undefined extends NodeType ? { + /** Type of node defined in nodeTypes */ + type?: string | undefined; +} : { + /** Type of node defined in nodeTypes */ + type: NodeType; +}); +export type InternalNodeBase = Omit & { + measured: { + width?: number; + height?: number; + }; + internals: { + positionAbsolute: XYPosition; + z: number; + /** + * Holds a reference to the original node object provided by the user. + * Used as an optimization to avoid certain operations. + */ + userNode: NodeType; + handleBounds?: NodeHandleBounds; + bounds?: NodeBounds; + }; +}; +/** + * The node data structure that gets used for the custom nodes props. + * + * @public + */ +export type NodeProps = Pick & Required> & { + /** Whether a node is connectable or not. */ + isConnectable: boolean; + /** Position absolute x value. */ + positionAbsoluteX: number; + /** Position absolute y value. */ + positionAbsoluteY: number; +}; +export type NodeHandleBounds = { + source: Handle[] | null; + target: Handle[] | null; +}; +export type InternalNodeUpdate = { + id: string; + nodeElement: HTMLDivElement; + force?: boolean; +}; +export type NodeBounds = XYPosition & { + width: number | null; + height: number | null; +}; +export type NodeDragItem = { + id: string; + position: XYPosition; + distance: XYPosition; + measured: { + width: number; + height: number; + }; + internals: { + positionAbsolute: XYPosition; + }; + extent?: 'parent' | CoordinateExtent; + parentId?: string; + dragging?: boolean; + origin?: NodeOrigin; + expandParent?: boolean; +}; +/** + * The origin of a Node determines how it is placed relative to its own coordinates. + * `[0, 0]` places it at the top left corner, `[0.5, 0.5]` right in the center and + * `[1, 1]` at the bottom right of its position. + * + * @public + */ +export type NodeOrigin = [number, number]; +export type OnSelectionDrag = (event: MouseEvent, nodes: NodeBase[]) => void; +/** + * Type for the handles of a node + * + * @public + */ +export type NodeHandle = Omit, 'nodeId'>; +export type Align = 'center' | 'start' | 'end'; +export type NodeLookup = Map; +export type ParentLookup = Map>; +//# sourceMappingURL=nodes.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/types/nodes.d.ts.map b/node_modules/@xyflow/system/dist/umd/types/nodes.d.ts.map new file mode 100644 index 0000000..dd3ef9b --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/types/nodes.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../src/types/nodes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C;;;;;;GAMG;AACH,MAAM,MAAM,QAAQ,CAClB,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClE,QAAQ,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,IACtD;IACF,2BAA2B;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX;;;OAGG;IACH,QAAQ,EAAE,UAAU,CAAC;IACrB,uCAAuC;IACvC,IAAI,EAAE,QAAQ,CAAC;IACf;;;OAGG;IACH,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B;;;OAGG;IACH,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,+DAA+D;IAC/D,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qDAAqD;IACrD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mDAAmD;IACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,MAAM,CAAC,EAAE,QAAQ,GAAG,gBAAgB,CAAC;IACrC;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE;QACT,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;CACH,GAAG,CAAC,SAAS,SAAS,QAAQ,GAC3B;IACE,wCAAwC;IACxC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B,GACD;IACE,wCAAwC;IACxC,IAAI,EAAE,QAAQ,CAAC;CAChB,CAAC,CAAC;AAEP,MAAM,MAAM,gBAAgB,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAAI,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,GAAG;IAChG,QAAQ,EAAE;QACR,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,SAAS,EAAE;QACT,gBAAgB,EAAE,UAAU,CAAC;QAC7B,CAAC,EAAE,MAAM,CAAC;QACV;;;WAGG;QACH,QAAQ,EAAE,QAAQ,CAAC;QACnB,YAAY,CAAC,EAAE,gBAAgB,CAAC;QAChC,MAAM,CAAC,EAAE,UAAU,CAAC;KACrB,CAAC;CACH,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,SAAS,CAAC,QAAQ,SAAS,QAAQ,IAAI,IAAI,CACrD,QAAQ,EACR,IAAI,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,YAAY,GAAG,UAAU,CACrG,GACC,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,GAAG,QAAQ,GAAG,YAAY,GAAG,WAAW,GAAG,UAAU,GAAG,WAAW,CAAC,CAAC,GAAG;IACjH,4CAA4C;IAC5C,aAAa,EAAE,OAAO,CAAC;IACvB,iCAAiC;IACjC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iCAAiC;IACjC,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEJ,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,cAAc,CAAC;IAC5B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG;IACpC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,UAAU,CAAC;IAErB,QAAQ,EAAE,UAAU,CAAC;IACrB,QAAQ,EAAE;QACR,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,SAAS,EAAE;QACT,gBAAgB,EAAE,UAAU,CAAC;KAC9B,CAAC;IACF,MAAM,CAAC,EAAE,QAAQ,GAAG,gBAAgB,CAAC;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE1C,MAAM,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;AAE7E;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAC;AAE9E,MAAM,MAAM,KAAK,GAAG,QAAQ,GAAG,OAAO,GAAG,KAAK,CAAC;AAE/C,MAAM,MAAM,UAAU,CAAC,QAAQ,SAAS,gBAAgB,GAAG,gBAAgB,IAAI,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AACrG,MAAM,MAAM,YAAY,CAAC,QAAQ,SAAS,gBAAgB,GAAG,gBAAgB,IAAI,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/types/panzoom.d.ts b/node_modules/@xyflow/system/dist/umd/types/panzoom.d.ts new file mode 100644 index 0000000..ed4ee81 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/types/panzoom.d.ts @@ -0,0 +1,53 @@ +import type { ZoomTransform } from 'd3-zoom'; +import { PanOnScrollMode, type CoordinateExtent, type Transform, type Viewport } from './'; +export type OnDraggingChange = (dragging: boolean) => void; +export type OnTransformChange = (transform: Transform) => void; +export type PanZoomParams = { + domNode: Element; + minZoom: number; + maxZoom: number; + paneClickDistance: number; + viewport: Viewport; + translateExtent: CoordinateExtent; + onDraggingChange: OnDraggingChange; + onPanZoomStart?: OnPanZoom; + onPanZoom?: OnPanZoom; + onPanZoomEnd?: OnPanZoom; +}; +export type PanZoomTransformOptions = { + duration?: number; + ease?: (t: number) => number; + interpolate?: 'smooth' | 'linear'; +}; +export type OnPanZoom = (event: MouseEvent | TouchEvent | null, viewport: Viewport) => void; +export type PanZoomUpdateOptions = { + noWheelClassName: string; + noPanClassName: string; + onPaneContextMenu?: (event: MouseEvent) => void; + preventScrolling: boolean; + panOnScroll: boolean; + panOnDrag: boolean | number[]; + panOnScrollMode: PanOnScrollMode; + panOnScrollSpeed: number; + userSelectionActive: boolean; + zoomOnPinch: boolean; + zoomOnScroll: boolean; + zoomOnDoubleClick: boolean; + zoomActivationKeyPressed: boolean; + lib: string; + onTransformChange: OnTransformChange; +}; +export type PanZoomInstance = { + update: (params: PanZoomUpdateOptions) => void; + destroy: () => void; + getViewport: () => Viewport; + setViewport: (viewport: Viewport, options?: PanZoomTransformOptions) => Promise; + setViewportConstrained: (viewport: Viewport, extent: CoordinateExtent, translateExtent: CoordinateExtent) => Promise; + setScaleExtent: (scaleExtent: [number, number]) => void; + setTranslateExtent: (translateExtent: CoordinateExtent) => void; + scaleTo: (scale: number, options?: PanZoomTransformOptions) => Promise; + scaleBy: (factor: number, options?: PanZoomTransformOptions) => Promise; + syncViewport: (viewport: Viewport) => void; + setClickDistance: (distance: number) => void; +}; +//# sourceMappingURL=panzoom.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/types/panzoom.d.ts.map b/node_modules/@xyflow/system/dist/umd/types/panzoom.d.ts.map new file mode 100644 index 0000000..3b0599f --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/types/panzoom.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"panzoom.d.ts","sourceRoot":"","sources":["../../src/types/panzoom.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,OAAO,EAAE,eAAe,EAAE,KAAK,gBAAgB,EAAE,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAE,MAAM,IAAI,CAAC;AAE3F,MAAM,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;AAC3D,MAAM,MAAM,iBAAiB,GAAG,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,CAAC;AAE/D,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,QAAQ,CAAC;IACnB,eAAe,EAAE,gBAAgB,CAAC;IAClC,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,YAAY,CAAC,EAAE,SAAS,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI,EAAE,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;AAE5F,MAAM,MAAM,oBAAoB,GAAG;IACjC,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IAChD,gBAAgB,EAAE,OAAO,CAAC;IAC1B,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,GAAG,MAAM,EAAE,CAAC;IAC9B,eAAe,EAAE,eAAe,CAAC;IACjC,gBAAgB,EAAE,MAAM,CAAC;IACzB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,wBAAwB,EAAE,OAAO,CAAC;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,iBAAiB,EAAE,iBAAiB,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,CAAC,MAAM,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC/C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,EAAE,MAAM,QAAQ,CAAC;IAC5B,WAAW,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,uBAAuB,KAAK,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAAC;IAC3G,sBAAsB,EAAE,CACtB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,gBAAgB,EACxB,eAAe,EAAE,gBAAgB,KAC9B,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAAC;IACxC,cAAc,EAAE,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IACxD,kBAAkB,EAAE,CAAC,eAAe,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAChE,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,uBAAuB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAChF,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,uBAAuB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACjF,YAAY,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC3C,gBAAgB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/types/utils.d.ts b/node_modules/@xyflow/system/dist/umd/types/utils.d.ts new file mode 100644 index 0000000..dbca943 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/types/utils.d.ts @@ -0,0 +1,53 @@ +/** + * While [`PanelPosition`](/api-reference/types/panel-position) can be used to place a + * component in the corners of a container, the `Position` enum is less precise and used + * primarily in relation to edges and handles. + * + * @public + */ +export declare enum Position { + Left = "left", + Top = "top", + Right = "right", + Bottom = "bottom" +} +export declare const oppositePosition: { + left: Position; + right: Position; + top: Position; + bottom: Position; +}; +/** + * All positions are stored in an object with x and y coordinates. + * + * @public + */ +export type XYPosition = { + x: number; + y: number; +}; +export type XYZPosition = XYPosition & { + z: number; +}; +export type Dimensions = { + width: number; + height: number; +}; +export type Rect = Dimensions & XYPosition; +export type Box = XYPosition & { + x2: number; + y2: number; +}; +export type Transform = [number, number, number]; +/** + * A coordinate extent represents two points in a coordinate system: one in the top + * left corner and one in the bottom right corner. It is used to represent the + * bounds of nodes in the flow or the bounds of the viewport. + * + * @public + * + * @remarks Props that expect a `CoordinateExtent` usually default to `[[-∞, -∞], [+∞, +∞]]` + * to represent an unbounded extent. + */ +export type CoordinateExtent = [[number, number], [number, number]]; +//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/types/utils.d.ts.map b/node_modules/@xyflow/system/dist/umd/types/utils.d.ts.map new file mode 100644 index 0000000..5da3810 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/types/utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/types/utils.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,oBAAY,QAAQ;IAClB,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,MAAM,WAAW;CAClB;AAED,eAAO,MAAM,gBAAgB;;;;;CAK5B,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG;IAAE,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAErD,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,IAAI,GAAG,UAAU,GAAG,UAAU,CAAC;AAE3C,MAAM,MAAM,GAAG,GAAG,UAAU,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAEjD;;;;;;;;;GASG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/utils/connections.d.ts b/node_modules/@xyflow/system/dist/umd/utils/connections.d.ts new file mode 100644 index 0000000..03dc064 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/utils/connections.d.ts @@ -0,0 +1,13 @@ +import { HandleConnection } from '../types'; +/** + * @internal + */ +export declare function areConnectionMapsEqual(a?: Map, b?: Map): boolean; +/** + * We call the callback for all connections in a that are not in b + * + * @internal + */ +export declare function handleConnectionChange(a: Map, b: Map, cb?: (diff: HandleConnection[]) => void): void; +export declare function getConnectionStatus(isValid: boolean | null): "valid" | "invalid" | null; +//# sourceMappingURL=connections.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/utils/connections.d.ts.map b/node_modules/@xyflow/system/dist/umd/utils/connections.d.ts.map new file mode 100644 index 0000000..0688bcf --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/utils/connections.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"connections.d.ts","sourceRoot":"","sources":["../../src/utils/connections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,WAoB1G;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,EAChC,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,EAChC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,IAAI,QAiBxC;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,8BAE1D"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/utils/dom.d.ts b/node_modules/@xyflow/system/dist/umd/utils/dom.d.ts new file mode 100644 index 0000000..8677d65 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/utils/dom.d.ts @@ -0,0 +1,21 @@ +import type { Transform, XYPosition, SnapGrid, Dimensions, Handle } from '../types'; +export type GetPointerPositionParams = { + transform: Transform; + snapGrid?: SnapGrid; + snapToGrid?: boolean; + containerBounds: DOMRect | null; +}; +export declare function getPointerPosition(event: MouseEvent | TouchEvent, { snapGrid, snapToGrid, transform, containerBounds }: GetPointerPositionParams): XYPosition & { + xSnapped: number; + ySnapped: number; +}; +export declare const getDimensions: (node: HTMLDivElement) => Dimensions; +export declare const getHostForElement: (element: HTMLElement | EventTarget | null) => Document | ShadowRoot; +export declare function isInputDOMNode(event: KeyboardEvent): boolean; +export declare const isMouseEvent: (event: MouseEvent | TouchEvent) => event is MouseEvent; +export declare const getEventPosition: (event: MouseEvent | TouchEvent, bounds?: DOMRect) => { + x: number; + y: number; +}; +export declare const getHandleBounds: (type: "source" | "target", nodeElement: HTMLDivElement, nodeBounds: DOMRect, zoom: number, nodeId: string) => Handle[] | null; +//# sourceMappingURL=dom.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/utils/dom.d.ts.map b/node_modules/@xyflow/system/dist/umd/utils/dom.d.ts.map new file mode 100644 index 0000000..bd26c68 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/utils/dom.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/utils/dom.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAY,MAAM,EAAE,MAAM,UAAU,CAAC;AAG9F,MAAM,MAAM,wBAAwB,GAAG;IACrC,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,EAAE,OAAO,GAAG,IAAI,CAAC;CACjC,CAAC;AAEF,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,UAAU,GAAG,UAAU,EAC9B,EAAE,QAAiB,EAAE,UAAkB,EAAE,SAAS,EAAE,eAAe,EAAE,EAAE,wBAAwB,GAC9F,UAAU,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAcrD;AAED,eAAO,MAAM,aAAa,SAAU,cAAc,KAAG,UAGnD,CAAC;AAEH,eAAO,MAAM,iBAAiB,YAAa,WAAW,GAAG,WAAW,GAAG,IAAI,KAAG,QAAQ,GAAG,UACiB,CAAC;AAI3G,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAS5D;AAED,eAAO,MAAM,YAAY,UAAW,UAAU,GAAG,UAAU,KAAG,KAAK,IAAI,UAAgC,CAAC;AAExG,eAAO,MAAM,gBAAgB,UAAW,UAAU,GAAG,UAAU,WAAW,OAAO;;;CAShF,CAAC;AAOF,eAAO,MAAM,eAAe,SACpB,QAAQ,GAAG,QAAQ,eACZ,cAAc,cACf,OAAO,QACb,MAAM,UACJ,MAAM,KACb,MAAM,EAAE,GAAG,IAoBb,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/utils/edges/bezier-edge.d.ts b/node_modules/@xyflow/system/dist/umd/utils/edges/bezier-edge.d.ts new file mode 100644 index 0000000..2df99ce --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/utils/edges/bezier-edge.d.ts @@ -0,0 +1,77 @@ +import { Position } from '../../types'; +export type GetBezierPathParams = { + /** The `x` position of the source handle. */ + sourceX: number; + /** The `y` position of the source handle. */ + sourceY: number; + /** + * The position of the source handle. + * @default Position.Bottom + */ + sourcePosition?: Position; + /** The `x` position of the target handle. */ + targetX: number; + /** The `y` position of the target handle. */ + targetY: number; + /** + * The position of the target handle. + * @default Position.Top + */ + targetPosition?: Position; + /** + * The curvature of the bezier edge. + * @default 0.25 + */ + curvature?: number; +}; +export type GetControlWithCurvatureParams = { + pos: Position; + x1: number; + y1: number; + x2: number; + y2: number; + c: number; +}; +export declare function getBezierEdgeCenter({ sourceX, sourceY, targetX, targetY, sourceControlX, sourceControlY, targetControlX, targetControlY, }: { + sourceX: number; + sourceY: number; + targetX: number; + targetY: number; + sourceControlX: number; + sourceControlY: number; + targetControlX: number; + targetControlY: number; +}): [number, number, number, number]; +/** + * The `getBezierPath` util returns everything you need to render a bezier edge + *between two nodes. + * @public + * @returns A path string you can use in an SVG, the `labelX` and `labelY` position (center of path) + * and `offsetX`, `offsetY` between source handle and label. + * - `path`: the path to use in an SVG `` element. + * - `labelX`: the `x` position you can use to render a label for this edge. + * - `labelY`: the `y` position you can use to render a label for this edge. + * - `offsetX`: the absolute difference between the source `x` position and the `x` position of the + * middle of this path. + * - `offsetY`: the absolute difference between the source `y` position and the `y` position of the + * middle of this path. + * @example + * ```js + * const source = { x: 0, y: 20 }; + * const target = { x: 150, y: 100 }; + * + * const [path, labelX, labelY, offsetX, offsetY] = getBezierPath({ + * sourceX: source.x, + * sourceY: source.y, + * sourcePosition: Position.Right, + * targetX: target.x, + * targetY: target.y, + * targetPosition: Position.Left, + *}); + *``` + * + * @remarks This function returns a tuple (aka a fixed-size array) to make it easier to + *work with multiple edge paths at once. + */ +export declare function getBezierPath({ sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition, curvature, }: GetBezierPathParams): [path: string, labelX: number, labelY: number, offsetX: number, offsetY: number]; +//# sourceMappingURL=bezier-edge.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/utils/edges/bezier-edge.d.ts.map b/node_modules/@xyflow/system/dist/umd/utils/edges/bezier-edge.d.ts.map new file mode 100644 index 0000000..6ecc89b --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/utils/edges/bezier-edge.d.ts.map @@ -0,0 +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,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B;;;OAGG;IACH,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,CAWnC;AAuBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,OAAO,EACP,cAAgC,EAChC,OAAO,EACP,OAAO,EACP,cAA6B,EAC7B,SAAgB,GACjB,EAAE,mBAAmB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAmCxG"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/utils/edges/general.d.ts b/node_modules/@xyflow/system/dist/umd/utils/edges/general.d.ts new file mode 100644 index 0000000..0bfa24a --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/utils/edges/general.d.ts @@ -0,0 +1,62 @@ +import { Connection, InternalNodeBase, Transform, EdgeBase } from '../..'; +export declare function getEdgeCenter({ sourceX, sourceY, targetX, targetY, }: { + sourceX: number; + sourceY: number; + targetX: number; + targetY: number; +}): [number, number, number, number]; +export type GetEdgeZIndexParams = { + sourceNode: InternalNodeBase; + targetNode: InternalNodeBase; + selected?: boolean; + zIndex?: number; + elevateOnSelect?: boolean; +}; +export declare function getElevatedEdgeZIndex({ sourceNode, targetNode, selected, zIndex, elevateOnSelect, }: GetEdgeZIndexParams): number; +type IsEdgeVisibleParams = { + sourceNode: InternalNodeBase; + targetNode: InternalNodeBase; + width: number; + height: number; + transform: Transform; +}; +export declare function isEdgeVisible({ sourceNode, targetNode, width, height, transform }: IsEdgeVisibleParams): boolean; +/** + * This util is a convenience function to add a new Edge to an array of edges. It also performs some validation to make sure you don't add an invalid edge or duplicate an existing one. + * @public + * @param edgeParams - Either an `Edge` or a `Connection` you want to add. + * @param edges - The array of all current edges. + * @returns A new array of edges with the new edge added. + * + * @remarks If an edge with the same `target` and `source` already exists (and the same + *`targetHandle` and `sourceHandle` if those are set), then this util won't add + *a new edge even if the `id` property is different. + * + */ +export declare const addEdge: (edgeParams: EdgeType | Connection, edges: EdgeType[]) => EdgeType[]; +export type ReconnectEdgeOptions = { + /** + * Should the id of the old edge be replaced with the new connection id. + * @default true + */ + shouldReplaceId?: boolean; +}; +/** + * A handy utility to update an existing [`Edge`](/api-reference/types/edge) with new properties. + *This searches your edge array for an edge with a matching `id` and updates its + *properties with the connection you provide. + * @public + * @param oldEdge - The edge you want to update. + * @param newConnection - The new connection you want to update the edge with. + * @param edges - The array of all current edges. + * @returns The updated edges array. + * + * @example + * ```js + *const onReconnect = useCallback( + * (oldEdge: Edge, newConnection: Connection) => setEdges((els) => reconnectEdge(oldEdge, newConnection, els)),[]); + *``` + */ +export declare const reconnectEdge: (oldEdge: EdgeType, newConnection: Connection, edges: EdgeType[], options?: ReconnectEdgeOptions) => EdgeType[]; +export {}; +//# sourceMappingURL=general.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/utils/edges/general.d.ts.map b/node_modules/@xyflow/system/dist/umd/utils/edges/general.d.ts.map new file mode 100644 index 0000000..c93f63e --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/utils/edges/general.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../../src/utils/edges/general.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,SAAS,EAA6B,QAAQ,EAAE,MAAM,OAAO,CAAC;AAIrG,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;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,UAAU,EAAE,gBAAgB,CAAC;IAC7B,UAAU,EAAE,gBAAgB,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,EACpC,UAAU,EACV,UAAU,EACV,QAAgB,EAChB,MAAU,EACV,eAAuB,GACxB,EAAE,mBAAmB,GAAG,MAAM,CAS9B;AAED,KAAK,mBAAmB,GAAG;IACzB,UAAU,EAAE,gBAAgB,CAAC;IAC7B,UAAU,EAAE,gBAAgB,CAAC;IAC7B,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;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,OAAO,GAAI,QAAQ,SAAS,QAAQ,cACnC,QAAQ,GAAG,UAAU,SAC1B,QAAQ,EAAE,KAChB,QAAQ,EA8BV,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,aAAa,GAAI,QAAQ,SAAS,QAAQ,WAC5C,QAAQ,iBACF,UAAU,SAClB,QAAQ,EAAE,YACR,oBAAoB,KAC5B,QAAQ,EA4BV,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/utils/edges/index.d.ts b/node_modules/@xyflow/system/dist/umd/utils/edges/index.d.ts new file mode 100644 index 0000000..668a084 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/utils/edges/index.d.ts @@ -0,0 +1,6 @@ +export * from './bezier-edge'; +export * from './straight-edge'; +export * from './smoothstep-edge'; +export * from './general'; +export * from './positions'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/utils/edges/index.d.ts.map b/node_modules/@xyflow/system/dist/umd/utils/edges/index.d.ts.map new file mode 100644 index 0000000..0efd829 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/utils/edges/index.d.ts.map @@ -0,0 +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"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/utils/edges/positions.d.ts b/node_modules/@xyflow/system/dist/umd/utils/edges/positions.d.ts new file mode 100644 index 0000000..e0687d3 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/utils/edges/positions.d.ts @@ -0,0 +1,17 @@ +import { EdgePosition } from '../../types/edges'; +import { ConnectionMode, OnError } from '../../types/general'; +import { InternalNodeBase } from '../../types/nodes'; +import { Position, XYPosition } from '../../types/utils'; +import { Handle } from '../../types'; +export type GetEdgePositionParams = { + id: string; + sourceNode: InternalNodeBase; + sourceHandle: string | null; + targetNode: InternalNodeBase; + targetHandle: string | null; + connectionMode: ConnectionMode; + onError?: OnError; +}; +export declare function getEdgePosition(params: GetEdgePositionParams): EdgePosition | null; +export declare function getHandlePosition(node: InternalNodeBase, handle: Handle | null, fallbackPosition?: Position, center?: boolean): XYPosition; +//# sourceMappingURL=positions.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/utils/edges/positions.d.ts.map b/node_modules/@xyflow/system/dist/umd/utils/edges/positions.d.ts.map new file mode 100644 index 0000000..ac5deb6 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/utils/edges/positions.d.ts.map @@ -0,0 +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,gBAAgB,EAAc,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGrC,MAAM,MAAM,qBAAqB,GAAG;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,gBAAgB,CAAC;IAC7B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,EAAE,gBAAgB,CAAC;IAC7B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,cAAc,EAAE,cAAc,CAAC;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAUF,wBAAgB,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,YAAY,GAAG,IAAI,CA6ClF;AA2BD,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,gBAAgB,EACtB,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,gBAAgB,GAAE,QAAwB,EAC1C,MAAM,UAAQ,GACb,UAAU,CAqBZ"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/utils/edges/smoothstep-edge.d.ts b/node_modules/@xyflow/system/dist/umd/utils/edges/smoothstep-edge.d.ts new file mode 100644 index 0000000..40083d8 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/utils/edges/smoothstep-edge.d.ts @@ -0,0 +1,60 @@ +import { Position } from '../../types'; +export interface GetSmoothStepPathParams { + /** The `x` position of the source handle. */ + sourceX: number; + /** The `y` position of the source handle. */ + sourceY: number; + /** + * The position of the source handle. + * @default Position.Bottom + */ + sourcePosition?: Position; + /** The `x` position of the target handle. */ + targetX: number; + /** The `y` position of the target handle. */ + targetY: number; + /** + * The position of the target handle. + * @default Position.Top + */ + targetPosition?: Position; + /** @default 5 */ + borderRadius?: number; + centerX?: number; + centerY?: number; + /** @default 20 */ + offset?: number; +} +/** + * The `getSmoothStepPath` util returns everything you need to render a stepped path + * between two nodes. The `borderRadius` property can be used to choose how rounded + * the corners of those steps are. + * @public + * @returns A path string you can use in an SVG, the `labelX` and `labelY` position (center of path) + * and `offsetX`, `offsetY` between source handle and label. + * + * - `path`: the path to use in an SVG `` element. + * - `labelX`: the `x` position you can use to render a label for this edge. + * - `labelY`: the `y` position you can use to render a label for this edge. + * - `offsetX`: the absolute difference between the source `x` position and the `x` position of the + * middle of this path. + * - `offsetY`: the absolute difference between the source `y` position and the `y` position of the + * middle of this path. + * @example + * ```js + * const source = { x: 0, y: 20 }; + * const target = { x: 150, y: 100 }; + * + * const [path, labelX, labelY, offsetX, offsetY] = getSmoothStepPath({ + * sourceX: source.x, + * sourceY: source.y, + * sourcePosition: Position.Right, + * targetX: target.x, + * targetY: target.y, + * targetPosition: Position.Left, + * }); + * ``` + * @remarks This function returns a tuple (aka a fixed-size array) to make it easier to work with multiple edge paths at once. + */ +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]; +//# sourceMappingURL=smoothstep-edge.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/utils/edges/smoothstep-edge.d.ts.map b/node_modules/@xyflow/system/dist/umd/utils/edges/smoothstep-edge.d.ts.map new file mode 100644 index 0000000..a954bf4 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/utils/edges/smoothstep-edge.d.ts.map @@ -0,0 +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,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,iBAAiB;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAwLD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,OAAO,EACP,cAAgC,EAChC,OAAO,EACP,OAAO,EACP,cAA6B,EAC7B,YAAgB,EAChB,OAAO,EACP,OAAO,EACP,MAAW,GACZ,EAAE,uBAAuB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAyB5G"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/utils/edges/straight-edge.d.ts b/node_modules/@xyflow/system/dist/umd/utils/edges/straight-edge.d.ts new file mode 100644 index 0000000..bbb609b --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/utils/edges/straight-edge.d.ts @@ -0,0 +1,41 @@ +export type GetStraightPathParams = { + /** The `x` position of the source handle. */ + sourceX: number; + /** The `y` position of the source handle. */ + sourceY: number; + /** The `x` position of the target handle. */ + targetX: number; + /** The `y` position of the target handle. */ + targetY: number; +}; +/** + * Calculates the straight line path between two points. + * @public + * @returns A path string you can use in an SVG, the `labelX` and `labelY` position (center of path) + * and `offsetX`, `offsetY` between source handle and label. + * + * - `path`: the path to use in an SVG `` element. + * - `labelX`: the `x` position you can use to render a label for this edge. + * - `labelY`: the `y` position you can use to render a label for this edge. + * - `offsetX`: the absolute difference between the source `x` position and the `x` position of the + * middle of this path. + * - `offsetY`: the absolute difference between the source `y` position and the `y` position of the + * middle of this path. + * @example + * ```js + * const source = { x: 0, y: 20 }; + * const target = { x: 150, y: 100 }; + * + * const [path, labelX, labelY, offsetX, offsetY] = getStraightPath({ + * sourceX: source.x, + * sourceY: source.y, + * sourcePosition: Position.Right, + * targetX: target.x, + * targetY: target.y, + * targetPosition: Position.Left, + * }); + * ``` + * @remarks This function returns a tuple (aka a fixed-size array) to make it easier to work with multiple edge paths at once. + */ +export declare function getStraightPath({ sourceX, sourceY, targetX, targetY, }: GetStraightPathParams): [path: string, labelX: number, labelY: number, offsetX: number, offsetY: number]; +//# sourceMappingURL=straight-edge.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/utils/edges/straight-edge.d.ts.map b/node_modules/@xyflow/system/dist/umd/utils/edges/straight-edge.d.ts.map new file mode 100644 index 0000000..b25ad66 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/utils/edges/straight-edge.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"straight-edge.d.ts","sourceRoot":"","sources":["../../../src/utils/edges/straight-edge.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,qBAAqB,GAAG;IAClC,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,eAAe,CAAC,EAC9B,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,GACR,EAAE,qBAAqB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAS1G"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/utils/general.d.ts b/node_modules/@xyflow/system/dist/umd/utils/general.d.ts new file mode 100644 index 0000000..cddc570 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/utils/general.d.ts @@ -0,0 +1,85 @@ +import type { Dimensions, XYPosition, CoordinateExtent, Box, Rect, NodeBase, NodeOrigin, SnapGrid, Transform, InternalNodeBase, NodeLookup, Padding } from '../types'; +import { type Viewport } from '../types'; +import { type AriaLabelConfig } from '../constants'; +export declare const clamp: (val: number, min?: number, max?: number) => number; +export declare const clampPosition: (position: XYPosition | undefined, extent: CoordinateExtent, dimensions: Partial) => { + x: number; + y: number; +}; +export declare function clampPositionToParent(childPosition: XYPosition, childDimensions: Dimensions, parent: InternalNodeBase): { + x: number; + y: number; +}; +export declare const calcAutoPan: (pos: XYPosition, bounds: Dimensions, speed?: number, distance?: number) => number[]; +export declare const getBoundsOfBoxes: (box1: Box, box2: Box) => Box; +export declare const rectToBox: ({ x, y, width, height }: Rect) => Box; +export declare const boxToRect: ({ x, y, x2, y2 }: Box) => Rect; +export declare const nodeToRect: (node: InternalNodeBase | NodeBase, nodeOrigin?: NodeOrigin) => Rect; +export declare const nodeToBox: (node: InternalNodeBase | NodeBase, nodeOrigin?: NodeOrigin) => Box; +export declare const getBoundsOfRects: (rect1: Rect, rect2: Rect) => Rect; +export declare const getOverlappingArea: (rectA: Rect, rectB: Rect) => number; +export declare const isRectObject: (obj: any) => obj is Rect; +export declare const isNumeric: (n: any) => n is number; +export declare const devWarn: (id: string, message: string) => void; +export declare const snapPosition: (position: XYPosition, snapGrid?: SnapGrid) => XYPosition; +export declare const pointToRendererPoint: ({ x, y }: XYPosition, [tx, ty, tScale]: Transform, snapToGrid?: boolean, snapGrid?: SnapGrid) => XYPosition; +export declare const rendererPointToPoint: ({ x, y }: XYPosition, [tx, ty, tScale]: Transform) => XYPosition; +/** + * Returns a viewport that encloses the given bounds with padding. + * @public + * @remarks You can determine bounds of nodes with {@link getNodesBounds} and {@link getBoundsOfRects} + * @param bounds - Bounds to fit inside viewport. + * @param width - Width of the viewport. + * @param height - Height of the viewport. + * @param minZoom - Minimum zoom level of the resulting viewport. + * @param maxZoom - Maximum zoom level of the resulting viewport. + * @param padding - Padding around the bounds. + * @returns A transformed {@link Viewport} that encloses the given bounds which you can pass to e.g. {@link setViewport}. + * @example + * const { x, y, zoom } = getViewportForBounds( + * { x: 0, y: 0, width: 100, height: 100}, + * 1200, 800, 0.5, 2); + */ +export declare const getViewportForBounds: (bounds: Rect, width: number, height: number, minZoom: number, maxZoom: number, padding: Padding) => Viewport; +export declare const isMacOs: () => boolean; +export declare function isCoordinateExtent(extent?: CoordinateExtent | 'parent'): extent is CoordinateExtent; +export declare function getNodeDimensions(node: { + measured?: { + width?: number; + height?: number; + }; + width?: number; + height?: number; + initialWidth?: number; + initialHeight?: number; +}): { + width: number; + height: number; +}; +export declare function nodeHasDimensions(node: NodeType): boolean; +/** + * Convert child position to aboslute position + * + * @internal + * @param position + * @param parentId + * @param nodeLookup + * @param nodeOrigin + * @returns an internal node with an absolute position + */ +export declare function evaluateAbsolutePosition(position: XYPosition, dimensions: { + width?: number; + height?: number; +} | undefined, parentId: string, nodeLookup: NodeLookup, nodeOrigin: NodeOrigin): XYPosition; +export declare function areSetsEqual(a: Set, b: Set): boolean; +/** + * Polyfill for Promise.withResolvers until we can use it in all browsers + * @internal + */ +export declare function withResolvers(): { + promise: Promise; + resolve: (value: T | PromiseLike) => void; + reject: (reason?: unknown) => void; +}; +export declare function mergeAriaLabelConfig(partial?: Partial): AriaLabelConfig; +//# sourceMappingURL=general.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/utils/general.d.ts.map b/node_modules/@xyflow/system/dist/umd/utils/general.d.ts.map new file mode 100644 index 0000000..ca848c1 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/utils/general.d.ts.map @@ -0,0 +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,EACT,gBAAgB,EAChB,UAAU,EACV,OAAO,EAER,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGzC,OAAO,EAA0B,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAE5E,eAAO,MAAM,KAAK,QAAS,MAAM,iCAAqB,MAA2C,CAAC;AAElG,eAAO,MAAM,aAAa,aACd,UAAU,sBACZ,gBAAgB,cACZ,OAAO,CAAC,UAAU,CAAC;;;CAI/B,CAAC;AAEH,wBAAgB,qBAAqB,CAAC,QAAQ,SAAS,QAAQ,EAC7D,aAAa,EAAE,UAAU,EACzB,eAAe,EAAE,UAAU,EAC3B,MAAM,EAAE,gBAAgB,CAAC,QAAQ,CAAC;;;EAanC;AAoBD,eAAO,MAAM,WAAW,QACjB,UAAU,UACP,UAAU,UACX,MAAM,aACH,MAAM,KACf,MAAM,EAKR,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,gBAAgB,GAAG,QAAQ,eAAc,UAAU,KAAY,IAW/F,CAAC;AAEF,eAAO,MAAM,SAAS,SAAU,gBAAgB,GAAG,QAAQ,eAAc,UAAU,KAAY,GAW9F,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,KAAG,GAAG,IAAI,IACwC,CAAC;AAGxF,eAAO,MAAM,SAAS,MAAO,GAAG,KAAG,CAAC,IAAI,MAAkC,CAAC;AAI3E,eAAO,MAAM,OAAO,OAAQ,MAAM,WAAW,MAAM,SAIlD,CAAC;AAEF,eAAO,MAAM,YAAY,aAAc,UAAU,aAAY,QAAQ,KAAY,UAKhF,CAAC;AAEF,eAAO,MAAM,oBAAoB,aACrB,UAAU,oBACF,SAAS,mCAEjB,QAAQ,KACjB,UAOF,CAAC;AAEF,eAAO,MAAM,oBAAoB,aAAc,UAAU,oBAAoB,SAAS,KAAG,UAKxF,CAAC;AAqGF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,oBAAoB,WACvB,IAAI,SACL,MAAM,UACL,MAAM,WACL,MAAM,WACN,MAAM,WACN,OAAO,KACf,QAgCF,CAAC;AAEF,eAAO,MAAM,OAAO,eAAsF,CAAC;AAE3G,wBAAgB,kBAAkB,CAAC,MAAM,CAAC,EAAE,gBAAgB,GAAG,QAAQ,GAAG,MAAM,IAAI,gBAAgB,CAEnG;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE;IACtC,QAAQ,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAKpC;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,EAAE,IAAI,EAAE,QAAQ,GAAG,OAAO,CAK/F;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,UAAU,EACpB,UAAU,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,YAA0B,EACzE,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,GACrB,UAAU,CAWZ;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,WAY1D;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,CAAC,KAAK;IAClC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACpB,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IAC7C,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACpC,CASA;AAED,wBAAgB,oBAAoB,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,eAAe,CAExF"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/utils/graph.d.ts b/node_modules/@xyflow/system/dist/umd/utils/graph.d.ts new file mode 100644 index 0000000..f8b0239 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/utils/graph.d.ts @@ -0,0 +1,191 @@ +import { type Transform, type XYPosition, type Rect, type NodeOrigin, type NodeBase, type EdgeBase, type FitViewParamsBase, type FitViewOptionsBase, CoordinateExtent, OnError, OnBeforeDeleteBase, NodeLookup, InternalNodeBase, NodeDragItem } from '../types'; +/** + * Test whether an object is usable as an Edge + * @public + * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Edge if it returns true + * @param element - The element to test + * @returns A boolean indicating whether the element is an Edge + */ +export declare const isEdgeBase: (element: any) => element is EdgeType; +/** + * Test whether an object is usable as a Node + * @public + * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Node if it returns true + * @param element - The element to test + * @returns A boolean indicating whether the element is an Node + */ +export declare const isNodeBase: (element: any) => element is NodeType; +export declare const isInternalNodeBase: (element: any) => element is NodeType; +/** + * This util is used to tell you what nodes, if any, are connected to the given node + * as the _target_ of an edge. + * @public + * @param node - The node to get the connected nodes from. + * @param nodes - The array of all nodes. + * @param edges - The array of all edges. + * @returns An array of nodes that are connected over edges where the source is the given node. + * + * @example + * ```ts + *import { getOutgoers } from '@xyflow/react'; + * + *const nodes = []; + *const edges = []; + * + *const outgoers = getOutgoers( + * { id: '1', position: { x: 0, y: 0 }, data: { label: 'node' } }, + * nodes, + * edges, + *); + *``` + */ +export declare const getOutgoers: (node: NodeType | { + id: string; +}, nodes: NodeType[], edges: EdgeType[]) => NodeType[]; +/** + * This util is used to tell you what nodes, if any, are connected to the given node + * as the _source_ of an edge. + * @public + * @param node - The node to get the connected nodes from. + * @param nodes - The array of all nodes. + * @param edges - The array of all edges. + * @returns An array of nodes that are connected over edges where the target is the given node. + * + * @example + * ```ts + *import { getIncomers } from '@xyflow/react'; + * + *const nodes = []; + *const edges = []; + * + *const incomers = getIncomers( + * { id: '1', position: { x: 0, y: 0 }, data: { label: 'node' } }, + * nodes, + * edges, + *); + *``` + */ +export declare const getIncomers: (node: NodeType | { + id: string; +}, nodes: NodeType[], edges: EdgeType[]) => NodeType[]; +export declare const getNodePositionWithOrigin: (node: NodeBase, nodeOrigin?: NodeOrigin) => XYPosition; +export type GetNodesBoundsParams = { + /** + * Origin of the nodes: `[0, 0]` for top-left, `[0.5, 0.5]` for center. + * @default [0, 0] + */ + nodeOrigin?: NodeOrigin; + nodeLookup?: NodeLookup>; +}; +/** + * Returns the bounding box that contains all the given nodes in an array. This can + * be useful when combined with [`getViewportForBounds`](/api-reference/utils/get-viewport-for-bounds) + * to calculate the correct transform to fit the given nodes in a viewport. + * @public + * @remarks Useful when combined with {@link getViewportForBounds} to calculate the correct transform to fit the given nodes in a viewport. + * @param nodes - Nodes to calculate the bounds for. + * @returns Bounding box enclosing all nodes. + * + * @remarks This function was previously called `getRectOfNodes` + * + * @example + * ```js + *import { getNodesBounds } from '@xyflow/react'; + * + *const nodes = [ + * { + * id: 'a', + * position: { x: 0, y: 0 }, + * data: { label: 'a' }, + * width: 50, + * height: 25, + * }, + * { + * id: 'b', + * position: { x: 100, y: 100 }, + * data: { label: 'b' }, + * width: 50, + * height: 25, + * }, + *]; + * + *const bounds = getNodesBounds(nodes); + *``` + */ +export declare const getNodesBounds: (nodes: (NodeType | InternalNodeBase | string)[], params?: GetNodesBoundsParams) => Rect; +export type GetInternalNodesBoundsParams = { + useRelativePosition?: boolean; + filter?: (node: NodeType) => boolean; +}; +/** + * Determines a bounding box that contains all given nodes in an array + * @internal + */ +export declare const getInternalNodesBounds: (nodeLookup: Map, params?: GetInternalNodesBoundsParams) => Rect; +export declare const getNodesInside: (nodes: Map>, rect: Rect, [tx, ty, tScale]?: Transform, partially?: boolean, excludeNonSelectableNodes?: boolean) => InternalNodeBase[]; +/** + * This utility filters an array of edges, keeping only those where either the source or target + * node is present in the given array of nodes. + * @public + * @param nodes - Nodes you want to get the connected edges for. + * @param edges - All edges. + * @returns Array of edges that connect any of the given nodes with each other. + * + * @example + * ```js + *import { getConnectedEdges } from '@xyflow/react'; + * + *const nodes = [ + * { id: 'a', position: { x: 0, y: 0 } }, + * { id: 'b', position: { x: 100, y: 0 } }, + *]; + * + *const edges = [ + * { id: 'a->c', source: 'a', target: 'c' }, + * { id: 'c->d', source: 'c', target: 'd' }, + *]; + * + *const connectedEdges = getConnectedEdges(nodes, edges); + * // => [{ id: 'a->c', source: 'a', target: 'c' }] + *``` + */ +export declare const getConnectedEdges: (nodes: NodeType[], edges: EdgeType[]) => EdgeType[]; +export declare function fitViewport, Options extends FitViewOptionsBase>({ nodes, width, height, panZoom, minZoom, maxZoom }: Params, options?: Omit): Promise; +/** + * This function calculates the next position of a node, taking into account the node's extent, parent node, and origin. + * + * @internal + * @returns position, positionAbsolute + */ +export declare function calculateNodePosition({ nodeId, nextPosition, nodeLookup, nodeOrigin, nodeExtent, onError, }: { + nodeId: string; + nextPosition: XYPosition; + nodeLookup: NodeLookup>; + nodeOrigin?: NodeOrigin; + nodeExtent?: CoordinateExtent; + onError?: OnError; +}): { + position: XYPosition; + positionAbsolute: XYPosition; +}; +/** + * Pass in nodes & edges to delete, get arrays of nodes and edges that actually can be deleted + * @internal + * @param param.nodesToRemove - The nodes to remove + * @param param.edgesToRemove - The edges to remove + * @param param.nodes - All nodes + * @param param.edges - All edges + * @param param.onBeforeDelete - Callback to check which nodes and edges can be deleted + * @returns nodes: nodes that can be deleted, edges: edges that can be deleted + */ +export declare function getElementsToRemove({ nodesToRemove, edgesToRemove, nodes, edges, onBeforeDelete, }: { + nodesToRemove: Partial[]; + edgesToRemove: Partial[]; + nodes: NodeType[]; + edges: EdgeType[]; + onBeforeDelete?: OnBeforeDeleteBase; +}): Promise<{ + nodes: NodeType[]; + edges: EdgeType[]; +}>; +//# sourceMappingURL=graph.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/utils/graph.d.ts.map b/node_modules/@xyflow/system/dist/umd/utils/graph.d.ts.map new file mode 100644 index 0000000..5032edd --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/utils/graph.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../src/utils/graph.ts"],"names":[],"mappings":"AAaA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,IAAI,EACT,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,gBAAgB,EAChB,OAAO,EACP,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,YAAY,EACb,MAAM,UAAU,CAAC;AAGlB;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GAAI,QAAQ,SAAS,QAAQ,sBAAsB,GAAG,KAAG,OAAO,IAAI,QAC5B,CAAC;AAEhE;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GAAI,QAAQ,SAAS,QAAQ,sBAAsB,GAAG,KAAG,OAAO,IAAI,QACG,CAAC;AAE/F,eAAO,MAAM,kBAAkB,GAAI,QAAQ,SAAS,gBAAgB,8BACzD,GAAG,KACX,OAAO,IAAI,QAAyG,CAAC;AAExH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,WAAW,GAAI,QAAQ,SAAS,QAAQ,aAAa,QAAQ,SAAS,QAAQ,mBACnF,QAAQ,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,SACxB,QAAQ,EAAE,SACV,QAAQ,EAAE,KAChB,QAAQ,EAaV,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,WAAW,GAAI,QAAQ,SAAS,QAAQ,aAAa,QAAQ,SAAS,QAAQ,mBACnF,QAAQ,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,SACxB,QAAQ,EAAE,SACV,QAAQ,EAAE,KAChB,QAAQ,EAYV,CAAC;AAEF,eAAO,MAAM,yBAAyB,SAAU,QAAQ,eAAc,UAAU,KAAY,UAU3F,CAAC;AAEF,MAAM,MAAM,oBAAoB,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAAI;IACvE;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,UAAU,CAAC,EAAE,UAAU,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC;CACrD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,cAAc,GAAI,QAAQ,SAAS,QAAQ,oBAC/C,CAAC,QAAQ,GAAG,gBAAgB,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,EAAE,WACjD,oBAAoB,CAAC,QAAQ,CAAC,KACrC,IA+BF,CAAC;AAEF,MAAM,MAAM,4BAA4B,CAAC,QAAQ,IAAI;IACnD,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAC;CACtC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,GAAI,QAAQ,SAAS,gBAAgB,GAAG,YAAY,cACzE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,WACzB,4BAA4B,CAAC,QAAQ,CAAC,KAC7C,IAeF,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,QAAQ,SAAS,QAAQ,oBAC/C,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC,QACxC,IAAI,qBACQ,SAAS,+DAI1B,gBAAgB,CAAC,QAAQ,CAAC,EAgC5B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,iBAAiB,GAAI,QAAQ,SAAS,QAAQ,aAAa,QAAQ,SAAS,QAAQ,oBACxF,QAAQ,EAAE,SACV,QAAQ,EAAE,KAChB,QAAQ,EAOV,CAAC;AAoBF,wBAAsB,WAAW,CAC/B,MAAM,SAAS,iBAAiB,CAAC,QAAQ,CAAC,EAC1C,OAAO,SAAS,kBAAkB,CAAC,QAAQ,CAAC,EAE5C,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,MAAM,EAC3D,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,oBAAoB,CAAC,GACtD,OAAO,CAAC,OAAO,CAAC,CAyBlB;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,SAAS,QAAQ,EAAE,EAC/D,MAAM,EACN,YAAY,EACZ,UAAU,EACV,UAAmB,EACnB,UAAU,EACV,OAAO,GACR,EAAE;IACD,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,UAAU,CAAC;IACzB,UAAU,EAAE,UAAU,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC;IACnD,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG;IAAE,QAAQ,EAAE,UAAU,CAAC;IAAC,gBAAgB,EAAE,UAAU,CAAA;CAAE,CA4CzD;AAED;;;;;;;;;GASG;AACH,wBAAsB,mBAAmB,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,EAAE,QAAQ,SAAS,QAAQ,GAAG,QAAQ,EAAE,EACpH,aAAkB,EAClB,aAAkB,EAClB,KAAK,EACL,KAAK,EACL,cAAc,GACf,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;IAClB,cAAc,CAAC,EAAE,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;CACzD,GAAG,OAAO,CAAC;IACV,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB,CAAC,CA+CD"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/utils/index.d.ts b/node_modules/@xyflow/system/dist/umd/utils/index.d.ts new file mode 100644 index 0000000..ba212c0 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/utils/index.d.ts @@ -0,0 +1,11 @@ +export * from './connections'; +export * from './dom'; +export * from './edges'; +export * from './graph'; +export * from './general'; +export * from './marker'; +export * from './node-toolbar'; +export * from './store'; +export * from './types'; +export * from './shallow-node-data'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/utils/index.d.ts.map b/node_modules/@xyflow/system/dist/umd/utils/index.d.ts.map new file mode 100644 index 0000000..a0c74ca --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/utils/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,qBAAqB,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/utils/marker.d.ts b/node_modules/@xyflow/system/dist/umd/utils/marker.d.ts new file mode 100644 index 0000000..85eb740 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/utils/marker.d.ts @@ -0,0 +1,9 @@ +import type { EdgeBase, EdgeMarkerType, MarkerProps } from '../types'; +export declare function getMarkerId(marker: EdgeMarkerType | undefined, id?: string | null): string; +export declare function createMarkerIds(edges: EdgeBase[], { id, defaultColor, defaultMarkerStart, defaultMarkerEnd, }: { + id?: string | null; + defaultColor?: string; + defaultMarkerStart?: EdgeMarkerType; + defaultMarkerEnd?: EdgeMarkerType; +}): MarkerProps[]; +//# sourceMappingURL=marker.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/utils/marker.d.ts.map b/node_modules/@xyflow/system/dist/umd/utils/marker.d.ts.map new file mode 100644 index 0000000..5f2af5f --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/utils/marker.d.ts.map @@ -0,0 +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,EACE,EAAE,EACF,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,GACjB,EAAE;IACD,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,cAAc,CAAC;IACpC,gBAAgB,CAAC,EAAE,cAAc,CAAC;CACnC,iBAmBF"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/utils/node-toolbar.d.ts b/node_modules/@xyflow/system/dist/umd/utils/node-toolbar.d.ts new file mode 100644 index 0000000..d687f10 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/utils/node-toolbar.d.ts @@ -0,0 +1,3 @@ +import { Position, type Rect, type Viewport, type Align } from '../'; +export declare function getNodeToolbarTransform(nodeRect: Rect, viewport: Viewport, position: Position, offset: number, align: Align): string; +//# sourceMappingURL=node-toolbar.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/utils/node-toolbar.d.ts.map b/node_modules/@xyflow/system/dist/umd/utils/node-toolbar.d.ts.map new file mode 100644 index 0000000..35bada6 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/utils/node-toolbar.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"node-toolbar.d.ts","sourceRoot":"","sources":["../../src/utils/node-toolbar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,KAAK,KAAK,EAAE,MAAM,KAAK,CAAC;AAErE,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,IAAI,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,GACX,MAAM,CA0CR"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/utils/shallow-node-data.d.ts b/node_modules/@xyflow/system/dist/umd/utils/shallow-node-data.d.ts new file mode 100644 index 0000000..f3fcf5b --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/utils/shallow-node-data.d.ts @@ -0,0 +1,5 @@ +import { NodeBase } from '../types'; +type NodeData = Pick; +export declare function shallowNodeData(a: NodeData | NodeData[] | null, b: NodeData | NodeData[] | null): boolean; +export {}; +//# sourceMappingURL=shallow-node-data.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/utils/shallow-node-data.d.ts.map b/node_modules/@xyflow/system/dist/umd/utils/shallow-node-data.d.ts.map new file mode 100644 index 0000000..3555e64 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/utils/shallow-node-data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"shallow-node-data.d.ts","sourceRoot":"","sources":["../../src/utils/shallow-node-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,KAAK,QAAQ,GAAG,IAAI,CAAC,QAAQ,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC,CAAC;AAEvD,wBAAgB,eAAe,CAAC,CAAC,EAAE,QAAQ,GAAG,QAAQ,EAAE,GAAG,IAAI,EAAE,CAAC,EAAE,QAAQ,GAAG,QAAQ,EAAE,GAAG,IAAI,WAmB/F"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/utils/store.d.ts b/node_modules/@xyflow/system/dist/umd/utils/store.d.ts new file mode 100644 index 0000000..b7fefc5 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/utils/store.d.ts @@ -0,0 +1,27 @@ +import { NodeBase, CoordinateExtent, InternalNodeUpdate, NodeOrigin, PanZoomInstance, Transform, XYPosition, ConnectionLookup, EdgeBase, EdgeLookup, InternalNodeBase, NodeLookup, NodeDimensionChange, NodePositionChange, ParentLookup } from '../types'; +import { ParentExpandChild } from './types'; +export declare function updateAbsolutePositions(nodeLookup: NodeLookup>, parentLookup: ParentLookup>, options?: UpdateNodesOptions): void; +type UpdateNodesOptions = { + nodeOrigin?: NodeOrigin; + nodeExtent?: CoordinateExtent; + elevateNodesOnSelect?: boolean; + defaults?: Partial; + checkEquality?: boolean; +}; +export declare function adoptUserNodes(nodes: NodeType[], nodeLookup: NodeLookup>, parentLookup: ParentLookup>, options?: UpdateNodesOptions): boolean; +export declare function handleExpandParent(children: ParentExpandChild[], nodeLookup: NodeLookup, parentLookup: ParentLookup, nodeOrigin?: NodeOrigin): (NodeDimensionChange | NodePositionChange)[]; +export declare function updateNodeInternals(updates: Map, nodeLookup: NodeLookup, parentLookup: ParentLookup, domNode: HTMLElement | null, nodeOrigin?: NodeOrigin, nodeExtent?: CoordinateExtent): { + changes: (NodeDimensionChange | NodePositionChange)[]; + updatedInternals: boolean; +}; +export declare function panBy({ delta, panZoom, transform, translateExtent, width, height, }: { + delta: XYPosition; + panZoom: PanZoomInstance | null; + transform: Transform; + translateExtent: CoordinateExtent; + width: number; + height: number; +}): Promise; +export declare function updateConnectionLookup(connectionLookup: ConnectionLookup, edgeLookup: EdgeLookup, edges: EdgeBase[]): void; +export {}; +//# sourceMappingURL=store.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/utils/store.d.ts.map b/node_modules/@xyflow/system/dist/umd/utils/store.d.ts.map new file mode 100644 index 0000000..b0d003b --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/utils/store.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/utils/store.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,kBAAkB,EAClB,UAAU,EACV,eAAe,EACf,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,UAAU,EACV,gBAAgB,EAChB,UAAU,EAEV,mBAAmB,EACnB,kBAAkB,EAClB,YAAY,EACb,MAAM,UAAU,CAAC;AAYlB,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AA0B5C,wBAAgB,uBAAuB,CAAC,QAAQ,SAAS,QAAQ,EAC/D,UAAU,EAAE,UAAU,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,EAClD,YAAY,EAAE,YAAY,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,EACtD,OAAO,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC,QAavC;AAED,KAAK,kBAAkB,CAAC,QAAQ,SAAS,QAAQ,IAAI;IACnD,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC7B,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,wBAAgB,cAAc,CAAC,QAAQ,SAAS,QAAQ,EACtD,KAAK,EAAE,QAAQ,EAAE,EACjB,UAAU,EAAE,UAAU,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,EAClD,YAAY,EAAE,YAAY,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,EACtD,OAAO,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC,GACrC,OAAO,CAsDT;AAiGD,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,iBAAiB,EAAE,EAC7B,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,EAC1B,UAAU,GAAE,UAAmB,GAC9B,CAAC,mBAAmB,GAAG,kBAAkB,CAAC,EAAE,CAiF9C;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,SAAS,gBAAgB,EACnE,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,EACxC,UAAU,EAAE,UAAU,CAAC,QAAQ,CAAC,EAChC,YAAY,EAAE,YAAY,CAAC,QAAQ,CAAC,EACpC,OAAO,EAAE,WAAW,GAAG,IAAI,EAC3B,UAAU,CAAC,EAAE,UAAU,EACvB,UAAU,CAAC,EAAE,gBAAgB,GAC5B;IAAE,OAAO,EAAE,CAAC,mBAAmB,GAAG,kBAAkB,CAAC,EAAE,CAAC;IAAC,gBAAgB,EAAE,OAAO,CAAA;CAAE,CAgGtF;AAED,wBAAsB,KAAK,CAAC,EAC1B,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,GAAG,OAAO,CAAC,OAAO,CAAC,CAuBnB;AAwCD,wBAAgB,sBAAsB,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,QAgBnH"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/utils/types.d.ts b/node_modules/@xyflow/system/dist/umd/utils/types.d.ts new file mode 100644 index 0000000..b9dd111 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/utils/types.d.ts @@ -0,0 +1,8 @@ +import { Rect } from '../types'; +export type Optional = Pick, K> & Omit; +export type ParentExpandChild = { + id: string; + parentId: string; + rect: Rect; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/utils/types.d.ts.map b/node_modules/@xyflow/system/dist/umd/utils/types.d.ts.map new file mode 100644 index 0000000..c0f6120 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/utils/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,MAAM,MAAM,QAAQ,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAE9E,MAAM,MAAM,iBAAiB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/xydrag/XYDrag.d.ts b/node_modules/@xyflow/system/dist/umd/xydrag/XYDrag.d.ts new file mode 100644 index 0000000..9a7a665 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/xydrag/XYDrag.d.ts @@ -0,0 +1,55 @@ +import type { NodeBase, NodeDragItem, EdgeBase, CoordinateExtent, NodeOrigin, OnError, SnapGrid, Transform, PanBy, OnSelectionDrag, UpdateNodePositions, InternalNodeBase } from '../types'; +export type OnDrag = (event: MouseEvent, dragItems: Map, node: NodeBase, nodes: NodeBase[]) => void; +type StoreItems = { + nodes: NodeBase[]; + nodeLookup: Map; + edges: EdgeBase[]; + nodeExtent: CoordinateExtent; + snapGrid: SnapGrid; + snapToGrid: boolean; + nodeOrigin: NodeOrigin; + multiSelectionActive: boolean; + domNode?: Element | null; + transform: Transform; + autoPanOnNodeDrag: boolean; + nodesDraggable: boolean; + selectNodesOnDrag: boolean; + nodeDragThreshold: number; + panBy: PanBy; + unselectNodesAndEdges: (params?: { + nodes?: NodeBase[]; + edges?: EdgeBase[]; + }) => void; + onError?: OnError; + onNodeDragStart?: OnNodeDrag; + onNodeDrag?: OnNodeDrag; + onNodeDragStop?: OnNodeDrag; + onSelectionDragStart?: OnSelectionDrag; + onSelectionDrag?: OnSelectionDrag; + onSelectionDragStop?: OnSelectionDrag; + updateNodePositions: UpdateNodePositions; + autoPanSpeed?: number; +}; +export type XYDragParams = { + getStoreItems: () => StoreItems; + onDragStart?: OnDrag; + onDrag?: OnDrag; + onDragStop?: OnDrag; + onNodeMouseDown?: (id: string) => void; + autoPanSpeed?: number; +}; +export type XYDragInstance = { + update: (params: DragUpdateParams) => void; + destroy: () => void; +}; +export type DragUpdateParams = { + noDragClassName?: string; + handleSelector?: string; + isSelectable?: boolean; + nodeId?: string; + domNode: Element; + nodeClickDistance?: number; +}; +export declare function XYDrag void | undefined>({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragStop, }: XYDragParams): XYDragInstance; +export {}; +//# sourceMappingURL=XYDrag.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/xydrag/XYDrag.d.ts.map b/node_modules/@xyflow/system/dist/umd/xydrag/XYDrag.d.ts.map new file mode 100644 index 0000000..53c8bf9 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/xydrag/XYDrag.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"XYDrag.d.ts","sourceRoot":"","sources":["../../src/xydrag/XYDrag.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,QAAQ,EACR,YAAY,EAGZ,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,OAAO,EACP,QAAQ,EACR,SAAS,EACT,KAAK,EACL,eAAe,EACf,mBAAmB,EAEnB,gBAAgB,EACjB,MAAM,UAAU,CAAC;AAElB,MAAM,MAAM,MAAM,GAAG,CACnB,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,EACpC,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,QAAQ,EAAE,KACd,IAAI,CAAC;AAEV,KAAK,UAAU,CAAC,UAAU,IAAI;IAC5B,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC1C,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,UAAU,EAAE,gBAAgB,CAAC;IAC7B,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,UAAU,CAAC;IACvB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,SAAS,CAAC;IACrB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,cAAc,EAAE,OAAO,CAAC;IACxB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,KAAK,EAAE,KAAK,CAAC;IACb,qBAAqB,EAAE,CAAC,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;QAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAA;KAAE,KAAK,IAAI,CAAC;IACrF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,UAAU,CAAC;IAC7B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B,oBAAoB,CAAC,EAAE,eAAe,CAAC;IACvC,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,mBAAmB,CAAC,EAAE,eAAe,CAAC;IACtC,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,YAAY,CAAC,UAAU,IAAI;IACrC,aAAa,EAAE,MAAM,UAAU,CAAC,UAAU,CAAC,CAAC;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,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;IACjB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAGF,wBAAgB,MAAM,CAAC,UAAU,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,KAAK,IAAI,GAAG,SAAS,EAAE,EAC7F,eAAe,EACf,aAAa,EACb,WAAW,EACX,MAAM,EACN,UAAU,GACX,EAAE,YAAY,CAAC,UAAU,CAAC,GAAG,cAAc,CA4S3C"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/xydrag/index.d.ts b/node_modules/@xyflow/system/dist/umd/xydrag/index.d.ts new file mode 100644 index 0000000..48955a5 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/xydrag/index.d.ts @@ -0,0 +1,2 @@ +export * from './XYDrag'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/xydrag/index.d.ts.map b/node_modules/@xyflow/system/dist/umd/xydrag/index.d.ts.map new file mode 100644 index 0000000..6f23db8 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/xydrag/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/xydrag/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/xydrag/utils.d.ts b/node_modules/@xyflow/system/dist/umd/xydrag/utils.d.ts new file mode 100644 index 0000000..2be1962 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/xydrag/utils.d.ts @@ -0,0 +1,11 @@ +import { type NodeDragItem, type XYPosition, InternalNodeBase, NodeBase, NodeLookup } from '../types'; +export declare function isParentSelected(node: NodeType, nodeLookup: NodeLookup): boolean; +export declare function hasSelector(target: Element | EventTarget | null, selector: string, domNode: Element): boolean; +export declare function getDragItems(nodeLookup: Map>, nodesDraggable: boolean, mousePos: XYPosition, nodeId?: string): Map; +export declare function getEventHandlerParams({ nodeId, dragItems, nodeLookup, dragging, }: { + nodeId?: string; + dragItems: Map; + nodeLookup: Map; + dragging?: boolean; +}): [NodeBase, NodeBase[]]; +//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/xydrag/utils.d.ts.map b/node_modules/@xyflow/system/dist/umd/xydrag/utils.d.ts.map new file mode 100644 index 0000000..5f3d208 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/xydrag/utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/xydrag/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,UAAU,EAAE,gBAAgB,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtG,wBAAgB,gBAAgB,CAAC,QAAQ,SAAS,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,GAAG,OAAO,CAgB3G;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,OAAO,GAAG,WAAW,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAU7G;AAGD,wBAAgB,YAAY,CAAC,QAAQ,SAAS,QAAQ,EACpD,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC,EACnD,cAAc,EAAE,OAAO,EACvB,QAAQ,EAAE,UAAU,EACpB,MAAM,CAAC,EAAE,MAAM,GACd,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAoC3B;AAOD,wBAAgB,qBAAqB,CAAC,QAAQ,SAAS,gBAAgB,EAAE,EACvE,MAAM,EACN,SAAS,EACT,UAAU,EACV,QAAe,GAChB,EAAE;IACD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACrC,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,CAAC,CA+BzB"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/xyhandle/XYHandle.d.ts b/node_modules/@xyflow/system/dist/umd/xyhandle/XYHandle.d.ts new file mode 100644 index 0000000..1f5d45d --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/xyhandle/XYHandle.d.ts @@ -0,0 +1,3 @@ +import { XYHandleInstance } from './types'; +export declare const XYHandle: XYHandleInstance; +//# sourceMappingURL=XYHandle.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/xyhandle/XYHandle.d.ts.map b/node_modules/@xyflow/system/dist/umd/xyhandle/XYHandle.d.ts.map new file mode 100644 index 0000000..2fbfad1 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/xyhandle/XYHandle.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"XYHandle.d.ts","sourceRoot":"","sources":["../../src/xyhandle/XYHandle.ts"],"names":[],"mappings":"AAkBA,OAAO,EAA8C,gBAAgB,EAAE,MAAM,SAAS,CAAC;AA6RvF,eAAO,MAAM,QAAQ,EAAE,gBAGtB,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/xyhandle/index.d.ts b/node_modules/@xyflow/system/dist/umd/xyhandle/index.d.ts new file mode 100644 index 0000000..15994ac --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/xyhandle/index.d.ts @@ -0,0 +1,2 @@ +export * from './XYHandle'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/xyhandle/index.d.ts.map b/node_modules/@xyflow/system/dist/umd/xyhandle/index.d.ts.map new file mode 100644 index 0000000..a74366a --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/xyhandle/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/xyhandle/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/xyhandle/types.d.ts b/node_modules/@xyflow/system/dist/umd/xyhandle/types.d.ts new file mode 100644 index 0000000..9c19420 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/xyhandle/types.d.ts @@ -0,0 +1,48 @@ +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'; +export type OnPointerDownParams = { + autoPanOnConnect: boolean; + connectionMode: ConnectionMode; + connectionRadius: number; + domNode: HTMLDivElement | null; + handleId: string | null; + nodeId: string; + isTarget: boolean; + nodeLookup: NodeLookup; + lib: string; + flowId: string | null; + edgeUpdaterType?: HandleType; + updateConnection: UpdateConnection; + panBy: PanBy; + cancelConnection: () => void; + onConnectStart?: OnConnectStart; + onConnect?: OnConnect; + onConnectEnd?: OnConnectEnd; + isValidConnection?: IsValidConnection; + onReconnectEnd?: (evt: MouseEvent | TouchEvent, connectionState: FinalConnectionState) => void; + getTransform: () => Transform; + getFromHandle: () => Handle | null; + autoPanSpeed?: number; +}; +export type IsValidParams = { + handle: Pick | null; + connectionMode: ConnectionMode; + fromNodeId: string; + fromHandleId: string | null; + fromType: HandleType; + isValidConnection?: IsValidConnection; + doc: Document | ShadowRoot; + lib: string; + flowId: string | null; + nodeLookup: NodeLookup; +}; +export type XYHandleInstance = { + onPointerDown: (event: MouseEvent | TouchEvent, params: OnPointerDownParams) => void; + isValid: (event: MouseEvent | TouchEvent, params: IsValidParams) => Result; +}; +export type Result = { + handleDomNode: Element | null; + isValid: boolean; + connection: Connection | null; + toHandle: Handle | null; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/xyhandle/types.d.ts.map b/node_modules/@xyflow/system/dist/umd/xyhandle/types.d.ts.map new file mode 100644 index 0000000..613bcc2 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/xyhandle/types.d.ts.map @@ -0,0 +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,EACtB,UAAU,EACV,oBAAoB,EACrB,MAAM,UAAU,CAAC;AAElB,MAAM,MAAM,mBAAmB,GAAG;IAChC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,cAAc,CAAC;IAC/B,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,cAAc,GAAG,IAAI,CAAC;IAC/B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,UAAU,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,eAAe,CAAC,EAAE,UAAU,CAAC;IAC7B,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,KAAK,EAAE,KAAK,CAAC;IACb,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,UAAU,GAAG,UAAU,EAAE,eAAe,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC/F,YAAY,EAAE,MAAM,SAAS,CAAC;IAC9B,aAAa,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IACnC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,GAAG,IAAI,GAAG,MAAM,CAAC,GAAG,IAAI,CAAC;IACtD,cAAc,EAAE,cAAc,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,EAAE,UAAU,CAAC;IACrB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,GAAG,EAAE,QAAQ,GAAG,UAAU,CAAC;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,aAAa,EAAE,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,EAAE,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,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"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/xyhandle/utils.d.ts b/node_modules/@xyflow/system/dist/umd/xyhandle/utils.d.ts new file mode 100644 index 0000000..e14f655 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/xyhandle/utils.d.ts @@ -0,0 +1,10 @@ +import type { HandleType, XYPosition, Handle, NodeLookup, ConnectionMode } from '../types'; +export declare function getClosestHandle(position: XYPosition, connectionRadius: number, nodeLookup: NodeLookup, fromHandle: { + nodeId: string; + type: HandleType; + id?: string | null; +}): Handle | null; +export declare function getHandle(nodeId: string, handleType: HandleType, handleId: string | null, nodeLookup: NodeLookup, connectionMode: ConnectionMode, withAbsolutePosition?: boolean): Handle | null; +export declare function getHandleType(edgeUpdaterType: HandleType | undefined, handleDomNode: Element | null): HandleType | null; +export declare function isConnectionValid(isInsideConnectionRadius: boolean, isHandleValid: boolean): boolean | null; +//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/xyhandle/utils.d.ts.map b/node_modules/@xyflow/system/dist/umd/xyhandle/utils.d.ts.map new file mode 100644 index 0000000..18c448a --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/xyhandle/utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/xyhandle/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAoB,UAAU,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AA0B7G,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,UAAU,EACpB,gBAAgB,EAAE,MAAM,EACxB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,UAAU,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GACnE,MAAM,GAAG,IAAI,CA2Cf;AAED,wBAAgB,SAAS,CACvB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,MAAM,GAAG,IAAI,EACvB,UAAU,EAAE,UAAU,EACtB,cAAc,EAAE,cAAc,EAC9B,oBAAoB,UAAQ,GAC3B,MAAM,GAAG,IAAI,CAef;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"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/xyminimap/index.d.ts b/node_modules/@xyflow/system/dist/umd/xyminimap/index.d.ts new file mode 100644 index 0000000..b881bdf --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/xyminimap/index.d.ts @@ -0,0 +1,28 @@ +import { pointer } from 'd3-selection'; +import type { CoordinateExtent, PanZoomInstance, Transform } from '../types'; +export type XYMinimapInstance = { + update: (params: XYMinimapUpdate) => void; + destroy: () => void; + pointer: typeof pointer; +}; +export type XYMinimapParams = { + panZoom: PanZoomInstance; + domNode: Element; + getTransform: () => Transform; + getViewScale: () => number; +}; +export type XYMinimapUpdate = { + translateExtent: CoordinateExtent; + width: number; + height: number; + inversePan?: boolean; + zoomStep?: number; + pannable?: boolean; + zoomable?: boolean; +}; +export declare function XYMinimap({ domNode, panZoom, getTransform, getViewScale }: XYMinimapParams): { + update: ({ translateExtent, width, height, zoomStep, pannable, zoomable, inversePan, }: XYMinimapUpdate) => void; + destroy: () => void; + pointer: typeof pointer; +}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/xyminimap/index.d.ts.map b/node_modules/@xyflow/system/dist/umd/xyminimap/index.d.ts.map new file mode 100644 index 0000000..21b2e05 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/xyminimap/index.d.ts.map @@ -0,0 +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;;;EAsFnB"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/xypanzoom/XYPanZoom.d.ts b/node_modules/@xyflow/system/dist/umd/xypanzoom/XYPanZoom.d.ts new file mode 100644 index 0000000..89085c4 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/xypanzoom/XYPanZoom.d.ts @@ -0,0 +1,12 @@ +import { type Viewport, PanZoomParams, PanZoomInstance } from '../types'; +export type ZoomPanValues = { + isZoomingOrPanning: boolean; + usedRightMouseButton: boolean; + prevViewport: Viewport; + mouseButton: number; + timerId: ReturnType | undefined; + panScrollTimeout: ReturnType | undefined; + isPanScrolling: boolean; +}; +export declare function XYPanZoom({ domNode, minZoom, maxZoom, paneClickDistance, translateExtent, viewport, onPanZoom, onPanZoomStart, onPanZoomEnd, onDraggingChange, }: PanZoomParams): PanZoomInstance; +//# sourceMappingURL=XYPanZoom.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/xypanzoom/XYPanZoom.d.ts.map b/node_modules/@xyflow/system/dist/umd/xypanzoom/XYPanZoom.d.ts.map new file mode 100644 index 0000000..d3d61ee --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/xypanzoom/XYPanZoom.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"XYPanZoom.d.ts","sourceRoot":"","sources":["../../src/xypanzoom/XYPanZoom.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,QAAQ,EAGb,aAAa,EACb,eAAe,EAChB,MAAM,UAAU,CAAC;AAclB,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;IACnD,gBAAgB,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,GAAG,SAAS,CAAC;IAC5D,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,wBAAgB,SAAS,CAAC,EACxB,OAAO,EACP,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,eAAe,EACf,QAAQ,EACR,SAAS,EACT,cAAc,EACd,YAAY,EACZ,gBAAgB,GACjB,EAAE,aAAa,GAAG,eAAe,CA0PjC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/xypanzoom/eventhandler.d.ts b/node_modules/@xyflow/system/dist/umd/xypanzoom/eventhandler.d.ts new file mode 100644 index 0000000..42ee4f4 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/xypanzoom/eventhandler.d.ts @@ -0,0 +1,46 @@ +import type { D3ZoomEvent } from 'd3-zoom'; +import { PanOnScrollMode, type D3SelectionInstance, type D3ZoomHandler, type D3ZoomInstance, type OnPanZoom, type OnDraggingChange, type OnTransformChange } from '../types'; +import { ZoomPanValues } from './XYPanZoom'; +export type PanOnScrollParams = { + zoomPanValues: ZoomPanValues; + noWheelClassName: string; + d3Selection: D3SelectionInstance; + d3Zoom: D3ZoomInstance; + panOnScrollMode: PanOnScrollMode; + panOnScrollSpeed: number; + zoomOnPinch: boolean; + onPanZoomStart?: OnPanZoom; + onPanZoom?: OnPanZoom; + onPanZoomEnd?: OnPanZoom; +}; +export type ZoomOnScrollParams = { + noWheelClassName: string; + preventScrolling: boolean; + d3ZoomHandler: D3ZoomHandler; +}; +export type PanZoomStartParams = { + zoomPanValues: ZoomPanValues; + onDraggingChange: OnDraggingChange; + onPanZoomStart?: OnPanZoom; +}; +export type PanZoomParams = { + zoomPanValues: ZoomPanValues; + panOnDrag: boolean | number[]; + onPaneContextMenu: boolean; + onTransformChange: OnTransformChange; + onPanZoom?: OnPanZoom; +}; +export type PanZoomEndParams = { + zoomPanValues: ZoomPanValues; + panOnDrag: boolean | number[]; + panOnScroll: boolean; + onDraggingChange: (isDragging: boolean) => void; + onPanZoomEnd?: OnPanZoom; + onPaneContextMenu?: (event: any) => void; +}; +export declare function createPanOnScrollHandler({ zoomPanValues, noWheelClassName, d3Selection, d3Zoom, panOnScrollMode, panOnScrollSpeed, zoomOnPinch, onPanZoomStart, onPanZoom, onPanZoomEnd, }: PanOnScrollParams): (event: any) => false | undefined; +export declare function createZoomOnScrollHandler({ noWheelClassName, preventScrolling, d3ZoomHandler }: ZoomOnScrollParams): (this: Element, event: any, d: unknown) => null | undefined; +export declare function createPanZoomStartHandler({ zoomPanValues, onDraggingChange, onPanZoomStart }: PanZoomStartParams): (event: D3ZoomEvent) => void; +export declare function createPanZoomHandler({ zoomPanValues, panOnDrag, onPaneContextMenu, onTransformChange, onPanZoom, }: PanZoomParams): (event: D3ZoomEvent) => void; +export declare function createPanZoomEndHandler({ zoomPanValues, panOnDrag, panOnScroll, onDraggingChange, onPanZoomEnd, onPaneContextMenu, }: PanZoomEndParams): (event: D3ZoomEvent) => void; +//# sourceMappingURL=eventhandler.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/xypanzoom/eventhandler.d.ts.map b/node_modules/@xyflow/system/dist/umd/xypanzoom/eventhandler.d.ts.map new file mode 100644 index 0000000..51f6fd7 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/xypanzoom/eventhandler.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"eventhandler.d.ts","sourceRoot":"","sources":["../../src/xypanzoom/eventhandler.ts"],"names":[],"mappings":"AAEA,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,gBAAgB,EACrB,KAAK,iBAAiB,EACvB,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,aAAa,EAAE,aAAa,CAAC;IAC7B,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;IACrB,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,YAAY,CAAC,EAAE,SAAS,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,aAAa,EAAE,aAAa,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,aAAa,EAAE,aAAa,CAAC;IAC7B,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,cAAc,CAAC,EAAE,SAAS,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,aAAa,EAAE,aAAa,CAAC;IAC7B,SAAS,EAAE,OAAO,GAAG,MAAM,EAAE,CAAC;IAC9B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,aAAa,EAAE,aAAa,CAAC;IAC7B,SAAS,EAAE,OAAO,GAAG,MAAM,EAAE,CAAC;IAC9B,WAAW,EAAE,OAAO,CAAC;IACrB,gBAAgB,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;CAC1C,CAAC;AAEF,wBAAgB,wBAAwB,CAAC,EACvC,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,MAAM,EACN,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,cAAc,EACd,SAAS,EACT,YAAY,GACb,EAAE,iBAAiB,WACH,GAAG,uBAmEnB;AAED,wBAAgB,yBAAyB,CAAC,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,EAAE,kBAAkB,UAC1F,OAAO,SAAS,GAAG,KAAK,OAAO,sBAmBvD;AAED,wBAAgB,yBAAyB,CAAC,EAAE,aAAa,EAAE,gBAAgB,EAAE,cAAc,EAAE,EAAE,kBAAkB,WAChG,WAAW,CAAC,cAAc,EAAE,GAAG,CAAC,UAoBhD;AAED,wBAAgB,oBAAoB,CAAC,EACnC,aAAa,EACb,SAAS,EACT,iBAAiB,EACjB,iBAAiB,EACjB,SAAS,GACV,EAAE,aAAa,WACC,WAAW,CAAC,cAAc,EAAE,GAAG,CAAC,UAahD;AAED,wBAAgB,uBAAuB,CAAC,EACtC,aAAa,EACb,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,GAClB,EAAE,gBAAgB,WACF,WAAW,CAAC,cAAc,EAAE,GAAG,CAAC,UAiChD"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/xypanzoom/filter.d.ts b/node_modules/@xyflow/system/dist/umd/xypanzoom/filter.d.ts new file mode 100644 index 0000000..a4179f4 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/xypanzoom/filter.d.ts @@ -0,0 +1,14 @@ +export type FilterParams = { + zoomActivationKeyPressed: boolean; + zoomOnScroll: boolean; + zoomOnPinch: boolean; + panOnDrag: boolean | number[]; + panOnScroll: boolean; + zoomOnDoubleClick: boolean; + userSelectionActive: boolean; + noWheelClassName: string; + noPanClassName: string; + lib: string; +}; +export declare function createFilter({ zoomActivationKeyPressed, zoomOnScroll, zoomOnPinch, panOnDrag, panOnScroll, zoomOnDoubleClick, userSelectionActive, noWheelClassName, noPanClassName, lib, }: FilterParams): (event: any) => boolean; +//# sourceMappingURL=filter.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/xypanzoom/filter.d.ts.map b/node_modules/@xyflow/system/dist/umd/xypanzoom/filter.d.ts.map new file mode 100644 index 0000000..1fbd76e --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/xypanzoom/filter.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../src/xypanzoom/filter.ts"],"names":[],"mappings":"AAGA,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,CAkE7B"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/xypanzoom/index.d.ts b/node_modules/@xyflow/system/dist/umd/xypanzoom/index.d.ts new file mode 100644 index 0000000..eaeb1d6 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/xypanzoom/index.d.ts @@ -0,0 +1,2 @@ +export * from './XYPanZoom'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/xypanzoom/index.d.ts.map b/node_modules/@xyflow/system/dist/umd/xypanzoom/index.d.ts.map new file mode 100644 index 0000000..b4758d7 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/xypanzoom/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/xypanzoom/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/xypanzoom/utils.d.ts b/node_modules/@xyflow/system/dist/umd/xypanzoom/utils.d.ts new file mode 100644 index 0000000..ff0513c --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/xypanzoom/utils.d.ts @@ -0,0 +1,10 @@ +import { type ZoomTransform } from 'd3-zoom'; +import { type D3SelectionInstance, type Viewport } from '../types'; +export declare const viewChanged: (prevViewport: Viewport, eventViewport: any) => boolean; +export declare const transformToViewport: (transform: ZoomTransform) => Viewport; +export declare const viewportToTransform: ({ x, y, zoom }: Viewport) => ZoomTransform; +export declare const isWrappedWithClass: (event: any, className: string | undefined) => any; +export declare const isRightClickPan: (panOnDrag: boolean | number[], usedButton: number) => boolean; +export declare const getD3Transition: (selection: D3SelectionInstance, duration?: number, ease?: (t: number) => number, onEnd?: () => void) => D3SelectionInstance | import("d3-transition").Transition; +export declare const wheelDelta: (event: any) => number; +//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/xypanzoom/utils.d.ts.map b/node_modules/@xyflow/system/dist/umd/xypanzoom/utils.d.ts.map new file mode 100644 index 0000000..6a33daf --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/xypanzoom/utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/xypanzoom/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAgB,MAAM,SAAS,CAAC;AAI3D,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGnE,eAAO,MAAM,WAAW,iBAAkB,QAAQ,iBAAiB,GAAG,KAAG,OAC0C,CAAC;AAEpH,eAAO,MAAM,mBAAmB,cAAe,aAAa,KAAG,QAI7D,CAAC;AAEH,eAAO,MAAM,mBAAmB,mBAAoB,QAAQ,KAAG,aACrB,CAAC;AAE3C,eAAO,MAAM,kBAAkB,UAAW,GAAG,aAAa,MAAM,GAAG,SAAS,QAA0C,CAAC;AAEvH,eAAO,MAAM,eAAe,cAAe,OAAO,GAAG,MAAM,EAAE,cAAc,MAAM,YACV,CAAC;AAKxE,eAAO,MAAM,eAAe,cAAe,mBAAmB,gCAFtC,MAAM,+HAU7B,CAAC;AAEF,eAAO,MAAM,UAAU,UAAW,GAAG,WAIpC,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/xyresizer/XYResizer.d.ts b/node_modules/@xyflow/system/dist/umd/xyresizer/XYResizer.d.ts new file mode 100644 index 0000000..097ad19 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/xyresizer/XYResizer.d.ts @@ -0,0 +1,49 @@ +import type { CoordinateExtent, NodeLookup, NodeOrigin, Transform, XYPosition } from '../types'; +import type { OnResize, OnResizeEnd, OnResizeStart, ShouldResize, ControlPosition, ResizeControlDirection } from './types'; +export type XYResizerChange = { + x?: number; + y?: number; + width?: number; + height?: number; +}; +export type XYResizerChildChange = { + id: string; + position: XYPosition; + extent?: 'parent' | CoordinateExtent; +}; +type XYResizerParams = { + domNode: HTMLDivElement; + nodeId: string; + getStoreItems: () => { + nodeLookup: NodeLookup; + transform: Transform; + snapGrid?: [number, number]; + snapToGrid: boolean; + nodeOrigin: NodeOrigin; + paneDomNode: HTMLDivElement | null; + }; + onChange: (changes: XYResizerChange, childChanges: XYResizerChildChange[]) => void; + onEnd?: (change: Required) => void; +}; +type XYResizerUpdateParams = { + controlPosition: ControlPosition; + boundaries: { + minWidth: number; + minHeight: number; + maxWidth: number; + maxHeight: number; + }; + keepAspectRatio: boolean; + resizeDirection?: ResizeControlDirection; + onResizeStart: OnResizeStart | undefined; + onResize: OnResize | undefined; + onResizeEnd: OnResizeEnd | undefined; + shouldResize: ShouldResize | undefined; +}; +export type XYResizerInstance = { + update: (params: XYResizerUpdateParams) => void; + destroy: () => void; +}; +export declare function XYResizer({ domNode, nodeId, getStoreItems, onChange, onEnd }: XYResizerParams): XYResizerInstance; +export {}; +//# sourceMappingURL=XYResizer.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/xyresizer/XYResizer.d.ts.map b/node_modules/@xyflow/system/dist/umd/xyresizer/XYResizer.d.ts.map new file mode 100644 index 0000000..b37e0a8 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/xyresizer/XYResizer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"XYResizer.d.ts","sourceRoot":"","sources":["../../src/xyresizer/XYResizer.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,gBAAgB,EAGhB,UAAU,EACV,UAAU,EACV,SAAS,EACT,UAAU,EACX,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EACV,QAAQ,EACR,WAAW,EACX,aAAa,EAEb,YAAY,EACZ,eAAe,EACf,sBAAsB,EACvB,MAAM,SAAS,CAAC;AAWjB,MAAM,MAAM,eAAe,GAAG;IAC5B,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,UAAU,CAAC;IACrB,MAAM,CAAC,EAAE,QAAQ,GAAG,gBAAgB,CAAC;CACtC,CAAC;AAEF,KAAK,eAAe,GAAG;IACrB,OAAO,EAAE,cAAc,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM;QACnB,UAAU,EAAE,UAAU,CAAC;QACvB,SAAS,EAAE,SAAS,CAAC;QACrB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC5B,UAAU,EAAE,OAAO,CAAC;QACpB,UAAU,EAAE,UAAU,CAAC;QACvB,WAAW,EAAE,cAAc,GAAG,IAAI,CAAC;KACpC,CAAC;IACF,QAAQ,EAAE,CAAC,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,oBAAoB,EAAE,KAAK,IAAI,CAAC;IACnF,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC;CACrD,CAAC;AAEF,KAAK,qBAAqB,GAAG;IAC3B,eAAe,EAAE,eAAe,CAAC;IACjC,UAAU,EAAE;QACV,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,eAAe,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,sBAAsB,CAAC;IACzC,aAAa,EAAE,aAAa,GAAG,SAAS,CAAC;IACzC,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC/B,WAAW,EAAE,WAAW,GAAG,SAAS,CAAC;IACrC,YAAY,EAAE,YAAY,GAAG,SAAS,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,CAAC,MAAM,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAChD,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAuBF,wBAAgB,SAAS,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,eAAe,GAAG,iBAAiB,CAyNjH"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/xyresizer/index.d.ts b/node_modules/@xyflow/system/dist/umd/xyresizer/index.d.ts new file mode 100644 index 0000000..b26a0e6 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/xyresizer/index.d.ts @@ -0,0 +1,3 @@ +export * from './types'; +export * from './XYResizer'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/xyresizer/index.d.ts.map b/node_modules/@xyflow/system/dist/umd/xyresizer/index.d.ts.map new file mode 100644 index 0000000..aa841ae --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/xyresizer/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/xyresizer/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/xyresizer/types.d.ts b/node_modules/@xyflow/system/dist/umd/xyresizer/types.d.ts new file mode 100644 index 0000000..212e450 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/xyresizer/types.d.ts @@ -0,0 +1,46 @@ +import type { D3DragEvent, SubjectPosition } from 'd3-drag'; +export type ResizeParams = { + x: number; + y: number; + width: number; + height: number; +}; +export type ResizeParamsWithDirection = ResizeParams & { + direction: number[]; +}; +/** + * Used to determine the control line position of the NodeResizer + * + * @public + */ +export type ControlLinePosition = 'top' | 'bottom' | 'left' | 'right'; +/** + * Used to determine the control position of the NodeResizer + * + * @public + */ +export type ControlPosition = ControlLinePosition | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'; +/** + * Used to determine the variant of the resize control + * + * @public + */ +export declare enum ResizeControlVariant { + Line = "line", + Handle = "handle" +} +/** + * The direction the user can resize the node. + * @public + */ +export type ResizeControlDirection = 'horizontal' | 'vertical'; +export declare const XY_RESIZER_HANDLE_POSITIONS: ControlPosition[]; +export declare const XY_RESIZER_LINE_POSITIONS: ControlLinePosition[]; +type OnResizeHandler = (event: ResizeDragEvent, params: Params) => Result; +export type ResizeDragEvent = D3DragEvent; +export type ShouldResize = OnResizeHandler; +export type OnResizeStart = OnResizeHandler; +export type OnResize = OnResizeHandler; +export type OnResizeEnd = OnResizeHandler; +export {}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/xyresizer/types.d.ts.map b/node_modules/@xyflow/system/dist/umd/xyresizer/types.d.ts.map new file mode 100644 index 0000000..ec347bf --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/xyresizer/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/xyresizer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE5D,MAAM,MAAM,YAAY,GAAG;IACzB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,YAAY,GAAG;IACrD,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAEtE;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,mBAAmB,GAAG,UAAU,GAAG,WAAW,GAAG,aAAa,GAAG,cAAc,CAAC;AAE9G;;;;GAIG;AACH,oBAAY,oBAAoB;IAC9B,IAAI,SAAS;IACb,MAAM,WAAW;CAClB;AAED;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,YAAY,GAAG,UAAU,CAAC;AAE/D,eAAO,MAAM,2BAA2B,EAAE,eAAe,EAA6D,CAAC;AACvH,eAAO,MAAM,yBAAyB,EAAE,mBAAmB,EAAuC,CAAC;AAEnG,KAAK,eAAe,CAAC,MAAM,GAAG,YAAY,EAAE,MAAM,GAAG,IAAI,IAAI,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;AAChH,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC,cAAc,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC;AAEjF,MAAM,MAAM,YAAY,GAAG,eAAe,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC;AAC/E,MAAM,MAAM,aAAa,GAAG,eAAe,CAAC;AAC5C,MAAM,MAAM,QAAQ,GAAG,eAAe,CAAC,yBAAyB,CAAC,CAAC;AAClE,MAAM,MAAM,WAAW,GAAG,eAAe,CAAC"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/xyresizer/utils.d.ts b/node_modules/@xyflow/system/dist/umd/xyresizer/utils.d.ts new file mode 100644 index 0000000..24a7f40 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/xyresizer/utils.d.ts @@ -0,0 +1,76 @@ +import { CoordinateExtent, NodeOrigin } from '../types'; +import { getPointerPosition } from '../utils'; +import { ControlPosition } from './types'; +type GetResizeDirectionParams = { + width: number; + prevWidth: number; + height: number; + prevHeight: number; + affectsX: boolean; + affectsY: boolean; +}; +/** + * Get all connecting edges for a given set of nodes + * @param width - new width of the node + * @param prevWidth - previous width of the node + * @param height - new height of the node + * @param prevHeight - previous height of the node + * @param affectsX - whether to invert the resize direction for the x axis + * @param affectsY - whether to invert the resize direction for the y axis + * @returns array of two numbers representing the direction of the resize for each axis, 0 = no change, 1 = increase, -1 = decrease + */ +export declare function getResizeDirection({ width, prevWidth, height, prevHeight, affectsX, affectsY, }: GetResizeDirectionParams): number[]; +/** + * Parses the control position that is being dragged to dimensions that are being resized + * @param controlPosition - position of the control that is being dragged + * @returns isHorizontal, isVertical, affectsX, affectsY, + */ +export declare function getControlDirection(controlPosition: ControlPosition): { + isHorizontal: boolean; + isVertical: boolean; + affectsX: boolean; + affectsY: boolean; +}; +type PrevValues = { + width: number; + height: number; + x: number; + y: number; +}; +type StartValues = PrevValues & { + pointerX: number; + pointerY: number; + aspectRatio: number; +}; +/** + * Calculates new width & height and x & y of node after resize based on pointer position + * @description - Buckle up, this is a chunky one... If you want to determine the new dimensions of a node after a resize, + * you have to account for all possible restrictions: min/max width/height of the node, the maximum extent the node is allowed + * to move in (in this case: resize into) determined by the parent node, the minimal extent determined by child nodes + * with expandParent or extent: 'parent' set and oh yeah, these things also have to work with keepAspectRatio! + * The way this is done is by determining how much each of these restricting actually restricts the resize and then applying the + * strongest restriction. Because the resize affects x, y and width, height and width, height of a opposing side with keepAspectRatio, + * the resize amount is always kept in distX & distY amount (the distance in mouse movement) + * Instead of clamping each value, we first calculate the biggest 'clamp' (for the lack of a better name) and then apply it to all values. + * To complicate things nodeOrigin has to be taken into account as well. This is done by offsetting the nodes as if their origin is [0, 0], + * then calculating the restrictions as usual + * @param startValues - starting values of resize + * @param controlDirection - dimensions affected by the resize + * @param pointerPosition - the current pointer position corrected for snapping + * @param boundaries - minimum and maximum dimensions of the node + * @param keepAspectRatio - prevent changes of asprect ratio + * @returns x, y, width and height of the node after resize + */ +export declare function getDimensionsAfterResize(startValues: StartValues, controlDirection: ReturnType, pointerPosition: ReturnType, boundaries: { + minWidth: number; + maxWidth: number; + minHeight: number; + maxHeight: number; +}, keepAspectRatio: boolean, nodeOrigin: NodeOrigin, extent?: CoordinateExtent, childExtent?: CoordinateExtent): { + width: number; + height: number; + x: number; + y: number; +}; +export {}; +//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/node_modules/@xyflow/system/dist/umd/xyresizer/utils.d.ts.map b/node_modules/@xyflow/system/dist/umd/xyresizer/utils.d.ts.map new file mode 100644 index 0000000..870b9c6 --- /dev/null +++ b/node_modules/@xyflow/system/dist/umd/xyresizer/utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/xyresizer/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,KAAK,wBAAwB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,SAAS,EACT,MAAM,EACN,UAAU,EACV,QAAQ,EACR,QAAQ,GACT,EAAE,wBAAwB,YAc1B;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,eAAe,EAAE,eAAe;;;;;EAYnE;AAED,KAAK,UAAU,GAAG;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,KAAK,WAAW,GAAG,UAAU,GAAG;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAkBF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,wBAAwB,CACtC,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,EACxD,eAAe,EAAE,UAAU,CAAC,OAAO,kBAAkB,CAAC,EACtD,UAAU,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,EACxF,eAAe,EAAE,OAAO,EACxB,UAAU,EAAE,UAAU,EACtB,MAAM,CAAC,EAAE,gBAAgB,EACzB,WAAW,CAAC,EAAE,gBAAgB;;;;;EA8J/B"} \ No newline at end of file diff --git a/node_modules/@xyflow/system/package.json b/node_modules/@xyflow/system/package.json new file mode 100644 index 0000000..a479169 --- /dev/null +++ b/node_modules/@xyflow/system/package.json @@ -0,0 +1,79 @@ +{ + "name": "@xyflow/system", + "version": "0.0.62", + "description": "xyflow core system that powers React Flow and Svelte Flow.", + "keywords": [ + "node-based UI", + "graph", + "diagram", + "workflow", + "reactflow", + "svelteflow", + "xyflow" + ], + "files": [ + "dist" + ], + "source": "src/index.ts", + "main": "dist/umd/index.js", + "module": "dist/esm/index.js", + "types": "dist/esm/index.d.ts", + "exports": { + ".": { + "node": { + "types": "./dist/esm/index.d.ts", + "module": "./dist/esm/index.js", + "require": "./dist/umd/index.js", + "import": "./dist/esm/index.mjs" + }, + "browser": { + "import": "./dist/esm/index.js", + "require": "./dist/umd/index.js" + }, + "default": "./dist/esm/index.js" + } + }, + "sideEffects": false, + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "https://github.com/xyflow/xyflow.git", + "directory": "packages/system" + }, + "dependencies": { + "@types/d3-drag": "^3.0.7", + "@types/d3-interpolate": "^3.0.4", + "@types/d3-selection": "^3.0.10", + "@types/d3-transition": "^3.0.8", + "@types/d3-zoom": "^3.0.8", + "d3-drag": "^3.0.0", + "d3-interpolate": "^3.0.1", + "d3-selection": "^3.0.0", + "d3-zoom": "^3.0.0" + }, + "devDependencies": { + "@types/node": "^18.7.16", + "typescript": "5.4.5", + "@xyflow/eslint-config": "0.0.1", + "@xyflow/rollup-config": "0.0.0", + "@xyflow/tsconfig": "0.0.0" + }, + "rollup": { + "globals": { + "d3-selection": "d3Selection", + "d3-zoom": "d3Zoom", + "d3-drag": "d3Drag" + }, + "vanilla": true, + "name": "XYFlowSystem" + }, + "scripts": { + "dev": "concurrently \"rollup --config node:@xyflow/rollup-config --watch\"", + "build": "rollup --config node:@xyflow/rollup-config --environment NODE_ENV:production", + "lint": "eslint --ext .js,.ts src", + "typecheck": "tsc --noEmit" + } +} \ No newline at end of file diff --git a/node_modules/classcat/LICENSE.md b/node_modules/classcat/LICENSE.md new file mode 100644 index 0000000..6ba7a0f --- /dev/null +++ b/node_modules/classcat/LICENSE.md @@ -0,0 +1,7 @@ +Copyright © Jorge Bucaran <> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/classcat/README.md b/node_modules/classcat/README.md new file mode 100644 index 0000000..a96a5c1 --- /dev/null +++ b/node_modules/classcat/README.md @@ -0,0 +1,88 @@ +# Classcat + +> Build a [`class`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class) attribute string quickly. + +- Framework agnostic, reusable, plain vanilla JavaScript. +- Up to [2.5x faster](#benchmarks) than alternatives. +- [217 B](http://bundlephobia.com/result?p=classcat) (minified+gzipped). 👌 + +This module makes it easy to build a space-delimited `class` attribute string from an object or array of CSS class names. Just pair each class with a boolean value to add or remove them conditionally. + +```js +import cc from "classcat" + +export const ToggleButton = ({ isOn, toggle }) => ( +
toggle(!isOn)}> +
+ {isOn ? "ON" : "OFF"} +
+) +``` + +[Try with React](https://codepen.io/jorgebucaran/pen/NYgLwG?editors=0010), [lit-html](https://codepen.io/jorgebucaran/pen/LjPJEp?editors=1000), [Mithril](https://codepen.io/jorgebucaran/pen/JjjOjwB?editors=1100), [Superfine](https://codepen.io/jorgebucaran/pen/wrMvjz?editors=1000) + +## Installation + +```console +npm install classcat +``` + +Or without a build step—import it right in your browser. + +```html + +``` + +## API + +### `cc(names)` + +```ps +cc(names: string | number | object | array): string +``` + +```js +import cc from "classcat" + +cc("elf") //=> "elf" + +cc(["elf", "orc", "gnome"]) //=> "elf orc gnome" + +cc({ + elf: false, + orc: null, + gnome: undefined, +}) //=> "" + +cc({ + elf: true, + orc: false, + gnome: true, +}) //=> "elf gnome" + +cc([ + { + elf: true, + orc: false, + }, + "gnome", +]) //=> "elf gnome" +``` + +## Benchmarks + +```console +npm --prefix bench start +``` + +## License + +[MIT](LICENSE.md) diff --git a/node_modules/classcat/index.cjs b/node_modules/classcat/index.cjs new file mode 100644 index 0000000..c81fb9c --- /dev/null +++ b/node_modules/classcat/index.cjs @@ -0,0 +1,19 @@ +module.exports = function cc(names) { + if (typeof names === "string" || typeof names === "number") return "" + names + + let out = "" + + if (Array.isArray(names)) { + for (let i = 0, tmp; i < names.length; i++) { + if ((tmp = cc(names[i])) !== "") { + out += (out && " ") + tmp + } + } + } else { + for (let k in names) { + if (names[k]) out += (out && " ") + k + } + } + + return out +} diff --git a/node_modules/classcat/index.d.ts b/node_modules/classcat/index.d.ts new file mode 100644 index 0000000..38807f3 --- /dev/null +++ b/node_modules/classcat/index.d.ts @@ -0,0 +1,15 @@ +export as namespace Classcat + +export interface ClassObject { + [key: string]: boolean | any +} + +export interface ClassArray extends Array {} + +export type Class = string | number | null | undefined | ClassObject | ClassArray + +/** + * @param names A string, array or object of CSS class names (as keys). + * @returns The class attribute string. + */ +export default function cc(names: Class): string diff --git a/node_modules/classcat/index.js b/node_modules/classcat/index.js new file mode 100644 index 0000000..4f3d6bc --- /dev/null +++ b/node_modules/classcat/index.js @@ -0,0 +1,19 @@ +export default function cc(names) { + if (typeof names === "string" || typeof names === "number") return "" + names + + let out = "" + + if (Array.isArray(names)) { + for (let i = 0, tmp; i < names.length; i++) { + if ((tmp = cc(names[i])) !== "") { + out += (out && " ") + tmp + } + } + } else { + for (let k in names) { + if (names[k]) out += (out && " ") + k + } + } + + return out +} diff --git a/node_modules/classcat/package.json b/node_modules/classcat/package.json new file mode 100644 index 0000000..eb5565f --- /dev/null +++ b/node_modules/classcat/package.json @@ -0,0 +1,38 @@ +{ + "name": "classcat", + "version": "5.0.5", + "type": "module", + "main": "index.cjs", + "module": "index.js", + "types": "index.d.ts", + "description": "Build a class attribute string quickly.", + "repository": "jorgebucaran/classcat", + "license": "MIT", + "exports": { + "./package.json": "./package.json", + ".": { + "require": "./index.cjs", + "import": "./index.js" + } + }, + "files": [ + "*.*(c)[tj]s*" + ], + "author": "Jorge Bucaran", + "keywords": [ + "classnames", + "classlist", + "class" + ], + "scripts": { + "test": "c8 twist tests/*.js", + "build": "node -e \"fs.writeFileSync('index.cjs',fs.readFileSync('index.js','utf8').replace(/export default/,'module.exports ='),'utf8')\"", + "deploy": "npm test && git commit --all --message $tag && git tag --sign $tag --message $tag && git push && git push --tags", + "release": "tag=$npm_package_version npm run deploy && npm publish --access public", + "prepare": "npm run build" + }, + "devDependencies": { + "c8": "*", + "twist": "*" + } +} diff --git a/node_modules/d3-color/LICENSE b/node_modules/d3-color/LICENSE new file mode 100644 index 0000000..fbe44bd --- /dev/null +++ b/node_modules/d3-color/LICENSE @@ -0,0 +1,13 @@ +Copyright 2010-2022 Mike Bostock + +Permission to use, copy, modify, and/or distribute this software for any purpose +with or without fee is hereby granted, provided that the above copyright notice +and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. diff --git a/node_modules/d3-color/README.md b/node_modules/d3-color/README.md new file mode 100644 index 0000000..a7f2d52 --- /dev/null +++ b/node_modules/d3-color/README.md @@ -0,0 +1,203 @@ +# d3-color + +Even though your browser understands a lot about colors, it doesn’t offer much help in manipulating colors through JavaScript. The d3-color module therefore provides representations for various color spaces, allowing specification, conversion and manipulation. (Also see [d3-interpolate](https://github.com/d3/d3-interpolate) for color interpolation.) + +For example, take the color named “steelblue”: + +```js +const c = d3.color("steelblue"); // {r: 70, g: 130, b: 180, opacity: 1} +``` + +Let’s try converting it to HSL: + +```js +const c = d3.hsl("steelblue"); // {h: 207.27…, s: 0.44, l: 0.4902…, opacity: 1} +``` + +Now rotate the hue by 90°, bump up the saturation, and format as a string for CSS: + +```js +c.h += 90; +c.s += 0.2; +c + ""; // rgb(198, 45, 205) +``` + +To fade the color slightly: + +```js +c.opacity = 0.8; +c + ""; // rgba(198, 45, 205, 0.8) +``` + +In addition to the ubiquitous and machine-friendly [RGB](#rgb) and [HSL](#hsl) color space, d3-color supports color spaces that are designed for humans: + +* [CIELAB](#lab) (*a.k.a.* “Lab”) +* [CIELChab](#lch) (*a.k.a.* “LCh” or “HCL”) +* Dave Green’s [Cubehelix](#cubehelix) + +Cubehelix features monotonic lightness, while CIELAB and its polar form CIELChab are perceptually uniform. + +## Extensions + +For additional color spaces, see: + +* [d3-cam16](https://github.com/d3/d3-cam16) +* [d3-cam02](https://github.com/connorgr/d3-cam02) +* [d3-hsv](https://github.com/d3/d3-hsv) +* [d3-hcg](https://github.com/d3/d3-hcg) +* [d3-hsluv](https://github.com/petulla/d3-hsluv) + +To measure color differences, see: + +* [d3-color-difference](https://github.com/Evercoder/d3-color-difference) + +## Installing + +If you use npm, `npm install d3-color`. You can also download the [latest release on GitHub](https://github.com/d3/d3-color/releases/latest). For vanilla HTML in modern browsers, import d3-color from Skypack: + +```html + +``` + +For legacy environments, you can load d3-color’s UMD bundle from an npm-based CDN such as jsDelivr; a `d3` global is exported: + +```html + + +``` + +[Try d3-color in your browser.](https://observablehq.com/collection/@d3/d3-color) + +## API Reference + +
# d3.color(specifier) [<>](https://github.com/d3/d3-color/blob/master/src/color.js "Source") + +Parses the specified [CSS Color Module Level 3](http://www.w3.org/TR/css3-color/#colorunits) *specifier* string, returning an [RGB](#rgb) or [HSL](#hsl) color, along with [CSS Color Module Level 4 hex](https://www.w3.org/TR/css-color-4/#hex-notation) *specifier* strings. If the specifier was not valid, null is returned. Some examples: + +* `rgb(255, 255, 255)` +* `rgb(10%, 20%, 30%)` +* `rgba(255, 255, 255, 0.4)` +* `rgba(10%, 20%, 30%, 0.4)` +* `hsl(120, 50%, 20%)` +* `hsla(120, 50%, 20%, 0.4)` +* `#ffeeaa` +* `#fea` +* `#ffeeaa22` +* `#fea2` +* `steelblue` + +The list of supported [named colors](http://www.w3.org/TR/SVG/types.html#ColorKeywords) is specified by CSS. + +Note: this function may also be used with `instanceof` to test if an object is a color instance. The same is true of color subclasses, allowing you to test whether a color is in a particular color space. + +# *color*.opacity + +This color’s opacity, typically in the range [0, 1]. + +# *color*.rgb() [<>](https://github.com/d3/d3-color/blob/master/src/color.js "Source") + +Returns the [RGB equivalent](#rgb) of this color. For RGB colors, that’s `this`. + +# color.copy([values]) [<>](https://github.com/d3/d3-color/blob/master/src/color.js "Source") + +Returns a copy of this color. If *values* is specified, any enumerable own properties of *values* are assigned to the new returned color. For example, to derive a copy of a *color* with opacity 0.5, say + +```js +color.copy({opacity: 0.5}) +``` + +# *color*.brighter([k]) [<>](https://github.com/d3/d3-color/blob/master/src/color.js "Source") + +Returns a brighter copy of this color. If *k* is specified, it controls how much brighter the returned color should be. If *k* is not specified, it defaults to 1. The behavior of this method is dependent on the implementing color space. + +# *color*.darker([k]) [<>](https://github.com/d3/d3-color/blob/master/src/color.js "Source") + +Returns a darker copy of this color. If *k* is specified, it controls how much darker the returned color should be. If *k* is not specified, it defaults to 1. The behavior of this method is dependent on the implementing color space. + +# *color*.displayable() [<>](https://github.com/d3/d3-color/blob/master/src/color.js "Source") + +Returns true if and only if the color is displayable on standard hardware. For example, this returns false for an RGB color if any channel value is less than zero or greater than 255 when rounded, or if the opacity is not in the range [0, 1]. + +# *color*.formatHex() [<>](https://github.com/d3/d3-color/blob/master/src/color.js "Source") + +Returns a hexadecimal string representing this color in RGB space, such as `#f7eaba`. If this color is not displayable, a suitable displayable color is returned instead. For example, RGB channel values greater than 255 are clamped to 255. + +# *color*.formatHsl() [<>](https://github.com/d3/d3-color/blob/master/src/color.js "Source") + +Returns a string representing this color according to the [CSS Color Module Level 3 specification](https://www.w3.org/TR/css-color-3/#hsl-color), such as `hsl(257, 50%, 80%)` or `hsla(257, 50%, 80%, 0.2)`. If this color is not displayable, a suitable displayable color is returned instead by clamping S and L channel values to the interval [0, 100]. + +# *color*.formatRgb() [<>](https://github.com/d3/d3-color/blob/master/src/color.js "Source") + +Returns a string representing this color according to the [CSS Object Model specification](https://drafts.csswg.org/cssom/#serialize-a-css-component-value), such as `rgb(247, 234, 186)` or `rgba(247, 234, 186, 0.2)`. If this color is not displayable, a suitable displayable color is returned instead by clamping RGB channel values to the interval [0, 255]. + +# *color*.toString() [<>](https://github.com/d3/d3-color/blob/master/src/color.js "Source") + +An alias for [*color*.formatRgb](#color_formatRgb). + +# d3.rgb(r, g, b[, opacity]) [<>](https://github.com/d3/d3-color/blob/master/src/color.js "Source")
+# d3.rgb(specifier)
+# d3.rgb(color)
+ +Constructs a new [RGB](https://en.wikipedia.org/wiki/RGB_color_model) color. The channel values are exposed as `r`, `g` and `b` properties on the returned instance. Use the [RGB color picker](http://bl.ocks.org/mbostock/78d64ca7ef013b4dcf8f) to explore this color space. + +If *r*, *g* and *b* are specified, these represent the channel values of the returned color; an *opacity* may also be specified. If a CSS Color Module Level 3 *specifier* string is specified, it is parsed and then converted to the RGB color space. See [color](#color) for examples. If a [*color*](#color) instance is specified, it is converted to the RGB color space using [*color*.rgb](#color_rgb). Note that unlike [*color*.rgb](#color_rgb) this method *always* returns a new instance, even if *color* is already an RGB color. + +# *rgb*.clamp() [<>](https://github.com/d3/d3-color/blob/master/src/color.js "Source") + +Returns a new RGB color where the `r`, `g`, and `b` channels are clamped to the range [0, 255] and rounded to the nearest integer value, and the `opacity` is clamped to the range [0, 1]. + +# d3.hsl(h, s, l[, opacity]) [<>](https://github.com/d3/d3-color/blob/master/src/color.js "Source")
+# d3.hsl(specifier)
+# d3.hsl(color)
+ +Constructs a new [HSL](https://en.wikipedia.org/wiki/HSL_and_HSV) color. The channel values are exposed as `h`, `s` and `l` properties on the returned instance. Use the [HSL color picker](http://bl.ocks.org/mbostock/debaad4fcce9bcee14cf) to explore this color space. + +If *h*, *s* and *l* are specified, these represent the channel values of the returned color; an *opacity* may also be specified. If a CSS Color Module Level 3 *specifier* string is specified, it is parsed and then converted to the HSL color space. See [color](#color) for examples. If a [*color*](#color) instance is specified, it is converted to the RGB color space using [*color*.rgb](#color_rgb) and then converted to HSL. (Colors already in the HSL color space skip the conversion to RGB.) + +# *hsl*.clamp() [<>](https://github.com/d3/d3-color/blob/master/src/color.js "Source") + +Returns a new HSL color where the `h` channel is clamped to the range [0, 360), and the `s`, `l`, and `opacity` channels are clamped to the range [0, 1]. + +# d3.lab(l, a, b[, opacity]) [<>](https://github.com/d3/d3-color/blob/master/src/lab.js "Source")
+# d3.lab(specifier)
+# d3.lab(color)
+ +Constructs a new [CIELAB](https://en.wikipedia.org/wiki/Lab_color_space#CIELAB) color. The channel values are exposed as `l`, `a` and `b` properties on the returned instance. Use the [CIELAB color picker](http://bl.ocks.org/mbostock/9f37cc207c0cb166921b) to explore this color space. The value of *l* is typically in the range [0, 100], while *a* and *b* are typically in [-160, +160]. + +If *l*, *a* and *b* are specified, these represent the channel values of the returned color; an *opacity* may also be specified. If a CSS Color Module Level 3 *specifier* string is specified, it is parsed and then converted to the CIELAB color space. See [color](#color) for examples. If a [*color*](#color) instance is specified, it is converted to the RGB color space using [*color*.rgb](#color_rgb) and then converted to CIELAB. (Colors already in the CIELAB color space skip the conversion to RGB, and colors in the HCL color space are converted directly to CIELAB.) + +# d3.gray(l[, opacity]) [<>](https://github.com/d3/d3-color/blob/master/src/lab.js "Source")
+ +Constructs a new [CIELAB](#lab) color with the specified *l* value and *a* = *b* = 0. + +# d3.hcl(h, c, l[, opacity]) [<>](https://github.com/d3/d3-color/blob/master/src/lab.js "Source")
+# d3.hcl(specifier)
+# d3.hcl(color)
+ +Equivalent to [d3.lch](#lch), but with reversed argument order. + +# d3.lch(l, c, h[, opacity]) [<>](https://github.com/d3/d3-color/blob/master/src/lab.js "Source")
+# d3.lch(specifier)
+# d3.lch(color)
+ +Constructs a new [CIELChab](https://en.wikipedia.org/wiki/CIELAB_color_space#Cylindrical_representation:_CIELCh_or_CIEHLC) color. The channel values are exposed as `l`, `c` and `h` properties on the returned instance. Use the [CIELChab color picker](http://bl.ocks.org/mbostock/3e115519a1b495e0bd95) to explore this color space. The value of *l* is typically in the range [0, 100], *c* is typically in [0, 230], and *h* is typically in [0, 360). + +If *l*, *c*, and *h* are specified, these represent the channel values of the returned color; an *opacity* may also be specified. If a CSS Color Module Level 3 *specifier* string is specified, it is parsed and then converted to CIELChab color space. See [color](#color) for examples. If a [*color*](#color) instance is specified, it is converted to the RGB color space using [*color*.rgb](#color_rgb) and then converted to CIELChab. (Colors already in CIELChab color space skip the conversion to RGB, and colors in CIELAB color space are converted directly to CIELChab.) + +# d3.cubehelix(h, s, l[, opacity]) [<>](https://github.com/d3/d3-color/blob/master/src/cubehelix.js "Source")
+# d3.cubehelix(specifier)
+# d3.cubehelix(color)
+ +Constructs a new [Cubehelix](http://www.mrao.cam.ac.uk/~dag/CUBEHELIX/) color. The channel values are exposed as `h`, `s` and `l` properties on the returned instance. Use the [Cubehelix color picker](http://bl.ocks.org/mbostock/ba8d75e45794c27168b5) to explore this color space. + +If *h*, *s* and *l* are specified, these represent the channel values of the returned color; an *opacity* may also be specified. If a CSS Color Module Level 3 *specifier* string is specified, it is parsed and then converted to the Cubehelix color space. See [color](#color) for examples. If a [*color*](#color) instance is specified, it is converted to the RGB color space using [*color*.rgb](#color_rgb) and then converted to Cubehelix. (Colors already in the Cubehelix color space skip the conversion to RGB.) diff --git a/node_modules/d3-color/dist/d3-color.js b/node_modules/d3-color/dist/d3-color.js new file mode 100644 index 0000000..a4ad54e --- /dev/null +++ b/node_modules/d3-color/dist/d3-color.js @@ -0,0 +1,606 @@ +// https://d3js.org/d3-color/ v3.1.0 Copyright 2010-2022 Mike Bostock +(function (global, factory) { +typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : +typeof define === 'function' && define.amd ? define(['exports'], factory) : +(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.d3 = global.d3 || {})); +})(this, (function (exports) { 'use strict'; + +function define(constructor, factory, prototype) { + constructor.prototype = factory.prototype = prototype; + prototype.constructor = constructor; +} + +function extend(parent, definition) { + var prototype = Object.create(parent.prototype); + for (var key in definition) prototype[key] = definition[key]; + return prototype; +} + +function Color() {} + +var darker = 0.7; +var brighter = 1 / darker; + +var reI = "\\s*([+-]?\\d+)\\s*", + reN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", + reP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", + reHex = /^#([0-9a-f]{3,8})$/, + reRgbInteger = new RegExp(`^rgb\\(${reI},${reI},${reI}\\)$`), + reRgbPercent = new RegExp(`^rgb\\(${reP},${reP},${reP}\\)$`), + reRgbaInteger = new RegExp(`^rgba\\(${reI},${reI},${reI},${reN}\\)$`), + reRgbaPercent = new RegExp(`^rgba\\(${reP},${reP},${reP},${reN}\\)$`), + reHslPercent = new RegExp(`^hsl\\(${reN},${reP},${reP}\\)$`), + reHslaPercent = new RegExp(`^hsla\\(${reN},${reP},${reP},${reN}\\)$`); + +var named = { + aliceblue: 0xf0f8ff, + antiquewhite: 0xfaebd7, + aqua: 0x00ffff, + aquamarine: 0x7fffd4, + azure: 0xf0ffff, + beige: 0xf5f5dc, + bisque: 0xffe4c4, + black: 0x000000, + blanchedalmond: 0xffebcd, + blue: 0x0000ff, + blueviolet: 0x8a2be2, + brown: 0xa52a2a, + burlywood: 0xdeb887, + cadetblue: 0x5f9ea0, + chartreuse: 0x7fff00, + chocolate: 0xd2691e, + coral: 0xff7f50, + cornflowerblue: 0x6495ed, + cornsilk: 0xfff8dc, + crimson: 0xdc143c, + cyan: 0x00ffff, + darkblue: 0x00008b, + darkcyan: 0x008b8b, + darkgoldenrod: 0xb8860b, + darkgray: 0xa9a9a9, + darkgreen: 0x006400, + darkgrey: 0xa9a9a9, + darkkhaki: 0xbdb76b, + darkmagenta: 0x8b008b, + darkolivegreen: 0x556b2f, + darkorange: 0xff8c00, + darkorchid: 0x9932cc, + darkred: 0x8b0000, + darksalmon: 0xe9967a, + darkseagreen: 0x8fbc8f, + darkslateblue: 0x483d8b, + darkslategray: 0x2f4f4f, + darkslategrey: 0x2f4f4f, + darkturquoise: 0x00ced1, + darkviolet: 0x9400d3, + deeppink: 0xff1493, + deepskyblue: 0x00bfff, + dimgray: 0x696969, + dimgrey: 0x696969, + dodgerblue: 0x1e90ff, + firebrick: 0xb22222, + floralwhite: 0xfffaf0, + forestgreen: 0x228b22, + fuchsia: 0xff00ff, + gainsboro: 0xdcdcdc, + ghostwhite: 0xf8f8ff, + gold: 0xffd700, + goldenrod: 0xdaa520, + gray: 0x808080, + green: 0x008000, + greenyellow: 0xadff2f, + grey: 0x808080, + honeydew: 0xf0fff0, + hotpink: 0xff69b4, + indianred: 0xcd5c5c, + indigo: 0x4b0082, + ivory: 0xfffff0, + khaki: 0xf0e68c, + lavender: 0xe6e6fa, + lavenderblush: 0xfff0f5, + lawngreen: 0x7cfc00, + lemonchiffon: 0xfffacd, + lightblue: 0xadd8e6, + lightcoral: 0xf08080, + lightcyan: 0xe0ffff, + lightgoldenrodyellow: 0xfafad2, + lightgray: 0xd3d3d3, + lightgreen: 0x90ee90, + lightgrey: 0xd3d3d3, + lightpink: 0xffb6c1, + lightsalmon: 0xffa07a, + lightseagreen: 0x20b2aa, + lightskyblue: 0x87cefa, + lightslategray: 0x778899, + lightslategrey: 0x778899, + lightsteelblue: 0xb0c4de, + lightyellow: 0xffffe0, + lime: 0x00ff00, + limegreen: 0x32cd32, + linen: 0xfaf0e6, + magenta: 0xff00ff, + maroon: 0x800000, + mediumaquamarine: 0x66cdaa, + mediumblue: 0x0000cd, + mediumorchid: 0xba55d3, + mediumpurple: 0x9370db, + mediumseagreen: 0x3cb371, + mediumslateblue: 0x7b68ee, + mediumspringgreen: 0x00fa9a, + mediumturquoise: 0x48d1cc, + mediumvioletred: 0xc71585, + midnightblue: 0x191970, + mintcream: 0xf5fffa, + mistyrose: 0xffe4e1, + moccasin: 0xffe4b5, + navajowhite: 0xffdead, + navy: 0x000080, + oldlace: 0xfdf5e6, + olive: 0x808000, + olivedrab: 0x6b8e23, + orange: 0xffa500, + orangered: 0xff4500, + orchid: 0xda70d6, + palegoldenrod: 0xeee8aa, + palegreen: 0x98fb98, + paleturquoise: 0xafeeee, + palevioletred: 0xdb7093, + papayawhip: 0xffefd5, + peachpuff: 0xffdab9, + peru: 0xcd853f, + pink: 0xffc0cb, + plum: 0xdda0dd, + powderblue: 0xb0e0e6, + purple: 0x800080, + rebeccapurple: 0x663399, + red: 0xff0000, + rosybrown: 0xbc8f8f, + royalblue: 0x4169e1, + saddlebrown: 0x8b4513, + salmon: 0xfa8072, + sandybrown: 0xf4a460, + seagreen: 0x2e8b57, + seashell: 0xfff5ee, + sienna: 0xa0522d, + silver: 0xc0c0c0, + skyblue: 0x87ceeb, + slateblue: 0x6a5acd, + slategray: 0x708090, + slategrey: 0x708090, + snow: 0xfffafa, + springgreen: 0x00ff7f, + steelblue: 0x4682b4, + tan: 0xd2b48c, + teal: 0x008080, + thistle: 0xd8bfd8, + tomato: 0xff6347, + turquoise: 0x40e0d0, + violet: 0xee82ee, + wheat: 0xf5deb3, + white: 0xffffff, + whitesmoke: 0xf5f5f5, + yellow: 0xffff00, + yellowgreen: 0x9acd32 +}; + +define(Color, color, { + copy(channels) { + return Object.assign(new this.constructor, this, channels); + }, + displayable() { + return this.rgb().displayable(); + }, + hex: color_formatHex, // Deprecated! Use color.formatHex. + formatHex: color_formatHex, + formatHex8: color_formatHex8, + formatHsl: color_formatHsl, + formatRgb: color_formatRgb, + toString: color_formatRgb +}); + +function color_formatHex() { + return this.rgb().formatHex(); +} + +function color_formatHex8() { + return this.rgb().formatHex8(); +} + +function color_formatHsl() { + return hslConvert(this).formatHsl(); +} + +function color_formatRgb() { + return this.rgb().formatRgb(); +} + +function color(format) { + var m, l; + format = (format + "").trim().toLowerCase(); + return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000 + : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00 + : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000 + : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000 + : null) // invalid hex + : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0) + : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%) + : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1) + : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1) + : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%) + : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1) + : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins + : format === "transparent" ? new Rgb(NaN, NaN, NaN, 0) + : null; +} + +function rgbn(n) { + return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1); +} + +function rgba(r, g, b, a) { + if (a <= 0) r = g = b = NaN; + return new Rgb(r, g, b, a); +} + +function rgbConvert(o) { + if (!(o instanceof Color)) o = color(o); + if (!o) return new Rgb; + o = o.rgb(); + return new Rgb(o.r, o.g, o.b, o.opacity); +} + +function rgb(r, g, b, opacity) { + return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity); +} + +function Rgb(r, g, b, opacity) { + this.r = +r; + this.g = +g; + this.b = +b; + this.opacity = +opacity; +} + +define(Rgb, rgb, extend(Color, { + brighter(k) { + k = k == null ? brighter : Math.pow(brighter, k); + return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity); + }, + darker(k) { + k = k == null ? darker : Math.pow(darker, k); + return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity); + }, + rgb() { + return this; + }, + clamp() { + return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity)); + }, + displayable() { + return (-0.5 <= this.r && this.r < 255.5) + && (-0.5 <= this.g && this.g < 255.5) + && (-0.5 <= this.b && this.b < 255.5) + && (0 <= this.opacity && this.opacity <= 1); + }, + hex: rgb_formatHex, // Deprecated! Use color.formatHex. + formatHex: rgb_formatHex, + formatHex8: rgb_formatHex8, + formatRgb: rgb_formatRgb, + toString: rgb_formatRgb +})); + +function rgb_formatHex() { + return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`; +} + +function rgb_formatHex8() { + return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; +} + +function rgb_formatRgb() { + const a = clampa(this.opacity); + return `${a === 1 ? "rgb(" : "rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a === 1 ? ")" : `, ${a})`}`; +} + +function clampa(opacity) { + return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity)); +} + +function clampi(value) { + return Math.max(0, Math.min(255, Math.round(value) || 0)); +} + +function hex(value) { + value = clampi(value); + return (value < 16 ? "0" : "") + value.toString(16); +} + +function hsla(h, s, l, a) { + if (a <= 0) h = s = l = NaN; + else if (l <= 0 || l >= 1) h = s = NaN; + else if (s <= 0) h = NaN; + return new Hsl(h, s, l, a); +} + +function hslConvert(o) { + if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity); + if (!(o instanceof Color)) o = color(o); + if (!o) return new Hsl; + if (o instanceof Hsl) return o; + o = o.rgb(); + var r = o.r / 255, + g = o.g / 255, + b = o.b / 255, + min = Math.min(r, g, b), + max = Math.max(r, g, b), + h = NaN, + s = max - min, + l = (max + min) / 2; + if (s) { + if (r === max) h = (g - b) / s + (g < b) * 6; + else if (g === max) h = (b - r) / s + 2; + else h = (r - g) / s + 4; + s /= l < 0.5 ? max + min : 2 - max - min; + h *= 60; + } else { + s = l > 0 && l < 1 ? 0 : h; + } + return new Hsl(h, s, l, o.opacity); +} + +function hsl(h, s, l, opacity) { + return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity); +} + +function Hsl(h, s, l, opacity) { + this.h = +h; + this.s = +s; + this.l = +l; + this.opacity = +opacity; +} + +define(Hsl, hsl, extend(Color, { + brighter(k) { + k = k == null ? brighter : Math.pow(brighter, k); + return new Hsl(this.h, this.s, this.l * k, this.opacity); + }, + darker(k) { + k = k == null ? darker : Math.pow(darker, k); + return new Hsl(this.h, this.s, this.l * k, this.opacity); + }, + rgb() { + var h = this.h % 360 + (this.h < 0) * 360, + s = isNaN(h) || isNaN(this.s) ? 0 : this.s, + l = this.l, + m2 = l + (l < 0.5 ? l : 1 - l) * s, + m1 = 2 * l - m2; + return new Rgb( + hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2), + hsl2rgb(h, m1, m2), + hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2), + this.opacity + ); + }, + clamp() { + return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity)); + }, + displayable() { + return (0 <= this.s && this.s <= 1 || isNaN(this.s)) + && (0 <= this.l && this.l <= 1) + && (0 <= this.opacity && this.opacity <= 1); + }, + formatHsl() { + const a = clampa(this.opacity); + return `${a === 1 ? "hsl(" : "hsla("}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a === 1 ? ")" : `, ${a})`}`; + } +})); + +function clamph(value) { + value = (value || 0) % 360; + return value < 0 ? value + 360 : value; +} + +function clampt(value) { + return Math.max(0, Math.min(1, value || 0)); +} + +/* From FvD 13.37, CSS Color Module Level 3 */ +function hsl2rgb(h, m1, m2) { + return (h < 60 ? m1 + (m2 - m1) * h / 60 + : h < 180 ? m2 + : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 + : m1) * 255; +} + +const radians = Math.PI / 180; +const degrees = 180 / Math.PI; + +// https://observablehq.com/@mbostock/lab-and-rgb +const K = 18, + Xn = 0.96422, + Yn = 1, + Zn = 0.82521, + t0 = 4 / 29, + t1 = 6 / 29, + t2 = 3 * t1 * t1, + t3 = t1 * t1 * t1; + +function labConvert(o) { + if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity); + if (o instanceof Hcl) return hcl2lab(o); + if (!(o instanceof Rgb)) o = rgbConvert(o); + var r = rgb2lrgb(o.r), + g = rgb2lrgb(o.g), + b = rgb2lrgb(o.b), + y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), x, z; + if (r === g && g === b) x = z = y; else { + x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn); + z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn); + } + return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity); +} + +function gray(l, opacity) { + return new Lab(l, 0, 0, opacity == null ? 1 : opacity); +} + +function lab(l, a, b, opacity) { + return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity); +} + +function Lab(l, a, b, opacity) { + this.l = +l; + this.a = +a; + this.b = +b; + this.opacity = +opacity; +} + +define(Lab, lab, extend(Color, { + brighter(k) { + return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity); + }, + darker(k) { + return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity); + }, + rgb() { + var y = (this.l + 16) / 116, + x = isNaN(this.a) ? y : y + this.a / 500, + z = isNaN(this.b) ? y : y - this.b / 200; + x = Xn * lab2xyz(x); + y = Yn * lab2xyz(y); + z = Zn * lab2xyz(z); + return new Rgb( + lrgb2rgb( 3.1338561 * x - 1.6168667 * y - 0.4906146 * z), + lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z), + lrgb2rgb( 0.0719453 * x - 0.2289914 * y + 1.4052427 * z), + this.opacity + ); + } +})); + +function xyz2lab(t) { + return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0; +} + +function lab2xyz(t) { + return t > t1 ? t * t * t : t2 * (t - t0); +} + +function lrgb2rgb(x) { + return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055); +} + +function rgb2lrgb(x) { + return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4); +} + +function hclConvert(o) { + if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity); + if (!(o instanceof Lab)) o = labConvert(o); + if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity); + var h = Math.atan2(o.b, o.a) * degrees; + return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity); +} + +function lch(l, c, h, opacity) { + return arguments.length === 1 ? hclConvert(l) : new Hcl(h, c, l, opacity == null ? 1 : opacity); +} + +function hcl(h, c, l, opacity) { + return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity); +} + +function Hcl(h, c, l, opacity) { + this.h = +h; + this.c = +c; + this.l = +l; + this.opacity = +opacity; +} + +function hcl2lab(o) { + if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity); + var h = o.h * radians; + return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity); +} + +define(Hcl, hcl, extend(Color, { + brighter(k) { + return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity); + }, + darker(k) { + return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity); + }, + rgb() { + return hcl2lab(this).rgb(); + } +})); + +var A = -0.14861, + B = +1.78277, + C = -0.29227, + D = -0.90649, + E = +1.97294, + ED = E * D, + EB = E * B, + BC_DA = B * C - D * A; + +function cubehelixConvert(o) { + if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity); + if (!(o instanceof Rgb)) o = rgbConvert(o); + var r = o.r / 255, + g = o.g / 255, + b = o.b / 255, + l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB), + bl = b - l, + k = (E * (g - l) - C * bl) / D, + s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1 + h = s ? Math.atan2(k, bl) * degrees - 120 : NaN; + return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity); +} + +function cubehelix(h, s, l, opacity) { + return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity); +} + +function Cubehelix(h, s, l, opacity) { + this.h = +h; + this.s = +s; + this.l = +l; + this.opacity = +opacity; +} + +define(Cubehelix, cubehelix, extend(Color, { + brighter(k) { + k = k == null ? brighter : Math.pow(brighter, k); + return new Cubehelix(this.h, this.s, this.l * k, this.opacity); + }, + darker(k) { + k = k == null ? darker : Math.pow(darker, k); + return new Cubehelix(this.h, this.s, this.l * k, this.opacity); + }, + rgb() { + var h = isNaN(this.h) ? 0 : (this.h + 120) * radians, + l = +this.l, + a = isNaN(this.s) ? 0 : this.s * l * (1 - l), + cosh = Math.cos(h), + sinh = Math.sin(h); + return new Rgb( + 255 * (l + a * (A * cosh + B * sinh)), + 255 * (l + a * (C * cosh + D * sinh)), + 255 * (l + a * (E * cosh)), + this.opacity + ); + } +})); + +exports.color = color; +exports.cubehelix = cubehelix; +exports.gray = gray; +exports.hcl = hcl; +exports.hsl = hsl; +exports.lab = lab; +exports.lch = lch; +exports.rgb = rgb; + +Object.defineProperty(exports, '__esModule', { value: true }); + +})); diff --git a/node_modules/d3-color/dist/d3-color.min.js b/node_modules/d3-color/dist/d3-color.min.js new file mode 100644 index 0000000..dfe24a3 --- /dev/null +++ b/node_modules/d3-color/dist/d3-color.min.js @@ -0,0 +1,2 @@ +// https://d3js.org/d3-color/ v3.1.0 Copyright 2010-2022 Mike Bostock +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).d3=t.d3||{})}(this,(function(t){"use strict";function e(t,e,i){t.prototype=e.prototype=i,i.constructor=t}function i(t,e){var i=Object.create(t.prototype);for(var n in e)i[n]=e[n];return i}function n(){}var r=.7,a=1/r,s="\\s*([+-]?\\d+)\\s*",h="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",o="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",l=/^#([0-9a-f]{3,8})$/,u=new RegExp(`^rgb\\(${s},${s},${s}\\)$`),c=new RegExp(`^rgb\\(${o},${o},${o}\\)$`),g=new RegExp(`^rgba\\(${s},${s},${s},${h}\\)$`),p=new RegExp(`^rgba\\(${o},${o},${o},${h}\\)$`),f=new RegExp(`^hsl\\(${h},${o},${o}\\)$`),d=new RegExp(`^hsla\\(${h},${o},${o},${h}\\)$`),b={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function y(){return this.rgb().formatHex()}function w(){return this.rgb().formatRgb()}function m(t){var e,i;return t=(t+"").trim().toLowerCase(),(e=l.exec(t))?(i=e[1].length,e=parseInt(e[1],16),6===i?$(e):3===i?new M(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===i?N(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===i?N(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=u.exec(t))?new M(e[1],e[2],e[3],1):(e=c.exec(t))?new M(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=g.exec(t))?N(e[1],e[2],e[3],e[4]):(e=p.exec(t))?N(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=f.exec(t))?j(e[1],e[2]/100,e[3]/100,1):(e=d.exec(t))?j(e[1],e[2]/100,e[3]/100,e[4]):b.hasOwnProperty(t)?$(b[t]):"transparent"===t?new M(NaN,NaN,NaN,0):null}function $(t){return new M(t>>16&255,t>>8&255,255&t,1)}function N(t,e,i,n){return n<=0&&(t=e=i=NaN),new M(t,e,i,n)}function k(t){return t instanceof n||(t=m(t)),t?new M((t=t.rgb()).r,t.g,t.b,t.opacity):new M}function x(t,e,i,n){return 1===arguments.length?k(t):new M(t,e,i,null==n?1:n)}function M(t,e,i,n){this.r=+t,this.g=+e,this.b=+i,this.opacity=+n}function v(){return`#${E(this.r)}${E(this.g)}${E(this.b)}`}function q(){const t=H(this.opacity);return`${1===t?"rgb(":"rgba("}${R(this.r)}, ${R(this.g)}, ${R(this.b)}${1===t?")":`, ${t})`}`}function H(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function R(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function E(t){return((t=R(t))<16?"0":"")+t.toString(16)}function j(t,e,i,n){return n<=0?t=e=i=NaN:i<=0||i>=1?t=e=NaN:e<=0&&(t=NaN),new I(t,e,i,n)}function O(t){if(t instanceof I)return new I(t.h,t.s,t.l,t.opacity);if(t instanceof n||(t=m(t)),!t)return new I;if(t instanceof I)return t;var e=(t=t.rgb()).r/255,i=t.g/255,r=t.b/255,a=Math.min(e,i,r),s=Math.max(e,i,r),h=NaN,o=s-a,l=(s+a)/2;return o?(h=e===s?(i-r)/o+6*(i0&&l<1?0:h,new I(h,o,l,t.opacity)}function P(t,e,i,n){return 1===arguments.length?O(t):new I(t,e,i,null==n?1:n)}function I(t,e,i,n){this.h=+t,this.s=+e,this.l=+i,this.opacity=+n}function S(t){return(t=(t||0)%360)<0?t+360:t}function T(t){return Math.max(0,Math.min(1,t||0))}function _(t,e,i){return 255*(t<60?e+(i-e)*t/60:t<180?i:t<240?e+(i-e)*(240-t)/60:e)}e(n,m,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:y,formatHex:y,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return O(this).formatHsl()},formatRgb:w,toString:w}),e(M,x,i(n,{brighter(t){return t=null==t?a:Math.pow(a,t),new M(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?r:Math.pow(r,t),new M(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new M(R(this.r),R(this.g),R(this.b),H(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:v,formatHex:v,formatHex8:function(){return`#${E(this.r)}${E(this.g)}${E(this.b)}${E(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:q,toString:q})),e(I,P,i(n,{brighter(t){return t=null==t?a:Math.pow(a,t),new I(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?r:Math.pow(r,t),new I(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,i=this.l,n=i+(i<.5?i:1-i)*e,r=2*i-n;return new M(_(t>=240?t-240:t+120,r,n),_(t,r,n),_(t<120?t+240:t-120,r,n),this.opacity)},clamp(){return new I(S(this.h),T(this.s),T(this.l),H(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=H(this.opacity);return`${1===t?"hsl(":"hsla("}${S(this.h)}, ${100*T(this.s)}%, ${100*T(this.l)}%${1===t?")":`, ${t})`}`}}));const z=Math.PI/180,C=180/Math.PI,L=.96422,A=.82521,B=4/29,D=6/29,F=3*D*D;function G(t){if(t instanceof K)return new K(t.l,t.a,t.b,t.opacity);if(t instanceof Z)return tt(t);t instanceof M||(t=k(t));var e,i,n=W(t.r),r=W(t.g),a=W(t.b),s=Q((.2225045*n+.7168786*r+.0606169*a)/1);return n===r&&r===a?e=i=s:(e=Q((.4360747*n+.3850649*r+.1430804*a)/L),i=Q((.0139322*n+.0971045*r+.7141733*a)/A)),new K(116*s-16,500*(e-s),200*(s-i),t.opacity)}function J(t,e,i,n){return 1===arguments.length?G(t):new K(t,e,i,null==n?1:n)}function K(t,e,i,n){this.l=+t,this.a=+e,this.b=+i,this.opacity=+n}function Q(t){return t>.008856451679035631?Math.pow(t,1/3):t/F+B}function U(t){return t>D?t*t*t:F*(t-B)}function V(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function W(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function X(t){if(t instanceof Z)return new Z(t.h,t.c,t.l,t.opacity);if(t instanceof K||(t=G(t)),0===t.a&&0===t.b)return new Z(NaN,0=12" + } +} diff --git a/node_modules/d3-color/src/color.js b/node_modules/d3-color/src/color.js new file mode 100644 index 0000000..75b68b4 --- /dev/null +++ b/node_modules/d3-color/src/color.js @@ -0,0 +1,396 @@ +import define, {extend} from "./define.js"; + +export function Color() {} + +export var darker = 0.7; +export var brighter = 1 / darker; + +var reI = "\\s*([+-]?\\d+)\\s*", + reN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", + reP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", + reHex = /^#([0-9a-f]{3,8})$/, + reRgbInteger = new RegExp(`^rgb\\(${reI},${reI},${reI}\\)$`), + reRgbPercent = new RegExp(`^rgb\\(${reP},${reP},${reP}\\)$`), + reRgbaInteger = new RegExp(`^rgba\\(${reI},${reI},${reI},${reN}\\)$`), + reRgbaPercent = new RegExp(`^rgba\\(${reP},${reP},${reP},${reN}\\)$`), + reHslPercent = new RegExp(`^hsl\\(${reN},${reP},${reP}\\)$`), + reHslaPercent = new RegExp(`^hsla\\(${reN},${reP},${reP},${reN}\\)$`); + +var named = { + aliceblue: 0xf0f8ff, + antiquewhite: 0xfaebd7, + aqua: 0x00ffff, + aquamarine: 0x7fffd4, + azure: 0xf0ffff, + beige: 0xf5f5dc, + bisque: 0xffe4c4, + black: 0x000000, + blanchedalmond: 0xffebcd, + blue: 0x0000ff, + blueviolet: 0x8a2be2, + brown: 0xa52a2a, + burlywood: 0xdeb887, + cadetblue: 0x5f9ea0, + chartreuse: 0x7fff00, + chocolate: 0xd2691e, + coral: 0xff7f50, + cornflowerblue: 0x6495ed, + cornsilk: 0xfff8dc, + crimson: 0xdc143c, + cyan: 0x00ffff, + darkblue: 0x00008b, + darkcyan: 0x008b8b, + darkgoldenrod: 0xb8860b, + darkgray: 0xa9a9a9, + darkgreen: 0x006400, + darkgrey: 0xa9a9a9, + darkkhaki: 0xbdb76b, + darkmagenta: 0x8b008b, + darkolivegreen: 0x556b2f, + darkorange: 0xff8c00, + darkorchid: 0x9932cc, + darkred: 0x8b0000, + darksalmon: 0xe9967a, + darkseagreen: 0x8fbc8f, + darkslateblue: 0x483d8b, + darkslategray: 0x2f4f4f, + darkslategrey: 0x2f4f4f, + darkturquoise: 0x00ced1, + darkviolet: 0x9400d3, + deeppink: 0xff1493, + deepskyblue: 0x00bfff, + dimgray: 0x696969, + dimgrey: 0x696969, + dodgerblue: 0x1e90ff, + firebrick: 0xb22222, + floralwhite: 0xfffaf0, + forestgreen: 0x228b22, + fuchsia: 0xff00ff, + gainsboro: 0xdcdcdc, + ghostwhite: 0xf8f8ff, + gold: 0xffd700, + goldenrod: 0xdaa520, + gray: 0x808080, + green: 0x008000, + greenyellow: 0xadff2f, + grey: 0x808080, + honeydew: 0xf0fff0, + hotpink: 0xff69b4, + indianred: 0xcd5c5c, + indigo: 0x4b0082, + ivory: 0xfffff0, + khaki: 0xf0e68c, + lavender: 0xe6e6fa, + lavenderblush: 0xfff0f5, + lawngreen: 0x7cfc00, + lemonchiffon: 0xfffacd, + lightblue: 0xadd8e6, + lightcoral: 0xf08080, + lightcyan: 0xe0ffff, + lightgoldenrodyellow: 0xfafad2, + lightgray: 0xd3d3d3, + lightgreen: 0x90ee90, + lightgrey: 0xd3d3d3, + lightpink: 0xffb6c1, + lightsalmon: 0xffa07a, + lightseagreen: 0x20b2aa, + lightskyblue: 0x87cefa, + lightslategray: 0x778899, + lightslategrey: 0x778899, + lightsteelblue: 0xb0c4de, + lightyellow: 0xffffe0, + lime: 0x00ff00, + limegreen: 0x32cd32, + linen: 0xfaf0e6, + magenta: 0xff00ff, + maroon: 0x800000, + mediumaquamarine: 0x66cdaa, + mediumblue: 0x0000cd, + mediumorchid: 0xba55d3, + mediumpurple: 0x9370db, + mediumseagreen: 0x3cb371, + mediumslateblue: 0x7b68ee, + mediumspringgreen: 0x00fa9a, + mediumturquoise: 0x48d1cc, + mediumvioletred: 0xc71585, + midnightblue: 0x191970, + mintcream: 0xf5fffa, + mistyrose: 0xffe4e1, + moccasin: 0xffe4b5, + navajowhite: 0xffdead, + navy: 0x000080, + oldlace: 0xfdf5e6, + olive: 0x808000, + olivedrab: 0x6b8e23, + orange: 0xffa500, + orangered: 0xff4500, + orchid: 0xda70d6, + palegoldenrod: 0xeee8aa, + palegreen: 0x98fb98, + paleturquoise: 0xafeeee, + palevioletred: 0xdb7093, + papayawhip: 0xffefd5, + peachpuff: 0xffdab9, + peru: 0xcd853f, + pink: 0xffc0cb, + plum: 0xdda0dd, + powderblue: 0xb0e0e6, + purple: 0x800080, + rebeccapurple: 0x663399, + red: 0xff0000, + rosybrown: 0xbc8f8f, + royalblue: 0x4169e1, + saddlebrown: 0x8b4513, + salmon: 0xfa8072, + sandybrown: 0xf4a460, + seagreen: 0x2e8b57, + seashell: 0xfff5ee, + sienna: 0xa0522d, + silver: 0xc0c0c0, + skyblue: 0x87ceeb, + slateblue: 0x6a5acd, + slategray: 0x708090, + slategrey: 0x708090, + snow: 0xfffafa, + springgreen: 0x00ff7f, + steelblue: 0x4682b4, + tan: 0xd2b48c, + teal: 0x008080, + thistle: 0xd8bfd8, + tomato: 0xff6347, + turquoise: 0x40e0d0, + violet: 0xee82ee, + wheat: 0xf5deb3, + white: 0xffffff, + whitesmoke: 0xf5f5f5, + yellow: 0xffff00, + yellowgreen: 0x9acd32 +}; + +define(Color, color, { + copy(channels) { + return Object.assign(new this.constructor, this, channels); + }, + displayable() { + return this.rgb().displayable(); + }, + hex: color_formatHex, // Deprecated! Use color.formatHex. + formatHex: color_formatHex, + formatHex8: color_formatHex8, + formatHsl: color_formatHsl, + formatRgb: color_formatRgb, + toString: color_formatRgb +}); + +function color_formatHex() { + return this.rgb().formatHex(); +} + +function color_formatHex8() { + return this.rgb().formatHex8(); +} + +function color_formatHsl() { + return hslConvert(this).formatHsl(); +} + +function color_formatRgb() { + return this.rgb().formatRgb(); +} + +export default function color(format) { + var m, l; + format = (format + "").trim().toLowerCase(); + return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000 + : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00 + : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000 + : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000 + : null) // invalid hex + : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0) + : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%) + : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1) + : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1) + : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%) + : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1) + : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins + : format === "transparent" ? new Rgb(NaN, NaN, NaN, 0) + : null; +} + +function rgbn(n) { + return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1); +} + +function rgba(r, g, b, a) { + if (a <= 0) r = g = b = NaN; + return new Rgb(r, g, b, a); +} + +export function rgbConvert(o) { + if (!(o instanceof Color)) o = color(o); + if (!o) return new Rgb; + o = o.rgb(); + return new Rgb(o.r, o.g, o.b, o.opacity); +} + +export function rgb(r, g, b, opacity) { + return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity); +} + +export function Rgb(r, g, b, opacity) { + this.r = +r; + this.g = +g; + this.b = +b; + this.opacity = +opacity; +} + +define(Rgb, rgb, extend(Color, { + brighter(k) { + k = k == null ? brighter : Math.pow(brighter, k); + return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity); + }, + darker(k) { + k = k == null ? darker : Math.pow(darker, k); + return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity); + }, + rgb() { + return this; + }, + clamp() { + return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity)); + }, + displayable() { + return (-0.5 <= this.r && this.r < 255.5) + && (-0.5 <= this.g && this.g < 255.5) + && (-0.5 <= this.b && this.b < 255.5) + && (0 <= this.opacity && this.opacity <= 1); + }, + hex: rgb_formatHex, // Deprecated! Use color.formatHex. + formatHex: rgb_formatHex, + formatHex8: rgb_formatHex8, + formatRgb: rgb_formatRgb, + toString: rgb_formatRgb +})); + +function rgb_formatHex() { + return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`; +} + +function rgb_formatHex8() { + return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; +} + +function rgb_formatRgb() { + const a = clampa(this.opacity); + return `${a === 1 ? "rgb(" : "rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a === 1 ? ")" : `, ${a})`}`; +} + +function clampa(opacity) { + return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity)); +} + +function clampi(value) { + return Math.max(0, Math.min(255, Math.round(value) || 0)); +} + +function hex(value) { + value = clampi(value); + return (value < 16 ? "0" : "") + value.toString(16); +} + +function hsla(h, s, l, a) { + if (a <= 0) h = s = l = NaN; + else if (l <= 0 || l >= 1) h = s = NaN; + else if (s <= 0) h = NaN; + return new Hsl(h, s, l, a); +} + +export function hslConvert(o) { + if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity); + if (!(o instanceof Color)) o = color(o); + if (!o) return new Hsl; + if (o instanceof Hsl) return o; + o = o.rgb(); + var r = o.r / 255, + g = o.g / 255, + b = o.b / 255, + min = Math.min(r, g, b), + max = Math.max(r, g, b), + h = NaN, + s = max - min, + l = (max + min) / 2; + if (s) { + if (r === max) h = (g - b) / s + (g < b) * 6; + else if (g === max) h = (b - r) / s + 2; + else h = (r - g) / s + 4; + s /= l < 0.5 ? max + min : 2 - max - min; + h *= 60; + } else { + s = l > 0 && l < 1 ? 0 : h; + } + return new Hsl(h, s, l, o.opacity); +} + +export function hsl(h, s, l, opacity) { + return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity); +} + +function Hsl(h, s, l, opacity) { + this.h = +h; + this.s = +s; + this.l = +l; + this.opacity = +opacity; +} + +define(Hsl, hsl, extend(Color, { + brighter(k) { + k = k == null ? brighter : Math.pow(brighter, k); + return new Hsl(this.h, this.s, this.l * k, this.opacity); + }, + darker(k) { + k = k == null ? darker : Math.pow(darker, k); + return new Hsl(this.h, this.s, this.l * k, this.opacity); + }, + rgb() { + var h = this.h % 360 + (this.h < 0) * 360, + s = isNaN(h) || isNaN(this.s) ? 0 : this.s, + l = this.l, + m2 = l + (l < 0.5 ? l : 1 - l) * s, + m1 = 2 * l - m2; + return new Rgb( + hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2), + hsl2rgb(h, m1, m2), + hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2), + this.opacity + ); + }, + clamp() { + return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity)); + }, + displayable() { + return (0 <= this.s && this.s <= 1 || isNaN(this.s)) + && (0 <= this.l && this.l <= 1) + && (0 <= this.opacity && this.opacity <= 1); + }, + formatHsl() { + const a = clampa(this.opacity); + return `${a === 1 ? "hsl(" : "hsla("}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a === 1 ? ")" : `, ${a})`}`; + } +})); + +function clamph(value) { + value = (value || 0) % 360; + return value < 0 ? value + 360 : value; +} + +function clampt(value) { + return Math.max(0, Math.min(1, value || 0)); +} + +/* From FvD 13.37, CSS Color Module Level 3 */ +function hsl2rgb(h, m1, m2) { + return (h < 60 ? m1 + (m2 - m1) * h / 60 + : h < 180 ? m2 + : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 + : m1) * 255; +} diff --git a/node_modules/d3-color/src/cubehelix.js b/node_modules/d3-color/src/cubehelix.js new file mode 100644 index 0000000..b3cf696 --- /dev/null +++ b/node_modules/d3-color/src/cubehelix.js @@ -0,0 +1,61 @@ +import define, {extend} from "./define.js"; +import {Color, rgbConvert, Rgb, darker, brighter} from "./color.js"; +import {degrees, radians} from "./math.js"; + +var A = -0.14861, + B = +1.78277, + C = -0.29227, + D = -0.90649, + E = +1.97294, + ED = E * D, + EB = E * B, + BC_DA = B * C - D * A; + +function cubehelixConvert(o) { + if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity); + if (!(o instanceof Rgb)) o = rgbConvert(o); + var r = o.r / 255, + g = o.g / 255, + b = o.b / 255, + l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB), + bl = b - l, + k = (E * (g - l) - C * bl) / D, + s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1 + h = s ? Math.atan2(k, bl) * degrees - 120 : NaN; + return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity); +} + +export default function cubehelix(h, s, l, opacity) { + return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity); +} + +export function Cubehelix(h, s, l, opacity) { + this.h = +h; + this.s = +s; + this.l = +l; + this.opacity = +opacity; +} + +define(Cubehelix, cubehelix, extend(Color, { + brighter(k) { + k = k == null ? brighter : Math.pow(brighter, k); + return new Cubehelix(this.h, this.s, this.l * k, this.opacity); + }, + darker(k) { + k = k == null ? darker : Math.pow(darker, k); + return new Cubehelix(this.h, this.s, this.l * k, this.opacity); + }, + rgb() { + var h = isNaN(this.h) ? 0 : (this.h + 120) * radians, + l = +this.l, + a = isNaN(this.s) ? 0 : this.s * l * (1 - l), + cosh = Math.cos(h), + sinh = Math.sin(h); + return new Rgb( + 255 * (l + a * (A * cosh + B * sinh)), + 255 * (l + a * (C * cosh + D * sinh)), + 255 * (l + a * (E * cosh)), + this.opacity + ); + } +})); diff --git a/node_modules/d3-color/src/define.js b/node_modules/d3-color/src/define.js new file mode 100644 index 0000000..2bba2d3 --- /dev/null +++ b/node_modules/d3-color/src/define.js @@ -0,0 +1,10 @@ +export default function(constructor, factory, prototype) { + constructor.prototype = factory.prototype = prototype; + prototype.constructor = constructor; +} + +export function extend(parent, definition) { + var prototype = Object.create(parent.prototype); + for (var key in definition) prototype[key] = definition[key]; + return prototype; +} diff --git a/node_modules/d3-color/src/index.js b/node_modules/d3-color/src/index.js new file mode 100644 index 0000000..831cf52 --- /dev/null +++ b/node_modules/d3-color/src/index.js @@ -0,0 +1,3 @@ +export {default as color, rgb, hsl} from "./color.js"; +export {default as lab, hcl, lch, gray} from "./lab.js"; +export {default as cubehelix} from "./cubehelix.js"; diff --git a/node_modules/d3-color/src/lab.js b/node_modules/d3-color/src/lab.js new file mode 100644 index 0000000..88c46e8 --- /dev/null +++ b/node_modules/d3-color/src/lab.js @@ -0,0 +1,123 @@ +import define, {extend} from "./define.js"; +import {Color, rgbConvert, Rgb} from "./color.js"; +import {degrees, radians} from "./math.js"; + +// https://observablehq.com/@mbostock/lab-and-rgb +const K = 18, + Xn = 0.96422, + Yn = 1, + Zn = 0.82521, + t0 = 4 / 29, + t1 = 6 / 29, + t2 = 3 * t1 * t1, + t3 = t1 * t1 * t1; + +function labConvert(o) { + if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity); + if (o instanceof Hcl) return hcl2lab(o); + if (!(o instanceof Rgb)) o = rgbConvert(o); + var r = rgb2lrgb(o.r), + g = rgb2lrgb(o.g), + b = rgb2lrgb(o.b), + y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), x, z; + if (r === g && g === b) x = z = y; else { + x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn); + z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn); + } + return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity); +} + +export function gray(l, opacity) { + return new Lab(l, 0, 0, opacity == null ? 1 : opacity); +} + +export default function lab(l, a, b, opacity) { + return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity); +} + +export function Lab(l, a, b, opacity) { + this.l = +l; + this.a = +a; + this.b = +b; + this.opacity = +opacity; +} + +define(Lab, lab, extend(Color, { + brighter(k) { + return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity); + }, + darker(k) { + return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity); + }, + rgb() { + var y = (this.l + 16) / 116, + x = isNaN(this.a) ? y : y + this.a / 500, + z = isNaN(this.b) ? y : y - this.b / 200; + x = Xn * lab2xyz(x); + y = Yn * lab2xyz(y); + z = Zn * lab2xyz(z); + return new Rgb( + lrgb2rgb( 3.1338561 * x - 1.6168667 * y - 0.4906146 * z), + lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z), + lrgb2rgb( 0.0719453 * x - 0.2289914 * y + 1.4052427 * z), + this.opacity + ); + } +})); + +function xyz2lab(t) { + return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0; +} + +function lab2xyz(t) { + return t > t1 ? t * t * t : t2 * (t - t0); +} + +function lrgb2rgb(x) { + return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055); +} + +function rgb2lrgb(x) { + return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4); +} + +function hclConvert(o) { + if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity); + if (!(o instanceof Lab)) o = labConvert(o); + if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity); + var h = Math.atan2(o.b, o.a) * degrees; + return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity); +} + +export function lch(l, c, h, opacity) { + return arguments.length === 1 ? hclConvert(l) : new Hcl(h, c, l, opacity == null ? 1 : opacity); +} + +export function hcl(h, c, l, opacity) { + return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity); +} + +export function Hcl(h, c, l, opacity) { + this.h = +h; + this.c = +c; + this.l = +l; + this.opacity = +opacity; +} + +function hcl2lab(o) { + if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity); + var h = o.h * radians; + return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity); +} + +define(Hcl, hcl, extend(Color, { + brighter(k) { + return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity); + }, + darker(k) { + return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity); + }, + rgb() { + return hcl2lab(this).rgb(); + } +})); diff --git a/node_modules/d3-color/src/math.js b/node_modules/d3-color/src/math.js new file mode 100644 index 0000000..66b172e --- /dev/null +++ b/node_modules/d3-color/src/math.js @@ -0,0 +1,2 @@ +export const radians = Math.PI / 180; +export const degrees = 180 / Math.PI; diff --git a/node_modules/d3-dispatch/LICENSE b/node_modules/d3-dispatch/LICENSE new file mode 100644 index 0000000..b014515 --- /dev/null +++ b/node_modules/d3-dispatch/LICENSE @@ -0,0 +1,13 @@ +Copyright 2010-2021 Mike Bostock + +Permission to use, copy, modify, and/or distribute this software for any purpose +with or without fee is hereby granted, provided that the above copyright notice +and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. diff --git a/node_modules/d3-dispatch/README.md b/node_modules/d3-dispatch/README.md new file mode 100644 index 0000000..9963a84 --- /dev/null +++ b/node_modules/d3-dispatch/README.md @@ -0,0 +1,94 @@ +# d3-dispatch + +Dispatching is a convenient mechanism for separating concerns with loosely-coupled code: register named callbacks and then call them with arbitrary arguments. A variety of D3 components, such as [d3-drag](https://github.com/d3/d3-drag), use this mechanism to emit events to listeners. Think of this like Node’s [EventEmitter](https://nodejs.org/api/events.html), except every listener has a well-defined name so it’s easy to remove or replace them. + +For example, to create a dispatch for *start* and *end* events: + +```js +const dispatch = d3.dispatch("start", "end"); +``` + +You can then register callbacks for these events using [*dispatch*.on](#dispatch_on): + +```js +dispatch.on("start", callback1); +dispatch.on("start.foo", callback2); +dispatch.on("end", callback3); +``` + +Then, you can invoke all the *start* callbacks using [*dispatch*.call](#dispatch_call) or [*dispatch*.apply](#dispatch_apply): + +```js +dispatch.call("start"); +``` + +Like *function*.call, you may also specify the `this` context and any arguments: + +```js +dispatch.call("start", {about: "I am a context object"}, "I am an argument"); +``` + +Want a more involved example? See how to use [d3-dispatch for coordinated views](http://bl.ocks.org/mbostock/5872848). + +## Installing + +If you use npm, `npm install d3-dispatch`. You can also download the [latest release on GitHub](https://github.com/d3/d3-dispatch/releases/latest). For vanilla HTML in modern browsers, import d3-dispatch from Skypack: + +```html + +``` + +For legacy environments, you can load d3-dispatch’s UMD bundle from an npm-based CDN such as jsDelivr; a `d3` global is exported: + +```html + + +``` + +[Try d3-dispatch in your browser.](https://observablehq.com/collection/@d3/d3-dispatch) + +## API Reference + +# d3.dispatch(types…) · [Source](https://github.com/d3/d3-dispatch/blob/master/src/dispatch.js) + +Creates a new dispatch for the specified event *types*. Each *type* is a string, such as `"start"` or `"end"`. + +# *dispatch*.on(typenames[, callback]) · [Source](https://github.com/d3/d3-dispatch/blob/master/src/dispatch.js) + +Adds, removes or gets the *callback* for the specified *typenames*. If a *callback* function is specified, it is registered for the specified (fully-qualified) *typenames*. If a callback was already registered for the given *typenames*, the existing callback is removed before the new callback is added. + +The specified *typenames* is a string, such as `start` or `end.foo`. The type may be optionally followed by a period (`.`) and a name; the optional name allows multiple callbacks to be registered to receive events of the same type, such as `start.foo` and `start.bar`. To specify multiple typenames, separate typenames with spaces, such as `start end` or `start.foo start.bar`. + +To remove all callbacks for a given name `foo`, say `dispatch.on(".foo", null)`. + +If *callback* is not specified, returns the current callback for the specified *typenames*, if any. If multiple typenames are specified, the first matching callback is returned. + +# *dispatch*.copy() · [Source](https://github.com/d3/d3-dispatch/blob/master/src/dispatch.js) + +Returns a copy of this dispatch object. Changes to this dispatch do not affect the returned copy and vice versa. + +# *dispatch*.call(type[, that[, arguments…]]) · [Source](https://github.com/d3/d3-dispatch/blob/master/src/dispatch.js) + +Like [*function*.call](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call), invokes each registered callback for the specified *type*, passing the callback the specified *arguments*, with *that* as the `this` context. See [*dispatch*.apply](#dispatch_apply) for more information. + +# *dispatch*.apply(type[, that[, arguments]]) · [Source](https://github.com/d3/d3-dispatch/blob/master/src/dispatch.js) + +Like [*function*.apply](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call), invokes each registered callback for the specified *type*, passing the callback the specified *arguments*, with *that* as the `this` context. For example, if you wanted to dispatch your *custom* callbacks after handling a native *click* event, while preserving the current `this` context and arguments, you could say: + +```js +selection.on("click", function() { + dispatch.apply("custom", this, arguments); +}); +``` + +You can pass whatever arguments you want to callbacks; most commonly, you might create an object that represents an event, or pass the current datum (*d*) and index (*i*). See [function.call](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function/Call) and [function.apply](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function/Apply) for further information. diff --git a/node_modules/d3-dispatch/dist/d3-dispatch.js b/node_modules/d3-dispatch/dist/d3-dispatch.js new file mode 100644 index 0000000..178c7c9 --- /dev/null +++ b/node_modules/d3-dispatch/dist/d3-dispatch.js @@ -0,0 +1,95 @@ +// https://d3js.org/d3-dispatch/ v3.0.1 Copyright 2010-2021 Mike Bostock +(function (global, factory) { +typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : +typeof define === 'function' && define.amd ? define(['exports'], factory) : +(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.d3 = global.d3 || {})); +}(this, (function (exports) { 'use strict'; + +var noop = {value: () => {}}; + +function dispatch() { + for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) { + if (!(t = arguments[i] + "") || (t in _) || /[\s.]/.test(t)) throw new Error("illegal type: " + t); + _[t] = []; + } + return new Dispatch(_); +} + +function Dispatch(_) { + this._ = _; +} + +function parseTypenames(typenames, types) { + return typenames.trim().split(/^|\s+/).map(function(t) { + var name = "", i = t.indexOf("."); + if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i); + if (t && !types.hasOwnProperty(t)) throw new Error("unknown type: " + t); + return {type: t, name: name}; + }); +} + +Dispatch.prototype = dispatch.prototype = { + constructor: Dispatch, + on: function(typename, callback) { + var _ = this._, + T = parseTypenames(typename + "", _), + t, + i = -1, + n = T.length; + + // If no callback was specified, return the callback of the given type and name. + if (arguments.length < 2) { + while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t; + return; + } + + // If a type was specified, set the callback for the given type and name. + // Otherwise, if a null callback was specified, remove callbacks of the given name. + if (callback != null && typeof callback !== "function") throw new Error("invalid callback: " + callback); + while (++i < n) { + if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback); + else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null); + } + + return this; + }, + copy: function() { + var copy = {}, _ = this._; + for (var t in _) copy[t] = _[t].slice(); + return new Dispatch(copy); + }, + call: function(type, that) { + if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2]; + if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type); + for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args); + }, + apply: function(type, that, args) { + if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type); + for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args); + } +}; + +function get(type, name) { + for (var i = 0, n = type.length, c; i < n; ++i) { + if ((c = type[i]).name === name) { + return c.value; + } + } +} + +function set(type, name, callback) { + for (var i = 0, n = type.length; i < n; ++i) { + if (type[i].name === name) { + type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1)); + break; + } + } + if (callback != null) type.push({name: name, value: callback}); + return type; +} + +exports.dispatch = dispatch; + +Object.defineProperty(exports, '__esModule', { value: true }); + +}))); diff --git a/node_modules/d3-dispatch/dist/d3-dispatch.min.js b/node_modules/d3-dispatch/dist/d3-dispatch.min.js new file mode 100644 index 0000000..608d2f7 --- /dev/null +++ b/node_modules/d3-dispatch/dist/d3-dispatch.min.js @@ -0,0 +1,2 @@ +// https://d3js.org/d3-dispatch/ v3.0.1 Copyright 2010-2021 Mike Bostock +!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((n="undefined"!=typeof globalThis?globalThis:n||self).d3=n.d3||{})}(this,(function(n){"use strict";var e={value:()=>{}};function t(){for(var n,e=0,t=arguments.length,o={};e=0&&(t=n.slice(r+1),n=n.slice(0,r)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:t}}))}function i(n,e){for(var t,r=0,o=n.length;r0)for(var t,r,o=new Array(t),i=0;i=12" + } +} diff --git a/node_modules/d3-dispatch/src/dispatch.js b/node_modules/d3-dispatch/src/dispatch.js new file mode 100644 index 0000000..c93ac4f --- /dev/null +++ b/node_modules/d3-dispatch/src/dispatch.js @@ -0,0 +1,84 @@ +var noop = {value: () => {}}; + +function dispatch() { + for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) { + if (!(t = arguments[i] + "") || (t in _) || /[\s.]/.test(t)) throw new Error("illegal type: " + t); + _[t] = []; + } + return new Dispatch(_); +} + +function Dispatch(_) { + this._ = _; +} + +function parseTypenames(typenames, types) { + return typenames.trim().split(/^|\s+/).map(function(t) { + var name = "", i = t.indexOf("."); + if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i); + if (t && !types.hasOwnProperty(t)) throw new Error("unknown type: " + t); + return {type: t, name: name}; + }); +} + +Dispatch.prototype = dispatch.prototype = { + constructor: Dispatch, + on: function(typename, callback) { + var _ = this._, + T = parseTypenames(typename + "", _), + t, + i = -1, + n = T.length; + + // If no callback was specified, return the callback of the given type and name. + if (arguments.length < 2) { + while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t; + return; + } + + // If a type was specified, set the callback for the given type and name. + // Otherwise, if a null callback was specified, remove callbacks of the given name. + if (callback != null && typeof callback !== "function") throw new Error("invalid callback: " + callback); + while (++i < n) { + if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback); + else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null); + } + + return this; + }, + copy: function() { + var copy = {}, _ = this._; + for (var t in _) copy[t] = _[t].slice(); + return new Dispatch(copy); + }, + call: function(type, that) { + if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2]; + if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type); + for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args); + }, + apply: function(type, that, args) { + if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type); + for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args); + } +}; + +function get(type, name) { + for (var i = 0, n = type.length, c; i < n; ++i) { + if ((c = type[i]).name === name) { + return c.value; + } + } +} + +function set(type, name, callback) { + for (var i = 0, n = type.length; i < n; ++i) { + if (type[i].name === name) { + type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1)); + break; + } + } + if (callback != null) type.push({name: name, value: callback}); + return type; +} + +export default dispatch; diff --git a/node_modules/d3-dispatch/src/index.js b/node_modules/d3-dispatch/src/index.js new file mode 100644 index 0000000..4b8d3bd --- /dev/null +++ b/node_modules/d3-dispatch/src/index.js @@ -0,0 +1 @@ +export {default as dispatch} from "./dispatch.js"; diff --git a/node_modules/d3-drag/LICENSE b/node_modules/d3-drag/LICENSE new file mode 100644 index 0000000..b014515 --- /dev/null +++ b/node_modules/d3-drag/LICENSE @@ -0,0 +1,13 @@ +Copyright 2010-2021 Mike Bostock + +Permission to use, copy, modify, and/or distribute this software for any purpose +with or without fee is hereby granted, provided that the above copyright notice +and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. diff --git a/node_modules/d3-drag/README.md b/node_modules/d3-drag/README.md new file mode 100644 index 0000000..f0f4d7c --- /dev/null +++ b/node_modules/d3-drag/README.md @@ -0,0 +1,248 @@ +# d3-drag + +[Drag-and-drop](https://en.wikipedia.org/wiki/Drag_and_drop) is a popular and easy-to-learn pointing gesture: move the pointer to an object, press and hold to grab it, “drag” the object to a new location, and release to “drop”. D3’s [drag behavior](#api-reference) provides a convenient but flexible abstraction for enabling drag-and-drop interaction on [selections](https://github.com/d3/d3-selection). For example, you can use d3-drag to facilitate interaction with a [force-directed graph](https://github.com/d3/d3-force), or a simulation of colliding circles: + +[Force-Directed Graph](https://observablehq.com/@d3/force-directed-graph)[Force Dragging II](https://observablehq.com/d/c55a5839a5bb7c73) + +You can also use d3-drag to implement custom user interface elements, such as a slider. But the drag behavior isn’t just for moving elements around; there are a variety of ways to respond to a drag gesture. For example, you can use it to lasso elements in a scatterplot, or to paint lines on a canvas: + +[Line Drawing](https://observablehq.com/@d3/draw-me) + +The drag behavior can be combined with other behaviors, such as [d3-zoom](https://github.com/d3/d3-zoom) for zooming. + +[Drag & Zoom II](https://observablehq.com/@d3/drag-zoom) + +The drag behavior is agnostic about the DOM, so you can use it with SVG, HTML or even Canvas! And you can extend it with advanced selection techniques, such as a Voronoi overlay or a closest-target search: + +[Circle Dragging IV](https://observablehq.com/@d3/circle-dragging-iii)[Circle Dragging II](https://observablehq.com/@d3/circle-dragging-ii) + +Best of all, the drag behavior automatically unifies mouse and touch input, and avoids browser idiosyncrasies. When [Pointer Events](https://www.w3.org/TR/pointerevents/) are more widely available, the drag behavior will support those, too. + +## Installing + +If you use npm, `npm install d3-drag`. You can also download the [latest release on GitHub](https://github.com/d3/d3-drag/releases/latest). For vanilla HTML in modern browsers, import d3-drag from Skypack: + +```html + +``` + +For legacy environments, you can load d3-drag’s UMD bundle from an npm-based CDN such as jsDelivr; a `d3` global is exported: + +```html + + + + +``` + +[Try d3-drag in your browser.](https://observablehq.com/collection/@d3/d3-drag) + +## API Reference + +This table describes how the drag behavior interprets native events: + +| Event | Listening Element | Drag Event | Default Prevented? | +| ------------ | ----------------- | ---------- | ------------------ | +| mousedown⁵ | selection | start | no¹ | +| mousemove² | window¹ | drag | yes | +| mouseup² | window¹ | end | yes | +| dragstart² | window | - | yes | +| selectstart² | window | - | yes | +| click³ | window | - | yes | +| touchstart | selection | start | no⁴ | +| touchmove | selection | drag | yes | +| touchend | selection | end | no⁴ | +| touchcancel | selection | end | no⁴ | + +The propagation of all consumed events is [immediately stopped](https://dom.spec.whatwg.org/#dom-event-stopimmediatepropagation). If you want to prevent some events from initiating a drag gesture, use [*drag*.filter](#drag_filter). + +¹ Necessary to capture events outside an iframe; see [#9](https://github.com/d3/d3-drag/issues/9). +
² Only applies during an active, mouse-based gesture; see [#9](https://github.com/d3/d3-drag/issues/9). +
³ Only applies immediately after some mouse-based gestures; see [*drag*.clickDistance](#drag_clickDistance). +
⁴ Necessary to allow [click emulation](https://developer.apple.com/library/ios/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html#//apple_ref/doc/uid/TP40006511-SW7) on touch input; see [#9](https://github.com/d3/d3-drag/issues/9). +
⁵ Ignored if within 500ms of a touch gesture ending; assumes [click emulation](https://developer.apple.com/library/ios/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html#//apple_ref/doc/uid/TP40006511-SW7). + +# d3.drag() · [Source](https://github.com/d3/d3-drag/blob/master/src/drag.js), [Examples](https://observablehq.com/collection/@d3/d3-drag) + +Creates a new drag behavior. The returned behavior, [*drag*](#_drag), is both an object and a function, and is typically applied to selected elements via [*selection*.call](https://github.com/d3/d3-selection#selection_call). + +# drag(selection) · [Source](https://github.com/d3/d3-drag/blob/master/src/drag.js), [Examples](https://observablehq.com/collection/@d3/d3-drag) + +Applies this drag behavior to the specified [*selection*](https://github.com/d3/d3-selection). This function is typically not invoked directly, and is instead invoked via [*selection*.call](https://github.com/d3/d3-selection#selection_call). For example, to instantiate a drag behavior and apply it to a selection: + +```js +d3.selectAll(".node").call(d3.drag().on("start", started)); +``` + +Internally, the drag behavior uses [*selection*.on](https://github.com/d3/d3-selection#selection_on) to bind the necessary event listeners for dragging. The listeners use the name `.drag`, so you can subsequently unbind the drag behavior as follows: + +```js +selection.on(".drag", null); +``` + +Applying the drag behavior also sets the [-webkit-tap-highlight-color](https://developer.apple.com/library/mac/documentation/AppleApplications/Reference/SafariWebContent/AdjustingtheTextSize/AdjustingtheTextSize.html#//apple_ref/doc/uid/TP40006510-SW5) style to transparent, disabling the tap highlight on iOS. If you want a different tap highlight color, remove or re-apply this style after applying the drag behavior. + +# drag.container([container]) · [Source](https://github.com/d3/d3-drag/blob/master/src/drag.js), [Examples](https://observablehq.com/collection/@d3/d3-drag) + +If *container* is specified, sets the container accessor to the specified object or function and returns the drag behavior. If *container* is not specified, returns the current container accessor, which defaults to: + +```js +function container() { + return this.parentNode; +} +``` + +The *container* of a drag gesture determines the coordinate system of subsequent [drag events](#drag-events), affecting *event*.x and *event*.y. The element returned by the container accessor is subsequently passed to [d3.pointer](https://github.com/d3/d3-selection#pointer) to determine the local coordinates of the pointer. + +The default container accessor returns the parent node of the element in the originating selection (see [*drag*](#_drag)) that received the initiating input event. This is often appropriate when dragging SVG or HTML elements, since those elements are typically positioned relative to a parent. For dragging graphical elements with a Canvas, however, you may want to redefine the container as the initiating element itself: + +```js +function container() { + return this; +} +``` + +Alternatively, the container may be specified as the element directly, such as `drag.container(canvas)`. + + +# drag.filter([filter]) · [Source](https://github.com/d3/d3-drag/blob/master/src/drag.js), [Examples](https://observablehq.com/d/c55a5839a5bb7c73) + +If *filter* is specified, sets the event filter to the specified function and returns the drag behavior. If *filter* is not specified, returns the current filter, which defaults to: + +```js +function filter(event) { + return !event.ctrlKey && !event.button; +} +``` + +If the filter returns falsey, the initiating event is ignored and no drag gestures are started. Thus, the filter determines which input events are ignored; the default filter ignores mousedown events on secondary buttons, since those buttons are typically intended for other purposes, such as the context menu. + +# drag.touchable([touchable]) · [Source](https://github.com/d3/d3-drag/blob/master/src/drag.js), [Examples](https://observablehq.com/d/c55a5839a5bb7c73) + +If *touchable* is specified, sets the touch support detector to the specified function and returns the drag behavior. If *touchable* is not specified, returns the current touch support detector, which defaults to: + +```js +function touchable() { + return navigator.maxTouchPoints || ("ontouchstart" in this); +} +``` + +Touch event listeners are only registered if the detector returns truthy for the corresponding element when the drag behavior is [applied](#_drag). The default detector works well for most browsers that are capable of touch input, but not all; Chrome’s mobile device emulator, for example, fails detection. + +# drag.subject([subject]) · [Source](https://github.com/d3/d3-drag/blob/master/src/drag.js), [Examples](https://observablehq.com/collection/@d3/d3-drag) + +If *subject* is specified, sets the subject accessor to the specified object or function and returns the drag behavior. If *subject* is not specified, returns the current subject accessor, which defaults to: + +```js +function subject(event, d) { + return d == null ? {x: event.x, y: event.y} : d; +} +``` + +The *subject* of a drag gesture represents *the thing being dragged*. It is computed when an initiating input event is received, such as a mousedown or touchstart, immediately before the drag gesture starts. The subject is then exposed as *event*.subject on subsequent [drag events](#drag-events) for this gesture. + +The default subject is the [datum](https://github.com/d3/d3-selection#selection_datum) of the element in the originating selection (see [*drag*](#_drag)) that received the initiating input event; if this datum is undefined, an object representing the coordinates of the pointer is created. When dragging circle elements in SVG, the default subject is thus the datum of the circle being dragged. With [Canvas](https://html.spec.whatwg.org/multipage/scripting.html#the-canvas-element), the default subject is the canvas element’s datum (regardless of where on the canvas you click). In this case, a custom subject accessor would be more appropriate, such as one that picks the closest circle to the mouse within a given search *radius*: + +```js +function subject(event) { + let n = circles.length, + i, + dx, + dy, + d2, + s2 = radius * radius, + circle, + subject; + + for (i = 0; i < n; ++i) { + circle = circles[i]; + dx = event.x - circle.x; + dy = event.y - circle.y; + d2 = dx * dx + dy * dy; + if (d2 < s2) subject = circle, s2 = d2; + } + + return subject; +} +``` + +(If necessary, the above can be accelerated using [*quadtree*.find](https://github.com/d3/d3-quadtree/blob/master/README.md#quadtree_find), [*simulation*.find](https://github.com/d3/d3-force/blob/master/README.md#simulation_find) or [*delaunay*.find](https://github.com/d3/d3-delaunay/blob/master/README.md#delaunay_find).) + +The returned subject should be an object that exposes `x` and `y` properties, so that the relative position of the subject and the pointer can be preserved during the drag gesture. If the subject is null or undefined, no drag gesture is started for this pointer; however, other starting touches may yet start drag gestures. See also [*drag*.filter](#drag_filter). + +The subject of a drag gesture may not be changed after the gesture starts. The subject accessor is invoked with the same context and arguments as [*selection*.on](https://github.com/d3/d3-selection#selection_on) listeners: the current event (`event`) and datum `d`, with the `this` context as the current DOM element. During the evaluation of the subject accessor, `event` is a beforestart [drag event](#drag-events). Use *event*.sourceEvent to access the initiating input event and *event*.identifier to access the touch identifier. The *event*.x and *event*.y are relative to the [container](#drag_container), and are computed using [d3.pointer](https://github.com/d3/d3-selection#pointer). + +# drag.clickDistance([distance]) · [Source](https://github.com/d3/d3-drag/blob/master/src/drag.js) + +If *distance* is specified, sets the maximum distance that the mouse can move between mousedown and mouseup that will trigger a subsequent click event. If at any point between mousedown and mouseup the mouse is greater than or equal to *distance* from its position on mousedown, the click event following mouseup will be suppressed. If *distance* is not specified, returns the current distance threshold, which defaults to zero. The distance threshold is measured in client coordinates ([*event*.clientX](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/clientX) and [*event*.clientY](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/clientY)). + +# drag.on(typenames, [listener]) · [Source](https://github.com/d3/d3-drag/blob/master/src/drag.js) + +If *listener* is specified, sets the event *listener* for the specified *typenames* and returns the drag behavior. If an event listener was already registered for the same type and name, the existing listener is removed before the new listener is added. If *listener* is null, removes the current event listeners for the specified *typenames*, if any. If *listener* is not specified, returns the first currently-assigned listener matching the specified *typenames*, if any. When a specified event is dispatched, each *listener* will be invoked with the same context and arguments as [*selection*.on](https://github.com/d3/d3-selection#selection_on) listeners: the current event (`event`) and datum `d`, with the `this` context as the current DOM element. + +The *typenames* is a string containing one or more *typename* separated by whitespace. Each *typename* is a *type*, optionally followed by a period (`.`) and a *name*, such as `drag.foo` and `drag.bar`; the name allows multiple listeners to be registered for the same *type*. The *type* must be one of the following: + +* `start` - after a new pointer becomes active (on mousedown or touchstart). +* `drag` - after an active pointer moves (on mousemove or touchmove). +* `end` - after an active pointer becomes inactive (on mouseup, touchend or touchcancel). + +See [*dispatch*.on](https://github.com/d3/d3-dispatch#dispatch_on) for more. + +Changes to registered listeners via *drag*.on during a drag gesture *do not affect* the current drag gesture. Instead, you must use [*event*.on](#event_on), which also allows you to register temporary event listeners for the current drag gesture. **Separate events are dispatched for each active pointer** during a drag gesture. For example, if simultaneously dragging multiple subjects with multiple fingers, a start event is dispatched for each finger, even if both fingers start touching simultaneously. See [Drag Events](#drag-events) for more. + +# d3.dragDisable(window) · [Source](https://github.com/d3/d3-drag/blob/master/src/nodrag.js) + +Prevents native drag-and-drop and text selection on the specified *window*. As an alternative to preventing the default action of mousedown events (see [#9](https://github.com/d3/d3-drag/issues/9)), this method prevents undesirable default actions following mousedown. In supported browsers, this means capturing dragstart and selectstart events, preventing the associated default actions, and immediately stopping their propagation. In browsers that do not support selection events, the user-select CSS property is set to none on the document element. This method is intended to be called on mousedown, followed by [d3.dragEnable](#dragEnable) on mouseup. + +# d3.dragEnable(window[, noclick]) · [Source](https://github.com/d3/d3-drag/blob/master/src/nodrag.js) + +Allows native drag-and-drop and text selection on the specified *window*; undoes the effect of [d3.dragDisable](#dragDisable). This method is intended to be called on mouseup, preceded by [d3.dragDisable](#dragDisable) on mousedown. If *noclick* is true, this method also temporarily suppresses click events. The suppression of click events expires after a zero-millisecond timeout, such that it only suppress the click event that would immediately follow the current mouseup event, if any. + +### Drag Events + +When a [drag event listener](#drag_on) is invoked, it receives the current drag event as its first argument. The *event* object exposes several fields: + +* `target` - the associated [drag behavior](#drag). +* `type` - the string “start”, “drag” or “end”; see [*drag*.on](#drag_on). +* `subject` - the drag subject, defined by [*drag*.subject](#drag_subject). +* `x` - the new *x*-coordinate of the subject; see [*drag*.container](#drag_container). +* `y` - the new *y*-coordinate of the subject; see [*drag*.container](#drag_container). +* `dx` - the change in *x*-coordinate since the previous drag event. +* `dy` - the change in *y*-coordinate since the previous drag event. +* `identifier` - the string “mouse”, or a numeric [touch identifier](https://www.w3.org/TR/touch-events/#widl-Touch-identifier). +* `active` - the number of currently active drag gestures (on start and end, not including this one). +* `sourceEvent` - the underlying input event, such as mousemove or touchmove. + +The *event*.active field is useful for detecting the first start event and the last end event in a sequence of concurrent drag gestures: it is zero when the first drag gesture starts, and zero when the last drag gesture ends. + +The *event* object also exposes the [*event*.on](#event_on) method. + +# event.on(typenames, [listener]) · [Source](https://github.com/d3/d3-drag/blob/master/src/event.js) + +Equivalent to [*drag*.on](#drag_on), but only applies to the current drag gesture. Before the drag gesture starts, a [copy](https://github.com/d3/d3-dispatch#dispatch_copy) of the current drag [event listeners](#drag_on) is made. This copy is bound to the current drag gesture and modified by *event*.on. This is useful for temporary listeners that only receive events for the current drag gesture. For example, this start event listener registers temporary drag and end event listeners as closures: + +```js +function started(event) { + const circle = d3.select(this).classed("dragging", true); + + event.on("drag", dragged).on("end", ended); + + function dragged(event, d) { + circle.raise().attr("cx", d.x = event.x).attr("cy", d.y = event.y); + } + + function ended() { + circle.classed("dragging", false); + } +} +``` diff --git a/node_modules/d3-drag/dist/d3-drag.js b/node_modules/d3-drag/dist/d3-drag.js new file mode 100644 index 0000000..98cbbb9 --- /dev/null +++ b/node_modules/d3-drag/dist/d3-drag.js @@ -0,0 +1,273 @@ +// https://d3js.org/d3-drag/ v3.0.0 Copyright 2010-2021 Mike Bostock +(function (global, factory) { +typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-dispatch'), require('d3-selection')) : +typeof define === 'function' && define.amd ? define(['exports', 'd3-dispatch', 'd3-selection'], factory) : +(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.d3 = global.d3 || {}, global.d3, global.d3)); +}(this, (function (exports, d3Dispatch, d3Selection) { 'use strict'; + +// These are typically used in conjunction with noevent to ensure that we can +// preventDefault on the event. +const nonpassive = {passive: false}; +const nonpassivecapture = {capture: true, passive: false}; + +function nopropagation(event) { + event.stopImmediatePropagation(); +} + +function noevent(event) { + event.preventDefault(); + event.stopImmediatePropagation(); +} + +function nodrag(view) { + var root = view.document.documentElement, + selection = d3Selection.select(view).on("dragstart.drag", noevent, nonpassivecapture); + if ("onselectstart" in root) { + selection.on("selectstart.drag", noevent, nonpassivecapture); + } else { + root.__noselect = root.style.MozUserSelect; + root.style.MozUserSelect = "none"; + } +} + +function yesdrag(view, noclick) { + var root = view.document.documentElement, + selection = d3Selection.select(view).on("dragstart.drag", null); + if (noclick) { + selection.on("click.drag", noevent, nonpassivecapture); + setTimeout(function() { selection.on("click.drag", null); }, 0); + } + if ("onselectstart" in root) { + selection.on("selectstart.drag", null); + } else { + root.style.MozUserSelect = root.__noselect; + delete root.__noselect; + } +} + +var constant = x => () => x; + +function DragEvent(type, { + sourceEvent, + subject, + target, + identifier, + active, + x, y, dx, dy, + dispatch +}) { + Object.defineProperties(this, { + type: {value: type, enumerable: true, configurable: true}, + sourceEvent: {value: sourceEvent, enumerable: true, configurable: true}, + subject: {value: subject, enumerable: true, configurable: true}, + target: {value: target, enumerable: true, configurable: true}, + identifier: {value: identifier, enumerable: true, configurable: true}, + active: {value: active, enumerable: true, configurable: true}, + x: {value: x, enumerable: true, configurable: true}, + y: {value: y, enumerable: true, configurable: true}, + dx: {value: dx, enumerable: true, configurable: true}, + dy: {value: dy, enumerable: true, configurable: true}, + _: {value: dispatch} + }); +} + +DragEvent.prototype.on = function() { + var value = this._.on.apply(this._, arguments); + return value === this._ ? this : value; +}; + +// Ignore right-click, since that should open the context menu. +function defaultFilter(event) { + return !event.ctrlKey && !event.button; +} + +function defaultContainer() { + return this.parentNode; +} + +function defaultSubject(event, d) { + return d == null ? {x: event.x, y: event.y} : d; +} + +function defaultTouchable() { + return navigator.maxTouchPoints || ("ontouchstart" in this); +} + +function drag() { + var filter = defaultFilter, + container = defaultContainer, + subject = defaultSubject, + touchable = defaultTouchable, + gestures = {}, + listeners = d3Dispatch.dispatch("start", "drag", "end"), + active = 0, + mousedownx, + mousedowny, + mousemoving, + touchending, + clickDistance2 = 0; + + function drag(selection) { + selection + .on("mousedown.drag", mousedowned) + .filter(touchable) + .on("touchstart.drag", touchstarted) + .on("touchmove.drag", touchmoved, nonpassive) + .on("touchend.drag touchcancel.drag", touchended) + .style("touch-action", "none") + .style("-webkit-tap-highlight-color", "rgba(0,0,0,0)"); + } + + function mousedowned(event, d) { + if (touchending || !filter.call(this, event, d)) return; + var gesture = beforestart(this, container.call(this, event, d), event, d, "mouse"); + if (!gesture) return; + d3Selection.select(event.view) + .on("mousemove.drag", mousemoved, nonpassivecapture) + .on("mouseup.drag", mouseupped, nonpassivecapture); + nodrag(event.view); + nopropagation(event); + mousemoving = false; + mousedownx = event.clientX; + mousedowny = event.clientY; + gesture("start", event); + } + + function mousemoved(event) { + noevent(event); + if (!mousemoving) { + var dx = event.clientX - mousedownx, dy = event.clientY - mousedowny; + mousemoving = dx * dx + dy * dy > clickDistance2; + } + gestures.mouse("drag", event); + } + + function mouseupped(event) { + d3Selection.select(event.view).on("mousemove.drag mouseup.drag", null); + yesdrag(event.view, mousemoving); + noevent(event); + gestures.mouse("end", event); + } + + function touchstarted(event, d) { + if (!filter.call(this, event, d)) return; + var touches = event.changedTouches, + c = container.call(this, event, d), + n = touches.length, i, gesture; + + for (i = 0; i < n; ++i) { + if (gesture = beforestart(this, c, event, d, touches[i].identifier, touches[i])) { + nopropagation(event); + gesture("start", event, touches[i]); + } + } + } + + function touchmoved(event) { + var touches = event.changedTouches, + n = touches.length, i, gesture; + + for (i = 0; i < n; ++i) { + if (gesture = gestures[touches[i].identifier]) { + noevent(event); + gesture("drag", event, touches[i]); + } + } + } + + function touchended(event) { + var touches = event.changedTouches, + n = touches.length, i, gesture; + + if (touchending) clearTimeout(touchending); + touchending = setTimeout(function() { touchending = null; }, 500); // Ghost clicks are delayed! + for (i = 0; i < n; ++i) { + if (gesture = gestures[touches[i].identifier]) { + nopropagation(event); + gesture("end", event, touches[i]); + } + } + } + + function beforestart(that, container, event, d, identifier, touch) { + var dispatch = listeners.copy(), + p = d3Selection.pointer(touch || event, container), dx, dy, + s; + + if ((s = subject.call(that, new DragEvent("beforestart", { + sourceEvent: event, + target: drag, + identifier, + active, + x: p[0], + y: p[1], + dx: 0, + dy: 0, + dispatch + }), d)) == null) return; + + dx = s.x - p[0] || 0; + dy = s.y - p[1] || 0; + + return function gesture(type, event, touch) { + var p0 = p, n; + switch (type) { + case "start": gestures[identifier] = gesture, n = active++; break; + case "end": delete gestures[identifier], --active; // falls through + case "drag": p = d3Selection.pointer(touch || event, container), n = active; break; + } + dispatch.call( + type, + that, + new DragEvent(type, { + sourceEvent: event, + subject: s, + target: drag, + identifier, + active: n, + x: p[0] + dx, + y: p[1] + dy, + dx: p[0] - p0[0], + dy: p[1] - p0[1], + dispatch + }), + d + ); + }; + } + + drag.filter = function(_) { + return arguments.length ? (filter = typeof _ === "function" ? _ : constant(!!_), drag) : filter; + }; + + drag.container = function(_) { + return arguments.length ? (container = typeof _ === "function" ? _ : constant(_), drag) : container; + }; + + drag.subject = function(_) { + return arguments.length ? (subject = typeof _ === "function" ? _ : constant(_), drag) : subject; + }; + + drag.touchable = function(_) { + return arguments.length ? (touchable = typeof _ === "function" ? _ : constant(!!_), drag) : touchable; + }; + + drag.on = function() { + var value = listeners.on.apply(listeners, arguments); + return value === listeners ? drag : value; + }; + + drag.clickDistance = function(_) { + return arguments.length ? (clickDistance2 = (_ = +_) * _, drag) : Math.sqrt(clickDistance2); + }; + + return drag; +} + +exports.drag = drag; +exports.dragDisable = nodrag; +exports.dragEnable = yesdrag; + +Object.defineProperty(exports, '__esModule', { value: true }); + +}))); diff --git a/node_modules/d3-drag/dist/d3-drag.min.js b/node_modules/d3-drag/dist/d3-drag.min.js new file mode 100644 index 0000000..1c8bcc3 --- /dev/null +++ b/node_modules/d3-drag/dist/d3-drag.min.js @@ -0,0 +1,2 @@ +// https://d3js.org/d3-drag/ v3.0.0 Copyright 2010-2021 Mike Bostock +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("d3-dispatch"),require("d3-selection")):"function"==typeof define&&define.amd?define(["exports","d3-dispatch","d3-selection"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).d3=e.d3||{},e.d3,e.d3)}(this,(function(e,t,n){"use strict";const o={passive:!1},r={capture:!0,passive:!1};function i(e){e.stopImmediatePropagation()}function a(e){e.preventDefault(),e.stopImmediatePropagation()}function u(e){var t=e.document.documentElement,o=n.select(e).on("dragstart.drag",a,r);"onselectstart"in t?o.on("selectstart.drag",a,r):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function c(e,t){var o=e.document.documentElement,i=n.select(e).on("dragstart.drag",null);t&&(i.on("click.drag",a,r),setTimeout((function(){i.on("click.drag",null)}),0)),"onselectstart"in o?i.on("selectstart.drag",null):(o.style.MozUserSelect=o.__noselect,delete o.__noselect)}var l=e=>()=>e;function s(e,{sourceEvent:t,subject:n,target:o,identifier:r,active:i,x:a,y:u,dx:c,dy:l,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:s}})}function d(e){return!e.ctrlKey&&!e.button}function f(){return this.parentNode}function g(e,t){return null==t?{x:e.x,y:e.y}:t}function h(){return navigator.maxTouchPoints||"ontouchstart"in this}s.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e},e.drag=function(){var e,v,p,b,m=d,y=f,x=g,_=h,w={},T=t.dispatch("start","drag","end"),j=0,E=0;function k(e){e.on("mousedown.drag",M).filter(_).on("touchstart.drag",z).on("touchmove.drag",D,o).on("touchend.drag touchcancel.drag",S).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function M(t,o){if(!b&&m.call(this,t,o)){var a=U(this,y.call(this,t,o),t,o,"mouse");a&&(n.select(t.view).on("mousemove.drag",P,r).on("mouseup.drag",q,r),u(t.view),i(t),p=!1,e=t.clientX,v=t.clientY,a("start",t))}}function P(t){if(a(t),!p){var n=t.clientX-e,o=t.clientY-v;p=n*n+o*o>E}w.mouse("drag",t)}function q(e){n.select(e.view).on("mousemove.drag mouseup.drag",null),c(e.view,p),a(e),w.mouse("end",e)}function z(e,t){if(m.call(this,e,t)){var n,o,r=e.changedTouches,a=y.call(this,e,t),u=r.length;for(n=0;n=12" + } +} diff --git a/node_modules/d3-drag/src/constant.js b/node_modules/d3-drag/src/constant.js new file mode 100644 index 0000000..3487c0d --- /dev/null +++ b/node_modules/d3-drag/src/constant.js @@ -0,0 +1 @@ +export default x => () => x; diff --git a/node_modules/d3-drag/src/drag.js b/node_modules/d3-drag/src/drag.js new file mode 100644 index 0000000..790d9c7 --- /dev/null +++ b/node_modules/d3-drag/src/drag.js @@ -0,0 +1,194 @@ +import {dispatch} from "d3-dispatch"; +import {select, pointer} from "d3-selection"; +import nodrag, {yesdrag} from "./nodrag.js"; +import noevent, {nonpassive, nonpassivecapture, nopropagation} from "./noevent.js"; +import constant from "./constant.js"; +import DragEvent from "./event.js"; + +// Ignore right-click, since that should open the context menu. +function defaultFilter(event) { + return !event.ctrlKey && !event.button; +} + +function defaultContainer() { + return this.parentNode; +} + +function defaultSubject(event, d) { + return d == null ? {x: event.x, y: event.y} : d; +} + +function defaultTouchable() { + return navigator.maxTouchPoints || ("ontouchstart" in this); +} + +export default function() { + var filter = defaultFilter, + container = defaultContainer, + subject = defaultSubject, + touchable = defaultTouchable, + gestures = {}, + listeners = dispatch("start", "drag", "end"), + active = 0, + mousedownx, + mousedowny, + mousemoving, + touchending, + clickDistance2 = 0; + + function drag(selection) { + selection + .on("mousedown.drag", mousedowned) + .filter(touchable) + .on("touchstart.drag", touchstarted) + .on("touchmove.drag", touchmoved, nonpassive) + .on("touchend.drag touchcancel.drag", touchended) + .style("touch-action", "none") + .style("-webkit-tap-highlight-color", "rgba(0,0,0,0)"); + } + + function mousedowned(event, d) { + if (touchending || !filter.call(this, event, d)) return; + var gesture = beforestart(this, container.call(this, event, d), event, d, "mouse"); + if (!gesture) return; + select(event.view) + .on("mousemove.drag", mousemoved, nonpassivecapture) + .on("mouseup.drag", mouseupped, nonpassivecapture); + nodrag(event.view); + nopropagation(event); + mousemoving = false; + mousedownx = event.clientX; + mousedowny = event.clientY; + gesture("start", event); + } + + function mousemoved(event) { + noevent(event); + if (!mousemoving) { + var dx = event.clientX - mousedownx, dy = event.clientY - mousedowny; + mousemoving = dx * dx + dy * dy > clickDistance2; + } + gestures.mouse("drag", event); + } + + function mouseupped(event) { + select(event.view).on("mousemove.drag mouseup.drag", null); + yesdrag(event.view, mousemoving); + noevent(event); + gestures.mouse("end", event); + } + + function touchstarted(event, d) { + if (!filter.call(this, event, d)) return; + var touches = event.changedTouches, + c = container.call(this, event, d), + n = touches.length, i, gesture; + + for (i = 0; i < n; ++i) { + if (gesture = beforestart(this, c, event, d, touches[i].identifier, touches[i])) { + nopropagation(event); + gesture("start", event, touches[i]); + } + } + } + + function touchmoved(event) { + var touches = event.changedTouches, + n = touches.length, i, gesture; + + for (i = 0; i < n; ++i) { + if (gesture = gestures[touches[i].identifier]) { + noevent(event); + gesture("drag", event, touches[i]); + } + } + } + + function touchended(event) { + var touches = event.changedTouches, + n = touches.length, i, gesture; + + if (touchending) clearTimeout(touchending); + touchending = setTimeout(function() { touchending = null; }, 500); // Ghost clicks are delayed! + for (i = 0; i < n; ++i) { + if (gesture = gestures[touches[i].identifier]) { + nopropagation(event); + gesture("end", event, touches[i]); + } + } + } + + function beforestart(that, container, event, d, identifier, touch) { + var dispatch = listeners.copy(), + p = pointer(touch || event, container), dx, dy, + s; + + if ((s = subject.call(that, new DragEvent("beforestart", { + sourceEvent: event, + target: drag, + identifier, + active, + x: p[0], + y: p[1], + dx: 0, + dy: 0, + dispatch + }), d)) == null) return; + + dx = s.x - p[0] || 0; + dy = s.y - p[1] || 0; + + return function gesture(type, event, touch) { + var p0 = p, n; + switch (type) { + case "start": gestures[identifier] = gesture, n = active++; break; + case "end": delete gestures[identifier], --active; // falls through + case "drag": p = pointer(touch || event, container), n = active; break; + } + dispatch.call( + type, + that, + new DragEvent(type, { + sourceEvent: event, + subject: s, + target: drag, + identifier, + active: n, + x: p[0] + dx, + y: p[1] + dy, + dx: p[0] - p0[0], + dy: p[1] - p0[1], + dispatch + }), + d + ); + }; + } + + drag.filter = function(_) { + return arguments.length ? (filter = typeof _ === "function" ? _ : constant(!!_), drag) : filter; + }; + + drag.container = function(_) { + return arguments.length ? (container = typeof _ === "function" ? _ : constant(_), drag) : container; + }; + + drag.subject = function(_) { + return arguments.length ? (subject = typeof _ === "function" ? _ : constant(_), drag) : subject; + }; + + drag.touchable = function(_) { + return arguments.length ? (touchable = typeof _ === "function" ? _ : constant(!!_), drag) : touchable; + }; + + drag.on = function() { + var value = listeners.on.apply(listeners, arguments); + return value === listeners ? drag : value; + }; + + drag.clickDistance = function(_) { + return arguments.length ? (clickDistance2 = (_ = +_) * _, drag) : Math.sqrt(clickDistance2); + }; + + return drag; +} diff --git a/node_modules/d3-drag/src/event.js b/node_modules/d3-drag/src/event.js new file mode 100644 index 0000000..5f246fe --- /dev/null +++ b/node_modules/d3-drag/src/event.js @@ -0,0 +1,28 @@ +export default function DragEvent(type, { + sourceEvent, + subject, + target, + identifier, + active, + x, y, dx, dy, + dispatch +}) { + Object.defineProperties(this, { + type: {value: type, enumerable: true, configurable: true}, + sourceEvent: {value: sourceEvent, enumerable: true, configurable: true}, + subject: {value: subject, enumerable: true, configurable: true}, + target: {value: target, enumerable: true, configurable: true}, + identifier: {value: identifier, enumerable: true, configurable: true}, + active: {value: active, enumerable: true, configurable: true}, + x: {value: x, enumerable: true, configurable: true}, + y: {value: y, enumerable: true, configurable: true}, + dx: {value: dx, enumerable: true, configurable: true}, + dy: {value: dy, enumerable: true, configurable: true}, + _: {value: dispatch} + }); +} + +DragEvent.prototype.on = function() { + var value = this._.on.apply(this._, arguments); + return value === this._ ? this : value; +}; diff --git a/node_modules/d3-drag/src/index.js b/node_modules/d3-drag/src/index.js new file mode 100644 index 0000000..d2dd601 --- /dev/null +++ b/node_modules/d3-drag/src/index.js @@ -0,0 +1,2 @@ +export {default as drag} from "./drag.js"; +export {default as dragDisable, yesdrag as dragEnable} from "./nodrag.js"; diff --git a/node_modules/d3-drag/src/nodrag.js b/node_modules/d3-drag/src/nodrag.js new file mode 100644 index 0000000..6076694 --- /dev/null +++ b/node_modules/d3-drag/src/nodrag.js @@ -0,0 +1,28 @@ +import {select} from "d3-selection"; +import noevent, {nonpassivecapture} from "./noevent.js"; + +export default function(view) { + var root = view.document.documentElement, + selection = select(view).on("dragstart.drag", noevent, nonpassivecapture); + if ("onselectstart" in root) { + selection.on("selectstart.drag", noevent, nonpassivecapture); + } else { + root.__noselect = root.style.MozUserSelect; + root.style.MozUserSelect = "none"; + } +} + +export function yesdrag(view, noclick) { + var root = view.document.documentElement, + selection = select(view).on("dragstart.drag", null); + if (noclick) { + selection.on("click.drag", noevent, nonpassivecapture); + setTimeout(function() { selection.on("click.drag", null); }, 0); + } + if ("onselectstart" in root) { + selection.on("selectstart.drag", null); + } else { + root.style.MozUserSelect = root.__noselect; + delete root.__noselect; + } +} diff --git a/node_modules/d3-drag/src/noevent.js b/node_modules/d3-drag/src/noevent.js new file mode 100644 index 0000000..173c250 --- /dev/null +++ b/node_modules/d3-drag/src/noevent.js @@ -0,0 +1,13 @@ +// These are typically used in conjunction with noevent to ensure that we can +// preventDefault on the event. +export const nonpassive = {passive: false}; +export const nonpassivecapture = {capture: true, passive: false}; + +export function nopropagation(event) { + event.stopImmediatePropagation(); +} + +export default function(event) { + event.preventDefault(); + event.stopImmediatePropagation(); +} diff --git a/node_modules/d3-ease/LICENSE b/node_modules/d3-ease/LICENSE new file mode 100644 index 0000000..83cc997 --- /dev/null +++ b/node_modules/d3-ease/LICENSE @@ -0,0 +1,28 @@ +Copyright 2010-2021 Mike Bostock +Copyright 2001 Robert Penner +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the author nor the names of contributors may be used to + endorse or promote products derived from this software without specific prior + written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/d3-ease/README.md b/node_modules/d3-ease/README.md new file mode 100644 index 0000000..cc6ca79 --- /dev/null +++ b/node_modules/d3-ease/README.md @@ -0,0 +1,253 @@ +# d3-ease + +*Easing* is a method of distorting time to control apparent motion in animation. It is most commonly used for [slow-in, slow-out](https://en.wikipedia.org/wiki/12_basic_principles_of_animation#Slow_In_and_Slow_Out). By easing time, [animated transitions](https://github.com/d3/d3-transition) are smoother and exhibit more plausible motion. + +The easing types in this module implement the [ease method](#ease_ease), which takes a normalized time *t* and returns the corresponding “eased” time *tʹ*. Both the normalized time and the eased time are typically in the range [0,1], where 0 represents the start of the animation and 1 represents the end; some easing types, such as [elastic](#easeElastic), may return eased times slightly outside this range. A good easing type should return 0 if *t* = 0 and 1 if *t* = 1. See the [easing explorer](https://observablehq.com/@d3/easing) for a visual demonstration. + +These easing types are largely based on work by [Robert Penner](http://robertpenner.com/easing/). + +## Installing + +If you use npm, `npm install d3-ease`. You can also download the [latest release on GitHub](https://github.com/d3/d3-ease/releases/latest). For vanilla HTML in modern browsers, import d3-ease from Skypack: + +```html + +``` + +For legacy environments, you can load d3-ease’s UMD bundle from an npm-based CDN such as jsDelivr; a `d3` global is exported: + +```html + + +``` + +[Try d3-ease in your browser.](https://observablehq.com/@d3/easing-animations) + +## API Reference + +# ease(t) + +Given the specified normalized time *t*, typically in the range [0,1], returns the “eased” time *tʹ*, also typically in [0,1]. 0 represents the start of the animation and 1 represents the end. A good implementation returns 0 if *t* = 0 and 1 if *t* = 1. See the [easing explorer](https://observablehq.com/@d3/easing) for a visual demonstration. For example, to apply [cubic](#easeCubic) easing: + +```js +const te = d3.easeCubic(t); +``` + +Similarly, to apply custom [elastic](#easeElastic) easing: + +```js +// Before the animation starts, create your easing function. +const customElastic = d3.easeElastic.period(0.4); + +// During the animation, apply the easing function. +const te = customElastic(t); +``` + +# d3.easeLinear(t) [<>](https://github.com/d3/d3-ease/blob/master/src/linear.js "Source") + +Linear easing; the identity function; *linear*(*t*) returns *t*. + +[linear](https://observablehq.com/@d3/easing#linear) + +# d3.easePolyIn(t) [<>](https://github.com/d3/d3-ease/blob/master/src/poly.js#L3 "Source") + +Polynomial easing; raises *t* to the specified [exponent](#poly_exponent). If the exponent is not specified, it defaults to 3, equivalent to [cubicIn](#easeCubicIn). + +[polyIn](https://observablehq.com/@d3/easing#polyIn) + +# d3.easePolyOut(t) [<>](https://github.com/d3/d3-ease/blob/master/src/poly.js#L15 "Source") + +Reverse polynomial easing; equivalent to 1 - [polyIn](#easePolyIn)(1 - *t*). If the [exponent](#poly_exponent) is not specified, it defaults to 3, equivalent to [cubicOut](#easeCubicOut). + +[polyOut](https://observablehq.com/@d3/easing#polyOut) + +# d3.easePoly(t) [<>](https://github.com/d3/d3-ease/blob/master/src/poly.js "Source") +
# d3.easePolyInOut(t) [<>](https://github.com/d3/d3-ease/blob/master/src/poly.js#L27 "Source") + +Symmetric polynomial easing; scales [polyIn](#easePolyIn) for *t* in [0, 0.5] and [polyOut](#easePolyOut) for *t* in [0.5, 1]. If the [exponent](#poly_exponent) is not specified, it defaults to 3, equivalent to [cubic](#easeCubic). + +[polyInOut](https://observablehq.com/@d3/easing#polyInOut) + +# poly.exponent(e) [<>](https://github.com/d3/d3-ease/blob/master/src/poly.js#L1 "Source") + +Returns a new polynomial easing with the specified exponent *e*. For example, to create equivalents of [linear](#easeLinear), [quad](#easeQuad), and [cubic](#easeCubic): + +```js +const linear = d3.easePoly.exponent(1); +const quad = d3.easePoly.exponent(2); +const cubic = d3.easePoly.exponent(3); +``` + +# d3.easeQuadIn(t) [<>](https://github.com/d3/d3-ease/blob/master/src/quad.js#L1 "Source") + +Quadratic easing; equivalent to [polyIn](#easePolyIn).[exponent](#poly_exponent)(2). + +[quadIn](https://observablehq.com/@d3/easing#quadIn) + +# d3.easeQuadOut(t) [<>](https://github.com/d3/d3-ease/blob/master/src/quad.js#L5 "Source") + +Reverse quadratic easing; equivalent to 1 - [quadIn](#easeQuadIn)(1 - *t*). Also equivalent to [polyOut](#easePolyOut).[exponent](#poly_exponent)(2). + +[quadOut](https://observablehq.com/@d3/easing#quadOut) + +# d3.easeQuad(t) [<>](https://github.com/d3/d3-ease/blob/master/src/quad.js "Source") +
# d3.easeQuadInOut(t) [<>](https://github.com/d3/d3-ease/blob/master/src/quad.js#L9 "Source") + +Symmetric quadratic easing; scales [quadIn](#easeQuadIn) for *t* in [0, 0.5] and [quadOut](#easeQuadOut) for *t* in [0.5, 1]. Also equivalent to [poly](#easePoly).[exponent](#poly_exponent)(2). + +[quadInOut](https://observablehq.com/@d3/easing#quadInOut) + +# d3.easeCubicIn(t) [<>](https://github.com/d3/d3-ease/blob/master/src/cubic.js#L1 "Source") + +Cubic easing; equivalent to [polyIn](#easePolyIn).[exponent](#poly_exponent)(3). + +[cubicIn](https://observablehq.com/@d3/easing#cubicIn) + +# d3.easeCubicOut(t) [<>](https://github.com/d3/d3-ease/blob/master/src/cubic.js#L5 "Source") + +Reverse cubic easing; equivalent to 1 - [cubicIn](#easeCubicIn)(1 - *t*). Also equivalent to [polyOut](#easePolyOut).[exponent](#poly_exponent)(3). + +[cubicOut](https://observablehq.com/@d3/easing#cubicOut) + +# d3.easeCubic(t) [<>](https://github.com/d3/d3-ease/blob/master/src/cubic.js "Source") +
# d3.easeCubicInOut(t) [<>](https://github.com/d3/d3-ease/blob/master/src/cubic.js#L9 "Source") + +Symmetric cubic easing; scales [cubicIn](#easeCubicIn) for *t* in [0, 0.5] and [cubicOut](#easeCubicOut) for *t* in [0.5, 1]. Also equivalent to [poly](#easePoly).[exponent](#poly_exponent)(3). + +[cubicInOut](https://observablehq.com/@d3/easing#cubicInOut) + +# d3.easeSinIn(t) [<>](https://github.com/d3/d3-ease/blob/master/src/sin.js#L4 "Source") + +Sinusoidal easing; returns sin(*t*). + +[sinIn](https://observablehq.com/@d3/easing#sinIn) + +# d3.easeSinOut(t) [<>](https://github.com/d3/d3-ease/blob/master/src/sin.js#L8 "Source") + +Reverse sinusoidal easing; equivalent to 1 - [sinIn](#easeSinIn)(1 - *t*). + +[sinOut](https://observablehq.com/@d3/easing#sinOut) + +# d3.easeSin(t) [<>](https://github.com/d3/d3-ease/blob/master/src/sin.js "Source") +
# d3.easeSinInOut(t) [<>](https://github.com/d3/d3-ease/blob/master/src/sin.js#L12 "Source") + +Symmetric sinusoidal easing; scales [sinIn](#easeSinIn) for *t* in [0, 0.5] and [sinOut](#easeSinOut) for *t* in [0.5, 1]. + +[sinInOut](https://observablehq.com/@d3/easing#sinInOut) + +# d3.easeExpIn(t) [<>](https://github.com/d3/d3-ease/blob/master/src/exp.js#L1 "Source") + +Exponential easing; raises 2 to the exponent 10 \* (*t* - 1). + +[expIn](https://observablehq.com/@d3/easing#expIn) + +# d3.easeExpOut(t) [<>](https://github.com/d3/d3-ease/blob/master/src/exp.js#L5 "Source") + +Reverse exponential easing; equivalent to 1 - [expIn](#easeExpIn)(1 - *t*). + +[expOut](https://observablehq.com/@d3/easing#expOut) + +# d3.easeExp(t) [<>](https://github.com/d3/d3-ease/blob/master/src/exp.js "Source") +
# d3.easeExpInOut(t) [<>](https://github.com/d3/d3-ease/blob/master/src/exp.js#L9 "Source") + +Symmetric exponential easing; scales [expIn](#easeExpIn) for *t* in [0, 0.5] and [expOut](#easeExpOut) for *t* in [0.5, 1]. + +[expInOut](https://observablehq.com/@d3/easing#expInOut) + +# d3.easeCircleIn(t) [<>](https://github.com/d3/d3-ease/blob/master/src/circle.js#L1 "Source") + +Circular easing. + +[circleIn](https://observablehq.com/@d3/easing#circleIn) + +# d3.easeCircleOut(t) [<>](https://github.com/d3/d3-ease/blob/master/src/circle.js#L5 "Source") + +Reverse circular easing; equivalent to 1 - [circleIn](#easeCircleIn)(1 - *t*). + +[circleOut](https://observablehq.com/@d3/easing#circleOut) + +# d3.easeCircle(t) [<>](https://github.com/d3/d3-ease/blob/master/src/circle.js "Source") +
# d3.easeCircleInOut(t) [<>](https://github.com/d3/d3-ease/blob/master/src/circle.js#L9 "Source") + +Symmetric circular easing; scales [circleIn](#easeCircleIn) for *t* in [0, 0.5] and [circleOut](#easeCircleOut) for *t* in [0.5, 1]. + +[circleInOut](https://observablehq.com/@d3/easing#circleInOut) + +# d3.easeElasticIn(t) [<>](https://github.com/d3/d3-ease/blob/master/src/elastic.js#L5 "Source") + +Elastic easing, like a rubber band. The [amplitude](#elastic_amplitude) and [period](#elastic_period) of the oscillation are configurable; if not specified, they default to 1 and 0.3, respectively. + +[elasticIn](https://observablehq.com/@d3/easing#elasticIn) + +# d3.easeElastic(t) [<>](https://github.com/d3/d3-ease/blob/master/src/elastic.js "Source") +
# d3.easeElasticOut(t) [<>](https://github.com/d3/d3-ease/blob/master/src/elastic.js#L18 "Source") + +Reverse elastic easing; equivalent to 1 - [elasticIn](#easeElasticIn)(1 - *t*). + +[elasticOut](https://observablehq.com/@d3/easing#elasticOut) + +# d3.easeElasticInOut(t) [<>](https://github.com/d3/d3-ease/blob/master/src/elastic.js#L31 "Source") + +Symmetric elastic easing; scales [elasticIn](#easeElasticIn) for *t* in [0, 0.5] and [elasticOut](#easeElasticOut) for *t* in [0.5, 1]. + +[elasticInOut](https://observablehq.com/@d3/easing#elasticInOut) + +# elastic.amplitude(a) [<>](https://github.com/d3/d3-ease/blob/master/src/elastic.js#L40 "Source") + +Returns a new elastic easing with the specified amplitude *a*. + +# elastic.period(p) [<>](https://github.com/d3/d3-ease/blob/master/src/elastic.js#L41 "Source") + +Returns a new elastic easing with the specified period *p*. + +# d3.easeBackIn(t) [<>](https://github.com/d3/d3-ease/blob/master/src/back.js#L3 "Source") + +[Anticipatory](https://en.wikipedia.org/wiki/12_basic_principles_of_animation#Anticipation) easing, like a dancer bending his knees before jumping off the floor. The degree of [overshoot](#back_overshoot) is configurable; if not specified, it defaults to 1.70158. + +[backIn](https://observablehq.com/@d3/easing#backIn) + +# d3.easeBackOut(t) [<>](https://github.com/d3/d3-ease/blob/master/src/back.js#L15 "Source") + +Reverse anticipatory easing; equivalent to 1 - [backIn](#easeBackIn)(1 - *t*). + +[backOut](https://observablehq.com/@d3/easing#backOut) + +# d3.easeBack(t) [<>](https://github.com/d3/d3-ease/blob/master/src/back.js "Source") +
# d3.easeBackInOut(t) [<>](https://github.com/d3/d3-ease/blob/master/src/back.js#L27 "Source") + +Symmetric anticipatory easing; scales [backIn](#easeBackIn) for *t* in [0, 0.5] and [backOut](#easeBackOut) for *t* in [0.5, 1]. + +[backInOut](https://observablehq.com/@d3/easing#backInOut) + +# back.overshoot(s) [<>](https://github.com/d3/d3-ease/blob/master/src/back.js#L1 "Source") + +Returns a new back easing with the specified overshoot *s*. + +# d3.easeBounceIn(t) [<>](https://github.com/d3/d3-ease/blob/master/src/bounce.js#L12 "Source") + +Bounce easing, like a rubber ball. + +[bounceIn](https://observablehq.com/@d3/easing#bounceIn) + +# d3.easeBounce(t) [<>](https://github.com/d3/d3-ease/blob/master/src/bounce.js "Source") +
# d3.easeBounceOut(t) [<>](https://github.com/d3/d3-ease/blob/master/src/bounce.js#L16 "Source") + +Reverse bounce easing; equivalent to 1 - [bounceIn](#easeBounceIn)(1 - *t*). + +[bounceOut](https://observablehq.com/@d3/easing#bounceOut) + +# d3.easeBounceInOut(t) [<>](https://github.com/d3/d3-ease/blob/master/src/bounce.js#L20 "Source") + +Symmetric bounce easing; scales [bounceIn](#easeBounceIn) for *t* in [0, 0.5] and [bounceOut](#easeBounceOut) for *t* in [0.5, 1]. + +[bounceInOut](https://observablehq.com/@d3/easing#bounceInOut) diff --git a/node_modules/d3-ease/dist/d3-ease.js b/node_modules/d3-ease/dist/d3-ease.js new file mode 100644 index 0000000..8e5e545 --- /dev/null +++ b/node_modules/d3-ease/dist/d3-ease.js @@ -0,0 +1,262 @@ +// https://d3js.org/d3-ease/ v3.0.1 Copyright 2010-2021 Mike Bostock, 2001 Robert Penner +(function (global, factory) { +typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : +typeof define === 'function' && define.amd ? define(['exports'], factory) : +(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.d3 = global.d3 || {})); +}(this, (function (exports) { 'use strict'; + +const linear = t => +t; + +function quadIn(t) { + return t * t; +} + +function quadOut(t) { + return t * (2 - t); +} + +function quadInOut(t) { + return ((t *= 2) <= 1 ? t * t : --t * (2 - t) + 1) / 2; +} + +function cubicIn(t) { + return t * t * t; +} + +function cubicOut(t) { + return --t * t * t + 1; +} + +function cubicInOut(t) { + return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; +} + +var exponent = 3; + +var polyIn = (function custom(e) { + e = +e; + + function polyIn(t) { + return Math.pow(t, e); + } + + polyIn.exponent = custom; + + return polyIn; +})(exponent); + +var polyOut = (function custom(e) { + e = +e; + + function polyOut(t) { + return 1 - Math.pow(1 - t, e); + } + + polyOut.exponent = custom; + + return polyOut; +})(exponent); + +var polyInOut = (function custom(e) { + e = +e; + + function polyInOut(t) { + return ((t *= 2) <= 1 ? Math.pow(t, e) : 2 - Math.pow(2 - t, e)) / 2; + } + + polyInOut.exponent = custom; + + return polyInOut; +})(exponent); + +var pi = Math.PI, + halfPi = pi / 2; + +function sinIn(t) { + return (+t === 1) ? 1 : 1 - Math.cos(t * halfPi); +} + +function sinOut(t) { + return Math.sin(t * halfPi); +} + +function sinInOut(t) { + return (1 - Math.cos(pi * t)) / 2; +} + +// tpmt is two power minus ten times t scaled to [0,1] +function tpmt(x) { + return (Math.pow(2, -10 * x) - 0.0009765625) * 1.0009775171065494; +} + +function expIn(t) { + return tpmt(1 - +t); +} + +function expOut(t) { + return 1 - tpmt(t); +} + +function expInOut(t) { + return ((t *= 2) <= 1 ? tpmt(1 - t) : 2 - tpmt(t - 1)) / 2; +} + +function circleIn(t) { + return 1 - Math.sqrt(1 - t * t); +} + +function circleOut(t) { + return Math.sqrt(1 - --t * t); +} + +function circleInOut(t) { + return ((t *= 2) <= 1 ? 1 - Math.sqrt(1 - t * t) : Math.sqrt(1 - (t -= 2) * t) + 1) / 2; +} + +var b1 = 4 / 11, + b2 = 6 / 11, + b3 = 8 / 11, + b4 = 3 / 4, + b5 = 9 / 11, + b6 = 10 / 11, + b7 = 15 / 16, + b8 = 21 / 22, + b9 = 63 / 64, + b0 = 1 / b1 / b1; + +function bounceIn(t) { + return 1 - bounceOut(1 - t); +} + +function bounceOut(t) { + return (t = +t) < b1 ? b0 * t * t : t < b3 ? b0 * (t -= b2) * t + b4 : t < b6 ? b0 * (t -= b5) * t + b7 : b0 * (t -= b8) * t + b9; +} + +function bounceInOut(t) { + return ((t *= 2) <= 1 ? 1 - bounceOut(1 - t) : bounceOut(t - 1) + 1) / 2; +} + +var overshoot = 1.70158; + +var backIn = (function custom(s) { + s = +s; + + function backIn(t) { + return (t = +t) * t * (s * (t - 1) + t); + } + + backIn.overshoot = custom; + + return backIn; +})(overshoot); + +var backOut = (function custom(s) { + s = +s; + + function backOut(t) { + return --t * t * ((t + 1) * s + t) + 1; + } + + backOut.overshoot = custom; + + return backOut; +})(overshoot); + +var backInOut = (function custom(s) { + s = +s; + + function backInOut(t) { + return ((t *= 2) < 1 ? t * t * ((s + 1) * t - s) : (t -= 2) * t * ((s + 1) * t + s) + 2) / 2; + } + + backInOut.overshoot = custom; + + return backInOut; +})(overshoot); + +var tau = 2 * Math.PI, + amplitude = 1, + period = 0.3; + +var elasticIn = (function custom(a, p) { + var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau); + + function elasticIn(t) { + return a * tpmt(-(--t)) * Math.sin((s - t) / p); + } + + elasticIn.amplitude = function(a) { return custom(a, p * tau); }; + elasticIn.period = function(p) { return custom(a, p); }; + + return elasticIn; +})(amplitude, period); + +var elasticOut = (function custom(a, p) { + var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau); + + function elasticOut(t) { + return 1 - a * tpmt(t = +t) * Math.sin((t + s) / p); + } + + elasticOut.amplitude = function(a) { return custom(a, p * tau); }; + elasticOut.period = function(p) { return custom(a, p); }; + + return elasticOut; +})(amplitude, period); + +var elasticInOut = (function custom(a, p) { + var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau); + + function elasticInOut(t) { + return ((t = t * 2 - 1) < 0 + ? a * tpmt(-t) * Math.sin((s - t) / p) + : 2 - a * tpmt(t) * Math.sin((s + t) / p)) / 2; + } + + elasticInOut.amplitude = function(a) { return custom(a, p * tau); }; + elasticInOut.period = function(p) { return custom(a, p); }; + + return elasticInOut; +})(amplitude, period); + +exports.easeBack = backInOut; +exports.easeBackIn = backIn; +exports.easeBackInOut = backInOut; +exports.easeBackOut = backOut; +exports.easeBounce = bounceOut; +exports.easeBounceIn = bounceIn; +exports.easeBounceInOut = bounceInOut; +exports.easeBounceOut = bounceOut; +exports.easeCircle = circleInOut; +exports.easeCircleIn = circleIn; +exports.easeCircleInOut = circleInOut; +exports.easeCircleOut = circleOut; +exports.easeCubic = cubicInOut; +exports.easeCubicIn = cubicIn; +exports.easeCubicInOut = cubicInOut; +exports.easeCubicOut = cubicOut; +exports.easeElastic = elasticOut; +exports.easeElasticIn = elasticIn; +exports.easeElasticInOut = elasticInOut; +exports.easeElasticOut = elasticOut; +exports.easeExp = expInOut; +exports.easeExpIn = expIn; +exports.easeExpInOut = expInOut; +exports.easeExpOut = expOut; +exports.easeLinear = linear; +exports.easePoly = polyInOut; +exports.easePolyIn = polyIn; +exports.easePolyInOut = polyInOut; +exports.easePolyOut = polyOut; +exports.easeQuad = quadInOut; +exports.easeQuadIn = quadIn; +exports.easeQuadInOut = quadInOut; +exports.easeQuadOut = quadOut; +exports.easeSin = sinInOut; +exports.easeSinIn = sinIn; +exports.easeSinInOut = sinInOut; +exports.easeSinOut = sinOut; + +Object.defineProperty(exports, '__esModule', { value: true }); + +}))); diff --git a/node_modules/d3-ease/dist/d3-ease.min.js b/node_modules/d3-ease/dist/d3-ease.min.js new file mode 100644 index 0000000..f34b0dd --- /dev/null +++ b/node_modules/d3-ease/dist/d3-ease.min.js @@ -0,0 +1,2 @@ +// https://d3js.org/d3-ease/ v3.0.1 Copyright 2010-2021 Mike Bostock, 2001 Robert Penner +!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((n="undefined"!=typeof globalThis?globalThis:n||self).d3=n.d3||{})}(this,(function(n){"use strict";function e(n){return((n*=2)<=1?n*n:--n*(2-n)+1)/2}function t(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}var u=function n(e){function t(n){return Math.pow(n,e)}return e=+e,t.exponent=n,t}(3),r=function n(e){function t(n){return 1-Math.pow(1-n,e)}return e=+e,t.exponent=n,t}(3),a=function n(e){function t(n){return((n*=2)<=1?Math.pow(n,e):2-Math.pow(2-n,e))/2}return e=+e,t.exponent=n,t}(3),o=Math.PI,i=o/2;function c(n){return(1-Math.cos(o*n))/2}function s(n){return 1.0009775171065494*(Math.pow(2,-10*n)-.0009765625)}function f(n){return((n*=2)<=1?s(1-n):2-s(n-1))/2}function h(n){return((n*=2)<=1?1-Math.sqrt(1-n*n):Math.sqrt(1-(n-=2)*n)+1)/2}var p=4/11,M=7.5625;function d(n){return(n=+n)+n,n.easePoly=a,n.easePolyIn=u,n.easePolyInOut=a,n.easePolyOut=r,n.easeQuad=e,n.easeQuadIn=function(n){return n*n},n.easeQuadInOut=e,n.easeQuadOut=function(n){return n*(2-n)},n.easeSin=c,n.easeSinIn=function(n){return 1==+n?1:1-Math.cos(n*i)},n.easeSinInOut=c,n.easeSinOut=function(n){return Math.sin(n*i)},Object.defineProperty(n,"__esModule",{value:!0})})); diff --git a/node_modules/d3-ease/package.json b/node_modules/d3-ease/package.json new file mode 100644 index 0000000..2ff544c --- /dev/null +++ b/node_modules/d3-ease/package.json @@ -0,0 +1,51 @@ +{ + "name": "d3-ease", + "version": "3.0.1", + "description": "Easing functions for smooth animation.", + "homepage": "https://d3js.org/d3-ease/", + "repository": { + "type": "git", + "url": "https://github.com/d3/d3-ease.git" + }, + "keywords": [ + "d3", + "d3-module", + "ease", + "easing", + "animation", + "transition" + ], + "license": "BSD-3-Clause", + "author": { + "name": "Mike Bostock", + "url": "http://bost.ocks.org/mike" + }, + "type": "module", + "files": [ + "dist/**/*.js", + "src/**/*.js" + ], + "module": "src/index.js", + "main": "src/index.js", + "jsdelivr": "dist/d3-ease.min.js", + "unpkg": "dist/d3-ease.min.js", + "exports": { + "umd": "./dist/d3-ease.min.js", + "default": "./src/index.js" + }, + "sideEffects": false, + "devDependencies": { + "eslint": "7", + "mocha": "8", + "rollup": "2", + "rollup-plugin-terser": "7" + }, + "scripts": { + "test": "mocha 'test/**/*-test.js' && eslint src test", + "prepublishOnly": "rm -rf dist && yarn test && rollup -c", + "postpublish": "git push && git push --tags && cd ../d3.github.com && git pull && cp ../${npm_package_name}/dist/${npm_package_name}.js ${npm_package_name}.v${npm_package_version%%.*}.js && cp ../${npm_package_name}/dist/${npm_package_name}.min.js ${npm_package_name}.v${npm_package_version%%.*}.min.js && git add ${npm_package_name}.v${npm_package_version%%.*}.js ${npm_package_name}.v${npm_package_version%%.*}.min.js && git commit -m \"${npm_package_name} ${npm_package_version}\" && git push && cd -" + }, + "engines": { + "node": ">=12" + } +} diff --git a/node_modules/d3-ease/src/back.js b/node_modules/d3-ease/src/back.js new file mode 100644 index 0000000..b9c1bcc --- /dev/null +++ b/node_modules/d3-ease/src/back.js @@ -0,0 +1,37 @@ +var overshoot = 1.70158; + +export var backIn = (function custom(s) { + s = +s; + + function backIn(t) { + return (t = +t) * t * (s * (t - 1) + t); + } + + backIn.overshoot = custom; + + return backIn; +})(overshoot); + +export var backOut = (function custom(s) { + s = +s; + + function backOut(t) { + return --t * t * ((t + 1) * s + t) + 1; + } + + backOut.overshoot = custom; + + return backOut; +})(overshoot); + +export var backInOut = (function custom(s) { + s = +s; + + function backInOut(t) { + return ((t *= 2) < 1 ? t * t * ((s + 1) * t - s) : (t -= 2) * t * ((s + 1) * t + s) + 2) / 2; + } + + backInOut.overshoot = custom; + + return backInOut; +})(overshoot); diff --git a/node_modules/d3-ease/src/bounce.js b/node_modules/d3-ease/src/bounce.js new file mode 100644 index 0000000..d2d81ca --- /dev/null +++ b/node_modules/d3-ease/src/bounce.js @@ -0,0 +1,22 @@ +var b1 = 4 / 11, + b2 = 6 / 11, + b3 = 8 / 11, + b4 = 3 / 4, + b5 = 9 / 11, + b6 = 10 / 11, + b7 = 15 / 16, + b8 = 21 / 22, + b9 = 63 / 64, + b0 = 1 / b1 / b1; + +export function bounceIn(t) { + return 1 - bounceOut(1 - t); +} + +export function bounceOut(t) { + return (t = +t) < b1 ? b0 * t * t : t < b3 ? b0 * (t -= b2) * t + b4 : t < b6 ? b0 * (t -= b5) * t + b7 : b0 * (t -= b8) * t + b9; +} + +export function bounceInOut(t) { + return ((t *= 2) <= 1 ? 1 - bounceOut(1 - t) : bounceOut(t - 1) + 1) / 2; +} diff --git a/node_modules/d3-ease/src/circle.js b/node_modules/d3-ease/src/circle.js new file mode 100644 index 0000000..8b9bb1d --- /dev/null +++ b/node_modules/d3-ease/src/circle.js @@ -0,0 +1,11 @@ +export function circleIn(t) { + return 1 - Math.sqrt(1 - t * t); +} + +export function circleOut(t) { + return Math.sqrt(1 - --t * t); +} + +export function circleInOut(t) { + return ((t *= 2) <= 1 ? 1 - Math.sqrt(1 - t * t) : Math.sqrt(1 - (t -= 2) * t) + 1) / 2; +} diff --git a/node_modules/d3-ease/src/cubic.js b/node_modules/d3-ease/src/cubic.js new file mode 100644 index 0000000..bad3a7c --- /dev/null +++ b/node_modules/d3-ease/src/cubic.js @@ -0,0 +1,11 @@ +export function cubicIn(t) { + return t * t * t; +} + +export function cubicOut(t) { + return --t * t * t + 1; +} + +export function cubicInOut(t) { + return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; +} diff --git a/node_modules/d3-ease/src/elastic.js b/node_modules/d3-ease/src/elastic.js new file mode 100644 index 0000000..48ca673 --- /dev/null +++ b/node_modules/d3-ease/src/elastic.js @@ -0,0 +1,46 @@ +import {tpmt} from "./math.js"; + +var tau = 2 * Math.PI, + amplitude = 1, + period = 0.3; + +export var elasticIn = (function custom(a, p) { + var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau); + + function elasticIn(t) { + return a * tpmt(-(--t)) * Math.sin((s - t) / p); + } + + elasticIn.amplitude = function(a) { return custom(a, p * tau); }; + elasticIn.period = function(p) { return custom(a, p); }; + + return elasticIn; +})(amplitude, period); + +export var elasticOut = (function custom(a, p) { + var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau); + + function elasticOut(t) { + return 1 - a * tpmt(t = +t) * Math.sin((t + s) / p); + } + + elasticOut.amplitude = function(a) { return custom(a, p * tau); }; + elasticOut.period = function(p) { return custom(a, p); }; + + return elasticOut; +})(amplitude, period); + +export var elasticInOut = (function custom(a, p) { + var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau); + + function elasticInOut(t) { + return ((t = t * 2 - 1) < 0 + ? a * tpmt(-t) * Math.sin((s - t) / p) + : 2 - a * tpmt(t) * Math.sin((s + t) / p)) / 2; + } + + elasticInOut.amplitude = function(a) { return custom(a, p * tau); }; + elasticInOut.period = function(p) { return custom(a, p); }; + + return elasticInOut; +})(amplitude, period); diff --git a/node_modules/d3-ease/src/exp.js b/node_modules/d3-ease/src/exp.js new file mode 100644 index 0000000..f3c1cf0 --- /dev/null +++ b/node_modules/d3-ease/src/exp.js @@ -0,0 +1,13 @@ +import {tpmt} from "./math.js"; + +export function expIn(t) { + return tpmt(1 - +t); +} + +export function expOut(t) { + return 1 - tpmt(t); +} + +export function expInOut(t) { + return ((t *= 2) <= 1 ? tpmt(1 - t) : 2 - tpmt(t - 1)) / 2; +} diff --git a/node_modules/d3-ease/src/index.js b/node_modules/d3-ease/src/index.js new file mode 100644 index 0000000..710d3df --- /dev/null +++ b/node_modules/d3-ease/src/index.js @@ -0,0 +1,66 @@ +export { + linear as easeLinear +} from "./linear.js"; + +export { + quadInOut as easeQuad, + quadIn as easeQuadIn, + quadOut as easeQuadOut, + quadInOut as easeQuadInOut +} from "./quad.js"; + +export { + cubicInOut as easeCubic, + cubicIn as easeCubicIn, + cubicOut as easeCubicOut, + cubicInOut as easeCubicInOut +} from "./cubic.js"; + +export { + polyInOut as easePoly, + polyIn as easePolyIn, + polyOut as easePolyOut, + polyInOut as easePolyInOut +} from "./poly.js"; + +export { + sinInOut as easeSin, + sinIn as easeSinIn, + sinOut as easeSinOut, + sinInOut as easeSinInOut +} from "./sin.js"; + +export { + expInOut as easeExp, + expIn as easeExpIn, + expOut as easeExpOut, + expInOut as easeExpInOut +} from "./exp.js"; + +export { + circleInOut as easeCircle, + circleIn as easeCircleIn, + circleOut as easeCircleOut, + circleInOut as easeCircleInOut +} from "./circle.js"; + +export { + bounceOut as easeBounce, + bounceIn as easeBounceIn, + bounceOut as easeBounceOut, + bounceInOut as easeBounceInOut +} from "./bounce.js"; + +export { + backInOut as easeBack, + backIn as easeBackIn, + backOut as easeBackOut, + backInOut as easeBackInOut +} from "./back.js"; + +export { + elasticOut as easeElastic, + elasticIn as easeElasticIn, + elasticOut as easeElasticOut, + elasticInOut as easeElasticInOut +} from "./elastic.js"; diff --git a/node_modules/d3-ease/src/linear.js b/node_modules/d3-ease/src/linear.js new file mode 100644 index 0000000..7b7d2c1 --- /dev/null +++ b/node_modules/d3-ease/src/linear.js @@ -0,0 +1 @@ +export const linear = t => +t; diff --git a/node_modules/d3-ease/src/math.js b/node_modules/d3-ease/src/math.js new file mode 100644 index 0000000..d342db1 --- /dev/null +++ b/node_modules/d3-ease/src/math.js @@ -0,0 +1,4 @@ +// tpmt is two power minus ten times t scaled to [0,1] +export function tpmt(x) { + return (Math.pow(2, -10 * x) - 0.0009765625) * 1.0009775171065494; +} diff --git a/node_modules/d3-ease/src/poly.js b/node_modules/d3-ease/src/poly.js new file mode 100644 index 0000000..827cf87 --- /dev/null +++ b/node_modules/d3-ease/src/poly.js @@ -0,0 +1,37 @@ +var exponent = 3; + +export var polyIn = (function custom(e) { + e = +e; + + function polyIn(t) { + return Math.pow(t, e); + } + + polyIn.exponent = custom; + + return polyIn; +})(exponent); + +export var polyOut = (function custom(e) { + e = +e; + + function polyOut(t) { + return 1 - Math.pow(1 - t, e); + } + + polyOut.exponent = custom; + + return polyOut; +})(exponent); + +export var polyInOut = (function custom(e) { + e = +e; + + function polyInOut(t) { + return ((t *= 2) <= 1 ? Math.pow(t, e) : 2 - Math.pow(2 - t, e)) / 2; + } + + polyInOut.exponent = custom; + + return polyInOut; +})(exponent); diff --git a/node_modules/d3-ease/src/quad.js b/node_modules/d3-ease/src/quad.js new file mode 100644 index 0000000..df65bc2 --- /dev/null +++ b/node_modules/d3-ease/src/quad.js @@ -0,0 +1,11 @@ +export function quadIn(t) { + return t * t; +} + +export function quadOut(t) { + return t * (2 - t); +} + +export function quadInOut(t) { + return ((t *= 2) <= 1 ? t * t : --t * (2 - t) + 1) / 2; +} diff --git a/node_modules/d3-ease/src/sin.js b/node_modules/d3-ease/src/sin.js new file mode 100644 index 0000000..d8e09b8 --- /dev/null +++ b/node_modules/d3-ease/src/sin.js @@ -0,0 +1,14 @@ +var pi = Math.PI, + halfPi = pi / 2; + +export function sinIn(t) { + return (+t === 1) ? 1 : 1 - Math.cos(t * halfPi); +} + +export function sinOut(t) { + return Math.sin(t * halfPi); +} + +export function sinInOut(t) { + return (1 - Math.cos(pi * t)) / 2; +} diff --git a/node_modules/d3-interpolate/LICENSE b/node_modules/d3-interpolate/LICENSE new file mode 100644 index 0000000..b014515 --- /dev/null +++ b/node_modules/d3-interpolate/LICENSE @@ -0,0 +1,13 @@ +Copyright 2010-2021 Mike Bostock + +Permission to use, copy, modify, and/or distribute this software for any purpose +with or without fee is hereby granted, provided that the above copyright notice +and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. diff --git a/node_modules/d3-interpolate/README.md b/node_modules/d3-interpolate/README.md new file mode 100644 index 0000000..f5d82e7 --- /dev/null +++ b/node_modules/d3-interpolate/README.md @@ -0,0 +1,268 @@ +# d3-interpolate + +This module provides a variety of interpolation methods for blending between two values. Values may be numbers, colors, strings, arrays, or even deeply-nested objects. For example: + +```js +const i = d3.interpolateNumber(10, 20); +i(0.0); // 10 +i(0.2); // 12 +i(0.5); // 15 +i(1.0); // 20 +``` + +The returned function `i` is called an *interpolator*. Given a starting value *a* and an ending value *b*, it takes a parameter *t* in the domain [0, 1] and returns the corresponding interpolated value between *a* and *b*. An interpolator typically returns a value equivalent to *a* at *t* = 0 and a value equivalent to *b* at *t* = 1. + +You can interpolate more than just numbers. To find the perceptual midpoint between steelblue and brown: + +```js +d3.interpolateLab("steelblue", "brown")(0.5); // "rgb(142, 92, 109)" +``` + +Here’s a more elaborate example demonstrating type inference used by [interpolate](#interpolate): + +```js +const i = d3.interpolate({colors: ["red", "blue"]}, {colors: ["white", "black"]}); +i(0.0); // {colors: ["rgb(255, 0, 0)", "rgb(0, 0, 255)"]} +i(0.5); // {colors: ["rgb(255, 128, 128)", "rgb(0, 0, 128)"]} +i(1.0); // {colors: ["rgb(255, 255, 255)", "rgb(0, 0, 0)"]} +``` + +Note that the generic value interpolator detects not only nested objects and arrays, but also color strings and numbers embedded in strings! + +## Installing + +If you use npm, `npm install d3-interpolate`. You can also download the [latest release on GitHub](https://github.com/d3/d3-interpolate/releases/latest). For vanilla HTML in modern browsers, import d3-interpolate from Skypack: + +```html + +``` + +For legacy environments, you can load d3-interpolate’s UMD bundle from an npm-based CDN such as jsDelivr; a `d3` global is exported. (If using [color interpolation](#color-spaces), also load [d3-color](https://github.com/d3/d3-color).) + +```html + + + +``` + +## API Reference + +# d3.interpolate(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/value.js), [Examples](https://observablehq.com/@d3/d3-interpolate) + +Returns an interpolator between the two arbitrary values *a* and *b*. The interpolator implementation is based on the type of the end value *b*, using the following algorithm: + +1. If *b* is null, undefined or a boolean, use the constant *b*. +2. If *b* is a number, use [interpolateNumber](#interpolateNumber). +3. If *b* is a [color](https://github.com/d3/d3-color/blob/master/README.md#color) or a string coercible to a color, use [interpolateRgb](#interpolateRgb). +4. If *b* is a [date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date), use [interpolateDate](#interpolateDate). +5. If *b* is a string, use [interpolateString](#interpolateString). +6. If *b* is a [typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) of numbers, use [interpolateNumberArray](#interpolateNumberArray). +7. If *b* is a generic [array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray), use [interpolateArray](#interpolateArray). +8. If *b* is coercible to a number, use [interpolateNumber](#interpolateNumber). +9. Use [interpolateObject](#interpolateObject). + +Based on the chosen interpolator, *a* is coerced to the suitable corresponding type. + +# d3.interpolateNumber(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/number.js), [Examples](https://observablehq.com/@d3/d3-interpolatenumber) + +Returns an interpolator between the two numbers *a* and *b*. The returned interpolator is equivalent to: + +```js +function interpolator(t) { + return a * (1 - t) + b * t; +} +``` + +Caution: avoid interpolating to or from the number zero when the interpolator is used to generate a string. When very small values are stringified, they may be converted to scientific notation, which is an invalid attribute or style property value in older browsers. For example, the number `0.0000001` is converted to the string `"1e-7"`. This is particularly noticeable with interpolating opacity. To avoid scientific notation, start or end the transition at 1e-6: the smallest value that is not stringified in scientific notation. + +# d3.interpolateRound(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/round.js), [Examples](https://observablehq.com/@d3/d3-interpolatenumber) + +Returns an interpolator between the two numbers *a* and *b*; the interpolator is similar to [interpolateNumber](#interpolateNumber), except it will round the resulting value to the nearest integer. + +# d3.interpolateString(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/string.js), [Examples](https://observablehq.com/@d3/d3-interpolatestring) + +Returns an interpolator between the two strings *a* and *b*. The string interpolator finds numbers embedded in *a* and *b*, where each number is of the form understood by JavaScript. A few examples of numbers that will be detected within a string: `-1`, `42`, `3.14159`, and `6.0221413e+23`. + +For each number embedded in *b*, the interpolator will attempt to find a corresponding number in *a*. If a corresponding number is found, a numeric interpolator is created using [interpolateNumber](#interpolateNumber). The remaining parts of the string *b* are used as a template: the static parts of the string *b* remain constant for the interpolation, with the interpolated numeric values embedded in the template. + +For example, if *a* is `"300 12px sans-serif"`, and *b* is `"500 36px Comic-Sans"`, two embedded numbers are found. The remaining static parts (of string *b*) are a space between the two numbers (`" "`), and the suffix (`"px Comic-Sans"`). The result of the interpolator at *t* = 0.5 is `"400 24px Comic-Sans"`. + +# d3.interpolateDate(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/date.js), [Examples](https://observablehq.com/@d3/d3-interpolatedate) + +Returns an interpolator between the two [dates](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) *a* and *b*. + +Note: **no defensive copy** of the returned date is created; the same Date instance is returned for every evaluation of the interpolator. No copy is made for performance reasons; interpolators are often part of the inner loop of [animated transitions](https://github.com/d3/d3-transition). + +# d3.interpolateArray(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/array.js), [Examples](https://observablehq.com/@d3/d3-interpolateobject) + +Returns an interpolator between the two arrays *a* and *b*. If *b* is a typed array (e.g., Float64Array), [interpolateNumberArray](#interpolateNumberArray) is called instead. + +Internally, an array template is created that is the same length as *b*. For each element in *b*, if there exists a corresponding element in *a*, a generic interpolator is created for the two elements using [interpolate](#interpolate). If there is no such element, the static value from *b* is used in the template. Then, for the given parameter *t*, the template’s embedded interpolators are evaluated. The updated array template is then returned. + +For example, if *a* is the array `[0, 1]` and *b* is the array `[1, 10, 100]`, then the result of the interpolator for *t* = 0.5 is the array `[0.5, 5.5, 100]`. + +Note: **no defensive copy** of the template array is created; modifications of the returned array may adversely affect subsequent evaluation of the interpolator. No copy is made for performance reasons; interpolators are often part of the inner loop of [animated transitions](https://github.com/d3/d3-transition). + +# d3.interpolateNumberArray(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/numberArray.js), [Examples](https://observablehq.com/@d3/d3-interpolatenumberarray) + +Returns an interpolator between the two arrays of numbers *a* and *b*. Internally, an array template is created that is the same type and length as *b*. For each element in *b*, if there exists a corresponding element in *a*, the values are directly interpolated in the array template. If there is no such element, the static value from *b* is copied. The updated array template is then returned. + +Note: For performance reasons, **no defensive copy** is made of the template array and the arguments *a* and *b*; modifications of these arrays may affect subsequent evaluation of the interpolator. + +# d3.interpolateObject(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/object.js), [Examples](https://observablehq.com/@d3/d3-interpolateobject) + +Returns an interpolator between the two objects *a* and *b*. Internally, an object template is created that has the same properties as *b*. For each property in *b*, if there exists a corresponding property in *a*, a generic interpolator is created for the two elements using [interpolate](#interpolate). If there is no such property, the static value from *b* is used in the template. Then, for the given parameter *t*, the template's embedded interpolators are evaluated and the updated object template is then returned. + +For example, if *a* is the object `{x: 0, y: 1}` and *b* is the object `{x: 1, y: 10, z: 100}`, the result of the interpolator for *t* = 0.5 is the object `{x: 0.5, y: 5.5, z: 100}`. + +Object interpolation is particularly useful for *dataspace interpolation*, where data is interpolated rather than attribute values. For example, you can interpolate an object which describes an arc in a pie chart, and then use [d3.arc](https://github.com/d3/d3-shape/blob/master/README.md#arc) to compute the new SVG path data. + +Note: **no defensive copy** of the template object is created; modifications of the returned object may adversely affect subsequent evaluation of the interpolator. No copy is made for performance reasons; interpolators are often part of the inner loop of [animated transitions](https://github.com/d3/d3-transition). + +# d3.interpolateTransformCss(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/transform/index.js#L62), [Examples](https://observablehq.com/@d3/d3-interpolatetransformcss) + +Returns an interpolator between the two 2D CSS transforms represented by *a* and *b*. Each transform is decomposed to a standard representation of translate, rotate, *x*-skew and scale; these component transformations are then interpolated. This behavior is standardized by CSS: see [matrix decomposition for animation](http://www.w3.org/TR/css3-2d-transforms/#matrix-decomposition). + +# d3.interpolateTransformSvg(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/transform/index.js#L63), [Examples](https://observablehq.com/@d3/d3-interpolatetransformcss) + +Returns an interpolator between the two 2D SVG transforms represented by *a* and *b*. Each transform is decomposed to a standard representation of translate, rotate, *x*-skew and scale; these component transformations are then interpolated. This behavior is standardized by CSS: see [matrix decomposition for animation](http://www.w3.org/TR/css3-2d-transforms/#matrix-decomposition). + +# d3.interpolateZoom(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/zoom.js), [Examples](https://observablehq.com/@d3/d3-interpolatezoom) + +Returns an interpolator between the two views *a* and *b* of a two-dimensional plane, based on [“Smooth and efficient zooming and panning”](http://www.win.tue.nl/~vanwijk/zoompan.pdf) by Jarke J. van Wijk and Wim A.A. Nuij. Each view is defined as an array of three numbers: *cx*, *cy* and *width*. The first two coordinates *cx*, *cy* represent the center of the viewport; the last coordinate *width* represents the size of the viewport. + +The returned interpolator exposes a *duration* property which encodes the recommended transition duration in milliseconds. This duration is based on the path length of the curved trajectory through *x,y* space. If you want a slower or faster transition, multiply this by an arbitrary scale factor (V as described in the original paper). + +# *interpolateZoom*.rho(rho) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/zoom.js) + +Given a [zoom interpolator](#interpolateZoom), returns a new zoom interpolator using the specified curvature *rho*. When *rho* is close to 0, the interpolator is almost linear. The default curvature is sqrt(2). + +# d3.interpolateDiscrete(values) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/discrete.js), [Examples](https://observablehq.com/@d3/d3-interpolatediscrete) + +Returns a discrete interpolator for the given array of *values*. The returned interpolator maps *t* in [0, 1 / *n*) to *values*[0], *t* in [1 / *n*, 2 / *n*) to *values*[1], and so on, where *n* = *values*.length. In effect, this is a lightweight [quantize scale](https://github.com/d3/d3-scale/blob/master/README.md#quantize-scales) with a fixed domain of [0, 1]. + +### Sampling + +# d3.quantize(interpolator, n) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/quantize.js), [Examples](https://observablehq.com/@d3/d3-quantize) + +Returns *n* uniformly-spaced samples from the specified *interpolator*, where *n* is an integer greater than one. The first sample is always at *t* = 0, and the last sample is always at *t* = 1. This can be useful in generating a fixed number of samples from a given interpolator, such as to derive the range of a [quantize scale](https://github.com/d3/d3-scale/blob/master/README.md#quantize-scales) from a [continuous interpolator](https://github.com/d3/d3-scale-chromatic/blob/master/README.md#interpolateWarm). + +Caution: this method will not work with interpolators that do not return defensive copies of their output, such as [d3.interpolateArray](#interpolateArray), [d3.interpolateDate](#interpolateDate) and [d3.interpolateObject](#interpolateObject). For those interpolators, you must wrap the interpolator and create a copy for each returned value. + +### Color Spaces + +# d3.interpolateRgb(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/rgb.js), [Examples](https://observablehq.com/@d3/working-with-color) + +rgb + +Or, with a corrected [gamma](#interpolate_gamma) of 2.2: + +rgbGamma + +Returns an RGB color space interpolator between the two colors *a* and *b* with a configurable [gamma](#interpolate_gamma). If the gamma is not specified, it defaults to 1.0. The colors *a* and *b* need not be in RGB; they will be converted to RGB using [d3.rgb](https://github.com/d3/d3-color/blob/master/README.md#rgb). The return value of the interpolator is an RGB string. + +# d3.interpolateRgbBasis(colors) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/rgb.js#L54), [Examples](https://observablehq.com/@d3/working-with-color) + +Returns a uniform nonrational B-spline interpolator through the specified array of *colors*, which are converted to [RGB color space](https://github.com/d3/d3-color/blob/master/README.md#rgb). Implicit control points are generated such that the interpolator returns *colors*[0] at *t* = 0 and *colors*[*colors*.length - 1] at *t* = 1. Opacity interpolation is not currently supported. See also [d3.interpolateBasis](#interpolateBasis), and see [d3-scale-chromatic](https://github.com/d3/d3-scale-chromatic) for examples. + +# d3.interpolateRgbBasisClosed(colors) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/rgb.js#L55), [Examples](https://observablehq.com/@d3/working-with-color) + +Returns a uniform nonrational B-spline interpolator through the specified array of *colors*, which are converted to [RGB color space](https://github.com/d3/d3-color/blob/master/README.md#rgb). The control points are implicitly repeated such that the resulting spline has cyclical C² continuity when repeated around *t* in [0,1]; this is useful, for example, to create cyclical color scales. Opacity interpolation is not currently supported. See also [d3.interpolateBasisClosed](#interpolateBasisClosed), and see [d3-scale-chromatic](https://github.com/d3/d3-scale-chromatic) for examples. + +# d3.interpolateHsl(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/hsl.js), [Examples](https://observablehq.com/@d3/working-with-color) + +hsl + +Returns an HSL color space interpolator between the two colors *a* and *b*. The colors *a* and *b* need not be in HSL; they will be converted to HSL using [d3.hsl](https://github.com/d3/d3-color/blob/master/README.md#hsl). If either color’s hue or saturation is NaN, the opposing color’s channel value is used. The shortest path between hues is used. The return value of the interpolator is an RGB string. + +# d3.interpolateHslLong(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/hsl.js#L21), [Examples](https://observablehq.com/@d3/working-with-color) + +hslLong + +Like [interpolateHsl](#interpolateHsl), but does not use the shortest path between hues. + +# d3.interpolateLab(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/lab.js), [Examples](https://observablehq.com/@d3/working-with-color) + +lab + +Returns a [CIELAB color space](https://en.wikipedia.org/wiki/Lab_color_space#CIELAB) interpolator between the two colors *a* and *b*. The colors *a* and *b* need not be in CIELAB; they will be converted to CIELAB using [d3.lab](https://github.com/d3/d3-color/blob/master/README.md#lab). The return value of the interpolator is an RGB string. + +# d3.interpolateHcl(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/hcl.js), [Examples](https://observablehq.com/@d3/working-with-color) + +hcl + +Returns a [CIELChab color space](https://en.wikipedia.org/wiki/CIELAB_color_space#Cylindrical_representation:_CIELCh_or_CIEHLC) interpolator between the two colors *a* and *b*. The colors *a* and *b* need not be in CIELChab; they will be converted to CIELChab using [d3.hcl](https://github.com/d3/d3-color/blob/master/README.md#hcl). If either color’s hue or chroma is NaN, the opposing color’s channel value is used. The shortest path between hues is used. The return value of the interpolator is an RGB string. + +# d3.interpolateHclLong(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/hcl.js#L21), [Examples](https://observablehq.com/@d3/working-with-color) + +hclLong + +Like [interpolateHcl](#interpolateHcl), but does not use the shortest path between hues. + +# d3.interpolateCubehelix(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/cubehelix.js), [Examples](https://observablehq.com/@d3/working-with-color) + +cubehelix + +Or, with a [gamma](#interpolate_gamma) of 3.0 to emphasize high-intensity values: + +cubehelixGamma + +Returns a Cubehelix color space interpolator between the two colors *a* and *b* using a configurable [gamma](#interpolate_gamma). If the gamma is not specified, it defaults to 1.0. The colors *a* and *b* need not be in Cubehelix; they will be converted to Cubehelix using [d3.cubehelix](https://github.com/d3/d3-color/blob/master/README.md#cubehelix). If either color’s hue or saturation is NaN, the opposing color’s channel value is used. The shortest path between hues is used. The return value of the interpolator is an RGB string. + +# d3.interpolateCubehelixLong(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/cubehelix.js#L29), [Examples](https://observablehq.com/@d3/working-with-color) + +cubehelixLong + +Or, with a [gamma](#interpolate_gamma) of 3.0 to emphasize high-intensity values: + +cubehelixGammaLong + +Like [interpolateCubehelix](#interpolateCubehelix), but does not use the shortest path between hues. + +# interpolate.gamma(gamma) + +Given that *interpolate* is one of [interpolateRgb](#interpolateRgb), [interpolateCubehelix](#interpolateCubehelix) or [interpolateCubehelixLong](#interpolateCubehelixLong), returns a new interpolator factory of the same type using the specified *gamma*. For example, to interpolate from purple to orange with a gamma of 2.2 in RGB space: + +```js +const interpolator = d3.interpolateRgb.gamma(2.2)("purple", "orange"); +``` + +See Eric Brasseur’s article, [Gamma error in picture scaling](http://www.ericbrasseur.org/gamma.html), for more on gamma correction. + +# d3.interpolateHue(a, b) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/hue.js), [Examples](https://observablehq.com/@d3/working-with-color) + +Returns an interpolator between the two hue angles *a* and *b*. If either hue is NaN, the opposing value is used. The shortest path between hues is used. The return value of the interpolator is a number in [0, 360). + +### Splines + +Whereas standard interpolators blend from a starting value *a* at *t* = 0 to an ending value *b* at *t* = 1, spline interpolators smoothly blend multiple input values for *t* in [0,1] using piecewise polynomial functions. Only cubic uniform nonrational [B-splines](https://en.wikipedia.org/wiki/B-spline) are currently supported, also known as basis splines. + +# d3.interpolateBasis(values) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/basis.js), [Examples](https://observablehq.com/@d3/d3-interpolatebasis) + +Returns a uniform nonrational B-spline interpolator through the specified array of *values*, which must be numbers. Implicit control points are generated such that the interpolator returns *values*[0] at *t* = 0 and *values*[*values*.length - 1] at *t* = 1. See also [d3.curveBasis](https://github.com/d3/d3-shape/blob/master/README.md#curveBasis). + +# d3.interpolateBasisClosed(values) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/basisClosed.js), [Examples](https://observablehq.com/@d3/d3-interpolatebasis) + +Returns a uniform nonrational B-spline interpolator through the specified array of *values*, which must be numbers. The control points are implicitly repeated such that the resulting one-dimensional spline has cyclical C² continuity when repeated around *t* in [0,1]. See also [d3.curveBasisClosed](https://github.com/d3/d3-shape/blob/master/README.md#curveBasisClosed). + +### Piecewise + +# d3.piecewise([interpolate, ]values) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/piecewise.js), [Examples](https://observablehq.com/@d3/d3-piecewise) + +Returns a piecewise interpolator, composing interpolators for each adjacent pair of *values*. The returned interpolator maps *t* in [0, 1 / (*n* - 1)] to *interpolate*(*values*[0], *values*[1]), *t* in [1 / (*n* - 1), 2 / (*n* - 1)] to *interpolate*(*values*[1], *values*[2]), and so on, where *n* = *values*.length. In effect, this is a lightweight [linear scale](https://github.com/d3/d3-scale/blob/master/README.md#linear-scales). For example, to blend through red, green and blue: + +```js +const interpolate = d3.piecewise(d3.interpolateRgb.gamma(2.2), ["red", "green", "blue"]); +``` + +If *interpolate* is not specified, defaults to [d3.interpolate](#interpolate). diff --git a/node_modules/d3-interpolate/dist/d3-interpolate.js b/node_modules/d3-interpolate/dist/d3-interpolate.js new file mode 100644 index 0000000..a374eed --- /dev/null +++ b/node_modules/d3-interpolate/dist/d3-interpolate.js @@ -0,0 +1,590 @@ +// https://d3js.org/d3-interpolate/ v3.0.1 Copyright 2010-2021 Mike Bostock +(function (global, factory) { +typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-color')) : +typeof define === 'function' && define.amd ? define(['exports', 'd3-color'], factory) : +(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.d3 = global.d3 || {}, global.d3)); +}(this, (function (exports, d3Color) { 'use strict'; + +function basis(t1, v0, v1, v2, v3) { + var t2 = t1 * t1, t3 = t2 * t1; + return ((1 - 3 * t1 + 3 * t2 - t3) * v0 + + (4 - 6 * t2 + 3 * t3) * v1 + + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2 + + t3 * v3) / 6; +} + +function basis$1(values) { + var n = values.length - 1; + return function(t) { + var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n), + v1 = values[i], + v2 = values[i + 1], + v0 = i > 0 ? values[i - 1] : 2 * v1 - v2, + v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1; + return basis((t - i / n) * n, v0, v1, v2, v3); + }; +} + +function basisClosed(values) { + var n = values.length; + return function(t) { + var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n), + v0 = values[(i + n - 1) % n], + v1 = values[i % n], + v2 = values[(i + 1) % n], + v3 = values[(i + 2) % n]; + return basis((t - i / n) * n, v0, v1, v2, v3); + }; +} + +var constant = x => () => x; + +function linear(a, d) { + return function(t) { + return a + t * d; + }; +} + +function exponential(a, b, y) { + return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) { + return Math.pow(a + t * b, y); + }; +} + +function hue$1(a, b) { + var d = b - a; + return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a); +} + +function gamma(y) { + return (y = +y) === 1 ? nogamma : function(a, b) { + return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a); + }; +} + +function nogamma(a, b) { + var d = b - a; + return d ? linear(a, d) : constant(isNaN(a) ? b : a); +} + +var rgb = (function rgbGamma(y) { + var color = gamma(y); + + function rgb(start, end) { + var r = color((start = d3Color.rgb(start)).r, (end = d3Color.rgb(end)).r), + g = color(start.g, end.g), + b = color(start.b, end.b), + opacity = nogamma(start.opacity, end.opacity); + return function(t) { + start.r = r(t); + start.g = g(t); + start.b = b(t); + start.opacity = opacity(t); + return start + ""; + }; + } + + rgb.gamma = rgbGamma; + + return rgb; +})(1); + +function rgbSpline(spline) { + return function(colors) { + var n = colors.length, + r = new Array(n), + g = new Array(n), + b = new Array(n), + i, color; + for (i = 0; i < n; ++i) { + color = d3Color.rgb(colors[i]); + r[i] = color.r || 0; + g[i] = color.g || 0; + b[i] = color.b || 0; + } + r = spline(r); + g = spline(g); + b = spline(b); + color.opacity = 1; + return function(t) { + color.r = r(t); + color.g = g(t); + color.b = b(t); + return color + ""; + }; + }; +} + +var rgbBasis = rgbSpline(basis$1); +var rgbBasisClosed = rgbSpline(basisClosed); + +function numberArray(a, b) { + if (!b) b = []; + var n = a ? Math.min(b.length, a.length) : 0, + c = b.slice(), + i; + return function(t) { + for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t; + return c; + }; +} + +function isNumberArray(x) { + return ArrayBuffer.isView(x) && !(x instanceof DataView); +} + +function array(a, b) { + return (isNumberArray(b) ? numberArray : genericArray)(a, b); +} + +function genericArray(a, b) { + var nb = b ? b.length : 0, + na = a ? Math.min(nb, a.length) : 0, + x = new Array(na), + c = new Array(nb), + i; + + for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]); + for (; i < nb; ++i) c[i] = b[i]; + + return function(t) { + for (i = 0; i < na; ++i) c[i] = x[i](t); + return c; + }; +} + +function date(a, b) { + var d = new Date; + return a = +a, b = +b, function(t) { + return d.setTime(a * (1 - t) + b * t), d; + }; +} + +function number(a, b) { + return a = +a, b = +b, function(t) { + return a * (1 - t) + b * t; + }; +} + +function object(a, b) { + var i = {}, + c = {}, + k; + + if (a === null || typeof a !== "object") a = {}; + if (b === null || typeof b !== "object") b = {}; + + for (k in b) { + if (k in a) { + i[k] = value(a[k], b[k]); + } else { + c[k] = b[k]; + } + } + + return function(t) { + for (k in i) c[k] = i[k](t); + return c; + }; +} + +var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, + reB = new RegExp(reA.source, "g"); + +function zero(b) { + return function() { + return b; + }; +} + +function one(b) { + return function(t) { + return b(t) + ""; + }; +} + +function string(a, b) { + var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b + am, // current match in a + bm, // current match in b + bs, // string preceding current number in b, if any + i = -1, // index in s + s = [], // string constants and placeholders + q = []; // number interpolators + + // Coerce inputs to strings. + a = a + "", b = b + ""; + + // Interpolate pairs of numbers in a & b. + while ((am = reA.exec(a)) + && (bm = reB.exec(b))) { + if ((bs = bm.index) > bi) { // a string precedes the next number in b + bs = b.slice(bi, bs); + if (s[i]) s[i] += bs; // coalesce with previous string + else s[++i] = bs; + } + if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match + if (s[i]) s[i] += bm; // coalesce with previous string + else s[++i] = bm; + } else { // interpolate non-matching numbers + s[++i] = null; + q.push({i: i, x: number(am, bm)}); + } + bi = reB.lastIndex; + } + + // Add remains of b. + if (bi < b.length) { + bs = b.slice(bi); + if (s[i]) s[i] += bs; // coalesce with previous string + else s[++i] = bs; + } + + // Special optimization for only a single match. + // Otherwise, interpolate each of the numbers and rejoin the string. + return s.length < 2 ? (q[0] + ? one(q[0].x) + : zero(b)) + : (b = q.length, function(t) { + for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t); + return s.join(""); + }); +} + +function value(a, b) { + var t = typeof b, c; + return b == null || t === "boolean" ? constant(b) + : (t === "number" ? number + : t === "string" ? ((c = d3Color.color(b)) ? (b = c, rgb) : string) + : b instanceof d3Color.color ? rgb + : b instanceof Date ? date + : isNumberArray(b) ? numberArray + : Array.isArray(b) ? genericArray + : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object + : number)(a, b); +} + +function discrete(range) { + var n = range.length; + return function(t) { + return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))]; + }; +} + +function hue(a, b) { + var i = hue$1(+a, +b); + return function(t) { + var x = i(t); + return x - 360 * Math.floor(x / 360); + }; +} + +function round(a, b) { + return a = +a, b = +b, function(t) { + return Math.round(a * (1 - t) + b * t); + }; +} + +var degrees = 180 / Math.PI; + +var identity = { + translateX: 0, + translateY: 0, + rotate: 0, + skewX: 0, + scaleX: 1, + scaleY: 1 +}; + +function decompose(a, b, c, d, e, f) { + var scaleX, scaleY, skewX; + if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX; + if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX; + if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY; + if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX; + return { + translateX: e, + translateY: f, + rotate: Math.atan2(b, a) * degrees, + skewX: Math.atan(skewX) * degrees, + scaleX: scaleX, + scaleY: scaleY + }; +} + +var svgNode; + +/* eslint-disable no-undef */ +function parseCss(value) { + const m = new (typeof DOMMatrix === "function" ? DOMMatrix : WebKitCSSMatrix)(value + ""); + return m.isIdentity ? identity : decompose(m.a, m.b, m.c, m.d, m.e, m.f); +} + +function parseSvg(value) { + if (value == null) return identity; + if (!svgNode) svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g"); + svgNode.setAttribute("transform", value); + if (!(value = svgNode.transform.baseVal.consolidate())) return identity; + value = value.matrix; + return decompose(value.a, value.b, value.c, value.d, value.e, value.f); +} + +function interpolateTransform(parse, pxComma, pxParen, degParen) { + + function pop(s) { + return s.length ? s.pop() + " " : ""; + } + + function translate(xa, ya, xb, yb, s, q) { + if (xa !== xb || ya !== yb) { + var i = s.push("translate(", null, pxComma, null, pxParen); + q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)}); + } else if (xb || yb) { + s.push("translate(" + xb + pxComma + yb + pxParen); + } + } + + function rotate(a, b, s, q) { + if (a !== b) { + if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path + q.push({i: s.push(pop(s) + "rotate(", null, degParen) - 2, x: number(a, b)}); + } else if (b) { + s.push(pop(s) + "rotate(" + b + degParen); + } + } + + function skewX(a, b, s, q) { + if (a !== b) { + q.push({i: s.push(pop(s) + "skewX(", null, degParen) - 2, x: number(a, b)}); + } else if (b) { + s.push(pop(s) + "skewX(" + b + degParen); + } + } + + function scale(xa, ya, xb, yb, s, q) { + if (xa !== xb || ya !== yb) { + var i = s.push(pop(s) + "scale(", null, ",", null, ")"); + q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)}); + } else if (xb !== 1 || yb !== 1) { + s.push(pop(s) + "scale(" + xb + "," + yb + ")"); + } + } + + return function(a, b) { + var s = [], // string constants and placeholders + q = []; // number interpolators + a = parse(a), b = parse(b); + translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q); + rotate(a.rotate, b.rotate, s, q); + skewX(a.skewX, b.skewX, s, q); + scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q); + a = b = null; // gc + return function(t) { + var i = -1, n = q.length, o; + while (++i < n) s[(o = q[i]).i] = o.x(t); + return s.join(""); + }; + }; +} + +var interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)"); +var interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")"); + +var epsilon2 = 1e-12; + +function cosh(x) { + return ((x = Math.exp(x)) + 1 / x) / 2; +} + +function sinh(x) { + return ((x = Math.exp(x)) - 1 / x) / 2; +} + +function tanh(x) { + return ((x = Math.exp(2 * x)) - 1) / (x + 1); +} + +var zoom = (function zoomRho(rho, rho2, rho4) { + + // p0 = [ux0, uy0, w0] + // p1 = [ux1, uy1, w1] + function zoom(p0, p1) { + var ux0 = p0[0], uy0 = p0[1], w0 = p0[2], + ux1 = p1[0], uy1 = p1[1], w1 = p1[2], + dx = ux1 - ux0, + dy = uy1 - uy0, + d2 = dx * dx + dy * dy, + i, + S; + + // Special case for u0 ≅ u1. + if (d2 < epsilon2) { + S = Math.log(w1 / w0) / rho; + i = function(t) { + return [ + ux0 + t * dx, + uy0 + t * dy, + w0 * Math.exp(rho * t * S) + ]; + }; + } + + // General case. + else { + var d1 = Math.sqrt(d2), + b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1), + b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1), + r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0), + r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1); + S = (r1 - r0) / rho; + i = function(t) { + var s = t * S, + coshr0 = cosh(r0), + u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0)); + return [ + ux0 + u * dx, + uy0 + u * dy, + w0 * coshr0 / cosh(rho * s + r0) + ]; + }; + } + + i.duration = S * 1000 * rho / Math.SQRT2; + + return i; + } + + zoom.rho = function(_) { + var _1 = Math.max(1e-3, +_), _2 = _1 * _1, _4 = _2 * _2; + return zoomRho(_1, _2, _4); + }; + + return zoom; +})(Math.SQRT2, 2, 4); + +function hsl(hue) { + return function(start, end) { + var h = hue((start = d3Color.hsl(start)).h, (end = d3Color.hsl(end)).h), + s = nogamma(start.s, end.s), + l = nogamma(start.l, end.l), + opacity = nogamma(start.opacity, end.opacity); + return function(t) { + start.h = h(t); + start.s = s(t); + start.l = l(t); + start.opacity = opacity(t); + return start + ""; + }; + } +} + +var hsl$1 = hsl(hue$1); +var hslLong = hsl(nogamma); + +function lab(start, end) { + var l = nogamma((start = d3Color.lab(start)).l, (end = d3Color.lab(end)).l), + a = nogamma(start.a, end.a), + b = nogamma(start.b, end.b), + opacity = nogamma(start.opacity, end.opacity); + return function(t) { + start.l = l(t); + start.a = a(t); + start.b = b(t); + start.opacity = opacity(t); + return start + ""; + }; +} + +function hcl(hue) { + return function(start, end) { + var h = hue((start = d3Color.hcl(start)).h, (end = d3Color.hcl(end)).h), + c = nogamma(start.c, end.c), + l = nogamma(start.l, end.l), + opacity = nogamma(start.opacity, end.opacity); + return function(t) { + start.h = h(t); + start.c = c(t); + start.l = l(t); + start.opacity = opacity(t); + return start + ""; + }; + } +} + +var hcl$1 = hcl(hue$1); +var hclLong = hcl(nogamma); + +function cubehelix(hue) { + return (function cubehelixGamma(y) { + y = +y; + + function cubehelix(start, end) { + var h = hue((start = d3Color.cubehelix(start)).h, (end = d3Color.cubehelix(end)).h), + s = nogamma(start.s, end.s), + l = nogamma(start.l, end.l), + opacity = nogamma(start.opacity, end.opacity); + return function(t) { + start.h = h(t); + start.s = s(t); + start.l = l(Math.pow(t, y)); + start.opacity = opacity(t); + return start + ""; + }; + } + + cubehelix.gamma = cubehelixGamma; + + return cubehelix; + })(1); +} + +var cubehelix$1 = cubehelix(hue$1); +var cubehelixLong = cubehelix(nogamma); + +function piecewise(interpolate, values) { + if (values === undefined) values = interpolate, interpolate = value; + var i = 0, n = values.length - 1, v = values[0], I = new Array(n < 0 ? 0 : n); + while (i < n) I[i] = interpolate(v, v = values[++i]); + return function(t) { + var i = Math.max(0, Math.min(n - 1, Math.floor(t *= n))); + return I[i](t - i); + }; +} + +function quantize(interpolator, n) { + var samples = new Array(n); + for (var i = 0; i < n; ++i) samples[i] = interpolator(i / (n - 1)); + return samples; +} + +exports.interpolate = value; +exports.interpolateArray = array; +exports.interpolateBasis = basis$1; +exports.interpolateBasisClosed = basisClosed; +exports.interpolateCubehelix = cubehelix$1; +exports.interpolateCubehelixLong = cubehelixLong; +exports.interpolateDate = date; +exports.interpolateDiscrete = discrete; +exports.interpolateHcl = hcl$1; +exports.interpolateHclLong = hclLong; +exports.interpolateHsl = hsl$1; +exports.interpolateHslLong = hslLong; +exports.interpolateHue = hue; +exports.interpolateLab = lab; +exports.interpolateNumber = number; +exports.interpolateNumberArray = numberArray; +exports.interpolateObject = object; +exports.interpolateRgb = rgb; +exports.interpolateRgbBasis = rgbBasis; +exports.interpolateRgbBasisClosed = rgbBasisClosed; +exports.interpolateRound = round; +exports.interpolateString = string; +exports.interpolateTransformCss = interpolateTransformCss; +exports.interpolateTransformSvg = interpolateTransformSvg; +exports.interpolateZoom = zoom; +exports.piecewise = piecewise; +exports.quantize = quantize; + +Object.defineProperty(exports, '__esModule', { value: true }); + +}))); diff --git a/node_modules/d3-interpolate/dist/d3-interpolate.min.js b/node_modules/d3-interpolate/dist/d3-interpolate.min.js new file mode 100644 index 0000000..d1b6263 --- /dev/null +++ b/node_modules/d3-interpolate/dist/d3-interpolate.min.js @@ -0,0 +1,2 @@ +// https://d3js.org/d3-interpolate/ v3.0.1 Copyright 2010-2021 Mike Bostock +!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("d3-color")):"function"==typeof define&&define.amd?define(["exports","d3-color"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).d3=t.d3||{},t.d3)}(this,(function(t,n){"use strict";function r(t,n,r,e,a){var o=t*t,u=o*t;return((1-3*t+3*o-u)*n+(4-6*o+3*u)*r+(1+3*t+3*o-3*u)*e+u*a)/6}function e(t){var n=t.length-1;return function(e){var a=e<=0?e=0:e>=1?(e=1,n-1):Math.floor(e*n),o=t[a],u=t[a+1],i=a>0?t[a-1]:2*o-u,c=a()=>t;function u(t,n){return function(r){return t+r*n}}function i(t,n){var r=n-t;return r?u(t,r>180||r<-180?r-360*Math.round(r/360):r):o(isNaN(t)?n:t)}function c(t){return 1==(t=+t)?l:function(n,r){return r-n?function(t,n,r){return t=Math.pow(t,r),n=Math.pow(n,r)-t,r=1/r,function(e){return Math.pow(t+e*n,r)}}(n,r,t):o(isNaN(n)?r:n)}}function l(t,n){var r=n-t;return r?u(t,r):o(isNaN(t)?n:t)}var f=function t(r){var e=c(r);function a(t,r){var a=e((t=n.rgb(t)).r,(r=n.rgb(r)).r),o=e(t.g,r.g),u=e(t.b,r.b),i=l(t.opacity,r.opacity);return function(n){return t.r=a(n),t.g=o(n),t.b=u(n),t.opacity=i(n),t+""}}return a.gamma=t,a}(1);function s(t){return function(r){var e,a,o=r.length,u=new Array(o),i=new Array(o),c=new Array(o);for(e=0;eo&&(a=n.slice(o,a),i[u]?i[u]+=a:i[++u]=a),(r=r[0])===(e=e[0])?i[u]?i[u]+=e:i[++u]=e:(i[++u]=null,c.push({i:u,x:b(r,e)})),o=w.lastIndex;return o180?n+=360:n-t>180&&(t+=360),o.push({i:r.push(a(r)+"rotate(",null,e)-2,x:b(t,n)})):n&&r.push(a(r)+"rotate("+n+e)}(o.rotate,u.rotate,i,c),function(t,n,r,o){t!==n?o.push({i:r.push(a(r)+"skewX(",null,e)-2,x:b(t,n)}):n&&r.push(a(r)+"skewX("+n+e)}(o.skewX,u.skewX,i,c),function(t,n,r,e,o,u){if(t!==r||n!==e){var i=o.push(a(o)+"scale(",null,",",null,")");u.push({i:i-4,x:b(t,r)},{i:i-2,x:b(n,e)})}else 1===r&&1===e||o.push(a(o)+"scale("+r+","+e+")")}(o.scaleX,o.scaleY,u.scaleX,u.scaleY,i,c),o=u=null,function(t){for(var n,r=-1,e=c.length;++r=12" + } +} diff --git a/node_modules/d3-interpolate/src/array.js b/node_modules/d3-interpolate/src/array.js new file mode 100644 index 0000000..89f7722 --- /dev/null +++ b/node_modules/d3-interpolate/src/array.js @@ -0,0 +1,22 @@ +import value from "./value.js"; +import numberArray, {isNumberArray} from "./numberArray.js"; + +export default function(a, b) { + return (isNumberArray(b) ? numberArray : genericArray)(a, b); +} + +export function genericArray(a, b) { + var nb = b ? b.length : 0, + na = a ? Math.min(nb, a.length) : 0, + x = new Array(na), + c = new Array(nb), + i; + + for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]); + for (; i < nb; ++i) c[i] = b[i]; + + return function(t) { + for (i = 0; i < na; ++i) c[i] = x[i](t); + return c; + }; +} diff --git a/node_modules/d3-interpolate/src/basis.js b/node_modules/d3-interpolate/src/basis.js new file mode 100644 index 0000000..0d853f0 --- /dev/null +++ b/node_modules/d3-interpolate/src/basis.js @@ -0,0 +1,19 @@ +export function basis(t1, v0, v1, v2, v3) { + var t2 = t1 * t1, t3 = t2 * t1; + return ((1 - 3 * t1 + 3 * t2 - t3) * v0 + + (4 - 6 * t2 + 3 * t3) * v1 + + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2 + + t3 * v3) / 6; +} + +export default function(values) { + var n = values.length - 1; + return function(t) { + var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n), + v1 = values[i], + v2 = values[i + 1], + v0 = i > 0 ? values[i - 1] : 2 * v1 - v2, + v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1; + return basis((t - i / n) * n, v0, v1, v2, v3); + }; +} diff --git a/node_modules/d3-interpolate/src/basisClosed.js b/node_modules/d3-interpolate/src/basisClosed.js new file mode 100644 index 0000000..2639d92 --- /dev/null +++ b/node_modules/d3-interpolate/src/basisClosed.js @@ -0,0 +1,13 @@ +import {basis} from "./basis.js"; + +export default function(values) { + var n = values.length; + return function(t) { + var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n), + v0 = values[(i + n - 1) % n], + v1 = values[i % n], + v2 = values[(i + 1) % n], + v3 = values[(i + 2) % n]; + return basis((t - i / n) * n, v0, v1, v2, v3); + }; +} diff --git a/node_modules/d3-interpolate/src/color.js b/node_modules/d3-interpolate/src/color.js new file mode 100644 index 0000000..4630fb2 --- /dev/null +++ b/node_modules/d3-interpolate/src/color.js @@ -0,0 +1,29 @@ +import constant from "./constant.js"; + +function linear(a, d) { + return function(t) { + return a + t * d; + }; +} + +function exponential(a, b, y) { + return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) { + return Math.pow(a + t * b, y); + }; +} + +export function hue(a, b) { + var d = b - a; + return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a); +} + +export function gamma(y) { + return (y = +y) === 1 ? nogamma : function(a, b) { + return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a); + }; +} + +export default function nogamma(a, b) { + var d = b - a; + return d ? linear(a, d) : constant(isNaN(a) ? b : a); +} diff --git a/node_modules/d3-interpolate/src/constant.js b/node_modules/d3-interpolate/src/constant.js new file mode 100644 index 0000000..3487c0d --- /dev/null +++ b/node_modules/d3-interpolate/src/constant.js @@ -0,0 +1 @@ +export default x => () => x; diff --git a/node_modules/d3-interpolate/src/cubehelix.js b/node_modules/d3-interpolate/src/cubehelix.js new file mode 100644 index 0000000..2c4f64b --- /dev/null +++ b/node_modules/d3-interpolate/src/cubehelix.js @@ -0,0 +1,29 @@ +import {cubehelix as colorCubehelix} from "d3-color"; +import color, {hue} from "./color.js"; + +function cubehelix(hue) { + return (function cubehelixGamma(y) { + y = +y; + + function cubehelix(start, end) { + var h = hue((start = colorCubehelix(start)).h, (end = colorCubehelix(end)).h), + s = color(start.s, end.s), + l = color(start.l, end.l), + opacity = color(start.opacity, end.opacity); + return function(t) { + start.h = h(t); + start.s = s(t); + start.l = l(Math.pow(t, y)); + start.opacity = opacity(t); + return start + ""; + }; + } + + cubehelix.gamma = cubehelixGamma; + + return cubehelix; + })(1); +} + +export default cubehelix(hue); +export var cubehelixLong = cubehelix(color); diff --git a/node_modules/d3-interpolate/src/date.js b/node_modules/d3-interpolate/src/date.js new file mode 100644 index 0000000..cdfbea7 --- /dev/null +++ b/node_modules/d3-interpolate/src/date.js @@ -0,0 +1,6 @@ +export default function(a, b) { + var d = new Date; + return a = +a, b = +b, function(t) { + return d.setTime(a * (1 - t) + b * t), d; + }; +} diff --git a/node_modules/d3-interpolate/src/discrete.js b/node_modules/d3-interpolate/src/discrete.js new file mode 100644 index 0000000..b3d1e3b --- /dev/null +++ b/node_modules/d3-interpolate/src/discrete.js @@ -0,0 +1,6 @@ +export default function(range) { + var n = range.length; + return function(t) { + return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))]; + }; +} diff --git a/node_modules/d3-interpolate/src/hcl.js b/node_modules/d3-interpolate/src/hcl.js new file mode 100644 index 0000000..0312580 --- /dev/null +++ b/node_modules/d3-interpolate/src/hcl.js @@ -0,0 +1,21 @@ +import {hcl as colorHcl} from "d3-color"; +import color, {hue} from "./color.js"; + +function hcl(hue) { + return function(start, end) { + var h = hue((start = colorHcl(start)).h, (end = colorHcl(end)).h), + c = color(start.c, end.c), + l = color(start.l, end.l), + opacity = color(start.opacity, end.opacity); + return function(t) { + start.h = h(t); + start.c = c(t); + start.l = l(t); + start.opacity = opacity(t); + return start + ""; + }; + } +} + +export default hcl(hue); +export var hclLong = hcl(color); diff --git a/node_modules/d3-interpolate/src/hsl.js b/node_modules/d3-interpolate/src/hsl.js new file mode 100644 index 0000000..2f78a90 --- /dev/null +++ b/node_modules/d3-interpolate/src/hsl.js @@ -0,0 +1,21 @@ +import {hsl as colorHsl} from "d3-color"; +import color, {hue} from "./color.js"; + +function hsl(hue) { + return function(start, end) { + var h = hue((start = colorHsl(start)).h, (end = colorHsl(end)).h), + s = color(start.s, end.s), + l = color(start.l, end.l), + opacity = color(start.opacity, end.opacity); + return function(t) { + start.h = h(t); + start.s = s(t); + start.l = l(t); + start.opacity = opacity(t); + return start + ""; + }; + } +} + +export default hsl(hue); +export var hslLong = hsl(color); diff --git a/node_modules/d3-interpolate/src/hue.js b/node_modules/d3-interpolate/src/hue.js new file mode 100644 index 0000000..5d8d4b9 --- /dev/null +++ b/node_modules/d3-interpolate/src/hue.js @@ -0,0 +1,9 @@ +import {hue} from "./color.js"; + +export default function(a, b) { + var i = hue(+a, +b); + return function(t) { + var x = i(t); + return x - 360 * Math.floor(x / 360); + }; +} diff --git a/node_modules/d3-interpolate/src/index.js b/node_modules/d3-interpolate/src/index.js new file mode 100644 index 0000000..b4dce7d --- /dev/null +++ b/node_modules/d3-interpolate/src/index.js @@ -0,0 +1,21 @@ +export {default as interpolate} from "./value.js"; +export {default as interpolateArray} from "./array.js"; +export {default as interpolateBasis} from "./basis.js"; +export {default as interpolateBasisClosed} from "./basisClosed.js"; +export {default as interpolateDate} from "./date.js"; +export {default as interpolateDiscrete} from "./discrete.js"; +export {default as interpolateHue} from "./hue.js"; +export {default as interpolateNumber} from "./number.js"; +export {default as interpolateNumberArray} from "./numberArray.js"; +export {default as interpolateObject} from "./object.js"; +export {default as interpolateRound} from "./round.js"; +export {default as interpolateString} from "./string.js"; +export {interpolateTransformCss, interpolateTransformSvg} from "./transform/index.js"; +export {default as interpolateZoom} from "./zoom.js"; +export {default as interpolateRgb, rgbBasis as interpolateRgbBasis, rgbBasisClosed as interpolateRgbBasisClosed} from "./rgb.js"; +export {default as interpolateHsl, hslLong as interpolateHslLong} from "./hsl.js"; +export {default as interpolateLab} from "./lab.js"; +export {default as interpolateHcl, hclLong as interpolateHclLong} from "./hcl.js"; +export {default as interpolateCubehelix, cubehelixLong as interpolateCubehelixLong} from "./cubehelix.js"; +export {default as piecewise} from "./piecewise.js"; +export {default as quantize} from "./quantize.js"; diff --git a/node_modules/d3-interpolate/src/lab.js b/node_modules/d3-interpolate/src/lab.js new file mode 100644 index 0000000..8fbf7f3 --- /dev/null +++ b/node_modules/d3-interpolate/src/lab.js @@ -0,0 +1,16 @@ +import {lab as colorLab} from "d3-color"; +import color from "./color.js"; + +export default function lab(start, end) { + var l = color((start = colorLab(start)).l, (end = colorLab(end)).l), + a = color(start.a, end.a), + b = color(start.b, end.b), + opacity = color(start.opacity, end.opacity); + return function(t) { + start.l = l(t); + start.a = a(t); + start.b = b(t); + start.opacity = opacity(t); + return start + ""; + }; +} diff --git a/node_modules/d3-interpolate/src/number.js b/node_modules/d3-interpolate/src/number.js new file mode 100644 index 0000000..837b13d --- /dev/null +++ b/node_modules/d3-interpolate/src/number.js @@ -0,0 +1,5 @@ +export default function(a, b) { + return a = +a, b = +b, function(t) { + return a * (1 - t) + b * t; + }; +} diff --git a/node_modules/d3-interpolate/src/numberArray.js b/node_modules/d3-interpolate/src/numberArray.js new file mode 100644 index 0000000..4081086 --- /dev/null +++ b/node_modules/d3-interpolate/src/numberArray.js @@ -0,0 +1,14 @@ +export default function(a, b) { + if (!b) b = []; + var n = a ? Math.min(b.length, a.length) : 0, + c = b.slice(), + i; + return function(t) { + for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t; + return c; + }; +} + +export function isNumberArray(x) { + return ArrayBuffer.isView(x) && !(x instanceof DataView); +} diff --git a/node_modules/d3-interpolate/src/object.js b/node_modules/d3-interpolate/src/object.js new file mode 100644 index 0000000..b521c33 --- /dev/null +++ b/node_modules/d3-interpolate/src/object.js @@ -0,0 +1,23 @@ +import value from "./value.js"; + +export default function(a, b) { + var i = {}, + c = {}, + k; + + if (a === null || typeof a !== "object") a = {}; + if (b === null || typeof b !== "object") b = {}; + + for (k in b) { + if (k in a) { + i[k] = value(a[k], b[k]); + } else { + c[k] = b[k]; + } + } + + return function(t) { + for (k in i) c[k] = i[k](t); + return c; + }; +} diff --git a/node_modules/d3-interpolate/src/piecewise.js b/node_modules/d3-interpolate/src/piecewise.js new file mode 100644 index 0000000..8b568c5 --- /dev/null +++ b/node_modules/d3-interpolate/src/piecewise.js @@ -0,0 +1,11 @@ +import {default as value} from "./value.js"; + +export default function piecewise(interpolate, values) { + if (values === undefined) values = interpolate, interpolate = value; + var i = 0, n = values.length - 1, v = values[0], I = new Array(n < 0 ? 0 : n); + while (i < n) I[i] = interpolate(v, v = values[++i]); + return function(t) { + var i = Math.max(0, Math.min(n - 1, Math.floor(t *= n))); + return I[i](t - i); + }; +} diff --git a/node_modules/d3-interpolate/src/quantize.js b/node_modules/d3-interpolate/src/quantize.js new file mode 100644 index 0000000..d7c23e6 --- /dev/null +++ b/node_modules/d3-interpolate/src/quantize.js @@ -0,0 +1,5 @@ +export default function(interpolator, n) { + var samples = new Array(n); + for (var i = 0; i < n; ++i) samples[i] = interpolator(i / (n - 1)); + return samples; +} diff --git a/node_modules/d3-interpolate/src/rgb.js b/node_modules/d3-interpolate/src/rgb.js new file mode 100644 index 0000000..495c1f8 --- /dev/null +++ b/node_modules/d3-interpolate/src/rgb.js @@ -0,0 +1,55 @@ +import {rgb as colorRgb} from "d3-color"; +import basis from "./basis.js"; +import basisClosed from "./basisClosed.js"; +import nogamma, {gamma} from "./color.js"; + +export default (function rgbGamma(y) { + var color = gamma(y); + + function rgb(start, end) { + var r = color((start = colorRgb(start)).r, (end = colorRgb(end)).r), + g = color(start.g, end.g), + b = color(start.b, end.b), + opacity = nogamma(start.opacity, end.opacity); + return function(t) { + start.r = r(t); + start.g = g(t); + start.b = b(t); + start.opacity = opacity(t); + return start + ""; + }; + } + + rgb.gamma = rgbGamma; + + return rgb; +})(1); + +function rgbSpline(spline) { + return function(colors) { + var n = colors.length, + r = new Array(n), + g = new Array(n), + b = new Array(n), + i, color; + for (i = 0; i < n; ++i) { + color = colorRgb(colors[i]); + r[i] = color.r || 0; + g[i] = color.g || 0; + b[i] = color.b || 0; + } + r = spline(r); + g = spline(g); + b = spline(b); + color.opacity = 1; + return function(t) { + color.r = r(t); + color.g = g(t); + color.b = b(t); + return color + ""; + }; + }; +} + +export var rgbBasis = rgbSpline(basis); +export var rgbBasisClosed = rgbSpline(basisClosed); diff --git a/node_modules/d3-interpolate/src/round.js b/node_modules/d3-interpolate/src/round.js new file mode 100644 index 0000000..2635d28 --- /dev/null +++ b/node_modules/d3-interpolate/src/round.js @@ -0,0 +1,5 @@ +export default function(a, b) { + return a = +a, b = +b, function(t) { + return Math.round(a * (1 - t) + b * t); + }; +} diff --git a/node_modules/d3-interpolate/src/string.js b/node_modules/d3-interpolate/src/string.js new file mode 100644 index 0000000..7f04d2d --- /dev/null +++ b/node_modules/d3-interpolate/src/string.js @@ -0,0 +1,64 @@ +import number from "./number.js"; + +var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, + reB = new RegExp(reA.source, "g"); + +function zero(b) { + return function() { + return b; + }; +} + +function one(b) { + return function(t) { + return b(t) + ""; + }; +} + +export default function(a, b) { + var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b + am, // current match in a + bm, // current match in b + bs, // string preceding current number in b, if any + i = -1, // index in s + s = [], // string constants and placeholders + q = []; // number interpolators + + // Coerce inputs to strings. + a = a + "", b = b + ""; + + // Interpolate pairs of numbers in a & b. + while ((am = reA.exec(a)) + && (bm = reB.exec(b))) { + if ((bs = bm.index) > bi) { // a string precedes the next number in b + bs = b.slice(bi, bs); + if (s[i]) s[i] += bs; // coalesce with previous string + else s[++i] = bs; + } + if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match + if (s[i]) s[i] += bm; // coalesce with previous string + else s[++i] = bm; + } else { // interpolate non-matching numbers + s[++i] = null; + q.push({i: i, x: number(am, bm)}); + } + bi = reB.lastIndex; + } + + // Add remains of b. + if (bi < b.length) { + bs = b.slice(bi); + if (s[i]) s[i] += bs; // coalesce with previous string + else s[++i] = bs; + } + + // Special optimization for only a single match. + // Otherwise, interpolate each of the numbers and rejoin the string. + return s.length < 2 ? (q[0] + ? one(q[0].x) + : zero(b)) + : (b = q.length, function(t) { + for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t); + return s.join(""); + }); +} diff --git a/node_modules/d3-interpolate/src/transform/decompose.js b/node_modules/d3-interpolate/src/transform/decompose.js new file mode 100644 index 0000000..3535f23 --- /dev/null +++ b/node_modules/d3-interpolate/src/transform/decompose.js @@ -0,0 +1,26 @@ +var degrees = 180 / Math.PI; + +export var identity = { + translateX: 0, + translateY: 0, + rotate: 0, + skewX: 0, + scaleX: 1, + scaleY: 1 +}; + +export default function(a, b, c, d, e, f) { + var scaleX, scaleY, skewX; + if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX; + if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX; + if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY; + if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX; + return { + translateX: e, + translateY: f, + rotate: Math.atan2(b, a) * degrees, + skewX: Math.atan(skewX) * degrees, + scaleX: scaleX, + scaleY: scaleY + }; +} diff --git a/node_modules/d3-interpolate/src/transform/index.js b/node_modules/d3-interpolate/src/transform/index.js new file mode 100644 index 0000000..5383d5f --- /dev/null +++ b/node_modules/d3-interpolate/src/transform/index.js @@ -0,0 +1,63 @@ +import number from "../number.js"; +import {parseCss, parseSvg} from "./parse.js"; + +function interpolateTransform(parse, pxComma, pxParen, degParen) { + + function pop(s) { + return s.length ? s.pop() + " " : ""; + } + + function translate(xa, ya, xb, yb, s, q) { + if (xa !== xb || ya !== yb) { + var i = s.push("translate(", null, pxComma, null, pxParen); + q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)}); + } else if (xb || yb) { + s.push("translate(" + xb + pxComma + yb + pxParen); + } + } + + function rotate(a, b, s, q) { + if (a !== b) { + if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path + q.push({i: s.push(pop(s) + "rotate(", null, degParen) - 2, x: number(a, b)}); + } else if (b) { + s.push(pop(s) + "rotate(" + b + degParen); + } + } + + function skewX(a, b, s, q) { + if (a !== b) { + q.push({i: s.push(pop(s) + "skewX(", null, degParen) - 2, x: number(a, b)}); + } else if (b) { + s.push(pop(s) + "skewX(" + b + degParen); + } + } + + function scale(xa, ya, xb, yb, s, q) { + if (xa !== xb || ya !== yb) { + var i = s.push(pop(s) + "scale(", null, ",", null, ")"); + q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)}); + } else if (xb !== 1 || yb !== 1) { + s.push(pop(s) + "scale(" + xb + "," + yb + ")"); + } + } + + return function(a, b) { + var s = [], // string constants and placeholders + q = []; // number interpolators + a = parse(a), b = parse(b); + translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q); + rotate(a.rotate, b.rotate, s, q); + skewX(a.skewX, b.skewX, s, q); + scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q); + a = b = null; // gc + return function(t) { + var i = -1, n = q.length, o; + while (++i < n) s[(o = q[i]).i] = o.x(t); + return s.join(""); + }; + }; +} + +export var interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)"); +export var interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")"); diff --git a/node_modules/d3-interpolate/src/transform/parse.js b/node_modules/d3-interpolate/src/transform/parse.js new file mode 100644 index 0000000..c62088e --- /dev/null +++ b/node_modules/d3-interpolate/src/transform/parse.js @@ -0,0 +1,18 @@ +import decompose, {identity} from "./decompose.js"; + +var svgNode; + +/* eslint-disable no-undef */ +export function parseCss(value) { + const m = new (typeof DOMMatrix === "function" ? DOMMatrix : WebKitCSSMatrix)(value + ""); + return m.isIdentity ? identity : decompose(m.a, m.b, m.c, m.d, m.e, m.f); +} + +export function parseSvg(value) { + if (value == null) return identity; + if (!svgNode) svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g"); + svgNode.setAttribute("transform", value); + if (!(value = svgNode.transform.baseVal.consolidate())) return identity; + value = value.matrix; + return decompose(value.a, value.b, value.c, value.d, value.e, value.f); +} diff --git a/node_modules/d3-interpolate/src/value.js b/node_modules/d3-interpolate/src/value.js new file mode 100644 index 0000000..6a67ac4 --- /dev/null +++ b/node_modules/d3-interpolate/src/value.js @@ -0,0 +1,22 @@ +import {color} from "d3-color"; +import rgb from "./rgb.js"; +import {genericArray} from "./array.js"; +import date from "./date.js"; +import number from "./number.js"; +import object from "./object.js"; +import string from "./string.js"; +import constant from "./constant.js"; +import numberArray, {isNumberArray} from "./numberArray.js"; + +export default function(a, b) { + var t = typeof b, c; + return b == null || t === "boolean" ? constant(b) + : (t === "number" ? number + : t === "string" ? ((c = color(b)) ? (b = c, rgb) : string) + : b instanceof color ? rgb + : b instanceof Date ? date + : isNumberArray(b) ? numberArray + : Array.isArray(b) ? genericArray + : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object + : number)(a, b); +} diff --git a/node_modules/d3-interpolate/src/zoom.js b/node_modules/d3-interpolate/src/zoom.js new file mode 100644 index 0000000..f275602 --- /dev/null +++ b/node_modules/d3-interpolate/src/zoom.js @@ -0,0 +1,71 @@ +var epsilon2 = 1e-12; + +function cosh(x) { + return ((x = Math.exp(x)) + 1 / x) / 2; +} + +function sinh(x) { + return ((x = Math.exp(x)) - 1 / x) / 2; +} + +function tanh(x) { + return ((x = Math.exp(2 * x)) - 1) / (x + 1); +} + +export default (function zoomRho(rho, rho2, rho4) { + + // p0 = [ux0, uy0, w0] + // p1 = [ux1, uy1, w1] + function zoom(p0, p1) { + var ux0 = p0[0], uy0 = p0[1], w0 = p0[2], + ux1 = p1[0], uy1 = p1[1], w1 = p1[2], + dx = ux1 - ux0, + dy = uy1 - uy0, + d2 = dx * dx + dy * dy, + i, + S; + + // Special case for u0 ≅ u1. + if (d2 < epsilon2) { + S = Math.log(w1 / w0) / rho; + i = function(t) { + return [ + ux0 + t * dx, + uy0 + t * dy, + w0 * Math.exp(rho * t * S) + ]; + } + } + + // General case. + else { + var d1 = Math.sqrt(d2), + b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1), + b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1), + r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0), + r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1); + S = (r1 - r0) / rho; + i = function(t) { + var s = t * S, + coshr0 = cosh(r0), + u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0)); + return [ + ux0 + u * dx, + uy0 + u * dy, + w0 * coshr0 / cosh(rho * s + r0) + ]; + } + } + + i.duration = S * 1000 * rho / Math.SQRT2; + + return i; + } + + zoom.rho = function(_) { + var _1 = Math.max(1e-3, +_), _2 = _1 * _1, _4 = _2 * _2; + return zoomRho(_1, _2, _4); + }; + + return zoom; +})(Math.SQRT2, 2, 4); diff --git a/node_modules/d3-selection/LICENSE b/node_modules/d3-selection/LICENSE new file mode 100644 index 0000000..b014515 --- /dev/null +++ b/node_modules/d3-selection/LICENSE @@ -0,0 +1,13 @@ +Copyright 2010-2021 Mike Bostock + +Permission to use, copy, modify, and/or distribute this software for any purpose +with or without fee is hereby granted, provided that the above copyright notice +and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. diff --git a/node_modules/d3-selection/README.md b/node_modules/d3-selection/README.md new file mode 100644 index 0000000..b8513c6 --- /dev/null +++ b/node_modules/d3-selection/README.md @@ -0,0 +1,863 @@ +# d3-selection + +Selections allow powerful data-driven transformation of the document object model (DOM): set [attributes](#selection_attr), [styles](#selection_style), [properties](#selection_property), [HTML](#selection_html) or [text](#selection_text) content, and more. Using the [data join](#joining-data)’s [enter](#selection_enter) and [exit](#selection_enter) selections, you can also [add](#selection_append) or [remove](#selection_remove) elements to correspond to data. + +Selection methods typically return the current selection, or a new selection, allowing the concise application of multiple operations on a given selection via method chaining. For example, to set the class and color style of all paragraph elements in the current document: + +```js +d3.selectAll("p") + .attr("class", "graf") + .style("color", "red"); +``` + +This is equivalent to: + +```js +const p = d3.selectAll("p"); +p.attr("class", "graf"); +p.style("color", "red"); +``` + +By convention, selection methods that return the current selection use *four* spaces of indent, while methods that return a new selection use only *two*. This helps reveal changes of context by making them stick out of the chain: + +```js +d3.select("body") + .append("svg") + .attr("width", 960) + .attr("height", 500) + .append("g") + .attr("transform", "translate(20,20)") + .append("rect") + .attr("width", 920) + .attr("height", 460); +``` + +Selections are immutable. All selection methods that affect which elements are selected (or their order) return a new selection rather than modifying the current selection. However, note that elements are necessarily mutable, as selections drive transformations of the document! + +For more, see [the d3-selection collection on Observable](https://observablehq.com/collection/@d3/d3-selection). + +## Installing + +If you use npm, `npm install d3-selection`. You can also download the [latest release on GitHub](https://github.com/d3/d3-selection/releases/latest). For vanilla HTML in modern browsers, import d3-selection from Skypack: + +```html + +``` + +For legacy environments, you can load d3-selection’s UMD bundle from an npm-based CDN such as jsDelivr; a `d3` global is exported: + +```html + + +``` + +[Try d3-selection in your browser.](https://observablehq.com/collection/@d3/d3-selection) + +## API Reference + +* [Selecting Elements](#selecting-elements) +* [Modifying Elements](#modifying-elements) +* [Joining Data](#joining-data) +* [Handling Events](#handling-events) +* [Control Flow](#control-flow) +* [Local Variables](#local-variables) +* [Namespaces](#namespaces) + +### Selecting Elements + +Selection methods accept [W3C selector strings](http://www.w3.org/TR/selectors-api/) such as `.fancy` to select elements with the class *fancy*, or `div` to select DIV elements. Selection methods come in two forms: select and selectAll: the former selects only the first matching element, while the latter selects all matching elements in document order. The top-level selection methods, [d3.select](#select) and [d3.selectAll](#selectAll), query the entire document; the subselection methods, [*selection*.select](#selection_select) and [*selection*.selectAll](#selection_selectAll), restrict selection to descendants of the selected elements. + +# d3.selection() · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/index.js) + +[Selects](#select) the root element, `document.documentElement`. This function can also be used to test for selections (`instanceof d3.selection`) or to extend the selection prototype. For example, to add a method to check checkboxes: + +```js +d3.selection.prototype.checked = function(value) { + return arguments.length < 1 + ? this.property("checked") + : this.property("checked", !!value); +}; +``` + +And then to use: + +```js +d3.selectAll("input[type=checkbox]").checked(true); +``` + +# d3.select(selector) · [Source](https://github.com/d3/d3-selection/blob/master/src/select.js) + +Selects the first element that matches the specified *selector* string. If no elements match the *selector*, returns an empty selection. If multiple elements match the *selector*, only the first matching element (in document order) will be selected. For example, to select the first anchor element: + +```js +const anchor = d3.select("a"); +``` + +If the *selector* is not a string, instead selects the specified node; this is useful if you already have a reference to a node, such as `this` within an event listener or a global such as `document.body`. For example, to make a clicked paragraph red: + +```js +d3.selectAll("p").on("click", function(event) { + d3.select(this).style("color", "red"); +}); +``` + +# d3.selectAll(selector) · [Source](https://github.com/d3/d3-selection/blob/master/src/selectAll.js) + +Selects all elements that match the specified *selector* string. The elements will be selected in document order (top-to-bottom). If no elements in the document match the *selector*, or if the *selector* is null or undefined, returns an empty selection. For example, to select all paragraphs: + +```js +const paragraph = d3.selectAll("p"); +``` + +If the *selector* is not a string, instead selects the specified array of nodes; this is useful if you already have a reference to nodes, such as `this.childNodes` within an event listener or a global such as `document.links`. The nodes may instead be an iterable, or a pseudo-array such as a NodeList. For example, to color all links red: + +```js +d3.selectAll(document.links).style("color", "red"); +``` + +# selection.select(selector) · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/select.js) + +For each selected element, selects the first descendant element that matches the specified *selector* string. If no element matches the specified selector for the current element, the element at the current index will be null in the returned selection. (If the *selector* is null, every element in the returned selection will be null, resulting in an empty selection.) If the current element has associated data, this data is propagated to the corresponding selected element. If multiple elements match the selector, only the first matching element in document order is selected. For example, to select the first bold element in every paragraph: + +```js +const b = d3.selectAll("p").select("b"); +``` + +If the *selector* is a function, it is evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element (*nodes*[*i*]). It must return an element, or null if there is no matching element. For example, to select the previous sibling of each paragraph: + +```js +const previous = d3.selectAll("p").select(function() { + return this.previousElementSibling; +}); +``` + +Unlike [*selection*.selectAll](#selection_selectAll), *selection*.select does not affect grouping: it preserves the existing group structure and indexes, and propagates data (if any) to selected children. Grouping plays an important role in the [data join](#joining-data). See [Nested Selections](http://bost.ocks.org/mike/nest/) and [How Selections Work](http://bost.ocks.org/mike/selection/) for more on this topic. + +# selection.selectAll(selector) · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/selectAll.js) + +For each selected element, selects the descendant elements that match the specified *selector* string. The elements in the returned selection are grouped by their corresponding parent node in this selection. If no element matches the specified selector for the current element, or if the *selector* is null, the group at the current index will be empty. The selected elements do not inherit data from this selection; use [*selection*.data](#selection_data) to propagate data to children. For example, to select the bold elements in every paragraph: + +```js +const b = d3.selectAll("p").selectAll("b"); +``` + +If the *selector* is a function, it is evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element (*nodes*[*i*]). It must return an array of elements (or an iterable, or a pseudo-array such as a NodeList), or the empty array if there are no matching elements. For example, to select the previous and next siblings of each paragraph: + +```js +const sibling = d3.selectAll("p").selectAll(function() { + return [ + this.previousElementSibling, + this.nextElementSibling + ]; +}); +``` + +Unlike [*selection*.select](#selection_select), *selection*.selectAll does affect grouping: each selected descendant is grouped by the parent element in the originating selection. Grouping plays an important role in the [data join](#joining-data). See [Nested Selections](http://bost.ocks.org/mike/nest/) and [How Selections Work](http://bost.ocks.org/mike/selection/) for more on this topic. + +# selection.filter(filter) · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/filter.js) + +Filters the selection, returning a new selection that contains only the elements for which the specified *filter* is true. The *filter* may be specified either as a selector string or a function. If the *filter* is a function, it is evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element (*nodes*[*i*]). + +For example, to filter a selection of table rows to contain only even rows: + +```js +const even = d3.selectAll("tr").filter(":nth-child(even)"); +``` + +This is approximately equivalent to using [d3.selectAll](#selectAll) directly, although the indexes may be different: + +```js +const even = d3.selectAll("tr:nth-child(even)"); +``` + +Similarly, using a function: + +```js +const even = d3.selectAll("tr").filter((d, i) => i & 1); +``` + +Or using [*selection*.select](#selection_select) (and avoiding an arrow function, since *this* is needed to refer to the current element): + +```js +const even = d3.selectAll("tr").select(function(d, i) { return i & 1 ? this : null; }); +``` + +Note that the `:nth-child` pseudo-class is a one-based index rather than a zero-based index. Also, the above filter functions do not have precisely the same meaning as `:nth-child`; they rely on the selection index rather than the number of preceding sibling elements in the DOM. + +The returned filtered selection preserves the parents of this selection, but like [*array*.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter), it does not preserve indexes as some elements may be removed; use [*selection*.select](#selection_select) to preserve the index, if needed. + +# selection.merge(other) · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/merge.js) + +Returns a new selection merging this selection with the specified *other* selection or transition. The returned selection has the same number of groups and the same parents as this selection. Any missing (null) elements in this selection are filled with the corresponding element, if present (not null), from the specified *selection*. (If the *other* selection has additional groups or parents, they are ignored.) + +This method is used internally by [*selection*.join](#selection_join) to merge the [enter](#selection_enter) and [update](#selection_data) selections after [binding data](#joining-data). You can also merge explicitly, although note that since merging is based on element index, you should use operations that preserve index, such as [*selection*.select](#selection_select) instead of [*selection*.filter](#selection_filter). For example: + +```js +const odd = selection.select(function(d, i) { return i & 1 ? this : null; )); +const even = selection.select(function(d, i) { return i & 1 ? null : this; )); +const merged = odd.merge(even); +``` + +See [*selection*.data](#selection_data) for more. + +This method is not intended for concatenating arbitrary selections, however: if both this selection and the specified *other* selection have (non-null) elements at the same index, this selection’s element is returned in the merge and the *other* selection’s element is ignored. + +# selection.selectChild([selector]) · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/selectChild.js) + +Returns a new selection with the (first) child of each element of the current selection matching the *selector*. If no *selector* is specified, selects the first child (if any). If the *selector* is specified as a string, selects the first child that matches (if any). If the *selector* is a function, it is evaluated for each of the children nodes, in order, being passed the child (*child*), the child’s index (*i*), and the list of children (*children*); the method selects the first child for which the selector return truthy, if any. + +# selection.selectChildren([selector]) · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/selectChildren.js) + +Returns a new selection with the children of each element of the current selection matching the *selector*. If no *selector* is specified, selects all the children. If the *selector* is specified as a string, selects the children that match (if any). If the *selector* is a function, it is evaluated for each of the children nodes, in order, being passed the child (*child*), the child’s index (*i*), and the list of children (*children*); the method selects all children for which the selector return truthy. + +# selection.selection() · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/index.js) + +Returns the selection (for symmetry with [transition.selection](https://github.com/d3/d3-transition/blob/master/README.md#transition_selection)). + +# d3.matcher(selector) · [Source](https://github.com/d3/d3-selection/blob/master/src/matcher.js) + +Given the specified *selector*, returns a function which returns true if `this` element [matches](https://developer.mozilla.org/en-US/docs/Web/API/Element/matches) the specified selector. This method is used internally by [*selection*.filter](#selection_filter). For example, this: + +```js +const div = selection.filter("div"); +``` + +Is equivalent to: + +```js +const div = selection.filter(d3.matcher("div")); +``` + +(Although D3 is not a compatibility layer, this implementation does support vendor-prefixed implementations due to the recent standardization of *element*.matches.) + +# d3.selector(selector) · [Source](https://github.com/d3/d3-selection/blob/master/src/selector.js) + +Given the specified *selector*, returns a function which returns the first descendant of `this` element that matches the specified selector. This method is used internally by [*selection*.select](#selection_select). For example, this: + +```js +const div = selection.select("div"); +``` + +Is equivalent to: + +```js +const div = selection.select(d3.selector("div")); +``` + +# d3.selectorAll(selector) · [Source](https://github.com/d3/d3-selection/blob/master/src/selectAll.js) + +Given the specified *selector*, returns a function which returns all descendants of `this` element that match the specified selector. This method is used internally by [*selection*.selectAll](#selection_selectAll). For example, this: + +```js +const div = selection.selectAll("div"); +``` + +Is equivalent to: + +```js +const div = selection.selectAll(d3.selectorAll("div")); +``` + +# d3.window(node) · [Source](https://github.com/d3/d3-selection/blob/master/src/window.js) + +Returns the owner window for the specified *node*. If *node* is a node, returns the owner document’s default view; if *node* is a document, returns its default view; otherwise returns the *node*. + +# d3.style(node, name) · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/style.js) + +Returns the value of the style property with the specified *name* for the specified *node*. If the *node* has an inline style with the specified *name*, its value is returned; otherwise, the [computed property value](https://developer.mozilla.org/en-US/docs/Web/CSS/computed_value) is returned. See also [*selection*.style](#selection_style). + +### Modifying Elements + +After selecting elements, use the selection’s transformation methods to affect document content. For example, to set the name attribute and color style of an anchor element: + +```js +d3.select("a") + .attr("name", "fred") + .style("color", "red"); +``` + +To experiment with selections, visit [d3js.org](https://d3js.org) and open your browser’s developer console! (In Chrome, open the console with ⌥⌘J.) Select elements and then inspect the returned selection to see which elements are selected and how they are grouped. Call selection methods and see how the page content changes. + +# selection.attr(name[, value]) · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/attr.js) + +If a *value* is specified, sets the attribute with the specified *name* to the specified value on the selected elements and returns this selection. If the *value* is a constant, all elements are given the same attribute value; otherwise, if the *value* is a function, it is evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element (*nodes*[*i*]). The function’s return value is then used to set each element’s attribute. A null value will remove the specified attribute. + +If a *value* is not specified, returns the current value of the specified attribute for the first (non-null) element in the selection. This is generally useful only if you know that the selection contains exactly one element. + +The specified *name* may have a namespace prefix, such as `xlink:href` to specify the `href` attribute in the XLink namespace. See [namespaces](#namespaces) for the map of supported namespaces; additional namespaces can be registered by adding to the map. + +# selection.classed(names[, value]) · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/classed.js) + +If a *value* is specified, assigns or unassigns the specified CSS class *names* on the selected elements by setting the `class` attribute or modifying the `classList` property and returns this selection. The specified *names* is a string of space-separated class names. For example, to assign the classes `foo` and `bar` to the selected elements: + +```js +selection.classed("foo bar", true); +``` + +If the *value* is truthy, then all elements are assigned the specified classes; otherwise, the classes are unassigned. If the *value* is a function, it is evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element (*nodes*[*i*]). The function’s return value is then used to assign or unassign classes on each element. For example, to randomly associate the class *foo* with on average half the selected elements: + +```js +selection.classed("foo", () => Math.random() > 0.5); +``` + +If a *value* is not specified, returns true if and only if the first (non-null) selected element has the specified *classes*. This is generally useful only if you know the selection contains exactly one element. + +# selection.style(name[, value[, priority]]) · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/style.js) + +If a *value* is specified, sets the style property with the specified *name* to the specified value on the selected elements and returns this selection. If the *value* is a constant, then all elements are given the same style property value; otherwise, if the *value* is a function, it is evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element (*nodes*[*i*]). The function’s return value is then used to set each element’s style property. A null value will remove the style property. An optional *priority* may also be specified, either as null or the string `important` (without the exclamation point). + +If a *value* is not specified, returns the current value of the specified style property for the first (non-null) element in the selection. The current value is defined as the element’s inline value, if present, and otherwise its [computed value](https://developer.mozilla.org/en-US/docs/Web/CSS/computed_value). Accessing the current style value is generally useful only if you know the selection contains exactly one element. + +Caution: unlike many SVG attributes, CSS styles typically have associated units. For example, `3px` is a valid stroke-width property value, while `3` is not. Some browsers implicitly assign the `px` (pixel) unit to numeric values, but not all browsers do: IE, for example, throws an “invalid arguments” error! + +# selection.property(name[, value]) · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/property.js) + +Some HTML elements have special properties that are not addressable using attributes or styles, such as a form field’s text `value` and a checkbox’s `checked` boolean. Use this method to get or set these properties. + +If a *value* is specified, sets the property with the specified *name* to the specified value on selected elements. If the *value* is a constant, then all elements are given the same property value; otherwise, if the *value* is a function, it is evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element (*nodes*[*i*]). The function’s return value is then used to set each element’s property. A null value will delete the specified property. + +If a *value* is not specified, returns the value of the specified property for the first (non-null) element in the selection. This is generally useful only if you know the selection contains exactly one element. + +# selection.text([value]) · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/text.js) + +If a *value* is specified, sets the [text content](http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-textContent) to the specified value on all selected elements, replacing any existing child elements. If the *value* is a constant, then all elements are given the same text content; otherwise, if the *value* is a function, it is evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element (*nodes*[*i*]). The function’s return value is then used to set each element’s text content. A null value will clear the content. + +If a *value* is not specified, returns the text content for the first (non-null) element in the selection. This is generally useful only if you know the selection contains exactly one element. + +# selection.html([value]) · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/html.js) + +If a *value* is specified, sets the [inner HTML](http://dev.w3.org/html5/spec-LC/apis-in-html-documents.html#innerhtml) to the specified value on all selected elements, replacing any existing child elements. If the *value* is a constant, then all elements are given the same inner HTML; otherwise, if the *value* is a function, it is evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element (*nodes*[*i*]). The function’s return value is then used to set each element’s inner HTML. A null value will clear the content. + +If a *value* is not specified, returns the inner HTML for the first (non-null) element in the selection. This is generally useful only if you know the selection contains exactly one element. + +Use [*selection*.append](#selection_append) or [*selection*.insert](#selection_insert) instead to create data-driven content; this method is intended for when you want a little bit of HTML, say for rich formatting. Also, *selection*.html is only supported on HTML elements. SVG elements and other non-HTML elements do not support the innerHTML property, and thus are incompatible with *selection*.html. Consider using [XMLSerializer](https://developer.mozilla.org/en-US/docs/XMLSerializer) to convert a DOM subtree to text. See also the [innersvg polyfill](https://code.google.com/p/innersvg/), which provides a shim to support the innerHTML property on SVG elements. + +# selection.append(type) · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/append.js) + +If the specified *type* is a string, appends a new element of this type (tag name) as the last child of each selected element, or before the next following sibling in the update selection if this is an [enter selection](#selection_enter). The latter behavior for enter selections allows you to insert elements into the DOM in an order consistent with the new bound data; however, note that [*selection*.order](#selection_order) may still be required if updating elements change order (*i.e.*, if the order of new data is inconsistent with old data). + +If the specified *type* is a function, it is evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element (*nodes*[*i*]). This function should return an element to be appended. (The function typically creates a new element, but it may instead return an existing element.) For example, to append a paragraph to each DIV element: + +```js +d3.selectAll("div").append("p"); +``` + +This is equivalent to: + +```js +d3.selectAll("div").append(() => document.createElement("p")); +``` + +Which is equivalent to: + +```js +d3.selectAll("div").select(function() { + return this.appendChild(document.createElement("p")); +}); +``` + +In both cases, this method returns a new selection containing the appended elements. Each new element inherits the data of the current elements, if any, in the same manner as [*selection*.select](#selection_select). + +The specified *name* may have a namespace prefix, such as `svg:text` to specify a `text` attribute in the SVG namespace. See [namespaces](#namespaces) for the map of supported namespaces; additional namespaces can be registered by adding to the map. If no namespace is specified, the namespace will be inherited from the parent element; or, if the name is one of the known prefixes, the corresponding namespace will be used (for example, `svg` implies `svg:svg`). + +# selection.insert(type[, before]) · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/insert.js) + +If the specified *type* is a string, inserts a new element of this type (tag name) before the first element matching the specified *before* selector for each selected element. For example, a *before* selector `:first-child` will prepend nodes before the first child. If *before* is not specified, it defaults to null. (To append elements in an order consistent with [bound data](#joining-data), use [*selection*.append](#selection_append).) + +Both *type* and *before* may instead be specified as functions which are evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element (*nodes*[*i*]). The *type* function should return an element to be inserted; the *before* function should return the child element before which the element should be inserted. For example, to append a paragraph to each DIV element: + +```js +d3.selectAll("div").insert("p"); +``` + +This is equivalent to: + +```js +d3.selectAll("div").insert(() => document.createElement("p")); +``` + +Which is equivalent to: + +```js +d3.selectAll("div").select(function() { + return this.insertBefore(document.createElement("p"), null); +}); +``` + +In both cases, this method returns a new selection containing the appended elements. Each new element inherits the data of the current elements, if any, in the same manner as [*selection*.select](#selection_select). + +The specified *name* may have a namespace prefix, such as `svg:text` to specify a `text` attribute in the SVG namespace. See [namespaces](#namespaces) for the map of supported namespaces; additional namespaces can be registered by adding to the map. If no namespace is specified, the namespace will be inherited from the parent element; or, if the name is one of the known prefixes, the corresponding namespace will be used (for example, `svg` implies `svg:svg`). + +# selection.remove() · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/remove.js) + +Removes the selected elements from the document. Returns this selection (the removed elements) which are now detached from the DOM. There is not currently a dedicated API to add removed elements back to the document; however, you can pass a function to [*selection*.append](#selection_append) or [*selection*.insert](#selection_insert) to re-add elements. + +# selection.clone([deep]) · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/clone.js) + +Inserts clones of the selected elements immediately following the selected elements and returns a selection of the newly added clones. If *deep* is truthy, the descendant nodes of the selected elements will be cloned as well. Otherwise, only the elements themselves will be cloned. Equivalent to: + +```js +selection.select(function() { + return this.parentNode.insertBefore(this.cloneNode(deep), this.nextSibling); +}); +``` + +# selection.sort(compare) · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/sort.js) + +Returns a new selection that contains a copy of each group in this selection sorted according to the *compare* function. After sorting, re-inserts elements to match the resulting order (per [*selection*.order](#selection_order)). + +The compare function, which defaults to [ascending](https://github.com/d3/d3-array#ascending), is passed two elements’ data *a* and *b* to compare. It should return either a negative, positive, or zero value. If negative, then *a* should be before *b*; if positive, then *a* should be after *b*; otherwise, *a* and *b* are considered equal and the order is arbitrary. + +Note that sorting is not guaranteed to be stable; however, it is guaranteed to have the same behavior as your browser’s built-in [sort](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/sort) method on arrays. + +# selection.order() · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/order.js) + +Re-inserts elements into the document such that the document order of each group matches the selection order. This is equivalent to calling [*selection*.sort](#selection_sort) if the data is already sorted, but much faster. + +# selection.raise() · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/raise.js) + +Re-inserts each selected element, in order, as the last child of its parent. Equivalent to: + +```js +selection.each(function() { + this.parentNode.appendChild(this); +}); +``` + +# selection.lower() · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/lower.js) + +Re-inserts each selected element, in order, as the first child of its parent. Equivalent to: + +```js +selection.each(function() { + this.parentNode.insertBefore(this, this.parentNode.firstChild); +}); +``` + +# d3.create(name) · [Source](https://github.com/d3/d3-selection/blob/master/src/create.js) + +Given the specified element *name*, returns a single-element selection containing a detached element of the given name in the current document. This method assumes the HTML namespace, so you must specify a namespace explicitly when creating SVG or other non-HTML elements; see [namespace](#namespace) for details on supported namespace prefixes. + +```js +d3.create("svg") // equivalent to svg:svg +d3.create("svg:svg") // more explicitly +d3.create("svg:g") // an SVG G element +d3.create("g") // an HTML G (unknown) element +``` + +# d3.creator(name) · [Source](https://github.com/d3/d3-selection/blob/master/src/creator.js) + +Given the specified element *name*, returns a function which creates an element of the given name, assuming that `this` is the parent element. This method is used internally by [*selection*.append](#selection_append) and [*selection*.insert](#selection_insert) to create new elements. For example, this: + +```js +selection.append("div"); +``` + +Is equivalent to: + +```js +selection.append(d3.creator("div")); +``` + +See [namespace](#namespace) for details on supported namespace prefixes, such as for SVG elements. + +### Joining Data + +For an introduction to D3’s data joins, see the [*selection*.join notebook](https://observablehq.com/@d3/selection-join). Also see [Thinking With Joins](http://bost.ocks.org/mike/join/). + +# selection.data([data[, key]]) · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/data.js), [Examples](https://observablehq.com/@d3/brushable-scatterplot) + +Binds the specified array of *data* with the selected elements, returning a new selection that represents the *update* selection: the elements successfully bound to data. Also defines the [enter](#selection_enter) and [exit](#selection_exit) selections on the returned selection, which can be used to add or remove elements to correspond to the new data. The specified *data* is an array of arbitrary values (*e.g.*, numbers or objects), or a function that returns an array of values for each group. When data is assigned to an element, it is stored in the property `__data__`, thus making the data “sticky” and available on re-selection. + +The *data* is specified **for each group** in the selection. If the selection has multiple groups (such as [d3.selectAll](#selectAll) followed by [*selection*.selectAll](#selection_selectAll)), then *data* should typically be specified as a function. This function will be evaluated for each group in order, being passed the group’s parent datum (*d*, which may be undefined), the group index (*i*), and the selection’s parent nodes (*nodes*), with *this* as the group’s parent element. + +In conjunction with [*selection*.join](#selection_join) (or more explicitly with [*selection*.enter](#selection_enter), [*selection*.exit](#selection_exit), [*selection*.append](#selection_append) and [*selection*.remove](#selection_remove)), *selection*.data can be used to enter, update and exit elements to match data. For example, to create an HTML table from a matrix of numbers: + +```js +const matrix = [ + [11975, 5871, 8916, 2868], + [ 1951, 10048, 2060, 6171], + [ 8010, 16145, 8090, 8045], + [ 1013, 990, 940, 6907] +]; + +d3.select("body") + .append("table") + .selectAll("tr") + .data(matrix) + .join("tr") + .selectAll("td") + .data(d => d) + .join("td") + .text(d => d); +``` + +In this example the *data* function is the identity function: for each table row, it returns the corresponding row from the data matrix. + +If a *key* function is not specified, then the first datum in *data* is assigned to the first selected element, the second datum to the second selected element, and so on. A *key* function may be specified to control which datum is assigned to which element, replacing the default join-by-index, by computing a string identifier for each datum and element. This key function is evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element (*nodes*[*i*]); the returned string is the element’s key. The key function is then also evaluated for each new datum in *data*, being passed the current datum (*d*), the current index (*i*), and the group’s new *data*, with *this* as the group’s parent DOM element; the returned string is the datum’s key. The datum for a given key is assigned to the element with the matching key. If multiple elements have the same key, the duplicate elements are put into the exit selection; if multiple data have the same key, the duplicate data are put into the enter selection. + +For example, given this document: + +```html +
+
+
+
+
+
+``` + +You could join data by key as follows: + + +```js +const data = [ + {name: "Locke", number: 4}, + {name: "Reyes", number: 8}, + {name: "Ford", number: 15}, + {name: "Jarrah", number: 16}, + {name: "Shephard", number: 23}, + {name: "Kwon", number: 42} +]; + +d3.selectAll("div") + .data(data, function(d) { return d ? d.name : this.id; }) + .text(d => d.number); +``` + +This example key function uses the datum *d* if present, and otherwise falls back to the element’s id property. Since these elements were not previously bound to data, the datum *d* is null when the key function is evaluated on selected elements, and non-null when the key function is evaluated on the new data. + +The *update* and *enter* selections are returned in data order, while the *exit* selection preserves the selection order prior to the join. If a key function is specified, the order of elements in the selection may not match their order in the document; use [*selection*.order](#selection_order) or [*selection*.sort](#selection_sort) as needed. For more on how the key function affects the join, see [A Bar Chart, Part 2](http://bost.ocks.org/mike/bar/2/) and [Object Constancy](http://bost.ocks.org/mike/constancy/). + +If *data* is not specified, this method returns the array of data for the selected elements. + +This method cannot be used to clear bound data; use [*selection*.datum](#selection_datum) instead. + +# selection.join(enter[, update][, exit]) · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/join.js) + +Appends, removes and reorders elements as necessary to match the data that was previously bound by [*selection*.data](#selection_data), returning the [merged](#selection_merge) enter and update selection. This method is a convenient alternative to the explicit [general update pattern](https://bl.ocks.org/mbostock/3808218), replacing [*selection*.enter](#selection_enter), [*selection*.exit](#selection_exit), [*selection*.append](#selection_append), [*selection*.remove](#selection_remove), and [*selection*.order](#selection_order). For example: + +```js +svg.selectAll("circle") + .data(data) + .join("circle") + .attr("fill", "none") + .attr("stroke", "black"); +``` + +The *enter* function may be specified as a string shorthand, as above, which is equivalent to [*selection*.append](#selection_append) with the given element name. Likewise, optional *update* and *exit* functions may be specified, which default to the identity function and calling [*selection*.remove](#selection_remove), respectively. The shorthand above is thus equivalent to: + +```js +svg.selectAll("circle") + .data(data) + .join( + enter => enter.append("circle"), + update => update, + exit => exit.remove() + ) + .attr("fill", "none") + .attr("stroke", "black"); +```` + +By passing separate functions on enter, update and exit, you have greater control over what happens. And by specifying a key function to [*selection*.data](#selection_data), you can minimize changes to the DOM to optimize performance. For example, to set different fill colors for enter and update: + +```js +svg.selectAll("circle") + .data(data) + .join( + enter => enter.append("circle").attr("fill", "green"), + update => update.attr("fill", "blue") + ) + .attr("stroke", "black"); +``` + +The selections returned by the *enter* and *update* functions are merged and then returned by *selection*.join. + +You can animate enter, update and exit by creating transitions inside the *enter*, *update* and *exit* functions. If the *enter* and *update* functions return transitions, their underlying selections are merged and then returned by *selection*.join. The return value of the *exit* function is not used. + +For more, see the [*selection*.join notebook](https://observablehq.com/@d3/selection-join). + +# selection.enter() · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/enter.js) + +Returns the enter selection: placeholder nodes for each datum that had no corresponding DOM element in the selection. (The enter selection is empty for selections not returned by [*selection*.data](#selection_data).) + +The enter selection is typically used to create “missing” elements corresponding to new data. For example, to create DIV elements from an array of numbers: + +```js +const div = d3.select("body") + .selectAll("div") + .data([4, 8, 15, 16, 23, 42]) + .enter().append("div") + .text(d => d); +``` + +If the body is initially empty, the above code will create six new DIV elements, append them to the body in-order, and assign their text content as the associated (string-coerced) number: + +```html +
4
+
8
+
15
+
16
+
23
+
42
+``` + +Conceptually, the enter selection’s placeholders are pointers to the parent element (in this example, the document body). The enter selection is typically only used transiently to append elements, and is often [merged](#selection_merge) with the update selection after appending, such that modifications can be applied to both entering and updating elements. + +# selection.exit() · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/exit.js) + +Returns the exit selection: existing DOM elements in the selection for which no new datum was found. (The exit selection is empty for selections not returned by [*selection*.data](#selection_data).) + +The exit selection is typically used to remove “superfluous” elements corresponding to old data. For example, to update the DIV elements created previously with a new array of numbers: + +```js +div = div.data([1, 2, 4, 8, 16, 32], d => d); +``` + +Since a key function was specified (as the identity function), and the new data contains the numbers [4, 8, 16] which match existing elements in the document, the update selection contains three DIV elements. Leaving those elements as-is, we can append new elements for [1, 2, 32] using the enter selection: + +```js +div.enter().append("div").text(d => d); +``` + +Likewise, to remove the exiting elements [15, 23, 42]: + +```js +div.exit().remove(); +``` + +Now the document body looks like this: + +```html +
1
+
2
+
4
+
8
+
16
+
32
+``` + +The order of the DOM elements matches the order of the data because the old data’s order and the new data’s order were consistent. If the new data’s order is different, use [*selection*.order](#selection_order) to reorder the elements in the DOM. See the [General Update Pattern](http://bl.ocks.org/mbostock/3808218) example thread for more on data joins. + +# selection.datum([value]) · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/datum.js) + +Gets or sets the bound data for each selected element. Unlike [*selection*.data](#selection_data), this method does not compute a join and does not affect indexes or the enter and exit selections. + +If a *value* is specified, sets the element’s bound data to the specified value on all selected elements. If the *value* is a constant, all elements are given the same datum; otherwise, if the *value* is a function, it is evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element (*nodes*[*i*]). The function is then used to set each element’s new data. A null value will delete the bound data. + +If a *value* is not specified, returns the bound datum for the first (non-null) element in the selection. This is generally useful only if you know the selection contains exactly one element. + +This method is useful for accessing HTML5 [custom data attributes](http://www.w3.org/TR/html5/dom.html#custom-data-attribute). For example, given the following elements: + +```html +
    +
  • Shawn Allen
  • +
  • Mike Bostock
  • +
+``` + +You can expose the custom data attributes by setting each element’s data as the built-in [dataset](http://www.w3.org/TR/html5/dom.html#dom-dataset) property: + +```js +selection.datum(function() { return this.dataset; }) +``` + +### Handling Events + +For interaction, selections allow listening for and dispatching of events. + +# selection.on(typenames[, listener[, options]]) · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/on.js) + +Adds or removes a *listener* to each selected element for the specified event *typenames*. The *typenames* is a string event type, such as `click`, `mouseover`, or `submit`; any [DOM event type](https://developer.mozilla.org/en-US/docs/Web/Events#Standard_events) supported by your browser may be used. The type may be optionally followed by a period (`.`) and a name; the optional name allows multiple callbacks to be registered to receive events of the same type, such as `click.foo` and `click.bar`. To specify multiple typenames, separate typenames with spaces, such as `input change` or `click.foo click.bar`. + +When a specified event is dispatched on a selected element, the specified *listener* will be evaluated for the element, being passed the current event (*event*) and the current datum (*d*), with *this* as the current DOM element (*event*.currentTarget). Listeners always see the latest datum for their element. Note: while you can use [*event*.pageX](https://developer.mozilla.org/en/DOM/event.pageX) and [*event*.pageY](https://developer.mozilla.org/en/DOM/event.pageY) directly, it is often convenient to transform the event position to the local coordinate system of the element that received the event using [d3.pointer](#pointer). + +If an event listener was previously registered for the same *typename* on a selected element, the old listener is removed before the new listener is added. To remove a listener, pass null as the *listener*. To remove all listeners for a given name, pass null as the *listener* and `.foo` as the *typename*, where `foo` is the name; to remove all listeners with no name, specify `.` as the *typename*. + +An optional *options* object may specify characteristics about the event listener, such as whether it is capturing or passive; see [*element*.addEventListener](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener). + +If a *listener* is not specified, returns the currently-assigned listener for the specified event *typename* on the first (non-null) selected element, if any. If multiple typenames are specified, the first matching listener is returned. + +# selection.dispatch(type[, parameters]) · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/dispatch.js) + +Dispatches a [custom event](http://www.w3.org/TR/dom/#interface-customevent) of the specified *type* to each selected element, in order. An optional *parameters* map may be specified to set additional properties of the event. It may contain the following fields: + +* [`bubbles`](https://www.w3.org/TR/dom/#dom-event-bubbles) - if true, the event is dispatched to ancestors in reverse tree order. +* [`cancelable`](https://www.w3.org/TR/dom/#dom-event-cancelable) - if true, *event*.preventDefault is allowed. +* [`detail`](https://www.w3.org/TR/dom/#dom-customevent-detail) - any custom data associated with the event. + +If *parameters* is a function, it is evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element (*nodes*[*i*]). It must return the parameters map for the current element. + +# d3.pointer(event[, target]) · [Source](https://github.com/d3/d3-selection/blob/master/src/pointer.js) + +Returns a two-element array of numbers [*x*, *y*] representing the coordinates of the specified *event* relative to the specified *target*. *event* can be a [MouseEvent](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent), a [PointerEvent](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent), a [Touch](https://www.w3.org/TR/touch-events/#touch-interface), or a custom event holding a UIEvent as *event*.sourceEvent. + +If *target* is not specified, it defaults to the source event’s currentTarget property, if available. If the *target* is an SVG element, the event’s coordinates are transformed using the [inverse](https://www.w3.org/TR/geometry-1/#dom-dommatrixreadonly-inverse) of the [screen coordinate transformation matrix](https://www.w3.org/TR/SVG/types.html#__svg__SVGGraphicsElement__getScreenCTM). If the *target* is an HTML element, the event’s coordinates are translated relative to the top-left corner of the *target*’s [bounding client rectangle](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect). (As such, the coordinate system can only be translated relative to the client coordinates. See also [GeometryUtils](https://www.w3.org/TR/cssom-view-1/#the-geometryutils-interface).) Otherwise, [*event*.pageX, *event*.pageY] is returned. + +# d3.pointers(event[, target]) · [Source](https://github.com/d3/d3-selection/blob/master/src/pointers.js) + +Returns an array [[*x0*, *y0*], [*x1*, *y1*]…] of coordinates of the specified *event*’s pointer locations relative to the specified *target*. For touch events, the returned array of positions corresponds to the *event*.touches array; for other events, returns a single-element array. + +If *target* is not specified, it defaults to the source event’s currentTarget property, if any. + +### Control Flow + +For advanced usage, selections provide methods for custom control flow. + +# selection.each(function) · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/each.js) + +Invokes the specified *function* for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element (*nodes*[*i*]). This method can be used to invoke arbitrary code for each selected element, and is useful for creating a context to access parent and child data simultaneously, such as: + +```js +parent.each(function(p, j) { + d3.select(this) + .selectAll(".child") + .text(d => `child ${d.name} of ${p.name}`); +}); +``` + +See [Sized Donut Multiples](http://bl.ocks.org/mbostock/4c5fad723c87d2fd8273) for an example. + +# selection.call(function[, arguments…]) · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/call.js) + +Invokes the specified *function* exactly once, passing in this selection along with any optional *arguments*. Returns this selection. This is equivalent to invoking the function by hand but facilitates method chaining. For example, to set several styles in a reusable function: + +```js +function name(selection, first, last) { + selection + .attr("first-name", first) + .attr("last-name", last); +} +``` + +Now say: + +```js +d3.selectAll("div").call(name, "John", "Snow"); +``` + +This is roughly equivalent to: + +```js +name(d3.selectAll("div"), "John", "Snow"); +``` + +The only difference is that *selection*.call always returns the *selection* and not the return value of the called *function*, `name`. + +# selection.empty() · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/empty.js) + +Returns true if this selection contains no (non-null) elements. + +# selection.nodes() · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/nodes.js) + +Returns an array of all (non-null) elements in this selection. Equivalent to: + +```js +const elements = Array.from(selection); +```` + +See also [*selection*[Symbol.iterator]](#selection_iterator). + +# selection.node() · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/node.js) + +Returns the first (non-null) element in this selection. If the selection is empty, returns null. + +# selection.size() · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/size.js) + +Returns the total number of (non-null) elements in this selection. + +# selection\[Symbol.iterator\]() · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/iterator.js) + +Returns an iterator over the selected (non-null) elements. For example, to iterate over the selected elements: + +```js +for (const element of selection) { + console.log(element); +} +``` + +To flatten the selection to an array: + +```js +const elements = [...selection]; +```` + +### Local Variables + +D3 locals allow you to define local state independent of data. For instance, when rendering [small multiples](http://bl.ocks.org/mbostock/e1192fe405703d8321a5187350910e08) of time-series data, you might want the same *x*-scale for all charts but distinct *y*-scales to compare the relative performance of each metric. D3 locals are scoped by DOM elements: on set, the value is stored on the given element; on get, the value is retrieved from given element or the nearest ancestor that defines it. + +# d3.local() · [Source](https://github.com/d3/d3-selection/blob/master/src/local.js) + +Declares a new local variable. For example: + +```js +const foo = d3.local(); +``` + +Like `var`, each local is a distinct symbolic reference; unlike `var`, the value of each local is also scoped by the DOM. + +# local.set(node, value) · [Source](https://github.com/d3/d3-selection/blob/master/src/local.js) + +Sets the value of this local on the specified *node* to the *value*, and returns the specified *value*. This is often performed using [*selection*.each](#selection_each): + +```js +selection.each(function(d) { foo.set(this, d.value); }); +``` + +If you are just setting a single variable, consider using [*selection*.property](#selection_property): + +```js +selection.property(foo, d => d.value); +``` + +# local.get(node) · [Source](https://github.com/d3/d3-selection/blob/master/src/local.js) + +Returns the value of this local on the specified *node*. If the *node* does not define this local, returns the value from the nearest ancestor that defines it. Returns undefined if no ancestor defines this local. + +# local.remove(node) · [Source](https://github.com/d3/d3-selection/blob/master/src/local.js) + +Deletes this local’s value from the specified *node*. Returns true if the *node* defined this local prior to removal, and false otherwise. If ancestors also define this local, those definitions are unaffected, and thus [*local*.get](#local_get) will still return the inherited value. + +# local.toString() · [Source](https://github.com/d3/d3-selection/blob/master/src/local.js) + +Returns the automatically-generated identifier for this local. This is the name of the property that is used to store the local’s value on elements, and thus you can also set or get the local’s value using *element*[*local*] or by using [*selection*.property](#selection_property). + +### Namespaces + +XML namespaces are fun! Right? Fortunately you can mostly ignore them. + +# d3.namespace(name) · [Source](https://github.com/d3/d3-selection/blob/master/src/namespace.js) + +Qualifies the specified *name*, which may or may not have a namespace prefix. If the name contains a colon (`:`), the substring before the colon is interpreted as the namespace prefix, which must be registered in [d3.namespaces](#namespaces). Returns an object `space` and `local` attributes describing the full namespace URL and the local name. For example: + +```js +d3.namespace("svg:text"); // {space: "http://www.w3.org/2000/svg", local: "text"} +``` + +If the name does not contain a colon, this function merely returns the input name. + +# d3.namespaces · [Source](https://github.com/d3/d3-selection/blob/master/src/namespaces.js) + +The map of registered namespace prefixes. The initial value is: + +```js +{ + svg: "http://www.w3.org/2000/svg", + xhtml: "http://www.w3.org/1999/xhtml", + xlink: "http://www.w3.org/1999/xlink", + xml: "http://www.w3.org/XML/1998/namespace", + xmlns: "http://www.w3.org/2000/xmlns/" +} +``` + +Additional prefixes may be assigned as needed to create elements or attributes in other namespaces. diff --git a/node_modules/d3-selection/dist/d3-selection.js b/node_modules/d3-selection/dist/d3-selection.js new file mode 100644 index 0000000..9ffc1e8 --- /dev/null +++ b/node_modules/d3-selection/dist/d3-selection.js @@ -0,0 +1,1022 @@ +// https://d3js.org/d3-selection/ v3.0.0 Copyright 2010-2021 Mike Bostock +(function (global, factory) { +typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : +typeof define === 'function' && define.amd ? define(['exports'], factory) : +(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.d3 = global.d3 || {})); +}(this, (function (exports) { 'use strict'; + +var xhtml = "http://www.w3.org/1999/xhtml"; + +var namespaces = { + svg: "http://www.w3.org/2000/svg", + xhtml: xhtml, + xlink: "http://www.w3.org/1999/xlink", + xml: "http://www.w3.org/XML/1998/namespace", + xmlns: "http://www.w3.org/2000/xmlns/" +}; + +function namespace(name) { + var prefix = name += "", i = prefix.indexOf(":"); + if (i >= 0 && (prefix = name.slice(0, i)) !== "xmlns") name = name.slice(i + 1); + return namespaces.hasOwnProperty(prefix) ? {space: namespaces[prefix], local: name} : name; // eslint-disable-line no-prototype-builtins +} + +function creatorInherit(name) { + return function() { + var document = this.ownerDocument, + uri = this.namespaceURI; + return uri === xhtml && document.documentElement.namespaceURI === xhtml + ? document.createElement(name) + : document.createElementNS(uri, name); + }; +} + +function creatorFixed(fullname) { + return function() { + return this.ownerDocument.createElementNS(fullname.space, fullname.local); + }; +} + +function creator(name) { + var fullname = namespace(name); + return (fullname.local + ? creatorFixed + : creatorInherit)(fullname); +} + +function none() {} + +function selector(selector) { + return selector == null ? none : function() { + return this.querySelector(selector); + }; +} + +function selection_select(select) { + if (typeof select !== "function") select = selector(select); + + for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { + for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) { + if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) { + if ("__data__" in node) subnode.__data__ = node.__data__; + subgroup[i] = subnode; + } + } + } + + return new Selection(subgroups, this._parents); +} + +// Given something array like (or null), returns something that is strictly an +// array. This is used to ensure that array-like objects passed to d3.selectAll +// or selection.selectAll are converted into proper arrays when creating a +// selection; we don’t ever want to create a selection backed by a live +// HTMLCollection or NodeList. However, note that selection.selectAll will use a +// static NodeList as a group, since it safely derived from querySelectorAll. +function array(x) { + return x == null ? [] : Array.isArray(x) ? x : Array.from(x); +} + +function empty() { + return []; +} + +function selectorAll(selector) { + return selector == null ? empty : function() { + return this.querySelectorAll(selector); + }; +} + +function arrayAll(select) { + return function() { + return array(select.apply(this, arguments)); + }; +} + +function selection_selectAll(select) { + if (typeof select === "function") select = arrayAll(select); + else select = selectorAll(select); + + for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) { + for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { + if (node = group[i]) { + subgroups.push(select.call(node, node.__data__, i, group)); + parents.push(node); + } + } + } + + return new Selection(subgroups, parents); +} + +function matcher(selector) { + return function() { + return this.matches(selector); + }; +} + +function childMatcher(selector) { + return function(node) { + return node.matches(selector); + }; +} + +var find = Array.prototype.find; + +function childFind(match) { + return function() { + return find.call(this.children, match); + }; +} + +function childFirst() { + return this.firstElementChild; +} + +function selection_selectChild(match) { + return this.select(match == null ? childFirst + : childFind(typeof match === "function" ? match : childMatcher(match))); +} + +var filter = Array.prototype.filter; + +function children() { + return Array.from(this.children); +} + +function childrenFilter(match) { + return function() { + return filter.call(this.children, match); + }; +} + +function selection_selectChildren(match) { + return this.selectAll(match == null ? children + : childrenFilter(typeof match === "function" ? match : childMatcher(match))); +} + +function selection_filter(match) { + if (typeof match !== "function") match = matcher(match); + + for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { + for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) { + if ((node = group[i]) && match.call(node, node.__data__, i, group)) { + subgroup.push(node); + } + } + } + + return new Selection(subgroups, this._parents); +} + +function sparse(update) { + return new Array(update.length); +} + +function selection_enter() { + return new Selection(this._enter || this._groups.map(sparse), this._parents); +} + +function EnterNode(parent, datum) { + this.ownerDocument = parent.ownerDocument; + this.namespaceURI = parent.namespaceURI; + this._next = null; + this._parent = parent; + this.__data__ = datum; +} + +EnterNode.prototype = { + constructor: EnterNode, + appendChild: function(child) { return this._parent.insertBefore(child, this._next); }, + insertBefore: function(child, next) { return this._parent.insertBefore(child, next); }, + querySelector: function(selector) { return this._parent.querySelector(selector); }, + querySelectorAll: function(selector) { return this._parent.querySelectorAll(selector); } +}; + +function constant(x) { + return function() { + return x; + }; +} + +function bindIndex(parent, group, enter, update, exit, data) { + var i = 0, + node, + groupLength = group.length, + dataLength = data.length; + + // Put any non-null nodes that fit into update. + // Put any null nodes into enter. + // Put any remaining data into enter. + for (; i < dataLength; ++i) { + if (node = group[i]) { + node.__data__ = data[i]; + update[i] = node; + } else { + enter[i] = new EnterNode(parent, data[i]); + } + } + + // Put any non-null nodes that don’t fit into exit. + for (; i < groupLength; ++i) { + if (node = group[i]) { + exit[i] = node; + } + } +} + +function bindKey(parent, group, enter, update, exit, data, key) { + var i, + node, + nodeByKeyValue = new Map, + groupLength = group.length, + dataLength = data.length, + keyValues = new Array(groupLength), + keyValue; + + // Compute the key for each node. + // If multiple nodes have the same key, the duplicates are added to exit. + for (i = 0; i < groupLength; ++i) { + if (node = group[i]) { + keyValues[i] = keyValue = key.call(node, node.__data__, i, group) + ""; + if (nodeByKeyValue.has(keyValue)) { + exit[i] = node; + } else { + nodeByKeyValue.set(keyValue, node); + } + } + } + + // Compute the key for each datum. + // If there a node associated with this key, join and add it to update. + // If there is not (or the key is a duplicate), add it to enter. + for (i = 0; i < dataLength; ++i) { + keyValue = key.call(parent, data[i], i, data) + ""; + if (node = nodeByKeyValue.get(keyValue)) { + update[i] = node; + node.__data__ = data[i]; + nodeByKeyValue.delete(keyValue); + } else { + enter[i] = new EnterNode(parent, data[i]); + } + } + + // Add any remaining nodes that were not bound to data to exit. + for (i = 0; i < groupLength; ++i) { + if ((node = group[i]) && (nodeByKeyValue.get(keyValues[i]) === node)) { + exit[i] = node; + } + } +} + +function datum(node) { + return node.__data__; +} + +function selection_data(value, key) { + if (!arguments.length) return Array.from(this, datum); + + var bind = key ? bindKey : bindIndex, + parents = this._parents, + groups = this._groups; + + if (typeof value !== "function") value = constant(value); + + for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) { + var parent = parents[j], + group = groups[j], + groupLength = group.length, + data = arraylike(value.call(parent, parent && parent.__data__, j, parents)), + dataLength = data.length, + enterGroup = enter[j] = new Array(dataLength), + updateGroup = update[j] = new Array(dataLength), + exitGroup = exit[j] = new Array(groupLength); + + bind(parent, group, enterGroup, updateGroup, exitGroup, data, key); + + // Now connect the enter nodes to their following update node, such that + // appendChild can insert the materialized enter node before this node, + // rather than at the end of the parent node. + for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) { + if (previous = enterGroup[i0]) { + if (i0 >= i1) i1 = i0 + 1; + while (!(next = updateGroup[i1]) && ++i1 < dataLength); + previous._next = next || null; + } + } + } + + update = new Selection(update, parents); + update._enter = enter; + update._exit = exit; + return update; +} + +// Given some data, this returns an array-like view of it: an object that +// exposes a length property and allows numeric indexing. Note that unlike +// selectAll, this isn’t worried about “live” collections because the resulting +// array will only be used briefly while data is being bound. (It is possible to +// cause the data to change while iterating by using a key function, but please +// don’t; we’d rather avoid a gratuitous copy.) +function arraylike(data) { + return typeof data === "object" && "length" in data + ? data // Array, TypedArray, NodeList, array-like + : Array.from(data); // Map, Set, iterable, string, or anything else +} + +function selection_exit() { + return new Selection(this._exit || this._groups.map(sparse), this._parents); +} + +function selection_join(onenter, onupdate, onexit) { + var enter = this.enter(), update = this, exit = this.exit(); + if (typeof onenter === "function") { + enter = onenter(enter); + if (enter) enter = enter.selection(); + } else { + enter = enter.append(onenter + ""); + } + if (onupdate != null) { + update = onupdate(update); + if (update) update = update.selection(); + } + if (onexit == null) exit.remove(); else onexit(exit); + return enter && update ? enter.merge(update).order() : update; +} + +function selection_merge(context) { + var selection = context.selection ? context.selection() : context; + + for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) { + for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) { + if (node = group0[i] || group1[i]) { + merge[i] = node; + } + } + } + + for (; j < m0; ++j) { + merges[j] = groups0[j]; + } + + return new Selection(merges, this._parents); +} + +function selection_order() { + + for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) { + for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0;) { + if (node = group[i]) { + if (next && node.compareDocumentPosition(next) ^ 4) next.parentNode.insertBefore(node, next); + next = node; + } + } + } + + return this; +} + +function selection_sort(compare) { + if (!compare) compare = ascending; + + function compareNode(a, b) { + return a && b ? compare(a.__data__, b.__data__) : !a - !b; + } + + for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) { + for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) { + if (node = group[i]) { + sortgroup[i] = node; + } + } + sortgroup.sort(compareNode); + } + + return new Selection(sortgroups, this._parents).order(); +} + +function ascending(a, b) { + return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN; +} + +function selection_call() { + var callback = arguments[0]; + arguments[0] = this; + callback.apply(null, arguments); + return this; +} + +function selection_nodes() { + return Array.from(this); +} + +function selection_node() { + + for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { + for (var group = groups[j], i = 0, n = group.length; i < n; ++i) { + var node = group[i]; + if (node) return node; + } + } + + return null; +} + +function selection_size() { + let size = 0; + for (const node of this) ++size; // eslint-disable-line no-unused-vars + return size; +} + +function selection_empty() { + return !this.node(); +} + +function selection_each(callback) { + + for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { + for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) { + if (node = group[i]) callback.call(node, node.__data__, i, group); + } + } + + return this; +} + +function attrRemove(name) { + return function() { + this.removeAttribute(name); + }; +} + +function attrRemoveNS(fullname) { + return function() { + this.removeAttributeNS(fullname.space, fullname.local); + }; +} + +function attrConstant(name, value) { + return function() { + this.setAttribute(name, value); + }; +} + +function attrConstantNS(fullname, value) { + return function() { + this.setAttributeNS(fullname.space, fullname.local, value); + }; +} + +function attrFunction(name, value) { + return function() { + var v = value.apply(this, arguments); + if (v == null) this.removeAttribute(name); + else this.setAttribute(name, v); + }; +} + +function attrFunctionNS(fullname, value) { + return function() { + var v = value.apply(this, arguments); + if (v == null) this.removeAttributeNS(fullname.space, fullname.local); + else this.setAttributeNS(fullname.space, fullname.local, v); + }; +} + +function selection_attr(name, value) { + var fullname = namespace(name); + + if (arguments.length < 2) { + var node = this.node(); + return fullname.local + ? node.getAttributeNS(fullname.space, fullname.local) + : node.getAttribute(fullname); + } + + return this.each((value == null + ? (fullname.local ? attrRemoveNS : attrRemove) : (typeof value === "function" + ? (fullname.local ? attrFunctionNS : attrFunction) + : (fullname.local ? attrConstantNS : attrConstant)))(fullname, value)); +} + +function defaultView(node) { + return (node.ownerDocument && node.ownerDocument.defaultView) // node is a Node + || (node.document && node) // node is a Window + || node.defaultView; // node is a Document +} + +function styleRemove(name) { + return function() { + this.style.removeProperty(name); + }; +} + +function styleConstant(name, value, priority) { + return function() { + this.style.setProperty(name, value, priority); + }; +} + +function styleFunction(name, value, priority) { + return function() { + var v = value.apply(this, arguments); + if (v == null) this.style.removeProperty(name); + else this.style.setProperty(name, v, priority); + }; +} + +function selection_style(name, value, priority) { + return arguments.length > 1 + ? this.each((value == null + ? styleRemove : typeof value === "function" + ? styleFunction + : styleConstant)(name, value, priority == null ? "" : priority)) + : styleValue(this.node(), name); +} + +function styleValue(node, name) { + return node.style.getPropertyValue(name) + || defaultView(node).getComputedStyle(node, null).getPropertyValue(name); +} + +function propertyRemove(name) { + return function() { + delete this[name]; + }; +} + +function propertyConstant(name, value) { + return function() { + this[name] = value; + }; +} + +function propertyFunction(name, value) { + return function() { + var v = value.apply(this, arguments); + if (v == null) delete this[name]; + else this[name] = v; + }; +} + +function selection_property(name, value) { + return arguments.length > 1 + ? this.each((value == null + ? propertyRemove : typeof value === "function" + ? propertyFunction + : propertyConstant)(name, value)) + : this.node()[name]; +} + +function classArray(string) { + return string.trim().split(/^|\s+/); +} + +function classList(node) { + return node.classList || new ClassList(node); +} + +function ClassList(node) { + this._node = node; + this._names = classArray(node.getAttribute("class") || ""); +} + +ClassList.prototype = { + add: function(name) { + var i = this._names.indexOf(name); + if (i < 0) { + this._names.push(name); + this._node.setAttribute("class", this._names.join(" ")); + } + }, + remove: function(name) { + var i = this._names.indexOf(name); + if (i >= 0) { + this._names.splice(i, 1); + this._node.setAttribute("class", this._names.join(" ")); + } + }, + contains: function(name) { + return this._names.indexOf(name) >= 0; + } +}; + +function classedAdd(node, names) { + var list = classList(node), i = -1, n = names.length; + while (++i < n) list.add(names[i]); +} + +function classedRemove(node, names) { + var list = classList(node), i = -1, n = names.length; + while (++i < n) list.remove(names[i]); +} + +function classedTrue(names) { + return function() { + classedAdd(this, names); + }; +} + +function classedFalse(names) { + return function() { + classedRemove(this, names); + }; +} + +function classedFunction(names, value) { + return function() { + (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names); + }; +} + +function selection_classed(name, value) { + var names = classArray(name + ""); + + if (arguments.length < 2) { + var list = classList(this.node()), i = -1, n = names.length; + while (++i < n) if (!list.contains(names[i])) return false; + return true; + } + + return this.each((typeof value === "function" + ? classedFunction : value + ? classedTrue + : classedFalse)(names, value)); +} + +function textRemove() { + this.textContent = ""; +} + +function textConstant(value) { + return function() { + this.textContent = value; + }; +} + +function textFunction(value) { + return function() { + var v = value.apply(this, arguments); + this.textContent = v == null ? "" : v; + }; +} + +function selection_text(value) { + return arguments.length + ? this.each(value == null + ? textRemove : (typeof value === "function" + ? textFunction + : textConstant)(value)) + : this.node().textContent; +} + +function htmlRemove() { + this.innerHTML = ""; +} + +function htmlConstant(value) { + return function() { + this.innerHTML = value; + }; +} + +function htmlFunction(value) { + return function() { + var v = value.apply(this, arguments); + this.innerHTML = v == null ? "" : v; + }; +} + +function selection_html(value) { + return arguments.length + ? this.each(value == null + ? htmlRemove : (typeof value === "function" + ? htmlFunction + : htmlConstant)(value)) + : this.node().innerHTML; +} + +function raise() { + if (this.nextSibling) this.parentNode.appendChild(this); +} + +function selection_raise() { + return this.each(raise); +} + +function lower() { + if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild); +} + +function selection_lower() { + return this.each(lower); +} + +function selection_append(name) { + var create = typeof name === "function" ? name : creator(name); + return this.select(function() { + return this.appendChild(create.apply(this, arguments)); + }); +} + +function constantNull() { + return null; +} + +function selection_insert(name, before) { + var create = typeof name === "function" ? name : creator(name), + select = before == null ? constantNull : typeof before === "function" ? before : selector(before); + return this.select(function() { + return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null); + }); +} + +function remove() { + var parent = this.parentNode; + if (parent) parent.removeChild(this); +} + +function selection_remove() { + return this.each(remove); +} + +function selection_cloneShallow() { + var clone = this.cloneNode(false), parent = this.parentNode; + return parent ? parent.insertBefore(clone, this.nextSibling) : clone; +} + +function selection_cloneDeep() { + var clone = this.cloneNode(true), parent = this.parentNode; + return parent ? parent.insertBefore(clone, this.nextSibling) : clone; +} + +function selection_clone(deep) { + return this.select(deep ? selection_cloneDeep : selection_cloneShallow); +} + +function selection_datum(value) { + return arguments.length + ? this.property("__data__", value) + : this.node().__data__; +} + +function contextListener(listener) { + return function(event) { + listener.call(this, event, this.__data__); + }; +} + +function parseTypenames(typenames) { + return typenames.trim().split(/^|\s+/).map(function(t) { + var name = "", i = t.indexOf("."); + if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i); + return {type: t, name: name}; + }); +} + +function onRemove(typename) { + return function() { + var on = this.__on; + if (!on) return; + for (var j = 0, i = -1, m = on.length, o; j < m; ++j) { + if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) { + this.removeEventListener(o.type, o.listener, o.options); + } else { + on[++i] = o; + } + } + if (++i) on.length = i; + else delete this.__on; + }; +} + +function onAdd(typename, value, options) { + return function() { + var on = this.__on, o, listener = contextListener(value); + if (on) for (var j = 0, m = on.length; j < m; ++j) { + if ((o = on[j]).type === typename.type && o.name === typename.name) { + this.removeEventListener(o.type, o.listener, o.options); + this.addEventListener(o.type, o.listener = listener, o.options = options); + o.value = value; + return; + } + } + this.addEventListener(typename.type, listener, options); + o = {type: typename.type, name: typename.name, value: value, listener: listener, options: options}; + if (!on) this.__on = [o]; + else on.push(o); + }; +} + +function selection_on(typename, value, options) { + var typenames = parseTypenames(typename + ""), i, n = typenames.length, t; + + if (arguments.length < 2) { + var on = this.node().__on; + if (on) for (var j = 0, m = on.length, o; j < m; ++j) { + for (i = 0, o = on[j]; i < n; ++i) { + if ((t = typenames[i]).type === o.type && t.name === o.name) { + return o.value; + } + } + } + return; + } + + on = value ? onAdd : onRemove; + for (i = 0; i < n; ++i) this.each(on(typenames[i], value, options)); + return this; +} + +function dispatchEvent(node, type, params) { + var window = defaultView(node), + event = window.CustomEvent; + + if (typeof event === "function") { + event = new event(type, params); + } else { + event = window.document.createEvent("Event"); + if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail; + else event.initEvent(type, false, false); + } + + node.dispatchEvent(event); +} + +function dispatchConstant(type, params) { + return function() { + return dispatchEvent(this, type, params); + }; +} + +function dispatchFunction(type, params) { + return function() { + return dispatchEvent(this, type, params.apply(this, arguments)); + }; +} + +function selection_dispatch(type, params) { + return this.each((typeof params === "function" + ? dispatchFunction + : dispatchConstant)(type, params)); +} + +function* selection_iterator() { + for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { + for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) { + if (node = group[i]) yield node; + } + } +} + +var root = [null]; + +function Selection(groups, parents) { + this._groups = groups; + this._parents = parents; +} + +function selection() { + return new Selection([[document.documentElement]], root); +} + +function selection_selection() { + return this; +} + +Selection.prototype = selection.prototype = { + constructor: Selection, + select: selection_select, + selectAll: selection_selectAll, + selectChild: selection_selectChild, + selectChildren: selection_selectChildren, + filter: selection_filter, + data: selection_data, + enter: selection_enter, + exit: selection_exit, + join: selection_join, + merge: selection_merge, + selection: selection_selection, + order: selection_order, + sort: selection_sort, + call: selection_call, + nodes: selection_nodes, + node: selection_node, + size: selection_size, + empty: selection_empty, + each: selection_each, + attr: selection_attr, + style: selection_style, + property: selection_property, + classed: selection_classed, + text: selection_text, + html: selection_html, + raise: selection_raise, + lower: selection_lower, + append: selection_append, + insert: selection_insert, + remove: selection_remove, + clone: selection_clone, + datum: selection_datum, + on: selection_on, + dispatch: selection_dispatch, + [Symbol.iterator]: selection_iterator +}; + +function select(selector) { + return typeof selector === "string" + ? new Selection([[document.querySelector(selector)]], [document.documentElement]) + : new Selection([[selector]], root); +} + +function create(name) { + return select(creator(name).call(document.documentElement)); +} + +var nextId = 0; + +function local() { + return new Local; +} + +function Local() { + this._ = "@" + (++nextId).toString(36); +} + +Local.prototype = local.prototype = { + constructor: Local, + get: function(node) { + var id = this._; + while (!(id in node)) if (!(node = node.parentNode)) return; + return node[id]; + }, + set: function(node, value) { + return node[this._] = value; + }, + remove: function(node) { + return this._ in node && delete node[this._]; + }, + toString: function() { + return this._; + } +}; + +function sourceEvent(event) { + let sourceEvent; + while (sourceEvent = event.sourceEvent) event = sourceEvent; + return event; +} + +function pointer(event, node) { + event = sourceEvent(event); + if (node === undefined) node = event.currentTarget; + if (node) { + var svg = node.ownerSVGElement || node; + if (svg.createSVGPoint) { + var point = svg.createSVGPoint(); + point.x = event.clientX, point.y = event.clientY; + point = point.matrixTransform(node.getScreenCTM().inverse()); + return [point.x, point.y]; + } + if (node.getBoundingClientRect) { + var rect = node.getBoundingClientRect(); + return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop]; + } + } + return [event.pageX, event.pageY]; +} + +function pointers(events, node) { + if (events.target) { // i.e., instanceof Event, not TouchList or iterable + events = sourceEvent(events); + if (node === undefined) node = events.currentTarget; + events = events.touches || [events]; + } + return Array.from(events, event => pointer(event, node)); +} + +function selectAll(selector) { + return typeof selector === "string" + ? new Selection([document.querySelectorAll(selector)], [document.documentElement]) + : new Selection([array(selector)], root); +} + +exports.create = create; +exports.creator = creator; +exports.local = local; +exports.matcher = matcher; +exports.namespace = namespace; +exports.namespaces = namespaces; +exports.pointer = pointer; +exports.pointers = pointers; +exports.select = select; +exports.selectAll = selectAll; +exports.selection = selection; +exports.selector = selector; +exports.selectorAll = selectorAll; +exports.style = styleValue; +exports.window = defaultView; + +Object.defineProperty(exports, '__esModule', { value: true }); + +}))); diff --git a/node_modules/d3-selection/dist/d3-selection.min.js b/node_modules/d3-selection/dist/d3-selection.min.js new file mode 100644 index 0000000..37a5707 --- /dev/null +++ b/node_modules/d3-selection/dist/d3-selection.min.js @@ -0,0 +1,2 @@ +// https://d3js.org/d3-selection/ v3.0.0 Copyright 2010-2021 Mike Bostock +!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).d3=t.d3||{})}(this,(function(t){"use strict";var n="http://www.w3.org/1999/xhtml",e={svg:"http://www.w3.org/2000/svg",xhtml:n,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function r(t){var n=t+="",r=n.indexOf(":");return r>=0&&"xmlns"!==(n=t.slice(0,r))&&(t=t.slice(r+1)),e.hasOwnProperty(n)?{space:e[n],local:t}:t}function i(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===n&&e.documentElement.namespaceURI===n?e.createElement(t):e.createElementNS(r,t)}}function o(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function u(t){var n=r(t);return(n.local?o:i)(n)}function s(){}function c(t){return null==t?s:function(){return this.querySelector(t)}}function l(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}function a(){return[]}function f(t){return null==t?a:function(){return this.querySelectorAll(t)}}function h(t){return function(){return this.matches(t)}}function p(t){return function(n){return n.matches(t)}}var _=Array.prototype.find;function d(){return this.firstElementChild}var y=Array.prototype.filter;function m(){return Array.from(this.children)}function v(t){return new Array(t.length)}function g(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function w(t){return function(){return t}}function A(t,n,e,r,i,o){for(var u,s=0,c=n.length,l=o.length;sn?1:t>=n?0:NaN}function N(t){return function(){this.removeAttribute(t)}}function C(t){return function(){this.removeAttributeNS(t.space,t.local)}}function L(t,n){return function(){this.setAttribute(t,n)}}function P(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function T(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function B(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function M(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function q(t){return function(){this.style.removeProperty(t)}}function D(t,n,e){return function(){this.style.setProperty(t,n,e)}}function O(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function V(t,n){return t.style.getPropertyValue(n)||M(t).getComputedStyle(t,null).getPropertyValue(n)}function j(t){return function(){delete this[t]}}function R(t,n){return function(){this[t]=n}}function H(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function I(t){return t.trim().split(/^|\s+/)}function U(t){return t.classList||new X(t)}function X(t){this._node=t,this._names=I(t.getAttribute("class")||"")}function G(t,n){for(var e=U(t),r=-1,i=n.length;++r=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}function st(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var ht=[null];function pt(t,n){this._groups=t,this._parents=n}function _t(){return new pt([[document.documentElement]],ht)}function dt(t){return"string"==typeof t?new pt([[document.querySelector(t)]],[document.documentElement]):new pt([[t]],ht)}pt.prototype=_t.prototype={constructor:pt,select:function(t){"function"!=typeof t&&(t=c(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i=N&&(N=E+1);!(g=y[N])&&++N<_;);v._next=g||null}}return(u=new pt(u,r))._enter=s,u._exit=c,u},enter:function(){return new pt(this._enter||this._groups.map(v),this._parents)},exit:function(){return new pt(this._exit||this._groups.map(v),this._parents)},join:function(t,n,e){var r=this.enter(),i=this,o=this.exit();return"function"==typeof t?(r=t(r))&&(r=r.selection()):r=r.append(t+""),null!=n&&(i=n(i))&&(i=i.selection()),null==e?o.remove():e(o),r&&i?r.merge(i).order():i},merge:function(t){for(var n=t.selection?t.selection():t,e=this._groups,r=n._groups,i=e.length,o=r.length,u=Math.min(i,o),s=new Array(i),c=0;c=0;)(r=i[o])&&(u&&4^r.compareDocumentPosition(u)&&u.parentNode.insertBefore(r,u),u=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=E);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o1?this.each((null==n?q:"function"==typeof n?O:D)(t,n,null==e?"":e)):V(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?j:"function"==typeof n?H:R)(t,n)):this.node()[t]},classed:function(t,n){var e=I(t+"");if(arguments.length<2){for(var r=U(this.node()),i=-1,o=e.length;++iwt(t,n)))},t.select=dt,t.selectAll=function(t){return"string"==typeof t?new pt([document.querySelectorAll(t)],[document.documentElement]):new pt([l(t)],ht)},t.selection=_t,t.selector=c,t.selectorAll=f,t.style=V,t.window=M,Object.defineProperty(t,"__esModule",{value:!0})})); diff --git a/node_modules/d3-selection/package.json b/node_modules/d3-selection/package.json new file mode 100644 index 0000000..2f6af45 --- /dev/null +++ b/node_modules/d3-selection/package.json @@ -0,0 +1,51 @@ +{ + "name": "d3-selection", + "version": "3.0.0", + "description": "Data-driven DOM manipulation: select elements and join them to data.", + "homepage": "https://d3js.org/d3-selection/", + "repository": { + "type": "git", + "url": "https://github.com/d3/d3-selection.git" + }, + "keywords": [ + "d3", + "d3-module", + "dom", + "selection", + "data-join" + ], + "license": "ISC", + "author": { + "name": "Mike Bostock", + "url": "https://bost.ocks.org/mike" + }, + "type": "module", + "files": [ + "dist/**/*.js", + "src/**/*.js" + ], + "module": "src/index.js", + "main": "src/index.js", + "jsdelivr": "dist/d3-selection.min.js", + "unpkg": "dist/d3-selection.min.js", + "exports": { + "umd": "./dist/d3-selection.min.js", + "default": "./src/index.js" + }, + "sideEffects": false, + "devDependencies": { + "eslint": "7", + "jsdom": "16", + "mocha": "9", + "rollup": "2", + "rollup-plugin-terser": "7" + }, + "scripts": { + "test": "mocha 'test/**/*-test.js' && eslint src test", + "prepublishOnly": "rm -rf dist && yarn test && rollup -c", + "postpublish": "git push && git push --tags && cd ../d3.github.com && git pull && cp ../${npm_package_name}/dist/${npm_package_name}.js ${npm_package_name}.v${npm_package_version%%.*}.js && cp ../${npm_package_name}/dist/${npm_package_name}.min.js ${npm_package_name}.v${npm_package_version%%.*}.min.js && git add ${npm_package_name}.v${npm_package_version%%.*}.js ${npm_package_name}.v${npm_package_version%%.*}.min.js && git commit -m \"${npm_package_name} ${npm_package_version}\" && git push && cd -" + }, + "engines": { + "node": ">=12" + } +} diff --git a/node_modules/d3-selection/src/array.js b/node_modules/d3-selection/src/array.js new file mode 100644 index 0000000..978c22a --- /dev/null +++ b/node_modules/d3-selection/src/array.js @@ -0,0 +1,9 @@ +// Given something array like (or null), returns something that is strictly an +// array. This is used to ensure that array-like objects passed to d3.selectAll +// or selection.selectAll are converted into proper arrays when creating a +// selection; we don’t ever want to create a selection backed by a live +// HTMLCollection or NodeList. However, note that selection.selectAll will use a +// static NodeList as a group, since it safely derived from querySelectorAll. +export default function array(x) { + return x == null ? [] : Array.isArray(x) ? x : Array.from(x); +} diff --git a/node_modules/d3-selection/src/constant.js b/node_modules/d3-selection/src/constant.js new file mode 100644 index 0000000..b7d42e7 --- /dev/null +++ b/node_modules/d3-selection/src/constant.js @@ -0,0 +1,5 @@ +export default function(x) { + return function() { + return x; + }; +} diff --git a/node_modules/d3-selection/src/create.js b/node_modules/d3-selection/src/create.js new file mode 100644 index 0000000..077a6a3 --- /dev/null +++ b/node_modules/d3-selection/src/create.js @@ -0,0 +1,6 @@ +import creator from "./creator.js"; +import select from "./select.js"; + +export default function(name) { + return select(creator(name).call(document.documentElement)); +} diff --git a/node_modules/d3-selection/src/creator.js b/node_modules/d3-selection/src/creator.js new file mode 100644 index 0000000..4f1b162 --- /dev/null +++ b/node_modules/d3-selection/src/creator.js @@ -0,0 +1,25 @@ +import namespace from "./namespace.js"; +import {xhtml} from "./namespaces.js"; + +function creatorInherit(name) { + return function() { + var document = this.ownerDocument, + uri = this.namespaceURI; + return uri === xhtml && document.documentElement.namespaceURI === xhtml + ? document.createElement(name) + : document.createElementNS(uri, name); + }; +} + +function creatorFixed(fullname) { + return function() { + return this.ownerDocument.createElementNS(fullname.space, fullname.local); + }; +} + +export default function(name) { + var fullname = namespace(name); + return (fullname.local + ? creatorFixed + : creatorInherit)(fullname); +} diff --git a/node_modules/d3-selection/src/identity.js b/node_modules/d3-selection/src/identity.js new file mode 100644 index 0000000..b2f94b2 --- /dev/null +++ b/node_modules/d3-selection/src/identity.js @@ -0,0 +1,3 @@ +export default function(x) { + return x; +} diff --git a/node_modules/d3-selection/src/index.js b/node_modules/d3-selection/src/index.js new file mode 100644 index 0000000..dc51a3b --- /dev/null +++ b/node_modules/d3-selection/src/index.js @@ -0,0 +1,15 @@ +export {default as create} from "./create.js"; +export {default as creator} from "./creator.js"; +export {default as local} from "./local.js"; +export {default as matcher} from "./matcher.js"; +export {default as namespace} from "./namespace.js"; +export {default as namespaces} from "./namespaces.js"; +export {default as pointer} from "./pointer.js"; +export {default as pointers} from "./pointers.js"; +export {default as select} from "./select.js"; +export {default as selectAll} from "./selectAll.js"; +export {default as selection} from "./selection/index.js"; +export {default as selector} from "./selector.js"; +export {default as selectorAll} from "./selectorAll.js"; +export {styleValue as style} from "./selection/style.js"; +export {default as window} from "./window.js"; diff --git a/node_modules/d3-selection/src/local.js b/node_modules/d3-selection/src/local.js new file mode 100644 index 0000000..ab4c20f --- /dev/null +++ b/node_modules/d3-selection/src/local.js @@ -0,0 +1,27 @@ +var nextId = 0; + +export default function local() { + return new Local; +} + +function Local() { + this._ = "@" + (++nextId).toString(36); +} + +Local.prototype = local.prototype = { + constructor: Local, + get: function(node) { + var id = this._; + while (!(id in node)) if (!(node = node.parentNode)) return; + return node[id]; + }, + set: function(node, value) { + return node[this._] = value; + }, + remove: function(node) { + return this._ in node && delete node[this._]; + }, + toString: function() { + return this._; + } +}; diff --git a/node_modules/d3-selection/src/matcher.js b/node_modules/d3-selection/src/matcher.js new file mode 100644 index 0000000..854b0d9 --- /dev/null +++ b/node_modules/d3-selection/src/matcher.js @@ -0,0 +1,12 @@ +export default function(selector) { + return function() { + return this.matches(selector); + }; +} + +export function childMatcher(selector) { + return function(node) { + return node.matches(selector); + }; +} + diff --git a/node_modules/d3-selection/src/namespace.js b/node_modules/d3-selection/src/namespace.js new file mode 100644 index 0000000..72db9df --- /dev/null +++ b/node_modules/d3-selection/src/namespace.js @@ -0,0 +1,7 @@ +import namespaces from "./namespaces.js"; + +export default function(name) { + var prefix = name += "", i = prefix.indexOf(":"); + if (i >= 0 && (prefix = name.slice(0, i)) !== "xmlns") name = name.slice(i + 1); + return namespaces.hasOwnProperty(prefix) ? {space: namespaces[prefix], local: name} : name; // eslint-disable-line no-prototype-builtins +} diff --git a/node_modules/d3-selection/src/namespaces.js b/node_modules/d3-selection/src/namespaces.js new file mode 100644 index 0000000..01749bd --- /dev/null +++ b/node_modules/d3-selection/src/namespaces.js @@ -0,0 +1,9 @@ +export var xhtml = "http://www.w3.org/1999/xhtml"; + +export default { + svg: "http://www.w3.org/2000/svg", + xhtml: xhtml, + xlink: "http://www.w3.org/1999/xlink", + xml: "http://www.w3.org/XML/1998/namespace", + xmlns: "http://www.w3.org/2000/xmlns/" +}; diff --git a/node_modules/d3-selection/src/pointer.js b/node_modules/d3-selection/src/pointer.js new file mode 100644 index 0000000..3e2298f --- /dev/null +++ b/node_modules/d3-selection/src/pointer.js @@ -0,0 +1,20 @@ +import sourceEvent from "./sourceEvent.js"; + +export default function(event, node) { + event = sourceEvent(event); + if (node === undefined) node = event.currentTarget; + if (node) { + var svg = node.ownerSVGElement || node; + if (svg.createSVGPoint) { + var point = svg.createSVGPoint(); + point.x = event.clientX, point.y = event.clientY; + point = point.matrixTransform(node.getScreenCTM().inverse()); + return [point.x, point.y]; + } + if (node.getBoundingClientRect) { + var rect = node.getBoundingClientRect(); + return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop]; + } + } + return [event.pageX, event.pageY]; +} diff --git a/node_modules/d3-selection/src/pointers.js b/node_modules/d3-selection/src/pointers.js new file mode 100644 index 0000000..43d17d1 --- /dev/null +++ b/node_modules/d3-selection/src/pointers.js @@ -0,0 +1,11 @@ +import pointer from "./pointer.js"; +import sourceEvent from "./sourceEvent.js"; + +export default function(events, node) { + if (events.target) { // i.e., instanceof Event, not TouchList or iterable + events = sourceEvent(events); + if (node === undefined) node = events.currentTarget; + events = events.touches || [events]; + } + return Array.from(events, event => pointer(event, node)); +} diff --git a/node_modules/d3-selection/src/select.js b/node_modules/d3-selection/src/select.js new file mode 100644 index 0000000..dcea22e --- /dev/null +++ b/node_modules/d3-selection/src/select.js @@ -0,0 +1,7 @@ +import {Selection, root} from "./selection/index.js"; + +export default function(selector) { + return typeof selector === "string" + ? new Selection([[document.querySelector(selector)]], [document.documentElement]) + : new Selection([[selector]], root); +} diff --git a/node_modules/d3-selection/src/selectAll.js b/node_modules/d3-selection/src/selectAll.js new file mode 100644 index 0000000..b6ecc3d --- /dev/null +++ b/node_modules/d3-selection/src/selectAll.js @@ -0,0 +1,8 @@ +import array from "./array.js"; +import {Selection, root} from "./selection/index.js"; + +export default function(selector) { + return typeof selector === "string" + ? new Selection([document.querySelectorAll(selector)], [document.documentElement]) + : new Selection([array(selector)], root); +} diff --git a/node_modules/d3-selection/src/selection/append.js b/node_modules/d3-selection/src/selection/append.js new file mode 100644 index 0000000..3333633 --- /dev/null +++ b/node_modules/d3-selection/src/selection/append.js @@ -0,0 +1,8 @@ +import creator from "../creator.js"; + +export default function(name) { + var create = typeof name === "function" ? name : creator(name); + return this.select(function() { + return this.appendChild(create.apply(this, arguments)); + }); +} diff --git a/node_modules/d3-selection/src/selection/attr.js b/node_modules/d3-selection/src/selection/attr.js new file mode 100644 index 0000000..5e93353 --- /dev/null +++ b/node_modules/d3-selection/src/selection/attr.js @@ -0,0 +1,57 @@ +import namespace from "../namespace.js"; + +function attrRemove(name) { + return function() { + this.removeAttribute(name); + }; +} + +function attrRemoveNS(fullname) { + return function() { + this.removeAttributeNS(fullname.space, fullname.local); + }; +} + +function attrConstant(name, value) { + return function() { + this.setAttribute(name, value); + }; +} + +function attrConstantNS(fullname, value) { + return function() { + this.setAttributeNS(fullname.space, fullname.local, value); + }; +} + +function attrFunction(name, value) { + return function() { + var v = value.apply(this, arguments); + if (v == null) this.removeAttribute(name); + else this.setAttribute(name, v); + }; +} + +function attrFunctionNS(fullname, value) { + return function() { + var v = value.apply(this, arguments); + if (v == null) this.removeAttributeNS(fullname.space, fullname.local); + else this.setAttributeNS(fullname.space, fullname.local, v); + }; +} + +export default function(name, value) { + var fullname = namespace(name); + + if (arguments.length < 2) { + var node = this.node(); + return fullname.local + ? node.getAttributeNS(fullname.space, fullname.local) + : node.getAttribute(fullname); + } + + return this.each((value == null + ? (fullname.local ? attrRemoveNS : attrRemove) : (typeof value === "function" + ? (fullname.local ? attrFunctionNS : attrFunction) + : (fullname.local ? attrConstantNS : attrConstant)))(fullname, value)); +} diff --git a/node_modules/d3-selection/src/selection/call.js b/node_modules/d3-selection/src/selection/call.js new file mode 100644 index 0000000..2c41eee --- /dev/null +++ b/node_modules/d3-selection/src/selection/call.js @@ -0,0 +1,6 @@ +export default function() { + var callback = arguments[0]; + arguments[0] = this; + callback.apply(null, arguments); + return this; +} diff --git a/node_modules/d3-selection/src/selection/classed.js b/node_modules/d3-selection/src/selection/classed.js new file mode 100644 index 0000000..b356373 --- /dev/null +++ b/node_modules/d3-selection/src/selection/classed.js @@ -0,0 +1,75 @@ +function classArray(string) { + return string.trim().split(/^|\s+/); +} + +function classList(node) { + return node.classList || new ClassList(node); +} + +function ClassList(node) { + this._node = node; + this._names = classArray(node.getAttribute("class") || ""); +} + +ClassList.prototype = { + add: function(name) { + var i = this._names.indexOf(name); + if (i < 0) { + this._names.push(name); + this._node.setAttribute("class", this._names.join(" ")); + } + }, + remove: function(name) { + var i = this._names.indexOf(name); + if (i >= 0) { + this._names.splice(i, 1); + this._node.setAttribute("class", this._names.join(" ")); + } + }, + contains: function(name) { + return this._names.indexOf(name) >= 0; + } +}; + +function classedAdd(node, names) { + var list = classList(node), i = -1, n = names.length; + while (++i < n) list.add(names[i]); +} + +function classedRemove(node, names) { + var list = classList(node), i = -1, n = names.length; + while (++i < n) list.remove(names[i]); +} + +function classedTrue(names) { + return function() { + classedAdd(this, names); + }; +} + +function classedFalse(names) { + return function() { + classedRemove(this, names); + }; +} + +function classedFunction(names, value) { + return function() { + (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names); + }; +} + +export default function(name, value) { + var names = classArray(name + ""); + + if (arguments.length < 2) { + var list = classList(this.node()), i = -1, n = names.length; + while (++i < n) if (!list.contains(names[i])) return false; + return true; + } + + return this.each((typeof value === "function" + ? classedFunction : value + ? classedTrue + : classedFalse)(names, value)); +} diff --git a/node_modules/d3-selection/src/selection/clone.js b/node_modules/d3-selection/src/selection/clone.js new file mode 100644 index 0000000..5e273bf --- /dev/null +++ b/node_modules/d3-selection/src/selection/clone.js @@ -0,0 +1,13 @@ +function selection_cloneShallow() { + var clone = this.cloneNode(false), parent = this.parentNode; + return parent ? parent.insertBefore(clone, this.nextSibling) : clone; +} + +function selection_cloneDeep() { + var clone = this.cloneNode(true), parent = this.parentNode; + return parent ? parent.insertBefore(clone, this.nextSibling) : clone; +} + +export default function(deep) { + return this.select(deep ? selection_cloneDeep : selection_cloneShallow); +} diff --git a/node_modules/d3-selection/src/selection/data.js b/node_modules/d3-selection/src/selection/data.js new file mode 100644 index 0000000..8eb0713 --- /dev/null +++ b/node_modules/d3-selection/src/selection/data.js @@ -0,0 +1,128 @@ +import {Selection} from "./index.js"; +import {EnterNode} from "./enter.js"; +import constant from "../constant.js"; + +function bindIndex(parent, group, enter, update, exit, data) { + var i = 0, + node, + groupLength = group.length, + dataLength = data.length; + + // Put any non-null nodes that fit into update. + // Put any null nodes into enter. + // Put any remaining data into enter. + for (; i < dataLength; ++i) { + if (node = group[i]) { + node.__data__ = data[i]; + update[i] = node; + } else { + enter[i] = new EnterNode(parent, data[i]); + } + } + + // Put any non-null nodes that don’t fit into exit. + for (; i < groupLength; ++i) { + if (node = group[i]) { + exit[i] = node; + } + } +} + +function bindKey(parent, group, enter, update, exit, data, key) { + var i, + node, + nodeByKeyValue = new Map, + groupLength = group.length, + dataLength = data.length, + keyValues = new Array(groupLength), + keyValue; + + // Compute the key for each node. + // If multiple nodes have the same key, the duplicates are added to exit. + for (i = 0; i < groupLength; ++i) { + if (node = group[i]) { + keyValues[i] = keyValue = key.call(node, node.__data__, i, group) + ""; + if (nodeByKeyValue.has(keyValue)) { + exit[i] = node; + } else { + nodeByKeyValue.set(keyValue, node); + } + } + } + + // Compute the key for each datum. + // If there a node associated with this key, join and add it to update. + // If there is not (or the key is a duplicate), add it to enter. + for (i = 0; i < dataLength; ++i) { + keyValue = key.call(parent, data[i], i, data) + ""; + if (node = nodeByKeyValue.get(keyValue)) { + update[i] = node; + node.__data__ = data[i]; + nodeByKeyValue.delete(keyValue); + } else { + enter[i] = new EnterNode(parent, data[i]); + } + } + + // Add any remaining nodes that were not bound to data to exit. + for (i = 0; i < groupLength; ++i) { + if ((node = group[i]) && (nodeByKeyValue.get(keyValues[i]) === node)) { + exit[i] = node; + } + } +} + +function datum(node) { + return node.__data__; +} + +export default function(value, key) { + if (!arguments.length) return Array.from(this, datum); + + var bind = key ? bindKey : bindIndex, + parents = this._parents, + groups = this._groups; + + if (typeof value !== "function") value = constant(value); + + for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) { + var parent = parents[j], + group = groups[j], + groupLength = group.length, + data = arraylike(value.call(parent, parent && parent.__data__, j, parents)), + dataLength = data.length, + enterGroup = enter[j] = new Array(dataLength), + updateGroup = update[j] = new Array(dataLength), + exitGroup = exit[j] = new Array(groupLength); + + bind(parent, group, enterGroup, updateGroup, exitGroup, data, key); + + // Now connect the enter nodes to their following update node, such that + // appendChild can insert the materialized enter node before this node, + // rather than at the end of the parent node. + for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) { + if (previous = enterGroup[i0]) { + if (i0 >= i1) i1 = i0 + 1; + while (!(next = updateGroup[i1]) && ++i1 < dataLength); + previous._next = next || null; + } + } + } + + update = new Selection(update, parents); + update._enter = enter; + update._exit = exit; + return update; +} + +// Given some data, this returns an array-like view of it: an object that +// exposes a length property and allows numeric indexing. Note that unlike +// selectAll, this isn’t worried about “live” collections because the resulting +// array will only be used briefly while data is being bound. (It is possible to +// cause the data to change while iterating by using a key function, but please +// don’t; we’d rather avoid a gratuitous copy.) +function arraylike(data) { + return typeof data === "object" && "length" in data + ? data // Array, TypedArray, NodeList, array-like + : Array.from(data); // Map, Set, iterable, string, or anything else +} diff --git a/node_modules/d3-selection/src/selection/datum.js b/node_modules/d3-selection/src/selection/datum.js new file mode 100644 index 0000000..5de4e58 --- /dev/null +++ b/node_modules/d3-selection/src/selection/datum.js @@ -0,0 +1,5 @@ +export default function(value) { + return arguments.length + ? this.property("__data__", value) + : this.node().__data__; +} diff --git a/node_modules/d3-selection/src/selection/dispatch.js b/node_modules/d3-selection/src/selection/dispatch.js new file mode 100644 index 0000000..8f57915 --- /dev/null +++ b/node_modules/d3-selection/src/selection/dispatch.js @@ -0,0 +1,34 @@ +import defaultView from "../window.js"; + +function dispatchEvent(node, type, params) { + var window = defaultView(node), + event = window.CustomEvent; + + if (typeof event === "function") { + event = new event(type, params); + } else { + event = window.document.createEvent("Event"); + if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail; + else event.initEvent(type, false, false); + } + + node.dispatchEvent(event); +} + +function dispatchConstant(type, params) { + return function() { + return dispatchEvent(this, type, params); + }; +} + +function dispatchFunction(type, params) { + return function() { + return dispatchEvent(this, type, params.apply(this, arguments)); + }; +} + +export default function(type, params) { + return this.each((typeof params === "function" + ? dispatchFunction + : dispatchConstant)(type, params)); +} diff --git a/node_modules/d3-selection/src/selection/each.js b/node_modules/d3-selection/src/selection/each.js new file mode 100644 index 0000000..260af8f --- /dev/null +++ b/node_modules/d3-selection/src/selection/each.js @@ -0,0 +1,10 @@ +export default function(callback) { + + for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { + for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) { + if (node = group[i]) callback.call(node, node.__data__, i, group); + } + } + + return this; +} diff --git a/node_modules/d3-selection/src/selection/empty.js b/node_modules/d3-selection/src/selection/empty.js new file mode 100644 index 0000000..4e2cf42 --- /dev/null +++ b/node_modules/d3-selection/src/selection/empty.js @@ -0,0 +1,3 @@ +export default function() { + return !this.node(); +} diff --git a/node_modules/d3-selection/src/selection/enter.js b/node_modules/d3-selection/src/selection/enter.js new file mode 100644 index 0000000..83a3ed4 --- /dev/null +++ b/node_modules/d3-selection/src/selection/enter.js @@ -0,0 +1,22 @@ +import sparse from "./sparse.js"; +import {Selection} from "./index.js"; + +export default function() { + return new Selection(this._enter || this._groups.map(sparse), this._parents); +} + +export function EnterNode(parent, datum) { + this.ownerDocument = parent.ownerDocument; + this.namespaceURI = parent.namespaceURI; + this._next = null; + this._parent = parent; + this.__data__ = datum; +} + +EnterNode.prototype = { + constructor: EnterNode, + appendChild: function(child) { return this._parent.insertBefore(child, this._next); }, + insertBefore: function(child, next) { return this._parent.insertBefore(child, next); }, + querySelector: function(selector) { return this._parent.querySelector(selector); }, + querySelectorAll: function(selector) { return this._parent.querySelectorAll(selector); } +}; diff --git a/node_modules/d3-selection/src/selection/exit.js b/node_modules/d3-selection/src/selection/exit.js new file mode 100644 index 0000000..f5d7b45 --- /dev/null +++ b/node_modules/d3-selection/src/selection/exit.js @@ -0,0 +1,6 @@ +import sparse from "./sparse.js"; +import {Selection} from "./index.js"; + +export default function() { + return new Selection(this._exit || this._groups.map(sparse), this._parents); +} diff --git a/node_modules/d3-selection/src/selection/filter.js b/node_modules/d3-selection/src/selection/filter.js new file mode 100644 index 0000000..74b3d6f --- /dev/null +++ b/node_modules/d3-selection/src/selection/filter.js @@ -0,0 +1,16 @@ +import {Selection} from "./index.js"; +import matcher from "../matcher.js"; + +export default function(match) { + if (typeof match !== "function") match = matcher(match); + + for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { + for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) { + if ((node = group[i]) && match.call(node, node.__data__, i, group)) { + subgroup.push(node); + } + } + } + + return new Selection(subgroups, this._parents); +} diff --git a/node_modules/d3-selection/src/selection/html.js b/node_modules/d3-selection/src/selection/html.js new file mode 100644 index 0000000..df27442 --- /dev/null +++ b/node_modules/d3-selection/src/selection/html.js @@ -0,0 +1,25 @@ +function htmlRemove() { + this.innerHTML = ""; +} + +function htmlConstant(value) { + return function() { + this.innerHTML = value; + }; +} + +function htmlFunction(value) { + return function() { + var v = value.apply(this, arguments); + this.innerHTML = v == null ? "" : v; + }; +} + +export default function(value) { + return arguments.length + ? this.each(value == null + ? htmlRemove : (typeof value === "function" + ? htmlFunction + : htmlConstant)(value)) + : this.node().innerHTML; +} diff --git a/node_modules/d3-selection/src/selection/index.js b/node_modules/d3-selection/src/selection/index.js new file mode 100644 index 0000000..a593a21 --- /dev/null +++ b/node_modules/d3-selection/src/selection/index.js @@ -0,0 +1,90 @@ +import selection_select from "./select.js"; +import selection_selectAll from "./selectAll.js"; +import selection_selectChild from "./selectChild.js"; +import selection_selectChildren from "./selectChildren.js"; +import selection_filter from "./filter.js"; +import selection_data from "./data.js"; +import selection_enter from "./enter.js"; +import selection_exit from "./exit.js"; +import selection_join from "./join.js"; +import selection_merge from "./merge.js"; +import selection_order from "./order.js"; +import selection_sort from "./sort.js"; +import selection_call from "./call.js"; +import selection_nodes from "./nodes.js"; +import selection_node from "./node.js"; +import selection_size from "./size.js"; +import selection_empty from "./empty.js"; +import selection_each from "./each.js"; +import selection_attr from "./attr.js"; +import selection_style from "./style.js"; +import selection_property from "./property.js"; +import selection_classed from "./classed.js"; +import selection_text from "./text.js"; +import selection_html from "./html.js"; +import selection_raise from "./raise.js"; +import selection_lower from "./lower.js"; +import selection_append from "./append.js"; +import selection_insert from "./insert.js"; +import selection_remove from "./remove.js"; +import selection_clone from "./clone.js"; +import selection_datum from "./datum.js"; +import selection_on from "./on.js"; +import selection_dispatch from "./dispatch.js"; +import selection_iterator from "./iterator.js"; + +export var root = [null]; + +export function Selection(groups, parents) { + this._groups = groups; + this._parents = parents; +} + +function selection() { + return new Selection([[document.documentElement]], root); +} + +function selection_selection() { + return this; +} + +Selection.prototype = selection.prototype = { + constructor: Selection, + select: selection_select, + selectAll: selection_selectAll, + selectChild: selection_selectChild, + selectChildren: selection_selectChildren, + filter: selection_filter, + data: selection_data, + enter: selection_enter, + exit: selection_exit, + join: selection_join, + merge: selection_merge, + selection: selection_selection, + order: selection_order, + sort: selection_sort, + call: selection_call, + nodes: selection_nodes, + node: selection_node, + size: selection_size, + empty: selection_empty, + each: selection_each, + attr: selection_attr, + style: selection_style, + property: selection_property, + classed: selection_classed, + text: selection_text, + html: selection_html, + raise: selection_raise, + lower: selection_lower, + append: selection_append, + insert: selection_insert, + remove: selection_remove, + clone: selection_clone, + datum: selection_datum, + on: selection_on, + dispatch: selection_dispatch, + [Symbol.iterator]: selection_iterator +}; + +export default selection; diff --git a/node_modules/d3-selection/src/selection/insert.js b/node_modules/d3-selection/src/selection/insert.js new file mode 100644 index 0000000..1733de5 --- /dev/null +++ b/node_modules/d3-selection/src/selection/insert.js @@ -0,0 +1,14 @@ +import creator from "../creator.js"; +import selector from "../selector.js"; + +function constantNull() { + return null; +} + +export default function(name, before) { + var create = typeof name === "function" ? name : creator(name), + select = before == null ? constantNull : typeof before === "function" ? before : selector(before); + return this.select(function() { + return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null); + }); +} diff --git a/node_modules/d3-selection/src/selection/iterator.js b/node_modules/d3-selection/src/selection/iterator.js new file mode 100644 index 0000000..5872819 --- /dev/null +++ b/node_modules/d3-selection/src/selection/iterator.js @@ -0,0 +1,7 @@ +export default function*() { + for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { + for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) { + if (node = group[i]) yield node; + } + } +} diff --git a/node_modules/d3-selection/src/selection/join.js b/node_modules/d3-selection/src/selection/join.js new file mode 100644 index 0000000..8b47281 --- /dev/null +++ b/node_modules/d3-selection/src/selection/join.js @@ -0,0 +1,15 @@ +export default function(onenter, onupdate, onexit) { + var enter = this.enter(), update = this, exit = this.exit(); + if (typeof onenter === "function") { + enter = onenter(enter); + if (enter) enter = enter.selection(); + } else { + enter = enter.append(onenter + ""); + } + if (onupdate != null) { + update = onupdate(update); + if (update) update = update.selection(); + } + if (onexit == null) exit.remove(); else onexit(exit); + return enter && update ? enter.merge(update).order() : update; +} diff --git a/node_modules/d3-selection/src/selection/lower.js b/node_modules/d3-selection/src/selection/lower.js new file mode 100644 index 0000000..d724713 --- /dev/null +++ b/node_modules/d3-selection/src/selection/lower.js @@ -0,0 +1,7 @@ +function lower() { + if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild); +} + +export default function() { + return this.each(lower); +} diff --git a/node_modules/d3-selection/src/selection/merge.js b/node_modules/d3-selection/src/selection/merge.js new file mode 100644 index 0000000..fd68d6c --- /dev/null +++ b/node_modules/d3-selection/src/selection/merge.js @@ -0,0 +1,19 @@ +import {Selection} from "./index.js"; + +export default function(context) { + var selection = context.selection ? context.selection() : context; + + for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) { + for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) { + if (node = group0[i] || group1[i]) { + merge[i] = node; + } + } + } + + for (; j < m0; ++j) { + merges[j] = groups0[j]; + } + + return new Selection(merges, this._parents); +} diff --git a/node_modules/d3-selection/src/selection/node.js b/node_modules/d3-selection/src/selection/node.js new file mode 100644 index 0000000..0691cbc --- /dev/null +++ b/node_modules/d3-selection/src/selection/node.js @@ -0,0 +1,11 @@ +export default function() { + + for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { + for (var group = groups[j], i = 0, n = group.length; i < n; ++i) { + var node = group[i]; + if (node) return node; + } + } + + return null; +} diff --git a/node_modules/d3-selection/src/selection/nodes.js b/node_modules/d3-selection/src/selection/nodes.js new file mode 100644 index 0000000..7f38090 --- /dev/null +++ b/node_modules/d3-selection/src/selection/nodes.js @@ -0,0 +1,3 @@ +export default function() { + return Array.from(this); +} diff --git a/node_modules/d3-selection/src/selection/on.js b/node_modules/d3-selection/src/selection/on.js new file mode 100644 index 0000000..7906c8c --- /dev/null +++ b/node_modules/d3-selection/src/selection/on.js @@ -0,0 +1,67 @@ +function contextListener(listener) { + return function(event) { + listener.call(this, event, this.__data__); + }; +} + +function parseTypenames(typenames) { + return typenames.trim().split(/^|\s+/).map(function(t) { + var name = "", i = t.indexOf("."); + if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i); + return {type: t, name: name}; + }); +} + +function onRemove(typename) { + return function() { + var on = this.__on; + if (!on) return; + for (var j = 0, i = -1, m = on.length, o; j < m; ++j) { + if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) { + this.removeEventListener(o.type, o.listener, o.options); + } else { + on[++i] = o; + } + } + if (++i) on.length = i; + else delete this.__on; + }; +} + +function onAdd(typename, value, options) { + return function() { + var on = this.__on, o, listener = contextListener(value); + if (on) for (var j = 0, m = on.length; j < m; ++j) { + if ((o = on[j]).type === typename.type && o.name === typename.name) { + this.removeEventListener(o.type, o.listener, o.options); + this.addEventListener(o.type, o.listener = listener, o.options = options); + o.value = value; + return; + } + } + this.addEventListener(typename.type, listener, options); + o = {type: typename.type, name: typename.name, value: value, listener: listener, options: options}; + if (!on) this.__on = [o]; + else on.push(o); + }; +} + +export default function(typename, value, options) { + var typenames = parseTypenames(typename + ""), i, n = typenames.length, t; + + if (arguments.length < 2) { + var on = this.node().__on; + if (on) for (var j = 0, m = on.length, o; j < m; ++j) { + for (i = 0, o = on[j]; i < n; ++i) { + if ((t = typenames[i]).type === o.type && t.name === o.name) { + return o.value; + } + } + } + return; + } + + on = value ? onAdd : onRemove; + for (i = 0; i < n; ++i) this.each(on(typenames[i], value, options)); + return this; +} diff --git a/node_modules/d3-selection/src/selection/order.js b/node_modules/d3-selection/src/selection/order.js new file mode 100644 index 0000000..f8c52b4 --- /dev/null +++ b/node_modules/d3-selection/src/selection/order.js @@ -0,0 +1,13 @@ +export default function() { + + for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) { + for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0;) { + if (node = group[i]) { + if (next && node.compareDocumentPosition(next) ^ 4) next.parentNode.insertBefore(node, next); + next = node; + } + } + } + + return this; +} diff --git a/node_modules/d3-selection/src/selection/property.js b/node_modules/d3-selection/src/selection/property.js new file mode 100644 index 0000000..3b7efd3 --- /dev/null +++ b/node_modules/d3-selection/src/selection/property.js @@ -0,0 +1,28 @@ +function propertyRemove(name) { + return function() { + delete this[name]; + }; +} + +function propertyConstant(name, value) { + return function() { + this[name] = value; + }; +} + +function propertyFunction(name, value) { + return function() { + var v = value.apply(this, arguments); + if (v == null) delete this[name]; + else this[name] = v; + }; +} + +export default function(name, value) { + return arguments.length > 1 + ? this.each((value == null + ? propertyRemove : typeof value === "function" + ? propertyFunction + : propertyConstant)(name, value)) + : this.node()[name]; +} diff --git a/node_modules/d3-selection/src/selection/raise.js b/node_modules/d3-selection/src/selection/raise.js new file mode 100644 index 0000000..3e9e1c9 --- /dev/null +++ b/node_modules/d3-selection/src/selection/raise.js @@ -0,0 +1,7 @@ +function raise() { + if (this.nextSibling) this.parentNode.appendChild(this); +} + +export default function() { + return this.each(raise); +} diff --git a/node_modules/d3-selection/src/selection/remove.js b/node_modules/d3-selection/src/selection/remove.js new file mode 100644 index 0000000..12a8106 --- /dev/null +++ b/node_modules/d3-selection/src/selection/remove.js @@ -0,0 +1,8 @@ +function remove() { + var parent = this.parentNode; + if (parent) parent.removeChild(this); +} + +export default function() { + return this.each(remove); +} diff --git a/node_modules/d3-selection/src/selection/select.js b/node_modules/d3-selection/src/selection/select.js new file mode 100644 index 0000000..223cc24 --- /dev/null +++ b/node_modules/d3-selection/src/selection/select.js @@ -0,0 +1,17 @@ +import {Selection} from "./index.js"; +import selector from "../selector.js"; + +export default function(select) { + if (typeof select !== "function") select = selector(select); + + for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { + for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) { + if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) { + if ("__data__" in node) subnode.__data__ = node.__data__; + subgroup[i] = subnode; + } + } + } + + return new Selection(subgroups, this._parents); +} diff --git a/node_modules/d3-selection/src/selection/selectAll.js b/node_modules/d3-selection/src/selection/selectAll.js new file mode 100644 index 0000000..2a87a27 --- /dev/null +++ b/node_modules/d3-selection/src/selection/selectAll.js @@ -0,0 +1,25 @@ +import {Selection} from "./index.js"; +import array from "../array.js"; +import selectorAll from "../selectorAll.js"; + +function arrayAll(select) { + return function() { + return array(select.apply(this, arguments)); + }; +} + +export default function(select) { + if (typeof select === "function") select = arrayAll(select); + else select = selectorAll(select); + + for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) { + for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { + if (node = group[i]) { + subgroups.push(select.call(node, node.__data__, i, group)); + parents.push(node); + } + } + } + + return new Selection(subgroups, parents); +} diff --git a/node_modules/d3-selection/src/selection/selectChild.js b/node_modules/d3-selection/src/selection/selectChild.js new file mode 100644 index 0000000..d042794 --- /dev/null +++ b/node_modules/d3-selection/src/selection/selectChild.js @@ -0,0 +1,18 @@ +import {childMatcher} from "../matcher.js"; + +var find = Array.prototype.find; + +function childFind(match) { + return function() { + return find.call(this.children, match); + }; +} + +function childFirst() { + return this.firstElementChild; +} + +export default function(match) { + return this.select(match == null ? childFirst + : childFind(typeof match === "function" ? match : childMatcher(match))); +} diff --git a/node_modules/d3-selection/src/selection/selectChildren.js b/node_modules/d3-selection/src/selection/selectChildren.js new file mode 100644 index 0000000..d514d3b --- /dev/null +++ b/node_modules/d3-selection/src/selection/selectChildren.js @@ -0,0 +1,18 @@ +import {childMatcher} from "../matcher.js"; + +var filter = Array.prototype.filter; + +function children() { + return Array.from(this.children); +} + +function childrenFilter(match) { + return function() { + return filter.call(this.children, match); + }; +} + +export default function(match) { + return this.selectAll(match == null ? children + : childrenFilter(typeof match === "function" ? match : childMatcher(match))); +} diff --git a/node_modules/d3-selection/src/selection/size.js b/node_modules/d3-selection/src/selection/size.js new file mode 100644 index 0000000..e07eaa4 --- /dev/null +++ b/node_modules/d3-selection/src/selection/size.js @@ -0,0 +1,5 @@ +export default function() { + let size = 0; + for (const node of this) ++size; // eslint-disable-line no-unused-vars + return size; +} diff --git a/node_modules/d3-selection/src/selection/sort.js b/node_modules/d3-selection/src/selection/sort.js new file mode 100644 index 0000000..336760f --- /dev/null +++ b/node_modules/d3-selection/src/selection/sort.js @@ -0,0 +1,24 @@ +import {Selection} from "./index.js"; + +export default function(compare) { + if (!compare) compare = ascending; + + function compareNode(a, b) { + return a && b ? compare(a.__data__, b.__data__) : !a - !b; + } + + for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) { + for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) { + if (node = group[i]) { + sortgroup[i] = node; + } + } + sortgroup.sort(compareNode); + } + + return new Selection(sortgroups, this._parents).order(); +} + +function ascending(a, b) { + return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN; +} diff --git a/node_modules/d3-selection/src/selection/sparse.js b/node_modules/d3-selection/src/selection/sparse.js new file mode 100644 index 0000000..7b261ad --- /dev/null +++ b/node_modules/d3-selection/src/selection/sparse.js @@ -0,0 +1,3 @@ +export default function(update) { + return new Array(update.length); +} diff --git a/node_modules/d3-selection/src/selection/style.js b/node_modules/d3-selection/src/selection/style.js new file mode 100644 index 0000000..7e0f058 --- /dev/null +++ b/node_modules/d3-selection/src/selection/style.js @@ -0,0 +1,35 @@ +import defaultView from "../window.js"; + +function styleRemove(name) { + return function() { + this.style.removeProperty(name); + }; +} + +function styleConstant(name, value, priority) { + return function() { + this.style.setProperty(name, value, priority); + }; +} + +function styleFunction(name, value, priority) { + return function() { + var v = value.apply(this, arguments); + if (v == null) this.style.removeProperty(name); + else this.style.setProperty(name, v, priority); + }; +} + +export default function(name, value, priority) { + return arguments.length > 1 + ? this.each((value == null + ? styleRemove : typeof value === "function" + ? styleFunction + : styleConstant)(name, value, priority == null ? "" : priority)) + : styleValue(this.node(), name); +} + +export function styleValue(node, name) { + return node.style.getPropertyValue(name) + || defaultView(node).getComputedStyle(node, null).getPropertyValue(name); +} diff --git a/node_modules/d3-selection/src/selection/text.js b/node_modules/d3-selection/src/selection/text.js new file mode 100644 index 0000000..a902980 --- /dev/null +++ b/node_modules/d3-selection/src/selection/text.js @@ -0,0 +1,25 @@ +function textRemove() { + this.textContent = ""; +} + +function textConstant(value) { + return function() { + this.textContent = value; + }; +} + +function textFunction(value) { + return function() { + var v = value.apply(this, arguments); + this.textContent = v == null ? "" : v; + }; +} + +export default function(value) { + return arguments.length + ? this.each(value == null + ? textRemove : (typeof value === "function" + ? textFunction + : textConstant)(value)) + : this.node().textContent; +} diff --git a/node_modules/d3-selection/src/selector.js b/node_modules/d3-selection/src/selector.js new file mode 100644 index 0000000..058bd73 --- /dev/null +++ b/node_modules/d3-selection/src/selector.js @@ -0,0 +1,7 @@ +function none() {} + +export default function(selector) { + return selector == null ? none : function() { + return this.querySelector(selector); + }; +} diff --git a/node_modules/d3-selection/src/selectorAll.js b/node_modules/d3-selection/src/selectorAll.js new file mode 100644 index 0000000..ea42ffa --- /dev/null +++ b/node_modules/d3-selection/src/selectorAll.js @@ -0,0 +1,9 @@ +function empty() { + return []; +} + +export default function(selector) { + return selector == null ? empty : function() { + return this.querySelectorAll(selector); + }; +} diff --git a/node_modules/d3-selection/src/sourceEvent.js b/node_modules/d3-selection/src/sourceEvent.js new file mode 100644 index 0000000..8ab130e --- /dev/null +++ b/node_modules/d3-selection/src/sourceEvent.js @@ -0,0 +1,5 @@ +export default function(event) { + let sourceEvent; + while (sourceEvent = event.sourceEvent) event = sourceEvent; + return event; +} diff --git a/node_modules/d3-selection/src/window.js b/node_modules/d3-selection/src/window.js new file mode 100644 index 0000000..ca1105b --- /dev/null +++ b/node_modules/d3-selection/src/window.js @@ -0,0 +1,5 @@ +export default function(node) { + return (node.ownerDocument && node.ownerDocument.defaultView) // node is a Node + || (node.document && node) // node is a Window + || node.defaultView; // node is a Document +} diff --git a/node_modules/d3-timer/LICENSE b/node_modules/d3-timer/LICENSE new file mode 100644 index 0000000..b014515 --- /dev/null +++ b/node_modules/d3-timer/LICENSE @@ -0,0 +1,13 @@ +Copyright 2010-2021 Mike Bostock + +Permission to use, copy, modify, and/or distribute this software for any purpose +with or without fee is hereby granted, provided that the above copyright notice +and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. diff --git a/node_modules/d3-timer/README.md b/node_modules/d3-timer/README.md new file mode 100644 index 0000000..a78ce3e --- /dev/null +++ b/node_modules/d3-timer/README.md @@ -0,0 +1,87 @@ +# d3-timer + +This module provides an efficient queue capable of managing thousands of concurrent animations, while guaranteeing consistent, synchronized timing with concurrent or staged animations. Internally, it uses [requestAnimationFrame](https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame) for fluid animation (if available), switching to [setTimeout](https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setTimeout) for delays longer than 24ms. + +## Installing + +If you use npm, `npm install d3-timer`. You can also download the [latest release on GitHub](https://github.com/d3/d3-timer/releases/latest). For vanilla HTML in modern browsers, import d3-timer from Skypack: + +```html + +``` + +For legacy environments, you can load d3-timer’s UMD bundle from an npm-based CDN such as jsDelivr; a `d3` global is exported: + +```html + + +``` + +## API Reference + +# d3.now() [<>](https://github.com/d3/d3-timer/blob/master/src/timer.js "Source") + +Returns the current time as defined by [performance.now](https://developer.mozilla.org/en-US/docs/Web/API/Performance/now) if available, and [Date.now](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/now) if not. The current time is updated at the start of a frame; it is thus consistent during the frame, and any timers scheduled during the same frame will be synchronized. If this method is called outside of a frame, such as in response to a user event, the current time is calculated and then fixed until the next frame, again ensuring consistent timing during event handling. + +# d3.timer(callback[, delay[, time]]) [<>](https://github.com/d3/d3-timer/blob/master/src/timer.js "Source") + +Schedules a new timer, invoking the specified *callback* repeatedly until the timer is [stopped](#timer_stop). An optional numeric *delay* in milliseconds may be specified to invoke the given *callback* after a delay; if *delay* is not specified, it defaults to zero. The delay is relative to the specified *time* in milliseconds; if *time* is not specified, it defaults to [now](#now). + +The *callback* is passed the (apparent) *elapsed* time since the timer became active. For example: + +```js +const t = d3.timer((elapsed) => { + console.log(elapsed); + if (elapsed > 200) t.stop(); +}, 150); +``` + +This produces roughly the following console output: + +``` +3 +25 +48 +65 +85 +106 +125 +146 +167 +189 +209 +``` + +(The exact values may vary depending on your JavaScript runtime and what else your computer is doing.) Note that the first *elapsed* time is 3ms: this is the elapsed time since the timer started, not since the timer was scheduled. Here the timer started 150ms after it was scheduled due to the specified delay. The apparent *elapsed* time may be less than the true *elapsed* time if the page is backgrounded and [requestAnimationFrame](https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame) is paused; in the background, apparent time is frozen. + +If [timer](#timer) is called within the callback of another timer, the new timer callback (if eligible as determined by the specified *delay* and *time*) will be invoked immediately at the end of the current frame, rather than waiting until the next frame. Within a frame, timer callbacks are guaranteed to be invoked in the order they were scheduled, regardless of their start time. + +# timer.restart(callback[, delay[, time]]) [<>](https://github.com/d3/d3-timer/blob/master/src/timer.js "Source") + +Restart a timer with the specified *callback* and optional *delay* and *time*. This is equivalent to stopping this timer and creating a new timer with the specified arguments, although this timer retains the original invocation priority. + +# timer.stop() [<>](https://github.com/d3/d3-timer/blob/master/src/timer.js "Source") + +Stops this timer, preventing subsequent callbacks. This method has no effect if the timer has already stopped. + +# d3.timerFlush() [<>](https://github.com/d3/d3-timer/blob/master/src/timer.js "Source") + +Immediately invoke any eligible timer callbacks. Note that zero-delay timers are normally first executed after one frame (~17ms). This can cause a brief flicker because the browser renders the page twice: once at the end of the first event loop, then again immediately on the first timer callback. By flushing the timer queue at the end of the first event loop, you can run any zero-delay timers immediately and avoid the flicker. + +# d3.timeout(callback[, delay[, time]]) [<>](https://github.com/d3/d3-timer/blob/master/src/timeout.js "Source") + +Like [timer](#timer), except the timer automatically [stops](#timer_stop) on its first callback. A suitable replacement for [setTimeout](https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setTimeout) that is guaranteed to not run in the background. The *callback* is passed the elapsed time. + +# d3.interval(callback[, delay[, time]]) [<>](https://github.com/d3/d3-timer/blob/master/src/interval.js "Source") + +Like [timer](#timer), except the *callback* is invoked only every *delay* milliseconds; if *delay* is not specified, this is equivalent to [timer](#timer). A suitable replacement for [setInterval](https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setInterval) that is guaranteed to not run in the background. The *callback* is passed the elapsed time. diff --git a/node_modules/d3-timer/dist/d3-timer.js b/node_modules/d3-timer/dist/d3-timer.js new file mode 100644 index 0000000..023aa5c --- /dev/null +++ b/node_modules/d3-timer/dist/d3-timer.js @@ -0,0 +1,153 @@ +// https://d3js.org/d3-timer/ v3.0.1 Copyright 2010-2021 Mike Bostock +(function (global, factory) { +typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : +typeof define === 'function' && define.amd ? define(['exports'], factory) : +(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.d3 = global.d3 || {})); +}(this, (function (exports) { 'use strict'; + +var frame = 0, // is an animation frame pending? + timeout$1 = 0, // is a timeout pending? + interval$1 = 0, // are any timers active? + pokeDelay = 1000, // how frequently we check for clock skew + taskHead, + taskTail, + clockLast = 0, + clockNow = 0, + clockSkew = 0, + clock = typeof performance === "object" && performance.now ? performance : Date, + setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); }; + +function now() { + return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew); +} + +function clearNow() { + clockNow = 0; +} + +function Timer() { + this._call = + this._time = + this._next = null; +} + +Timer.prototype = timer.prototype = { + constructor: Timer, + restart: function(callback, delay, time) { + if (typeof callback !== "function") throw new TypeError("callback is not a function"); + time = (time == null ? now() : +time) + (delay == null ? 0 : +delay); + if (!this._next && taskTail !== this) { + if (taskTail) taskTail._next = this; + else taskHead = this; + taskTail = this; + } + this._call = callback; + this._time = time; + sleep(); + }, + stop: function() { + if (this._call) { + this._call = null; + this._time = Infinity; + sleep(); + } + } +}; + +function timer(callback, delay, time) { + var t = new Timer; + t.restart(callback, delay, time); + return t; +} + +function timerFlush() { + now(); // Get the current time, if not already set. + ++frame; // Pretend we’ve set an alarm, if we haven’t already. + var t = taskHead, e; + while (t) { + if ((e = clockNow - t._time) >= 0) t._call.call(undefined, e); + t = t._next; + } + --frame; +} + +function wake() { + clockNow = (clockLast = clock.now()) + clockSkew; + frame = timeout$1 = 0; + try { + timerFlush(); + } finally { + frame = 0; + nap(); + clockNow = 0; + } +} + +function poke() { + var now = clock.now(), delay = now - clockLast; + if (delay > pokeDelay) clockSkew -= delay, clockLast = now; +} + +function nap() { + var t0, t1 = taskHead, t2, time = Infinity; + while (t1) { + if (t1._call) { + if (time > t1._time) time = t1._time; + t0 = t1, t1 = t1._next; + } else { + t2 = t1._next, t1._next = null; + t1 = t0 ? t0._next = t2 : taskHead = t2; + } + } + taskTail = t0; + sleep(time); +} + +function sleep(time) { + if (frame) return; // Soonest alarm already set, or will be. + if (timeout$1) timeout$1 = clearTimeout(timeout$1); + var delay = time - clockNow; // Strictly less than if we recomputed clockNow. + if (delay > 24) { + if (time < Infinity) timeout$1 = setTimeout(wake, time - clock.now() - clockSkew); + if (interval$1) interval$1 = clearInterval(interval$1); + } else { + if (!interval$1) clockLast = clock.now(), interval$1 = setInterval(poke, pokeDelay); + frame = 1, setFrame(wake); + } +} + +function timeout(callback, delay, time) { + var t = new Timer; + delay = delay == null ? 0 : +delay; + t.restart(elapsed => { + t.stop(); + callback(elapsed + delay); + }, delay, time); + return t; +} + +function interval(callback, delay, time) { + var t = new Timer, total = delay; + if (delay == null) return t.restart(callback, delay, time), t; + t._restart = t.restart; + t.restart = function(callback, delay, time) { + delay = +delay, time = time == null ? now() : +time; + t._restart(function tick(elapsed) { + elapsed += total; + t._restart(tick, total += delay, time); + callback(elapsed); + }, delay, time); + }; + t.restart(callback, delay, time); + return t; +} + +exports.interval = interval; +exports.now = now; +exports.timeout = timeout; +exports.timer = timer; +exports.timerFlush = timerFlush; + +Object.defineProperty(exports, '__esModule', { value: true }); + +}))); diff --git a/node_modules/d3-timer/dist/d3-timer.min.js b/node_modules/d3-timer/dist/d3-timer.min.js new file mode 100644 index 0000000..7fee967 --- /dev/null +++ b/node_modules/d3-timer/dist/d3-timer.min.js @@ -0,0 +1,2 @@ +// https://d3js.org/d3-timer/ v3.0.1 Copyright 2010-2021 Mike Bostock +!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).d3=t.d3||{})}(this,(function(t){"use strict";var n,e,o=0,i=0,r=0,l=0,u=0,a=0,s="object"==typeof performance&&performance.now?performance:Date,c="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function f(){return u||(c(_),u=s.now()+a)}function _(){u=0}function m(){this._call=this._time=this._next=null}function p(t,n,e){var o=new m;return o.restart(t,n,e),o}function w(){f(),++o;for(var t,e=n;e;)(t=u-e._time)>=0&&e._call.call(void 0,t),e=e._next;--o}function d(){u=(l=s.now())+a,o=i=0;try{w()}finally{o=0,function(){var t,o,i=n,r=1/0;for(;i;)i._call?(r>i._time&&(r=i._time),t=i,i=i._next):(o=i._next,i._next=null,i=t?t._next=o:n=o);e=t,y(r)}(),u=0}}function h(){var t=s.now(),n=t-l;n>1e3&&(a-=n,l=t)}function y(t){o||(i&&(i=clearTimeout(i)),t-u>24?(t<1/0&&(i=setTimeout(d,t-s.now()-a)),r&&(r=clearInterval(r))):(r||(l=s.now(),r=setInterval(h,1e3)),o=1,c(d)))}m.prototype=p.prototype={constructor:m,restart:function(t,o,i){if("function"!=typeof t)throw new TypeError("callback is not a function");i=(null==i?f():+i)+(null==o?0:+o),this._next||e===this||(e?e._next=this:n=this,e=this),this._call=t,this._time=i,y()},stop:function(){this._call&&(this._call=null,this._time=1/0,y())}},t.interval=function(t,n,e){var o=new m,i=n;return null==n?(o.restart(t,n,e),o):(o._restart=o.restart,o.restart=function(t,n,e){n=+n,e=null==e?f():+e,o._restart((function r(l){l+=i,o._restart(r,i+=n,e),t(l)}),n,e)},o.restart(t,n,e),o)},t.now=f,t.timeout=function(t,n,e){var o=new m;return n=null==n?0:+n,o.restart((e=>{o.stop(),t(e+n)}),n,e),o},t.timer=p,t.timerFlush=w,Object.defineProperty(t,"__esModule",{value:!0})})); diff --git a/node_modules/d3-timer/package.json b/node_modules/d3-timer/package.json new file mode 100644 index 0000000..fc52f55 --- /dev/null +++ b/node_modules/d3-timer/package.json @@ -0,0 +1,53 @@ +{ + "name": "d3-timer", + "version": "3.0.1", + "description": "An efficient queue capable of managing thousands of concurrent animations.", + "homepage": "https://d3js.org/d3-timer/", + "repository": { + "type": "git", + "url": "https://github.com/d3/d3-timer.git" + }, + "keywords": [ + "d3", + "d3-module", + "timer", + "transition", + "animation", + "requestAnimationFrame", + "setTimeout", + "setInterval" + ], + "license": "ISC", + "author": { + "name": "Mike Bostock", + "url": "http://bost.ocks.org/mike" + }, + "type": "module", + "files": [ + "dist/**/*.js", + "src/**/*.js" + ], + "module": "src/index.js", + "main": "src/index.js", + "jsdelivr": "dist/d3-timer.min.js", + "unpkg": "dist/d3-timer.min.js", + "exports": { + "umd": "./dist/d3-timer.min.js", + "default": "./src/index.js" + }, + "sideEffects": false, + "devDependencies": { + "eslint": "7", + "mocha": "8", + "rollup": "2", + "rollup-plugin-terser": "7" + }, + "scripts": { + "test": "mocha 'test/**/*-test.js' && eslint src test", + "prepublishOnly": "rm -rf dist && yarn test && rollup -c", + "postpublish": "git push && git push --tags && cd ../d3.github.com && git pull && cp ../${npm_package_name}/dist/${npm_package_name}.js ${npm_package_name}.v${npm_package_version%%.*}.js && cp ../${npm_package_name}/dist/${npm_package_name}.min.js ${npm_package_name}.v${npm_package_version%%.*}.min.js && git add ${npm_package_name}.v${npm_package_version%%.*}.js ${npm_package_name}.v${npm_package_version%%.*}.min.js && git commit -m \"${npm_package_name} ${npm_package_version}\" && git push && cd -" + }, + "engines": { + "node": ">=12" + } +} diff --git a/node_modules/d3-timer/src/index.js b/node_modules/d3-timer/src/index.js new file mode 100644 index 0000000..66fb8c9 --- /dev/null +++ b/node_modules/d3-timer/src/index.js @@ -0,0 +1,13 @@ +export { + now, + timer, + timerFlush +} from "./timer.js"; + +export { + default as timeout +} from "./timeout.js"; + +export { + default as interval +} from "./interval.js"; diff --git a/node_modules/d3-timer/src/interval.js b/node_modules/d3-timer/src/interval.js new file mode 100644 index 0000000..e38e1bd --- /dev/null +++ b/node_modules/d3-timer/src/interval.js @@ -0,0 +1,17 @@ +import {Timer, now} from "./timer.js"; + +export default function(callback, delay, time) { + var t = new Timer, total = delay; + if (delay == null) return t.restart(callback, delay, time), t; + t._restart = t.restart; + t.restart = function(callback, delay, time) { + delay = +delay, time = time == null ? now() : +time; + t._restart(function tick(elapsed) { + elapsed += total; + t._restart(tick, total += delay, time); + callback(elapsed); + }, delay, time); + } + t.restart(callback, delay, time); + return t; +} diff --git a/node_modules/d3-timer/src/timeout.js b/node_modules/d3-timer/src/timeout.js new file mode 100644 index 0000000..29b4dd2 --- /dev/null +++ b/node_modules/d3-timer/src/timeout.js @@ -0,0 +1,11 @@ +import {Timer} from "./timer.js"; + +export default function(callback, delay, time) { + var t = new Timer; + delay = delay == null ? 0 : +delay; + t.restart(elapsed => { + t.stop(); + callback(elapsed + delay); + }, delay, time); + return t; +} diff --git a/node_modules/d3-timer/src/timer.js b/node_modules/d3-timer/src/timer.js new file mode 100644 index 0000000..79cdf10 --- /dev/null +++ b/node_modules/d3-timer/src/timer.js @@ -0,0 +1,110 @@ +var frame = 0, // is an animation frame pending? + timeout = 0, // is a timeout pending? + interval = 0, // are any timers active? + pokeDelay = 1000, // how frequently we check for clock skew + taskHead, + taskTail, + clockLast = 0, + clockNow = 0, + clockSkew = 0, + clock = typeof performance === "object" && performance.now ? performance : Date, + setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); }; + +export function now() { + return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew); +} + +function clearNow() { + clockNow = 0; +} + +export function Timer() { + this._call = + this._time = + this._next = null; +} + +Timer.prototype = timer.prototype = { + constructor: Timer, + restart: function(callback, delay, time) { + if (typeof callback !== "function") throw new TypeError("callback is not a function"); + time = (time == null ? now() : +time) + (delay == null ? 0 : +delay); + if (!this._next && taskTail !== this) { + if (taskTail) taskTail._next = this; + else taskHead = this; + taskTail = this; + } + this._call = callback; + this._time = time; + sleep(); + }, + stop: function() { + if (this._call) { + this._call = null; + this._time = Infinity; + sleep(); + } + } +}; + +export function timer(callback, delay, time) { + var t = new Timer; + t.restart(callback, delay, time); + return t; +} + +export function timerFlush() { + now(); // Get the current time, if not already set. + ++frame; // Pretend we’ve set an alarm, if we haven’t already. + var t = taskHead, e; + while (t) { + if ((e = clockNow - t._time) >= 0) t._call.call(undefined, e); + t = t._next; + } + --frame; +} + +function wake() { + clockNow = (clockLast = clock.now()) + clockSkew; + frame = timeout = 0; + try { + timerFlush(); + } finally { + frame = 0; + nap(); + clockNow = 0; + } +} + +function poke() { + var now = clock.now(), delay = now - clockLast; + if (delay > pokeDelay) clockSkew -= delay, clockLast = now; +} + +function nap() { + var t0, t1 = taskHead, t2, time = Infinity; + while (t1) { + if (t1._call) { + if (time > t1._time) time = t1._time; + t0 = t1, t1 = t1._next; + } else { + t2 = t1._next, t1._next = null; + t1 = t0 ? t0._next = t2 : taskHead = t2; + } + } + taskTail = t0; + sleep(time); +} + +function sleep(time) { + if (frame) return; // Soonest alarm already set, or will be. + if (timeout) timeout = clearTimeout(timeout); + var delay = time - clockNow; // Strictly less than if we recomputed clockNow. + if (delay > 24) { + if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew); + if (interval) interval = clearInterval(interval); + } else { + if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay); + frame = 1, setFrame(wake); + } +} diff --git a/node_modules/d3-transition/LICENSE b/node_modules/d3-transition/LICENSE new file mode 100644 index 0000000..b014515 --- /dev/null +++ b/node_modules/d3-transition/LICENSE @@ -0,0 +1,13 @@ +Copyright 2010-2021 Mike Bostock + +Permission to use, copy, modify, and/or distribute this software for any purpose +with or without fee is hereby granted, provided that the above copyright notice +and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. diff --git a/node_modules/d3-transition/README.md b/node_modules/d3-transition/README.md new file mode 100644 index 0000000..3802a99 --- /dev/null +++ b/node_modules/d3-transition/README.md @@ -0,0 +1,490 @@ +# d3-transition + +A transition is a [selection](https://github.com/d3/d3-selection)-like interface for animating changes to the DOM. Instead of applying changes instantaneously, transitions smoothly interpolate the DOM from its current state to the desired target state over a given duration. + +To apply a transition, select elements, call [*selection*.transition](#selection_transition), and then make the desired changes. For example: + +```js +d3.select("body") + .transition() + .style("background-color", "red"); +``` + +Transitions support most selection methods (such as [*transition*.attr](#transition_attr) and [*transition*.style](#transition_style) in place of [*selection*.attr](https://github.com/d3/d3-selection#selection_attr) and [*selection*.style](https://github.com/d3/d3-selection#selection_style)), but not all methods are supported; for example, you must [append](https://github.com/d3/d3-selection#selection_append) elements or [bind data](https://github.com/d3/d3-selection#joining-data) before a transition starts. A [*transition*.remove](#transition_remove) operator is provided for convenient removal of elements when the transition ends. + +To compute intermediate state, transitions leverage a variety of [built-in interpolators](https://github.com/d3/d3-interpolate). [Colors](https://github.com/d3/d3-interpolate#interpolateRgb), [numbers](https://github.com/d3/d3-interpolate#interpolateNumber), and [transforms](https://github.com/d3/d3-interpolate#interpolateTransform) are automatically detected. [Strings](https://github.com/d3/d3-interpolate#interpolateString) with embedded numbers are also detected, as is common with many styles (such as padding or font sizes) and paths. To specify a custom interpolator, use [*transition*.attrTween](#transition_attrTween), [*transition*.styleTween](#transition_styleTween) or [*transition*.tween](#transition_tween). + +## Installing + +If you use npm, `npm install d3-transition`. You can also download the [latest release on GitHub](https://github.com/d3/d3-transition/releases/latest). For vanilla HTML in modern browsers, import d3-transition from Skypack: + +```html + +``` + +For legacy environments, you can load d3-transition’s UMD bundle from an npm-based CDN such as jsDelivr; a `d3` global is exported: + +```html + + + + + + + + +``` + +[Try d3-transition in your browser.](https://observablehq.com/collection/@d3/d3-transition) + +## API Reference + +* [Selecting Elements](#selecting-elements) +* [Modifying Elements](#modifying-elements) +* [Timing](#timing) +* [Control Flow](#control-flow) +* [The Life of a Transition](#the-life-of-a-transition) + +### Selecting Elements + +Transitions are derived from [selections](https://github.com/d3/d3-selection) via [*selection*.transition](#selection_transition). You can also create a transition on the document root element using [d3.transition](#transition). + +# selection.transition([name]) · [Source](https://github.com/d3/d3-transition/blob/master/src/selection/transition.js) + +Returns a new transition on the given *selection* with the specified *name*. If a *name* is not specified, null is used. The new transition is only exclusive with other transitions of the same name. + +If the *name* is a [transition](#transition) instance, the returned transition has the same id and name as the specified transition. If a transition with the same id already exists on a selected element, the existing transition is returned for that element. Otherwise, the timing of the returned transition is inherited from the existing transition of the same id on the nearest ancestor of each selected element. Thus, this method can be used to synchronize a transition across multiple selections, or to re-select a transition for specific elements and modify its configuration. For example: + +```js +var t = d3.transition() + .duration(750) + .ease(d3.easeLinear); + +d3.selectAll(".apple").transition(t) + .style("fill", "red"); + +d3.selectAll(".orange").transition(t) + .style("fill", "orange"); +``` + +If the specified *transition* is not found on a selected node or its ancestors (such as if the transition [already ended](#the-life-of-a-transition)), the default timing parameters are used; however, in a future release, this will likely be changed to throw an error. See [#59](https://github.com/d3/d3-transition/issues/59). + +# selection.interrupt([name]) · [Source](https://github.com/d3/d3-transition/blob/master/src/selection/interrupt.js) + +Interrupts the active transition of the specified *name* on the selected elements, and cancels any pending transitions with the specified *name*, if any. If a name is not specified, null is used. + +Interrupting a transition on an element has no effect on any transitions on any descendant elements. For example, an [axis transition](https://github.com/d3/d3-axis) consists of multiple independent, synchronized transitions on the descendants of the axis [G element](https://www.w3.org/TR/SVG/struct.html#Groups) (the tick lines, the tick labels, the domain path, *etc.*). To interrupt the axis transition, you must therefore interrupt the descendants: + +```js +selection.selectAll("*").interrupt(); +``` + +The [universal selector](https://developer.mozilla.org/en-US/docs/Web/CSS/Universal_selectors), `*`, selects all descendant elements. If you also want to interrupt the G element itself: + +```js +selection.interrupt().selectAll("*").interrupt(); +``` + +# d3.interrupt(node[, name]) · [Source](https://github.com/d3/d3-transition/blob/master/src/interrupt.js) + +Interrupts the active transition of the specified *name* on the specified *node*, and cancels any pending transitions with the specified *name*, if any. If a name is not specified, null is used. See also [*selection*.interrupt](#selection_interrupt). + +# d3.transition([name]) · [Source](https://github.com/d3/d3-transition/blob/master/src/transition/index.js#L29) + +Returns a new transition on the root element, `document.documentElement`, with the specified *name*. If a *name* is not specified, null is used. The new transition is only exclusive with other transitions of the same name. The *name* may also be a [transition](#transition) instance; see [*selection*.transition](#selection_transition). This method is equivalent to: + +```js +d3.selection() + .transition(name) +``` + +This function can also be used to test for transitions (`instanceof d3.transition`) or to extend the transition prototype. + +# transition.select(selector) · [Source](https://github.com/d3/d3-transition/blob/master/src/transition/select.js) + +For each selected element, selects the first descendant element that matches the specified *selector* string, if any, and returns a transition on the resulting selection. The *selector* may be specified either as a selector string or a function. If a function, it is evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element. The new transition has the same id, name and timing as this transition; however, if a transition with the same id already exists on a selected element, the existing transition is returned for that element. + +This method is equivalent to deriving the selection for this transition via [*transition*.selection](#transition_selection), creating a subselection via [*selection*.select](https://github.com/d3/d3-selection#selection_select), and then creating a new transition via [*selection*.transition](#selection_transition): + +```js +transition + .selection() + .select(selector) + .transition(transition) +``` + +# transition.selectAll(selector) · [Source](https://github.com/d3/d3-transition/blob/master/src/transition/selectAll.js) + +For each selected element, selects all descendant elements that match the specified *selector* string, if any, and returns a transition on the resulting selection. The *selector* may be specified either as a selector string or a function. If a function, it is evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element. The new transition has the same id, name and timing as this transition; however, if a transition with the same id already exists on a selected element, the existing transition is returned for that element. + +This method is equivalent to deriving the selection for this transition via [*transition*.selection](#transition_selection), creating a subselection via [*selection*.selectAll](https://github.com/d3/d3-selection#selection_selectAll), and then creating a new transition via [*selection*.transition](#selection_transition): + +```js +transition + .selection() + .selectAll(selector) + .transition(transition) +``` + +# transition.selectChild([selector]) · [Source](https://github.com/d3/d3-transition/blob/master/src/transition/select.js) + +For each selected element, selects the first child element that matches the specified *selector* string, if any, and returns a transition on the resulting selection. The *selector* may be specified either as a selector string or a function. If a function, it is evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element. The new transition has the same id, name and timing as this transition; however, if a transition with the same id already exists on a selected element, the existing transition is returned for that element. + +This method is equivalent to deriving the selection for this transition via [*transition*.selection](#transition_selection), creating a subselection via [*selection*.selectChild](https://github.com/d3/d3-selection#selection_selectChild), and then creating a new transition via [*selection*.transition](#selection_transition): + +```js +transition + .selection() + .selectChild(selector) + .transition(transition) +``` + +# transition.selectChildren([selector]) · [Source](https://github.com/d3/d3-transition/blob/master/src/transition/selectAll.js) + +For each selected element, selects all children that match the specified *selector* string, if any, and returns a transition on the resulting selection. The *selector* may be specified either as a selector string or a function. If a function, it is evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element. The new transition has the same id, name and timing as this transition; however, if a transition with the same id already exists on a selected element, the existing transition is returned for that element. + +This method is equivalent to deriving the selection for this transition via [*transition*.selection](#transition_selection), creating a subselection via [*selection*.selectChildren](https://github.com/d3/d3-selection#selection_selectChildren), and then creating a new transition via [*selection*.transition](#selection_transition): + +```js +transition + .selection() + .selectChildren(selector) + .transition(transition) +``` + +# transition.filter(filter) · [Source](https://github.com/d3/d3-transition/blob/master/src/transition/filter.js) + +For each selected element, selects only the elements that match the specified *filter*, and returns a transition on the resulting selection. The *filter* may be specified either as a selector string or a function. If a function, it is evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element. The new transition has the same id, name and timing as this transition; however, if a transition with the same id already exists on a selected element, the existing transition is returned for that element. + +This method is equivalent to deriving the selection for this transition via [*transition*.selection](#transition_selection), creating a subselection via [*selection*.filter](https://github.com/d3/d3-selection#selection_filter), and then creating a new transition via [*selection*.transition](#selection_transition): + +```js +transition + .selection() + .filter(filter) + .transition(transition) +``` + +# transition.merge(other) · [Source](https://github.com/d3/d3-transition/blob/master/src/transition/merge.js) + +Returns a new transition merging this transition with the specified *other* transition, which must have the same id as this transition. The returned transition has the same number of groups, the same parents, the same name and the same id as this transition. Any missing (null) elements in this transition are filled with the corresponding element, if present (not null), from the *other* transition. + +This method is equivalent to deriving the selection for this transition via [*transition*.selection](#transition_selection), merging with the selection likewise derived from the *other* transition via [*selection*.merge](https://github.com/d3/d3-selection#selection_merge), and then creating a new transition via [*selection*.transition](#selection_transition): + +```js +transition + .selection() + .merge(other.selection()) + .transition(transition) +``` + +# transition.transition() · [Source](https://github.com/d3/d3-transition/blob/master/src/transition/transition.js) + +Returns a new transition on the same selected elements as this transition, scheduled to start when this transition ends. The new transition inherits a reference time equal to this transition’s time plus its [delay](#transition_delay) and [duration](#transition_duration). The new transition also inherits this transition’s name, duration, and [easing](#transition_ease). This method can be used to schedule a sequence of chained transitions. For example: + +```js +d3.selectAll(".apple") + .transition() // First fade to green. + .style("fill", "green") + .transition() // Then red. + .style("fill", "red") + .transition() // Wait one second. Then brown, and remove. + .delay(1000) + .style("fill", "brown") + .remove(); +``` + +The delay for each transition is relative to its previous transition. Thus, in the above example, apples will stay red for one second before the last transition to brown starts. + +# transition.selection() · [Source](https://github.com/d3/d3-transition/blob/master/src/transition/selection.js) + +Returns the [selection](https://github.com/d3/d3-selection#selection) corresponding to this transition. + +# d3.active(node[, name]) · [Source](https://github.com/d3/d3-transition/blob/master/src/active.js) + +Returns the active transition on the specified *node* with the specified *name*, if any. If no *name* is specified, null is used. Returns null if there is no such active transition on the specified node. This method is useful for creating chained transitions. For example, to initiate disco mode: + +```js +d3.selectAll("circle").transition() + .delay(function(d, i) { return i * 50; }) + .on("start", function repeat() { + d3.active(this) + .style("fill", "red") + .transition() + .style("fill", "green") + .transition() + .style("fill", "blue") + .transition() + .on("start", repeat); + }); +``` + +See [chained transitions](https://bl.ocks.org/mbostock/70d5541b547cc222aa02) for an example. + +### Modifying Elements + +After selecting elements and creating a transition with [*selection*.transition](#selection_transition), use the transition’s transformation methods to affect document content. + +# transition.attr(name, value) · [Source](https://github.com/d3/d3-transition/blob/master/src/transition/attr.js) + +For each selected element, assigns the [attribute tween](#transition_attrTween) for the attribute with the specified *name* to the specified target *value*. The starting value of the tween is the attribute’s value when the transition starts. The target *value* may be specified either as a constant or a function. If a function, it is immediately evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element. + +If the target value is null, the attribute is removed when the transition starts. Otherwise, an interpolator is chosen based on the type of the target value, using the following algorithm: + +1. If *value* is a number, use [interpolateNumber](https://github.com/d3/d3-interpolate#interpolateNumber). +2. If *value* is a [color](https://github.com/d3/d3-color#color) or a string coercible to a color, use [interpolateRgb](https://github.com/d3/d3-interpolate#interpolateRgb). +3. Use [interpolateString](https://github.com/d3/d3-interpolate#interpolateString). + +To apply a different interpolator, use [*transition*.attrTween](#transition_attrTween). + +# transition.attrTween(name[, factory]) · [Source](https://github.com/d3/d3-transition/blob/master/src/transition/attrTween.js) + +If *factory* is specified and not null, assigns the attribute [tween](#transition_tween) for the attribute with the specified *name* to the specified interpolator *factory*. An interpolator factory is a function that returns an [interpolator](https://github.com/d3/d3-interpolate); when the transition starts, the *factory* is evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element. The returned interpolator will then be invoked for each frame of the transition, in order, being passed the [eased](#transition_ease) time *t*, typically in the range [0, 1]. Lastly, the return value of the interpolator will be used to set the attribute value. The interpolator must return a string. (To remove an attribute at the start of a transition, use [*transition*.attr](#transition_attr); to remove an attribute at the end of a transition, use [*transition*.on](#transition_on) to listen for the *end* event.) + +If the specified *factory* is null, removes the previously-assigned attribute tween of the specified *name*, if any. If *factory* is not specified, returns the current interpolator factory for attribute with the specified *name*, or undefined if no such tween exists. + +For example, to interpolate the fill attribute from red to blue: + +```js +transition.attrTween("fill", function() { + return d3.interpolateRgb("red", "blue"); +}); +``` + +Or to interpolate from the current fill to blue, like [*transition*.attr](#transition_attr): + +```js +transition.attrTween("fill", function() { + return d3.interpolateRgb(this.getAttribute("fill"), "blue"); +}); +``` + +Or to apply a custom rainbow interpolator: + +```js +transition.attrTween("fill", function() { + return function(t) { + return "hsl(" + t * 360 + ",100%,50%)"; + }; +}); +``` + +This method is useful to specify a custom interpolator, such as one that understands [SVG paths](https://bl.ocks.org/mbostock/3916621). A useful technique is *data interpolation*, where [d3.interpolateObject](https://github.com/d3/d3-interpolate#interpolateObject) is used to interpolate two data values, and the resulting value is then used (say, with a [shape](https://github.com/d3/d3-shape)) to compute the new attribute value. + +# transition.style(name, value[, priority]) · [Source](https://github.com/d3/d3-transition/blob/master/src/transition/style.js) + +For each selected element, assigns the [style tween](#transition_styleTween) for the style with the specified *name* to the specified target *value* with the specified *priority*. The starting value of the tween is the style’s inline value if present, and otherwise its computed value, when the transition starts. The target *value* may be specified either as a constant or a function. If a function, it is immediately evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element. + +If the target value is null, the style is removed when the transition starts. Otherwise, an interpolator is chosen based on the type of the target value, using the following algorithm: + +1. If *value* is a number, use [interpolateNumber](https://github.com/d3/d3-interpolate#interpolateNumber). +2. If *value* is a [color](https://github.com/d3/d3-color#color) or a string coercible to a color, use [interpolateRgb](https://github.com/d3/d3-interpolate#interpolateRgb). +3. Use [interpolateString](https://github.com/d3/d3-interpolate#interpolateString). + +To apply a different interpolator, use [*transition*.styleTween](#transition_styleTween). + +# transition.styleTween(name[, factory[, priority]]) · [Source](https://github.com/d3/d3-transition/blob/master/src/transition/styleTween.js) + +If *factory* is specified and not null, assigns the style [tween](#transition_tween) for the style with the specified *name* to the specified interpolator *factory*. An interpolator factory is a function that returns an [interpolator](https://github.com/d3/d3-interpolate); when the transition starts, the *factory* is evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element. The returned interpolator will then be invoked for each frame of the transition, in order, being passed the [eased](#transition_ease) time *t*, typically in the range [0, 1]. Lastly, the return value of the interpolator will be used to set the style value with the specified *priority*. The interpolator must return a string. (To remove an style at the start of a transition, use [*transition*.style](#transition_style); to remove an style at the end of a transition, use [*transition*.on](#transition_on) to listen for the *end* event.) + +If the specified *factory* is null, removes the previously-assigned style tween of the specified *name*, if any. If *factory* is not specified, returns the current interpolator factory for style with the specified *name*, or undefined if no such tween exists. + +For example, to interpolate the fill style from red to blue: + +```js +transition.styleTween("fill", function() { + return d3.interpolateRgb("red", "blue"); +}); +``` + +Or to interpolate from the current fill to blue, like [*transition*.style](#transition_style): + +```js +transition.styleTween("fill", function() { + return d3.interpolateRgb(this.style.fill, "blue"); +}); +``` + +Or to apply a custom rainbow interpolator: + +```js +transition.styleTween("fill", function() { + return function(t) { + return "hsl(" + t * 360 + ",100%,50%)"; + }; +}); +``` + +This method is useful to specify a custom interpolator, such as with *data interpolation*, where [d3.interpolateObject](https://github.com/d3/d3-interpolate#interpolateObject) is used to interpolate two data values, and the resulting value is then used to compute the new style value. + +# transition.text(value) · [Source](https://github.com/d3/d3-transition/blob/master/src/transition/text.js) + +For each selected element, sets the [text content](http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-textContent) to the specified target *value* when the transition starts. The *value* may be specified either as a constant or a function. If a function, it is immediately evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element. The function’s return value is then used to set each element’s text content. A null value will clear the content. + +To interpolate text rather than to set it on start, use [*transition*.textTween](#transition_textTween) or append a replacement element and cross-fade opacity. Text is not interpolated by default because it is usually undesirable. + +# transition.textTween(factory) · [Source](https://github.com/d3/d3-transition/blob/master/src/transition/textTween.js), [Examples](https://observablehq.com/@d3/transition-texttween) + +If *factory* is specified and not null, assigns the text [tween](#transition_tween) to the specified interpolator *factory*. An interpolator factory is a function that returns an [interpolator](https://github.com/d3/d3-interpolate); when the transition starts, the *factory* is evaluated for each selected element, in order, being passed the current datum `d` and index `i`, with the `this` context as the current DOM element. The returned interpolator will then be invoked for each frame of the transition, in order, being passed the [eased](#transition_ease) time *t*, typically in the range [0, 1]. Lastly, the return value of the interpolator will be used to set the text. The interpolator must return a string. + +For example, to interpolate the text with integers from 0 to 100: + +```js +transition.textTween(function() { + return d3.interpolateRound(0, 100); +}); +``` + +If the specified *factory* is null, removes the previously-assigned text tween, if any. If *factory* is not specified, returns the current interpolator factory for text, or undefined if no such tween exists. + +# transition.remove() · [Source](https://github.com/d3/d3-transition/blob/master/src/transition/remove.js) + +For each selected element, [removes](https://github.com/d3/d3-selection#selection_remove) the element when the transition ends, as long as the element has no other active or pending transitions. If the element has other active or pending transitions, does nothing. + +# transition.tween(name[, value]) · [Source](https://github.com/d3/d3-transition/blob/master/src/transition/tween.js) + +For each selected element, assigns the tween with the specified *name* with the specified *value* function. The *value* must be specified as a function that returns a function. When the transition starts, the *value* function is evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element. The returned function is then invoked for each frame of the transition, in order, being passed the [eased](#transition_ease) time *t*, typically in the range [0, 1]. If the specified *value* is null, removes the previously-assigned tween of the specified *name*, if any. + +For example, to interpolate the fill attribute to blue, like [*transition*.attr](#transition_attr): + +```js +transition.tween("attr.fill", function() { + var i = d3.interpolateRgb(this.getAttribute("fill"), "blue"); + return function(t) { + this.setAttribute("fill", i(t)); + }; +}); +``` + +This method is useful to specify a custom interpolator, or to perform side-effects, say to animate the [scroll offset](https://bl.ocks.org/mbostock/1649463). + +### Timing + +The [easing](#transition_ease), [delay](#transition_delay) and [duration](#transition_duration) of a transition is configurable. For example, a per-element delay can be used to [stagger the reordering](https://observablehq.com/@d3/sortable-bar-chart) of elements, improving perception. See [Animated Transitions in Statistical Data Graphics](http://vis.berkeley.edu/papers/animated_transitions/) for recommendations. + +# transition.delay([value]) · [Source](https://github.com/d3/d3-transition/blob/master/src/transition/delay.js) + +For each selected element, sets the transition delay to the specified *value* in milliseconds. The *value* may be specified either as a constant or a function. If a function, it is immediately evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element. The function’s return value is then used to set each element’s transition delay. If a delay is not specified, it defaults to zero. + +If a *value* is not specified, returns the current value of the delay for the first (non-null) element in the transition. This is generally useful only if you know that the transition contains exactly one element. + +Setting the delay to a multiple of the index `i` is a convenient way to stagger transitions across a set of elements. For example: + +```js +transition.delay(function(d, i) { return i * 10; }); +``` + +Of course, you can also compute the delay as a function of the data, or [sort the selection](https://github.com/d3/d3-selection#selection_sort) before computed an index-based delay. + +# transition.duration([value]) · [Source](https://github.com/d3/d3-transition/blob/master/src/transition/duration.js) + +For each selected element, sets the transition duration to the specified *value* in milliseconds. The *value* may be specified either as a constant or a function. If a function, it is immediately evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element. The function’s return value is then used to set each element’s transition duration. If a duration is not specified, it defaults to 250ms. + +If a *value* is not specified, returns the current value of the duration for the first (non-null) element in the transition. This is generally useful only if you know that the transition contains exactly one element. + +# transition.ease([value]) · [Source](https://github.com/d3/d3-transition/blob/master/src/transition/ease.js) + +Specifies the transition [easing function](https://github.com/d3/d3-ease) for all selected elements. The *value* must be specified as a function. The easing function is invoked for each frame of the animation, being passed the normalized time *t* in the range [0, 1]; it must then return the eased time *tʹ* which is typically also in the range [0, 1]. A good easing function should return 0 if *t* = 0 and 1 if *t* = 1. If an easing function is not specified, it defaults to [d3.easeCubic](https://github.com/d3/d3-ease#easeCubic). + +If a *value* is not specified, returns the current easing function for the first (non-null) element in the transition. This is generally useful only if you know that the transition contains exactly one element. + +# transition.easeVarying(factory) [<>](https://github.com/d3/d3-transition/blob/master/src/transition/easeVarying.js "Source") + +Specifies a factory for the transition [easing function](https://github.com/d3/d3-ease). The *factory* must be a function. It is invoked for each node of the selection, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element. It must return an easing function. + +### Control Flow + +For advanced usage, transitions provide methods for custom control flow. + +# transition.end() · [Source](https://github.com/d3/d3-transition/blob/master/src/transition/end.js) + +Returns a promise that resolves when every selected element finishes transitioning. If any element’s transition is cancelled or interrupted, the promise rejects. + +# transition.on(typenames[, listener]) · [Source](https://github.com/d3/d3-transition/blob/master/src/transition/on.js) + +Adds or removes a *listener* to each selected element for the specified event *typenames*. The *typenames* is one of the following string event types: + +* `start` - when the transition starts. +* `end` - when the transition ends. +* `interrupt` - when the transition is interrupted. +* `cancel` - when the transition is cancelled. + +See [The Life of a Transition](#the-life-of-a-transition) for more. Note that these are *not* native DOM events as implemented by [*selection*.on](https://github.com/d3/d3-selection#selection_on) and [*selection*.dispatch](https://github.com/d3/d3-selection#selection_dispatch), but transition events! + +The type may be optionally followed by a period (`.`) and a name; the optional name allows multiple callbacks to be registered to receive events of the same type, such as `start.foo` and `start.bar`. To specify multiple typenames, separate typenames with spaces, such as `interrupt end` or `start.foo start.bar`. + +When a specified transition event is dispatched on a selected node, the specified *listener* will be invoked for the transitioning element, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element. Listeners always see the latest datum for their element, but the index is a property of the selection and is fixed when the listener is assigned; to update the index, re-assign the listener. + +If an event listener was previously registered for the same *typename* on a selected element, the old listener is removed before the new listener is added. To remove a listener, pass null as the *listener*. To remove all listeners for a given name, pass null as the *listener* and `.foo` as the *typename*, where `foo` is the name; to remove all listeners with no name, specify `.` as the *typename*. + +If a *listener* is not specified, returns the currently-assigned listener for the specified event *typename* on the first (non-null) selected element, if any. If multiple typenames are specified, the first matching listener is returned. + +# transition.each(function) · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/each.js) + +Invokes the specified *function* for each selected element, passing in the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element. This method can be used to invoke arbitrary code for each selected element, and is useful for creating a context to access parent and child data simultaneously. Equivalent to [*selection*.each](https://github.com/d3/d3-selection#selection_each). + +# transition.call(function[, arguments…]) · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/call.js) + +Invokes the specified *function* exactly once, passing in this transition along with any optional *arguments*. Returns this transition. This is equivalent to invoking the function by hand but facilitates method chaining. For example, to set several attributes in a reusable function: + +```js +function color(transition, fill, stroke) { + transition + .style("fill", fill) + .style("stroke", stroke); +} +``` + +Now say: + +```js +d3.selectAll("div").transition().call(color, "red", "blue"); +``` + +This is equivalent to: + +```js +color(d3.selectAll("div").transition(), "red", "blue"); +``` + +Equivalent to [*selection*.call](https://github.com/d3/d3-selection#selection_call). + +# transition.empty() · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/empty.js) + +Returns true if this transition contains no (non-null) elements. Equivalent to [*selection*.empty](https://github.com/d3/d3-selection#selection_empty). + +# transition.nodes() · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/nodes.js) + +Returns an array of all (non-null) elements in this transition. Equivalent to [*selection*.nodes](https://github.com/d3/d3-selection#selection_nodes). + +# transition.node() · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/node.js) + +Returns the first (non-null) element in this transition. If the transition is empty, returns null. Equivalent to [*selection*.node](https://github.com/d3/d3-selection#selection_node). + +# transition.size() · [Source](https://github.com/d3/d3-selection/blob/master/src/selection/size.js) + +Returns the total number of elements in this transition. Equivalent to [*selection*.size](https://github.com/d3/d3-selection#selection_size). + +### The Life of a Transition + +Immediately after creating a transition, such as by [*selection*.transition](#selection_transition) or [*transition*.transition](#transition_transition), you may configure the transition using methods such as [*transition*.delay](#transition_delay), [*transition*.duration](#transition_duration), [*transition*.attr](#transition_attr) and [*transition*.style](#transition_style). Methods that specify target values (such as *transition*.attr) are evaluated synchronously; however, methods that require the starting value for interpolation, such as [*transition*.attrTween](#transition_attrTween) and [*transition*.styleTween](#transition_styleTween), must be deferred until the transition starts. + +Shortly after creation, either at the end of the current frame or during the next frame, the transition is scheduled. At this point, the delay and `start` event listeners may no longer be changed; attempting to do so throws an error with the message “too late: already scheduled” (or if the transition has ended, “transition not found”). + +When the transition subsequently starts, it interrupts the active transition of the same name on the same element, if any, dispatching an `interrupt` event to registered listeners. (Note that interrupts happen on start, not creation, and thus even a zero-delay transition will not immediately interrupt the active transition: the old transition is given a final frame. Use [*selection*.interrupt](#selection_interrupt) to interrupt immediately.) The starting transition also cancels any pending transitions of the same name on the same element that were created before the starting transition. The transition then dispatches a `start` event to registered listeners. This is the last moment at which the transition may be modified: the transition’s timing, tweens, and listeners may not be changed when it is running; attempting to do so throws an error with the message “too late: already running” (or if the transition has ended, “transition not found”). The transition initializes its tweens immediately after starting. + +During the frame the transition starts, but *after* all transitions starting this frame have been started, the transition invokes its tweens for the first time. Batching tween initialization, which typically involves reading from the DOM, improves performance by avoiding interleaved DOM reads and writes. + +For each frame that a transition is active, it invokes its tweens with an [eased](#transition_ease) *t*-value ranging from 0 to 1. Within each frame, the transition invokes its tweens in the order they were registered. + +When a transition ends, it invokes its tweens a final time with a (non-eased) *t*-value of 1. It then dispatches an `end` event to registered listeners. This is the last moment at which the transition may be inspected: after ending, the transition is deleted from the element, and its configuration is destroyed. (A transition’s configuration is also destroyed on interrupt or cancel.) Attempting to inspect a transition after it is destroyed throws an error with the message “transition not found”. diff --git a/node_modules/d3-transition/dist/d3-transition.js b/node_modules/d3-transition/dist/d3-transition.js new file mode 100644 index 0000000..81849c2 --- /dev/null +++ b/node_modules/d3-transition/dist/d3-transition.js @@ -0,0 +1,900 @@ +// https://d3js.org/d3-transition/ v3.0.1 Copyright 2010-2021 Mike Bostock +(function (global, factory) { +typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-selection'), require('d3-dispatch'), require('d3-timer'), require('d3-interpolate'), require('d3-color'), require('d3-ease')) : +typeof define === 'function' && define.amd ? define(['exports', 'd3-selection', 'd3-dispatch', 'd3-timer', 'd3-interpolate', 'd3-color', 'd3-ease'], factory) : +(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.d3 = global.d3 || {}, global.d3, global.d3, global.d3, global.d3, global.d3, global.d3)); +}(this, (function (exports, d3Selection, d3Dispatch, d3Timer, d3Interpolate, d3Color, d3Ease) { 'use strict'; + +var emptyOn = d3Dispatch.dispatch("start", "end", "cancel", "interrupt"); +var emptyTween = []; + +var CREATED = 0; +var SCHEDULED = 1; +var STARTING = 2; +var STARTED = 3; +var RUNNING = 4; +var ENDING = 5; +var ENDED = 6; + +function schedule(node, name, id, index, group, timing) { + var schedules = node.__transition; + if (!schedules) node.__transition = {}; + else if (id in schedules) return; + create(node, id, { + name: name, + index: index, // For context during callback. + group: group, // For context during callback. + on: emptyOn, + tween: emptyTween, + time: timing.time, + delay: timing.delay, + duration: timing.duration, + ease: timing.ease, + timer: null, + state: CREATED + }); +} + +function init(node, id) { + var schedule = get(node, id); + if (schedule.state > CREATED) throw new Error("too late; already scheduled"); + return schedule; +} + +function set(node, id) { + var schedule = get(node, id); + if (schedule.state > STARTED) throw new Error("too late; already running"); + return schedule; +} + +function get(node, id) { + var schedule = node.__transition; + if (!schedule || !(schedule = schedule[id])) throw new Error("transition not found"); + return schedule; +} + +function create(node, id, self) { + var schedules = node.__transition, + tween; + + // Initialize the self timer when the transition is created. + // Note the actual delay is not known until the first callback! + schedules[id] = self; + self.timer = d3Timer.timer(schedule, 0, self.time); + + function schedule(elapsed) { + self.state = SCHEDULED; + self.timer.restart(start, self.delay, self.time); + + // If the elapsed delay is less than our first sleep, start immediately. + if (self.delay <= elapsed) start(elapsed - self.delay); + } + + function start(elapsed) { + var i, j, n, o; + + // If the state is not SCHEDULED, then we previously errored on start. + if (self.state !== SCHEDULED) return stop(); + + for (i in schedules) { + o = schedules[i]; + if (o.name !== self.name) continue; + + // While this element already has a starting transition during this frame, + // defer starting an interrupting transition until that transition has a + // chance to tick (and possibly end); see d3/d3-transition#54! + if (o.state === STARTED) return d3Timer.timeout(start); + + // Interrupt the active transition, if any. + if (o.state === RUNNING) { + o.state = ENDED; + o.timer.stop(); + o.on.call("interrupt", node, node.__data__, o.index, o.group); + delete schedules[i]; + } + + // Cancel any pre-empted transitions. + else if (+i < id) { + o.state = ENDED; + o.timer.stop(); + o.on.call("cancel", node, node.__data__, o.index, o.group); + delete schedules[i]; + } + } + + // Defer the first tick to end of the current frame; see d3/d3#1576. + // Note the transition may be canceled after start and before the first tick! + // Note this must be scheduled before the start event; see d3/d3-transition#16! + // Assuming this is successful, subsequent callbacks go straight to tick. + d3Timer.timeout(function() { + if (self.state === STARTED) { + self.state = RUNNING; + self.timer.restart(tick, self.delay, self.time); + tick(elapsed); + } + }); + + // Dispatch the start event. + // Note this must be done before the tween are initialized. + self.state = STARTING; + self.on.call("start", node, node.__data__, self.index, self.group); + if (self.state !== STARTING) return; // interrupted + self.state = STARTED; + + // Initialize the tween, deleting null tween. + tween = new Array(n = self.tween.length); + for (i = 0, j = -1; i < n; ++i) { + if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) { + tween[++j] = o; + } + } + tween.length = j + 1; + } + + function tick(elapsed) { + var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1), + i = -1, + n = tween.length; + + while (++i < n) { + tween[i].call(node, t); + } + + // Dispatch the end event. + if (self.state === ENDING) { + self.on.call("end", node, node.__data__, self.index, self.group); + stop(); + } + } + + function stop() { + self.state = ENDED; + self.timer.stop(); + delete schedules[id]; + for (var i in schedules) return; // eslint-disable-line no-unused-vars + delete node.__transition; + } +} + +function interrupt(node, name) { + var schedules = node.__transition, + schedule, + active, + empty = true, + i; + + if (!schedules) return; + + name = name == null ? null : name + ""; + + for (i in schedules) { + if ((schedule = schedules[i]).name !== name) { empty = false; continue; } + active = schedule.state > STARTING && schedule.state < ENDING; + schedule.state = ENDED; + schedule.timer.stop(); + schedule.on.call(active ? "interrupt" : "cancel", node, node.__data__, schedule.index, schedule.group); + delete schedules[i]; + } + + if (empty) delete node.__transition; +} + +function selection_interrupt(name) { + return this.each(function() { + interrupt(this, name); + }); +} + +function tweenRemove(id, name) { + var tween0, tween1; + return function() { + var schedule = set(this, id), + tween = schedule.tween; + + // If this node shared tween with the previous node, + // just assign the updated shared tween and we’re done! + // Otherwise, copy-on-write. + if (tween !== tween0) { + tween1 = tween0 = tween; + for (var i = 0, n = tween1.length; i < n; ++i) { + if (tween1[i].name === name) { + tween1 = tween1.slice(); + tween1.splice(i, 1); + break; + } + } + } + + schedule.tween = tween1; + }; +} + +function tweenFunction(id, name, value) { + var tween0, tween1; + if (typeof value !== "function") throw new Error; + return function() { + var schedule = set(this, id), + tween = schedule.tween; + + // If this node shared tween with the previous node, + // just assign the updated shared tween and we’re done! + // Otherwise, copy-on-write. + if (tween !== tween0) { + tween1 = (tween0 = tween).slice(); + for (var t = {name: name, value: value}, i = 0, n = tween1.length; i < n; ++i) { + if (tween1[i].name === name) { + tween1[i] = t; + break; + } + } + if (i === n) tween1.push(t); + } + + schedule.tween = tween1; + }; +} + +function transition_tween(name, value) { + var id = this._id; + + name += ""; + + if (arguments.length < 2) { + var tween = get(this.node(), id).tween; + for (var i = 0, n = tween.length, t; i < n; ++i) { + if ((t = tween[i]).name === name) { + return t.value; + } + } + return null; + } + + return this.each((value == null ? tweenRemove : tweenFunction)(id, name, value)); +} + +function tweenValue(transition, name, value) { + var id = transition._id; + + transition.each(function() { + var schedule = set(this, id); + (schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments); + }); + + return function(node) { + return get(node, id).value[name]; + }; +} + +function interpolate(a, b) { + var c; + return (typeof b === "number" ? d3Interpolate.interpolateNumber + : b instanceof d3Color.color ? d3Interpolate.interpolateRgb + : (c = d3Color.color(b)) ? (b = c, d3Interpolate.interpolateRgb) + : d3Interpolate.interpolateString)(a, b); +} + +function attrRemove(name) { + return function() { + this.removeAttribute(name); + }; +} + +function attrRemoveNS(fullname) { + return function() { + this.removeAttributeNS(fullname.space, fullname.local); + }; +} + +function attrConstant(name, interpolate, value1) { + var string00, + string1 = value1 + "", + interpolate0; + return function() { + var string0 = this.getAttribute(name); + return string0 === string1 ? null + : string0 === string00 ? interpolate0 + : interpolate0 = interpolate(string00 = string0, value1); + }; +} + +function attrConstantNS(fullname, interpolate, value1) { + var string00, + string1 = value1 + "", + interpolate0; + return function() { + var string0 = this.getAttributeNS(fullname.space, fullname.local); + return string0 === string1 ? null + : string0 === string00 ? interpolate0 + : interpolate0 = interpolate(string00 = string0, value1); + }; +} + +function attrFunction(name, interpolate, value) { + var string00, + string10, + interpolate0; + return function() { + var string0, value1 = value(this), string1; + if (value1 == null) return void this.removeAttribute(name); + string0 = this.getAttribute(name); + string1 = value1 + ""; + return string0 === string1 ? null + : string0 === string00 && string1 === string10 ? interpolate0 + : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1)); + }; +} + +function attrFunctionNS(fullname, interpolate, value) { + var string00, + string10, + interpolate0; + return function() { + var string0, value1 = value(this), string1; + if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local); + string0 = this.getAttributeNS(fullname.space, fullname.local); + string1 = value1 + ""; + return string0 === string1 ? null + : string0 === string00 && string1 === string10 ? interpolate0 + : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1)); + }; +} + +function transition_attr(name, value) { + var fullname = d3Selection.namespace(name), i = fullname === "transform" ? d3Interpolate.interpolateTransformSvg : interpolate; + return this.attrTween(name, typeof value === "function" + ? (fullname.local ? attrFunctionNS : attrFunction)(fullname, i, tweenValue(this, "attr." + name, value)) + : value == null ? (fullname.local ? attrRemoveNS : attrRemove)(fullname) + : (fullname.local ? attrConstantNS : attrConstant)(fullname, i, value)); +} + +function attrInterpolate(name, i) { + return function(t) { + this.setAttribute(name, i.call(this, t)); + }; +} + +function attrInterpolateNS(fullname, i) { + return function(t) { + this.setAttributeNS(fullname.space, fullname.local, i.call(this, t)); + }; +} + +function attrTweenNS(fullname, value) { + var t0, i0; + function tween() { + var i = value.apply(this, arguments); + if (i !== i0) t0 = (i0 = i) && attrInterpolateNS(fullname, i); + return t0; + } + tween._value = value; + return tween; +} + +function attrTween(name, value) { + var t0, i0; + function tween() { + var i = value.apply(this, arguments); + if (i !== i0) t0 = (i0 = i) && attrInterpolate(name, i); + return t0; + } + tween._value = value; + return tween; +} + +function transition_attrTween(name, value) { + var key = "attr." + name; + if (arguments.length < 2) return (key = this.tween(key)) && key._value; + if (value == null) return this.tween(key, null); + if (typeof value !== "function") throw new Error; + var fullname = d3Selection.namespace(name); + return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value)); +} + +function delayFunction(id, value) { + return function() { + init(this, id).delay = +value.apply(this, arguments); + }; +} + +function delayConstant(id, value) { + return value = +value, function() { + init(this, id).delay = value; + }; +} + +function transition_delay(value) { + var id = this._id; + + return arguments.length + ? this.each((typeof value === "function" + ? delayFunction + : delayConstant)(id, value)) + : get(this.node(), id).delay; +} + +function durationFunction(id, value) { + return function() { + set(this, id).duration = +value.apply(this, arguments); + }; +} + +function durationConstant(id, value) { + return value = +value, function() { + set(this, id).duration = value; + }; +} + +function transition_duration(value) { + var id = this._id; + + return arguments.length + ? this.each((typeof value === "function" + ? durationFunction + : durationConstant)(id, value)) + : get(this.node(), id).duration; +} + +function easeConstant(id, value) { + if (typeof value !== "function") throw new Error; + return function() { + set(this, id).ease = value; + }; +} + +function transition_ease(value) { + var id = this._id; + + return arguments.length + ? this.each(easeConstant(id, value)) + : get(this.node(), id).ease; +} + +function easeVarying(id, value) { + return function() { + var v = value.apply(this, arguments); + if (typeof v !== "function") throw new Error; + set(this, id).ease = v; + }; +} + +function transition_easeVarying(value) { + if (typeof value !== "function") throw new Error; + return this.each(easeVarying(this._id, value)); +} + +function transition_filter(match) { + if (typeof match !== "function") match = d3Selection.matcher(match); + + for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { + for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) { + if ((node = group[i]) && match.call(node, node.__data__, i, group)) { + subgroup.push(node); + } + } + } + + return new Transition(subgroups, this._parents, this._name, this._id); +} + +function transition_merge(transition) { + if (transition._id !== this._id) throw new Error; + + for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) { + for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) { + if (node = group0[i] || group1[i]) { + merge[i] = node; + } + } + } + + for (; j < m0; ++j) { + merges[j] = groups0[j]; + } + + return new Transition(merges, this._parents, this._name, this._id); +} + +function start(name) { + return (name + "").trim().split(/^|\s+/).every(function(t) { + var i = t.indexOf("."); + if (i >= 0) t = t.slice(0, i); + return !t || t === "start"; + }); +} + +function onFunction(id, name, listener) { + var on0, on1, sit = start(name) ? init : set; + return function() { + var schedule = sit(this, id), + on = schedule.on; + + // If this node shared a dispatch with the previous node, + // just assign the updated shared dispatch and we’re done! + // Otherwise, copy-on-write. + if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener); + + schedule.on = on1; + }; +} + +function transition_on(name, listener) { + var id = this._id; + + return arguments.length < 2 + ? get(this.node(), id).on.on(name) + : this.each(onFunction(id, name, listener)); +} + +function removeFunction(id) { + return function() { + var parent = this.parentNode; + for (var i in this.__transition) if (+i !== id) return; + if (parent) parent.removeChild(this); + }; +} + +function transition_remove() { + return this.on("end.remove", removeFunction(this._id)); +} + +function transition_select(select) { + var name = this._name, + id = this._id; + + if (typeof select !== "function") select = d3Selection.selector(select); + + for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { + for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) { + if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) { + if ("__data__" in node) subnode.__data__ = node.__data__; + subgroup[i] = subnode; + schedule(subgroup[i], name, id, i, subgroup, get(node, id)); + } + } + } + + return new Transition(subgroups, this._parents, name, id); +} + +function transition_selectAll(select) { + var name = this._name, + id = this._id; + + if (typeof select !== "function") select = d3Selection.selectorAll(select); + + for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) { + for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { + if (node = group[i]) { + for (var children = select.call(node, node.__data__, i, group), child, inherit = get(node, id), k = 0, l = children.length; k < l; ++k) { + if (child = children[k]) { + schedule(child, name, id, k, children, inherit); + } + } + subgroups.push(children); + parents.push(node); + } + } + } + + return new Transition(subgroups, parents, name, id); +} + +var Selection = d3Selection.selection.prototype.constructor; + +function transition_selection() { + return new Selection(this._groups, this._parents); +} + +function styleNull(name, interpolate) { + var string00, + string10, + interpolate0; + return function() { + var string0 = d3Selection.style(this, name), + string1 = (this.style.removeProperty(name), d3Selection.style(this, name)); + return string0 === string1 ? null + : string0 === string00 && string1 === string10 ? interpolate0 + : interpolate0 = interpolate(string00 = string0, string10 = string1); + }; +} + +function styleRemove(name) { + return function() { + this.style.removeProperty(name); + }; +} + +function styleConstant(name, interpolate, value1) { + var string00, + string1 = value1 + "", + interpolate0; + return function() { + var string0 = d3Selection.style(this, name); + return string0 === string1 ? null + : string0 === string00 ? interpolate0 + : interpolate0 = interpolate(string00 = string0, value1); + }; +} + +function styleFunction(name, interpolate, value) { + var string00, + string10, + interpolate0; + return function() { + var string0 = d3Selection.style(this, name), + value1 = value(this), + string1 = value1 + ""; + if (value1 == null) string1 = value1 = (this.style.removeProperty(name), d3Selection.style(this, name)); + return string0 === string1 ? null + : string0 === string00 && string1 === string10 ? interpolate0 + : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1)); + }; +} + +function styleMaybeRemove(id, name) { + var on0, on1, listener0, key = "style." + name, event = "end." + key, remove; + return function() { + var schedule = set(this, id), + on = schedule.on, + listener = schedule.value[key] == null ? remove || (remove = styleRemove(name)) : undefined; + + // If this node shared a dispatch with the previous node, + // just assign the updated shared dispatch and we’re done! + // Otherwise, copy-on-write. + if (on !== on0 || listener0 !== listener) (on1 = (on0 = on).copy()).on(event, listener0 = listener); + + schedule.on = on1; + }; +} + +function transition_style(name, value, priority) { + var i = (name += "") === "transform" ? d3Interpolate.interpolateTransformCss : interpolate; + return value == null ? this + .styleTween(name, styleNull(name, i)) + .on("end.style." + name, styleRemove(name)) + : typeof value === "function" ? this + .styleTween(name, styleFunction(name, i, tweenValue(this, "style." + name, value))) + .each(styleMaybeRemove(this._id, name)) + : this + .styleTween(name, styleConstant(name, i, value), priority) + .on("end.style." + name, null); +} + +function styleInterpolate(name, i, priority) { + return function(t) { + this.style.setProperty(name, i.call(this, t), priority); + }; +} + +function styleTween(name, value, priority) { + var t, i0; + function tween() { + var i = value.apply(this, arguments); + if (i !== i0) t = (i0 = i) && styleInterpolate(name, i, priority); + return t; + } + tween._value = value; + return tween; +} + +function transition_styleTween(name, value, priority) { + var key = "style." + (name += ""); + if (arguments.length < 2) return (key = this.tween(key)) && key._value; + if (value == null) return this.tween(key, null); + if (typeof value !== "function") throw new Error; + return this.tween(key, styleTween(name, value, priority == null ? "" : priority)); +} + +function textConstant(value) { + return function() { + this.textContent = value; + }; +} + +function textFunction(value) { + return function() { + var value1 = value(this); + this.textContent = value1 == null ? "" : value1; + }; +} + +function transition_text(value) { + return this.tween("text", typeof value === "function" + ? textFunction(tweenValue(this, "text", value)) + : textConstant(value == null ? "" : value + "")); +} + +function textInterpolate(i) { + return function(t) { + this.textContent = i.call(this, t); + }; +} + +function textTween(value) { + var t0, i0; + function tween() { + var i = value.apply(this, arguments); + if (i !== i0) t0 = (i0 = i) && textInterpolate(i); + return t0; + } + tween._value = value; + return tween; +} + +function transition_textTween(value) { + var key = "text"; + if (arguments.length < 1) return (key = this.tween(key)) && key._value; + if (value == null) return this.tween(key, null); + if (typeof value !== "function") throw new Error; + return this.tween(key, textTween(value)); +} + +function transition_transition() { + var name = this._name, + id0 = this._id, + id1 = newId(); + + for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) { + for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { + if (node = group[i]) { + var inherit = get(node, id0); + schedule(node, name, id1, i, group, { + time: inherit.time + inherit.delay + inherit.duration, + delay: 0, + duration: inherit.duration, + ease: inherit.ease + }); + } + } + } + + return new Transition(groups, this._parents, name, id1); +} + +function transition_end() { + var on0, on1, that = this, id = that._id, size = that.size(); + return new Promise(function(resolve, reject) { + var cancel = {value: reject}, + end = {value: function() { if (--size === 0) resolve(); }}; + + that.each(function() { + var schedule = set(this, id), + on = schedule.on; + + // If this node shared a dispatch with the previous node, + // just assign the updated shared dispatch and we’re done! + // Otherwise, copy-on-write. + if (on !== on0) { + on1 = (on0 = on).copy(); + on1._.cancel.push(cancel); + on1._.interrupt.push(cancel); + on1._.end.push(end); + } + + schedule.on = on1; + }); + + // The selection was empty, resolve end immediately + if (size === 0) resolve(); + }); +} + +var id = 0; + +function Transition(groups, parents, name, id) { + this._groups = groups; + this._parents = parents; + this._name = name; + this._id = id; +} + +function transition(name) { + return d3Selection.selection().transition(name); +} + +function newId() { + return ++id; +} + +var selection_prototype = d3Selection.selection.prototype; + +Transition.prototype = transition.prototype = { + constructor: Transition, + select: transition_select, + selectAll: transition_selectAll, + selectChild: selection_prototype.selectChild, + selectChildren: selection_prototype.selectChildren, + filter: transition_filter, + merge: transition_merge, + selection: transition_selection, + transition: transition_transition, + call: selection_prototype.call, + nodes: selection_prototype.nodes, + node: selection_prototype.node, + size: selection_prototype.size, + empty: selection_prototype.empty, + each: selection_prototype.each, + on: transition_on, + attr: transition_attr, + attrTween: transition_attrTween, + style: transition_style, + styleTween: transition_styleTween, + text: transition_text, + textTween: transition_textTween, + remove: transition_remove, + tween: transition_tween, + delay: transition_delay, + duration: transition_duration, + ease: transition_ease, + easeVarying: transition_easeVarying, + end: transition_end, + [Symbol.iterator]: selection_prototype[Symbol.iterator] +}; + +var defaultTiming = { + time: null, // Set on use. + delay: 0, + duration: 250, + ease: d3Ease.easeCubicInOut +}; + +function inherit(node, id) { + var timing; + while (!(timing = node.__transition) || !(timing = timing[id])) { + if (!(node = node.parentNode)) { + throw new Error(`transition ${id} not found`); + } + } + return timing; +} + +function selection_transition(name) { + var id, + timing; + + if (name instanceof Transition) { + id = name._id, name = name._name; + } else { + id = newId(), (timing = defaultTiming).time = d3Timer.now(), name = name == null ? null : name + ""; + } + + for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) { + for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { + if (node = group[i]) { + schedule(node, name, id, i, group, timing || inherit(node, id)); + } + } + } + + return new Transition(groups, this._parents, name, id); +} + +d3Selection.selection.prototype.interrupt = selection_interrupt; +d3Selection.selection.prototype.transition = selection_transition; + +var root = [null]; + +function active(node, name) { + var schedules = node.__transition, + schedule, + i; + + if (schedules) { + name = name == null ? null : name + ""; + for (i in schedules) { + if ((schedule = schedules[i]).state > SCHEDULED && schedule.name === name) { + return new Transition([[node]], root, name, +i); + } + } + } + + return null; +} + +exports.active = active; +exports.interrupt = interrupt; +exports.transition = transition; + +Object.defineProperty(exports, '__esModule', { value: true }); + +}))); diff --git a/node_modules/d3-transition/dist/d3-transition.min.js b/node_modules/d3-transition/dist/d3-transition.min.js new file mode 100644 index 0000000..8e9bffd --- /dev/null +++ b/node_modules/d3-transition/dist/d3-transition.min.js @@ -0,0 +1,2 @@ +// https://d3js.org/d3-transition/ v3.0.1 Copyright 2010-2021 Mike Bostock +!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("d3-selection"),require("d3-dispatch"),require("d3-timer"),require("d3-interpolate"),require("d3-color"),require("d3-ease")):"function"==typeof define&&define.amd?define(["exports","d3-selection","d3-dispatch","d3-timer","d3-interpolate","d3-color","d3-ease"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).d3=t.d3||{},t.d3,t.d3,t.d3,t.d3,t.d3,t.d3)}(this,(function(t,n,e,r,i,o,u){"use strict";var a=e.dispatch("start","end","cancel","interrupt"),s=[];function l(t,n,e,i,o,u){var l=t.__transition;if(l){if(e in l)return}else t.__transition={};!function(t,n,e){var i,o=t.__transition;function u(t){e.state=1,e.timer.restart(a,e.delay,e.time),e.delay<=t&&a(t-e.delay)}function a(u){var f,c,h,d;if(1!==e.state)return l();for(f in o)if((d=o[f]).name===e.name){if(3===d.state)return r.timeout(a);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete o[f]):+f0)throw new Error("too late; already scheduled");return e}function c(t,n){var e=h(t,n);if(e.state>3)throw new Error("too late; already running");return e}function h(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function d(t,n){var e,r,i,o=t.__transition,u=!0;if(o){for(i in n=null==n?null:n+"",o)(e=o[i]).name===n?(r=e.state>2&&e.state<5,e.state=6,e.timer.stop(),e.on.call(r?"interrupt":"cancel",t,t.__data__,e.index,e.group),delete o[i]):u=!1;u&&delete t.__transition}}function p(t,n){var e,r;return function(){var i=c(this,t),o=i.tween;if(o!==e)for(var u=0,a=(r=e=o).length;u=0&&(t=t.slice(0,n)),!t||"start"===t}))}(n)?f:c;return function(){var u=o(this,t),a=u.on;a!==r&&(i=(r=a).copy()).on(n,e),u.on=i}}var k=n.selection.prototype.constructor;function M(t){return function(){this.style.removeProperty(t)}}function R(t,n,e){return function(r){this.style.setProperty(t,n.call(this,r),e)}}function I(t,n,e){var r,i;function o(){var o=n.apply(this,arguments);return o!==i&&(r=(i=o)&&R(t,o,e)),r}return o._value=n,o}function V(t){return function(n){this.textContent=t.call(this,n)}}function $(t){var n,e;function r(){var r=t.apply(this,arguments);return r!==e&&(n=(e=r)&&V(r)),n}return r._value=t,r}var B=0;function D(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function F(t){return n.selection().transition(t)}function G(){return++B}var H=n.selection.prototype;D.prototype=F.prototype={constructor:D,select:function(t){var e=this._name,r=this._id;"function"!=typeof t&&(t=n.selector(t));for(var i=this._groups,o=i.length,u=new Array(o),a=0;a1&&e.name===n)return new D([[t]],L,n,+r);return null},t.interrupt=d,t.transition=F,Object.defineProperty(t,"__esModule",{value:!0})})); diff --git a/node_modules/d3-transition/package.json b/node_modules/d3-transition/package.json new file mode 100644 index 0000000..b38ab5d --- /dev/null +++ b/node_modules/d3-transition/package.json @@ -0,0 +1,65 @@ +{ + "name": "d3-transition", + "version": "3.0.1", + "description": "Animated transitions for D3 selections.", + "homepage": "https://d3js.org/d3-transition/", + "repository": { + "type": "git", + "url": "https://github.com/d3/d3-transition.git" + }, + "keywords": [ + "d3", + "d3-module", + "dom", + "transition", + "animation" + ], + "license": "ISC", + "author": { + "name": "Mike Bostock", + "url": "https://bost.ocks.org/mike" + }, + "type": "module", + "files": [ + "dist/**/*.js", + "src/**/*.js" + ], + "module": "src/index.js", + "main": "src/index.js", + "jsdelivr": "dist/d3-transition.min.js", + "unpkg": "dist/d3-transition.min.js", + "exports": { + "umd": "./dist/d3-transition.min.js", + "default": "./src/index.js" + }, + "sideEffects": [ + "./src/index.js", + "./src/selection/index.js" + ], + "dependencies": { + "d3-color": "1 - 3", + "d3-dispatch": "1 - 3", + "d3-ease": "1 - 3", + "d3-interpolate": "1 - 3", + "d3-timer": "1 - 3" + }, + "devDependencies": { + "d3-selection": "2 - 3", + "eslint": "7", + "jsdom": "16", + "mocha": "9", + "rollup": "2", + "rollup-plugin-terser": "7" + }, + "scripts": { + "test": "mocha 'test/**/*-test.js' && eslint src test", + "prepublishOnly": "rm -rf dist && yarn test && rollup -c && git push", + "postpublish": "git push --tags && cd ../d3.github.com && git pull && cp ../${npm_package_name}/dist/${npm_package_name}.js ${npm_package_name}.v${npm_package_version%%.*}.js && cp ../${npm_package_name}/dist/${npm_package_name}.min.js ${npm_package_name}.v${npm_package_version%%.*}.min.js && git add ${npm_package_name}.v${npm_package_version%%.*}.js ${npm_package_name}.v${npm_package_version%%.*}.min.js && git commit -m \"${npm_package_name} ${npm_package_version}\" && git push && cd -" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "d3-selection": "2 - 3" + } +} diff --git a/node_modules/d3-transition/src/active.js b/node_modules/d3-transition/src/active.js new file mode 100644 index 0000000..abd4c67 --- /dev/null +++ b/node_modules/d3-transition/src/active.js @@ -0,0 +1,21 @@ +import {Transition} from "./transition/index.js"; +import {SCHEDULED} from "./transition/schedule.js"; + +var root = [null]; + +export default function(node, name) { + var schedules = node.__transition, + schedule, + i; + + if (schedules) { + name = name == null ? null : name + ""; + for (i in schedules) { + if ((schedule = schedules[i]).state > SCHEDULED && schedule.name === name) { + return new Transition([[node]], root, name, +i); + } + } + } + + return null; +} diff --git a/node_modules/d3-transition/src/index.js b/node_modules/d3-transition/src/index.js new file mode 100644 index 0000000..d6a6dd3 --- /dev/null +++ b/node_modules/d3-transition/src/index.js @@ -0,0 +1,4 @@ +import "./selection/index.js"; +export {default as transition} from "./transition/index.js"; +export {default as active} from "./active.js"; +export {default as interrupt} from "./interrupt.js"; diff --git a/node_modules/d3-transition/src/interrupt.js b/node_modules/d3-transition/src/interrupt.js new file mode 100644 index 0000000..efb455e --- /dev/null +++ b/node_modules/d3-transition/src/interrupt.js @@ -0,0 +1,24 @@ +import {STARTING, ENDING, ENDED} from "./transition/schedule.js"; + +export default function(node, name) { + var schedules = node.__transition, + schedule, + active, + empty = true, + i; + + if (!schedules) return; + + name = name == null ? null : name + ""; + + for (i in schedules) { + if ((schedule = schedules[i]).name !== name) { empty = false; continue; } + active = schedule.state > STARTING && schedule.state < ENDING; + schedule.state = ENDED; + schedule.timer.stop(); + schedule.on.call(active ? "interrupt" : "cancel", node, node.__data__, schedule.index, schedule.group); + delete schedules[i]; + } + + if (empty) delete node.__transition; +} diff --git a/node_modules/d3-transition/src/selection/index.js b/node_modules/d3-transition/src/selection/index.js new file mode 100644 index 0000000..c5512ef --- /dev/null +++ b/node_modules/d3-transition/src/selection/index.js @@ -0,0 +1,6 @@ +import {selection} from "d3-selection"; +import selection_interrupt from "./interrupt.js"; +import selection_transition from "./transition.js"; + +selection.prototype.interrupt = selection_interrupt; +selection.prototype.transition = selection_transition; diff --git a/node_modules/d3-transition/src/selection/interrupt.js b/node_modules/d3-transition/src/selection/interrupt.js new file mode 100644 index 0000000..799a923 --- /dev/null +++ b/node_modules/d3-transition/src/selection/interrupt.js @@ -0,0 +1,7 @@ +import interrupt from "../interrupt.js"; + +export default function(name) { + return this.each(function() { + interrupt(this, name); + }); +} diff --git a/node_modules/d3-transition/src/selection/transition.js b/node_modules/d3-transition/src/selection/transition.js new file mode 100644 index 0000000..a328dcb --- /dev/null +++ b/node_modules/d3-transition/src/selection/transition.js @@ -0,0 +1,42 @@ +import {Transition, newId} from "../transition/index.js"; +import schedule from "../transition/schedule.js"; +import {easeCubicInOut} from "d3-ease"; +import {now} from "d3-timer"; + +var defaultTiming = { + time: null, // Set on use. + delay: 0, + duration: 250, + ease: easeCubicInOut +}; + +function inherit(node, id) { + var timing; + while (!(timing = node.__transition) || !(timing = timing[id])) { + if (!(node = node.parentNode)) { + throw new Error(`transition ${id} not found`); + } + } + return timing; +} + +export default function(name) { + var id, + timing; + + if (name instanceof Transition) { + id = name._id, name = name._name; + } else { + id = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + ""; + } + + for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) { + for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { + if (node = group[i]) { + schedule(node, name, id, i, group, timing || inherit(node, id)); + } + } + } + + return new Transition(groups, this._parents, name, id); +} diff --git a/node_modules/d3-transition/src/transition/attr.js b/node_modules/d3-transition/src/transition/attr.js new file mode 100644 index 0000000..3c3c764 --- /dev/null +++ b/node_modules/d3-transition/src/transition/attr.js @@ -0,0 +1,78 @@ +import {interpolateTransformSvg as interpolateTransform} from "d3-interpolate"; +import {namespace} from "d3-selection"; +import {tweenValue} from "./tween.js"; +import interpolate from "./interpolate.js"; + +function attrRemove(name) { + return function() { + this.removeAttribute(name); + }; +} + +function attrRemoveNS(fullname) { + return function() { + this.removeAttributeNS(fullname.space, fullname.local); + }; +} + +function attrConstant(name, interpolate, value1) { + var string00, + string1 = value1 + "", + interpolate0; + return function() { + var string0 = this.getAttribute(name); + return string0 === string1 ? null + : string0 === string00 ? interpolate0 + : interpolate0 = interpolate(string00 = string0, value1); + }; +} + +function attrConstantNS(fullname, interpolate, value1) { + var string00, + string1 = value1 + "", + interpolate0; + return function() { + var string0 = this.getAttributeNS(fullname.space, fullname.local); + return string0 === string1 ? null + : string0 === string00 ? interpolate0 + : interpolate0 = interpolate(string00 = string0, value1); + }; +} + +function attrFunction(name, interpolate, value) { + var string00, + string10, + interpolate0; + return function() { + var string0, value1 = value(this), string1; + if (value1 == null) return void this.removeAttribute(name); + string0 = this.getAttribute(name); + string1 = value1 + ""; + return string0 === string1 ? null + : string0 === string00 && string1 === string10 ? interpolate0 + : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1)); + }; +} + +function attrFunctionNS(fullname, interpolate, value) { + var string00, + string10, + interpolate0; + return function() { + var string0, value1 = value(this), string1; + if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local); + string0 = this.getAttributeNS(fullname.space, fullname.local); + string1 = value1 + ""; + return string0 === string1 ? null + : string0 === string00 && string1 === string10 ? interpolate0 + : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1)); + }; +} + +export default function(name, value) { + var fullname = namespace(name), i = fullname === "transform" ? interpolateTransform : interpolate; + return this.attrTween(name, typeof value === "function" + ? (fullname.local ? attrFunctionNS : attrFunction)(fullname, i, tweenValue(this, "attr." + name, value)) + : value == null ? (fullname.local ? attrRemoveNS : attrRemove)(fullname) + : (fullname.local ? attrConstantNS : attrConstant)(fullname, i, value)); +} diff --git a/node_modules/d3-transition/src/transition/attrTween.js b/node_modules/d3-transition/src/transition/attrTween.js new file mode 100644 index 0000000..0dd4a00 --- /dev/null +++ b/node_modules/d3-transition/src/transition/attrTween.js @@ -0,0 +1,44 @@ +import {namespace} from "d3-selection"; + +function attrInterpolate(name, i) { + return function(t) { + this.setAttribute(name, i.call(this, t)); + }; +} + +function attrInterpolateNS(fullname, i) { + return function(t) { + this.setAttributeNS(fullname.space, fullname.local, i.call(this, t)); + }; +} + +function attrTweenNS(fullname, value) { + var t0, i0; + function tween() { + var i = value.apply(this, arguments); + if (i !== i0) t0 = (i0 = i) && attrInterpolateNS(fullname, i); + return t0; + } + tween._value = value; + return tween; +} + +function attrTween(name, value) { + var t0, i0; + function tween() { + var i = value.apply(this, arguments); + if (i !== i0) t0 = (i0 = i) && attrInterpolate(name, i); + return t0; + } + tween._value = value; + return tween; +} + +export default function(name, value) { + var key = "attr." + name; + if (arguments.length < 2) return (key = this.tween(key)) && key._value; + if (value == null) return this.tween(key, null); + if (typeof value !== "function") throw new Error; + var fullname = namespace(name); + return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value)); +} diff --git a/node_modules/d3-transition/src/transition/delay.js b/node_modules/d3-transition/src/transition/delay.js new file mode 100644 index 0000000..1ba1acd --- /dev/null +++ b/node_modules/d3-transition/src/transition/delay.js @@ -0,0 +1,23 @@ +import {get, init} from "./schedule.js"; + +function delayFunction(id, value) { + return function() { + init(this, id).delay = +value.apply(this, arguments); + }; +} + +function delayConstant(id, value) { + return value = +value, function() { + init(this, id).delay = value; + }; +} + +export default function(value) { + var id = this._id; + + return arguments.length + ? this.each((typeof value === "function" + ? delayFunction + : delayConstant)(id, value)) + : get(this.node(), id).delay; +} diff --git a/node_modules/d3-transition/src/transition/duration.js b/node_modules/d3-transition/src/transition/duration.js new file mode 100644 index 0000000..445691e --- /dev/null +++ b/node_modules/d3-transition/src/transition/duration.js @@ -0,0 +1,23 @@ +import {get, set} from "./schedule.js"; + +function durationFunction(id, value) { + return function() { + set(this, id).duration = +value.apply(this, arguments); + }; +} + +function durationConstant(id, value) { + return value = +value, function() { + set(this, id).duration = value; + }; +} + +export default function(value) { + var id = this._id; + + return arguments.length + ? this.each((typeof value === "function" + ? durationFunction + : durationConstant)(id, value)) + : get(this.node(), id).duration; +} diff --git a/node_modules/d3-transition/src/transition/ease.js b/node_modules/d3-transition/src/transition/ease.js new file mode 100644 index 0000000..83b1445 --- /dev/null +++ b/node_modules/d3-transition/src/transition/ease.js @@ -0,0 +1,16 @@ +import {get, set} from "./schedule.js"; + +function easeConstant(id, value) { + if (typeof value !== "function") throw new Error; + return function() { + set(this, id).ease = value; + }; +} + +export default function(value) { + var id = this._id; + + return arguments.length + ? this.each(easeConstant(id, value)) + : get(this.node(), id).ease; +} diff --git a/node_modules/d3-transition/src/transition/easeVarying.js b/node_modules/d3-transition/src/transition/easeVarying.js new file mode 100644 index 0000000..51e3a0d --- /dev/null +++ b/node_modules/d3-transition/src/transition/easeVarying.js @@ -0,0 +1,14 @@ +import {set} from "./schedule.js"; + +function easeVarying(id, value) { + return function() { + var v = value.apply(this, arguments); + if (typeof v !== "function") throw new Error; + set(this, id).ease = v; + }; +} + +export default function(value) { + if (typeof value !== "function") throw new Error; + return this.each(easeVarying(this._id, value)); +} diff --git a/node_modules/d3-transition/src/transition/end.js b/node_modules/d3-transition/src/transition/end.js new file mode 100644 index 0000000..d9aa373 --- /dev/null +++ b/node_modules/d3-transition/src/transition/end.js @@ -0,0 +1,29 @@ +import {set} from "./schedule.js"; + +export default function() { + var on0, on1, that = this, id = that._id, size = that.size(); + return new Promise(function(resolve, reject) { + var cancel = {value: reject}, + end = {value: function() { if (--size === 0) resolve(); }}; + + that.each(function() { + var schedule = set(this, id), + on = schedule.on; + + // If this node shared a dispatch with the previous node, + // just assign the updated shared dispatch and we’re done! + // Otherwise, copy-on-write. + if (on !== on0) { + on1 = (on0 = on).copy(); + on1._.cancel.push(cancel); + on1._.interrupt.push(cancel); + on1._.end.push(end); + } + + schedule.on = on1; + }); + + // The selection was empty, resolve end immediately + if (size === 0) resolve(); + }); +} diff --git a/node_modules/d3-transition/src/transition/filter.js b/node_modules/d3-transition/src/transition/filter.js new file mode 100644 index 0000000..f5237be --- /dev/null +++ b/node_modules/d3-transition/src/transition/filter.js @@ -0,0 +1,16 @@ +import {matcher} from "d3-selection"; +import {Transition} from "./index.js"; + +export default function(match) { + if (typeof match !== "function") match = matcher(match); + + for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { + for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) { + if ((node = group[i]) && match.call(node, node.__data__, i, group)) { + subgroup.push(node); + } + } + } + + return new Transition(subgroups, this._parents, this._name, this._id); +} diff --git a/node_modules/d3-transition/src/transition/index.js b/node_modules/d3-transition/src/transition/index.js new file mode 100644 index 0000000..81e7747 --- /dev/null +++ b/node_modules/d3-transition/src/transition/index.js @@ -0,0 +1,73 @@ +import {selection} from "d3-selection"; +import transition_attr from "./attr.js"; +import transition_attrTween from "./attrTween.js"; +import transition_delay from "./delay.js"; +import transition_duration from "./duration.js"; +import transition_ease from "./ease.js"; +import transition_easeVarying from "./easeVarying.js"; +import transition_filter from "./filter.js"; +import transition_merge from "./merge.js"; +import transition_on from "./on.js"; +import transition_remove from "./remove.js"; +import transition_select from "./select.js"; +import transition_selectAll from "./selectAll.js"; +import transition_selection from "./selection.js"; +import transition_style from "./style.js"; +import transition_styleTween from "./styleTween.js"; +import transition_text from "./text.js"; +import transition_textTween from "./textTween.js"; +import transition_transition from "./transition.js"; +import transition_tween from "./tween.js"; +import transition_end from "./end.js"; + +var id = 0; + +export function Transition(groups, parents, name, id) { + this._groups = groups; + this._parents = parents; + this._name = name; + this._id = id; +} + +export default function transition(name) { + return selection().transition(name); +} + +export function newId() { + return ++id; +} + +var selection_prototype = selection.prototype; + +Transition.prototype = transition.prototype = { + constructor: Transition, + select: transition_select, + selectAll: transition_selectAll, + selectChild: selection_prototype.selectChild, + selectChildren: selection_prototype.selectChildren, + filter: transition_filter, + merge: transition_merge, + selection: transition_selection, + transition: transition_transition, + call: selection_prototype.call, + nodes: selection_prototype.nodes, + node: selection_prototype.node, + size: selection_prototype.size, + empty: selection_prototype.empty, + each: selection_prototype.each, + on: transition_on, + attr: transition_attr, + attrTween: transition_attrTween, + style: transition_style, + styleTween: transition_styleTween, + text: transition_text, + textTween: transition_textTween, + remove: transition_remove, + tween: transition_tween, + delay: transition_delay, + duration: transition_duration, + ease: transition_ease, + easeVarying: transition_easeVarying, + end: transition_end, + [Symbol.iterator]: selection_prototype[Symbol.iterator] +}; diff --git a/node_modules/d3-transition/src/transition/interpolate.js b/node_modules/d3-transition/src/transition/interpolate.js new file mode 100644 index 0000000..d389d62 --- /dev/null +++ b/node_modules/d3-transition/src/transition/interpolate.js @@ -0,0 +1,10 @@ +import {color} from "d3-color"; +import {interpolateNumber, interpolateRgb, interpolateString} from "d3-interpolate"; + +export default function(a, b) { + var c; + return (typeof b === "number" ? interpolateNumber + : b instanceof color ? interpolateRgb + : (c = color(b)) ? (b = c, interpolateRgb) + : interpolateString)(a, b); +} diff --git a/node_modules/d3-transition/src/transition/merge.js b/node_modules/d3-transition/src/transition/merge.js new file mode 100644 index 0000000..4660953 --- /dev/null +++ b/node_modules/d3-transition/src/transition/merge.js @@ -0,0 +1,19 @@ +import {Transition} from "./index.js"; + +export default function(transition) { + if (transition._id !== this._id) throw new Error; + + for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) { + for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) { + if (node = group0[i] || group1[i]) { + merge[i] = node; + } + } + } + + for (; j < m0; ++j) { + merges[j] = groups0[j]; + } + + return new Transition(merges, this._parents, this._name, this._id); +} diff --git a/node_modules/d3-transition/src/transition/on.js b/node_modules/d3-transition/src/transition/on.js new file mode 100644 index 0000000..b6a91d3 --- /dev/null +++ b/node_modules/d3-transition/src/transition/on.js @@ -0,0 +1,32 @@ +import {get, set, init} from "./schedule.js"; + +function start(name) { + return (name + "").trim().split(/^|\s+/).every(function(t) { + var i = t.indexOf("."); + if (i >= 0) t = t.slice(0, i); + return !t || t === "start"; + }); +} + +function onFunction(id, name, listener) { + var on0, on1, sit = start(name) ? init : set; + return function() { + var schedule = sit(this, id), + on = schedule.on; + + // If this node shared a dispatch with the previous node, + // just assign the updated shared dispatch and we’re done! + // Otherwise, copy-on-write. + if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener); + + schedule.on = on1; + }; +} + +export default function(name, listener) { + var id = this._id; + + return arguments.length < 2 + ? get(this.node(), id).on.on(name) + : this.each(onFunction(id, name, listener)); +} diff --git a/node_modules/d3-transition/src/transition/remove.js b/node_modules/d3-transition/src/transition/remove.js new file mode 100644 index 0000000..c4bff9b --- /dev/null +++ b/node_modules/d3-transition/src/transition/remove.js @@ -0,0 +1,11 @@ +function removeFunction(id) { + return function() { + var parent = this.parentNode; + for (var i in this.__transition) if (+i !== id) return; + if (parent) parent.removeChild(this); + }; +} + +export default function() { + return this.on("end.remove", removeFunction(this._id)); +} diff --git a/node_modules/d3-transition/src/transition/schedule.js b/node_modules/d3-transition/src/transition/schedule.js new file mode 100644 index 0000000..f4e88d7 --- /dev/null +++ b/node_modules/d3-transition/src/transition/schedule.js @@ -0,0 +1,153 @@ +import {dispatch} from "d3-dispatch"; +import {timer, timeout} from "d3-timer"; + +var emptyOn = dispatch("start", "end", "cancel", "interrupt"); +var emptyTween = []; + +export var CREATED = 0; +export var SCHEDULED = 1; +export var STARTING = 2; +export var STARTED = 3; +export var RUNNING = 4; +export var ENDING = 5; +export var ENDED = 6; + +export default function(node, name, id, index, group, timing) { + var schedules = node.__transition; + if (!schedules) node.__transition = {}; + else if (id in schedules) return; + create(node, id, { + name: name, + index: index, // For context during callback. + group: group, // For context during callback. + on: emptyOn, + tween: emptyTween, + time: timing.time, + delay: timing.delay, + duration: timing.duration, + ease: timing.ease, + timer: null, + state: CREATED + }); +} + +export function init(node, id) { + var schedule = get(node, id); + if (schedule.state > CREATED) throw new Error("too late; already scheduled"); + return schedule; +} + +export function set(node, id) { + var schedule = get(node, id); + if (schedule.state > STARTED) throw new Error("too late; already running"); + return schedule; +} + +export function get(node, id) { + var schedule = node.__transition; + if (!schedule || !(schedule = schedule[id])) throw new Error("transition not found"); + return schedule; +} + +function create(node, id, self) { + var schedules = node.__transition, + tween; + + // Initialize the self timer when the transition is created. + // Note the actual delay is not known until the first callback! + schedules[id] = self; + self.timer = timer(schedule, 0, self.time); + + function schedule(elapsed) { + self.state = SCHEDULED; + self.timer.restart(start, self.delay, self.time); + + // If the elapsed delay is less than our first sleep, start immediately. + if (self.delay <= elapsed) start(elapsed - self.delay); + } + + function start(elapsed) { + var i, j, n, o; + + // If the state is not SCHEDULED, then we previously errored on start. + if (self.state !== SCHEDULED) return stop(); + + for (i in schedules) { + o = schedules[i]; + if (o.name !== self.name) continue; + + // While this element already has a starting transition during this frame, + // defer starting an interrupting transition until that transition has a + // chance to tick (and possibly end); see d3/d3-transition#54! + if (o.state === STARTED) return timeout(start); + + // Interrupt the active transition, if any. + if (o.state === RUNNING) { + o.state = ENDED; + o.timer.stop(); + o.on.call("interrupt", node, node.__data__, o.index, o.group); + delete schedules[i]; + } + + // Cancel any pre-empted transitions. + else if (+i < id) { + o.state = ENDED; + o.timer.stop(); + o.on.call("cancel", node, node.__data__, o.index, o.group); + delete schedules[i]; + } + } + + // Defer the first tick to end of the current frame; see d3/d3#1576. + // Note the transition may be canceled after start and before the first tick! + // Note this must be scheduled before the start event; see d3/d3-transition#16! + // Assuming this is successful, subsequent callbacks go straight to tick. + timeout(function() { + if (self.state === STARTED) { + self.state = RUNNING; + self.timer.restart(tick, self.delay, self.time); + tick(elapsed); + } + }); + + // Dispatch the start event. + // Note this must be done before the tween are initialized. + self.state = STARTING; + self.on.call("start", node, node.__data__, self.index, self.group); + if (self.state !== STARTING) return; // interrupted + self.state = STARTED; + + // Initialize the tween, deleting null tween. + tween = new Array(n = self.tween.length); + for (i = 0, j = -1; i < n; ++i) { + if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) { + tween[++j] = o; + } + } + tween.length = j + 1; + } + + function tick(elapsed) { + var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1), + i = -1, + n = tween.length; + + while (++i < n) { + tween[i].call(node, t); + } + + // Dispatch the end event. + if (self.state === ENDING) { + self.on.call("end", node, node.__data__, self.index, self.group); + stop(); + } + } + + function stop() { + self.state = ENDED; + self.timer.stop(); + delete schedules[id]; + for (var i in schedules) return; // eslint-disable-line no-unused-vars + delete node.__transition; + } +} diff --git a/node_modules/d3-transition/src/transition/select.js b/node_modules/d3-transition/src/transition/select.js new file mode 100644 index 0000000..959c8c0 --- /dev/null +++ b/node_modules/d3-transition/src/transition/select.js @@ -0,0 +1,22 @@ +import {selector} from "d3-selection"; +import {Transition} from "./index.js"; +import schedule, {get} from "./schedule.js"; + +export default function(select) { + var name = this._name, + id = this._id; + + if (typeof select !== "function") select = selector(select); + + for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { + for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) { + if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) { + if ("__data__" in node) subnode.__data__ = node.__data__; + subgroup[i] = subnode; + schedule(subgroup[i], name, id, i, subgroup, get(node, id)); + } + } + } + + return new Transition(subgroups, this._parents, name, id); +} diff --git a/node_modules/d3-transition/src/transition/selectAll.js b/node_modules/d3-transition/src/transition/selectAll.js new file mode 100644 index 0000000..1ba4801 --- /dev/null +++ b/node_modules/d3-transition/src/transition/selectAll.js @@ -0,0 +1,26 @@ +import {selectorAll} from "d3-selection"; +import {Transition} from "./index.js"; +import schedule, {get} from "./schedule.js"; + +export default function(select) { + var name = this._name, + id = this._id; + + if (typeof select !== "function") select = selectorAll(select); + + for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) { + for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { + if (node = group[i]) { + for (var children = select.call(node, node.__data__, i, group), child, inherit = get(node, id), k = 0, l = children.length; k < l; ++k) { + if (child = children[k]) { + schedule(child, name, id, k, children, inherit); + } + } + subgroups.push(children); + parents.push(node); + } + } + } + + return new Transition(subgroups, parents, name, id); +} diff --git a/node_modules/d3-transition/src/transition/selection.js b/node_modules/d3-transition/src/transition/selection.js new file mode 100644 index 0000000..d0c5944 --- /dev/null +++ b/node_modules/d3-transition/src/transition/selection.js @@ -0,0 +1,7 @@ +import {selection} from "d3-selection"; + +var Selection = selection.prototype.constructor; + +export default function() { + return new Selection(this._groups, this._parents); +} diff --git a/node_modules/d3-transition/src/transition/style.js b/node_modules/d3-transition/src/transition/style.js new file mode 100644 index 0000000..7dcb187 --- /dev/null +++ b/node_modules/d3-transition/src/transition/style.js @@ -0,0 +1,80 @@ +import {interpolateTransformCss as interpolateTransform} from "d3-interpolate"; +import {style} from "d3-selection"; +import {set} from "./schedule.js"; +import {tweenValue} from "./tween.js"; +import interpolate from "./interpolate.js"; + +function styleNull(name, interpolate) { + var string00, + string10, + interpolate0; + return function() { + var string0 = style(this, name), + string1 = (this.style.removeProperty(name), style(this, name)); + return string0 === string1 ? null + : string0 === string00 && string1 === string10 ? interpolate0 + : interpolate0 = interpolate(string00 = string0, string10 = string1); + }; +} + +function styleRemove(name) { + return function() { + this.style.removeProperty(name); + }; +} + +function styleConstant(name, interpolate, value1) { + var string00, + string1 = value1 + "", + interpolate0; + return function() { + var string0 = style(this, name); + return string0 === string1 ? null + : string0 === string00 ? interpolate0 + : interpolate0 = interpolate(string00 = string0, value1); + }; +} + +function styleFunction(name, interpolate, value) { + var string00, + string10, + interpolate0; + return function() { + var string0 = style(this, name), + value1 = value(this), + string1 = value1 + ""; + if (value1 == null) string1 = value1 = (this.style.removeProperty(name), style(this, name)); + return string0 === string1 ? null + : string0 === string00 && string1 === string10 ? interpolate0 + : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1)); + }; +} + +function styleMaybeRemove(id, name) { + var on0, on1, listener0, key = "style." + name, event = "end." + key, remove; + return function() { + var schedule = set(this, id), + on = schedule.on, + listener = schedule.value[key] == null ? remove || (remove = styleRemove(name)) : undefined; + + // If this node shared a dispatch with the previous node, + // just assign the updated shared dispatch and we’re done! + // Otherwise, copy-on-write. + if (on !== on0 || listener0 !== listener) (on1 = (on0 = on).copy()).on(event, listener0 = listener); + + schedule.on = on1; + }; +} + +export default function(name, value, priority) { + var i = (name += "") === "transform" ? interpolateTransform : interpolate; + return value == null ? this + .styleTween(name, styleNull(name, i)) + .on("end.style." + name, styleRemove(name)) + : typeof value === "function" ? this + .styleTween(name, styleFunction(name, i, tweenValue(this, "style." + name, value))) + .each(styleMaybeRemove(this._id, name)) + : this + .styleTween(name, styleConstant(name, i, value), priority) + .on("end.style." + name, null); +} diff --git a/node_modules/d3-transition/src/transition/styleTween.js b/node_modules/d3-transition/src/transition/styleTween.js new file mode 100644 index 0000000..f692483 --- /dev/null +++ b/node_modules/d3-transition/src/transition/styleTween.js @@ -0,0 +1,24 @@ +function styleInterpolate(name, i, priority) { + return function(t) { + this.style.setProperty(name, i.call(this, t), priority); + }; +} + +function styleTween(name, value, priority) { + var t, i0; + function tween() { + var i = value.apply(this, arguments); + if (i !== i0) t = (i0 = i) && styleInterpolate(name, i, priority); + return t; + } + tween._value = value; + return tween; +} + +export default function(name, value, priority) { + var key = "style." + (name += ""); + if (arguments.length < 2) return (key = this.tween(key)) && key._value; + if (value == null) return this.tween(key, null); + if (typeof value !== "function") throw new Error; + return this.tween(key, styleTween(name, value, priority == null ? "" : priority)); +} diff --git a/node_modules/d3-transition/src/transition/text.js b/node_modules/d3-transition/src/transition/text.js new file mode 100644 index 0000000..a7f75d9 --- /dev/null +++ b/node_modules/d3-transition/src/transition/text.js @@ -0,0 +1,20 @@ +import {tweenValue} from "./tween.js"; + +function textConstant(value) { + return function() { + this.textContent = value; + }; +} + +function textFunction(value) { + return function() { + var value1 = value(this); + this.textContent = value1 == null ? "" : value1; + }; +} + +export default function(value) { + return this.tween("text", typeof value === "function" + ? textFunction(tweenValue(this, "text", value)) + : textConstant(value == null ? "" : value + "")); +} diff --git a/node_modules/d3-transition/src/transition/textTween.js b/node_modules/d3-transition/src/transition/textTween.js new file mode 100644 index 0000000..16d1bf1 --- /dev/null +++ b/node_modules/d3-transition/src/transition/textTween.js @@ -0,0 +1,24 @@ +function textInterpolate(i) { + return function(t) { + this.textContent = i.call(this, t); + }; +} + +function textTween(value) { + var t0, i0; + function tween() { + var i = value.apply(this, arguments); + if (i !== i0) t0 = (i0 = i) && textInterpolate(i); + return t0; + } + tween._value = value; + return tween; +} + +export default function(value) { + var key = "text"; + if (arguments.length < 1) return (key = this.tween(key)) && key._value; + if (value == null) return this.tween(key, null); + if (typeof value !== "function") throw new Error; + return this.tween(key, textTween(value)); +} diff --git a/node_modules/d3-transition/src/transition/transition.js b/node_modules/d3-transition/src/transition/transition.js new file mode 100644 index 0000000..6a6dd24 --- /dev/null +++ b/node_modules/d3-transition/src/transition/transition.js @@ -0,0 +1,24 @@ +import {Transition, newId} from "./index.js"; +import schedule, {get} from "./schedule.js"; + +export default function() { + var name = this._name, + id0 = this._id, + id1 = newId(); + + for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) { + for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { + if (node = group[i]) { + var inherit = get(node, id0); + schedule(node, name, id1, i, group, { + time: inherit.time + inherit.delay + inherit.duration, + delay: 0, + duration: inherit.duration, + ease: inherit.ease + }); + } + } + } + + return new Transition(groups, this._parents, name, id1); +} diff --git a/node_modules/d3-transition/src/transition/tween.js b/node_modules/d3-transition/src/transition/tween.js new file mode 100644 index 0000000..ba96781 --- /dev/null +++ b/node_modules/d3-transition/src/transition/tween.js @@ -0,0 +1,81 @@ +import {get, set} from "./schedule.js"; + +function tweenRemove(id, name) { + var tween0, tween1; + return function() { + var schedule = set(this, id), + tween = schedule.tween; + + // If this node shared tween with the previous node, + // just assign the updated shared tween and we’re done! + // Otherwise, copy-on-write. + if (tween !== tween0) { + tween1 = tween0 = tween; + for (var i = 0, n = tween1.length; i < n; ++i) { + if (tween1[i].name === name) { + tween1 = tween1.slice(); + tween1.splice(i, 1); + break; + } + } + } + + schedule.tween = tween1; + }; +} + +function tweenFunction(id, name, value) { + var tween0, tween1; + if (typeof value !== "function") throw new Error; + return function() { + var schedule = set(this, id), + tween = schedule.tween; + + // If this node shared tween with the previous node, + // just assign the updated shared tween and we’re done! + // Otherwise, copy-on-write. + if (tween !== tween0) { + tween1 = (tween0 = tween).slice(); + for (var t = {name: name, value: value}, i = 0, n = tween1.length; i < n; ++i) { + if (tween1[i].name === name) { + tween1[i] = t; + break; + } + } + if (i === n) tween1.push(t); + } + + schedule.tween = tween1; + }; +} + +export default function(name, value) { + var id = this._id; + + name += ""; + + if (arguments.length < 2) { + var tween = get(this.node(), id).tween; + for (var i = 0, n = tween.length, t; i < n; ++i) { + if ((t = tween[i]).name === name) { + return t.value; + } + } + return null; + } + + return this.each((value == null ? tweenRemove : tweenFunction)(id, name, value)); +} + +export function tweenValue(transition, name, value) { + var id = transition._id; + + transition.each(function() { + var schedule = set(this, id); + (schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments); + }); + + return function(node) { + return get(node, id).value[name]; + }; +} diff --git a/node_modules/d3-zoom/LICENSE b/node_modules/d3-zoom/LICENSE new file mode 100644 index 0000000..b014515 --- /dev/null +++ b/node_modules/d3-zoom/LICENSE @@ -0,0 +1,13 @@ +Copyright 2010-2021 Mike Bostock + +Permission to use, copy, modify, and/or distribute this software for any purpose +with or without fee is hereby granted, provided that the above copyright notice +and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. diff --git a/node_modules/d3-zoom/README.md b/node_modules/d3-zoom/README.md new file mode 100644 index 0000000..adcb856 --- /dev/null +++ b/node_modules/d3-zoom/README.md @@ -0,0 +1,414 @@ +# d3-zoom + +Panning and zooming are popular interaction techniques which let the user focus on a region of interest by restricting the view. It is easy to learn due to direct manipulation: click-and-drag to pan (translate), spin the wheel to zoom (scale), or use touch. Panning and zooming are widely used in web-based mapping, but can also be used with visualizations such as time-series and scatterplots. + +The zoom behavior implemented by d3-zoom is a convenient but flexible abstraction for enabling pan-and-zoom on [selections](https://github.com/d3/d3-selection). It handles a surprising variety of [input events](#api-reference) and browser quirks. The zoom behavior is agnostic about the DOM, so you can use it with SVG, HTML or Canvas. + +[Canvas Zooming](https://observablehq.com/@d3/zoom-canvas)[SVG Zooming](https://observablehq.com/@d3/zoom) + +The zoom behavior is also designed to work with [d3-scale](https://github.com/d3/d3-scale) and [d3-axis](https://github.com/d3/d3-axis); see [*transform*.rescaleX](#transform_rescaleX) and [*transform*.rescaleY](#transform_rescaleY). You can also restrict zooming using [*zoom*.scaleExtent](#zoom_scaleExtent) and panning using [*zoom*.translateExtent](#zoom_translateExtent). + +[Axis Zooming](https://observablehq.com/@d3/zoomable-scatterplot) + +The zoom behavior can be combined with other behaviors, such as [d3-drag](https://github.com/d3/d3-drag) for dragging, and [d3-brush](https://github.com/d3/d3-brush) for focus + context. + +[Drag & Zoom II](https://observablehq.com/@d3/drag-zoom)[Brush & Zoom](https://observablehq.com/@d3/focus-context) + +The zoom behavior can be controlled programmatically using [*zoom*.transform](#zoom_transform), allowing you to implement user interface controls which drive the display or to stage animated tours through your data. Smooth zoom transitions are based on [“Smooth and efficient zooming and panning”](http://www.win.tue.nl/~vanwijk/zoompan.pdf) by Jarke J. van Wijk and Wim A.A. Nuij. + +[Zoom Transitions](https://observablehq.com/@d3/programmatic-zoom) + +See also [d3-tile](https://github.com/d3/d3-tile) for examples panning and zooming maps. + +## Installing + +If you use npm, `npm install d3-zoom`. You can also download the [latest release on GitHub](https://github.com/d3/d3-zoom/releases/latest). For vanilla HTML in modern browsers, import d3-zoom from Skypack: + +```html + +``` + +For legacy environments, you can load d3-zoom’s UMD bundle from an npm-based CDN such as jsDelivr; a `d3` global is exported: + +```html + + + + + + + + + + +``` + +[Try d3-zoom in your browser.](https://observablehq.com/collection/@d3/d3-zoom) + +## API Reference + +This table describes how the zoom behavior interprets native events: + +| Event | Listening Element | Zoom Event | Default Prevented? | +| ------------ | ----------------- | ----------- | ------------------ | +| mousedown⁵ | selection | start | no¹ | +| mousemove² | window¹ | zoom | yes | +| mouseup² | window¹ | end | yes | +| dragstart² | window | - | yes | +| selectstart² | window | - | yes | +| click³ | window | - | yes | +| dblclick | selection | *multiple*⁶ | yes | +| wheel⁸ | selection | zoom⁷ | yes | +| touchstart | selection | *multiple*⁶ | no⁴ | +| touchmove | selection | zoom | yes | +| touchend | selection | end | no⁴ | +| touchcancel | selection | end | no⁴ | + +The propagation of all consumed events is [immediately stopped](https://dom.spec.whatwg.org/#dom-event-stopimmediatepropagation). + +¹ Necessary to capture events outside an iframe; see [d3-drag#9](https://github.com/d3/d3-drag/issues/9). +
² Only applies during an active, mouse-based gesture; see [d3-drag#9](https://github.com/d3/d3-drag/issues/9). +
³ Only applies immediately after some mouse-based gestures; see [*zoom*.clickDistance](#zoom_clickDistance). +
⁴ Necessary to allow [click emulation](https://developer.apple.com/library/ios/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html#//apple_ref/doc/uid/TP40006511-SW7) on touch input; see [d3-drag#9](https://github.com/d3/d3-drag/issues/9). +
⁵ Ignored if within 500ms of a touch gesture ending; assumes [click emulation](https://developer.apple.com/library/ios/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html#//apple_ref/doc/uid/TP40006511-SW7). +
⁶ Double-click and double-tap initiate a transition that emits start, zoom and end events; see [*zoom*.tapDistance](#zoom_tapDistance).. +
⁷ The first wheel event emits a start event; an end event is emitted when no wheel events are received for 150ms. +
⁸ Ignored if already at the corresponding limit of the [scale extent](#zoom_scaleExtent). + +# d3.zoom() · [Source](https://github.com/d3/d3-zoom/blob/master/src/zoom.js), [Examples](https://observablehq.com/collection/@d3/d3-zoom) + +Creates a new zoom behavior. The returned behavior, [*zoom*](#_drag), is both an object and a function, and is typically applied to selected elements via [*selection*.call](https://github.com/d3/d3-selection#selection_call). + +# zoom(selection) · [Source](https://github.com/d3/d3-zoom/blob/master/src/zoom.js), [Examples](https://observablehq.com/collection/@d3/d3-zoom) + +Applies this zoom behavior to the specified [*selection*](https://github.com/d3/d3-selection), binding the necessary event listeners to allow panning and zooming, and initializing the [zoom transform](#zoom-transforms) on each selected element to the identity transform if not already defined. This function is typically not invoked directly, and is instead invoked via [*selection*.call](https://github.com/d3/d3-selection#selection_call). For example, to instantiate a zoom behavior and apply it to a selection: + +```js +selection.call(d3.zoom().on("zoom", zoomed)); +``` + +Internally, the zoom behavior uses [*selection*.on](https://github.com/d3/d3-selection#selection_on) to bind the necessary event listeners for zooming. The listeners use the name `.zoom`, so you can subsequently unbind the zoom behavior as follows: + +```js +selection.on(".zoom", null); +``` + +To disable just wheel-driven zooming (say to not interfere with native scrolling), you can remove the zoom behavior’s wheel event listener after applying the zoom behavior to the selection: + +```js +selection + .call(zoom) + .on("wheel.zoom", null); +``` + +Alternatively, use [*zoom*.filter](#zoom_filter) for greater control over which events can initiate zoom gestures. + +Applying the zoom behavior also sets the [-webkit-tap-highlight-color](https://developer.apple.com/library/mac/documentation/AppleApplications/Reference/SafariWebContent/AdjustingtheTextSize/AdjustingtheTextSize.html#//apple_ref/doc/uid/TP40006510-SW5) style to transparent, disabling the tap highlight on iOS. If you want a different tap highlight color, remove or re-apply this style after applying the drag behavior. + +# zoom.transform(selection, transform[, point]) · [Source](https://github.com/d3/d3-zoom/blob/master/src/zoom.js), [Examples](https://observablehq.com/collection/@d3/d3-zoom) + +If *selection* is a selection, sets the [current zoom transform](#zoomTransform) of the selected elements to the specified *transform*, instantaneously emitting start, zoom and end [events](#zoom-events). If *selection* is a transition, defines a “zoom” tween to the specified *transform* using [d3.interpolateZoom](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolateZoom), emitting a start event when the transition starts, zoom events for each tick of the transition, and then an end event when the transition ends (or is interrupted). The transition will attempt to minimize the visual movement around the specified *point*; if the *point* is not specified, it defaults to the center of the viewport [extent](#zoom_extent). The *transform* may be specified either as a [zoom transform](#zoom-transforms) or as a function that returns a zoom transform; similarly, the *point* may be specified either as a two-element array [*x*, *y*] or a function that returns such an array. If a function, it is invoked for each selected element, being passed the current event (`event`) and datum `d`, with the `this` context as the current DOM element. + +This function is typically not invoked directly, and is instead invoked via [*selection*.call](https://github.com/d3/d3-selection#selection_call) or [*transition*.call](https://github.com/d3/d3-transition#transition_call). For example, to reset the zoom transform to the [identity transform](#zoomIdentity) instantaneously: + +```js +selection.call(zoom.transform, d3.zoomIdentity); +``` + +To smoothly reset the zoom transform to the identity transform over 750 milliseconds: + +```js +selection.transition().duration(750).call(zoom.transform, d3.zoomIdentity); +``` + +This method requires that you specify the new zoom transform completely, and does not enforce the defined [scale extent](#zoom_scaleExtent) and [translate extent](#zoom_translateExtent), if any. To derive a new transform from the existing transform, and to enforce the scale and translate extents, see the convenience methods [*zoom*.translateBy](#zoom_translateBy), [*zoom*.scaleBy](#zoom_scaleBy) and [*zoom*.scaleTo](#zoom_scaleTo). + +# zoom.translateBy(selection, x, y) · [Source](https://github.com/d3/d3-zoom/blob/master/src/zoom.js) + +If *selection* is a selection, [translates](#transform_translate) the [current zoom transform](#zoomTransform) of the selected elements by *x* and *y*, such that the new *tx1* = *tx0* + *kx* and *ty1* = *ty0* + *ky*. If *selection* is a transition, defines a “zoom” tween translating the current transform. This method is a convenience method for [*zoom*.transform](#zoom_transform). The *x* and *y* translation amounts may be specified either as numbers or as functions that return numbers. If a function, it is invoked for each selected element, being passed the current datum `d` and index `i`, with the `this` context as the current DOM element. + +# zoom.translateTo(selection, x, y[, p]) · [Source](https://github.com/d3/d3-zoom/blob/master/src/zoom.js) + +If *selection* is a selection, [translates](#transform_translate) the [current zoom transform](#zoomTransform) of the selected elements such that the given position ⟨*x*,*y*⟩ appears at given point *p*. The new *tx* = *px* - *kx* and *ty* = *py* - *ky*. If *p* is not specified, it defaults to the center of the viewport [extent](#zoom_extent). If *selection* is a transition, defines a “zoom” tween translating the current transform. This method is a convenience method for [*zoom*.transform](#zoom_transform). The *x* and *y* coordinates may be specified either as numbers or as functions that returns numbers; similarly the *p* point may be specified either as a two-element array [*px*,*py*] or a function. If a function, it is invoked for each selected element, being passed the current datum `d` and index `i`, with the `this` context as the current DOM element. + +# zoom.scaleBy(selection, k[, p]) · [Source](https://github.com/d3/d3-zoom/blob/master/src/zoom.js) + +If *selection* is a selection, [scales](#transform_scale) the [current zoom transform](#zoomTransform) of the selected elements by *k*, such that the new *k₁* = *k₀k*. The reference point *p* does move. If *p* is not specified, it defaults to the center of the viewport [extent](#zoom_extent). If *selection* is a transition, defines a “zoom” tween translating the current transform. This method is a convenience method for [*zoom*.transform](#zoom_transform). The *k* scale factor may be specified either as a number or a function that returns a number; similarly the *p* point may be specified either as a two-element array [*px*,*py*] or a function. If a function, it is invoked for each selected element, being passed the current datum `d` and index `i`, with the `this` context as the current DOM element. + +# zoom.scaleTo(selection, k[, p]) · [Source](https://github.com/d3/d3-zoom/blob/master/src/zoom.js) + +If *selection* is a selection, [scales](#transform_scale) the [current zoom transform](#zoomTransform) of the selected elements to *k*, such that the new *k₁* = *k*. The reference point *p* does move. If *p* is not specified, it defaults to the center of the viewport [extent](#zoom_extent). If *selection* is a transition, defines a “zoom” tween translating the current transform. This method is a convenience method for [*zoom*.transform](#zoom_transform). The *k* scale factor may be specified either as a number or a function that returns a number; similarly the *p* point may be specified either as a two-element array [*px*,*py*] or a function. If a function, it is invoked for each selected element, being passed the current datum `d` and index `i`, with the `this` context as the current DOM element. + +# zoom.constrain([constrain]) · [Source](https://github.com/d3/d3-zoom/blob/master/src/zoom.js) + +If *constrain* is specified, sets the transform constraint function to the specified function and returns the zoom behavior. If *constrain* is not specified, returns the current constraint function, which defaults to: + +```js +function constrain(transform, extent, translateExtent) { + var dx0 = transform.invertX(extent[0][0]) - translateExtent[0][0], + dx1 = transform.invertX(extent[1][0]) - translateExtent[1][0], + dy0 = transform.invertY(extent[0][1]) - translateExtent[0][1], + dy1 = transform.invertY(extent[1][1]) - translateExtent[1][1]; + return transform.translate( + dx1 > dx0 ? (dx0 + dx1) / 2 : Math.min(0, dx0) || Math.max(0, dx1), + dy1 > dy0 ? (dy0 + dy1) / 2 : Math.min(0, dy0) || Math.max(0, dy1) + ); +} +``` + +The constraint function must return a [*transform*](#zoom-transforms) given the current *transform*, [viewport extent](#zoom_extent) and [translate extent](#zoom_translateExtent). The default implementation attempts to ensure that the viewport extent does not go outside the translate extent. + +# zoom.filter([filter]) · [Source](https://github.com/d3/d3-zoom/blob/master/src/zoom.js) + +If *filter* is specified, sets the filter to the specified function and returns the zoom behavior. If *filter* is not specified, returns the current filter, which defaults to: + +```js +function filter(event) { + return (!event.ctrlKey || event.type === 'wheel') && !event.button; +} +``` + +The filter is passed the current event (`event`) and datum `d`, with the `this` context as the current DOM element. If the filter returns falsey, the initiating event is ignored and no zoom gestures are started. Thus, the filter determines which input events are ignored. The default filter ignores mousedown events on secondary buttons, since those buttons are typically intended for other purposes, such as the context menu. + +# zoom.touchable([touchable]) · [Source](https://github.com/d3/d3-zoom/blob/master/src/zoom.js) + +If *touchable* is specified, sets the touch support detector to the specified function and returns the zoom behavior. If *touchable* is not specified, returns the current touch support detector, which defaults to: + +```js +function touchable() { + return navigator.maxTouchPoints || ("ontouchstart" in this); +} +``` + +Touch event listeners are only registered if the detector returns truthy for the corresponding element when the zoom behavior is [applied](#_zoom). The default detector works well for most browsers that are capable of touch input, but not all; Chrome’s mobile device emulator, for example, fails detection. + +# zoom.wheelDelta([delta]) · [Source](https://github.com/d3/d3-zoom/blob/master/src/zoom.js) + +If *delta* is specified, sets the wheel delta function to the specified function and returns the zoom behavior. If *delta* is not specified, returns the current wheel delta function, which defaults to: + +```js +function wheelDelta(event) { + return -event.deltaY * (event.deltaMode === 1 ? 0.05 : event.deltaMode ? 1 : 0.002); +} +``` + +The value *Δ* returned by the wheel delta function determines the amount of scaling applied in response to a [WheelEvent](https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent). The scale factor [*transform*.k](#zoomTransform) is multiplied by 2*Δ*; for example, a *Δ* of +1 doubles the scale factor, *Δ* of -1 halves the scale factor. + +# zoom.extent([extent]) · [Source](https://github.com/d3/d3-zoom/blob/master/src/zoom.js) + +If *extent* is specified, sets the viewport extent to the specified array of points [[*x0*, *y0*], [*x1*, *y1*]], where [*x0*, *y0*] is the top-left corner of the viewport and [*x1*, *y1*] is the bottom-right corner of the viewport, and returns this zoom behavior. The *extent* may also be specified as a function which returns such an array; if a function, it is invoked for each selected element, being passed the current datum `d`, with the `this` context as the current DOM element. + +If *extent* is not specified, returns the current extent accessor, which defaults to [[0, 0], [*width*, *height*]] where *width* is the [client width](https://developer.mozilla.org/en-US/docs/Web/API/Element/clientWidth) of the element and *height* is its [client height](https://developer.mozilla.org/en-US/docs/Web/API/Element/clientHeight); for SVG elements, the nearest ancestor SVG element’s viewBox, or [width](https://www.w3.org/TR/SVG/struct.html#SVGElementWidthAttribute) and [height](https://www.w3.org/TR/SVG/struct.html#SVGElementHeightAttribute) attributes, are used. Alternatively, consider using [*element*.getBoundingClientRect](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect). + +The viewport extent affects several functions: the center of the viewport remains fixed during changes by [*zoom*.scaleBy](#zoom_scaleBy) and [*zoom*.scaleTo](#zoom_scaleTo); the viewport center and dimensions affect the path chosen by [d3.interpolateZoom](https://github.com/d3/d3-interpolate#interpolateZoom); and the viewport extent is needed to enforce the optional [translate extent](#zoom_translateExtent). + +# zoom.scaleExtent([extent]) · [Source](https://github.com/d3/d3-zoom/blob/master/src/zoom.js) + +If *extent* is specified, sets the scale extent to the specified array of numbers [*k0*, *k1*] where *k0* is the minimum allowed scale factor and *k1* is the maximum allowed scale factor, and returns this zoom behavior. If *extent* is not specified, returns the current scale extent, which defaults to [0, ∞]. The scale extent restricts zooming in and out. It is enforced on interaction and when using [*zoom*.scaleBy](#zoom_scaleBy), [*zoom*.scaleTo](#zoom_scaleTo) and [*zoom*.translateBy](#zoom_translateBy); however, it is not enforced when using [*zoom*.transform](#zoom_transform) to set the transform explicitly. + +If the user tries to zoom by wheeling when already at the corresponding limit of the scale extent, the wheel events will be ignored and not initiate a zoom gesture. This allows the user to scroll down past a zoomable area after zooming in, or to scroll up after zooming out. If you would prefer to always prevent scrolling on wheel input regardless of the scale extent, register a wheel event listener to prevent the browser default behavior: + +```js +selection + .call(zoom) + .on("wheel", event => event.preventDefault()); +``` + +# zoom.translateExtent([extent]) · [Source](https://github.com/d3/d3-zoom/blob/master/src/zoom.js) + +If *extent* is specified, sets the translate extent to the specified array of points [[*x0*, *y0*], [*x1*, *y1*]], where [*x0*, *y0*] is the top-left corner of the world and [*x1*, *y1*] is the bottom-right corner of the world, and returns this zoom behavior. If *extent* is not specified, returns the current translate extent, which defaults to [[-∞, -∞], [+∞, +∞]]. The translate extent restricts panning, and may cause translation on zoom out. It is enforced on interaction and when using [*zoom*.scaleBy](#zoom_scaleBy), [*zoom*.scaleTo](#zoom_scaleTo) and [*zoom*.translateBy](#zoom_translateBy); however, it is not enforced when using [*zoom*.transform](#zoom_transform) to set the transform explicitly. + +# zoom.clickDistance([distance]) · [Source](https://github.com/d3/d3-zoom/blob/master/src/zoom.js) + +If *distance* is specified, sets the maximum distance that the mouse can move between mousedown and mouseup that will trigger a subsequent click event. If at any point between mousedown and mouseup the mouse is greater than or equal to *distance* from its position on mousedown, the click event following mouseup will be suppressed. If *distance* is not specified, returns the current distance threshold, which defaults to zero. The distance threshold is measured in client coordinates ([*event*.clientX](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/clientX) and [*event*.clientY](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/clientY)). + +# zoom.tapDistance([distance]) · [Source](https://github.com/d3/d3-zoom/blob/master/src/zoom.js) + +If *distance* is specified, sets the maximum distance that a double-tap gesture can move between first touchstart and second touchend that will trigger a subsequent double-click event. If *distance* is not specified, returns the current distance threshold, which defaults to 10. The distance threshold is measured in client coordinates ([*event*.clientX](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/clientX) and [*event*.clientY](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/clientY)). + +# zoom.duration([duration]) · [Source](https://github.com/d3/d3-zoom/blob/master/src/zoom.js) + +If *duration* is specified, sets the duration for zoom transitions on double-click and double-tap to the specified number of milliseconds and returns the zoom behavior. If *duration* is not specified, returns the current duration, which defaults to 250 milliseconds. If the duration is not greater than zero, double-click and -tap trigger instantaneous changes to the zoom transform rather than initiating smooth transitions. + +To disable double-click and double-tap transitions, you can remove the zoom behavior’s dblclick event listener after applying the zoom behavior to the selection: + +```js +selection + .call(zoom) + .on("dblclick.zoom", null); +``` + +# zoom.interpolate([interpolate]) · [Source](https://github.com/d3/d3-zoom/blob/master/src/zoom.js) + +If *interpolate* is specified, sets the interpolation factory for zoom transitions to the specified function. If *interpolate* is not specified, returns the current interpolation factory, which defaults to [d3.interpolateZoom](https://github.com/d3/d3-interpolate#interpolateZoom) to implement smooth zooming. To apply direct interpolation between two views, try [d3.interpolate](https://github.com/d3/d3-interpolate#interpolate) instead. + +# zoom.on(typenames[, listener]) · [Source](https://github.com/d3/d3-zoom/blob/master/src/zoom.js) + +If *listener* is specified, sets the event *listener* for the specified *typenames* and returns the zoom behavior. If an event listener was already registered for the same type and name, the existing listener is removed before the new listener is added. If *listener* is null, removes the current event listeners for the specified *typenames*, if any. If *listener* is not specified, returns the first currently-assigned listener matching the specified *typenames*, if any. When a specified event is dispatched, each *listener* will be invoked with the same context and arguments as [*selection*.on](https://github.com/d3/d3-selection#selection_on) listeners: the current event (`event`) and datum `d`, with the `this` context as the current DOM element. + +The *typenames* is a string containing one or more *typename* separated by whitespace. Each *typename* is a *type*, optionally followed by a period (`.`) and a *name*, such as `zoom.foo` and `zoom.bar`; the name allows multiple listeners to be registered for the same *type*. The *type* must be one of the following: + +* `start` - after zooming begins (such as on mousedown). +* `zoom` - after a change to the zoom transform (such as on mousemove). +* `end` - after zooming ends (such as on mouseup ). + +See [*dispatch*.on](https://github.com/d3/d3-dispatch#dispatch_on) for more. + +### Zoom Events + +When a [zoom event listener](#zoom_on) is invoked, it receives the current zoom event as a first argument. The *event* object exposes several fields: + +* *event*.target - the associated [zoom behavior](#zoom). +* *event*.type - the string “start”, “zoom” or “end”; see [*zoom*.on](#zoom_on). +* *event*.transform - the current [zoom transform](#zoom-transforms). +* *event*.sourceEvent - the underlying input event, such as mousemove or touchmove. + +### Zoom Transforms + +The zoom behavior stores the zoom state on the element to which the zoom behavior was [applied](#_zoom), not on the zoom behavior itself. This is because the zoom behavior can be applied to many elements simultaneously, and each element can be zoomed independently. The zoom state can change either on user interaction or programmatically via [*zoom*.transform](#zoom_transform). + +To retrieve the zoom state, use *event*.transform on the current [zoom event](#zoom-events) within a zoom event listener (see [*zoom*.on](#zoom_on)), or use [d3.zoomTransform](#zoomTransform) for a given node. The latter is particularly useful for modifying the zoom state programmatically, say to implement buttons for zooming in and out. + +# d3.zoomTransform(node) · [Source](https://github.com/d3/d3-zoom/blob/master/src/transform.js) + +Returns the current transform for the specified *node*. Note that *node* should typically be a DOM element, not a *selection*. (A selection may consist of multiple nodes, in different states, and this function only returns a single transform.) If you have a selection, call [*selection*.node](https://github.com/d3/d3-selection#selection_node) first: + +```js +var transform = d3.zoomTransform(selection.node()); +``` + +In the context of an [event listener](https://github.com/d3/d3-selection#selection_on), the *node* is typically the element that received the input event (which should be equal to [*event*.transform](#zoom-events)), *this*: + +```js +var transform = d3.zoomTransform(this); +``` + +Internally, an element’s transform is stored as *element*.\_\_zoom; however, you should use this method rather than accessing it directly. If the given *node* has no defined transform, returns the transform of the closest ancestor, or if none exists, the [identity transformation](#zoomIdentity). The returned transform represents a two-dimensional [transformation matrix](https://en.wikipedia.org/wiki/Transformation_matrix#Affine_transformations) of the form: + +*k* 0 *tx* +
0 *k* *ty* +
0 0 1 + +(This matrix is capable of representing only scale and translation; a future release may also allow rotation, though this would probably not be a backwards-compatible change.) The position ⟨*x*,*y*⟩ is transformed to ⟨*xk* + *tx*,*yk* + *ty*⟩. The transform object exposes the following properties: + +* *transform*.x - the translation amount *tx* along the *x*-axis. +* *transform*.y - the translation amount *ty* along the *y*-axis. +* *transform*.k - the scale factor *k*. + +These properties should be considered read-only; instead of mutating a transform, use [*transform*.scale](#transform_scale) and [*transform*.translate](#transform_translate) to derive a new transform. Also see [*zoom*.scaleBy](#zoom_scaleBy), [*zoom*.scaleTo](#zoom_scaleTo) and [*zoom*.translateBy](#zoom_translateBy) for convenience methods on the zoom behavior. To create a transform with a given *k*, *tx*, and *ty*: + +```js +var t = d3.zoomIdentity.translate(x, y).scale(k); +``` + +To apply the transformation to a [Canvas 2D context](https://www.w3.org/TR/2dcontext/), use [*context*.translate](https://www.w3.org/TR/2dcontext/#dom-context-2d-translate) followed by [*context*.scale](https://www.w3.org/TR/2dcontext/#dom-context-2d-scale): + +```js +context.translate(transform.x, transform.y); +context.scale(transform.k, transform.k); +``` + +Similarly, to apply the transformation to HTML elements via [CSS](https://www.w3.org/TR/css-transforms-1/): + +```js +div.style("transform", "translate(" + transform.x + "px," + transform.y + "px) scale(" + transform.k + ")"); +div.style("transform-origin", "0 0"); +``` + +To apply the transformation to [SVG](https://www.w3.org/TR/SVG/coords.html#TransformAttribute): + +```js +g.attr("transform", "translate(" + transform.x + "," + transform.y + ") scale(" + transform.k + ")"); +``` + +Or more simply, taking advantage of [*transform*.toString](#transform_toString): + +```js +g.attr("transform", transform); +``` + +Note that the order of transformations matters! The translate must be applied before the scale. + +# transform.scale(k) · [Source](https://github.com/d3/d3-zoom/blob/master/src/transform.js) + +Returns a transform whose scale *k₁* is equal to *k₀k*, where *k₀* is this transform’s scale. + +# transform.translate(x, y) · [Source](https://github.com/d3/d3-zoom/blob/master/src/transform.js) + +Returns a transform whose translation *tx1* and *ty1* is equal to *tx0* + *tk x* and *ty0* + *tk y*, where *tx0* and *ty0* is this transform’s translation and *tk* is this transform’s scale. + +# transform.apply(point) · [Source](https://github.com/d3/d3-zoom/blob/master/src/transform.js) + +Returns the transformation of the specified *point* which is a two-element array of numbers [*x*, *y*]. The returned point is equal to [*xk* + *tx*, *yk* + *ty*]. + +# transform.applyX(x) · [Source](https://github.com/d3/d3-zoom/blob/master/src/transform.js) + +Returns the transformation of the specified *x*-coordinate, *xk* + *tx*. + +# transform.applyY(y) · [Source](https://github.com/d3/d3-zoom/blob/master/src/transform.js) + +Returns the transformation of the specified *y*-coordinate, *yk* + *ty*. + +# transform.invert(point) · [Source](https://github.com/d3/d3-zoom/blob/master/src/transform.js) + +Returns the inverse transformation of the specified *point* which is a two-element array of numbers [*x*, *y*]. The returned point is equal to [(*x* - *tx*) / *k*, (*y* - *ty*) / *k*]. + +# transform.invertX(x) · [Source](https://github.com/d3/d3-zoom/blob/master/src/transform.js) + +Returns the inverse transformation of the specified *x*-coordinate, (*x* - *tx*) / *k*. + +# transform.invertY(y) · [Source](https://github.com/d3/d3-zoom/blob/master/src/transform.js) + +Returns the inverse transformation of the specified *y*-coordinate, (*y* - *ty*) / *k*. + +# transform.rescaleX(x) · [Source](https://github.com/d3/d3-zoom/blob/master/src/transform.js) + +Returns a [copy](https://github.com/d3/d3-scale#continuous_copy) of the [continuous scale](https://github.com/d3/d3-scale#continuous-scales) *x* whose [domain](https://github.com/d3/d3-scale#continuous_domain) is transformed. This is implemented by first applying the [inverse *x*-transform](#transform_invertX) on the scale’s [range](https://github.com/d3/d3-scale#continuous_range), and then applying the [inverse scale](https://github.com/d3/d3-scale#continuous_invert) to compute the corresponding domain: + +```js +function rescaleX(x) { + var range = x.range().map(transform.invertX, transform), + domain = range.map(x.invert, x); + return x.copy().domain(domain); +} +``` + +The scale *x* must use [d3.interpolateNumber](https://github.com/d3/d3-interpolate#interpolateNumber); do not use [*continuous*.rangeRound](https://github.com/d3/d3-scale#continuous_rangeRound) as this reduces the accuracy of [*continuous*.invert](https://github.com/d3/d3-scale#continuous_invert) and can lead to an inaccurate rescaled domain. This method does not modify the input scale *x*; *x* thus represents the untransformed scale, while the returned scale represents its transformed view. + +# transform.rescaleY(y) · [Source](https://github.com/d3/d3-zoom/blob/master/src/transform.js) + +Returns a [copy](https://github.com/d3/d3-scale#continuous_copy) of the [continuous scale](https://github.com/d3/d3-scale#continuous-scales) *y* whose [domain](https://github.com/d3/d3-scale#continuous_domain) is transformed. This is implemented by first applying the [inverse *y*-transform](#transform_invertY) on the scale’s [range](https://github.com/d3/d3-scale#continuous_range), and then applying the [inverse scale](https://github.com/d3/d3-scale#continuous_invert) to compute the corresponding domain: + +```js +function rescaleY(y) { + var range = y.range().map(transform.invertY, transform), + domain = range.map(y.invert, y); + return y.copy().domain(domain); +} +``` + +The scale *y* must use [d3.interpolateNumber](https://github.com/d3/d3-interpolate#interpolateNumber); do not use [*continuous*.rangeRound](https://github.com/d3/d3-scale#continuous_rangeRound) as this reduces the accuracy of [*continuous*.invert](https://github.com/d3/d3-scale#continuous_invert) and can lead to an inaccurate rescaled domain. This method does not modify the input scale *y*; *y* thus represents the untransformed scale, while the returned scale represents its transformed view. + +# transform.toString() · [Source](https://github.com/d3/d3-zoom/blob/master/src/transform.js) + +Returns a string representing the [SVG transform](https://www.w3.org/TR/SVG/coords.html#TransformAttribute) corresponding to this transform. Implemented as: + +```js +function toString() { + return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; +} +``` + +# d3.zoomIdentity · [Source](https://github.com/d3/d3-zoom/blob/master/src/transform.js) + +The identity transform, where *k* = 1, *tx* = *ty* = 0. diff --git a/node_modules/d3-zoom/dist/d3-zoom.js b/node_modules/d3-zoom/dist/d3-zoom.js new file mode 100644 index 0000000..ddf02ae --- /dev/null +++ b/node_modules/d3-zoom/dist/d3-zoom.js @@ -0,0 +1,531 @@ +// https://d3js.org/d3-zoom/ v3.0.0 Copyright 2010-2021 Mike Bostock +(function (global, factory) { +typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-dispatch'), require('d3-drag'), require('d3-interpolate'), require('d3-selection'), require('d3-transition')) : +typeof define === 'function' && define.amd ? define(['exports', 'd3-dispatch', 'd3-drag', 'd3-interpolate', 'd3-selection', 'd3-transition'], factory) : +(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.d3 = global.d3 || {}, global.d3, global.d3, global.d3, global.d3, global.d3)); +}(this, (function (exports, d3Dispatch, d3Drag, d3Interpolate, d3Selection, d3Transition) { 'use strict'; + +var constant = x => () => x; + +function ZoomEvent(type, { + sourceEvent, + target, + transform, + dispatch +}) { + Object.defineProperties(this, { + type: {value: type, enumerable: true, configurable: true}, + sourceEvent: {value: sourceEvent, enumerable: true, configurable: true}, + target: {value: target, enumerable: true, configurable: true}, + transform: {value: transform, enumerable: true, configurable: true}, + _: {value: dispatch} + }); +} + +function Transform(k, x, y) { + this.k = k; + this.x = x; + this.y = y; +} + +Transform.prototype = { + constructor: Transform, + scale: function(k) { + return k === 1 ? this : new Transform(this.k * k, this.x, this.y); + }, + translate: function(x, y) { + return x === 0 & y === 0 ? this : new Transform(this.k, this.x + this.k * x, this.y + this.k * y); + }, + apply: function(point) { + return [point[0] * this.k + this.x, point[1] * this.k + this.y]; + }, + applyX: function(x) { + return x * this.k + this.x; + }, + applyY: function(y) { + return y * this.k + this.y; + }, + invert: function(location) { + return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k]; + }, + invertX: function(x) { + return (x - this.x) / this.k; + }, + invertY: function(y) { + return (y - this.y) / this.k; + }, + rescaleX: function(x) { + return x.copy().domain(x.range().map(this.invertX, this).map(x.invert, x)); + }, + rescaleY: function(y) { + return y.copy().domain(y.range().map(this.invertY, this).map(y.invert, y)); + }, + toString: function() { + return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; + } +}; + +var identity = new Transform(1, 0, 0); + +transform.prototype = Transform.prototype; + +function transform(node) { + while (!node.__zoom) if (!(node = node.parentNode)) return identity; + return node.__zoom; +} + +function nopropagation(event) { + event.stopImmediatePropagation(); +} + +function noevent(event) { + event.preventDefault(); + event.stopImmediatePropagation(); +} + +// Ignore right-click, since that should open the context menu. +// except for pinch-to-zoom, which is sent as a wheel+ctrlKey event +function defaultFilter(event) { + return (!event.ctrlKey || event.type === 'wheel') && !event.button; +} + +function defaultExtent() { + var e = this; + if (e instanceof SVGElement) { + e = e.ownerSVGElement || e; + if (e.hasAttribute("viewBox")) { + e = e.viewBox.baseVal; + return [[e.x, e.y], [e.x + e.width, e.y + e.height]]; + } + return [[0, 0], [e.width.baseVal.value, e.height.baseVal.value]]; + } + return [[0, 0], [e.clientWidth, e.clientHeight]]; +} + +function defaultTransform() { + return this.__zoom || identity; +} + +function defaultWheelDelta(event) { + return -event.deltaY * (event.deltaMode === 1 ? 0.05 : event.deltaMode ? 1 : 0.002) * (event.ctrlKey ? 10 : 1); +} + +function defaultTouchable() { + return navigator.maxTouchPoints || ("ontouchstart" in this); +} + +function defaultConstrain(transform, extent, translateExtent) { + var dx0 = transform.invertX(extent[0][0]) - translateExtent[0][0], + dx1 = transform.invertX(extent[1][0]) - translateExtent[1][0], + dy0 = transform.invertY(extent[0][1]) - translateExtent[0][1], + dy1 = transform.invertY(extent[1][1]) - translateExtent[1][1]; + return transform.translate( + dx1 > dx0 ? (dx0 + dx1) / 2 : Math.min(0, dx0) || Math.max(0, dx1), + dy1 > dy0 ? (dy0 + dy1) / 2 : Math.min(0, dy0) || Math.max(0, dy1) + ); +} + +function zoom() { + var filter = defaultFilter, + extent = defaultExtent, + constrain = defaultConstrain, + wheelDelta = defaultWheelDelta, + touchable = defaultTouchable, + scaleExtent = [0, Infinity], + translateExtent = [[-Infinity, -Infinity], [Infinity, Infinity]], + duration = 250, + interpolate = d3Interpolate.interpolateZoom, + listeners = d3Dispatch.dispatch("start", "zoom", "end"), + touchstarting, + touchfirst, + touchending, + touchDelay = 500, + wheelDelay = 150, + clickDistance2 = 0, + tapDistance = 10; + + function zoom(selection) { + selection + .property("__zoom", defaultTransform) + .on("wheel.zoom", wheeled, {passive: false}) + .on("mousedown.zoom", mousedowned) + .on("dblclick.zoom", dblclicked) + .filter(touchable) + .on("touchstart.zoom", touchstarted) + .on("touchmove.zoom", touchmoved) + .on("touchend.zoom touchcancel.zoom", touchended) + .style("-webkit-tap-highlight-color", "rgba(0,0,0,0)"); + } + + zoom.transform = function(collection, transform, point, event) { + var selection = collection.selection ? collection.selection() : collection; + selection.property("__zoom", defaultTransform); + if (collection !== selection) { + schedule(collection, transform, point, event); + } else { + selection.interrupt().each(function() { + gesture(this, arguments) + .event(event) + .start() + .zoom(null, typeof transform === "function" ? transform.apply(this, arguments) : transform) + .end(); + }); + } + }; + + zoom.scaleBy = function(selection, k, p, event) { + zoom.scaleTo(selection, function() { + var k0 = this.__zoom.k, + k1 = typeof k === "function" ? k.apply(this, arguments) : k; + return k0 * k1; + }, p, event); + }; + + zoom.scaleTo = function(selection, k, p, event) { + zoom.transform(selection, function() { + var e = extent.apply(this, arguments), + t0 = this.__zoom, + p0 = p == null ? centroid(e) : typeof p === "function" ? p.apply(this, arguments) : p, + p1 = t0.invert(p0), + k1 = typeof k === "function" ? k.apply(this, arguments) : k; + return constrain(translate(scale(t0, k1), p0, p1), e, translateExtent); + }, p, event); + }; + + zoom.translateBy = function(selection, x, y, event) { + zoom.transform(selection, function() { + return constrain(this.__zoom.translate( + typeof x === "function" ? x.apply(this, arguments) : x, + typeof y === "function" ? y.apply(this, arguments) : y + ), extent.apply(this, arguments), translateExtent); + }, null, event); + }; + + zoom.translateTo = function(selection, x, y, p, event) { + zoom.transform(selection, function() { + var e = extent.apply(this, arguments), + t = this.__zoom, + p0 = p == null ? centroid(e) : typeof p === "function" ? p.apply(this, arguments) : p; + return constrain(identity.translate(p0[0], p0[1]).scale(t.k).translate( + typeof x === "function" ? -x.apply(this, arguments) : -x, + typeof y === "function" ? -y.apply(this, arguments) : -y + ), e, translateExtent); + }, p, event); + }; + + function scale(transform, k) { + k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], k)); + return k === transform.k ? transform : new Transform(k, transform.x, transform.y); + } + + function translate(transform, p0, p1) { + var x = p0[0] - p1[0] * transform.k, y = p0[1] - p1[1] * transform.k; + return x === transform.x && y === transform.y ? transform : new Transform(transform.k, x, y); + } + + function centroid(extent) { + return [(+extent[0][0] + +extent[1][0]) / 2, (+extent[0][1] + +extent[1][1]) / 2]; + } + + function schedule(transition, transform, point, event) { + transition + .on("start.zoom", function() { gesture(this, arguments).event(event).start(); }) + .on("interrupt.zoom end.zoom", function() { gesture(this, arguments).event(event).end(); }) + .tween("zoom", function() { + var that = this, + args = arguments, + g = gesture(that, args).event(event), + e = extent.apply(that, args), + p = point == null ? centroid(e) : typeof point === "function" ? point.apply(that, args) : point, + w = Math.max(e[1][0] - e[0][0], e[1][1] - e[0][1]), + a = that.__zoom, + b = typeof transform === "function" ? transform.apply(that, args) : transform, + i = interpolate(a.invert(p).concat(w / a.k), b.invert(p).concat(w / b.k)); + return function(t) { + if (t === 1) t = b; // Avoid rounding error on end. + else { var l = i(t), k = w / l[2]; t = new Transform(k, p[0] - l[0] * k, p[1] - l[1] * k); } + g.zoom(null, t); + }; + }); + } + + function gesture(that, args, clean) { + return (!clean && that.__zooming) || new Gesture(that, args); + } + + function Gesture(that, args) { + this.that = that; + this.args = args; + this.active = 0; + this.sourceEvent = null; + this.extent = extent.apply(that, args); + this.taps = 0; + } + + Gesture.prototype = { + event: function(event) { + if (event) this.sourceEvent = event; + return this; + }, + start: function() { + if (++this.active === 1) { + this.that.__zooming = this; + this.emit("start"); + } + return this; + }, + zoom: function(key, transform) { + if (this.mouse && key !== "mouse") this.mouse[1] = transform.invert(this.mouse[0]); + if (this.touch0 && key !== "touch") this.touch0[1] = transform.invert(this.touch0[0]); + if (this.touch1 && key !== "touch") this.touch1[1] = transform.invert(this.touch1[0]); + this.that.__zoom = transform; + this.emit("zoom"); + return this; + }, + end: function() { + if (--this.active === 0) { + delete this.that.__zooming; + this.emit("end"); + } + return this; + }, + emit: function(type) { + var d = d3Selection.select(this.that).datum(); + listeners.call( + type, + this.that, + new ZoomEvent(type, { + sourceEvent: this.sourceEvent, + target: zoom, + type, + transform: this.that.__zoom, + dispatch: listeners + }), + d + ); + } + }; + + function wheeled(event, ...args) { + if (!filter.apply(this, arguments)) return; + var g = gesture(this, args).event(event), + t = this.__zoom, + k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], t.k * Math.pow(2, wheelDelta.apply(this, arguments)))), + p = d3Selection.pointer(event); + + // If the mouse is in the same location as before, reuse it. + // If there were recent wheel events, reset the wheel idle timeout. + if (g.wheel) { + if (g.mouse[0][0] !== p[0] || g.mouse[0][1] !== p[1]) { + g.mouse[1] = t.invert(g.mouse[0] = p); + } + clearTimeout(g.wheel); + } + + // If this wheel event won’t trigger a transform change, ignore it. + else if (t.k === k) return; + + // Otherwise, capture the mouse point and location at the start. + else { + g.mouse = [p, t.invert(p)]; + d3Transition.interrupt(this); + g.start(); + } + + noevent(event); + g.wheel = setTimeout(wheelidled, wheelDelay); + g.zoom("mouse", constrain(translate(scale(t, k), g.mouse[0], g.mouse[1]), g.extent, translateExtent)); + + function wheelidled() { + g.wheel = null; + g.end(); + } + } + + function mousedowned(event, ...args) { + if (touchending || !filter.apply(this, arguments)) return; + var currentTarget = event.currentTarget, + g = gesture(this, args, true).event(event), + v = d3Selection.select(event.view).on("mousemove.zoom", mousemoved, true).on("mouseup.zoom", mouseupped, true), + p = d3Selection.pointer(event, currentTarget), + x0 = event.clientX, + y0 = event.clientY; + + d3Drag.dragDisable(event.view); + nopropagation(event); + g.mouse = [p, this.__zoom.invert(p)]; + d3Transition.interrupt(this); + g.start(); + + function mousemoved(event) { + noevent(event); + if (!g.moved) { + var dx = event.clientX - x0, dy = event.clientY - y0; + g.moved = dx * dx + dy * dy > clickDistance2; + } + g.event(event) + .zoom("mouse", constrain(translate(g.that.__zoom, g.mouse[0] = d3Selection.pointer(event, currentTarget), g.mouse[1]), g.extent, translateExtent)); + } + + function mouseupped(event) { + v.on("mousemove.zoom mouseup.zoom", null); + d3Drag.dragEnable(event.view, g.moved); + noevent(event); + g.event(event).end(); + } + } + + function dblclicked(event, ...args) { + if (!filter.apply(this, arguments)) return; + var t0 = this.__zoom, + p0 = d3Selection.pointer(event.changedTouches ? event.changedTouches[0] : event, this), + p1 = t0.invert(p0), + k1 = t0.k * (event.shiftKey ? 0.5 : 2), + t1 = constrain(translate(scale(t0, k1), p0, p1), extent.apply(this, args), translateExtent); + + noevent(event); + if (duration > 0) d3Selection.select(this).transition().duration(duration).call(schedule, t1, p0, event); + else d3Selection.select(this).call(zoom.transform, t1, p0, event); + } + + function touchstarted(event, ...args) { + if (!filter.apply(this, arguments)) return; + var touches = event.touches, + n = touches.length, + g = gesture(this, args, event.changedTouches.length === n).event(event), + started, i, t, p; + + nopropagation(event); + for (i = 0; i < n; ++i) { + t = touches[i], p = d3Selection.pointer(t, this); + p = [p, this.__zoom.invert(p), t.identifier]; + if (!g.touch0) g.touch0 = p, started = true, g.taps = 1 + !!touchstarting; + else if (!g.touch1 && g.touch0[2] !== p[2]) g.touch1 = p, g.taps = 0; + } + + if (touchstarting) touchstarting = clearTimeout(touchstarting); + + if (started) { + if (g.taps < 2) touchfirst = p[0], touchstarting = setTimeout(function() { touchstarting = null; }, touchDelay); + d3Transition.interrupt(this); + g.start(); + } + } + + function touchmoved(event, ...args) { + if (!this.__zooming) return; + var g = gesture(this, args).event(event), + touches = event.changedTouches, + n = touches.length, i, t, p, l; + + noevent(event); + for (i = 0; i < n; ++i) { + t = touches[i], p = d3Selection.pointer(t, this); + if (g.touch0 && g.touch0[2] === t.identifier) g.touch0[0] = p; + else if (g.touch1 && g.touch1[2] === t.identifier) g.touch1[0] = p; + } + t = g.that.__zoom; + if (g.touch1) { + var p0 = g.touch0[0], l0 = g.touch0[1], + p1 = g.touch1[0], l1 = g.touch1[1], + dp = (dp = p1[0] - p0[0]) * dp + (dp = p1[1] - p0[1]) * dp, + dl = (dl = l1[0] - l0[0]) * dl + (dl = l1[1] - l0[1]) * dl; + t = scale(t, Math.sqrt(dp / dl)); + p = [(p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2]; + l = [(l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2]; + } + else if (g.touch0) p = g.touch0[0], l = g.touch0[1]; + else return; + + g.zoom("touch", constrain(translate(t, p, l), g.extent, translateExtent)); + } + + function touchended(event, ...args) { + if (!this.__zooming) return; + var g = gesture(this, args).event(event), + touches = event.changedTouches, + n = touches.length, i, t; + + nopropagation(event); + if (touchending) clearTimeout(touchending); + touchending = setTimeout(function() { touchending = null; }, touchDelay); + for (i = 0; i < n; ++i) { + t = touches[i]; + if (g.touch0 && g.touch0[2] === t.identifier) delete g.touch0; + else if (g.touch1 && g.touch1[2] === t.identifier) delete g.touch1; + } + if (g.touch1 && !g.touch0) g.touch0 = g.touch1, delete g.touch1; + if (g.touch0) g.touch0[1] = this.__zoom.invert(g.touch0[0]); + else { + g.end(); + // If this was a dbltap, reroute to the (optional) dblclick.zoom handler. + if (g.taps === 2) { + t = d3Selection.pointer(t, this); + if (Math.hypot(touchfirst[0] - t[0], touchfirst[1] - t[1]) < tapDistance) { + var p = d3Selection.select(this).on("dblclick.zoom"); + if (p) p.apply(this, arguments); + } + } + } + } + + zoom.wheelDelta = function(_) { + return arguments.length ? (wheelDelta = typeof _ === "function" ? _ : constant(+_), zoom) : wheelDelta; + }; + + zoom.filter = function(_) { + return arguments.length ? (filter = typeof _ === "function" ? _ : constant(!!_), zoom) : filter; + }; + + zoom.touchable = function(_) { + return arguments.length ? (touchable = typeof _ === "function" ? _ : constant(!!_), zoom) : touchable; + }; + + zoom.extent = function(_) { + return arguments.length ? (extent = typeof _ === "function" ? _ : constant([[+_[0][0], +_[0][1]], [+_[1][0], +_[1][1]]]), zoom) : extent; + }; + + zoom.scaleExtent = function(_) { + return arguments.length ? (scaleExtent[0] = +_[0], scaleExtent[1] = +_[1], zoom) : [scaleExtent[0], scaleExtent[1]]; + }; + + zoom.translateExtent = function(_) { + return arguments.length ? (translateExtent[0][0] = +_[0][0], translateExtent[1][0] = +_[1][0], translateExtent[0][1] = +_[0][1], translateExtent[1][1] = +_[1][1], zoom) : [[translateExtent[0][0], translateExtent[0][1]], [translateExtent[1][0], translateExtent[1][1]]]; + }; + + zoom.constrain = function(_) { + return arguments.length ? (constrain = _, zoom) : constrain; + }; + + zoom.duration = function(_) { + return arguments.length ? (duration = +_, zoom) : duration; + }; + + zoom.interpolate = function(_) { + return arguments.length ? (interpolate = _, zoom) : interpolate; + }; + + zoom.on = function() { + var value = listeners.on.apply(listeners, arguments); + return value === listeners ? zoom : value; + }; + + zoom.clickDistance = function(_) { + return arguments.length ? (clickDistance2 = (_ = +_) * _, zoom) : Math.sqrt(clickDistance2); + }; + + zoom.tapDistance = function(_) { + return arguments.length ? (tapDistance = +_, zoom) : tapDistance; + }; + + return zoom; +} + +exports.ZoomTransform = Transform; +exports.zoom = zoom; +exports.zoomIdentity = identity; +exports.zoomTransform = transform; + +Object.defineProperty(exports, '__esModule', { value: true }); + +}))); diff --git a/node_modules/d3-zoom/dist/d3-zoom.min.js b/node_modules/d3-zoom/dist/d3-zoom.min.js new file mode 100644 index 0000000..974aea1 --- /dev/null +++ b/node_modules/d3-zoom/dist/d3-zoom.min.js @@ -0,0 +1,2 @@ +// https://d3js.org/d3-zoom/ v3.0.0 Copyright 2010-2021 Mike Bostock +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("d3-dispatch"),require("d3-drag"),require("d3-interpolate"),require("d3-selection"),require("d3-transition")):"function"==typeof define&&define.amd?define(["exports","d3-dispatch","d3-drag","d3-interpolate","d3-selection","d3-transition"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).d3=t.d3||{},t.d3,t.d3,t.d3,t.d3,t.d3)}(this,(function(t,e,n,o,i,r){"use strict";var u=t=>()=>t;function s(t,{sourceEvent:e,target:n,transform:o,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:i}})}function h(t,e,n){this.k=t,this.x=e,this.y=n}h.prototype={constructor:h,scale:function(t){return 1===t?this:new h(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new h(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var a=new h(1,0,0);function c(t){for(;!t.__zoom;)if(!(t=t.parentNode))return a;return t.__zoom}function l(t){t.stopImmediatePropagation()}function f(t){t.preventDefault(),t.stopImmediatePropagation()}function p(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function m(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function v(){return this.__zoom||a}function d(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function y(){return navigator.maxTouchPoints||"ontouchstart"in this}function g(t,e,n){var o=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],r=t.invertY(e[0][1])-n[0][1],u=t.invertY(e[1][1])-n[1][1];return t.translate(i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i),u>r?(r+u)/2:Math.min(0,r)||Math.max(0,u))}c.prototype=h.prototype,t.ZoomTransform=h,t.zoom=function(){var t,c,z,_=p,x=m,k=g,w=d,b=y,T=[0,1/0],M=[[-1/0,-1/0],[1/0,1/0]],E=250,Y=o.interpolateZoom,X=e.dispatch("start","zoom","end"),q=500,D=0,P=10;function V(t){t.property("__zoom",v).on("wheel.zoom",O,{passive:!1}).on("mousedown.zoom",Z).on("dblclick.zoom",A).filter(b).on("touchstart.zoom",H).on("touchmove.zoom",N).on("touchend.zoom touchcancel.zoom",W).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function B(t,e){return(e=Math.max(T[0],Math.min(T[1],e)))===t.k?t:new h(e,t.x,t.y)}function j(t,e,n){var o=e[0]-n[0]*t.k,i=e[1]-n[1]*t.k;return o===t.x&&i===t.y?t:new h(t.k,o,i)}function I(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function K(t,e,n,o){t.on("start.zoom",(function(){S(this,arguments).event(o).start()})).on("interrupt.zoom end.zoom",(function(){S(this,arguments).event(o).end()})).tween("zoom",(function(){var t=this,i=arguments,r=S(t,i).event(o),u=x.apply(t,i),s=null==n?I(u):"function"==typeof n?n.apply(t,i):n,a=Math.max(u[1][0]-u[0][0],u[1][1]-u[0][1]),c=t.__zoom,l="function"==typeof e?e.apply(t,i):e,f=Y(c.invert(s).concat(a/c.k),l.invert(s).concat(a/l.k));return function(t){if(1===t)t=l;else{var e=f(t),n=a/e[2];t=new h(n,s[0]-e[0]*n,s[1]-e[1]*n)}r.zoom(null,t)}}))}function S(t,e,n){return!n&&t.__zooming||new G(t,e)}function G(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=x.apply(t,e),this.taps=0}function O(t,...e){if(_.apply(this,arguments)){var n=S(this,e).event(t),o=this.__zoom,u=Math.max(T[0],Math.min(T[1],o.k*Math.pow(2,w.apply(this,arguments)))),s=i.pointer(t);if(n.wheel)n.mouse[0][0]===s[0]&&n.mouse[0][1]===s[1]||(n.mouse[1]=o.invert(n.mouse[0]=s)),clearTimeout(n.wheel);else{if(o.k===u)return;n.mouse=[s,o.invert(s)],r.interrupt(this),n.start()}f(t),n.wheel=setTimeout(h,150),n.zoom("mouse",k(j(B(o,u),n.mouse[0],n.mouse[1]),n.extent,M))}function h(){n.wheel=null,n.end()}}function Z(t,...e){if(!z&&_.apply(this,arguments)){var o=t.currentTarget,u=S(this,e,!0).event(t),s=i.select(t.view).on("mousemove.zoom",p,!0).on("mouseup.zoom",m,!0),h=i.pointer(t,o),a=t.clientX,c=t.clientY;n.dragDisable(t.view),l(t),u.mouse=[h,this.__zoom.invert(h)],r.interrupt(this),u.start()}function p(t){if(f(t),!u.moved){var e=t.clientX-a,n=t.clientY-c;u.moved=e*e+n*n>D}u.event(t).zoom("mouse",k(j(u.that.__zoom,u.mouse[0]=i.pointer(t,o),u.mouse[1]),u.extent,M))}function m(t){s.on("mousemove.zoom mouseup.zoom",null),n.dragEnable(t.view,u.moved),f(t),u.event(t).end()}}function A(t,...e){if(_.apply(this,arguments)){var n=this.__zoom,o=i.pointer(t.changedTouches?t.changedTouches[0]:t,this),r=n.invert(o),u=n.k*(t.shiftKey?.5:2),s=k(j(B(n,u),o,r),x.apply(this,e),M);f(t),E>0?i.select(this).transition().duration(E).call(K,s,o,t):i.select(this).call(V.transform,s,o,t)}}function H(e,...n){if(_.apply(this,arguments)){var o,u,s,h,a=e.touches,f=a.length,p=S(this,n,e.changedTouches.length===f).event(e);for(l(e),u=0;u=12" + } +} diff --git a/node_modules/d3-zoom/src/constant.js b/node_modules/d3-zoom/src/constant.js new file mode 100644 index 0000000..3487c0d --- /dev/null +++ b/node_modules/d3-zoom/src/constant.js @@ -0,0 +1 @@ +export default x => () => x; diff --git a/node_modules/d3-zoom/src/event.js b/node_modules/d3-zoom/src/event.js new file mode 100644 index 0000000..0a28790 --- /dev/null +++ b/node_modules/d3-zoom/src/event.js @@ -0,0 +1,14 @@ +export default function ZoomEvent(type, { + sourceEvent, + target, + transform, + dispatch +}) { + Object.defineProperties(this, { + type: {value: type, enumerable: true, configurable: true}, + sourceEvent: {value: sourceEvent, enumerable: true, configurable: true}, + target: {value: target, enumerable: true, configurable: true}, + transform: {value: transform, enumerable: true, configurable: true}, + _: {value: dispatch} + }); +} diff --git a/node_modules/d3-zoom/src/index.js b/node_modules/d3-zoom/src/index.js new file mode 100644 index 0000000..4a5f278 --- /dev/null +++ b/node_modules/d3-zoom/src/index.js @@ -0,0 +1,2 @@ +export {default as zoom} from "./zoom.js"; +export {default as zoomTransform, identity as zoomIdentity, Transform as ZoomTransform} from "./transform.js"; diff --git a/node_modules/d3-zoom/src/noevent.js b/node_modules/d3-zoom/src/noevent.js new file mode 100644 index 0000000..b32552d --- /dev/null +++ b/node_modules/d3-zoom/src/noevent.js @@ -0,0 +1,8 @@ +export function nopropagation(event) { + event.stopImmediatePropagation(); +} + +export default function(event) { + event.preventDefault(); + event.stopImmediatePropagation(); +} diff --git a/node_modules/d3-zoom/src/transform.js b/node_modules/d3-zoom/src/transform.js new file mode 100644 index 0000000..8e19f1b --- /dev/null +++ b/node_modules/d3-zoom/src/transform.js @@ -0,0 +1,51 @@ +export function Transform(k, x, y) { + this.k = k; + this.x = x; + this.y = y; +} + +Transform.prototype = { + constructor: Transform, + scale: function(k) { + return k === 1 ? this : new Transform(this.k * k, this.x, this.y); + }, + translate: function(x, y) { + return x === 0 & y === 0 ? this : new Transform(this.k, this.x + this.k * x, this.y + this.k * y); + }, + apply: function(point) { + return [point[0] * this.k + this.x, point[1] * this.k + this.y]; + }, + applyX: function(x) { + return x * this.k + this.x; + }, + applyY: function(y) { + return y * this.k + this.y; + }, + invert: function(location) { + return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k]; + }, + invertX: function(x) { + return (x - this.x) / this.k; + }, + invertY: function(y) { + return (y - this.y) / this.k; + }, + rescaleX: function(x) { + return x.copy().domain(x.range().map(this.invertX, this).map(x.invert, x)); + }, + rescaleY: function(y) { + return y.copy().domain(y.range().map(this.invertY, this).map(y.invert, y)); + }, + toString: function() { + return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; + } +}; + +export var identity = new Transform(1, 0, 0); + +transform.prototype = Transform.prototype; + +export default function transform(node) { + while (!node.__zoom) if (!(node = node.parentNode)) return identity; + return node.__zoom; +} diff --git a/node_modules/d3-zoom/src/zoom.js b/node_modules/d3-zoom/src/zoom.js new file mode 100644 index 0000000..d564388 --- /dev/null +++ b/node_modules/d3-zoom/src/zoom.js @@ -0,0 +1,447 @@ +import {dispatch} from "d3-dispatch"; +import {dragDisable, dragEnable} from "d3-drag"; +import {interpolateZoom} from "d3-interpolate"; +import {select, pointer} from "d3-selection"; +import {interrupt} from "d3-transition"; +import constant from "./constant.js"; +import ZoomEvent from "./event.js"; +import {Transform, identity} from "./transform.js"; +import noevent, {nopropagation} from "./noevent.js"; + +// Ignore right-click, since that should open the context menu. +// except for pinch-to-zoom, which is sent as a wheel+ctrlKey event +function defaultFilter(event) { + return (!event.ctrlKey || event.type === 'wheel') && !event.button; +} + +function defaultExtent() { + var e = this; + if (e instanceof SVGElement) { + e = e.ownerSVGElement || e; + if (e.hasAttribute("viewBox")) { + e = e.viewBox.baseVal; + return [[e.x, e.y], [e.x + e.width, e.y + e.height]]; + } + return [[0, 0], [e.width.baseVal.value, e.height.baseVal.value]]; + } + return [[0, 0], [e.clientWidth, e.clientHeight]]; +} + +function defaultTransform() { + return this.__zoom || identity; +} + +function defaultWheelDelta(event) { + return -event.deltaY * (event.deltaMode === 1 ? 0.05 : event.deltaMode ? 1 : 0.002) * (event.ctrlKey ? 10 : 1); +} + +function defaultTouchable() { + return navigator.maxTouchPoints || ("ontouchstart" in this); +} + +function defaultConstrain(transform, extent, translateExtent) { + var dx0 = transform.invertX(extent[0][0]) - translateExtent[0][0], + dx1 = transform.invertX(extent[1][0]) - translateExtent[1][0], + dy0 = transform.invertY(extent[0][1]) - translateExtent[0][1], + dy1 = transform.invertY(extent[1][1]) - translateExtent[1][1]; + return transform.translate( + dx1 > dx0 ? (dx0 + dx1) / 2 : Math.min(0, dx0) || Math.max(0, dx1), + dy1 > dy0 ? (dy0 + dy1) / 2 : Math.min(0, dy0) || Math.max(0, dy1) + ); +} + +export default function() { + var filter = defaultFilter, + extent = defaultExtent, + constrain = defaultConstrain, + wheelDelta = defaultWheelDelta, + touchable = defaultTouchable, + scaleExtent = [0, Infinity], + translateExtent = [[-Infinity, -Infinity], [Infinity, Infinity]], + duration = 250, + interpolate = interpolateZoom, + listeners = dispatch("start", "zoom", "end"), + touchstarting, + touchfirst, + touchending, + touchDelay = 500, + wheelDelay = 150, + clickDistance2 = 0, + tapDistance = 10; + + function zoom(selection) { + selection + .property("__zoom", defaultTransform) + .on("wheel.zoom", wheeled, {passive: false}) + .on("mousedown.zoom", mousedowned) + .on("dblclick.zoom", dblclicked) + .filter(touchable) + .on("touchstart.zoom", touchstarted) + .on("touchmove.zoom", touchmoved) + .on("touchend.zoom touchcancel.zoom", touchended) + .style("-webkit-tap-highlight-color", "rgba(0,0,0,0)"); + } + + zoom.transform = function(collection, transform, point, event) { + var selection = collection.selection ? collection.selection() : collection; + selection.property("__zoom", defaultTransform); + if (collection !== selection) { + schedule(collection, transform, point, event); + } else { + selection.interrupt().each(function() { + gesture(this, arguments) + .event(event) + .start() + .zoom(null, typeof transform === "function" ? transform.apply(this, arguments) : transform) + .end(); + }); + } + }; + + zoom.scaleBy = function(selection, k, p, event) { + zoom.scaleTo(selection, function() { + var k0 = this.__zoom.k, + k1 = typeof k === "function" ? k.apply(this, arguments) : k; + return k0 * k1; + }, p, event); + }; + + zoom.scaleTo = function(selection, k, p, event) { + zoom.transform(selection, function() { + var e = extent.apply(this, arguments), + t0 = this.__zoom, + p0 = p == null ? centroid(e) : typeof p === "function" ? p.apply(this, arguments) : p, + p1 = t0.invert(p0), + k1 = typeof k === "function" ? k.apply(this, arguments) : k; + return constrain(translate(scale(t0, k1), p0, p1), e, translateExtent); + }, p, event); + }; + + zoom.translateBy = function(selection, x, y, event) { + zoom.transform(selection, function() { + return constrain(this.__zoom.translate( + typeof x === "function" ? x.apply(this, arguments) : x, + typeof y === "function" ? y.apply(this, arguments) : y + ), extent.apply(this, arguments), translateExtent); + }, null, event); + }; + + zoom.translateTo = function(selection, x, y, p, event) { + zoom.transform(selection, function() { + var e = extent.apply(this, arguments), + t = this.__zoom, + p0 = p == null ? centroid(e) : typeof p === "function" ? p.apply(this, arguments) : p; + return constrain(identity.translate(p0[0], p0[1]).scale(t.k).translate( + typeof x === "function" ? -x.apply(this, arguments) : -x, + typeof y === "function" ? -y.apply(this, arguments) : -y + ), e, translateExtent); + }, p, event); + }; + + function scale(transform, k) { + k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], k)); + return k === transform.k ? transform : new Transform(k, transform.x, transform.y); + } + + function translate(transform, p0, p1) { + var x = p0[0] - p1[0] * transform.k, y = p0[1] - p1[1] * transform.k; + return x === transform.x && y === transform.y ? transform : new Transform(transform.k, x, y); + } + + function centroid(extent) { + return [(+extent[0][0] + +extent[1][0]) / 2, (+extent[0][1] + +extent[1][1]) / 2]; + } + + function schedule(transition, transform, point, event) { + transition + .on("start.zoom", function() { gesture(this, arguments).event(event).start(); }) + .on("interrupt.zoom end.zoom", function() { gesture(this, arguments).event(event).end(); }) + .tween("zoom", function() { + var that = this, + args = arguments, + g = gesture(that, args).event(event), + e = extent.apply(that, args), + p = point == null ? centroid(e) : typeof point === "function" ? point.apply(that, args) : point, + w = Math.max(e[1][0] - e[0][0], e[1][1] - e[0][1]), + a = that.__zoom, + b = typeof transform === "function" ? transform.apply(that, args) : transform, + i = interpolate(a.invert(p).concat(w / a.k), b.invert(p).concat(w / b.k)); + return function(t) { + if (t === 1) t = b; // Avoid rounding error on end. + else { var l = i(t), k = w / l[2]; t = new Transform(k, p[0] - l[0] * k, p[1] - l[1] * k); } + g.zoom(null, t); + }; + }); + } + + function gesture(that, args, clean) { + return (!clean && that.__zooming) || new Gesture(that, args); + } + + function Gesture(that, args) { + this.that = that; + this.args = args; + this.active = 0; + this.sourceEvent = null; + this.extent = extent.apply(that, args); + this.taps = 0; + } + + Gesture.prototype = { + event: function(event) { + if (event) this.sourceEvent = event; + return this; + }, + start: function() { + if (++this.active === 1) { + this.that.__zooming = this; + this.emit("start"); + } + return this; + }, + zoom: function(key, transform) { + if (this.mouse && key !== "mouse") this.mouse[1] = transform.invert(this.mouse[0]); + if (this.touch0 && key !== "touch") this.touch0[1] = transform.invert(this.touch0[0]); + if (this.touch1 && key !== "touch") this.touch1[1] = transform.invert(this.touch1[0]); + this.that.__zoom = transform; + this.emit("zoom"); + return this; + }, + end: function() { + if (--this.active === 0) { + delete this.that.__zooming; + this.emit("end"); + } + return this; + }, + emit: function(type) { + var d = select(this.that).datum(); + listeners.call( + type, + this.that, + new ZoomEvent(type, { + sourceEvent: this.sourceEvent, + target: zoom, + type, + transform: this.that.__zoom, + dispatch: listeners + }), + d + ); + } + }; + + function wheeled(event, ...args) { + if (!filter.apply(this, arguments)) return; + var g = gesture(this, args).event(event), + t = this.__zoom, + k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], t.k * Math.pow(2, wheelDelta.apply(this, arguments)))), + p = pointer(event); + + // If the mouse is in the same location as before, reuse it. + // If there were recent wheel events, reset the wheel idle timeout. + if (g.wheel) { + if (g.mouse[0][0] !== p[0] || g.mouse[0][1] !== p[1]) { + g.mouse[1] = t.invert(g.mouse[0] = p); + } + clearTimeout(g.wheel); + } + + // If this wheel event won’t trigger a transform change, ignore it. + else if (t.k === k) return; + + // Otherwise, capture the mouse point and location at the start. + else { + g.mouse = [p, t.invert(p)]; + interrupt(this); + g.start(); + } + + noevent(event); + g.wheel = setTimeout(wheelidled, wheelDelay); + g.zoom("mouse", constrain(translate(scale(t, k), g.mouse[0], g.mouse[1]), g.extent, translateExtent)); + + function wheelidled() { + g.wheel = null; + g.end(); + } + } + + function mousedowned(event, ...args) { + if (touchending || !filter.apply(this, arguments)) return; + var currentTarget = event.currentTarget, + g = gesture(this, args, true).event(event), + v = select(event.view).on("mousemove.zoom", mousemoved, true).on("mouseup.zoom", mouseupped, true), + p = pointer(event, currentTarget), + x0 = event.clientX, + y0 = event.clientY; + + dragDisable(event.view); + nopropagation(event); + g.mouse = [p, this.__zoom.invert(p)]; + interrupt(this); + g.start(); + + function mousemoved(event) { + noevent(event); + if (!g.moved) { + var dx = event.clientX - x0, dy = event.clientY - y0; + g.moved = dx * dx + dy * dy > clickDistance2; + } + g.event(event) + .zoom("mouse", constrain(translate(g.that.__zoom, g.mouse[0] = pointer(event, currentTarget), g.mouse[1]), g.extent, translateExtent)); + } + + function mouseupped(event) { + v.on("mousemove.zoom mouseup.zoom", null); + dragEnable(event.view, g.moved); + noevent(event); + g.event(event).end(); + } + } + + function dblclicked(event, ...args) { + if (!filter.apply(this, arguments)) return; + var t0 = this.__zoom, + p0 = pointer(event.changedTouches ? event.changedTouches[0] : event, this), + p1 = t0.invert(p0), + k1 = t0.k * (event.shiftKey ? 0.5 : 2), + t1 = constrain(translate(scale(t0, k1), p0, p1), extent.apply(this, args), translateExtent); + + noevent(event); + if (duration > 0) select(this).transition().duration(duration).call(schedule, t1, p0, event); + else select(this).call(zoom.transform, t1, p0, event); + } + + function touchstarted(event, ...args) { + if (!filter.apply(this, arguments)) return; + var touches = event.touches, + n = touches.length, + g = gesture(this, args, event.changedTouches.length === n).event(event), + started, i, t, p; + + nopropagation(event); + for (i = 0; i < n; ++i) { + t = touches[i], p = pointer(t, this); + p = [p, this.__zoom.invert(p), t.identifier]; + if (!g.touch0) g.touch0 = p, started = true, g.taps = 1 + !!touchstarting; + else if (!g.touch1 && g.touch0[2] !== p[2]) g.touch1 = p, g.taps = 0; + } + + if (touchstarting) touchstarting = clearTimeout(touchstarting); + + if (started) { + if (g.taps < 2) touchfirst = p[0], touchstarting = setTimeout(function() { touchstarting = null; }, touchDelay); + interrupt(this); + g.start(); + } + } + + function touchmoved(event, ...args) { + if (!this.__zooming) return; + var g = gesture(this, args).event(event), + touches = event.changedTouches, + n = touches.length, i, t, p, l; + + noevent(event); + for (i = 0; i < n; ++i) { + t = touches[i], p = pointer(t, this); + if (g.touch0 && g.touch0[2] === t.identifier) g.touch0[0] = p; + else if (g.touch1 && g.touch1[2] === t.identifier) g.touch1[0] = p; + } + t = g.that.__zoom; + if (g.touch1) { + var p0 = g.touch0[0], l0 = g.touch0[1], + p1 = g.touch1[0], l1 = g.touch1[1], + dp = (dp = p1[0] - p0[0]) * dp + (dp = p1[1] - p0[1]) * dp, + dl = (dl = l1[0] - l0[0]) * dl + (dl = l1[1] - l0[1]) * dl; + t = scale(t, Math.sqrt(dp / dl)); + p = [(p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2]; + l = [(l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2]; + } + else if (g.touch0) p = g.touch0[0], l = g.touch0[1]; + else return; + + g.zoom("touch", constrain(translate(t, p, l), g.extent, translateExtent)); + } + + function touchended(event, ...args) { + if (!this.__zooming) return; + var g = gesture(this, args).event(event), + touches = event.changedTouches, + n = touches.length, i, t; + + nopropagation(event); + if (touchending) clearTimeout(touchending); + touchending = setTimeout(function() { touchending = null; }, touchDelay); + for (i = 0; i < n; ++i) { + t = touches[i]; + if (g.touch0 && g.touch0[2] === t.identifier) delete g.touch0; + else if (g.touch1 && g.touch1[2] === t.identifier) delete g.touch1; + } + if (g.touch1 && !g.touch0) g.touch0 = g.touch1, delete g.touch1; + if (g.touch0) g.touch0[1] = this.__zoom.invert(g.touch0[0]); + else { + g.end(); + // If this was a dbltap, reroute to the (optional) dblclick.zoom handler. + if (g.taps === 2) { + t = pointer(t, this); + if (Math.hypot(touchfirst[0] - t[0], touchfirst[1] - t[1]) < tapDistance) { + var p = select(this).on("dblclick.zoom"); + if (p) p.apply(this, arguments); + } + } + } + } + + zoom.wheelDelta = function(_) { + return arguments.length ? (wheelDelta = typeof _ === "function" ? _ : constant(+_), zoom) : wheelDelta; + }; + + zoom.filter = function(_) { + return arguments.length ? (filter = typeof _ === "function" ? _ : constant(!!_), zoom) : filter; + }; + + zoom.touchable = function(_) { + return arguments.length ? (touchable = typeof _ === "function" ? _ : constant(!!_), zoom) : touchable; + }; + + zoom.extent = function(_) { + return arguments.length ? (extent = typeof _ === "function" ? _ : constant([[+_[0][0], +_[0][1]], [+_[1][0], +_[1][1]]]), zoom) : extent; + }; + + zoom.scaleExtent = function(_) { + return arguments.length ? (scaleExtent[0] = +_[0], scaleExtent[1] = +_[1], zoom) : [scaleExtent[0], scaleExtent[1]]; + }; + + zoom.translateExtent = function(_) { + return arguments.length ? (translateExtent[0][0] = +_[0][0], translateExtent[1][0] = +_[1][0], translateExtent[0][1] = +_[0][1], translateExtent[1][1] = +_[1][1], zoom) : [[translateExtent[0][0], translateExtent[0][1]], [translateExtent[1][0], translateExtent[1][1]]]; + }; + + zoom.constrain = function(_) { + return arguments.length ? (constrain = _, zoom) : constrain; + }; + + zoom.duration = function(_) { + return arguments.length ? (duration = +_, zoom) : duration; + }; + + zoom.interpolate = function(_) { + return arguments.length ? (interpolate = _, zoom) : interpolate; + }; + + zoom.on = function() { + var value = listeners.on.apply(listeners, arguments); + return value === listeners ? zoom : value; + }; + + zoom.clickDistance = function(_) { + return arguments.length ? (clickDistance2 = (_ = +_) * _, zoom) : Math.sqrt(clickDistance2); + }; + + zoom.tapDistance = function(_) { + return arguments.length ? (tapDistance = +_, zoom) : tapDistance; + }; + + return zoom; +} diff --git a/node_modules/i/.github/dependabot.yml b/node_modules/i/.github/dependabot.yml new file mode 100644 index 0000000..9dcd158 --- /dev/null +++ b/node_modules/i/.github/dependabot.yml @@ -0,0 +1,8 @@ +version: 2 +updates: +- package-ecosystem: npm + directory: "/" + schedule: + interval: daily + time: "04:00" + open-pull-requests-limit: 10 diff --git a/node_modules/i/.github/workflows/ci.yml b/node_modules/i/.github/workflows/ci.yml new file mode 100644 index 0000000..0c3b3a5 --- /dev/null +++ b/node_modules/i/.github/workflows/ci.yml @@ -0,0 +1,26 @@ +name: CI +on: + push: + branches: [master] + pull_request: + branches: [master] + types: [opened, reopened, synchronize] +jobs: + test: + name: Tests + strategy: + fail-fast: true + matrix: + node: [4, 6, 8, 10, 12, 14] + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Install Node.js + uses: actions/setup-node@v2-beta + with: + node-version: ${{ matrix.node }} + - name: Install dependencies + run: npm install + - name: Test + run: npm test diff --git a/node_modules/i/LICENSE b/node_modules/i/LICENSE new file mode 100644 index 0000000..ad36af3 --- /dev/null +++ b/node_modules/i/LICENSE @@ -0,0 +1,20 @@ +Copyright (C) 2020 Pavan Kumar Sunkara + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/i/README.md b/node_modules/i/README.md new file mode 100644 index 0000000..23f4c22 --- /dev/null +++ b/node_modules/i/README.md @@ -0,0 +1,176 @@ +# inflect + +customizable inflections for nodejs + +**NOTE: 0.3.2 was accidentally unpublished from the server and npm doesn't allow me to publish it back. Please upgrade to 0.3.3** + +## Installation + +```bash +npm install i +``` + +## Usage + +Require the module before using + +```js +var inflect = require('i')(); +``` + +All the below api functions can be called directly on a string + +```js +inflect.titleize('messages to store') // === 'Messages To Store' +'messages to store'.titleize // === 'Messages To Store' +``` + +only if `true` is passed while initiating + +```js +var inflect = require('i')(true); +``` + +### Pluralize + +```js +inflect.pluralize('person'); // === 'people' +inflect.pluralize('octopus'); // === 'octopi' +inflect.pluralize('Hat'); // === 'Hats' +``` + +### Singularize + +```js +inflect.singularize('people'); // === 'person' +inflect.singularize('octopi'); // === 'octopus' +inflect.singularize('Hats'); // === 'Hat' +``` + +### Camelize + +```js +inflect.camelize('message_properties'); // === 'MessageProperties' +inflect.camelize('message_properties', false); // === 'messageProperties' +``` + +### Underscore + +```js +inflect.underscore('MessageProperties'); // === 'message_properties' +inflect.underscore('messageProperties'); // === 'message_properties' +``` + +### Humanize + +```js +inflect.humanize('message_id'); // === 'Message' +``` + +### Dasherize + +```js +inflect.dasherize('message_properties'); // === 'message-properties' +inflect.dasherize('Message Properties'); // === 'Message Properties' +``` + +### Titleize + +```js +inflect.titleize('message_properties'); // === 'Message Properties' +inflect.titleize('message properties to keep'); // === 'Message Properties to Keep' +``` + +### Demodulize + +```js +inflect.demodulize('Message.Bus.Properties'); // === 'Properties' +``` + +### Tableize + +```js +inflect.tableize('MessageBusProperty'); // === 'message_bus_properties' +``` + +### Classify + +```js +inflect.classify('message_bus_properties'); // === 'MessageBusProperty' +``` + +### Foreign key + +```js +inflect.foreign_key('MessageBusProperty'); // === 'message_bus_property_id' +inflect.foreign_key('MessageBusProperty', false); // === 'message_bus_propertyid' +``` + +### Ordinalize + +```js +inflect.ordinalize( '1' ); // === '1st' +``` + +## Custom rules for inflection + +### Custom plural + +We can use regexp in any of these custom rules + +```js +inflect.inflections.plural('person', 'guys'); +inflect.pluralize('person'); // === 'guys' +inflect.singularize('guys'); // === 'guy' +``` + +### Custom singular + +```js +inflect.inflections.singular('guys', 'person') +inflect.singularize('guys'); // === 'person' +inflect.pluralize('person'); // === 'people' +``` + +### Custom irregular + +```js +inflect.inflections.irregular('person', 'guys') +inflect.pluralize('person'); // === 'guys' +inflect.singularize('guys'); // === 'person' +``` + +### Custom human + +```js +inflect.inflections.human(/^(.*)_cnt$/i, '$1_count'); +inflect.humanize('jargon_cnt'); // === 'Jargon count' +``` + +### Custom uncountable + +```js +inflect.inflections.uncountable('oil') +inflect.pluralize('oil'); // === 'oil' +inflect.singularize('oil'); // === 'oil' +``` + +## Contributors +Here is a list of [Contributors](http://github.com/pksunkara/inflect/contributors) + +### TODO + +- More obscure test cases + +__I accept pull requests and guarantee a reply back within a day__ + +## License +MIT/X11 + +## Bug Reports +Report [here](http://github.com/pksunkara/inflect/issues). __Guaranteed reply within a day__. + +## Contact +Pavan Kumar Sunkara (pavan.sss1991@gmail.com) + +Follow me on [github](https://github.com/users/follow?target=pksunkara), [twitter](http://twitter.com/pksunkara) diff --git a/node_modules/i/lib/defaults.js b/node_modules/i/lib/defaults.js new file mode 100644 index 0000000..859d464 --- /dev/null +++ b/node_modules/i/lib/defaults.js @@ -0,0 +1,78 @@ +// Default inflections +module.exports = function (inflect) { + inflect.plural(/$/, 's'); + inflect.plural(/s$/i, 's'); + inflect.plural(/(ax|test)is$/i, '$1es'); + inflect.plural(/(octop|vir)us$/i, '$1i'); + inflect.plural(/(octop|vir)i$/i, '$1i'); + inflect.plural(/(alias|status)$/i, '$1es'); + inflect.plural(/(bu)s$/i, '$1ses'); + inflect.plural(/(buffal|tomat)o$/i, '$1oes'); + inflect.plural(/([ti])um$/i, '$1a'); + inflect.plural(/([ti])a$/i, '$1a'); + inflect.plural(/sis$/i, 'ses'); + inflect.plural(/(?:([^fa])fe|(?:(oa)f)|([lr])f)$/i, '$1ves'); + inflect.plural(/(hive)$/i, '$1s'); + inflect.plural(/([^aeiouy]|qu)y$/i, '$1ies'); + inflect.plural(/(x|ch|ss|sh)$/i, '$1es'); + inflect.plural(/(matr|vert|ind)(?:ix|ex)$/i, '$1ices'); + inflect.plural(/([m|l])ouse$/i, '$1ice'); + inflect.plural(/([m|l])ice$/i, '$1ice'); + inflect.plural(/^(ox)$/i, '$1en'); + inflect.plural(/^(oxen)$/i, '$1'); + inflect.plural(/(quiz)$/i, '$1zes'); + + inflect.singular(/s$/i, ''); + inflect.singular(/(n)ews$/i, '$1ews'); + inflect.singular(/([ti])a$/i, '$1um'); + inflect.singular(/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i, '$1sis'); + inflect.singular(/(^analy)ses$/i, '$1sis'); + inflect.singular(/([^f])ves$/i, '$1fe'); + inflect.singular(/(hive)s$/i, '$1'); + inflect.singular(/(tive)s$/i, '$1'); + inflect.singular(/(oave)s$/i, 'oaf'); + inflect.singular(/([lr])ves$/i, '$1f'); + inflect.singular(/([^aeiouy]|qu)ies$/i, '$1y'); + inflect.singular(/(s)eries$/i, '$1eries'); + inflect.singular(/(m)ovies$/i, '$1ovie'); + inflect.singular(/(x|ch|ss|sh)es$/i, '$1'); + inflect.singular(/([m|l])ice$/i, '$1ouse'); + inflect.singular(/(bus)es$/i, '$1'); + inflect.singular(/(o)es$/i, '$1'); + inflect.singular(/(shoe)s$/i, '$1'); + inflect.singular(/(cris|ax|test)es$/i, '$1is'); + inflect.singular(/(octop|vir)i$/i, '$1us'); + inflect.singular(/(alias|status)es$/i, '$1'); + inflect.singular(/^(ox)en/i, '$1'); + inflect.singular(/(vert|ind)ices$/i, '$1ex'); + inflect.singular(/(matr)ices$/i, '$1ix'); + inflect.singular(/(quiz)zes$/i, '$1'); + inflect.singular(/(database)s$/i, '$1'); + + inflect.irregular('child', 'children'); + inflect.irregular('person', 'people'); + inflect.irregular('man', 'men'); + inflect.irregular('child', 'children'); + inflect.irregular('sex', 'sexes'); + inflect.irregular('move', 'moves'); + inflect.irregular('cow', 'kine'); + inflect.irregular('zombie', 'zombies'); + inflect.irregular('oaf', 'oafs', true); + inflect.irregular('jefe', 'jefes'); + inflect.irregular('save', 'saves'); + inflect.irregular('safe', 'safes'); + inflect.irregular('fife', 'fifes'); + + inflect.uncountable([ + 'equipment', + 'information', + 'rice', + 'money', + 'species', + 'series', + 'fish', + 'sheep', + 'jeans', + 'sushi', + ]); +}; diff --git a/node_modules/i/lib/inflect.js b/node_modules/i/lib/inflect.js new file mode 100644 index 0000000..ea5c230 --- /dev/null +++ b/node_modules/i/lib/inflect.js @@ -0,0 +1,11 @@ +// Requiring modules + +module.exports = function (attach) { + var methods = require('./methods'); + + if (attach) { + require('./native')(methods); + } + + return methods; +}; diff --git a/node_modules/i/lib/inflections.js b/node_modules/i/lib/inflections.js new file mode 100644 index 0000000..cde19c6 --- /dev/null +++ b/node_modules/i/lib/inflections.js @@ -0,0 +1,138 @@ +// A singleton instance of this class is yielded by Inflector.inflections, which can then be used to specify additional +// inflection rules. Examples: +// +// BulletSupport.Inflector.inflect ($) -> +// $.plural /^(ox)$/i, '$1en' +// $.singular /^(ox)en/i, '$1' +// +// $.irregular 'octopus', 'octopi' +// +// $.uncountable "equipment" +// +// New rules are added at the top. So in the example above, the irregular rule for octopus will now be the first of the +// pluralization and singularization rules that is runs. This guarantees that your rules run before any of the rules that may +// already have been loaded. + +var util = require('./util'); + +var Inflections = function () { + this.plurals = []; + this.singulars = []; + this.uncountables = []; + this.humans = []; + require('./defaults')(this); + return this; +}; + +// Specifies a new pluralization rule and its replacement. The rule can either be a string or a regular expression. +// The replacement should always be a string that may include references to the matched data from the rule. +Inflections.prototype.plural = function (rule, replacement) { + if (typeof rule == 'string') { + this.uncountables = util.array.del(this.uncountables, rule); + } + this.uncountables = util.array.del(this.uncountables, replacement); + this.plurals.unshift([rule, replacement]); +}; + +// Specifies a new singularization rule and its replacement. The rule can either be a string or a regular expression. +// The replacement should always be a string that may include references to the matched data from the rule. +Inflections.prototype.singular = function (rule, replacement) { + if (typeof rule == 'string') { + this.uncountables = util.array.del(this.uncountables, rule); + } + this.uncountables = util.array.del(this.uncountables, replacement); + this.singulars.unshift([rule, replacement]); +}; + +// Specifies a new irregular that applies to both pluralization and singularization at the same time. This can only be used +// for strings, not regular expressions. You simply pass the irregular in singular and plural form. +// +// irregular 'octopus', 'octopi' +// irregular 'person', 'people' +Inflections.prototype.irregular = function (singular, plural, fullMatchRequired) { + this.uncountables = util.array.del(this.uncountables, singular); + this.uncountables = util.array.del(this.uncountables, plural); + var prefix = ''; + if (fullMatchRequired) { + prefix = '^'; + } + if (singular[0].toUpperCase() == plural[0].toUpperCase()) { + this.plural(new RegExp('(' + prefix + singular[0] + ')' + singular.slice(1) + '$', 'i'), '$1' + plural.slice(1)); + this.plural(new RegExp('(' + prefix + plural[0] + ')' + plural.slice(1) + '$', 'i'), '$1' + plural.slice(1)); + this.singular(new RegExp('(' + prefix + plural[0] + ')' + plural.slice(1) + '$', 'i'), '$1' + singular.slice(1)); + } else { + this.plural( + new RegExp(prefix + singular[0].toUpperCase() + singular.slice(1) + '$'), + plural[0].toUpperCase() + plural.slice(1) + ); + this.plural( + new RegExp(prefix + singular[0].toLowerCase() + singular.slice(1) + '$'), + plural[0].toLowerCase() + plural.slice(1) + ); + this.plural( + new RegExp(prefix + plural[0].toUpperCase() + plural.slice(1) + '$'), + plural[0].toUpperCase() + plural.slice(1) + ); + this.plural( + new RegExp(prefix + plural[0].toLowerCase() + plural.slice(1) + '$'), + plural[0].toLowerCase() + plural.slice(1) + ); + this.singular( + new RegExp(prefix + plural[0].toUpperCase() + plural.slice(1) + '$'), + singular[0].toUpperCase() + singular.slice(1) + ); + this.singular( + new RegExp(prefix + plural[0].toLowerCase() + plural.slice(1) + '$'), + singular[0].toLowerCase() + singular.slice(1) + ); + } +}; + +// Specifies a humanized form of a string by a regular expression rule or by a string mapping. +// When using a regular expression based replacement, the normal humanize formatting is called after the replacement. +// When a string is used, the human form should be specified as desired (example: 'The name', not 'the_name') +// +// human /(.*)_cnt$/i, '$1_count' +// human "legacy_col_person_name", "Name" +Inflections.prototype.human = function (rule, replacement) { + this.humans.unshift([rule, replacement]); +}; + +// Add uncountable words that shouldn't be attempted inflected. +// +// uncountable "money" +// uncountable ["money", "information"] +Inflections.prototype.uncountable = function (words) { + this.uncountables = this.uncountables.concat(words); +}; + +// Clears the loaded inflections within a given scope (default is _'all'_). +// Give the scope as a symbol of the inflection type, the options are: _'plurals'_, +// _'singulars'_, _'uncountables'_, _'humans'_. +// +// clear 'all' +// clear 'plurals' +Inflections.prototype.clear = function (scope) { + if (scope == null) scope = 'all'; + switch (scope) { + case 'all': + this.plurals = []; + this.singulars = []; + this.uncountables = []; + this.humans = []; + default: + this[scope] = []; + } +}; + +// Clears the loaded inflections and initializes them to [default](../inflections.html) +Inflections.prototype.default = function () { + this.plurals = []; + this.singulars = []; + this.uncountables = []; + this.humans = []; + require('./defaults')(this); + return this; +}; + +module.exports = new Inflections(); diff --git a/node_modules/i/lib/methods.js b/node_modules/i/lib/methods.js new file mode 100644 index 0000000..450e63f --- /dev/null +++ b/node_modules/i/lib/methods.js @@ -0,0 +1,234 @@ +// The Inflector transforms words from singular to plural, class names to table names, modularized class names to ones without, +// and class names to foreign keys. The default inflections for pluralization, singularization, and uncountable words are kept +// in inflections.coffee +// +// If you discover an incorrect inflection and require it for your application, you'll need +// to correct it yourself (explained below). + +var util = require('./util'); + +var inflect = module.exports; + +// Import [inflections](inflections.html) instance +inflect.inflections = require('./inflections'); + +// Gives easy access to add inflections to this class +inflect.inflect = function (fn) { + fn(inflect.inflections); +}; + +// By default, _camelize_ converts strings to UpperCamelCase. If the argument to _camelize_ +// is set to _false_ then _camelize_ produces lowerCamelCase. +// +// _camelize_ will also convert '/' to '.' which is useful for converting paths to namespaces. +// +// "bullet_record".camelize() // => "BulletRecord" +// "bullet_record".camelize(false) // => "bulletRecord" +// "bullet_record/errors".camelize() // => "BulletRecord.Errors" +// "bullet_record/errors".camelize(false) // => "bulletRecord.Errors" +// +// As a rule of thumb you can think of _camelize_ as the inverse of _underscore_, +// though there are cases where that does not hold: +// +// "SSLError".underscore.camelize // => "SslError" +inflect.camelize = function (lower_case_and_underscored_word, first_letter_in_uppercase) { + var result; + if (first_letter_in_uppercase == null) first_letter_in_uppercase = true; + result = util.string.gsub(lower_case_and_underscored_word, /\/(.?)/, function ($) { + return '.' + util.string.upcase($[1]); + }); + result = util.string.gsub(result, /(?:_)(.)/, function ($) { + return util.string.upcase($[1]); + }); + if (first_letter_in_uppercase) { + return util.string.upcase(result); + } else { + return util.string.downcase(result); + } +}; + +// Makes an underscored, lowercase form from the expression in the string. +// +// Changes '.' to '/' to convert namespaces to paths. +// +// "BulletRecord".underscore() // => "bullet_record" +// "BulletRecord.Errors".underscore() // => "bullet_record/errors" +// +// As a rule of thumb you can think of +underscore+ as the inverse of +camelize+, +// though there are cases where that does not hold: +// +// "SSLError".underscore().camelize() // => "SslError" +inflect.underscore = function (camel_cased_word) { + var self; + self = util.string.gsub(camel_cased_word, /\./, '/'); + self = util.string.gsub(self, /([A-Z])([A-Z][a-z])/, '$1_$2'); + self = util.string.gsub(self, /([a-z\d])([A-Z])/, '$1_$2'); + self = util.string.gsub(self, /-/, '_'); + return self.toLowerCase(); +}; + +// Replaces underscores with dashes in the string. +// +// "puni_puni".dasherize() // => "puni-puni" +inflect.dasherize = function (underscored_word) { + return util.string.gsub(underscored_word, /_/, '-'); +}; + +// Removes the module part from the expression in the string. +// +// "BulletRecord.String.Inflections".demodulize() // => "Inflections" +// "Inflections".demodulize() // => "Inflections" +inflect.demodulize = function (class_name_in_module) { + return util.string.gsub(class_name_in_module, /^.*\./, ''); +}; + +// Creates a foreign key name from a class name. +// _separate_class_name_and_id_with_underscore_ sets whether +// the method should put '_' between the name and 'id'. +// +// "Message".foreign_key() // => "message_id" +// "Message".foreign_key(false) // => "messageid" +// "Admin::Post".foreign_key() // => "post_id" +inflect.foreign_key = function (class_name, separate_class_name_and_id_with_underscore) { + if (separate_class_name_and_id_with_underscore == null) { + separate_class_name_and_id_with_underscore = true; + } + return ( + inflect.underscore(inflect.demodulize(class_name)) + (separate_class_name_and_id_with_underscore ? '_id' : 'id') + ); +}; + +// Turns a number into an ordinal string used to denote the position in an +// ordered sequence such as 1st, 2nd, 3rd, 4th. +// +// ordinalize(1) // => "1st" +// ordinalize(2) // => "2nd" +// ordinalize(1002) // => "1002nd" +// ordinalize(1003) // => "1003rd" +// ordinalize(-11) // => "-11th" +// ordinalize(-1021) // => "-1021st" +inflect.ordinalize = function (number) { + var _ref; + number = parseInt(number); + if ((_ref = Math.abs(number) % 100) === 11 || _ref === 12 || _ref === 13) { + return '' + number + 'th'; + } else { + switch (Math.abs(number) % 10) { + case 1: + return '' + number + 'st'; + case 2: + return '' + number + 'nd'; + case 3: + return '' + number + 'rd'; + default: + return '' + number + 'th'; + } + } +}; + +// Checks a given word for uncountability +// +// "money".uncountability() // => true +// "my money".uncountability() // => true +inflect.uncountability = function (word) { + return inflect.inflections.uncountables.some(function (ele, ind, arr) { + return word.match(new RegExp('(\\b|_)' + ele + '$', 'i')) != null; + }); +}; + +// Returns the plural form of the word in the string. +// +// "post".pluralize() // => "posts" +// "octopus".pluralize() // => "octopi" +// "sheep".pluralize() // => "sheep" +// "words".pluralize() // => "words" +// "CamelOctopus".pluralize() // => "CamelOctopi" +inflect.pluralize = function (word) { + var plural, result; + result = word; + if (word === '' || inflect.uncountability(word)) { + return result; + } else { + for (var i = 0; i < inflect.inflections.plurals.length; i++) { + plural = inflect.inflections.plurals[i]; + result = util.string.gsub(result, plural[0], plural[1]); + if (word.match(plural[0]) != null) break; + } + return result; + } +}; + +// The reverse of _pluralize_, returns the singular form of a word in a string. +// +// "posts".singularize() // => "post" +// "octopi".singularize() // => "octopus" +// "sheep".singularize() // => "sheep" +// "word".singularize() // => "word" +// "CamelOctopi".singularize() // => "CamelOctopus" +inflect.singularize = function (word) { + var result, singular; + result = word; + if (word === '' || inflect.uncountability(word)) { + return result; + } else { + for (var i = 0; i < inflect.inflections.singulars.length; i++) { + singular = inflect.inflections.singulars[i]; + result = util.string.gsub(result, singular[0], singular[1]); + if (word.match(singular[0])) break; + } + return result; + } +}; + +// Capitalizes the first word and turns underscores into spaces and strips a +// trailing "_id", if any. Like _titleize_, this is meant for creating pretty output. +// +// "employee_salary".humanize() // => "Employee salary" +// "author_id".humanize() // => "Author" +inflect.humanize = function (lower_case_and_underscored_word) { + var human, result; + result = lower_case_and_underscored_word; + for (var i = 0; i < inflect.inflections.humans.length; i++) { + human = inflect.inflections.humans[i]; + result = util.string.gsub(result, human[0], human[1]); + } + result = util.string.gsub(result, /_id$/, ''); + result = util.string.gsub(result, /_/, ' '); + return util.string.capitalize(result, true); +}; + +// Capitalizes all the words and replaces some characters in the string to create +// a nicer looking title. _titleize_ is meant for creating pretty output. It is not +// used in the Bullet internals. +// +// +// "man from the boondocks".titleize() // => "Man From The Boondocks" +// "x-men: the last stand".titleize() // => "X Men: The Last Stand" +inflect.titleize = function (word) { + var self; + self = inflect.humanize(inflect.underscore(word)); + return util.string.capitalize(self); +}; + +// Create the name of a table like Bullet does for models to table names. This method +// uses the _pluralize_ method on the last word in the string. +// +// "RawScaledScorer".tableize() // => "raw_scaled_scorers" +// "egg_and_ham".tableize() // => "egg_and_hams" +// "fancyCategory".tableize() // => "fancy_categories" +inflect.tableize = function (class_name) { + return inflect.pluralize(inflect.underscore(class_name)); +}; + +// Create a class name from a plural table name like Bullet does for table names to models. +// Note that this returns a string and not a Class. +// +// "egg_and_hams".classify() // => "EggAndHam" +// "posts".classify() // => "Post" +// +// Singular names are not handled correctly: +// +// "business".classify() // => "Busines" +inflect.classify = function (table_name) { + return inflect.camelize(inflect.singularize(util.string.gsub(table_name, /^.*\./, ''))); +}; diff --git a/node_modules/i/lib/native.js b/node_modules/i/lib/native.js new file mode 100644 index 0000000..3c944c7 --- /dev/null +++ b/node_modules/i/lib/native.js @@ -0,0 +1,51 @@ +module.exports = function (obj) { + var addProperty = function (method, func) { + String.prototype.__defineGetter__(method, func); + }; + + var stringPrototypeBlacklist = [ + '__defineGetter__', + '__defineSetter__', + '__lookupGetter__', + '__lookupSetter__', + 'charAt', + 'constructor', + 'hasOwnProperty', + 'isPrototypeOf', + 'propertyIsEnumerable', + 'toLocaleString', + 'toString', + 'valueOf', + 'charCodeAt', + 'indexOf', + 'lastIndexof', + 'length', + 'localeCompare', + 'match', + 'replace', + 'search', + 'slice', + 'split', + 'substring', + 'toLocaleLowerCase', + 'toLocaleUpperCase', + 'toLowerCase', + 'toUpperCase', + 'trim', + 'trimLeft', + 'trimRight', + 'gsub', + ]; + + Object.keys(obj).forEach(function (key) { + if (key != 'inflect' && key != 'inflections') { + if (stringPrototypeBlacklist.indexOf(key) !== -1) { + console.log('warn: You should not override String.prototype.' + key); + } else { + addProperty(key, function () { + return obj[key](this); + }); + } + } + }); +}; diff --git a/node_modules/i/lib/util.js b/node_modules/i/lib/util.js new file mode 100644 index 0000000..183ae6e --- /dev/null +++ b/node_modules/i/lib/util.js @@ -0,0 +1,147 @@ +// Some utility functions in js + +var u = (module.exports = { + array: { + // Returns a copy of the array with the value removed once + // + // [1, 2, 3, 1].del 1 #=> [2, 3, 1] + // [1, 2, 3].del 4 #=> [1, 2, 3] + del: function (arr, val) { + var index = arr.indexOf(val); + + if (index != -1) { + if (index == 0) { + return arr.slice(1); + } else { + return arr.slice(0, index).concat(arr.slice(index + 1)); + } + } else { + return arr; + } + }, + + // Returns the first element of the array + // + // [1, 2, 3].first() #=> 1 + first: function (arr) { + return arr[0]; + }, + + // Returns the last element of the array + // + // [1, 2, 3].last() #=> 3 + last: function (arr) { + return arr[arr.length - 1]; + }, + }, + string: { + // Returns a copy of str with all occurrences of pattern replaced with either replacement or the return value of a function. + // The pattern will typically be a Regexp; if it is a String then no regular expression metacharacters will be interpreted + // (that is /\d/ will match a digit, but ‘\d’ will match a backslash followed by a ‘d’). + // + // In the function form, the current match object is passed in as a parameter to the function, and variables such as + // $[1], $[2], $[3] (where $ is the match object) will be set appropriately. The value returned by the function will be + // substituted for the match on each call. + // + // The result inherits any tainting in the original string or any supplied replacement string. + // + // "hello".gsub /[aeiou]/, '*' #=> "h*ll*" + // "hello".gsub /[aeiou]/, '<$1>' #=> "hll" + // "hello".gsub /[aeiou]/, ($) { + // "<#{$[1]}>" #=> "hll" + // + gsub: function (str, pattern, replacement) { + var i, match, matchCmpr, matchCmprPrev, replacementStr, result, self; + if (!(pattern != null && replacement != null)) return u.string.value(str); + result = ''; + self = str; + while (self.length > 0) { + if ((match = self.match(pattern))) { + result += self.slice(0, match.index); + if (typeof replacement === 'function') { + match[1] = match[1] || match[0]; + result += replacement(match); + } else if (replacement.match(/\$[1-9]/)) { + matchCmprPrev = match; + matchCmpr = u.array.del(match, void 0); + while (matchCmpr !== matchCmprPrev) { + matchCmprPrev = matchCmpr; + matchCmpr = u.array.del(matchCmpr, void 0); + } + match[1] = match[1] || match[0]; + replacementStr = replacement; + for (i = 1; i <= 9; i++) { + if (matchCmpr[i]) { + replacementStr = u.string.gsub(replacementStr, new RegExp('\\$' + i), matchCmpr[i]); + } + } + result += replacementStr; + } else { + result += replacement; + } + self = self.slice(match.index + match[0].length); + } else { + result += self; + self = ''; + } + } + return result; + }, + + // Returns a copy of the String with the first letter being upper case + // + // "hello".upcase #=> "Hello" + upcase: function (str) { + var self = u.string.gsub(str, /_([a-z])/, function ($) { + return '_' + $[1].toUpperCase(); + }); + + self = u.string.gsub(self, /\/([a-z])/, function ($) { + return '/' + $[1].toUpperCase(); + }); + + return self[0].toUpperCase() + self.substr(1); + }, + + // Returns a copy of capitalized string + // + // "employee salary" #=> "Employee Salary" + capitalize: function (str, spaces) { + if (!str.length) { + return str; + } + + var self = str.toLowerCase(); + + if (!spaces) { + self = u.string.gsub(self, /\s([a-z])/, function ($) { + return ' ' + $[1].toUpperCase(); + }); + } + + return self[0].toUpperCase() + self.substr(1); + }, + + // Returns a copy of the String with the first letter being lower case + // + // "HELLO".downcase #=> "hELLO" + downcase: function (str) { + var self = u.string.gsub(str, /_([A-Z])/, function ($) { + return '_' + $[1].toLowerCase(); + }); + + self = u.string.gsub(self, /\/([A-Z])/, function ($) { + return '/' + $[1].toLowerCase(); + }); + + return self[0].toLowerCase() + self.substr(1); + }, + + // Returns a string value for the String object + // + // "hello".value() #=> "hello" + value: function (str) { + return str.substr(0); + }, + }, +}); diff --git a/node_modules/i/package.json b/node_modules/i/package.json new file mode 100644 index 0000000..0c27c7b --- /dev/null +++ b/node_modules/i/package.json @@ -0,0 +1,53 @@ +{ + "name": "i", + "version": "0.3.7", + "author": "Pavan Kumar Sunkara (pksunkara.github.com)", + "description": "custom inflections for nodejs", + "main": "./lib/inflect", + "repository": { + "type": "git", + "url": "git://github.com/pksunkara/inflect.git" + }, + "keywords": [ + "singular", + "plural", + "camelize", + "underscore", + "dasherize", + "demodulize", + "ordinalize", + "uncountable", + "pluralize", + "singularize", + "titleize", + "tableize", + "classify", + "foreign_key" + ], + "homepage": "http://pksunkara.github.com/inflect", + "scripts": { + "test": "./node_modules/.bin/vows --spec $(find test -name '*-test.js')" + }, + "contributors": [ + { + "name": "Pavan Kumar Sunkara", + "email": "pavan.sss1991@gmail.com" + } + ], + "dependencies": {}, + "devDependencies": { + "vows": "^0.8.2" + }, + "engines": { + "node": ">=0.4" + }, + "bugs": { + "url": "https://github.com/pksunkara/inflect/issues" + }, + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/pksunkara/inflect/raw/master/LICENSE" + } + ] +} diff --git a/node_modules/i/test/inflector/cases.js b/node_modules/i/test/inflector/cases.js new file mode 100644 index 0000000..a818f9a --- /dev/null +++ b/node_modules/i/test/inflector/cases.js @@ -0,0 +1,230 @@ +(function() { + + module.exports = { + SingularToPlural: { + "search": "searches", + "switch": "switches", + "fix": "fixes", + "box": "boxes", + "process": "processes", + "address": "addresses", + "case": "cases", + "stack": "stacks", + "wish": "wishes", + "fish": "fish", + "jeans": "jeans", + "funky jeans": "funky jeans", + "my money": "my money", + "category": "categories", + "query": "queries", + "ability": "abilities", + "agency": "agencies", + "movie": "movies", + "archive": "archives", + "index": "indices", + "wife": "wives", + "safe": "saves", + "half": "halves", + "move": "moves", + "salesperson": "salespeople", + "person": "people", + "spokesman": "spokesmen", + "man": "men", + "woman": "women", + "basis": "bases", + "diagnosis": "diagnoses", + "diagnosis_a": "diagnosis_as", + "datum": "data", + "medium": "media", + "stadium": "stadia", + "analysis": "analyses", + "node_child": "node_children", + "child": "children", + "experience": "experiences", + "day": "days", + "comment": "comments", + "foobar": "foobars", + "newsletter": "newsletters", + "old_news": "old_news", + "news": "news", + "series": "series", + "species": "species", + "quiz": "quizzes", + "perspective": "perspectives", + "ox": "oxen", + "photo": "photos", + "buffalo": "buffaloes", + "tomato": "tomatoes", + "dwarf": "dwarves", + "elf": "elves", + "information": "information", + "equipment": "equipment", + "bus": "buses", + "status": "statuses", + "status_code": "status_codes", + "mouse": "mice", + "louse": "lice", + "house": "houses", + "octopus": "octopi", + "virus": "viri", + "alias": "aliases", + "portfolio": "portfolios", + "vertex": "vertices", + "matrix": "matrices", + "matrix_fu": "matrix_fus", + "axis": "axes", + "testis": "testes", + "crisis": "crises", + "rice": "rice", + "shoe": "shoes", + "horse": "horses", + "prize": "prizes", + "edge": "edges", + "cow": "kine", + "database": "databases", + "safe": "safes", + "belief": "beliefs", + "gaffe": "gaffes", + "cafe": "cafes", + "caffe": "caffes", + "life": "lives", + "wife": "wives", + "save": "saves", + "fife": "fifes", + "carafe": "carafes", + "giraffe": "giraffes", + "elf": "elves", + "calf": "calves", + "bookshelf": "bookshelves", + "wolf": "wolves", + "half": "halves", + "meatloaf": "meatloaves", + "loaf": "loaves", + "oaf": "oafs", + "jefe": "jefes", + "afterlife": "afterlives", + }, + CamelToUnderscore: { + "Product": "product", + "SpecialGuest": "special_guest", + "ApplicationController": "application_controller", + "Area51Controller": "area51_controller" + }, + UnderscoreToLowerCamel: { + "product": "product", + "Widget": "widget", + "special_guest": "specialGuest", + "application_controller": "applicationController", + "area51_controller": "area51Controller" + }, + CamelToUnderscoreWithoutReverse: { + "HTMLTidy": "html_tidy", + "HTMLTidyGenerator": "html_tidy_generator", + "FreeBSD": "free_bsd", + "HTML": "html" + }, + CamelWithModuleToUnderscoreWithSlash: { + "Admin.Product": "admin/product", + "Users.Commission.Department": "users/commission/department", + "UsersSection.CommissionDepartment": "users_section/commission_department" + }, + ClassNameToForeignKeyWithUnderscore: { + "Person": "person_id", + "MyApplication.Billing.Account": "account_id" + }, + ClassNameToForeignKeyWithoutUnderscore: { + "Person": "personid", + "MyApplication.Billing.Account": "accountid" + }, + ClassNameToTableName: { + "PrimarySpokesman": "primary_spokesmen", + "NodeChild": "node_children" + }, + UnderscoreToHuman: { + "employee_salary": "Employee salary", + "employee_id": "Employee", + "underground": "Underground" + }, + MixtureToTitleCase: { + 'bullet_record': 'Bullet Record', + 'BulletRecord': 'Bullet Record', + 'bullet web service': 'Bullet Web Service', + 'Bullet Web Service': 'Bullet Web Service', + 'Bullet web service': 'Bullet Web Service', + 'bulletwebservice': 'Bulletwebservice', + 'Bulletwebservice': 'Bulletwebservice', + "pavan's code": "Pavan's Code", + "Pavan's code": "Pavan's Code", + "pavan's Code": "Pavan's Code" + }, + OrdinalNumbers: { + "-1": "-1st", + "-2": "-2nd", + "-3": "-3rd", + "-4": "-4th", + "-5": "-5th", + "-6": "-6th", + "-7": "-7th", + "-8": "-8th", + "-9": "-9th", + "-10": "-10th", + "-11": "-11th", + "-12": "-12th", + "-13": "-13th", + "-14": "-14th", + "-20": "-20th", + "-21": "-21st", + "-22": "-22nd", + "-23": "-23rd", + "-24": "-24th", + "-100": "-100th", + "-101": "-101st", + "-102": "-102nd", + "-103": "-103rd", + "-104": "-104th", + "-110": "-110th", + "-111": "-111th", + "-112": "-112th", + "-113": "-113th", + "-1000": "-1000th", + "-1001": "-1001st", + "0": "0th", + "1": "1st", + "2": "2nd", + "3": "3rd", + "4": "4th", + "5": "5th", + "6": "6th", + "7": "7th", + "8": "8th", + "9": "9th", + "10": "10th", + "11": "11th", + "12": "12th", + "13": "13th", + "14": "14th", + "20": "20th", + "21": "21st", + "22": "22nd", + "23": "23rd", + "24": "24th", + "100": "100th", + "101": "101st", + "102": "102nd", + "103": "103rd", + "104": "104th", + "110": "110th", + "111": "111th", + "112": "112th", + "113": "113th", + "1000": "1000th", + "1001": "1001st" + }, + UnderscoresToDashes: { + "street": "street", + "street_address": "street-address", + "person_street_address": "person-street-address" + } + }; + +}).call(this); diff --git a/node_modules/i/test/inflector/inflections-test.js b/node_modules/i/test/inflector/inflections-test.js new file mode 100644 index 0000000..be8d960 --- /dev/null +++ b/node_modules/i/test/inflector/inflections-test.js @@ -0,0 +1,87 @@ +(function() { + var assert, vows; + + vows = require('vows'); + + assert = require('assert'); + + vows.describe('Module Inflector inflections').addBatch({ + 'Test inflector inflections': { + topic: require('../../lib/inflections'), + 'clear': { + 'single': function(topic) { + topic.uncountables = [1, 2, 3]; + topic.humans = [1, 2, 3]; + topic.clear('uncountables'); + assert.isEmpty(topic.uncountables); + return assert.deepEqual(topic.humans, [1, 2, 3]); + }, + 'all': function(topic) { + assert.deepEqual(topic.humans, [1, 2, 3]); + topic.uncountables = [1, 2, 3]; + topic.clear(); + assert.isEmpty(topic.uncountables); + return assert.isEmpty(topic.humans); + } + }, + 'uncountable': { + 'one item': function(topic) { + topic.clear(); + assert.isEmpty(topic.uncountables); + topic.uncountable('money'); + return assert.deepEqual(topic.uncountables, ['money']); + }, + 'many items': function(topic) { + topic.clear(); + assert.isEmpty(topic.uncountables); + topic.uncountable(['money', 'rice']); + return assert.deepEqual(topic.uncountables, ['money', 'rice']); + } + }, + 'human': function(topic) { + topic.clear(); + assert.isEmpty(topic.humans); + topic.human("legacy_col_person_name", "Name"); + return assert.deepEqual(topic.humans, [["legacy_col_person_name", "Name"]]); + }, + 'plural': function(topic) { + topic.clear(); + assert.isEmpty(topic.plurals); + topic.plural('ox', 'oxen'); + assert.deepEqual(topic.plurals, [['ox', 'oxen']]); + topic.uncountable('money'); + assert.deepEqual(topic.uncountables, ['money']); + topic.uncountable('monies'); + topic.plural('money', 'monies'); + assert.deepEqual(topic.plurals, [['money', 'monies'], ['ox', 'oxen']]); + return assert.isEmpty(topic.uncountables); + }, + 'singular': function(topic) { + topic.clear(); + assert.isEmpty(topic.singulars); + topic.singular('ox', 'oxen'); + assert.deepEqual(topic.singulars, [['ox', 'oxen']]); + topic.uncountable('money'); + assert.deepEqual(topic.uncountables, ['money']); + topic.uncountable('monies'); + topic.singular('money', 'monies'); + assert.deepEqual(topic.singulars, [['money', 'monies'], ['ox', 'oxen']]); + return assert.isEmpty(topic.uncountables); + }, + 'irregular': function(topic) { + topic.clear(); + topic.uncountable(['octopi', 'octopus']); + assert.deepEqual(topic.uncountables, ['octopi', 'octopus']); + topic.irregular('octopus', 'octopi'); + assert.isEmpty(topic.uncountables); + assert.equal(topic.singulars[0][0].toString(), /(o)ctopi$/i.toString()); + assert.equal(topic.singulars[0][1], '$1ctopus'); + assert.equal(topic.plurals[0][0].toString(), /(o)ctopi$/i.toString()); + assert.equal(topic.plurals[0][1], '$1ctopi'); + assert.equal(topic.plurals[1][0].toString(), /(o)ctopus$/i.toString()); + return assert.equal(topic.plurals[1][1].toString(), '$1ctopi'); + } + } + })["export"](module); + +}).call(this); diff --git a/node_modules/i/test/inflector/methods-test.js b/node_modules/i/test/inflector/methods-test.js new file mode 100644 index 0000000..1cd419b --- /dev/null +++ b/node_modules/i/test/inflector/methods-test.js @@ -0,0 +1,348 @@ +(function() { + var assert, cases, vows, util; + + vows = require('vows'); + + assert = require('assert'); + + util = require('../../lib/util'); + + cases = require('./cases'); + + vows.describe('Module Inflector methods').addBatch({ + 'Test inflector method': { + topic: require('../../lib/methods'), + 'camelize': { + 'word': function(topic) { + var i, words, _i, _len, _ref, _results; + words = cases.CamelToUnderscore; + _ref = Object.keys(words); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + i = _ref[_i]; + _results.push(assert.equal(topic.camelize(words[i]), i)); + } + return _results; + }, + 'word with first letter lower': function(topic) { + var i, words, _i, _len, _ref, _results; + words = cases.UnderscoreToLowerCamel; + _ref = Object.keys(words); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + i = _ref[_i]; + _results.push(assert.equal(topic.camelize(i, false), words[i])); + } + return _results; + }, + 'path': function(topic) { + var i, words, _i, _len, _ref, _results; + words = cases.CamelWithModuleToUnderscoreWithSlash; + _ref = Object.keys(words); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + i = _ref[_i]; + _results.push(assert.equal(topic.camelize(words[i]), i)); + } + return _results; + }, + 'path with first letter lower': function(topic) { + return assert.equal(topic.camelize('bullet_record/errors', false), 'bulletRecord.Errors'); + } + }, + 'underscore': { + 'word': function(topic) { + var i, words, _i, _j, _len, _len2, _ref, _ref2, _results; + words = cases.CamelToUnderscore; + _ref = Object.keys(words); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + i = _ref[_i]; + assert.equal(topic.underscore(i), words[i]); + } + words = cases.CamelToUnderscoreWithoutReverse; + _ref2 = Object.keys(words); + _results = []; + for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) { + i = _ref2[_j]; + _results.push(assert.equal(topic.underscore(i), words[i])); + } + return _results; + }, + 'path': function(topic) { + var i, words, _i, _len, _ref, _results; + words = cases.CamelWithModuleToUnderscoreWithSlash; + _ref = Object.keys(words); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + i = _ref[_i]; + _results.push(assert.equal(topic.underscore(i), words[i])); + } + return _results; + }, + 'from dasherize': function(topic) { + var i, words, _i, _len, _ref, _results; + words = cases.UnderscoresToDashes; + _ref = Object.keys(words); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + i = _ref[_i]; + _results.push(assert.equal(topic.underscore(topic.dasherize(i)), i)); + } + return _results; + } + }, + 'dasherize': { + 'underscored_word': function(topic) { + var i, words, _i, _len, _ref, _results; + words = cases.UnderscoresToDashes; + _ref = Object.keys(words); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + i = _ref[_i]; + _results.push(assert.equal(topic.dasherize(i), words[i])); + } + return _results; + } + }, + 'demodulize': { + 'module name': function(topic) { + return assert.equal(topic.demodulize('BulletRecord.CoreExtensions.Inflections'), 'Inflections'); + }, + 'isolated module name': function(topic) { + return assert.equal(topic.demodulize('Inflections'), 'Inflections'); + } + }, + 'foreign_key': { + 'normal': function(topic) { + var i, words, _i, _len, _ref, _results; + words = cases.ClassNameToForeignKeyWithoutUnderscore; + _ref = Object.keys(words); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + i = _ref[_i]; + _results.push(assert.equal(topic.foreign_key(i, false), words[i])); + } + return _results; + }, + 'with_underscore': function(topic) { + var i, words, _i, _len, _ref, _results; + words = cases.ClassNameToForeignKeyWithUnderscore; + _ref = Object.keys(words); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + i = _ref[_i]; + _results.push(assert.equal(topic.foreign_key(i), words[i])); + } + return _results; + } + }, + 'ordinalize': function(topic) { + var i, words, _i, _len, _ref, _results; + words = cases.OrdinalNumbers; + _ref = Object.keys(words); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + i = _ref[_i]; + _results.push(assert.equal(topic.ordinalize(i), words[i])); + } + return _results; + } + } + }).addBatch({ + 'Test inflector inflection methods': { + topic: function() { + var Inflector; + Inflector = require('../../lib/methods'); + Inflector.inflections["default"](); + return Inflector; + }, + 'pluralize': { + 'empty': function(topic) { + return assert.equal(topic.pluralize(''), ''); + }, + 'uncountable': function(topic) { + return assert.equal(topic.pluralize('money'), 'money'); + }, + 'normal': function(topic) { + topic.inflections.irregular('octopus', 'octopi'); + return assert.equal(topic.pluralize('octopus'), 'octopi'); + }, + 'cases': function(topic) { + var i, words, _i, _j, _len, _len2, _ref, _ref2, _results; + words = cases.SingularToPlural; + _ref = Object.keys(words); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + i = _ref[_i]; + assert.equal(topic.pluralize(i), words[i]); + } + _ref2 = Object.keys(words); + _results = []; + for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) { + i = _ref2[_j]; + _results.push(assert.equal(topic.pluralize(util.string.capitalize(i)), util.string.capitalize(words[i]))); + } + return _results; + }, + 'cases plural': function(topic) { + var i, words, _i, _j, _len, _len2, _ref, _ref2, _results; + words = cases.SingularToPlural; + _ref = Object.keys(words); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + i = _ref[_i]; + assert.equal(topic.pluralize(words[i]), words[i]); + } + _ref2 = Object.keys(words); + _results = []; + for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) { + i = _ref2[_j]; + _results.push(assert.equal(topic.pluralize(util.string.capitalize(words[i])), util.string.capitalize(words[i]))); + } + return _results; + } + }, + 'singuralize': { + 'empty': function(topic) { + return assert.equal(topic.singularize(''), ''); + }, + 'uncountable': function(topic) { + return assert.equal(topic.singularize('money'), 'money'); + }, + 'normal': function(topic) { + topic.inflections.irregular('octopus', 'octopi'); + return assert.equal(topic.singularize('octopi'), 'octopus'); + }, + 'cases': function(topic) { + var i, words, _i, _j, _len, _len2, _ref, _ref2, _results; + words = cases.SingularToPlural; + _ref = Object.keys(words); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + i = _ref[_i]; + assert.equal(topic.singularize(words[i]), i); + } + _ref2 = Object.keys(words); + _results = []; + for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) { + i = _ref2[_j]; + _results.push(assert.equal(topic.singularize(util.string.capitalize(words[i])), util.string.capitalize(i))); + } + return _results; + } + }, + 'uncountablility': { + 'normal': function(topic) { + var i, words, _i, _j, _k, _len, _len2, _len3, _results; + words = topic.inflections.uncountables; + for (_i = 0, _len = words.length; _i < _len; _i++) { + i = words[_i]; + assert.equal(topic.singularize(i), i); + } + for (_j = 0, _len2 = words.length; _j < _len2; _j++) { + i = words[_j]; + assert.equal(topic.pluralize(i), i); + } + _results = []; + for (_k = 0, _len3 = words.length; _k < _len3; _k++) { + i = words[_k]; + _results.push(assert.equal(topic.singularize(i), topic.pluralize(i))); + } + return _results; + }, + 'greedy': function(topic) { + var countable_word, uncountable_word; + uncountable_word = "ors"; + countable_word = "sponsor"; + topic.inflections.uncountable(uncountable_word); + assert.equal(topic.singularize(uncountable_word), uncountable_word); + assert.equal(topic.pluralize(uncountable_word), uncountable_word); + assert.equal(topic.pluralize(uncountable_word), topic.singularize(uncountable_word)); + assert.equal(topic.singularize(countable_word), 'sponsor'); + assert.equal(topic.pluralize(countable_word), 'sponsors'); + return assert.equal(topic.singularize(topic.pluralize(countable_word)), 'sponsor'); + } + }, + 'humanize': { + 'normal': function(topic) { + var i, words, _i, _len, _ref, _results; + words = cases.UnderscoreToHuman; + _ref = Object.keys(words); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + i = _ref[_i]; + _results.push(assert.equal(topic.humanize(i), words[i])); + } + return _results; + }, + 'with rule': function(topic) { + topic.inflections.human(/^(.*)_cnt$/i, '$1_count'); + topic.inflections.human(/^prefix_(.*)$/i, '$1'); + assert.equal(topic.humanize('jargon_cnt'), 'Jargon count'); + return assert.equal(topic.humanize('prefix_request'), 'Request'); + }, + 'with string': function(topic) { + topic.inflections.human('col_rpted_bugs', 'Reported bugs'); + assert.equal(topic.humanize('col_rpted_bugs'), 'Reported bugs'); + return assert.equal(topic.humanize('COL_rpted_bugs'), 'Col rpted bugs'); + }, + 'with _id': function(topic) { + return assert.equal(topic.humanize('author_id'), 'Author'); + }, + 'with just _id': function(topic) { + return assert.equal(topic.humanize('_id'), ''); + } + }, + 'titleize': { + 'normal': function(topic) { + var i, words, _i, _len, _ref, _results; + words = cases.MixtureToTitleCase; + _ref = Object.keys(words); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + i = _ref[_i]; + _results.push(assert.equal(topic.titleize(i), words[i])); + } + return _results; + }, + 'with hyphens': function(topic) { + return assert.equal(topic.titleize('x-men: the last stand'), 'X Men: The Last Stand'); + }, + 'with ampersands': function(topic) { + return assert.equal(topic.titleize('garfunkel & oates'), 'Garfunkel & Oates'); + } + }, + 'tableize': function(topic) { + var i, words, _i, _len, _ref, _results; + words = cases.ClassNameToTableName; + _ref = Object.keys(words); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + i = _ref[_i]; + _results.push(assert.equal(topic.tableize(i), words[i])); + } + return _results; + }, + 'classify': { + 'underscore': function(topic) { + var i, words, _i, _j, _len, _len2, _ref, _ref2, _results; + words = cases.ClassNameToTableName; + _ref = Object.keys(words); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + i = _ref[_i]; + assert.equal(topic.classify(words[i]), i); + } + _ref2 = Object.keys(words); + _results = []; + for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) { + i = _ref2[_j]; + _results.push(assert.equal(topic.classify('table_prefix.' + words[i]), i)); + } + return _results; + }, + 'normal': function(topic) { + topic.inflections.irregular('octopus', 'octopi'); + return assert.equal(topic.classify('octopi'), 'Octopus'); + } + } + } + })["export"](module); + +}).call(this); diff --git a/node_modules/i/test/utils/array-test.js b/node_modules/i/test/utils/array-test.js new file mode 100644 index 0000000..95ba2bc --- /dev/null +++ b/node_modules/i/test/utils/array-test.js @@ -0,0 +1,39 @@ +(function() { + var assert, vows, util; + + vows = require('vows'); + + assert = require('assert'); + + util = require('../../lib/util'); + + vows.describe('Module core extension Array').addBatch({ + 'Testing del': { + topic: ['a', 'b', 'c'], + 'element exists': { + 'first element': function(topic) { + return assert.deepEqual(util.array.del(topic, 'a'), ['b', 'c']); + }, + 'middle element': function(topic) { + return assert.deepEqual(util.array.del(topic, 'b'), ['a', 'c']); + }, + 'last element': function(topic) { + return assert.deepEqual(util.array.del(topic, 'c'), ['a', 'b']); + } + }, + 'element does not exist': function(topic) { + return assert.deepEqual(util.array.del(topic, 'd'), ['a', 'b', 'c']); + } + }, + 'Testing utils': { + topic: ['a', 'b', 'c'], + 'first': function(topic) { + return assert.equal(util.array.first(topic), 'a'); + }, + 'last': function(topic) { + return assert.equal(util.array.last(topic), 'c'); + } + } + })["export"](module); + +}).call(this); diff --git a/node_modules/i/test/utils/string-test.js b/node_modules/i/test/utils/string-test.js new file mode 100644 index 0000000..e932233 --- /dev/null +++ b/node_modules/i/test/utils/string-test.js @@ -0,0 +1,88 @@ +(function() { + var assert, vows, util; + + vows = require('vows'); + + assert = require('assert'); + + util = require('../../lib/util'); + + vows.describe('Module core extension String').addBatch({ + 'Testing value': { + topic: 'bullet', + 'join the keys': function(topic) { + return assert.equal(util.string.value(topic), 'bullet'); + } + }, + 'Testing gsub': { + topic: 'bullet', + 'when no args': function(topic) { + return assert.equal(util.string.gsub(topic), 'bullet'); + }, + 'when only 1 arg': function(topic) { + return assert.equal(util.string.gsub(topic, /./), 'bullet'); + }, + 'when given proper args': function(topic) { + return assert.equal(util.string.gsub(topic, /[aeiou]/, '*'), 'b*ll*t'); + }, + 'when replacement is a function': { + 'with many groups': function(topic) { + var str; + str = util.string.gsub(topic, /([aeiou])(.)/, function($) { + return "<" + $[1] + ">" + $[2]; + }); + return assert.equal(str, 'bllt'); + }, + 'with no groups': function(topic) { + var str; + str = util.string.gsub(topic, /[aeiou]/, function($) { + return "<" + $[1] + ">"; + }); + return assert.equal(str, 'bllt'); + } + }, + 'when replacement is special': { + 'with many groups': function(topic) { + return assert.equal(util.string.gsub(topic, /([aeiou])(.)/, '<$1>$2'), 'bllt'); + }, + 'with no groups': function(topic) { + return assert.equal(util.string.gsub(topic, /[aeiou]/, '<$1>'), 'bllt'); + } + } + }, + 'Testing capitalize': { + topic: 'employee salary', + 'normal': function(topic) { + return assert.equal(util.string.capitalize(topic), 'Employee Salary'); + } + }, + 'Testing upcase': { + topic: 'bullet', + 'only first letter should be upcase': function(topic) { + return assert.equal(util.string.upcase(topic), 'Bullet'); + }, + 'letter after underscore': function(topic) { + return assert.equal(util.string.upcase('bullet_record'), 'Bullet_Record'); + }, + 'letter after slash': function(topic) { + return assert.equal(util.string.upcase('bullet_record/errors'), 'Bullet_Record/Errors'); + }, + 'no letter after space': function(topic) { + return assert.equal(util.string.upcase('employee salary'), 'Employee salary'); + } + }, + 'Testing downcase': { + topic: 'BULLET', + 'only first letter should be downcase': function(topic) { + return assert.equal(util.string.downcase(topic), 'bULLET'); + }, + 'letter after underscore': function(topic) { + return assert.equal(util.string.downcase('BULLET_RECORD'), 'bULLET_rECORD'); + }, + 'letter after slash': function(topic) { + return assert.equal(util.string.downcase('BULLET_RECORD/ERRORS'), 'bULLET_rECORD/eRRORS'); + } + } + })["export"](module); + +}).call(this); diff --git a/node_modules/nanoid/LICENSE b/node_modules/nanoid/LICENSE new file mode 100644 index 0000000..37f56aa --- /dev/null +++ b/node_modules/nanoid/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright 2017 Andrey Sitnik + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/nanoid/README.md b/node_modules/nanoid/README.md new file mode 100644 index 0000000..9d178e6 --- /dev/null +++ b/node_modules/nanoid/README.md @@ -0,0 +1,38 @@ +# Nano ID + +Nano ID logo by Anton Lovchikov + +**English** | [Русский](./README.ru.md) | [简体中文](./README.zh-CN.md) | [Bahasa Indonesia](./README.id-ID.md) + +A tiny, secure, URL-friendly, unique string ID generator for JavaScript. + +> “An amazing level of senseless perfectionism, +> which is simply impossible not to respect.” + +* **Small.** 118 bytes (minified and brotlied). No dependencies. + [Size Limit] controls the size. +* **Safe.** It uses hardware random generator. Can be used in clusters. +* **Short IDs.** It uses a larger alphabet than UUID (`A-Za-z0-9_-`). + So ID size was reduced from 36 to 21 symbols. +* **Portable.** Nano ID was ported + to over [20 programming languages](./README.md#other-programming-languages). + +```js +import { nanoid } from 'nanoid' +model.id = nanoid() //=> "V1StGXR8_Z5jdHi6B-myT" +``` + +--- + +  Made at Evil Martians, product consulting for developer tools. + +--- + +[online tool]: https://gitpod.io/#https://github.com/ai/nanoid/ +[with Babel]: https://developer.epages.com/blog/coding/how-to-transpile-node-modules-with-babel-and-webpack-in-a-monorepo/ +[Size Limit]: https://github.com/ai/size-limit + + +## Docs +Read full docs **[here](https://github.com/ai/nanoid#readme)**. diff --git a/node_modules/nanoid/bin/nanoid.js b/node_modules/nanoid/bin/nanoid.js new file mode 100644 index 0000000..f8d7556 --- /dev/null +++ b/node_modules/nanoid/bin/nanoid.js @@ -0,0 +1,45 @@ +#!/usr/bin/env node +import { customAlphabet, nanoid } from '../index.js' +function print(msg) { + process.stdout.write(msg + '\n') +} +function error(msg) { + process.stderr.write(msg + '\n') + process.exit(1) +} +if (process.argv.includes('--help') || process.argv.includes('-h')) { + print(`Usage + $ nanoid [options] +Options + -s, --size Generated ID size + -a, --alphabet Alphabet to use + -h, --help Show this help +Examples + $ nanoid -s 15 + S9sBF77U6sDB8Yg + $ nanoid --size 10 --alphabet abc + bcabababca`) + process.exit() +} +let alphabet, size +for (let i = 2; i < process.argv.length; i++) { + let arg = process.argv[i] + if (arg === '--size' || arg === '-s') { + size = Number(process.argv[i + 1]) + i += 1 + if (Number.isNaN(size) || size <= 0) { + error('Size must be positive integer') + } + } else if (arg === '--alphabet' || arg === '-a') { + alphabet = process.argv[i + 1] + i += 1 + } else { + error('Unknown argument ' + arg) + } +} +if (alphabet) { + let customNanoid = customAlphabet(alphabet, size) + print(customNanoid()) +} else { + print(nanoid(size)) +} diff --git a/node_modules/nanoid/index.browser.js b/node_modules/nanoid/index.browser.js new file mode 100644 index 0000000..3858bd3 --- /dev/null +++ b/node_modules/nanoid/index.browser.js @@ -0,0 +1,29 @@ +/* @ts-self-types="./index.d.ts" */ +import { urlAlphabet as scopedUrlAlphabet } from './url-alphabet/index.js' +export { urlAlphabet } from './url-alphabet/index.js' +export let random = bytes => crypto.getRandomValues(new Uint8Array(bytes)) +export let customRandom = (alphabet, defaultSize, getRandom) => { + let mask = (2 << Math.log2(alphabet.length - 1)) - 1 + let step = -~((1.6 * mask * defaultSize) / alphabet.length) + return (size = defaultSize) => { + let id = '' + while (true) { + let bytes = getRandom(step) + let j = step | 0 + while (j--) { + id += alphabet[bytes[j] & mask] || '' + if (id.length >= size) return id + } + } + } +} +export let customAlphabet = (alphabet, size = 21) => + customRandom(alphabet, size | 0, random) +export let nanoid = (size = 21) => { + let id = '' + let bytes = crypto.getRandomValues(new Uint8Array((size |= 0))) + while (size--) { + id += scopedUrlAlphabet[bytes[size] & 63] + } + return id +} diff --git a/node_modules/nanoid/index.d.ts b/node_modules/nanoid/index.d.ts new file mode 100644 index 0000000..9f28403 --- /dev/null +++ b/node_modules/nanoid/index.d.ts @@ -0,0 +1,106 @@ +/** + * A tiny, secure, URL-friendly, unique string ID generator for JavaScript + * with hardware random generator. + * + * ```js + * import { nanoid } from 'nanoid' + * model.id = nanoid() //=> "V1StGXR8_Z5jdHi6B-myT" + * ``` + * + * @module + */ + +/** + * Generate secure URL-friendly unique ID. + * + * By default, the ID will have 21 symbols to have a collision probability + * similar to UUID v4. + * + * ```js + * import { nanoid } from 'nanoid' + * model.id = nanoid() //=> "Uakgb_J5m9g-0JDMbcJqL" + * ``` + * + * @param size Size of the ID. The default size is 21. + * @typeparam Type The ID type to replace `string` with some opaque type. + * @returns A random string. + */ +export function nanoid(size?: number): Type + +/** + * Generate secure unique ID with custom alphabet. + * + * Alphabet must contain 256 symbols or less. Otherwise, the generator + * will not be secure. + * + * @param alphabet Alphabet used to generate the ID. + * @param defaultSize Size of the ID. The default size is 21. + * @typeparam Type The ID type to replace `string` with some opaque type. + * @returns A random string generator. + * + * ```js + * const { customAlphabet } = require('nanoid') + * const nanoid = customAlphabet('0123456789абвгдеё', 5) + * nanoid() //=> "8ё56а" + * ``` + */ +export function customAlphabet( + alphabet: string, + defaultSize?: number +): (size?: number) => Type + +/** + * Generate unique ID with custom random generator and alphabet. + * + * Alphabet must contain 256 symbols or less. Otherwise, the generator + * will not be secure. + * + * ```js + * import { customRandom } from 'nanoid/format' + * + * const nanoid = customRandom('abcdef', 5, size => { + * const random = [] + * for (let i = 0; i < size; i++) { + * random.push(randomByte()) + * } + * return random + * }) + * + * nanoid() //=> "fbaef" + * ``` + * + * @param alphabet Alphabet used to generate a random string. + * @param size Size of the random string. + * @param random A random bytes generator. + * @typeparam Type The ID type to replace `string` with some opaque type. + * @returns A random string generator. + */ +export function customRandom( + alphabet: string, + size: number, + random: (bytes: number) => Uint8Array +): () => Type + +/** + * URL safe symbols. + * + * ```js + * import { urlAlphabet } from 'nanoid' + * const nanoid = customAlphabet(urlAlphabet, 10) + * nanoid() //=> "Uakgb_J5m9" + * ``` + */ +export const urlAlphabet: string + +/** + * Generate an array of random bytes collected from hardware noise. + * + * ```js + * import { customRandom, random } from 'nanoid' + * const nanoid = customRandom("abcdef", 5, random) + * ``` + * + * @param bytes Size of the array. + * @returns An array of random bytes. + */ +export function random(bytes: number): Uint8Array diff --git a/node_modules/nanoid/index.js b/node_modules/nanoid/index.js new file mode 100644 index 0000000..ab7b425 --- /dev/null +++ b/node_modules/nanoid/index.js @@ -0,0 +1,46 @@ +import { webcrypto as crypto } from 'node:crypto' +import { urlAlphabet as scopedUrlAlphabet } from './url-alphabet/index.js' +export { urlAlphabet } from './url-alphabet/index.js' +const POOL_SIZE_MULTIPLIER = 128 +let pool, poolOffset +function fillPool(bytes) { + if (!pool || pool.length < bytes) { + pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER) + crypto.getRandomValues(pool) + poolOffset = 0 + } else if (poolOffset + bytes > pool.length) { + crypto.getRandomValues(pool) + poolOffset = 0 + } + poolOffset += bytes +} +export function random(bytes) { + fillPool((bytes |= 0)) + return pool.subarray(poolOffset - bytes, poolOffset) +} +export function customRandom(alphabet, defaultSize, getRandom) { + let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 1 + let step = Math.ceil((1.6 * mask * defaultSize) / alphabet.length) + return (size = defaultSize) => { + let id = '' + while (true) { + let bytes = getRandom(step) + let i = step + while (i--) { + id += alphabet[bytes[i] & mask] || '' + if (id.length >= size) return id + } + } + } +} +export function customAlphabet(alphabet, size = 21) { + return customRandom(alphabet, size, random) +} +export function nanoid(size = 21) { + fillPool((size |= 0)) + let id = '' + for (let i = poolOffset - size; i < poolOffset; i++) { + id += scopedUrlAlphabet[pool[i] & 63] + } + return id +} diff --git a/node_modules/nanoid/nanoid.js b/node_modules/nanoid/nanoid.js new file mode 100644 index 0000000..ffa1d4b --- /dev/null +++ b/node_modules/nanoid/nanoid.js @@ -0,0 +1 @@ +let a="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";export let nanoid=(e=21)=>{let t="",r=crypto.getRandomValues(new Uint8Array(e));for(let n=0;n "Uakgb_J5m9g-0JDMbcJqLJ" + * ``` + * + * @module + */ + +/** + * Generate URL-friendly unique ID. This method uses the non-secure + * predictable random generator with bigger collision probability. + * + * ```js + * import { nanoid } from 'nanoid/non-secure' + * model.id = nanoid() //=> "Uakgb_J5m9g-0JDMbcJqL" + * ``` + * + * @param size Size of the ID. The default size is 21. + * @typeparam Type The ID type to replace `string` with some opaque type. + * @returns A random string. + */ +export function nanoid(size?: number): Type + +/** + * Generate a unique ID based on a custom alphabet. + * This method uses the non-secure predictable random generator + * with bigger collision probability. + * + * @param alphabet Alphabet used to generate the ID. + * @param defaultSize Size of the ID. The default size is 21. + * @typeparam Type The ID type to replace `string` with some opaque type. + * @returns A random string generator. + * + * ```js + * import { customAlphabet } from 'nanoid/non-secure' + * const nanoid = customAlphabet('0123456789абвгдеё', 5) + * model.id = nanoid() //=> "8ё56а" + * ``` + */ +export function customAlphabet( + alphabet: string, + defaultSize?: number +): (size?: number) => Type diff --git a/node_modules/nanoid/non-secure/index.js b/node_modules/nanoid/non-secure/index.js new file mode 100644 index 0000000..a3d83f2 --- /dev/null +++ b/node_modules/nanoid/non-secure/index.js @@ -0,0 +1,21 @@ +/* @ts-self-types="./index.d.ts" */ +let urlAlphabet = + 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict' +export let customAlphabet = (alphabet, defaultSize = 21) => { + return (size = defaultSize) => { + let id = '' + let i = size | 0 + while (i--) { + id += alphabet[(Math.random() * alphabet.length) | 0] + } + return id + } +} +export let nanoid = (size = 21) => { + let id = '' + let i = size | 0 + while (i--) { + id += urlAlphabet[(Math.random() * 64) | 0] + } + return id +} diff --git a/node_modules/nanoid/package.json b/node_modules/nanoid/package.json new file mode 100644 index 0000000..032de3b --- /dev/null +++ b/node_modules/nanoid/package.json @@ -0,0 +1,42 @@ +{ + "name": "nanoid", + "version": "5.1.5", + "description": "A tiny (118 bytes), secure URL-friendly unique string ID generator", + "keywords": [ + "uuid", + "random", + "id", + "url" + ], + "type": "module", + "engines": { + "node": "^18 || >=20" + }, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "author": "Andrey Sitnik ", + "license": "MIT", + "repository": "ai/nanoid", + "exports": { + ".": { + "browser": "./index.browser.js", + "react-native": "./index.browser.js", + "default": "./index.js" + }, + "./non-secure": "./non-secure/index.js", + "./package.json": "./package.json" + }, + "browser": { + "./index.js": "./index.browser.js" + }, + "react-native": { + "./index.js": "./index.browser.js" + }, + "bin": "./bin/nanoid.js", + "sideEffects": false, + "types": "./index.d.ts" +} diff --git a/node_modules/nanoid/url-alphabet/index.js b/node_modules/nanoid/url-alphabet/index.js new file mode 100644 index 0000000..cfec9b2 --- /dev/null +++ b/node_modules/nanoid/url-alphabet/index.js @@ -0,0 +1,2 @@ +export const urlAlphabet = + 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict' diff --git a/node_modules/react-dom/LICENSE b/node_modules/react-dom/LICENSE new file mode 100644 index 0000000..b93be90 --- /dev/null +++ b/node_modules/react-dom/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Meta Platforms, Inc. and affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/react-dom/README.md b/node_modules/react-dom/README.md new file mode 100644 index 0000000..b078f19 --- /dev/null +++ b/node_modules/react-dom/README.md @@ -0,0 +1,60 @@ +# `react-dom` + +This package serves as the entry point to the DOM and server renderers for React. It is intended to be paired with the generic React package, which is shipped as `react` to npm. + +## Installation + +```sh +npm install react react-dom +``` + +## Usage + +### In the browser + +```js +import { createRoot } from 'react-dom/client'; + +function App() { + return
Hello World
; +} + +const root = createRoot(document.getElementById('root')); +root.render(); +``` + +### On the server + +```js +import { renderToPipeableStream } from 'react-dom/server'; + +function App() { + return
Hello World
; +} + +function handleRequest(res) { + // ... in your server handler ... + const stream = renderToPipeableStream(, { + onShellReady() { + res.statusCode = 200; + res.setHeader('Content-type', 'text/html'); + stream.pipe(res); + }, + // ... + }); +} +``` + +## API + +### `react-dom` + +See https://react.dev/reference/react-dom + +### `react-dom/client` + +See https://react.dev/reference/react-dom/client + +### `react-dom/server` + +See https://react.dev/reference/react-dom/server diff --git a/node_modules/react-dom/cjs/react-dom-client.development.js b/node_modules/react-dom/cjs/react-dom-client.development.js new file mode 100644 index 0000000..dd10829 --- /dev/null +++ b/node_modules/react-dom/cjs/react-dom-client.development.js @@ -0,0 +1,24990 @@ +/** + * @license React + * react-dom-client.development.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +/* + Modernizr 3.0.0pre (Custom Build) | MIT +*/ +"use strict"; +"production" !== process.env.NODE_ENV && + (function () { + function findHook(fiber, id) { + for (fiber = fiber.memoizedState; null !== fiber && 0 < id; ) + (fiber = fiber.next), id--; + return fiber; + } + function copyWithSetImpl(obj, path, index, value) { + if (index >= path.length) return value; + var key = path[index], + updated = isArrayImpl(obj) ? obj.slice() : assign({}, obj); + updated[key] = copyWithSetImpl(obj[key], path, index + 1, value); + return updated; + } + function copyWithRename(obj, oldPath, newPath) { + if (oldPath.length !== newPath.length) + console.warn("copyWithRename() expects paths of the same length"); + else { + for (var i = 0; i < newPath.length - 1; i++) + if (oldPath[i] !== newPath[i]) { + console.warn( + "copyWithRename() expects paths to be the same except for the deepest key" + ); + return; + } + return copyWithRenameImpl(obj, oldPath, newPath, 0); + } + } + function copyWithRenameImpl(obj, oldPath, newPath, index) { + var oldKey = oldPath[index], + updated = isArrayImpl(obj) ? obj.slice() : assign({}, obj); + index + 1 === oldPath.length + ? ((updated[newPath[index]] = updated[oldKey]), + isArrayImpl(updated) + ? updated.splice(oldKey, 1) + : delete updated[oldKey]) + : (updated[oldKey] = copyWithRenameImpl( + obj[oldKey], + oldPath, + newPath, + index + 1 + )); + return updated; + } + function copyWithDeleteImpl(obj, path, index) { + var key = path[index], + updated = isArrayImpl(obj) ? obj.slice() : assign({}, obj); + if (index + 1 === path.length) + return ( + isArrayImpl(updated) ? updated.splice(key, 1) : delete updated[key], + updated + ); + updated[key] = copyWithDeleteImpl(obj[key], path, index + 1); + return updated; + } + function shouldSuspendImpl() { + return !1; + } + function shouldErrorImpl() { + return null; + } + function warnForMissingKey() {} + function warnInvalidHookAccess() { + console.error( + "Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://react.dev/link/rules-of-hooks" + ); + } + function warnInvalidContextAccess() { + console.error( + "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." + ); + } + function noop$2() {} + function setToSortedString(set) { + var array = []; + set.forEach(function (value) { + array.push(value); + }); + return array.sort().join(", "); + } + function createFiber(tag, pendingProps, key, mode) { + return new FiberNode(tag, pendingProps, key, mode); + } + function scheduleRoot(root, element) { + root.context === emptyContextObject && + (updateContainerImpl(root.current, 2, element, root, null, null), + flushSyncWork$1()); + } + function scheduleRefresh(root, update) { + if (null !== resolveFamily) { + var staleFamilies = update.staleFamilies; + update = update.updatedFamilies; + flushPendingEffects(); + scheduleFibersWithFamiliesRecursively( + root.current, + update, + staleFamilies + ); + flushSyncWork$1(); + } + } + function setRefreshHandler(handler) { + resolveFamily = handler; + } + function isValidContainer(node) { + return !( + !node || + (1 !== node.nodeType && 9 !== node.nodeType && 11 !== node.nodeType) + ); + } + function getNearestMountedFiber(fiber) { + var node = fiber, + nearestMounted = fiber; + if (fiber.alternate) for (; node.return; ) node = node.return; + else { + fiber = node; + do + (node = fiber), + 0 !== (node.flags & 4098) && (nearestMounted = node.return), + (fiber = node.return); + while (fiber); + } + return 3 === node.tag ? nearestMounted : null; + } + function getSuspenseInstanceFromFiber(fiber) { + if (13 === fiber.tag) { + var suspenseState = fiber.memoizedState; + null === suspenseState && + ((fiber = fiber.alternate), + null !== fiber && (suspenseState = fiber.memoizedState)); + if (null !== suspenseState) return suspenseState.dehydrated; + } + return null; + } + function assertIsMounted(fiber) { + if (getNearestMountedFiber(fiber) !== fiber) + throw Error("Unable to find node on an unmounted component."); + } + function findCurrentFiberUsingSlowPath(fiber) { + var alternate = fiber.alternate; + if (!alternate) { + alternate = getNearestMountedFiber(fiber); + if (null === alternate) + throw Error("Unable to find node on an unmounted component."); + return alternate !== fiber ? null : fiber; + } + for (var a = fiber, b = alternate; ; ) { + var parentA = a.return; + if (null === parentA) break; + var parentB = parentA.alternate; + if (null === parentB) { + b = parentA.return; + if (null !== b) { + a = b; + continue; + } + break; + } + if (parentA.child === parentB.child) { + for (parentB = parentA.child; parentB; ) { + if (parentB === a) return assertIsMounted(parentA), fiber; + if (parentB === b) return assertIsMounted(parentA), alternate; + parentB = parentB.sibling; + } + throw Error("Unable to find node on an unmounted component."); + } + if (a.return !== b.return) (a = parentA), (b = parentB); + else { + for (var didFindChild = !1, _child = parentA.child; _child; ) { + if (_child === a) { + didFindChild = !0; + a = parentA; + b = parentB; + break; + } + if (_child === b) { + didFindChild = !0; + b = parentA; + a = parentB; + break; + } + _child = _child.sibling; + } + if (!didFindChild) { + for (_child = parentB.child; _child; ) { + if (_child === a) { + didFindChild = !0; + a = parentB; + b = parentA; + break; + } + if (_child === b) { + didFindChild = !0; + b = parentB; + a = parentA; + break; + } + _child = _child.sibling; + } + if (!didFindChild) + throw Error( + "Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue." + ); + } + } + if (a.alternate !== b) + throw Error( + "Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue." + ); + } + if (3 !== a.tag) + throw Error("Unable to find node on an unmounted component."); + return a.stateNode.current === a ? fiber : alternate; + } + function findCurrentHostFiberImpl(node) { + var tag = node.tag; + if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node; + for (node = node.child; null !== node; ) { + tag = findCurrentHostFiberImpl(node); + if (null !== tag) return tag; + node = node.sibling; + } + return null; + } + function getIteratorFn(maybeIterable) { + if (null === maybeIterable || "object" !== typeof maybeIterable) + return null; + maybeIterable = + (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) || + maybeIterable["@@iterator"]; + return "function" === typeof maybeIterable ? maybeIterable : null; + } + function getComponentNameFromType(type) { + if (null == type) return null; + if ("function" === typeof type) + return type.$$typeof === REACT_CLIENT_REFERENCE + ? null + : type.displayName || type.name || null; + if ("string" === typeof type) return type; + switch (type) { + case REACT_FRAGMENT_TYPE: + return "Fragment"; + case REACT_PROFILER_TYPE: + return "Profiler"; + case REACT_STRICT_MODE_TYPE: + return "StrictMode"; + case REACT_SUSPENSE_TYPE: + return "Suspense"; + case REACT_SUSPENSE_LIST_TYPE: + return "SuspenseList"; + case REACT_ACTIVITY_TYPE: + return "Activity"; + } + if ("object" === typeof type) + switch ( + ("number" === typeof type.tag && + console.error( + "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue." + ), + type.$$typeof) + ) { + case REACT_PORTAL_TYPE: + return "Portal"; + case REACT_CONTEXT_TYPE: + return (type.displayName || "Context") + ".Provider"; + case REACT_CONSUMER_TYPE: + return (type._context.displayName || "Context") + ".Consumer"; + case REACT_FORWARD_REF_TYPE: + var innerType = type.render; + type = type.displayName; + type || + ((type = innerType.displayName || innerType.name || ""), + (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef")); + return type; + case REACT_MEMO_TYPE: + return ( + (innerType = type.displayName || null), + null !== innerType + ? innerType + : getComponentNameFromType(type.type) || "Memo" + ); + case REACT_LAZY_TYPE: + innerType = type._payload; + type = type._init; + try { + return getComponentNameFromType(type(innerType)); + } catch (x) {} + } + return null; + } + function getComponentNameFromOwner(owner) { + return "number" === typeof owner.tag + ? getComponentNameFromFiber(owner) + : "string" === typeof owner.name + ? owner.name + : null; + } + function getComponentNameFromFiber(fiber) { + var type = fiber.type; + switch (fiber.tag) { + case 31: + return "Activity"; + case 24: + return "Cache"; + case 9: + return (type._context.displayName || "Context") + ".Consumer"; + case 10: + return (type.displayName || "Context") + ".Provider"; + case 18: + return "DehydratedFragment"; + case 11: + return ( + (fiber = type.render), + (fiber = fiber.displayName || fiber.name || ""), + type.displayName || + ("" !== fiber ? "ForwardRef(" + fiber + ")" : "ForwardRef") + ); + case 7: + return "Fragment"; + case 26: + case 27: + case 5: + return type; + case 4: + return "Portal"; + case 3: + return "Root"; + case 6: + return "Text"; + case 16: + return getComponentNameFromType(type); + case 8: + return type === REACT_STRICT_MODE_TYPE ? "StrictMode" : "Mode"; + case 22: + return "Offscreen"; + case 12: + return "Profiler"; + case 21: + return "Scope"; + case 13: + return "Suspense"; + case 19: + return "SuspenseList"; + case 25: + return "TracingMarker"; + case 1: + case 0: + case 14: + case 15: + if ("function" === typeof type) + return type.displayName || type.name || null; + if ("string" === typeof type) return type; + break; + case 29: + type = fiber._debugInfo; + if (null != type) + for (var i = type.length - 1; 0 <= i; i--) + if ("string" === typeof type[i].name) return type[i].name; + if (null !== fiber.return) + return getComponentNameFromFiber(fiber.return); + } + return null; + } + function createCursor(defaultValue) { + return { current: defaultValue }; + } + function pop(cursor, fiber) { + 0 > index$jscomp$0 + ? console.error("Unexpected pop.") + : (fiber !== fiberStack[index$jscomp$0] && + console.error("Unexpected Fiber popped."), + (cursor.current = valueStack[index$jscomp$0]), + (valueStack[index$jscomp$0] = null), + (fiberStack[index$jscomp$0] = null), + index$jscomp$0--); + } + function push(cursor, value, fiber) { + index$jscomp$0++; + valueStack[index$jscomp$0] = cursor.current; + fiberStack[index$jscomp$0] = fiber; + cursor.current = value; + } + function requiredContext(c) { + null === c && + console.error( + "Expected host context to exist. This error is likely caused by a bug in React. Please file an issue." + ); + return c; + } + function pushHostContainer(fiber, nextRootInstance) { + push(rootInstanceStackCursor, nextRootInstance, fiber); + push(contextFiberStackCursor, fiber, fiber); + push(contextStackCursor, null, fiber); + var nextRootContext = nextRootInstance.nodeType; + switch (nextRootContext) { + case 9: + case 11: + nextRootContext = 9 === nextRootContext ? "#document" : "#fragment"; + nextRootInstance = (nextRootInstance = + nextRootInstance.documentElement) + ? (nextRootInstance = nextRootInstance.namespaceURI) + ? getOwnHostContext(nextRootInstance) + : HostContextNamespaceNone + : HostContextNamespaceNone; + break; + default: + if ( + ((nextRootContext = nextRootInstance.tagName), + (nextRootInstance = nextRootInstance.namespaceURI)) + ) + (nextRootInstance = getOwnHostContext(nextRootInstance)), + (nextRootInstance = getChildHostContextProd( + nextRootInstance, + nextRootContext + )); + else + switch (nextRootContext) { + case "svg": + nextRootInstance = HostContextNamespaceSvg; + break; + case "math": + nextRootInstance = HostContextNamespaceMath; + break; + default: + nextRootInstance = HostContextNamespaceNone; + } + } + nextRootContext = nextRootContext.toLowerCase(); + nextRootContext = updatedAncestorInfoDev(null, nextRootContext); + nextRootContext = { + context: nextRootInstance, + ancestorInfo: nextRootContext + }; + pop(contextStackCursor, fiber); + push(contextStackCursor, nextRootContext, fiber); + } + function popHostContainer(fiber) { + pop(contextStackCursor, fiber); + pop(contextFiberStackCursor, fiber); + pop(rootInstanceStackCursor, fiber); + } + function getHostContext() { + return requiredContext(contextStackCursor.current); + } + function pushHostContext(fiber) { + null !== fiber.memoizedState && + push(hostTransitionProviderCursor, fiber, fiber); + var context = requiredContext(contextStackCursor.current); + var type = fiber.type; + var nextContext = getChildHostContextProd(context.context, type); + type = updatedAncestorInfoDev(context.ancestorInfo, type); + nextContext = { context: nextContext, ancestorInfo: type }; + context !== nextContext && + (push(contextFiberStackCursor, fiber, fiber), + push(contextStackCursor, nextContext, fiber)); + } + function popHostContext(fiber) { + contextFiberStackCursor.current === fiber && + (pop(contextStackCursor, fiber), pop(contextFiberStackCursor, fiber)); + hostTransitionProviderCursor.current === fiber && + (pop(hostTransitionProviderCursor, fiber), + (HostTransitionContext._currentValue = NotPendingTransition)); + } + function typeName(value) { + return ( + ("function" === typeof Symbol && + Symbol.toStringTag && + value[Symbol.toStringTag]) || + value.constructor.name || + "Object" + ); + } + function willCoercionThrow(value) { + try { + return testStringCoercion(value), !1; + } catch (e) { + return !0; + } + } + function testStringCoercion(value) { + return "" + value; + } + function checkAttributeStringCoercion(value, attributeName) { + if (willCoercionThrow(value)) + return ( + console.error( + "The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before using it here.", + attributeName, + typeName(value) + ), + testStringCoercion(value) + ); + } + function checkCSSPropertyStringCoercion(value, propName) { + if (willCoercionThrow(value)) + return ( + console.error( + "The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before using it here.", + propName, + typeName(value) + ), + testStringCoercion(value) + ); + } + function checkFormFieldValueStringCoercion(value) { + if (willCoercionThrow(value)) + return ( + console.error( + "Form field values (value, checked, defaultValue, or defaultChecked props) must be strings, not %s. This value must be coerced to a string before using it here.", + typeName(value) + ), + testStringCoercion(value) + ); + } + function injectInternals(internals) { + if ("undefined" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) return !1; + var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__; + if (hook.isDisabled) return !0; + if (!hook.supportsFiber) + return ( + console.error( + "The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://react.dev/link/react-devtools" + ), + !0 + ); + try { + (rendererID = hook.inject(internals)), (injectedHook = hook); + } catch (err) { + console.error("React instrumentation encountered an error: %s.", err); + } + return hook.checkDCE ? !0 : !1; + } + function setIsStrictModeForDevtools(newIsStrictMode) { + "function" === typeof log$1 && + unstable_setDisableYieldValue(newIsStrictMode); + if (injectedHook && "function" === typeof injectedHook.setStrictMode) + try { + injectedHook.setStrictMode(rendererID, newIsStrictMode); + } catch (err) { + hasLoggedError || + ((hasLoggedError = !0), + console.error( + "React instrumentation encountered an error: %s", + err + )); + } + } + function injectProfilingHooks(profilingHooks) { + injectedProfilingHooks = profilingHooks; + } + function markCommitStopped() { + null !== injectedProfilingHooks && + "function" === typeof injectedProfilingHooks.markCommitStopped && + injectedProfilingHooks.markCommitStopped(); + } + function markComponentRenderStarted(fiber) { + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentRenderStarted && + injectedProfilingHooks.markComponentRenderStarted(fiber); + } + function markComponentRenderStopped() { + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentRenderStopped && + injectedProfilingHooks.markComponentRenderStopped(); + } + function markRenderStarted(lanes) { + null !== injectedProfilingHooks && + "function" === typeof injectedProfilingHooks.markRenderStarted && + injectedProfilingHooks.markRenderStarted(lanes); + } + function markRenderStopped() { + null !== injectedProfilingHooks && + "function" === typeof injectedProfilingHooks.markRenderStopped && + injectedProfilingHooks.markRenderStopped(); + } + function markStateUpdateScheduled(fiber, lane) { + null !== injectedProfilingHooks && + "function" === typeof injectedProfilingHooks.markStateUpdateScheduled && + injectedProfilingHooks.markStateUpdateScheduled(fiber, lane); + } + function clz32Fallback(x) { + x >>>= 0; + return 0 === x ? 32 : (31 - ((log(x) / LN2) | 0)) | 0; + } + function getLabelForLane(lane) { + if (lane & 1) return "SyncHydrationLane"; + if (lane & 2) return "Sync"; + if (lane & 4) return "InputContinuousHydration"; + if (lane & 8) return "InputContinuous"; + if (lane & 16) return "DefaultHydration"; + if (lane & 32) return "Default"; + if (lane & 128) return "TransitionHydration"; + if (lane & 4194048) return "Transition"; + if (lane & 62914560) return "Retry"; + if (lane & 67108864) return "SelectiveHydration"; + if (lane & 134217728) return "IdleHydration"; + if (lane & 268435456) return "Idle"; + if (lane & 536870912) return "Offscreen"; + if (lane & 1073741824) return "Deferred"; + } + function getHighestPriorityLanes(lanes) { + var pendingSyncLanes = lanes & 42; + if (0 !== pendingSyncLanes) return pendingSyncLanes; + switch (lanes & -lanes) { + case 1: + return 1; + case 2: + return 2; + case 4: + return 4; + case 8: + return 8; + case 16: + return 16; + case 32: + return 32; + case 64: + return 64; + case 128: + return 128; + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + return lanes & 4194048; + case 4194304: + case 8388608: + case 16777216: + case 33554432: + return lanes & 62914560; + case 67108864: + return 67108864; + case 134217728: + return 134217728; + case 268435456: + return 268435456; + case 536870912: + return 536870912; + case 1073741824: + return 0; + default: + return ( + console.error( + "Should have found matching lanes. This is a bug in React." + ), + lanes + ); + } + } + function getNextLanes(root, wipLanes, rootHasPendingCommit) { + var pendingLanes = root.pendingLanes; + if (0 === pendingLanes) return 0; + var nextLanes = 0, + suspendedLanes = root.suspendedLanes, + pingedLanes = root.pingedLanes; + root = root.warmLanes; + var nonIdlePendingLanes = pendingLanes & 134217727; + 0 !== nonIdlePendingLanes + ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), + 0 !== pendingLanes + ? (nextLanes = getHighestPriorityLanes(pendingLanes)) + : ((pingedLanes &= nonIdlePendingLanes), + 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : rootHasPendingCommit || + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = + getHighestPriorityLanes(rootHasPendingCommit))))) + : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), + 0 !== nonIdlePendingLanes + ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) + : 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : rootHasPendingCommit || + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); + return 0 === nextLanes + ? 0 + : 0 !== wipLanes && + wipLanes !== nextLanes && + 0 === (wipLanes & suspendedLanes) && + ((suspendedLanes = nextLanes & -nextLanes), + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194048))) + ? wipLanes + : nextLanes; + } + function checkIfRootIsPrerendering(root, renderLanes) { + return ( + 0 === + (root.pendingLanes & + ~(root.suspendedLanes & ~root.pingedLanes) & + renderLanes) + ); + } + function computeExpirationTime(lane, currentTime) { + switch (lane) { + case 1: + case 2: + case 4: + case 8: + case 64: + return currentTime + 250; + case 16: + case 32: + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + return currentTime + 5e3; + case 4194304: + case 8388608: + case 16777216: + case 33554432: + return -1; + case 67108864: + case 134217728: + case 268435456: + case 536870912: + case 1073741824: + return -1; + default: + return ( + console.error( + "Should have found matching lanes. This is a bug in React." + ), + -1 + ); + } + } + function claimNextTransitionLane() { + var lane = nextTransitionLane; + nextTransitionLane <<= 1; + 0 === (nextTransitionLane & 4194048) && (nextTransitionLane = 256); + return lane; + } + function claimNextRetryLane() { + var lane = nextRetryLane; + nextRetryLane <<= 1; + 0 === (nextRetryLane & 62914560) && (nextRetryLane = 4194304); + return lane; + } + function createLaneMap(initial) { + for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); + return laneMap; + } + function markRootUpdated$1(root, updateLane) { + root.pendingLanes |= updateLane; + 268435456 !== updateLane && + ((root.suspendedLanes = 0), + (root.pingedLanes = 0), + (root.warmLanes = 0)); + } + function markRootFinished( + root, + finishedLanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ) { + var previouslyPendingLanes = root.pendingLanes; + root.pendingLanes = remainingLanes; + root.suspendedLanes = 0; + root.pingedLanes = 0; + root.warmLanes = 0; + root.expiredLanes &= remainingLanes; + root.entangledLanes &= remainingLanes; + root.errorRecoveryDisabledLanes &= remainingLanes; + root.shellSuspendCounter = 0; + var entanglements = root.entanglements, + expirationTimes = root.expirationTimes, + hiddenUpdates = root.hiddenUpdates; + for ( + remainingLanes = previouslyPendingLanes & ~remainingLanes; + 0 < remainingLanes; + + ) { + var index = 31 - clz32(remainingLanes), + lane = 1 << index; + entanglements[index] = 0; + expirationTimes[index] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index]; + if (null !== hiddenUpdatesForLane) + for ( + hiddenUpdates[index] = null, index = 0; + index < hiddenUpdatesForLane.length; + index++ + ) { + var update = hiddenUpdatesForLane[index]; + null !== update && (update.lane &= -536870913); + } + remainingLanes &= ~lane; + } + 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0); + 0 !== suspendedRetryLanes && + 0 === updatedLanes && + 0 !== root.tag && + (root.suspendedLanes |= + suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes)); + } + function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { + root.pendingLanes |= spawnedLane; + root.suspendedLanes &= ~spawnedLane; + var spawnedLaneIndex = 31 - clz32(spawnedLane); + root.entangledLanes |= spawnedLane; + root.entanglements[spawnedLaneIndex] = + root.entanglements[spawnedLaneIndex] | + 1073741824 | + (entangledLanes & 4194090); + } + function markRootEntangled(root, entangledLanes) { + var rootEntangledLanes = (root.entangledLanes |= entangledLanes); + for (root = root.entanglements; rootEntangledLanes; ) { + var index = 31 - clz32(rootEntangledLanes), + lane = 1 << index; + (lane & entangledLanes) | (root[index] & entangledLanes) && + (root[index] |= entangledLanes); + rootEntangledLanes &= ~lane; + } + } + function getBumpedLaneForHydrationByLane(lane) { + switch (lane) { + case 2: + lane = 1; + break; + case 8: + lane = 4; + break; + case 32: + lane = 16; + break; + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + case 4194304: + case 8388608: + case 16777216: + case 33554432: + lane = 128; + break; + case 268435456: + lane = 134217728; + break; + default: + lane = 0; + } + return lane; + } + function addFiberToLanesMap(root, fiber, lanes) { + if (isDevToolsPresent) + for (root = root.pendingUpdatersLaneMap; 0 < lanes; ) { + var index = 31 - clz32(lanes), + lane = 1 << index; + root[index].add(fiber); + lanes &= ~lane; + } + } + function movePendingFibersToMemoized(root, lanes) { + if (isDevToolsPresent) + for ( + var pendingUpdatersLaneMap = root.pendingUpdatersLaneMap, + memoizedUpdaters = root.memoizedUpdaters; + 0 < lanes; + + ) { + var index = 31 - clz32(lanes); + root = 1 << index; + index = pendingUpdatersLaneMap[index]; + 0 < index.size && + (index.forEach(function (fiber) { + var alternate = fiber.alternate; + (null !== alternate && memoizedUpdaters.has(alternate)) || + memoizedUpdaters.add(fiber); + }), + index.clear()); + lanes &= ~root; + } + } + function lanesToEventPriority(lanes) { + lanes &= -lanes; + return 0 !== DiscreteEventPriority && DiscreteEventPriority < lanes + ? 0 !== ContinuousEventPriority && ContinuousEventPriority < lanes + ? 0 !== (lanes & 134217727) + ? DefaultEventPriority + : IdleEventPriority + : ContinuousEventPriority + : DiscreteEventPriority; + } + function resolveUpdatePriority() { + var updatePriority = ReactDOMSharedInternals.p; + if (0 !== updatePriority) return updatePriority; + updatePriority = window.event; + return void 0 === updatePriority + ? DefaultEventPriority + : getEventPriority(updatePriority.type); + } + function runWithPriority(priority, fn) { + var previousPriority = ReactDOMSharedInternals.p; + try { + return (ReactDOMSharedInternals.p = priority), fn(); + } finally { + ReactDOMSharedInternals.p = previousPriority; + } + } + function detachDeletedInstance(node) { + delete node[internalInstanceKey]; + delete node[internalPropsKey]; + delete node[internalEventHandlersKey]; + delete node[internalEventHandlerListenersKey]; + delete node[internalEventHandlesSetKey]; + } + function getClosestInstanceFromNode(targetNode) { + var targetInst = targetNode[internalInstanceKey]; + if (targetInst) return targetInst; + for (var parentNode = targetNode.parentNode; parentNode; ) { + if ( + (targetInst = + parentNode[internalContainerInstanceKey] || + parentNode[internalInstanceKey]) + ) { + parentNode = targetInst.alternate; + if ( + null !== targetInst.child || + (null !== parentNode && null !== parentNode.child) + ) + for ( + targetNode = getParentSuspenseInstance(targetNode); + null !== targetNode; + + ) { + if ((parentNode = targetNode[internalInstanceKey])) + return parentNode; + targetNode = getParentSuspenseInstance(targetNode); + } + return targetInst; + } + targetNode = parentNode; + parentNode = targetNode.parentNode; + } + return null; + } + function getInstanceFromNode(node) { + if ( + (node = node[internalInstanceKey] || node[internalContainerInstanceKey]) + ) { + var tag = node.tag; + if ( + 5 === tag || + 6 === tag || + 13 === tag || + 26 === tag || + 27 === tag || + 3 === tag + ) + return node; + } + return null; + } + function getNodeFromInstance(inst) { + var tag = inst.tag; + if (5 === tag || 26 === tag || 27 === tag || 6 === tag) + return inst.stateNode; + throw Error("getNodeFromInstance: Invalid argument."); + } + function getResourcesFromRoot(root) { + var resources = root[internalRootNodeResourcesKey]; + resources || + (resources = root[internalRootNodeResourcesKey] = + { hoistableStyles: new Map(), hoistableScripts: new Map() }); + return resources; + } + function markNodeAsHoistable(node) { + node[internalHoistableMarker] = !0; + } + function registerTwoPhaseEvent(registrationName, dependencies) { + registerDirectEvent(registrationName, dependencies); + registerDirectEvent(registrationName + "Capture", dependencies); + } + function registerDirectEvent(registrationName, dependencies) { + registrationNameDependencies[registrationName] && + console.error( + "EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.", + registrationName + ); + registrationNameDependencies[registrationName] = dependencies; + var lowerCasedName = registrationName.toLowerCase(); + possibleRegistrationNames[lowerCasedName] = registrationName; + "onDoubleClick" === registrationName && + (possibleRegistrationNames.ondblclick = registrationName); + for ( + registrationName = 0; + registrationName < dependencies.length; + registrationName++ + ) + allNativeEvents.add(dependencies[registrationName]); + } + function checkControlledValueProps(tagName, props) { + hasReadOnlyValue[props.type] || + props.onChange || + props.onInput || + props.readOnly || + props.disabled || + null == props.value || + ("select" === tagName + ? console.error( + "You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set `onChange`." + ) + : console.error( + "You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`." + )); + props.onChange || + props.readOnly || + props.disabled || + null == props.checked || + console.error( + "You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`." + ); + } + function isAttributeNameSafe(attributeName) { + if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) + return !0; + if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) + return !1; + if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) + return (validatedAttributeNameCache[attributeName] = !0); + illegalAttributeNameCache[attributeName] = !0; + console.error("Invalid attribute name: `%s`", attributeName); + return !1; + } + function getValueForAttributeOnCustomComponent(node, name, expected) { + if (isAttributeNameSafe(name)) { + if (!node.hasAttribute(name)) { + switch (typeof expected) { + case "symbol": + case "object": + return expected; + case "function": + return expected; + case "boolean": + if (!1 === expected) return expected; + } + return void 0 === expected ? void 0 : null; + } + node = node.getAttribute(name); + if ("" === node && !0 === expected) return !0; + checkAttributeStringCoercion(expected, name); + return node === "" + expected ? expected : node; + } + } + function setValueForAttribute(node, name, value) { + if (isAttributeNameSafe(name)) + if (null === value) node.removeAttribute(name); + else { + switch (typeof value) { + case "undefined": + case "function": + case "symbol": + node.removeAttribute(name); + return; + case "boolean": + var prefix = name.toLowerCase().slice(0, 5); + if ("data-" !== prefix && "aria-" !== prefix) { + node.removeAttribute(name); + return; + } + } + checkAttributeStringCoercion(value, name); + node.setAttribute(name, "" + value); + } + } + function setValueForKnownAttribute(node, name, value) { + if (null === value) node.removeAttribute(name); + else { + switch (typeof value) { + case "undefined": + case "function": + case "symbol": + case "boolean": + node.removeAttribute(name); + return; + } + checkAttributeStringCoercion(value, name); + node.setAttribute(name, "" + value); + } + } + function setValueForNamespacedAttribute(node, namespace, name, value) { + if (null === value) node.removeAttribute(name); + else { + switch (typeof value) { + case "undefined": + case "function": + case "symbol": + case "boolean": + node.removeAttribute(name); + return; + } + checkAttributeStringCoercion(value, name); + node.setAttributeNS(namespace, name, "" + value); + } + } + function disabledLog() {} + function disableLogs() { + if (0 === disabledDepth) { + prevLog = console.log; + prevInfo = console.info; + prevWarn = console.warn; + prevError = console.error; + prevGroup = console.group; + prevGroupCollapsed = console.groupCollapsed; + prevGroupEnd = console.groupEnd; + var props = { + configurable: !0, + enumerable: !0, + value: disabledLog, + writable: !0 + }; + Object.defineProperties(console, { + info: props, + log: props, + warn: props, + error: props, + group: props, + groupCollapsed: props, + groupEnd: props + }); + } + disabledDepth++; + } + function reenableLogs() { + disabledDepth--; + if (0 === disabledDepth) { + var props = { configurable: !0, enumerable: !0, writable: !0 }; + Object.defineProperties(console, { + log: assign({}, props, { value: prevLog }), + info: assign({}, props, { value: prevInfo }), + warn: assign({}, props, { value: prevWarn }), + error: assign({}, props, { value: prevError }), + group: assign({}, props, { value: prevGroup }), + groupCollapsed: assign({}, props, { value: prevGroupCollapsed }), + groupEnd: assign({}, props, { value: prevGroupEnd }) + }); + } + 0 > disabledDepth && + console.error( + "disabledDepth fell below zero. This is a bug in React. Please file an issue." + ); + } + function describeBuiltInComponentFrame(name) { + if (void 0 === prefix) + try { + throw Error(); + } catch (x) { + var match = x.stack.trim().match(/\n( *(at )?)/); + prefix = (match && match[1]) || ""; + suffix = + -1 < x.stack.indexOf("\n at") + ? " ()" + : -1 < x.stack.indexOf("@") + ? "@unknown:0:0" + : ""; + } + return "\n" + prefix + name + suffix; + } + function describeNativeComponentFrame(fn, construct) { + if (!fn || reentry) return ""; + var frame = componentFrameCache.get(fn); + if (void 0 !== frame) return frame; + reentry = !0; + frame = Error.prepareStackTrace; + Error.prepareStackTrace = void 0; + var previousDispatcher = null; + previousDispatcher = ReactSharedInternals.H; + ReactSharedInternals.H = null; + disableLogs(); + try { + var RunInRootFrame = { + DetermineComponentFrameRoot: function () { + try { + if (construct) { + var Fake = function () { + throw Error(); + }; + Object.defineProperty(Fake.prototype, "props", { + set: function () { + throw Error(); + } + }); + if ("object" === typeof Reflect && Reflect.construct) { + try { + Reflect.construct(Fake, []); + } catch (x) { + var control = x; + } + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x$0) { + control = x$0; + } + fn.call(Fake.prototype); + } + } else { + try { + throw Error(); + } catch (x$1) { + control = x$1; + } + (Fake = fn()) && + "function" === typeof Fake.catch && + Fake.catch(function () {}); + } + } catch (sample) { + if (sample && control && "string" === typeof sample.stack) + return [sample.stack, control.stack]; + } + return [null, null]; + } + }; + RunInRootFrame.DetermineComponentFrameRoot.displayName = + "DetermineComponentFrameRoot"; + var namePropDescriptor = Object.getOwnPropertyDescriptor( + RunInRootFrame.DetermineComponentFrameRoot, + "name" + ); + namePropDescriptor && + namePropDescriptor.configurable && + Object.defineProperty( + RunInRootFrame.DetermineComponentFrameRoot, + "name", + { value: "DetermineComponentFrameRoot" } + ); + var _RunInRootFrame$Deter = + RunInRootFrame.DetermineComponentFrameRoot(), + sampleStack = _RunInRootFrame$Deter[0], + controlStack = _RunInRootFrame$Deter[1]; + if (sampleStack && controlStack) { + var sampleLines = sampleStack.split("\n"), + controlLines = controlStack.split("\n"); + for ( + _RunInRootFrame$Deter = namePropDescriptor = 0; + namePropDescriptor < sampleLines.length && + !sampleLines[namePropDescriptor].includes( + "DetermineComponentFrameRoot" + ); + + ) + namePropDescriptor++; + for ( + ; + _RunInRootFrame$Deter < controlLines.length && + !controlLines[_RunInRootFrame$Deter].includes( + "DetermineComponentFrameRoot" + ); + + ) + _RunInRootFrame$Deter++; + if ( + namePropDescriptor === sampleLines.length || + _RunInRootFrame$Deter === controlLines.length + ) + for ( + namePropDescriptor = sampleLines.length - 1, + _RunInRootFrame$Deter = controlLines.length - 1; + 1 <= namePropDescriptor && + 0 <= _RunInRootFrame$Deter && + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter]; + + ) + _RunInRootFrame$Deter--; + for ( + ; + 1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter; + namePropDescriptor--, _RunInRootFrame$Deter-- + ) + if ( + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter] + ) { + if (1 !== namePropDescriptor || 1 !== _RunInRootFrame$Deter) { + do + if ( + (namePropDescriptor--, + _RunInRootFrame$Deter--, + 0 > _RunInRootFrame$Deter || + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter]) + ) { + var _frame = + "\n" + + sampleLines[namePropDescriptor].replace( + " at new ", + " at " + ); + fn.displayName && + _frame.includes("") && + (_frame = _frame.replace("", fn.displayName)); + "function" === typeof fn && + componentFrameCache.set(fn, _frame); + return _frame; + } + while (1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter); + } + break; + } + } + } finally { + (reentry = !1), + (ReactSharedInternals.H = previousDispatcher), + reenableLogs(), + (Error.prepareStackTrace = frame); + } + sampleLines = (sampleLines = fn ? fn.displayName || fn.name : "") + ? describeBuiltInComponentFrame(sampleLines) + : ""; + "function" === typeof fn && componentFrameCache.set(fn, sampleLines); + return sampleLines; + } + function formatOwnerStack(error) { + var prevPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = void 0; + error = error.stack; + Error.prepareStackTrace = prevPrepareStackTrace; + error.startsWith("Error: react-stack-top-frame\n") && + (error = error.slice(29)); + prevPrepareStackTrace = error.indexOf("\n"); + -1 !== prevPrepareStackTrace && + (error = error.slice(prevPrepareStackTrace + 1)); + prevPrepareStackTrace = error.indexOf("react-stack-bottom-frame"); + -1 !== prevPrepareStackTrace && + (prevPrepareStackTrace = error.lastIndexOf( + "\n", + prevPrepareStackTrace + )); + if (-1 !== prevPrepareStackTrace) + error = error.slice(0, prevPrepareStackTrace); + else return ""; + return error; + } + function describeFiber(fiber) { + switch (fiber.tag) { + case 26: + case 27: + case 5: + return describeBuiltInComponentFrame(fiber.type); + case 16: + return describeBuiltInComponentFrame("Lazy"); + case 13: + return describeBuiltInComponentFrame("Suspense"); + case 19: + return describeBuiltInComponentFrame("SuspenseList"); + case 0: + case 15: + return describeNativeComponentFrame(fiber.type, !1); + case 11: + return describeNativeComponentFrame(fiber.type.render, !1); + case 1: + return describeNativeComponentFrame(fiber.type, !0); + case 31: + return describeBuiltInComponentFrame("Activity"); + default: + return ""; + } + } + function getStackByFiberInDevAndProd(workInProgress) { + try { + var info = ""; + do { + info += describeFiber(workInProgress); + var debugInfo = workInProgress._debugInfo; + if (debugInfo) + for (var i = debugInfo.length - 1; 0 <= i; i--) { + var entry = debugInfo[i]; + if ("string" === typeof entry.name) { + var JSCompiler_temp_const = info, + env = entry.env; + var JSCompiler_inline_result = describeBuiltInComponentFrame( + entry.name + (env ? " [" + env + "]" : "") + ); + info = JSCompiler_temp_const + JSCompiler_inline_result; + } + } + workInProgress = workInProgress.return; + } while (workInProgress); + return info; + } catch (x) { + return "\nError generating stack: " + x.message + "\n" + x.stack; + } + } + function describeFunctionComponentFrameWithoutLineNumber(fn) { + return (fn = fn ? fn.displayName || fn.name : "") + ? describeBuiltInComponentFrame(fn) + : ""; + } + function getCurrentFiberOwnerNameInDevOrNull() { + if (null === current) return null; + var owner = current._debugOwner; + return null != owner ? getComponentNameFromOwner(owner) : null; + } + function getCurrentFiberStackInDev() { + if (null === current) return ""; + var workInProgress = current; + try { + var info = ""; + 6 === workInProgress.tag && (workInProgress = workInProgress.return); + switch (workInProgress.tag) { + case 26: + case 27: + case 5: + info += describeBuiltInComponentFrame(workInProgress.type); + break; + case 13: + info += describeBuiltInComponentFrame("Suspense"); + break; + case 19: + info += describeBuiltInComponentFrame("SuspenseList"); + break; + case 31: + info += describeBuiltInComponentFrame("Activity"); + break; + case 30: + case 0: + case 15: + case 1: + workInProgress._debugOwner || + "" !== info || + (info += describeFunctionComponentFrameWithoutLineNumber( + workInProgress.type + )); + break; + case 11: + workInProgress._debugOwner || + "" !== info || + (info += describeFunctionComponentFrameWithoutLineNumber( + workInProgress.type.render + )); + } + for (; workInProgress; ) + if ("number" === typeof workInProgress.tag) { + var fiber = workInProgress; + workInProgress = fiber._debugOwner; + var debugStack = fiber._debugStack; + workInProgress && + debugStack && + ("string" !== typeof debugStack && + (fiber._debugStack = debugStack = formatOwnerStack(debugStack)), + "" !== debugStack && (info += "\n" + debugStack)); + } else if (null != workInProgress.debugStack) { + var ownerStack = workInProgress.debugStack; + (workInProgress = workInProgress.owner) && + ownerStack && + (info += "\n" + formatOwnerStack(ownerStack)); + } else break; + var JSCompiler_inline_result = info; + } catch (x) { + JSCompiler_inline_result = + "\nError generating stack: " + x.message + "\n" + x.stack; + } + return JSCompiler_inline_result; + } + function runWithFiberInDEV(fiber, callback, arg0, arg1, arg2, arg3, arg4) { + var previousFiber = current; + setCurrentFiber(fiber); + try { + return null !== fiber && fiber._debugTask + ? fiber._debugTask.run( + callback.bind(null, arg0, arg1, arg2, arg3, arg4) + ) + : callback(arg0, arg1, arg2, arg3, arg4); + } finally { + setCurrentFiber(previousFiber); + } + throw Error( + "runWithFiberInDEV should never be called in production. This is a bug in React." + ); + } + function setCurrentFiber(fiber) { + ReactSharedInternals.getCurrentStack = + null === fiber ? null : getCurrentFiberStackInDev; + isRendering = !1; + current = fiber; + } + function getToStringValue(value) { + switch (typeof value) { + case "bigint": + case "boolean": + case "number": + case "string": + case "undefined": + return value; + case "object": + return checkFormFieldValueStringCoercion(value), value; + default: + return ""; + } + } + function isCheckable(elem) { + var type = elem.type; + return ( + (elem = elem.nodeName) && + "input" === elem.toLowerCase() && + ("checkbox" === type || "radio" === type) + ); + } + function trackValueOnNode(node) { + var valueField = isCheckable(node) ? "checked" : "value", + descriptor = Object.getOwnPropertyDescriptor( + node.constructor.prototype, + valueField + ); + checkFormFieldValueStringCoercion(node[valueField]); + var currentValue = "" + node[valueField]; + if ( + !node.hasOwnProperty(valueField) && + "undefined" !== typeof descriptor && + "function" === typeof descriptor.get && + "function" === typeof descriptor.set + ) { + var get = descriptor.get, + set = descriptor.set; + Object.defineProperty(node, valueField, { + configurable: !0, + get: function () { + return get.call(this); + }, + set: function (value) { + checkFormFieldValueStringCoercion(value); + currentValue = "" + value; + set.call(this, value); + } + }); + Object.defineProperty(node, valueField, { + enumerable: descriptor.enumerable + }); + return { + getValue: function () { + return currentValue; + }, + setValue: function (value) { + checkFormFieldValueStringCoercion(value); + currentValue = "" + value; + }, + stopTracking: function () { + node._valueTracker = null; + delete node[valueField]; + } + }; + } + } + function track(node) { + node._valueTracker || (node._valueTracker = trackValueOnNode(node)); + } + function updateValueIfChanged(node) { + if (!node) return !1; + var tracker = node._valueTracker; + if (!tracker) return !0; + var lastValue = tracker.getValue(); + var value = ""; + node && + (value = isCheckable(node) + ? node.checked + ? "true" + : "false" + : node.value); + node = value; + return node !== lastValue ? (tracker.setValue(node), !0) : !1; + } + function getActiveElement(doc) { + doc = doc || ("undefined" !== typeof document ? document : void 0); + if ("undefined" === typeof doc) return null; + try { + return doc.activeElement || doc.body; + } catch (e) { + return doc.body; + } + } + function escapeSelectorAttributeValueInsideDoubleQuotes(value) { + return value.replace( + escapeSelectorAttributeValueInsideDoubleQuotesRegex, + function (ch) { + return "\\" + ch.charCodeAt(0).toString(16) + " "; + } + ); + } + function validateInputProps(element, props) { + void 0 === props.checked || + void 0 === props.defaultChecked || + didWarnCheckedDefaultChecked || + (console.error( + "%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://react.dev/link/controlled-components", + getCurrentFiberOwnerNameInDevOrNull() || "A component", + props.type + ), + (didWarnCheckedDefaultChecked = !0)); + void 0 === props.value || + void 0 === props.defaultValue || + didWarnValueDefaultValue$1 || + (console.error( + "%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://react.dev/link/controlled-components", + getCurrentFiberOwnerNameInDevOrNull() || "A component", + props.type + ), + (didWarnValueDefaultValue$1 = !0)); + } + function updateInput( + element, + value, + defaultValue, + lastDefaultValue, + checked, + defaultChecked, + type, + name + ) { + element.name = ""; + null != type && + "function" !== typeof type && + "symbol" !== typeof type && + "boolean" !== typeof type + ? (checkAttributeStringCoercion(type, "type"), (element.type = type)) + : element.removeAttribute("type"); + if (null != value) + if ("number" === type) { + if ((0 === value && "" === element.value) || element.value != value) + element.value = "" + getToStringValue(value); + } else + element.value !== "" + getToStringValue(value) && + (element.value = "" + getToStringValue(value)); + else + ("submit" !== type && "reset" !== type) || + element.removeAttribute("value"); + null != value + ? setDefaultValue(element, type, getToStringValue(value)) + : null != defaultValue + ? setDefaultValue(element, type, getToStringValue(defaultValue)) + : null != lastDefaultValue && element.removeAttribute("value"); + null == checked && + null != defaultChecked && + (element.defaultChecked = !!defaultChecked); + null != checked && + (element.checked = + checked && + "function" !== typeof checked && + "symbol" !== typeof checked); + null != name && + "function" !== typeof name && + "symbol" !== typeof name && + "boolean" !== typeof name + ? (checkAttributeStringCoercion(name, "name"), + (element.name = "" + getToStringValue(name))) + : element.removeAttribute("name"); + } + function initInput( + element, + value, + defaultValue, + checked, + defaultChecked, + type, + name, + isHydrating + ) { + null != type && + "function" !== typeof type && + "symbol" !== typeof type && + "boolean" !== typeof type && + (checkAttributeStringCoercion(type, "type"), (element.type = type)); + if (null != value || null != defaultValue) { + if ( + !( + ("submit" !== type && "reset" !== type) || + (void 0 !== value && null !== value) + ) + ) + return; + defaultValue = + null != defaultValue ? "" + getToStringValue(defaultValue) : ""; + value = null != value ? "" + getToStringValue(value) : defaultValue; + isHydrating || value === element.value || (element.value = value); + element.defaultValue = value; + } + checked = null != checked ? checked : defaultChecked; + checked = + "function" !== typeof checked && + "symbol" !== typeof checked && + !!checked; + element.checked = isHydrating ? element.checked : !!checked; + element.defaultChecked = !!checked; + null != name && + "function" !== typeof name && + "symbol" !== typeof name && + "boolean" !== typeof name && + (checkAttributeStringCoercion(name, "name"), (element.name = name)); + } + function setDefaultValue(node, type, value) { + ("number" === type && getActiveElement(node.ownerDocument) === node) || + node.defaultValue === "" + value || + (node.defaultValue = "" + value); + } + function validateOptionProps(element, props) { + null == props.value && + ("object" === typeof props.children && null !== props.children + ? React.Children.forEach(props.children, function (child) { + null == child || + "string" === typeof child || + "number" === typeof child || + "bigint" === typeof child || + didWarnInvalidChild || + ((didWarnInvalidChild = !0), + console.error( + "Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to