@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,273 @@
|
|
|
1
|
+
import { hasClassWithin } from "./configuration.js";
|
|
2
|
+
import { calcAutoPan, calculateNodePosition, calculateSnapOffset, dragItemsBox, getDragItems, getEventHandlerParams, getEventPosition, getPointerPosition, snapPosition, } from "./system.js";
|
|
3
|
+
function hasSelector(target, selector, domNode) {
|
|
4
|
+
let current = target;
|
|
5
|
+
do {
|
|
6
|
+
if (current?.matches?.(selector))
|
|
7
|
+
return true;
|
|
8
|
+
if (current === domNode)
|
|
9
|
+
return false;
|
|
10
|
+
current = current?.parentElement ?? null;
|
|
11
|
+
} while (current);
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
const noevent = (event) => {
|
|
15
|
+
event.preventDefault();
|
|
16
|
+
event.stopImmediatePropagation();
|
|
17
|
+
};
|
|
18
|
+
/** Attaches dragging to an element; returns the cleanup. */
|
|
19
|
+
export function attachDrag(store, options) {
|
|
20
|
+
const { domNode, nodeId, isSelectable, noDragClassName = "nodrag", handleSelector, nodeClickDistance = 0 } = options;
|
|
21
|
+
const view = domNode.ownerDocument.defaultView ?? window;
|
|
22
|
+
const get = () => store.getState();
|
|
23
|
+
let lastPos = { x: null, y: null };
|
|
24
|
+
let autoPanId = 0;
|
|
25
|
+
let dragItems = new Map();
|
|
26
|
+
let autoPanStarted = false;
|
|
27
|
+
let mousePosition = { x: 0, y: 0 };
|
|
28
|
+
let containerBounds = null;
|
|
29
|
+
let dragStarted = false;
|
|
30
|
+
let abortDrag = false;
|
|
31
|
+
let nodePositionsChanged = false;
|
|
32
|
+
let dragEvent = null;
|
|
33
|
+
// d3-drag's gesture state.
|
|
34
|
+
let active = false;
|
|
35
|
+
let moving = false;
|
|
36
|
+
let downX = 0;
|
|
37
|
+
let downY = 0;
|
|
38
|
+
function updateNodes({ x, y }) {
|
|
39
|
+
const s = get();
|
|
40
|
+
const { nodeLookup, snapGrid, snapToGrid } = s;
|
|
41
|
+
const nodeExtent = s.nodeExtent;
|
|
42
|
+
lastPos = { x, y };
|
|
43
|
+
let hasChange = false;
|
|
44
|
+
const multi = dragItems.size > 1;
|
|
45
|
+
const box = multi && nodeExtent ? dragItemsBox(dragItems) : null;
|
|
46
|
+
const snapOffset = multi && snapToGrid ? calculateSnapOffset({ dragItems, snapGrid, x, y }) : null;
|
|
47
|
+
for (const [id, item] of dragItems) {
|
|
48
|
+
if (!nodeLookup.has(id))
|
|
49
|
+
continue;
|
|
50
|
+
let next = { x: x - item.distance.x, y: y - item.distance.y };
|
|
51
|
+
if (snapToGrid) {
|
|
52
|
+
next = snapOffset ? { x: Math.round(next.x + snapOffset.x), y: Math.round(next.y + snapOffset.y) } : snapPosition(next, snapGrid);
|
|
53
|
+
}
|
|
54
|
+
let adjusted = null;
|
|
55
|
+
if (multi && nodeExtent && !item.extent && box) {
|
|
56
|
+
const p = item.internals.positionAbsolute;
|
|
57
|
+
adjusted = [
|
|
58
|
+
[p.x - box.x + nodeExtent[0][0], p.y - box.y + nodeExtent[0][1]],
|
|
59
|
+
[p.x + item.measured.width - box.x2 + nodeExtent[1][0], p.y + item.measured.height - box.y2 + nodeExtent[1][1]],
|
|
60
|
+
];
|
|
61
|
+
}
|
|
62
|
+
const { position, positionAbsolute } = calculateNodePosition({
|
|
63
|
+
nodeId: id,
|
|
64
|
+
nextPosition: next,
|
|
65
|
+
nodeLookup,
|
|
66
|
+
nodeExtent: adjusted ?? nodeExtent,
|
|
67
|
+
nodeOrigin: s.nodeOrigin,
|
|
68
|
+
});
|
|
69
|
+
hasChange = hasChange || item.position.x !== position.x || item.position.y !== position.y;
|
|
70
|
+
item.position = position;
|
|
71
|
+
item.internals.positionAbsolute = positionAbsolute;
|
|
72
|
+
}
|
|
73
|
+
nodePositionsChanged = nodePositionsChanged || hasChange;
|
|
74
|
+
if (!hasChange)
|
|
75
|
+
return;
|
|
76
|
+
s.updateNodePositions(dragItems, true);
|
|
77
|
+
const { onNodeDrag, onSelectionDrag } = get();
|
|
78
|
+
if (dragEvent && (onNodeDrag || (!nodeId && onSelectionDrag))) {
|
|
79
|
+
const [node, nodes] = getEventHandlerParams({ nodeId, dragItems, nodeLookup: get().nodeLookup });
|
|
80
|
+
onNodeDrag?.(dragEvent, node, nodes);
|
|
81
|
+
if (!nodeId)
|
|
82
|
+
onSelectionDrag?.(dragEvent, nodes);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
function autoPan() {
|
|
86
|
+
if (!containerBounds)
|
|
87
|
+
return;
|
|
88
|
+
const { transform, panBy, autoPanSpeed, autoPanOnNodeDrag } = get();
|
|
89
|
+
if (!autoPanOnNodeDrag) {
|
|
90
|
+
autoPanStarted = false;
|
|
91
|
+
cancelAnimationFrame(autoPanId);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
const [dx, dy] = calcAutoPan(mousePosition, containerBounds, autoPanSpeed);
|
|
95
|
+
if (dx !== 0 || dy !== 0) {
|
|
96
|
+
lastPos.x = (lastPos.x ?? 0) - dx / transform[2];
|
|
97
|
+
lastPos.y = (lastPos.y ?? 0) - dy / transform[2];
|
|
98
|
+
if (panBy({ x: dx, y: dy }))
|
|
99
|
+
updateNodes(lastPos);
|
|
100
|
+
}
|
|
101
|
+
autoPanId = requestAnimationFrame(autoPan);
|
|
102
|
+
}
|
|
103
|
+
function startDrag(event) {
|
|
104
|
+
const s = get();
|
|
105
|
+
const { nodeLookup, multiSelectionActive, nodesDraggable, transform, snapGrid, snapToGrid, selectNodesOnDrag, unselectNodesAndEdges } = s;
|
|
106
|
+
dragStarted = true;
|
|
107
|
+
if ((!selectNodesOnDrag || !isSelectable) && !multiSelectionActive && nodeId) {
|
|
108
|
+
if (!nodeLookup.get(nodeId)?.selected)
|
|
109
|
+
unselectNodesAndEdges();
|
|
110
|
+
}
|
|
111
|
+
if (isSelectable && selectNodesOnDrag && nodeId)
|
|
112
|
+
options.onNodeMouseDown?.(nodeId);
|
|
113
|
+
const pointer = getPointerPosition(event, { transform, snapGrid, snapToGrid, containerBounds });
|
|
114
|
+
lastPos = pointer;
|
|
115
|
+
dragItems = getDragItems(get().nodeLookup, nodesDraggable, pointer, nodeId);
|
|
116
|
+
const { onNodeDragStart, onSelectionDragStart } = get();
|
|
117
|
+
options.onDragStart?.();
|
|
118
|
+
if (dragItems.size > 0 && (onNodeDragStart || (!nodeId && onSelectionDragStart))) {
|
|
119
|
+
const [node, nodes] = getEventHandlerParams({ nodeId, dragItems, nodeLookup: get().nodeLookup });
|
|
120
|
+
onNodeDragStart?.(event, node, nodes);
|
|
121
|
+
if (!nodeId)
|
|
122
|
+
onSelectionDragStart?.(event, nodes);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
function onStart(event) {
|
|
126
|
+
const { domNode: root, nodeDragThreshold, transform, snapGrid, snapToGrid } = get();
|
|
127
|
+
containerBounds = root?.getBoundingClientRect() ?? null;
|
|
128
|
+
abortDrag = false;
|
|
129
|
+
nodePositionsChanged = false;
|
|
130
|
+
dragEvent = event;
|
|
131
|
+
if (nodeDragThreshold === 0)
|
|
132
|
+
startDrag(event);
|
|
133
|
+
lastPos = getPointerPosition(event, { transform, snapGrid, snapToGrid, containerBounds });
|
|
134
|
+
mousePosition = getEventPosition(event, containerBounds);
|
|
135
|
+
}
|
|
136
|
+
function onDrag(event) {
|
|
137
|
+
const { autoPanOnNodeDrag, transform, snapGrid, snapToGrid, nodeDragThreshold, nodeLookup } = get();
|
|
138
|
+
const pointer = getPointerPosition(event, { transform, snapGrid, snapToGrid, containerBounds });
|
|
139
|
+
dragEvent = event;
|
|
140
|
+
if ((event.type === "touchmove" && event.touches.length > 1) || (nodeId && !nodeLookup.has(nodeId)))
|
|
141
|
+
abortDrag = true;
|
|
142
|
+
if (abortDrag)
|
|
143
|
+
return;
|
|
144
|
+
if (!autoPanStarted && autoPanOnNodeDrag && dragStarted) {
|
|
145
|
+
autoPanStarted = true;
|
|
146
|
+
autoPan();
|
|
147
|
+
}
|
|
148
|
+
if (!dragStarted) {
|
|
149
|
+
const current = getEventPosition(event, containerBounds);
|
|
150
|
+
if (Math.hypot(current.x - mousePosition.x, current.y - mousePosition.y) > nodeDragThreshold)
|
|
151
|
+
startDrag(event);
|
|
152
|
+
}
|
|
153
|
+
if ((lastPos.x !== pointer.xSnapped || lastPos.y !== pointer.ySnapped) && dragItems && dragStarted) {
|
|
154
|
+
mousePosition = getEventPosition(event, containerBounds);
|
|
155
|
+
updateNodes(pointer);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
function onEnd(event) {
|
|
159
|
+
if (!dragStarted || abortDrag) {
|
|
160
|
+
if (abortDrag && dragItems.size > 0)
|
|
161
|
+
get().updateNodePositions(dragItems, false);
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
autoPanStarted = false;
|
|
165
|
+
dragStarted = false;
|
|
166
|
+
cancelAnimationFrame(autoPanId);
|
|
167
|
+
options.onDragStop?.();
|
|
168
|
+
if (dragItems.size > 0) {
|
|
169
|
+
const { updateNodePositions } = get();
|
|
170
|
+
if (nodePositionsChanged) {
|
|
171
|
+
updateNodePositions(dragItems, false);
|
|
172
|
+
nodePositionsChanged = false;
|
|
173
|
+
}
|
|
174
|
+
const { onNodeDragStop, onSelectionDragStop } = get();
|
|
175
|
+
if (onNodeDragStop || (!nodeId && onSelectionDragStop)) {
|
|
176
|
+
const [node, nodes] = getEventHandlerParams({ nodeId, dragItems, nodeLookup: get().nodeLookup, dragging: false });
|
|
177
|
+
onNodeDragStop?.(event, node, nodes);
|
|
178
|
+
if (!nodeId)
|
|
179
|
+
onSelectionDragStop?.(event, nodes);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
// d3-drag's filter: the main button, not on .nodrag, inside the drag handle.
|
|
184
|
+
const filter = (event) => {
|
|
185
|
+
const target = event.target;
|
|
186
|
+
return (!("button" in event && event.button) &&
|
|
187
|
+
(!noDragClassName || !hasClassWithin(target, noDragClassName, domNode)) &&
|
|
188
|
+
(!handleSelector || hasSelector(target, handleSelector, domNode)));
|
|
189
|
+
};
|
|
190
|
+
// d3-drag's nodrag/yesdrag: no native drag or text selection meanwhile; a
|
|
191
|
+
// moved gesture swallows the click that follows.
|
|
192
|
+
let userSelect = null;
|
|
193
|
+
const nodrag = () => {
|
|
194
|
+
view.addEventListener("dragstart", noevent, { capture: true, passive: false });
|
|
195
|
+
view.addEventListener("selectstart", noevent, { capture: true, passive: false });
|
|
196
|
+
const style = view.document.documentElement.style;
|
|
197
|
+
userSelect = style.userSelect;
|
|
198
|
+
style.userSelect = "none";
|
|
199
|
+
};
|
|
200
|
+
const yesdrag = (noclick) => {
|
|
201
|
+
view.removeEventListener("dragstart", noevent, { capture: true });
|
|
202
|
+
view.removeEventListener("selectstart", noevent, { capture: true });
|
|
203
|
+
if (noclick) {
|
|
204
|
+
view.addEventListener("click", noevent, { capture: true, passive: false, once: true });
|
|
205
|
+
setTimeout(() => view.removeEventListener("click", noevent, { capture: true }), 0);
|
|
206
|
+
}
|
|
207
|
+
view.document.documentElement.style.userSelect = userSelect ?? "";
|
|
208
|
+
};
|
|
209
|
+
const clickDistance2 = nodeClickDistance * nodeClickDistance;
|
|
210
|
+
const onMouseMove = (event) => {
|
|
211
|
+
noevent(event);
|
|
212
|
+
if (!moving)
|
|
213
|
+
moving = (event.clientX - downX) ** 2 + (event.clientY - downY) ** 2 > clickDistance2;
|
|
214
|
+
onDrag(event);
|
|
215
|
+
};
|
|
216
|
+
const onMouseUp = (event) => {
|
|
217
|
+
view.removeEventListener("mousemove", onMouseMove, { capture: true });
|
|
218
|
+
view.removeEventListener("mouseup", onMouseUp, { capture: true });
|
|
219
|
+
yesdrag(moving);
|
|
220
|
+
noevent(event);
|
|
221
|
+
active = false;
|
|
222
|
+
onEnd(event);
|
|
223
|
+
};
|
|
224
|
+
const onMouseDown = (event) => {
|
|
225
|
+
if (active || !filter(event))
|
|
226
|
+
return;
|
|
227
|
+
active = true;
|
|
228
|
+
view.addEventListener("mousemove", onMouseMove, { capture: true, passive: false });
|
|
229
|
+
view.addEventListener("mouseup", onMouseUp, { capture: true, passive: false });
|
|
230
|
+
nodrag();
|
|
231
|
+
event.stopImmediatePropagation();
|
|
232
|
+
moving = false;
|
|
233
|
+
downX = event.clientX;
|
|
234
|
+
downY = event.clientY;
|
|
235
|
+
onStart(event);
|
|
236
|
+
};
|
|
237
|
+
let touchId = null;
|
|
238
|
+
const onTouchMove = (event) => {
|
|
239
|
+
if (touchId === null || ![...event.changedTouches].some((t) => t.identifier === touchId))
|
|
240
|
+
return;
|
|
241
|
+
noevent(event);
|
|
242
|
+
onDrag(event);
|
|
243
|
+
};
|
|
244
|
+
const onTouchEnd = (event) => {
|
|
245
|
+
if (touchId === null || ![...event.changedTouches].some((t) => t.identifier === touchId))
|
|
246
|
+
return;
|
|
247
|
+
touchId = null;
|
|
248
|
+
domNode.removeEventListener("touchmove", onTouchMove);
|
|
249
|
+
domNode.removeEventListener("touchend", onTouchEnd);
|
|
250
|
+
domNode.removeEventListener("touchcancel", onTouchEnd);
|
|
251
|
+
event.stopImmediatePropagation();
|
|
252
|
+
onEnd(event);
|
|
253
|
+
};
|
|
254
|
+
const onTouchStart = (event) => {
|
|
255
|
+
if (touchId !== null || !filter(event))
|
|
256
|
+
return;
|
|
257
|
+
touchId = event.changedTouches[0].identifier;
|
|
258
|
+
event.stopImmediatePropagation();
|
|
259
|
+
domNode.addEventListener("touchmove", onTouchMove, { passive: false });
|
|
260
|
+
domNode.addEventListener("touchend", onTouchEnd);
|
|
261
|
+
domNode.addEventListener("touchcancel", onTouchEnd);
|
|
262
|
+
onStart(event);
|
|
263
|
+
};
|
|
264
|
+
domNode.addEventListener("mousedown", onMouseDown);
|
|
265
|
+
domNode.addEventListener("touchstart", onTouchStart, { passive: false });
|
|
266
|
+
return () => {
|
|
267
|
+
domNode.removeEventListener("mousedown", onMouseDown);
|
|
268
|
+
domNode.removeEventListener("touchstart", onTouchStart);
|
|
269
|
+
view.removeEventListener("mousemove", onMouseMove, { capture: true });
|
|
270
|
+
view.removeEventListener("mouseup", onMouseUp, { capture: true });
|
|
271
|
+
cancelAnimationFrame(autoPanId);
|
|
272
|
+
};
|
|
273
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactNode } from "react";
|
|
2
|
+
import { NodeResizer } from "./components.js";
|
|
3
|
+
import { StoreContext } from "./hooks.js";
|
|
4
|
+
import { viewportForBounds } from "./store.js";
|
|
5
|
+
import type { Connection, FlowEdge, FlowNode, InternalNode } from "./types.js";
|
|
6
|
+
export declare const ConnectionLineType: {
|
|
7
|
+
readonly Bezier: "default";
|
|
8
|
+
readonly Straight: "straight";
|
|
9
|
+
readonly Step: "step";
|
|
10
|
+
readonly SmoothStep: "smoothstep";
|
|
11
|
+
readonly SimpleBezier: "simplebezier";
|
|
12
|
+
};
|
|
13
|
+
export declare const ResizeControlVariant: {
|
|
14
|
+
readonly Line: "line";
|
|
15
|
+
readonly Handle: "handle";
|
|
16
|
+
};
|
|
17
|
+
export declare const isEdge: (element: unknown) => element is FlowEdge;
|
|
18
|
+
export declare const isNode: (element: unknown) => element is FlowNode;
|
|
19
|
+
export declare function getOutgoers(node: {
|
|
20
|
+
id: string;
|
|
21
|
+
}, nodes: FlowNode[], edges: FlowEdge[]): FlowNode[];
|
|
22
|
+
export declare function getIncomers(node: {
|
|
23
|
+
id: string;
|
|
24
|
+
}, nodes: FlowNode[], edges: FlowEdge[]): FlowNode[];
|
|
25
|
+
export declare function getConnectedEdges(nodes: {
|
|
26
|
+
id: string;
|
|
27
|
+
}[], edges: FlowEdge[]): FlowEdge[];
|
|
28
|
+
/** xyflow's getNodesBounds: the box around nodes (ids or nodes; with nodeLookup, absolute positions). */
|
|
29
|
+
export declare function getNodesBounds(nodes: (FlowNode | InternalNode | string)[], params?: {
|
|
30
|
+
nodeOrigin?: [number, number];
|
|
31
|
+
nodeLookup?: Map<string, InternalNode>;
|
|
32
|
+
}): {
|
|
33
|
+
x: number;
|
|
34
|
+
y: number;
|
|
35
|
+
width: number;
|
|
36
|
+
height: number;
|
|
37
|
+
};
|
|
38
|
+
/** xyflow's reconnectEdge: the edge moved to a new connection (a new id unless told not to). */
|
|
39
|
+
export declare function reconnectEdge<E extends FlowEdge>(oldEdge: E, newConnection: Connection, edges: E[], options?: {
|
|
40
|
+
shouldReplaceId?: boolean;
|
|
41
|
+
getEdgeId?: (c: Connection) => string;
|
|
42
|
+
}): E[];
|
|
43
|
+
export declare function getBezierEdgeCenter({ sourceX, sourceY, targetX, targetY, sourceControlX, sourceControlY, targetControlX, targetControlY, }: Record<"sourceX" | "sourceY" | "targetX" | "targetY" | "sourceControlX" | "sourceControlY" | "targetControlX" | "targetControlY", number>): [number, number, number, number];
|
|
44
|
+
/** xyflow's getViewportForBounds: the viewport that fits a box (padding a fraction of the view). */
|
|
45
|
+
export declare function getViewportForBounds(bounds: {
|
|
46
|
+
x: number;
|
|
47
|
+
y: number;
|
|
48
|
+
width: number;
|
|
49
|
+
height: number;
|
|
50
|
+
}, width: number, height: number, minZoom: number, maxZoom: number, padding: Parameters<typeof viewportForBounds>[5]): {
|
|
51
|
+
x: number;
|
|
52
|
+
y: number;
|
|
53
|
+
zoom: number;
|
|
54
|
+
};
|
|
55
|
+
export declare function ControlButton({ children, className, ...rest }: React.ButtonHTMLAttributes<HTMLButtonElement>): import("react").JSX.Element;
|
|
56
|
+
export type ControlProps = {
|
|
57
|
+
style?: CSSProperties;
|
|
58
|
+
showZoom?: boolean;
|
|
59
|
+
showFitView?: boolean;
|
|
60
|
+
showInteractive?: boolean;
|
|
61
|
+
fitViewOptions?: Record<string, unknown>;
|
|
62
|
+
onZoomIn?: () => void;
|
|
63
|
+
onZoomOut?: () => void;
|
|
64
|
+
onFitView?: () => void;
|
|
65
|
+
onInteractiveChange?: (interactive: boolean) => void;
|
|
66
|
+
className?: string;
|
|
67
|
+
children?: ReactNode;
|
|
68
|
+
position?: string;
|
|
69
|
+
orientation?: "horizontal" | "vertical";
|
|
70
|
+
"aria-label"?: string;
|
|
71
|
+
};
|
|
72
|
+
export declare const Controls: import("react").MemoExoticComponent<({ style, showZoom, showFitView, showInteractive, fitViewOptions, onZoomIn, onZoomOut, onFitView, onInteractiveChange, className, children, position, orientation, "aria-label": ariaLabel, }: ControlProps) => import("react").JSX.Element>;
|
|
73
|
+
export declare const MiniMapNode: import("react").MemoExoticComponent<({ id, x, y, width, height, style, color, strokeColor, strokeWidth, className, borderRadius, shapeRendering, selected, onClick, }: {
|
|
74
|
+
id: string;
|
|
75
|
+
x: number;
|
|
76
|
+
y: number;
|
|
77
|
+
width: number;
|
|
78
|
+
height: number;
|
|
79
|
+
style?: CSSProperties;
|
|
80
|
+
color?: string;
|
|
81
|
+
strokeColor?: string;
|
|
82
|
+
strokeWidth?: number;
|
|
83
|
+
className?: string;
|
|
84
|
+
borderRadius?: number;
|
|
85
|
+
shapeRendering?: string;
|
|
86
|
+
selected?: boolean;
|
|
87
|
+
onClick?: (event: React.MouseEvent, id: string) => void;
|
|
88
|
+
}) => import("react").JSX.Element>;
|
|
89
|
+
export declare function EdgeToolbar({ edgeId, x, y, children, className, style, isVisible, alignX, alignY, ...rest }: React.HTMLAttributes<HTMLDivElement> & {
|
|
90
|
+
edgeId: string;
|
|
91
|
+
x: number;
|
|
92
|
+
y: number;
|
|
93
|
+
isVisible?: boolean;
|
|
94
|
+
alignX?: string;
|
|
95
|
+
alignY?: string;
|
|
96
|
+
}): import("react").JSX.Element | null;
|
|
97
|
+
/** One resize control (the NodeResizer's controls, one at a time). */
|
|
98
|
+
export declare function NodeResizeControl({ position, variant, className, style, children, ...props }: Parameters<typeof NodeResizer>[0] & {
|
|
99
|
+
position?: string;
|
|
100
|
+
variant?: string;
|
|
101
|
+
className?: string;
|
|
102
|
+
style?: CSSProperties;
|
|
103
|
+
children?: ReactNode;
|
|
104
|
+
}): import("react").JSX.Element;
|
|
105
|
+
/** xyflow's useKeyPress: whether a key (or combination, "Meta+a") is held. */
|
|
106
|
+
export declare function useKeyPress(keyCode?: string | string[] | null, options?: {
|
|
107
|
+
target?: Window | Document | HTMLElement | ShadowRoot | null;
|
|
108
|
+
actInsideInputWithModifier?: boolean;
|
|
109
|
+
preventDefault?: boolean;
|
|
110
|
+
}): boolean;
|
|
111
|
+
type SelectionHandler = (params: {
|
|
112
|
+
nodes: FlowNode[];
|
|
113
|
+
edges: FlowEdge[];
|
|
114
|
+
}) => void;
|
|
115
|
+
export declare function useOnSelectionChange({ onChange }: {
|
|
116
|
+
onChange: SelectionHandler;
|
|
117
|
+
}): void;
|
|
118
|
+
/** React Flow's SelectionListener: onSelectionChange (prop and hook handlers) when the selection changes. */
|
|
119
|
+
export declare function SelectionListener({ onSelectionChange }: {
|
|
120
|
+
onSelectionChange?: SelectionHandler;
|
|
121
|
+
}): null;
|
|
122
|
+
type ViewportHandler = (viewport: {
|
|
123
|
+
x: number;
|
|
124
|
+
y: number;
|
|
125
|
+
zoom: number;
|
|
126
|
+
}) => void;
|
|
127
|
+
export declare function useOnViewportChange({ onStart, onChange, onEnd }: {
|
|
128
|
+
onStart?: ViewportHandler;
|
|
129
|
+
onChange?: ViewportHandler;
|
|
130
|
+
onEnd?: ViewportHandler;
|
|
131
|
+
}): void;
|
|
132
|
+
/** xyflow's useNodesInitialized: every node measured (with its handles). */
|
|
133
|
+
export declare function useNodesInitialized(options?: {
|
|
134
|
+
includeHiddenNodes?: boolean;
|
|
135
|
+
}): boolean;
|
|
136
|
+
type HandleConnection = Connection & {
|
|
137
|
+
edgeId: string;
|
|
138
|
+
};
|
|
139
|
+
/** Deprecated in React Flow for useNodeConnections; kept for its users. */
|
|
140
|
+
export declare function useHandleConnections({ type, id, nodeId, onConnect, onDisconnect, }: {
|
|
141
|
+
type: "source" | "target";
|
|
142
|
+
id?: string | null;
|
|
143
|
+
nodeId?: string;
|
|
144
|
+
onConnect?: (connections: HandleConnection[]) => void;
|
|
145
|
+
onDisconnect?: (connections: HandleConnection[]) => void;
|
|
146
|
+
}): HandleConnection[];
|
|
147
|
+
/** xyflow's useUpdateNodeInternals: re-measure nodes (their handles moved). */
|
|
148
|
+
export declare function useUpdateNodeInternals(): (id: string | string[]) => void;
|
|
149
|
+
type Middleware<C> = (changes: C[]) => C[];
|
|
150
|
+
declare function useOnNodesChangeMiddleware<C>(fn: Middleware<C>): void;
|
|
151
|
+
declare function useOnEdgesChangeMiddleware<C>(fn: Middleware<C>): void;
|
|
152
|
+
/** React Flow's experimental change middleware: rewrites drag and arrow-key position changes. */
|
|
153
|
+
export declare const experimental_useOnNodesChangeMiddleware: typeof useOnNodesChangeMiddleware;
|
|
154
|
+
export declare const experimental_useOnEdgesChangeMiddleware: typeof useOnEdgesChangeMiddleware;
|
|
155
|
+
export { StoreContext };
|