@xyflow/vue 2.0.0-next.5 → 2.0.0-next.6

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/dist/index.d.mts CHANGED
@@ -73,10 +73,10 @@ interface BackgroundProps {
73
73
  //#region src/components/Background/Background.vue.d.ts
74
74
  declare const _default: typeof __VLS_export$15;
75
75
  declare const __VLS_export$15: __VLS_WithSlots$11<import("vue").DefineComponent<BackgroundProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<BackgroundProps> & Readonly<{}>, {
76
+ offset: number | [number, number];
76
77
  x: number;
77
78
  y: number;
78
79
  size: number;
79
- offset: number | [number, number];
80
80
  variant: BackgroundVariant;
81
81
  gap: number | number[];
82
82
  lineWidth: number;
@@ -2051,8 +2051,8 @@ interface NodeToolbarProps {
2051
2051
  //#region src/components/NodeToolbar/NodeToolbar.vue.d.ts
2052
2052
  declare const _default$12: typeof __VLS_export$3;
2053
2053
  declare const __VLS_export$3: __VLS_WithSlots$2<import("vue").DefineComponent<NodeToolbarProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NodeToolbarProps> & Readonly<{}>, {
2054
- position: Position$1;
2055
2054
  offset: number;
2055
+ position: Position$1;
2056
2056
  isVisible: boolean;
2057
2057
  align: "center" | "start" | "end";
2058
2058
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
@@ -2174,6 +2174,35 @@ interface UseNodesInitializedOptions {
2174
2174
  */
2175
2175
  declare function useNodesInitialized(options?: UseNodesInitializedOptions): import("vue").ComputedRef<boolean>;
2176
2176
  //#endregion
2177
+ //#region src/composables/setupVueFlow.d.ts
2178
+ /**
2179
+ * Create a VueFlow store, `provide` it to the current component's subtree, and return the instance — the
2180
+ * same API as {@link useVueFlow}. The Vue-native alternative to wrapping in `<VueFlowProvider>`: call it
2181
+ * in the component that renders `<VueFlow>` and you get the store's actions/getters/hooks in that same
2182
+ * `setup`, while the rendered `<VueFlow>` (and any `useVueFlow()`/`useStore()` below it) reuse the provided
2183
+ * store instead of creating their own.
2184
+ *
2185
+ * Must run in a component `setup` (it calls `provide`). Delegates to the same store factory as
2186
+ * `<VueFlowProvider>`, so one call scopes one store — host a single `<VueFlow>` per setup.
2187
+ *
2188
+ * @public
2189
+ * @param options - initial flow options (`id`, initial nodes/edges, defaults, …)
2190
+ * @returns the VueFlow instance (same shape `useVueFlow()` returns)
2191
+ * @example
2192
+ * ```vue
2193
+ * <script setup lang="ts">
2194
+ * import { setupVueFlow, VueFlow } from '@xyflow/vue'
2195
+ *
2196
+ * const { addEdges, fitView } = setupVueFlow()
2197
+ * </script>
2198
+ *
2199
+ * <template>
2200
+ * <VueFlow v-model:nodes="nodes" v-model:edges="edges" />
2201
+ * </template>
2202
+ * ```
2203
+ */
2204
+ declare function setupVueFlow<NodeType extends Node = Node, EdgeType extends Edge = Edge>(options?: FlowOptions<NodeType, EdgeType>): VueFlowInstance<NodeType, EdgeType>;
2205
+ //#endregion
2177
2206
  //#region src/container/VueFlow/VueFlow.vue.d.ts
2178
2207
  declare const _default$14: typeof __VLS_export$1;
2179
2208
  declare const __VLS_export$1: <NodeType extends Node = Node, EdgeType extends Edge = Edge>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
@@ -2509,5 +2538,5 @@ declare function addEdge<EdgeType extends EdgeBase>(edgeParams: EdgeType | Conne
2509
2538
  */
2510
2539
  declare function reconnectEdge<EdgeType extends EdgeBase>(oldEdge: EdgeType, newConnection: Connection$1, edges: EdgeType[], options?: ReconnectEdgeOptions): EdgeType[];
2511
2540
  //#endregion
2512
- export { Actions, AddEdges, AddNodes, type Align, type AriaLabelConfig, _default as Background, BackgroundProps, BackgroundVariant, _default$1 as BaseEdge, BaseEdgeProps, BezierEdge, BezierEdgeProps, BezierEdgeType, BezierPathOptions, BuiltInNode, CSSVars, ClassValue, type ColorMode, ComputedGetters, ConnectEndEvent, ConnectingHandle, type Connection, ConnectionInProgress, ConnectionLineOptions, ConnectionLineProps, ConnectionLineType, ConnectionLookup, ConnectionMode, ConnectionState, ConnectionStatus, Connector, _default$2 as ControlButton, ControlEmits, type ControlLinePosition, type ControlPosition, ControlProps, _default$3 as Controls, type CoordinateExtent, CustomThemeVars, DefaultEdge, DefaultEdgeOptions, DefaultEdgeTypes, DefaultNodeTypes, DeleteElements, type Dimensions, Edge, EdgeAddChange, EdgeChange, EdgeComponent, EdgeEventsHandler, EdgeEventsOn, EdgeLabelOptions, _default$4 as EdgeLabelRenderer, EdgeLookup, EdgeMarker, EdgeMarkerType, EdgeMouseEvent, EdgePositions, EdgeProps, EdgeReconnectEndEvent, EdgeReconnectEvent, EdgeReconnectStartEvent, EdgeReconnectable, type EdgeRemoveChange, type EdgeSelectionChange, EdgeSlots, _default$5 as EdgeText, EdgeTextProps, _default$6 as EdgeToolbar, EdgeToolbarProps, EdgeTypesObject, ElementChange, ErrorCode, type FinalConnectionState, FitBounds, FitBoundsOptions, FitView, type FitViewOptions, FlowEmits, FlowEvents, FlowExportObject, FlowHooks, FlowHooksEmit, FlowHooksOn, FlowOptions, FlowProps, FlowSlots, GetEdge, GetInternalNode, GetIntersectingNodes, GetNode, type GetViewport, Getters, _default$7 as Handle, HandleConnectable, HandleConnectableFunc, HandleElement, HandleProps, type HandleType, InternalNode, IsNodeIntersecting, IsValidParams, MarkerProps, MarkerType, _default$8 as MiniMap, MiniMapEmits, _default$9 as MiniMapNode, MiniMapNodeEmits, MiniMapNodeFunc, MiniMapNodeProps, MiniMapProps, MiniMapSlots, MouseTouchEvent, NoConnection, Node, NodeAddChange, NodeChange, NodeComponent, type NodeConnection, type NodeDimensionChange, NodeDragEvent, NodeDragItem, NodeEventsHandler, NodeEventsOn, NodeHandleBounds, NodeId as NodeIdInjection, NodeLookup, NodeMouseEvent, NodeOrigin, type NodePositionChange, NodeProps, type NodeRemoveChange, _default$10 as NodeResizeControl, _default$11 as NodeResizer, NodeResizerEmits, NodeResizerProps, type NodeSelectionChange, NodeSlots, _default$12 as NodeToolbar, NodeToolbarProps, NodeTypesObject, OnBeforeDelete, OnConnectStartParams, OnResize, OnResizeEnd, OnResizeStart, type Padding, type PaddingUnit, type PaddingWithUnit, PanOnScrollMode, _default$13 as Panel, PanelProps, Position, type Project, ReconnectEdge, type Rect, RemoveEdges, RemoveNodes, ResizeControlLineProps, ResizeControlProps, ResizeControlVariant, type ResizeDragEvent, type ResizeParams, type ResizeParamsWithDirection, Result, SelectionChangeEvent, SelectionMode, type SelectionRect, type SetCenter, type SetCenterOptions, SetEdges, SetNodes, SetState, SetStateOptions, type SetViewport, ShapeRendering, type ShouldResize, SimpleBezierEdge, SimpleBezierEdgeProps, Slots, SmoothStepEdge, SmoothStepEdgeProps, SmoothStepEdgeType, SmoothStepPathOptions, type SnapGrid, State, StepEdge, StepEdgeProps, StraightEdge, StraightEdgeProps, Styles, ThemeVars, UpdateEdge, UpdateEdgeData, UpdateNode, UpdateNodeData, UpdateNodeDimensions, UpdateNodeDimensionsParams, UpdateNodeInternals, UpdateNodePosition, ValidConnectionFunc, type Viewport, ViewportFunctions, type ViewportHelperFunctionOptions, _default$14 as VueFlow, VueFlowError, VueFlow as VueFlowInjection, VueFlowInstance, _default$15 as VueFlowProvider, VueFlowState, VueFlowStoreHandle, type XYPosition, type ZIndexMode, type ZoomInOut, type ZoomTo, addEdge, applyChanges, applyEdgeChanges, applyNodeChanges, clamp, connectionExists, connectionLineProps, defaultEdgeTypes, defaultNodeTypes, edgeProps, getBezierEdgeCenter, getBezierPath, getBoundsOfBoxes, getBoundsOfRects, getConnectedEdges, getConnectionStatus, getIncomers, getMarkerId, getNodesBounds, getNodesInside, getOutgoers, getSimpleBezierPath, getSmoothStepPath, getStraightPath, getViewportForBounds, isEdge, isEdgeBase, isErrorOfType, isInternalNode, isInternalNodeBase, isMacOs, isNode, isNodeBase, nodeProps, pointToRendererPoint, reconnectEdge, rendererPointToPoint, storeToRefs, useConnection, useEdge, useEdgesData, useHandle, useInternalNode, useKeyPress, useNode, useNodeConnections, useNodeId, useNodesData, useNodesInitialized, useStore, useVueFlow };
2541
+ export { Actions, AddEdges, AddNodes, type Align, type AriaLabelConfig, _default as Background, BackgroundProps, BackgroundVariant, _default$1 as BaseEdge, BaseEdgeProps, BezierEdge, BezierEdgeProps, BezierEdgeType, BezierPathOptions, BuiltInNode, CSSVars, ClassValue, type ColorMode, ComputedGetters, ConnectEndEvent, ConnectingHandle, type Connection, ConnectionInProgress, ConnectionLineOptions, ConnectionLineProps, ConnectionLineType, ConnectionLookup, ConnectionMode, ConnectionState, ConnectionStatus, Connector, _default$2 as ControlButton, ControlEmits, type ControlLinePosition, type ControlPosition, ControlProps, _default$3 as Controls, type CoordinateExtent, CustomThemeVars, DefaultEdge, DefaultEdgeOptions, DefaultEdgeTypes, DefaultNodeTypes, DeleteElements, type Dimensions, Edge, EdgeAddChange, EdgeChange, EdgeComponent, EdgeEventsHandler, EdgeEventsOn, EdgeLabelOptions, _default$4 as EdgeLabelRenderer, EdgeLookup, EdgeMarker, EdgeMarkerType, EdgeMouseEvent, EdgePositions, EdgeProps, EdgeReconnectEndEvent, EdgeReconnectEvent, EdgeReconnectStartEvent, EdgeReconnectable, type EdgeRemoveChange, type EdgeSelectionChange, EdgeSlots, _default$5 as EdgeText, EdgeTextProps, _default$6 as EdgeToolbar, EdgeToolbarProps, EdgeTypesObject, ElementChange, ErrorCode, type FinalConnectionState, FitBounds, FitBoundsOptions, FitView, type FitViewOptions, FlowEmits, FlowEvents, FlowExportObject, FlowHooks, FlowHooksEmit, FlowHooksOn, FlowOptions, FlowProps, FlowSlots, GetEdge, GetInternalNode, GetIntersectingNodes, GetNode, type GetViewport, Getters, _default$7 as Handle, HandleConnectable, HandleConnectableFunc, HandleElement, HandleProps, type HandleType, InternalNode, IsNodeIntersecting, IsValidParams, MarkerProps, MarkerType, _default$8 as MiniMap, MiniMapEmits, _default$9 as MiniMapNode, MiniMapNodeEmits, MiniMapNodeFunc, MiniMapNodeProps, MiniMapProps, MiniMapSlots, MouseTouchEvent, NoConnection, Node, NodeAddChange, NodeChange, NodeComponent, type NodeConnection, type NodeDimensionChange, NodeDragEvent, NodeDragItem, NodeEventsHandler, NodeEventsOn, NodeHandleBounds, NodeId as NodeIdInjection, NodeLookup, NodeMouseEvent, NodeOrigin, type NodePositionChange, NodeProps, type NodeRemoveChange, _default$10 as NodeResizeControl, _default$11 as NodeResizer, NodeResizerEmits, NodeResizerProps, type NodeSelectionChange, NodeSlots, _default$12 as NodeToolbar, NodeToolbarProps, NodeTypesObject, OnBeforeDelete, OnConnectStartParams, OnResize, OnResizeEnd, OnResizeStart, type Padding, type PaddingUnit, type PaddingWithUnit, PanOnScrollMode, _default$13 as Panel, PanelProps, Position, type Project, ReconnectEdge, type Rect, RemoveEdges, RemoveNodes, ResizeControlLineProps, ResizeControlProps, ResizeControlVariant, type ResizeDragEvent, type ResizeParams, type ResizeParamsWithDirection, Result, SelectionChangeEvent, SelectionMode, type SelectionRect, type SetCenter, type SetCenterOptions, SetEdges, SetNodes, SetState, SetStateOptions, type SetViewport, ShapeRendering, type ShouldResize, SimpleBezierEdge, SimpleBezierEdgeProps, Slots, SmoothStepEdge, SmoothStepEdgeProps, SmoothStepEdgeType, SmoothStepPathOptions, type SnapGrid, State, StepEdge, StepEdgeProps, StraightEdge, StraightEdgeProps, Styles, ThemeVars, UpdateEdge, UpdateEdgeData, UpdateNode, UpdateNodeData, UpdateNodeDimensions, UpdateNodeDimensionsParams, UpdateNodeInternals, UpdateNodePosition, ValidConnectionFunc, type Viewport, ViewportFunctions, type ViewportHelperFunctionOptions, _default$14 as VueFlow, VueFlowError, VueFlow as VueFlowInjection, VueFlowInstance, _default$15 as VueFlowProvider, VueFlowState, VueFlowStoreHandle, type XYPosition, type ZIndexMode, type ZoomInOut, type ZoomTo, addEdge, applyChanges, applyEdgeChanges, applyNodeChanges, clamp, connectionExists, connectionLineProps, defaultEdgeTypes, defaultNodeTypes, edgeProps, getBezierEdgeCenter, getBezierPath, getBoundsOfBoxes, getBoundsOfRects, getConnectedEdges, getConnectionStatus, getIncomers, getMarkerId, getNodesBounds, getNodesInside, getOutgoers, getSimpleBezierPath, getSmoothStepPath, getStraightPath, getViewportForBounds, isEdge, isEdgeBase, isErrorOfType, isInternalNode, isInternalNodeBase, isMacOs, isNode, isNodeBase, nodeProps, pointToRendererPoint, reconnectEdge, rendererPointToPoint, setupVueFlow, storeToRefs, useConnection, useEdge, useEdgesData, useHandle, useInternalNode, useKeyPress, useNode, useNodeConnections, useNodeId, useNodesData, useNodesInitialized, useStore, useVueFlow };
2513
2542
  //# sourceMappingURL=index.d.mts.map
package/dist/index.d.ts CHANGED
@@ -73,10 +73,10 @@ interface BackgroundProps {
73
73
  //#region src/components/Background/Background.vue.d.ts
74
74
  declare const _default: typeof __VLS_export$15;
75
75
  declare const __VLS_export$15: __VLS_WithSlots$11<import("vue").DefineComponent<BackgroundProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<BackgroundProps> & Readonly<{}>, {
76
+ offset: number | [number, number];
76
77
  x: number;
77
78
  y: number;
78
79
  size: number;
79
- offset: number | [number, number];
80
80
  variant: BackgroundVariant;
81
81
  gap: number | number[];
82
82
  lineWidth: number;
@@ -2051,8 +2051,8 @@ interface NodeToolbarProps {
2051
2051
  //#region src/components/NodeToolbar/NodeToolbar.vue.d.ts
2052
2052
  declare const _default$12: typeof __VLS_export$3;
2053
2053
  declare const __VLS_export$3: __VLS_WithSlots$2<import("vue").DefineComponent<NodeToolbarProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NodeToolbarProps> & Readonly<{}>, {
2054
- position: Position$1;
2055
2054
  offset: number;
2055
+ position: Position$1;
2056
2056
  isVisible: boolean;
2057
2057
  align: "center" | "start" | "end";
2058
2058
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
@@ -2174,6 +2174,35 @@ interface UseNodesInitializedOptions {
2174
2174
  */
2175
2175
  declare function useNodesInitialized(options?: UseNodesInitializedOptions): import("vue").ComputedRef<boolean>;
2176
2176
  //#endregion
2177
+ //#region src/composables/setupVueFlow.d.ts
2178
+ /**
2179
+ * Create a VueFlow store, `provide` it to the current component's subtree, and return the instance — the
2180
+ * same API as {@link useVueFlow}. The Vue-native alternative to wrapping in `<VueFlowProvider>`: call it
2181
+ * in the component that renders `<VueFlow>` and you get the store's actions/getters/hooks in that same
2182
+ * `setup`, while the rendered `<VueFlow>` (and any `useVueFlow()`/`useStore()` below it) reuse the provided
2183
+ * store instead of creating their own.
2184
+ *
2185
+ * Must run in a component `setup` (it calls `provide`). Delegates to the same store factory as
2186
+ * `<VueFlowProvider>`, so one call scopes one store — host a single `<VueFlow>` per setup.
2187
+ *
2188
+ * @public
2189
+ * @param options - initial flow options (`id`, initial nodes/edges, defaults, …)
2190
+ * @returns the VueFlow instance (same shape `useVueFlow()` returns)
2191
+ * @example
2192
+ * ```vue
2193
+ * <script setup lang="ts">
2194
+ * import { setupVueFlow, VueFlow } from '@xyflow/vue'
2195
+ *
2196
+ * const { addEdges, fitView } = setupVueFlow()
2197
+ * </script>
2198
+ *
2199
+ * <template>
2200
+ * <VueFlow v-model:nodes="nodes" v-model:edges="edges" />
2201
+ * </template>
2202
+ * ```
2203
+ */
2204
+ declare function setupVueFlow<NodeType extends Node = Node, EdgeType extends Edge = Edge>(options?: FlowOptions<NodeType, EdgeType>): VueFlowInstance<NodeType, EdgeType>;
2205
+ //#endregion
2177
2206
  //#region src/container/VueFlow/VueFlow.vue.d.ts
2178
2207
  declare const _default$14: typeof __VLS_export$1;
2179
2208
  declare const __VLS_export$1: <NodeType extends Node = Node, EdgeType extends Edge = Edge>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
@@ -2509,5 +2538,5 @@ declare function addEdge<EdgeType extends EdgeBase>(edgeParams: EdgeType | Conne
2509
2538
  */
2510
2539
  declare function reconnectEdge<EdgeType extends EdgeBase>(oldEdge: EdgeType, newConnection: Connection$1, edges: EdgeType[], options?: ReconnectEdgeOptions): EdgeType[];
2511
2540
  //#endregion
2512
- export { Actions, AddEdges, AddNodes, type Align, type AriaLabelConfig, _default as Background, BackgroundProps, BackgroundVariant, _default$1 as BaseEdge, BaseEdgeProps, BezierEdge, BezierEdgeProps, BezierEdgeType, BezierPathOptions, BuiltInNode, CSSVars, ClassValue, type ColorMode, ComputedGetters, ConnectEndEvent, ConnectingHandle, type Connection, ConnectionInProgress, ConnectionLineOptions, ConnectionLineProps, ConnectionLineType, ConnectionLookup, ConnectionMode, ConnectionState, ConnectionStatus, Connector, _default$2 as ControlButton, ControlEmits, type ControlLinePosition, type ControlPosition, ControlProps, _default$3 as Controls, type CoordinateExtent, CustomThemeVars, DefaultEdge, DefaultEdgeOptions, DefaultEdgeTypes, DefaultNodeTypes, DeleteElements, type Dimensions, Edge, EdgeAddChange, EdgeChange, EdgeComponent, EdgeEventsHandler, EdgeEventsOn, EdgeLabelOptions, _default$4 as EdgeLabelRenderer, EdgeLookup, EdgeMarker, EdgeMarkerType, EdgeMouseEvent, EdgePositions, EdgeProps, EdgeReconnectEndEvent, EdgeReconnectEvent, EdgeReconnectStartEvent, EdgeReconnectable, type EdgeRemoveChange, type EdgeSelectionChange, EdgeSlots, _default$5 as EdgeText, EdgeTextProps, _default$6 as EdgeToolbar, EdgeToolbarProps, EdgeTypesObject, ElementChange, ErrorCode, type FinalConnectionState, FitBounds, FitBoundsOptions, FitView, type FitViewOptions, FlowEmits, FlowEvents, FlowExportObject, FlowHooks, FlowHooksEmit, FlowHooksOn, FlowOptions, FlowProps, FlowSlots, GetEdge, GetInternalNode, GetIntersectingNodes, GetNode, type GetViewport, Getters, _default$7 as Handle, HandleConnectable, HandleConnectableFunc, HandleElement, HandleProps, type HandleType, InternalNode, IsNodeIntersecting, IsValidParams, MarkerProps, MarkerType, _default$8 as MiniMap, MiniMapEmits, _default$9 as MiniMapNode, MiniMapNodeEmits, MiniMapNodeFunc, MiniMapNodeProps, MiniMapProps, MiniMapSlots, MouseTouchEvent, NoConnection, Node, NodeAddChange, NodeChange, NodeComponent, type NodeConnection, type NodeDimensionChange, NodeDragEvent, NodeDragItem, NodeEventsHandler, NodeEventsOn, NodeHandleBounds, NodeId as NodeIdInjection, NodeLookup, NodeMouseEvent, NodeOrigin, type NodePositionChange, NodeProps, type NodeRemoveChange, _default$10 as NodeResizeControl, _default$11 as NodeResizer, NodeResizerEmits, NodeResizerProps, type NodeSelectionChange, NodeSlots, _default$12 as NodeToolbar, NodeToolbarProps, NodeTypesObject, OnBeforeDelete, OnConnectStartParams, OnResize, OnResizeEnd, OnResizeStart, type Padding, type PaddingUnit, type PaddingWithUnit, PanOnScrollMode, _default$13 as Panel, PanelProps, Position, type Project, ReconnectEdge, type Rect, RemoveEdges, RemoveNodes, ResizeControlLineProps, ResizeControlProps, ResizeControlVariant, type ResizeDragEvent, type ResizeParams, type ResizeParamsWithDirection, Result, SelectionChangeEvent, SelectionMode, type SelectionRect, type SetCenter, type SetCenterOptions, SetEdges, SetNodes, SetState, SetStateOptions, type SetViewport, ShapeRendering, type ShouldResize, SimpleBezierEdge, SimpleBezierEdgeProps, Slots, SmoothStepEdge, SmoothStepEdgeProps, SmoothStepEdgeType, SmoothStepPathOptions, type SnapGrid, State, StepEdge, StepEdgeProps, StraightEdge, StraightEdgeProps, Styles, ThemeVars, UpdateEdge, UpdateEdgeData, UpdateNode, UpdateNodeData, UpdateNodeDimensions, UpdateNodeDimensionsParams, UpdateNodeInternals, UpdateNodePosition, ValidConnectionFunc, type Viewport, ViewportFunctions, type ViewportHelperFunctionOptions, _default$14 as VueFlow, VueFlowError, VueFlow as VueFlowInjection, VueFlowInstance, _default$15 as VueFlowProvider, VueFlowState, VueFlowStoreHandle, type XYPosition, type ZIndexMode, type ZoomInOut, type ZoomTo, addEdge, applyChanges, applyEdgeChanges, applyNodeChanges, clamp, connectionExists, connectionLineProps, defaultEdgeTypes, defaultNodeTypes, edgeProps, getBezierEdgeCenter, getBezierPath, getBoundsOfBoxes, getBoundsOfRects, getConnectedEdges, getConnectionStatus, getIncomers, getMarkerId, getNodesBounds, getNodesInside, getOutgoers, getSimpleBezierPath, getSmoothStepPath, getStraightPath, getViewportForBounds, isEdge, isEdgeBase, isErrorOfType, isInternalNode, isInternalNodeBase, isMacOs, isNode, isNodeBase, nodeProps, pointToRendererPoint, reconnectEdge, rendererPointToPoint, storeToRefs, useConnection, useEdge, useEdgesData, useHandle, useInternalNode, useKeyPress, useNode, useNodeConnections, useNodeId, useNodesData, useNodesInitialized, useStore, useVueFlow };
2541
+ export { Actions, AddEdges, AddNodes, type Align, type AriaLabelConfig, _default as Background, BackgroundProps, BackgroundVariant, _default$1 as BaseEdge, BaseEdgeProps, BezierEdge, BezierEdgeProps, BezierEdgeType, BezierPathOptions, BuiltInNode, CSSVars, ClassValue, type ColorMode, ComputedGetters, ConnectEndEvent, ConnectingHandle, type Connection, ConnectionInProgress, ConnectionLineOptions, ConnectionLineProps, ConnectionLineType, ConnectionLookup, ConnectionMode, ConnectionState, ConnectionStatus, Connector, _default$2 as ControlButton, ControlEmits, type ControlLinePosition, type ControlPosition, ControlProps, _default$3 as Controls, type CoordinateExtent, CustomThemeVars, DefaultEdge, DefaultEdgeOptions, DefaultEdgeTypes, DefaultNodeTypes, DeleteElements, type Dimensions, Edge, EdgeAddChange, EdgeChange, EdgeComponent, EdgeEventsHandler, EdgeEventsOn, EdgeLabelOptions, _default$4 as EdgeLabelRenderer, EdgeLookup, EdgeMarker, EdgeMarkerType, EdgeMouseEvent, EdgePositions, EdgeProps, EdgeReconnectEndEvent, EdgeReconnectEvent, EdgeReconnectStartEvent, EdgeReconnectable, type EdgeRemoveChange, type EdgeSelectionChange, EdgeSlots, _default$5 as EdgeText, EdgeTextProps, _default$6 as EdgeToolbar, EdgeToolbarProps, EdgeTypesObject, ElementChange, ErrorCode, type FinalConnectionState, FitBounds, FitBoundsOptions, FitView, type FitViewOptions, FlowEmits, FlowEvents, FlowExportObject, FlowHooks, FlowHooksEmit, FlowHooksOn, FlowOptions, FlowProps, FlowSlots, GetEdge, GetInternalNode, GetIntersectingNodes, GetNode, type GetViewport, Getters, _default$7 as Handle, HandleConnectable, HandleConnectableFunc, HandleElement, HandleProps, type HandleType, InternalNode, IsNodeIntersecting, IsValidParams, MarkerProps, MarkerType, _default$8 as MiniMap, MiniMapEmits, _default$9 as MiniMapNode, MiniMapNodeEmits, MiniMapNodeFunc, MiniMapNodeProps, MiniMapProps, MiniMapSlots, MouseTouchEvent, NoConnection, Node, NodeAddChange, NodeChange, NodeComponent, type NodeConnection, type NodeDimensionChange, NodeDragEvent, NodeDragItem, NodeEventsHandler, NodeEventsOn, NodeHandleBounds, NodeId as NodeIdInjection, NodeLookup, NodeMouseEvent, NodeOrigin, type NodePositionChange, NodeProps, type NodeRemoveChange, _default$10 as NodeResizeControl, _default$11 as NodeResizer, NodeResizerEmits, NodeResizerProps, type NodeSelectionChange, NodeSlots, _default$12 as NodeToolbar, NodeToolbarProps, NodeTypesObject, OnBeforeDelete, OnConnectStartParams, OnResize, OnResizeEnd, OnResizeStart, type Padding, type PaddingUnit, type PaddingWithUnit, PanOnScrollMode, _default$13 as Panel, PanelProps, Position, type Project, ReconnectEdge, type Rect, RemoveEdges, RemoveNodes, ResizeControlLineProps, ResizeControlProps, ResizeControlVariant, type ResizeDragEvent, type ResizeParams, type ResizeParamsWithDirection, Result, SelectionChangeEvent, SelectionMode, type SelectionRect, type SetCenter, type SetCenterOptions, SetEdges, SetNodes, SetState, SetStateOptions, type SetViewport, ShapeRendering, type ShouldResize, SimpleBezierEdge, SimpleBezierEdgeProps, Slots, SmoothStepEdge, SmoothStepEdgeProps, SmoothStepEdgeType, SmoothStepPathOptions, type SnapGrid, State, StepEdge, StepEdgeProps, StraightEdge, StraightEdgeProps, Styles, ThemeVars, UpdateEdge, UpdateEdgeData, UpdateNode, UpdateNodeData, UpdateNodeDimensions, UpdateNodeDimensionsParams, UpdateNodeInternals, UpdateNodePosition, ValidConnectionFunc, type Viewport, ViewportFunctions, type ViewportHelperFunctionOptions, _default$14 as VueFlow, VueFlowError, VueFlow as VueFlowInjection, VueFlowInstance, _default$15 as VueFlowProvider, VueFlowState, VueFlowStoreHandle, type XYPosition, type ZIndexMode, type ZoomInOut, type ZoomTo, addEdge, applyChanges, applyEdgeChanges, applyNodeChanges, clamp, connectionExists, connectionLineProps, defaultEdgeTypes, defaultNodeTypes, edgeProps, getBezierEdgeCenter, getBezierPath, getBoundsOfBoxes, getBoundsOfRects, getConnectedEdges, getConnectionStatus, getIncomers, getMarkerId, getNodesBounds, getNodesInside, getOutgoers, getSimpleBezierPath, getSmoothStepPath, getStraightPath, getViewportForBounds, isEdge, isEdgeBase, isErrorOfType, isInternalNode, isInternalNodeBase, isMacOs, isNode, isNodeBase, nodeProps, pointToRendererPoint, reconnectEdge, rendererPointToPoint, setupVueFlow, storeToRefs, useConnection, useEdge, useEdgesData, useHandle, useInternalNode, useKeyPress, useNode, useNodeConnections, useNodeId, useNodesData, useNodesInitialized, useStore, useVueFlow };
2513
2542
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -4040,70 +4040,6 @@ function useNodesInitialized(options = { includeHiddenNodes: false }) {
4040
4040
  return (0, vue.computed)(() => areNodesInitialized(nodeLookup, options.includeHiddenNodes));
4041
4041
  }
4042
4042
  //#endregion
4043
- //#region src/components/A11y/A11yDescriptions.vue
4044
- const _sfc_main$11 = /* @__PURE__ */ (0, vue.defineComponent)({
4045
- name: "A11yDescriptions",
4046
- compatConfig: { MODE: 3 },
4047
- setup(__props, { expose: __expose }) {
4048
- __expose();
4049
- const { id } = useVueFlow();
4050
- const { disableKeyboardA11y, ariaLiveMessage, ariaLabelConfig } = storeToRefs(useStore());
4051
- const __returned__ = {
4052
- id,
4053
- disableKeyboardA11y,
4054
- ariaLiveMessage,
4055
- ariaLabelConfig,
4056
- get ARIA_EDGE_DESC_KEY() {
4057
- return ARIA_EDGE_DESC_KEY;
4058
- },
4059
- get ARIA_LIVE_MESSAGE() {
4060
- return ARIA_LIVE_MESSAGE;
4061
- },
4062
- get ARIA_NODE_DESC_KEY() {
4063
- return ARIA_NODE_DESC_KEY;
4064
- }
4065
- };
4066
- Object.defineProperty(__returned__, "__isScriptSetup", {
4067
- enumerable: false,
4068
- value: true
4069
- });
4070
- return __returned__;
4071
- }
4072
- });
4073
- const _hoisted_1$5 = ["id"];
4074
- const _hoisted_2 = ["id"];
4075
- const _hoisted_3 = ["id"];
4076
- function _sfc_render$11(_ctx, _cache, $props, $setup, $data, $options) {
4077
- return (0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, null, [
4078
- (0, vue.createElementVNode)("div", {
4079
- id: `${$setup.ARIA_NODE_DESC_KEY}-${$setup.id}`,
4080
- style: { "display": "none" }
4081
- }, (0, vue.toDisplayString)($setup.disableKeyboardA11y ? $setup.ariaLabelConfig["node.a11yDescription.default"] : $setup.ariaLabelConfig["node.a11yDescription.keyboardDisabled"]), 9, _hoisted_1$5),
4082
- (0, vue.createElementVNode)("div", {
4083
- id: `${$setup.ARIA_EDGE_DESC_KEY}-${$setup.id}`,
4084
- style: { "display": "none" }
4085
- }, (0, vue.toDisplayString)($setup.ariaLabelConfig["edge.a11yDescription.default"]), 9, _hoisted_2),
4086
- !$setup.disableKeyboardA11y ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
4087
- key: 0,
4088
- id: `${$setup.ARIA_LIVE_MESSAGE}-${$setup.id}`,
4089
- "aria-live": "assertive",
4090
- "aria-atomic": "true",
4091
- style: {
4092
- "position": "absolute",
4093
- "width": "1px",
4094
- "height": "1px",
4095
- "margin": "-1px",
4096
- "border": "0",
4097
- "padding": "0",
4098
- "overflow": "hidden",
4099
- "clip": "rect(0px, 0px, 0px, 0px)",
4100
- "clip-path": "inset(100%)"
4101
- }
4102
- }, (0, vue.toDisplayString)($setup.ariaLiveMessage), 9, _hoisted_3)) : (0, vue.createCommentVNode)("v-if", true)
4103
- ], 64);
4104
- }
4105
- var A11yDescriptions_default = /* @__PURE__ */ export_helper_default(_sfc_main$11, [["render", _sfc_render$11], ["__file", "/Users/moritz/xyflow/xyflow/packages/vue/src/components/A11y/A11yDescriptions.vue"]]);
4106
- //#endregion
4107
4043
  //#region src/store/hooks.ts
4108
4044
  function createHooks() {
4109
4045
  return {
@@ -5157,6 +5093,101 @@ function useCreateVueFlow(options, signals) {
5157
5093
  return handle;
5158
5094
  }
5159
5095
  //#endregion
5096
+ //#region src/composables/setupVueFlow.ts
5097
+ /**
5098
+ * Create a VueFlow store, `provide` it to the current component's subtree, and return the instance — the
5099
+ * same API as {@link useVueFlow}. The Vue-native alternative to wrapping in `<VueFlowProvider>`: call it
5100
+ * in the component that renders `<VueFlow>` and you get the store's actions/getters/hooks in that same
5101
+ * `setup`, while the rendered `<VueFlow>` (and any `useVueFlow()`/`useStore()` below it) reuse the provided
5102
+ * store instead of creating their own.
5103
+ *
5104
+ * Must run in a component `setup` (it calls `provide`). Delegates to the same store factory as
5105
+ * `<VueFlowProvider>`, so one call scopes one store — host a single `<VueFlow>` per setup.
5106
+ *
5107
+ * @public
5108
+ * @param options - initial flow options (`id`, initial nodes/edges, defaults, …)
5109
+ * @returns the VueFlow instance (same shape `useVueFlow()` returns)
5110
+ * @example
5111
+ * ```vue
5112
+ * <script setup lang="ts">
5113
+ * import { setupVueFlow, VueFlow } from '@xyflow/vue'
5114
+ *
5115
+ * const { addEdges, fitView } = setupVueFlow()
5116
+ * <\/script>
5117
+ *
5118
+ * <template>
5119
+ * <VueFlow v-model:nodes="nodes" v-model:edges="edges" />
5120
+ * </template>
5121
+ * ```
5122
+ */
5123
+ function setupVueFlow(options) {
5124
+ return useCreateVueFlow(options).instance;
5125
+ }
5126
+ //#endregion
5127
+ //#region src/components/A11y/A11yDescriptions.vue
5128
+ const _sfc_main$11 = /* @__PURE__ */ (0, vue.defineComponent)({
5129
+ name: "A11yDescriptions",
5130
+ compatConfig: { MODE: 3 },
5131
+ setup(__props, { expose: __expose }) {
5132
+ __expose();
5133
+ const { id } = useVueFlow();
5134
+ const { disableKeyboardA11y, ariaLiveMessage, ariaLabelConfig } = storeToRefs(useStore());
5135
+ const __returned__ = {
5136
+ id,
5137
+ disableKeyboardA11y,
5138
+ ariaLiveMessage,
5139
+ ariaLabelConfig,
5140
+ get ARIA_EDGE_DESC_KEY() {
5141
+ return ARIA_EDGE_DESC_KEY;
5142
+ },
5143
+ get ARIA_LIVE_MESSAGE() {
5144
+ return ARIA_LIVE_MESSAGE;
5145
+ },
5146
+ get ARIA_NODE_DESC_KEY() {
5147
+ return ARIA_NODE_DESC_KEY;
5148
+ }
5149
+ };
5150
+ Object.defineProperty(__returned__, "__isScriptSetup", {
5151
+ enumerable: false,
5152
+ value: true
5153
+ });
5154
+ return __returned__;
5155
+ }
5156
+ });
5157
+ const _hoisted_1$5 = ["id"];
5158
+ const _hoisted_2 = ["id"];
5159
+ const _hoisted_3 = ["id"];
5160
+ function _sfc_render$11(_ctx, _cache, $props, $setup, $data, $options) {
5161
+ return (0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, null, [
5162
+ (0, vue.createElementVNode)("div", {
5163
+ id: `${$setup.ARIA_NODE_DESC_KEY}-${$setup.id}`,
5164
+ style: { "display": "none" }
5165
+ }, (0, vue.toDisplayString)($setup.disableKeyboardA11y ? $setup.ariaLabelConfig["node.a11yDescription.default"] : $setup.ariaLabelConfig["node.a11yDescription.keyboardDisabled"]), 9, _hoisted_1$5),
5166
+ (0, vue.createElementVNode)("div", {
5167
+ id: `${$setup.ARIA_EDGE_DESC_KEY}-${$setup.id}`,
5168
+ style: { "display": "none" }
5169
+ }, (0, vue.toDisplayString)($setup.ariaLabelConfig["edge.a11yDescription.default"]), 9, _hoisted_2),
5170
+ !$setup.disableKeyboardA11y ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
5171
+ key: 0,
5172
+ id: `${$setup.ARIA_LIVE_MESSAGE}-${$setup.id}`,
5173
+ "aria-live": "assertive",
5174
+ "aria-atomic": "true",
5175
+ style: {
5176
+ "position": "absolute",
5177
+ "width": "1px",
5178
+ "height": "1px",
5179
+ "margin": "-1px",
5180
+ "border": "0",
5181
+ "padding": "0",
5182
+ "overflow": "hidden",
5183
+ "clip": "rect(0px, 0px, 0px, 0px)",
5184
+ "clip-path": "inset(100%)"
5185
+ }
5186
+ }, (0, vue.toDisplayString)($setup.ariaLiveMessage), 9, _hoisted_3)) : (0, vue.createCommentVNode)("v-if", true)
5187
+ ], 64);
5188
+ }
5189
+ var A11yDescriptions_default = /* @__PURE__ */ export_helper_default(_sfc_main$11, [["render", _sfc_render$11], ["__file", "/Users/moritz/xyflow/xyflow/packages/vue/src/components/A11y/A11yDescriptions.vue"]]);
5190
+ //#endregion
5160
5191
  //#region src/composables/useOnInitHandler.ts
5161
5192
  /**
5162
5193
  * Composable that handles the initialization of the viewport.
@@ -7793,6 +7824,7 @@ Object.defineProperty(exports, "rendererPointToPoint", {
7793
7824
  return _xyflow_system.rendererPointToPoint;
7794
7825
  }
7795
7826
  });
7827
+ exports.setupVueFlow = setupVueFlow;
7796
7828
  exports.storeToRefs = storeToRefs;
7797
7829
  exports.useConnection = useConnection;
7798
7830
  exports.useEdge = useEdge;