@avis-studio/engine 0.0.0-stage → 0.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +193 -2
- package/THIRD_PARTY_NOTICES.md +29 -0
- package/dist/a11y/focus.d.ts +60 -0
- package/dist/a11y/focus.js +222 -0
- package/dist/a11y/index.d.ts +2 -0
- package/dist/a11y/index.js +4 -0
- package/dist/a11y/semantics.d.ts +37 -0
- package/dist/a11y/semantics.js +88 -0
- package/dist/commands/builtins.d.ts +88 -0
- package/dist/commands/builtins.js +362 -0
- package/dist/commands/command.d.ts +23 -0
- package/dist/commands/command.js +20 -0
- package/dist/commands/draft.d.ts +33 -0
- package/dist/commands/draft.js +96 -0
- package/dist/commands/history.d.ts +34 -0
- package/dist/commands/history.js +80 -0
- package/dist/commands/index.d.ts +6 -0
- package/dist/commands/index.js +6 -0
- package/dist/commands/patch.d.ts +24 -0
- package/dist/commands/patch.js +44 -0
- package/dist/commands/transaction.d.ts +16 -0
- package/dist/commands/transaction.js +39 -0
- package/dist/core/diagnostics.d.ts +23 -0
- package/dist/core/diagnostics.js +23 -0
- package/dist/core/disposable.d.ts +14 -0
- package/dist/core/disposable.js +51 -0
- package/dist/core/engine.d.ts +108 -0
- package/dist/core/engine.js +323 -0
- package/dist/core/event-bus.d.ts +10 -0
- package/dist/core/event-bus.js +33 -0
- package/dist/core/ids.d.ts +13 -0
- package/dist/core/ids.js +6 -0
- package/dist/core/index.d.ts +7 -0
- package/dist/core/index.js +7 -0
- package/dist/core/plugin.d.ts +20 -0
- package/dist/core/plugin.js +47 -0
- package/dist/core/services.d.ts +14 -0
- package/dist/core/services.js +20 -0
- package/dist/devtools/index.d.ts +1 -0
- package/dist/devtools/index.js +2 -0
- package/dist/devtools/panel.d.ts +39 -0
- package/dist/devtools/panel.js +100 -0
- package/dist/dom/a11y-layer.d.ts +32 -0
- package/dist/dom/a11y-layer.js +358 -0
- package/dist/dom/anchor.d.ts +34 -0
- package/dist/dom/anchor.js +35 -0
- package/dist/dom/index.d.ts +6 -0
- package/dist/dom/index.js +8 -0
- package/dist/dom/menu.d.ts +24 -0
- package/dist/dom/menu.js +122 -0
- package/dist/dom/overlays.d.ts +29 -0
- package/dist/dom/overlays.js +82 -0
- package/dist/dom/paint/collect.d.ts +8 -0
- package/dist/dom/paint/collect.js +589 -0
- package/dist/dom/paint/css.d.ts +86 -0
- package/dist/dom/paint/css.js +526 -0
- package/dist/dom/paint/draw.d.ts +16 -0
- package/dist/dom/paint/draw.js +413 -0
- package/dist/dom/paint/ghost.d.ts +2 -0
- package/dist/dom/paint/ghost.js +8 -0
- package/dist/dom/paint/index.d.ts +6 -0
- package/dist/dom/paint/index.js +9 -0
- package/dist/dom/paint/text.d.ts +26 -0
- package/dist/dom/paint/text.js +209 -0
- package/dist/dom/paint/types.d.ts +174 -0
- package/dist/dom/paint/types.js +7 -0
- package/dist/dom/paint/watch.d.ts +10 -0
- package/dist/dom/paint/watch.js +109 -0
- package/dist/dom/position.d.ts +37 -0
- package/dist/dom/position.js +125 -0
- package/dist/dom/text-editor.d.ts +27 -0
- package/dist/dom/text-editor.js +128 -0
- package/dist/events/event.d.ts +122 -0
- package/dist/events/event.js +130 -0
- package/dist/events/eventer.d.ts +24 -0
- package/dist/events/eventer.js +83 -0
- package/dist/events/index.d.ts +3 -0
- package/dist/events/index.js +3 -0
- package/dist/events/interaction.d.ts +43 -0
- package/dist/events/interaction.js +203 -0
- package/dist/geometry/anchors.d.ts +14 -0
- package/dist/geometry/anchors.js +13 -0
- package/dist/geometry/bounds.d.ts +16 -0
- package/dist/geometry/bounds.js +42 -0
- package/dist/geometry/curves.d.ts +39 -0
- package/dist/geometry/curves.js +68 -0
- package/dist/geometry/index.d.ts +6 -0
- package/dist/geometry/index.js +6 -0
- package/dist/geometry/matrix.d.ts +22 -0
- package/dist/geometry/matrix.js +56 -0
- package/dist/geometry/spaces.d.ts +22 -0
- package/dist/geometry/spaces.js +28 -0
- package/dist/geometry/vec2.d.ts +12 -0
- package/dist/geometry/vec2.js +10 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +22 -0
- package/dist/interaction/behaviors.d.ts +10 -0
- package/dist/interaction/behaviors.js +744 -0
- package/dist/interaction/controller.d.ts +180 -0
- package/dist/interaction/controller.js +269 -0
- package/dist/interaction/hit-test.d.ts +45 -0
- package/dist/interaction/hit-test.js +119 -0
- package/dist/interaction/index.d.ts +4 -0
- package/dist/interaction/index.js +7 -0
- package/dist/interaction/web-input.d.ts +13 -0
- package/dist/interaction/web-input.js +172 -0
- package/dist/layout/index.d.ts +1 -0
- package/dist/layout/index.js +2 -0
- package/dist/layout/layout.d.ts +27 -0
- package/dist/layout/layout.js +266 -0
- package/dist/react/canvas/graph.d.ts +83 -0
- package/dist/react/canvas/graph.js +89 -0
- package/dist/react/canvas/hooks.d.ts +42 -0
- package/dist/react/canvas/hooks.js +78 -0
- package/dist/react/canvas/index.d.ts +35 -0
- package/dist/react/canvas/index.js +8 -0
- package/dist/react/components.d.ts +55 -0
- package/dist/react/components.js +197 -0
- package/dist/react/context.d.ts +4 -0
- package/dist/react/context.js +9 -0
- package/dist/react/flow/api/LICENSE +21 -0
- package/dist/react/flow/api/externals.d.ts +12 -0
- package/dist/react/flow/api/react/additional-components/Background/Background.d.ts +7 -0
- package/dist/react/flow/api/react/additional-components/Background/Patterns.d.ts +17 -0
- package/dist/react/flow/api/react/additional-components/Background/index.d.ts +2 -0
- package/dist/react/flow/api/react/additional-components/Background/types.d.ts +25 -0
- package/dist/react/flow/api/react/additional-components/Controls/ControlButton.d.ts +2 -0
- package/dist/react/flow/api/react/additional-components/Controls/Controls.d.ts +7 -0
- package/dist/react/flow/api/react/additional-components/Controls/Icons/FitView.d.ts +1 -0
- package/dist/react/flow/api/react/additional-components/Controls/Icons/Lock.d.ts +1 -0
- package/dist/react/flow/api/react/additional-components/Controls/Icons/Minus.d.ts +1 -0
- package/dist/react/flow/api/react/additional-components/Controls/Icons/Plus.d.ts +1 -0
- package/dist/react/flow/api/react/additional-components/Controls/Icons/Unlock.d.ts +1 -0
- package/dist/react/flow/api/react/additional-components/Controls/index.d.ts +3 -0
- package/dist/react/flow/api/react/additional-components/Controls/types.d.ts +20 -0
- package/dist/react/flow/api/react/additional-components/EdgeToolbar/EdgeToolbar.d.ts +2 -0
- package/dist/react/flow/api/react/additional-components/EdgeToolbar/index.d.ts +2 -0
- package/dist/react/flow/api/react/additional-components/EdgeToolbar/types.d.ts +6 -0
- package/dist/react/flow/api/react/additional-components/MiniMap/MiniMap.d.ts +8 -0
- package/dist/react/flow/api/react/additional-components/MiniMap/MiniMapNode.d.ts +4 -0
- package/dist/react/flow/api/react/additional-components/MiniMap/MiniMapNodes.d.ts +5 -0
- package/dist/react/flow/api/react/additional-components/MiniMap/index.d.ts +3 -0
- package/dist/react/flow/api/react/additional-components/MiniMap/types.d.ts +44 -0
- package/dist/react/flow/api/react/additional-components/NodeResizer/NodeResizeControl.d.ts +5 -0
- package/dist/react/flow/api/react/additional-components/NodeResizer/NodeResizer.d.ts +2 -0
- package/dist/react/flow/api/react/additional-components/NodeResizer/index.d.ts +3 -0
- package/dist/react/flow/api/react/additional-components/NodeResizer/types.d.ts +32 -0
- package/dist/react/flow/api/react/additional-components/NodeToolbar/NodeToolbar.d.ts +2 -0
- package/dist/react/flow/api/react/additional-components/NodeToolbar/NodeToolbarPortal.d.ts +4 -0
- package/dist/react/flow/api/react/additional-components/NodeToolbar/index.d.ts +2 -0
- package/dist/react/flow/api/react/additional-components/NodeToolbar/types.d.ts +9 -0
- package/dist/react/flow/api/react/additional-components/index.d.ts +6 -0
- package/dist/react/flow/api/react/components/A11yDescriptions/index.d.ts +7 -0
- package/dist/react/flow/api/react/components/Attribution/index.d.ts +8 -0
- package/dist/react/flow/api/react/components/BatchProvider/index.d.ts +10 -0
- package/dist/react/flow/api/react/components/BatchProvider/types.d.ts +6 -0
- package/dist/react/flow/api/react/components/BatchProvider/useQueue.d.ts +2 -0
- package/dist/react/flow/api/react/components/ConnectionLine/index.d.ts +11 -0
- package/dist/react/flow/api/react/components/EdgeLabelRenderer/index.d.ts +5 -0
- package/dist/react/flow/api/react/components/EdgeWrapper/EdgeUpdateAnchors.d.ts +14 -0
- package/dist/react/flow/api/react/components/EdgeWrapper/index.d.ts +5 -0
- package/dist/react/flow/api/react/components/EdgeWrapper/utils.d.ts +11 -0
- package/dist/react/flow/api/react/components/Edges/BaseEdge.d.ts +2 -0
- package/dist/react/flow/api/react/components/Edges/BezierEdge.d.ts +4 -0
- package/dist/react/flow/api/react/components/Edges/EdgeAnchor.d.ts +13 -0
- package/dist/react/flow/api/react/components/Edges/EdgeText.d.ts +7 -0
- package/dist/react/flow/api/react/components/Edges/SimpleBezierEdge.d.ts +20 -0
- package/dist/react/flow/api/react/components/Edges/SmoothStepEdge.d.ts +4 -0
- package/dist/react/flow/api/react/components/Edges/StepEdge.d.ts +4 -0
- package/dist/react/flow/api/react/components/Edges/StraightEdge.d.ts +4 -0
- package/dist/react/flow/api/react/components/Edges/index.d.ts +5 -0
- package/dist/react/flow/api/react/components/Handle/index.d.ts +8 -0
- package/dist/react/flow/api/react/components/NodeWrapper/index.d.ts +4 -0
- package/dist/react/flow/api/react/components/NodeWrapper/useNodeObserver.d.ts +7 -0
- package/dist/react/flow/api/react/components/NodeWrapper/utils.d.ts +8 -0
- package/dist/react/flow/api/react/components/Nodes/DefaultNode.d.ts +2 -0
- package/dist/react/flow/api/react/components/Nodes/GroupNode.d.ts +1 -0
- package/dist/react/flow/api/react/components/Nodes/InputNode.d.ts +2 -0
- package/dist/react/flow/api/react/components/Nodes/OutputNode.d.ts +2 -0
- package/dist/react/flow/api/react/components/Nodes/utils.d.ts +12 -0
- package/dist/react/flow/api/react/components/NodesSelection/index.d.ts +8 -0
- package/dist/react/flow/api/react/components/Panel/index.d.ts +8 -0
- package/dist/react/flow/api/react/components/ReactFlowProvider/index.d.ts +20 -0
- package/dist/react/flow/api/react/components/SelectionListener/index.d.ts +6 -0
- package/dist/react/flow/api/react/components/StoreUpdater/index.d.ts +67 -0
- package/dist/react/flow/api/react/components/UserSelection/index.d.ts +1 -0
- package/dist/react/flow/api/react/components/ViewportPortal/index.d.ts +4 -0
- package/dist/react/flow/api/react/container/EdgeRenderer/MarkerDefinitions.d.ts +9 -0
- package/dist/react/flow/api/react/container/EdgeRenderer/MarkerSymbols.d.ts +8 -0
- package/dist/react/flow/api/react/container/EdgeRenderer/index.d.ts +12 -0
- package/dist/react/flow/api/react/container/FlowRenderer/index.d.ts +13 -0
- package/dist/react/flow/api/react/container/GraphView/index.d.ts +10 -0
- package/dist/react/flow/api/react/container/GraphView/useNodeOrEdgeTypesWarning.d.ts +3 -0
- package/dist/react/flow/api/react/container/GraphView/useStylesLoadedWarning.d.ts +1 -0
- package/dist/react/flow/api/react/container/NodeRenderer/index.d.ts +9 -0
- package/dist/react/flow/api/react/container/NodeRenderer/useResizeObserver.d.ts +1 -0
- package/dist/react/flow/api/react/container/Pane/index.d.ts +10 -0
- package/dist/react/flow/api/react/container/ReactFlow/Wrapper.d.ts +19 -0
- package/dist/react/flow/api/react/container/ReactFlow/index.d.ts +3 -0
- package/dist/react/flow/api/react/container/ReactFlow/init-values.d.ts +3 -0
- package/dist/react/flow/api/react/container/Viewport/index.d.ts +6 -0
- package/dist/react/flow/api/react/container/ZoomPane/index.d.ts +7 -0
- package/dist/react/flow/api/react/contexts/HandleConfigContext.d.ts +11 -0
- package/dist/react/flow/api/react/contexts/NodeIdContext.d.ts +5 -0
- package/dist/react/flow/api/react/contexts/StoreContext.d.ts +3 -0
- package/dist/react/flow/api/react/hooks/useColorModeClass.d.ts +2 -0
- package/dist/react/flow/api/react/hooks/useConnection.d.ts +3 -0
- package/dist/react/flow/api/react/hooks/useDrag.d.ts +12 -0
- package/dist/react/flow/api/react/hooks/useEdges.d.ts +2 -0
- package/dist/react/flow/api/react/hooks/useGlobalKeyHandler.d.ts +5 -0
- package/dist/react/flow/api/react/hooks/useHandleConnections.d.ts +10 -0
- package/dist/react/flow/api/react/hooks/useInternalNode.d.ts +2 -0
- package/dist/react/flow/api/react/hooks/useIsomorphicLayoutEffect.d.ts +2 -0
- package/dist/react/flow/api/react/hooks/useKeyPress.d.ts +7 -0
- package/dist/react/flow/api/react/hooks/useMoveSelectedNodes.d.ts +5 -0
- package/dist/react/flow/api/react/hooks/useNodeConnections.d.ts +2 -0
- package/dist/react/flow/api/react/hooks/useNodes.d.ts +2 -0
- package/dist/react/flow/api/react/hooks/useNodesData.d.ts +4 -0
- package/dist/react/flow/api/react/hooks/useNodesEdgesState.d.ts +12 -0
- package/dist/react/flow/api/react/hooks/useNodesInitialized.d.ts +4 -0
- package/dist/react/flow/api/react/hooks/useOnEdgesChangeMiddleware.d.ts +3 -0
- package/dist/react/flow/api/react/hooks/useOnInitHandler.d.ts +2 -0
- package/dist/react/flow/api/react/hooks/useOnNodesChangeMiddleware.d.ts +3 -0
- package/dist/react/flow/api/react/hooks/useOnSelectionChange.d.ts +5 -0
- package/dist/react/flow/api/react/hooks/useOnViewportChange.d.ts +7 -0
- package/dist/react/flow/api/react/hooks/useReactFlow.d.ts +2 -0
- package/dist/react/flow/api/react/hooks/useResizeHandler.d.ts +2 -0
- package/dist/react/flow/api/react/hooks/useStore.d.ts +8 -0
- package/dist/react/flow/api/react/hooks/useUpdateNodeInternals.d.ts +2 -0
- package/dist/react/flow/api/react/hooks/useViewport.d.ts +2 -0
- package/dist/react/flow/api/react/hooks/useViewportHelper.d.ts +3 -0
- package/dist/react/flow/api/react/hooks/useViewportSync.d.ts +2 -0
- package/dist/react/flow/api/react/hooks/useVisibleEdgeIds.d.ts +1 -0
- package/dist/react/flow/api/react/hooks/useVisibleNodeIds.d.ts +1 -0
- package/dist/react/flow/api/react/index.d.ts +41 -0
- package/dist/react/flow/api/react/store/index.d.ts +18 -0
- package/dist/react/flow/api/react/store/initialState.d.ts +18 -0
- package/dist/react/flow/api/react/styles/utils.d.ts +2 -0
- package/dist/react/flow/api/react/types/component-props.d.ts +127 -0
- package/dist/react/flow/api/react/types/edges.d.ts +111 -0
- package/dist/react/flow/api/react/types/general.d.ts +53 -0
- package/dist/react/flow/api/react/types/index.d.ts +6 -0
- package/dist/react/flow/api/react/types/instance.d.ts +64 -0
- package/dist/react/flow/api/react/types/nodes.d.ts +41 -0
- package/dist/react/flow/api/react/types/store.d.ts +114 -0
- package/dist/react/flow/api/react/utils/changes.d.ts +15 -0
- package/dist/react/flow/api/react/utils/edges.d.ts +3 -0
- package/dist/react/flow/api/react/utils/general.d.ts +5 -0
- package/dist/react/flow/api/react/utils/index.d.ts +3 -0
- package/dist/react/flow/api/system/constants.d.ts +43 -0
- package/dist/react/flow/api/system/index.d.ts +8 -0
- package/dist/react/flow/api/system/types/changes.d.ts +48 -0
- package/dist/react/flow/api/system/types/edges.d.ts +72 -0
- package/dist/react/flow/api/system/types/general.d.ts +175 -0
- package/dist/react/flow/api/system/types/handles.d.ts +21 -0
- package/dist/react/flow/api/system/types/index.d.ts +7 -0
- package/dist/react/flow/api/system/types/nodes.d.ts +89 -0
- package/dist/react/flow/api/system/types/panzoom.d.ts +58 -0
- package/dist/react/flow/api/system/types/utils.d.ts +46 -0
- package/dist/react/flow/api/system/utils/attribution.d.ts +1 -0
- package/dist/react/flow/api/system/utils/connections.d.ts +4 -0
- package/dist/react/flow/api/system/utils/dom.d.ts +20 -0
- package/dist/react/flow/api/system/utils/edge-toolbar.d.ts +1 -0
- package/dist/react/flow/api/system/utils/edges/bezier-edge.d.ts +40 -0
- package/dist/react/flow/api/system/utils/edges/general.d.ts +44 -0
- package/dist/react/flow/api/system/utils/edges/index.d.ts +5 -0
- package/dist/react/flow/api/system/utils/edges/positions.d.ts +16 -0
- package/dist/react/flow/api/system/utils/edges/smoothstep-edge.d.ts +21 -0
- package/dist/react/flow/api/system/utils/edges/straight-edge.d.ts +13 -0
- package/dist/react/flow/api/system/utils/general.d.ts +56 -0
- package/dist/react/flow/api/system/utils/graph.d.ts +45 -0
- package/dist/react/flow/api/system/utils/index.d.ts +12 -0
- package/dist/react/flow/api/system/utils/marker.d.ts +8 -0
- package/dist/react/flow/api/system/utils/node-toolbar.d.ts +2 -0
- package/dist/react/flow/api/system/utils/shallow-node-data.d.ts +4 -0
- package/dist/react/flow/api/system/utils/store.d.ts +33 -0
- package/dist/react/flow/api/system/utils/types.d.ts +7 -0
- package/dist/react/flow/api/system/xydrag/XYDrag.d.ts +56 -0
- package/dist/react/flow/api/system/xydrag/index.d.ts +1 -0
- package/dist/react/flow/api/system/xydrag/utils.d.ts +22 -0
- package/dist/react/flow/api/system/xyhandle/XYHandle.d.ts +2 -0
- package/dist/react/flow/api/system/xyhandle/index.d.ts +1 -0
- package/dist/react/flow/api/system/xyhandle/types.d.ts +49 -0
- package/dist/react/flow/api/system/xyhandle/utils.d.ts +9 -0
- package/dist/react/flow/api/system/xyminimap/index.d.ts +27 -0
- package/dist/react/flow/api/system/xypanzoom/XYPanZoom.d.ts +11 -0
- package/dist/react/flow/api/system/xypanzoom/eventhandler.d.ts +45 -0
- package/dist/react/flow/api/system/xypanzoom/filter.d.ts +15 -0
- package/dist/react/flow/api/system/xypanzoom/index.d.ts +1 -0
- package/dist/react/flow/api/system/xypanzoom/utils.d.ts +8 -0
- package/dist/react/flow/api/system/xyresizer/XYResizer.d.ts +51 -0
- package/dist/react/flow/api/system/xyresizer/index.d.ts +2 -0
- package/dist/react/flow/api/system/xyresizer/types.d.ts +26 -0
- package/dist/react/flow/api/system/xyresizer/utils.d.ts +41 -0
- package/dist/react/flow/components.d.ts +148 -0
- package/dist/react/flow/components.js +526 -0
- package/dist/react/flow/configuration.d.ts +6 -0
- package/dist/react/flow/configuration.js +27 -0
- package/dist/react/flow/drag.d.ts +14 -0
- package/dist/react/flow/drag.js +273 -0
- package/dist/react/flow/extras.d.ts +155 -0
- package/dist/react/flow/extras.js +317 -0
- package/dist/react/flow/handle.d.ts +21 -0
- package/dist/react/flow/handle.js +149 -0
- package/dist/react/flow/hooks.d.ts +47 -0
- package/dist/react/flow/hooks.js +131 -0
- package/dist/react/flow/index.d.ts +78 -0
- package/dist/react/flow/index.js +73 -0
- package/dist/react/flow/queries.d.ts +20 -0
- package/dist/react/flow/queries.js +30 -0
- package/dist/react/flow/react-flow.d.ts +73 -0
- package/dist/react/flow/react-flow.js +1445 -0
- package/dist/react/flow/resize.d.ts +30 -0
- package/dist/react/flow/resize.js +49 -0
- package/dist/react/flow/store.d.ts +412 -0
- package/dist/react/flow/store.js +713 -0
- package/dist/react/flow/style.css +630 -0
- package/dist/react/flow/style.css.d.ts +2 -0
- package/dist/react/flow/system.d.ts +146 -0
- package/dist/react/flow/system.js +300 -0
- package/dist/react/flow/types.d.ts +131 -0
- package/dist/react/flow/types.js +1 -0
- package/dist/react/flow/utils.d.ts +77 -0
- package/dist/react/flow/utils.js +285 -0
- package/dist/react/hooks.d.ts +14 -0
- package/dist/react/hooks.js +44 -0
- package/dist/react/index.d.ts +3 -0
- package/dist/react/index.js +5 -0
- package/dist/render/backend.d.ts +26 -0
- package/dist/render/backend.js +5 -0
- package/dist/render/canvas2d/backend.d.ts +7 -0
- package/dist/render/canvas2d/backend.js +122 -0
- package/dist/render/canvas2d/index.d.ts +1 -0
- package/dist/render/canvas2d/index.js +2 -0
- package/dist/render/color.d.ts +9 -0
- package/dist/render/color.js +69 -0
- package/dist/render/commands.d.ts +69 -0
- package/dist/render/commands.js +1 -0
- package/dist/render/display-list.d.ts +65 -0
- package/dist/render/display-list.js +316 -0
- package/dist/render/images.d.ts +35 -0
- package/dist/render/images.js +83 -0
- package/dist/render/index.d.ts +14 -0
- package/dist/render/index.js +16 -0
- package/dist/render/painters.d.ts +35 -0
- package/dist/render/painters.js +109 -0
- package/dist/render/renderer.d.ts +70 -0
- package/dist/render/renderer.js +162 -0
- package/dist/render/scene-index.d.ts +21 -0
- package/dist/render/scene-index.js +64 -0
- package/dist/render/text.d.ts +8 -0
- package/dist/render/text.js +100 -0
- package/dist/render/theme.d.ts +21 -0
- package/dist/render/theme.js +33 -0
- package/dist/render/ui.d.ts +63 -0
- package/dist/render/ui.js +188 -0
- package/dist/render/webgl2/atlas.d.ts +36 -0
- package/dist/render/webgl2/atlas.js +93 -0
- package/dist/render/webgl2/backend.d.ts +19 -0
- package/dist/render/webgl2/backend.js +338 -0
- package/dist/render/webgl2/index.d.ts +2 -0
- package/dist/render/webgl2/index.js +3 -0
- package/dist/render/webgl2/shaders.d.ts +6 -0
- package/dist/render/webgl2/shaders.js +112 -0
- package/dist/render/webgpu/index.d.ts +1 -0
- package/dist/render/webgpu/index.js +3 -0
- package/dist/scene/builtins.d.ts +25 -0
- package/dist/scene/builtins.js +60 -0
- package/dist/scene/dirty.d.ts +11 -0
- package/dist/scene/dirty.js +10 -0
- package/dist/scene/index.d.ts +5 -0
- package/dist/scene/index.js +5 -0
- package/dist/scene/record.d.ts +40 -0
- package/dist/scene/record.js +12 -0
- package/dist/scene/scene-graph.d.ts +58 -0
- package/dist/scene/scene-graph.js +178 -0
- package/dist/scene/schema.d.ts +27 -0
- package/dist/scene/schema.js +32 -0
- package/dist/sdk/create-avis.d.ts +109 -0
- package/dist/sdk/create-avis.js +162 -0
- package/dist/sdk/index.d.ts +1 -0
- package/dist/sdk/index.js +2 -0
- package/dist/serialization/format.d.ts +46 -0
- package/dist/serialization/format.js +20 -0
- package/dist/serialization/index.d.ts +3 -0
- package/dist/serialization/index.js +3 -0
- package/dist/serialization/migrate.d.ts +7 -0
- package/dist/serialization/migrate.js +54 -0
- package/dist/serialization/serialize.d.ts +10 -0
- package/dist/serialization/serialize.js +114 -0
- package/dist/state/index.d.ts +2 -0
- package/dist/state/index.js +2 -0
- package/dist/state/selector.d.ts +6 -0
- package/dist/state/selector.js +29 -0
- package/dist/state/store.d.ts +91 -0
- package/dist/state/store.js +102 -0
- package/dist/style/computed.d.ts +84 -0
- package/dist/style/computed.js +296 -0
- package/dist/style/index.d.ts +6 -0
- package/dist/style/index.js +8 -0
- package/dist/style/style-engine.d.ts +33 -0
- package/dist/style/style-engine.js +113 -0
- package/dist/style/tokens.d.ts +49 -0
- package/dist/style/tokens.js +142 -0
- package/dist/style/utilities.d.ts +34 -0
- package/dist/style/utilities.js +341 -0
- package/dist/style/values.d.ts +30 -0
- package/dist/style/values.js +361 -0
- package/dist/style/variants.d.ts +38 -0
- package/dist/style/variants.js +55 -0
- package/dist/sync/index.d.ts +2 -0
- package/dist/sync/index.js +1 -0
- package/dist/sync/save-queue.d.ts +24 -0
- package/dist/sync/save-queue.js +88 -0
- package/dist/wasm/index.d.ts +2 -0
- package/dist/wasm/index.js +2 -0
- package/dist/wasm/load.d.ts +7 -0
- package/dist/wasm/load.js +47 -0
- package/dist/wasm/pkg/avis_engine_wasm.d.ts +84 -0
- package/dist/wasm/pkg/avis_engine_wasm.js +339 -0
- package/dist/wasm/pkg/avis_engine_wasm_bg.wasm +0 -0
- package/dist/wasm/reference.d.ts +38 -0
- package/dist/wasm/reference.js +174 -0
- package/package.json +76 -4
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Rect, XY } from "./types.js";
|
|
2
|
+
export type ResizeOptions = {
|
|
3
|
+
minWidth: number;
|
|
4
|
+
minHeight: number;
|
|
5
|
+
maxWidth: number;
|
|
6
|
+
maxHeight: number;
|
|
7
|
+
keepAspectRatio?: boolean;
|
|
8
|
+
resizeDirection?: "horizontal" | "vertical";
|
|
9
|
+
origin?: [number, number];
|
|
10
|
+
snapGrid?: [number, number];
|
|
11
|
+
extent?: [[number, number], [number, number]];
|
|
12
|
+
childExtent?: [[number, number], [number, number]];
|
|
13
|
+
};
|
|
14
|
+
export type ResizeResult = Rect & {
|
|
15
|
+
direction: number[];
|
|
16
|
+
};
|
|
17
|
+
export type ResizeEvent = {
|
|
18
|
+
type: "start" | "drag" | "end";
|
|
19
|
+
sourceEvent: PointerEvent;
|
|
20
|
+
x: number;
|
|
21
|
+
y: number;
|
|
22
|
+
dx: number;
|
|
23
|
+
dy: number;
|
|
24
|
+
subject: XY;
|
|
25
|
+
identifier: number;
|
|
26
|
+
active: number;
|
|
27
|
+
};
|
|
28
|
+
export declare function expandResizeBounds(parent: Rect, child: Rect): Rect;
|
|
29
|
+
/** Solve both dimensions together, so ratio enforcement cannot exceed max/min. */
|
|
30
|
+
export declare function resizeRect(start: Rect, delta: XY, control: string, options: ResizeOptions): ResizeResult;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export function expandResizeBounds(parent, child) {
|
|
2
|
+
const x = Math.min(parent.x, child.x), y = Math.min(parent.y, child.y);
|
|
3
|
+
return { x, y, width: Math.max(parent.x + parent.width, child.x + child.width) - x, height: Math.max(parent.y + parent.height, child.y + child.height) - y };
|
|
4
|
+
}
|
|
5
|
+
/** Solve both dimensions together, so ratio enforcement cannot exceed max/min. */
|
|
6
|
+
export function resizeRect(start, delta, control, options) {
|
|
7
|
+
const left = control.includes("left"), top = control.includes("top");
|
|
8
|
+
const horizontal = (left || control.includes("right")) && options.resizeDirection !== "vertical";
|
|
9
|
+
const vertical = (top || control.includes("bottom")) && options.resizeDirection !== "horizontal";
|
|
10
|
+
const dx = options.snapGrid ? Math.round(delta.x / options.snapGrid[0]) * options.snapGrid[0] : delta.x;
|
|
11
|
+
const dy = options.snapGrid ? Math.round(delta.y / options.snapGrid[1]) * options.snapGrid[1] : delta.y;
|
|
12
|
+
let width = horizontal ? start.width + (left ? -dx : dx) : start.width;
|
|
13
|
+
let height = vertical ? start.height + (top ? -dy : dy) : start.height;
|
|
14
|
+
const clamp = (v, min, max) => Math.max(min, Math.min(max, v));
|
|
15
|
+
const ratio = start.width / start.height;
|
|
16
|
+
const [ox, oy] = options.origin ?? [0, 0];
|
|
17
|
+
const ratioEnabled = options.keepAspectRatio && !options.resizeDirection && Number.isFinite(ratio) && ratio > 0;
|
|
18
|
+
const affectsX = left || (ratioEnabled && vertical && !horizontal && top);
|
|
19
|
+
const affectsY = top || (ratioEnabled && horizontal && !vertical && left);
|
|
20
|
+
const sx = start.x - start.width * ox, sy = start.y - start.height * oy;
|
|
21
|
+
let { minWidth, minHeight, maxWidth, maxHeight } = options;
|
|
22
|
+
if (options.extent) {
|
|
23
|
+
maxWidth = Math.min(maxWidth, affectsX ? sx + start.width - options.extent[0][0] : options.extent[1][0] - sx);
|
|
24
|
+
maxHeight = Math.min(maxHeight, affectsY ? sy + start.height - options.extent[0][1] : options.extent[1][1] - sy);
|
|
25
|
+
}
|
|
26
|
+
if (options.childExtent) {
|
|
27
|
+
minWidth = Math.max(minWidth, affectsX ? sx + start.width - options.childExtent[0][0] : options.childExtent[1][0] - sx);
|
|
28
|
+
minHeight = Math.max(minHeight, affectsY ? sy + start.height - options.childExtent[0][1] : options.childExtent[1][1] - sy);
|
|
29
|
+
}
|
|
30
|
+
if (ratioEnabled) {
|
|
31
|
+
const useWidth = horizontal && (!vertical || width >= height * ratio);
|
|
32
|
+
const min = Math.max(minWidth, minHeight * ratio);
|
|
33
|
+
const max = Math.min(maxWidth, maxHeight * ratio);
|
|
34
|
+
width = clamp(useWidth ? width : height * ratio, min, max);
|
|
35
|
+
height = width / ratio;
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
if (horizontal)
|
|
39
|
+
width = clamp(width, minWidth, maxWidth);
|
|
40
|
+
if (vertical)
|
|
41
|
+
height = clamp(height, minHeight, maxHeight);
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
width, height,
|
|
45
|
+
x: start.x + (affectsX ? start.width - width : 0) + (width - start.width) * ox,
|
|
46
|
+
y: start.y + (affectsY ? start.height - height : 0) + (height - start.height) * oy,
|
|
47
|
+
direction: [Math.sign(width - start.width) * (left ? -1 : 1) || 0, Math.sign(height - start.height) * (top ? -1 : 1) || 0],
|
|
48
|
+
};
|
|
49
|
+
}
|
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
import type { Connection, EdgeChange, FlowEdge, FlowNode, HandleBox, InternalNode, NodeChange, Rect, Transform, XY } from "./types.js";
|
|
2
|
+
import { type ConnectionState, type DragItem } from "./system.js";
|
|
3
|
+
import { nodeConnections, type NodeQuery } from "./queries.js";
|
|
4
|
+
import { defaultAriaLabels } from "./configuration.js";
|
|
5
|
+
import type { Padding } from "./api/system/types/general.js";
|
|
6
|
+
type Listener = () => void;
|
|
7
|
+
type Handler = ((...args: never[]) => unknown) | undefined;
|
|
8
|
+
export type FlowState = {
|
|
9
|
+
nodes: FlowNode[];
|
|
10
|
+
edges: FlowEdge[];
|
|
11
|
+
nodeLookup: Map<string, InternalNode>;
|
|
12
|
+
edgeLookup: Map<string, FlowEdge>;
|
|
13
|
+
/** Derived once per setNodes (xyflow keeps a parentLookup): render order of shown nodes, … */
|
|
14
|
+
visibleNodeIds: string[];
|
|
15
|
+
selectedNodeCount: number;
|
|
16
|
+
parentIds: Set<string>;
|
|
17
|
+
transform: Transform;
|
|
18
|
+
width: number;
|
|
19
|
+
height: number;
|
|
20
|
+
minZoom: number;
|
|
21
|
+
maxZoom: number;
|
|
22
|
+
domNode: HTMLDivElement | null;
|
|
23
|
+
/** React Flow's pan-zoom instance (its internals; tools and tests use it). */
|
|
24
|
+
panZoom: {
|
|
25
|
+
setViewport(viewport: {
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
28
|
+
zoom: number;
|
|
29
|
+
}, options?: {
|
|
30
|
+
duration?: number;
|
|
31
|
+
}): Promise<boolean>;
|
|
32
|
+
getViewport(): {
|
|
33
|
+
x: number;
|
|
34
|
+
y: number;
|
|
35
|
+
zoom: number;
|
|
36
|
+
};
|
|
37
|
+
scaleTo(zoom: number, options?: {
|
|
38
|
+
duration?: number;
|
|
39
|
+
}): Promise<boolean>;
|
|
40
|
+
scaleBy(factor: number, options?: {
|
|
41
|
+
duration?: number;
|
|
42
|
+
}): Promise<boolean>;
|
|
43
|
+
setScaleExtent(extent: [number, number]): void;
|
|
44
|
+
} | null;
|
|
45
|
+
nodesSelectionActive: boolean;
|
|
46
|
+
userSelectionActive: boolean;
|
|
47
|
+
userSelectionRect: Rect | null;
|
|
48
|
+
multiSelectionActive: boolean;
|
|
49
|
+
elementsSelectable: boolean;
|
|
50
|
+
nodesDraggable: boolean;
|
|
51
|
+
nodesConnectable: boolean;
|
|
52
|
+
nodesFocusable: boolean;
|
|
53
|
+
selectNodesOnDrag: boolean;
|
|
54
|
+
snapToGrid: boolean;
|
|
55
|
+
snapGrid: [number, number];
|
|
56
|
+
nodeDragThreshold: number;
|
|
57
|
+
connectionDragThreshold: number;
|
|
58
|
+
connectionRadius: number;
|
|
59
|
+
connectionMode: string;
|
|
60
|
+
elevateNodesOnSelect: boolean;
|
|
61
|
+
fitViewDone: boolean;
|
|
62
|
+
/** The connection being dragged out of a handle (React Flow's ConnectionState). */
|
|
63
|
+
connection: ConnectionState;
|
|
64
|
+
connectionClickStartHandle: {
|
|
65
|
+
nodeId: string;
|
|
66
|
+
type: "source" | "target";
|
|
67
|
+
id: string | null;
|
|
68
|
+
} | null;
|
|
69
|
+
paneDragging: boolean;
|
|
70
|
+
autoPanOnNodeDrag: boolean;
|
|
71
|
+
autoPanOnConnect: boolean;
|
|
72
|
+
autoPanSpeed: number;
|
|
73
|
+
nodeExtent?: [[number, number], [number, number]];
|
|
74
|
+
nodeOrigin?: [number, number];
|
|
75
|
+
translateExtent: [[number, number], [number, number]];
|
|
76
|
+
zIndexMode: "auto" | "basic" | "manual";
|
|
77
|
+
ariaLabelConfig: typeof defaultAriaLabels;
|
|
78
|
+
defaultEdgeOptions?: Partial<FlowEdge>;
|
|
79
|
+
hasDefaultNodes: boolean;
|
|
80
|
+
hasDefaultEdges: boolean;
|
|
81
|
+
edgesFocusable: boolean;
|
|
82
|
+
/** React Flow's flow id (the `id` prop, "1" by default): handles and descriptions carry it. */
|
|
83
|
+
rfId: string;
|
|
84
|
+
onSelectionChangeHandlers: ((params: {
|
|
85
|
+
nodes: FlowNode[];
|
|
86
|
+
edges: FlowEdge[];
|
|
87
|
+
}) => void)[];
|
|
88
|
+
onNodesChangeMiddlewareMap: Map<symbol, (changes: NodeChange[]) => NodeChange[]>;
|
|
89
|
+
onEdgesChangeMiddlewareMap: Map<symbol, (changes: EdgeChange[]) => EdgeChange[]>;
|
|
90
|
+
ariaLiveMessage: string;
|
|
91
|
+
autoPanOnNodeFocus: boolean;
|
|
92
|
+
/** Handle boxes measured from the DOM (React Flow's handleBounds). */
|
|
93
|
+
measuredHandles: Map<string, {
|
|
94
|
+
source: HandleBox[] | null;
|
|
95
|
+
target: HandleBox[] | null;
|
|
96
|
+
}>;
|
|
97
|
+
/** Sizes measured from the DOM, until the app writes them back. */
|
|
98
|
+
measuredSizes: Map<string, {
|
|
99
|
+
width: number;
|
|
100
|
+
height: number;
|
|
101
|
+
}>;
|
|
102
|
+
onNodesChange?: (changes: NodeChange[]) => void;
|
|
103
|
+
onEdgesChange?: (changes: EdgeChange[]) => void;
|
|
104
|
+
onBeforeDelete?: (elements: {
|
|
105
|
+
nodes: FlowNode[];
|
|
106
|
+
edges: FlowEdge[];
|
|
107
|
+
}) => Promise<boolean | {
|
|
108
|
+
nodes: FlowNode[];
|
|
109
|
+
edges: FlowEdge[];
|
|
110
|
+
}>;
|
|
111
|
+
onNodesDelete?: (nodes: FlowNode[]) => void;
|
|
112
|
+
onEdgesDelete?: (edges: FlowEdge[]) => void;
|
|
113
|
+
onDelete?: (elements: {
|
|
114
|
+
nodes: FlowNode[];
|
|
115
|
+
edges: FlowEdge[];
|
|
116
|
+
}) => void;
|
|
117
|
+
onNodeDragStart?: Handler;
|
|
118
|
+
onNodeDrag?: Handler;
|
|
119
|
+
onNodeDragStop?: Handler;
|
|
120
|
+
onSelectionDragStart?: Handler;
|
|
121
|
+
onSelectionDragStop?: Handler;
|
|
122
|
+
onConnectStart?: Handler;
|
|
123
|
+
onConnect?: (connection: Connection) => void;
|
|
124
|
+
onConnectEnd?: Handler;
|
|
125
|
+
isValidConnection?: Handler;
|
|
126
|
+
onViewportChange?: Handler;
|
|
127
|
+
viewportHandlers: Set<{
|
|
128
|
+
onStart?: (viewport: {
|
|
129
|
+
x: number;
|
|
130
|
+
y: number;
|
|
131
|
+
zoom: number;
|
|
132
|
+
}) => void;
|
|
133
|
+
onChange?: (viewport: {
|
|
134
|
+
x: number;
|
|
135
|
+
y: number;
|
|
136
|
+
zoom: number;
|
|
137
|
+
}) => void;
|
|
138
|
+
onEnd?: (viewport: {
|
|
139
|
+
x: number;
|
|
140
|
+
y: number;
|
|
141
|
+
zoom: number;
|
|
142
|
+
}) => void;
|
|
143
|
+
}>;
|
|
144
|
+
triggerNodeChanges(changes: NodeChange[]): void;
|
|
145
|
+
triggerEdgeChanges(changes: EdgeChange[]): void;
|
|
146
|
+
addSelectedNodes(ids: string[]): void;
|
|
147
|
+
addSelectedEdges(ids: string[]): void;
|
|
148
|
+
unselectNodesAndEdges(params?: {
|
|
149
|
+
nodes?: FlowNode[];
|
|
150
|
+
edges?: FlowEdge[];
|
|
151
|
+
}): void;
|
|
152
|
+
resetSelectedElements(): void;
|
|
153
|
+
setNodes(nodes: FlowNode[]): void;
|
|
154
|
+
setEdges(edges: FlowEdge[]): void;
|
|
155
|
+
setMinZoom(zoom: number): void;
|
|
156
|
+
setMaxZoom(zoom: number): void;
|
|
157
|
+
setTranslateExtent(extent: [[number, number], [number, number]]): void;
|
|
158
|
+
updateNodeInternals(ids?: string[]): void;
|
|
159
|
+
panBy(delta: XY, event?: Event): boolean;
|
|
160
|
+
setTransform(transform: Transform, event?: Event): void;
|
|
161
|
+
updateNodePositions(items: Map<string, DragItem>, dragging?: boolean): void;
|
|
162
|
+
updateConnection(connection: ConnectionState): void;
|
|
163
|
+
cancelConnection(): void;
|
|
164
|
+
[key: string]: unknown;
|
|
165
|
+
};
|
|
166
|
+
export type FlowStore = {
|
|
167
|
+
getState(): FlowState;
|
|
168
|
+
setState(partial: Partial<FlowState> | ((state: FlowState) => Partial<FlowState>)): void;
|
|
169
|
+
subscribe(listener: Listener): () => void;
|
|
170
|
+
};
|
|
171
|
+
export declare function constrainTransform(state: Pick<FlowState, "minZoom" | "maxZoom" | "width" | "height" | "translateExtent">, transform: Transform): Transform;
|
|
172
|
+
export declare function disposeFlowViewport(store: FlowStore): void;
|
|
173
|
+
/** Builds the internal nodes: absolute positions (parents first), z, sizes, handles. */
|
|
174
|
+
export declare function adoptNodes(state: FlowState, nodes: FlowNode[]): Map<string, InternalNode>;
|
|
175
|
+
/** xyflow's getSelectionChanges (`mutate`: the internal items follow at once). */
|
|
176
|
+
export declare const selectionChanges: (items: Iterable<{
|
|
177
|
+
id: string;
|
|
178
|
+
selected?: boolean;
|
|
179
|
+
}>, selected: Set<string>, mutate?: boolean) => {
|
|
180
|
+
type: "select";
|
|
181
|
+
id: string;
|
|
182
|
+
selected: boolean;
|
|
183
|
+
}[];
|
|
184
|
+
export declare function createFlowStore(): FlowStore;
|
|
185
|
+
export type FitViewOptions = {
|
|
186
|
+
padding?: Padding;
|
|
187
|
+
includeHiddenNodes?: boolean;
|
|
188
|
+
minZoom?: number;
|
|
189
|
+
maxZoom?: number;
|
|
190
|
+
duration?: number;
|
|
191
|
+
ease?: (t: number) => number;
|
|
192
|
+
interpolate?: "smooth" | "linear";
|
|
193
|
+
nodes?: (FlowNode | {
|
|
194
|
+
id: string;
|
|
195
|
+
})[];
|
|
196
|
+
};
|
|
197
|
+
/** The visible box of nodes (absolute, measured). */
|
|
198
|
+
export declare function nodesBounds(state: FlowState, ids: Set<string> | null, includeHidden: boolean): Rect | null;
|
|
199
|
+
/**
|
|
200
|
+
* xyflow's getViewportForBounds (@xyflow/system, MIT): a numeric padding
|
|
201
|
+
* becomes whole px per side, then the view shifts where a side got less.
|
|
202
|
+
*/
|
|
203
|
+
export declare function viewportForBounds(bounds: Rect, width: number, height: number, minZoom: number, maxZoom: number, padding: Padding): Transform;
|
|
204
|
+
/** Moves the viewport, over `duration` ms when given. */
|
|
205
|
+
export type ViewportOptions = {
|
|
206
|
+
duration?: number;
|
|
207
|
+
ease?: (t: number) => number;
|
|
208
|
+
interpolate?: "smooth" | "linear";
|
|
209
|
+
};
|
|
210
|
+
export declare function animateTo(store: FlowStore, target: Transform, options?: number | ViewportOptions): Promise<boolean>;
|
|
211
|
+
export declare function fitView(store: FlowStore, options?: FitViewOptions): Promise<boolean>;
|
|
212
|
+
type NodeUpdate = Partial<FlowNode> | ((node: FlowNode) => Partial<FlowNode>);
|
|
213
|
+
/** The useReactFlow() instance for a store. */
|
|
214
|
+
export declare function createInstance(store: FlowStore): {
|
|
215
|
+
getNodes: () => {
|
|
216
|
+
[key: string]: unknown;
|
|
217
|
+
id: string;
|
|
218
|
+
position: XY;
|
|
219
|
+
data: Record<string, unknown>;
|
|
220
|
+
type?: string;
|
|
221
|
+
parentId?: string;
|
|
222
|
+
hidden?: boolean;
|
|
223
|
+
selected?: boolean;
|
|
224
|
+
dragging?: boolean;
|
|
225
|
+
width?: number;
|
|
226
|
+
height?: number;
|
|
227
|
+
measured?: Partial<import("./types.js").Dimensions>;
|
|
228
|
+
zIndex?: number;
|
|
229
|
+
selectable?: boolean;
|
|
230
|
+
draggable?: boolean;
|
|
231
|
+
connectable?: boolean;
|
|
232
|
+
deletable?: boolean;
|
|
233
|
+
className?: string;
|
|
234
|
+
style?: Record<string, unknown>;
|
|
235
|
+
domAttributes?: Record<string, unknown>;
|
|
236
|
+
handles?: Omit<HandleBox, "nodeId">[];
|
|
237
|
+
sourcePosition?: string;
|
|
238
|
+
targetPosition?: string;
|
|
239
|
+
dragHandle?: string;
|
|
240
|
+
}[];
|
|
241
|
+
getNode: (id: string) => FlowNode | undefined;
|
|
242
|
+
getInternalNode: (id: string) => InternalNode | undefined;
|
|
243
|
+
getNodePosition: (id: string) => {
|
|
244
|
+
x: number;
|
|
245
|
+
y: number;
|
|
246
|
+
} | null;
|
|
247
|
+
getNodeBox: (id: string) => {
|
|
248
|
+
x: number;
|
|
249
|
+
y: number;
|
|
250
|
+
width: number;
|
|
251
|
+
height: number;
|
|
252
|
+
} | null;
|
|
253
|
+
getEdges: () => {
|
|
254
|
+
[key: string]: unknown;
|
|
255
|
+
id: string;
|
|
256
|
+
source: string;
|
|
257
|
+
target: string;
|
|
258
|
+
sourceHandle?: string | null;
|
|
259
|
+
targetHandle?: string | null;
|
|
260
|
+
type?: string;
|
|
261
|
+
data?: Record<string, unknown>;
|
|
262
|
+
hidden?: boolean;
|
|
263
|
+
selected?: boolean;
|
|
264
|
+
selectable?: boolean;
|
|
265
|
+
deletable?: boolean;
|
|
266
|
+
animated?: boolean;
|
|
267
|
+
style?: Record<string, unknown>;
|
|
268
|
+
className?: string;
|
|
269
|
+
markerEnd?: unknown;
|
|
270
|
+
markerStart?: unknown;
|
|
271
|
+
label?: unknown;
|
|
272
|
+
interactionWidth?: number;
|
|
273
|
+
zIndex?: number;
|
|
274
|
+
}[];
|
|
275
|
+
getEdge: (id: string) => FlowEdge | undefined;
|
|
276
|
+
setNodes: (payload: FlowNode[] | ((nodes: FlowNode[]) => FlowNode[])) => void;
|
|
277
|
+
setEdges: (payload: FlowEdge[] | ((edges: FlowEdge[]) => FlowEdge[])) => void;
|
|
278
|
+
addNodes: (payload: FlowNode | FlowNode[]) => void;
|
|
279
|
+
addEdges: (payload: FlowEdge | FlowEdge[]) => void;
|
|
280
|
+
updateNode(id: string, update: NodeUpdate, options?: {
|
|
281
|
+
replace?: boolean;
|
|
282
|
+
}): void;
|
|
283
|
+
updateNodeData(id: string, update: Record<string, unknown> | ((node: FlowNode) => Record<string, unknown>), options?: {
|
|
284
|
+
replace?: boolean;
|
|
285
|
+
}): void;
|
|
286
|
+
updateEdge(id: string, update: Partial<FlowEdge> | ((edge: FlowEdge) => Partial<FlowEdge>), options?: {
|
|
287
|
+
replace?: boolean;
|
|
288
|
+
}): void;
|
|
289
|
+
updateEdgeData(id: string, update: Record<string, unknown> | ((edge: FlowEdge) => Record<string, unknown>), options?: {
|
|
290
|
+
replace?: boolean;
|
|
291
|
+
}): void;
|
|
292
|
+
deleteElements: ({ nodes, edges }: {
|
|
293
|
+
nodes?: {
|
|
294
|
+
id: string;
|
|
295
|
+
}[];
|
|
296
|
+
edges?: {
|
|
297
|
+
id: string;
|
|
298
|
+
}[];
|
|
299
|
+
}) => Promise<{
|
|
300
|
+
deletedNodes: FlowNode[];
|
|
301
|
+
deletedEdges: FlowEdge[];
|
|
302
|
+
}>;
|
|
303
|
+
getViewport: () => {
|
|
304
|
+
x: number;
|
|
305
|
+
y: number;
|
|
306
|
+
zoom: number;
|
|
307
|
+
};
|
|
308
|
+
setViewport: (viewport: {
|
|
309
|
+
x?: number;
|
|
310
|
+
y?: number;
|
|
311
|
+
zoom?: number;
|
|
312
|
+
}, options?: ViewportOptions) => Promise<boolean>;
|
|
313
|
+
getZoom: () => number;
|
|
314
|
+
zoomIn: (options?: ViewportOptions) => Promise<boolean>;
|
|
315
|
+
zoomOut: (options?: ViewportOptions) => Promise<boolean>;
|
|
316
|
+
zoomTo: (zoom: number, options?: ViewportOptions) => Promise<boolean>;
|
|
317
|
+
fitView: (options?: FitViewOptions) => Promise<boolean>;
|
|
318
|
+
setCenter: (x: number, y: number, options?: ViewportOptions & {
|
|
319
|
+
zoom?: number;
|
|
320
|
+
}) => Promise<boolean>;
|
|
321
|
+
fitBounds: (bounds: Rect, options?: ViewportOptions & {
|
|
322
|
+
padding?: number;
|
|
323
|
+
}) => Promise<boolean>;
|
|
324
|
+
screenToFlowPosition: (point: XY, options?: {
|
|
325
|
+
snapToGrid?: boolean;
|
|
326
|
+
}) => {
|
|
327
|
+
x: number;
|
|
328
|
+
y: number;
|
|
329
|
+
};
|
|
330
|
+
flowToScreenPosition: (point: XY) => {
|
|
331
|
+
x: number;
|
|
332
|
+
y: number;
|
|
333
|
+
};
|
|
334
|
+
getNodesBounds: (nodes: (string | {
|
|
335
|
+
id: string;
|
|
336
|
+
} | FlowNode)[]) => {
|
|
337
|
+
x: number;
|
|
338
|
+
y: number;
|
|
339
|
+
width: number;
|
|
340
|
+
height: number;
|
|
341
|
+
};
|
|
342
|
+
getIntersectingNodes: (input: NodeQuery, partially?: boolean, nodes?: FlowNode[]) => FlowNode[];
|
|
343
|
+
isNodeIntersecting: (input: NodeQuery, area: Rect, partially?: boolean) => boolean;
|
|
344
|
+
getHandleConnections: ({ type, id, nodeId }: {
|
|
345
|
+
type: "source" | "target";
|
|
346
|
+
nodeId: string;
|
|
347
|
+
id?: string | null;
|
|
348
|
+
}) => (Connection & {
|
|
349
|
+
edgeId: string;
|
|
350
|
+
})[];
|
|
351
|
+
getNodeConnections: (query: Parameters<typeof nodeConnections>[1]) => (Connection & {
|
|
352
|
+
edgeId: string;
|
|
353
|
+
})[];
|
|
354
|
+
toObject: () => {
|
|
355
|
+
nodes: {
|
|
356
|
+
[key: string]: unknown;
|
|
357
|
+
id: string;
|
|
358
|
+
position: XY;
|
|
359
|
+
data: Record<string, unknown>;
|
|
360
|
+
type?: string;
|
|
361
|
+
parentId?: string;
|
|
362
|
+
hidden?: boolean;
|
|
363
|
+
selected?: boolean;
|
|
364
|
+
dragging?: boolean;
|
|
365
|
+
width?: number;
|
|
366
|
+
height?: number;
|
|
367
|
+
measured?: Partial<import("./types.js").Dimensions>;
|
|
368
|
+
zIndex?: number;
|
|
369
|
+
selectable?: boolean;
|
|
370
|
+
draggable?: boolean;
|
|
371
|
+
connectable?: boolean;
|
|
372
|
+
deletable?: boolean;
|
|
373
|
+
className?: string;
|
|
374
|
+
style?: Record<string, unknown>;
|
|
375
|
+
domAttributes?: Record<string, unknown>;
|
|
376
|
+
handles?: Omit<HandleBox, "nodeId">[];
|
|
377
|
+
sourcePosition?: string;
|
|
378
|
+
targetPosition?: string;
|
|
379
|
+
dragHandle?: string;
|
|
380
|
+
}[];
|
|
381
|
+
edges: {
|
|
382
|
+
[key: string]: unknown;
|
|
383
|
+
id: string;
|
|
384
|
+
source: string;
|
|
385
|
+
target: string;
|
|
386
|
+
sourceHandle?: string | null;
|
|
387
|
+
targetHandle?: string | null;
|
|
388
|
+
type?: string;
|
|
389
|
+
data?: Record<string, unknown>;
|
|
390
|
+
hidden?: boolean;
|
|
391
|
+
selected?: boolean;
|
|
392
|
+
selectable?: boolean;
|
|
393
|
+
deletable?: boolean;
|
|
394
|
+
animated?: boolean;
|
|
395
|
+
style?: Record<string, unknown>;
|
|
396
|
+
className?: string;
|
|
397
|
+
markerEnd?: unknown;
|
|
398
|
+
markerStart?: unknown;
|
|
399
|
+
label?: unknown;
|
|
400
|
+
interactionWidth?: number;
|
|
401
|
+
zIndex?: number;
|
|
402
|
+
}[];
|
|
403
|
+
viewport: {
|
|
404
|
+
x: number;
|
|
405
|
+
y: number;
|
|
406
|
+
zoom: number;
|
|
407
|
+
};
|
|
408
|
+
};
|
|
409
|
+
readonly viewportInitialized: boolean;
|
|
410
|
+
};
|
|
411
|
+
export type FlowInstance = ReturnType<typeof createInstance>;
|
|
412
|
+
export {};
|