@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.mjs CHANGED
@@ -4039,70 +4039,6 @@ function useNodesInitialized(options = { includeHiddenNodes: false }) {
4039
4039
  return computed(() => areNodesInitialized(nodeLookup, options.includeHiddenNodes));
4040
4040
  }
4041
4041
  //#endregion
4042
- //#region src/components/A11y/A11yDescriptions.vue
4043
- const _sfc_main$11 = /* @__PURE__ */ defineComponent({
4044
- name: "A11yDescriptions",
4045
- compatConfig: { MODE: 3 },
4046
- setup(__props, { expose: __expose }) {
4047
- __expose();
4048
- const { id } = useVueFlow();
4049
- const { disableKeyboardA11y, ariaLiveMessage, ariaLabelConfig } = storeToRefs(useStore());
4050
- const __returned__ = {
4051
- id,
4052
- disableKeyboardA11y,
4053
- ariaLiveMessage,
4054
- ariaLabelConfig,
4055
- get ARIA_EDGE_DESC_KEY() {
4056
- return ARIA_EDGE_DESC_KEY;
4057
- },
4058
- get ARIA_LIVE_MESSAGE() {
4059
- return ARIA_LIVE_MESSAGE;
4060
- },
4061
- get ARIA_NODE_DESC_KEY() {
4062
- return ARIA_NODE_DESC_KEY;
4063
- }
4064
- };
4065
- Object.defineProperty(__returned__, "__isScriptSetup", {
4066
- enumerable: false,
4067
- value: true
4068
- });
4069
- return __returned__;
4070
- }
4071
- });
4072
- const _hoisted_1$5 = ["id"];
4073
- const _hoisted_2 = ["id"];
4074
- const _hoisted_3 = ["id"];
4075
- function _sfc_render$11(_ctx, _cache, $props, $setup, $data, $options) {
4076
- return openBlock(), createElementBlock(Fragment, null, [
4077
- createElementVNode("div", {
4078
- id: `${$setup.ARIA_NODE_DESC_KEY}-${$setup.id}`,
4079
- style: { "display": "none" }
4080
- }, toDisplayString($setup.disableKeyboardA11y ? $setup.ariaLabelConfig["node.a11yDescription.default"] : $setup.ariaLabelConfig["node.a11yDescription.keyboardDisabled"]), 9, _hoisted_1$5),
4081
- createElementVNode("div", {
4082
- id: `${$setup.ARIA_EDGE_DESC_KEY}-${$setup.id}`,
4083
- style: { "display": "none" }
4084
- }, toDisplayString($setup.ariaLabelConfig["edge.a11yDescription.default"]), 9, _hoisted_2),
4085
- !$setup.disableKeyboardA11y ? (openBlock(), createElementBlock("div", {
4086
- key: 0,
4087
- id: `${$setup.ARIA_LIVE_MESSAGE}-${$setup.id}`,
4088
- "aria-live": "assertive",
4089
- "aria-atomic": "true",
4090
- style: {
4091
- "position": "absolute",
4092
- "width": "1px",
4093
- "height": "1px",
4094
- "margin": "-1px",
4095
- "border": "0",
4096
- "padding": "0",
4097
- "overflow": "hidden",
4098
- "clip": "rect(0px, 0px, 0px, 0px)",
4099
- "clip-path": "inset(100%)"
4100
- }
4101
- }, toDisplayString($setup.ariaLiveMessage), 9, _hoisted_3)) : createCommentVNode("v-if", true)
4102
- ], 64);
4103
- }
4104
- 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"]]);
4105
- //#endregion
4106
4042
  //#region src/store/hooks.ts
4107
4043
  function createHooks() {
4108
4044
  return {
@@ -5156,6 +5092,101 @@ function useCreateVueFlow(options, signals) {
5156
5092
  return handle;
5157
5093
  }
5158
5094
  //#endregion
5095
+ //#region src/composables/setupVueFlow.ts
5096
+ /**
5097
+ * Create a VueFlow store, `provide` it to the current component's subtree, and return the instance — the
5098
+ * same API as {@link useVueFlow}. The Vue-native alternative to wrapping in `<VueFlowProvider>`: call it
5099
+ * in the component that renders `<VueFlow>` and you get the store's actions/getters/hooks in that same
5100
+ * `setup`, while the rendered `<VueFlow>` (and any `useVueFlow()`/`useStore()` below it) reuse the provided
5101
+ * store instead of creating their own.
5102
+ *
5103
+ * Must run in a component `setup` (it calls `provide`). Delegates to the same store factory as
5104
+ * `<VueFlowProvider>`, so one call scopes one store — host a single `<VueFlow>` per setup.
5105
+ *
5106
+ * @public
5107
+ * @param options - initial flow options (`id`, initial nodes/edges, defaults, …)
5108
+ * @returns the VueFlow instance (same shape `useVueFlow()` returns)
5109
+ * @example
5110
+ * ```vue
5111
+ * <script setup lang="ts">
5112
+ * import { setupVueFlow, VueFlow } from '@xyflow/vue'
5113
+ *
5114
+ * const { addEdges, fitView } = setupVueFlow()
5115
+ * <\/script>
5116
+ *
5117
+ * <template>
5118
+ * <VueFlow v-model:nodes="nodes" v-model:edges="edges" />
5119
+ * </template>
5120
+ * ```
5121
+ */
5122
+ function setupVueFlow(options) {
5123
+ return useCreateVueFlow(options).instance;
5124
+ }
5125
+ //#endregion
5126
+ //#region src/components/A11y/A11yDescriptions.vue
5127
+ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
5128
+ name: "A11yDescriptions",
5129
+ compatConfig: { MODE: 3 },
5130
+ setup(__props, { expose: __expose }) {
5131
+ __expose();
5132
+ const { id } = useVueFlow();
5133
+ const { disableKeyboardA11y, ariaLiveMessage, ariaLabelConfig } = storeToRefs(useStore());
5134
+ const __returned__ = {
5135
+ id,
5136
+ disableKeyboardA11y,
5137
+ ariaLiveMessage,
5138
+ ariaLabelConfig,
5139
+ get ARIA_EDGE_DESC_KEY() {
5140
+ return ARIA_EDGE_DESC_KEY;
5141
+ },
5142
+ get ARIA_LIVE_MESSAGE() {
5143
+ return ARIA_LIVE_MESSAGE;
5144
+ },
5145
+ get ARIA_NODE_DESC_KEY() {
5146
+ return ARIA_NODE_DESC_KEY;
5147
+ }
5148
+ };
5149
+ Object.defineProperty(__returned__, "__isScriptSetup", {
5150
+ enumerable: false,
5151
+ value: true
5152
+ });
5153
+ return __returned__;
5154
+ }
5155
+ });
5156
+ const _hoisted_1$5 = ["id"];
5157
+ const _hoisted_2 = ["id"];
5158
+ const _hoisted_3 = ["id"];
5159
+ function _sfc_render$11(_ctx, _cache, $props, $setup, $data, $options) {
5160
+ return openBlock(), createElementBlock(Fragment, null, [
5161
+ createElementVNode("div", {
5162
+ id: `${$setup.ARIA_NODE_DESC_KEY}-${$setup.id}`,
5163
+ style: { "display": "none" }
5164
+ }, toDisplayString($setup.disableKeyboardA11y ? $setup.ariaLabelConfig["node.a11yDescription.default"] : $setup.ariaLabelConfig["node.a11yDescription.keyboardDisabled"]), 9, _hoisted_1$5),
5165
+ createElementVNode("div", {
5166
+ id: `${$setup.ARIA_EDGE_DESC_KEY}-${$setup.id}`,
5167
+ style: { "display": "none" }
5168
+ }, toDisplayString($setup.ariaLabelConfig["edge.a11yDescription.default"]), 9, _hoisted_2),
5169
+ !$setup.disableKeyboardA11y ? (openBlock(), createElementBlock("div", {
5170
+ key: 0,
5171
+ id: `${$setup.ARIA_LIVE_MESSAGE}-${$setup.id}`,
5172
+ "aria-live": "assertive",
5173
+ "aria-atomic": "true",
5174
+ style: {
5175
+ "position": "absolute",
5176
+ "width": "1px",
5177
+ "height": "1px",
5178
+ "margin": "-1px",
5179
+ "border": "0",
5180
+ "padding": "0",
5181
+ "overflow": "hidden",
5182
+ "clip": "rect(0px, 0px, 0px, 0px)",
5183
+ "clip-path": "inset(100%)"
5184
+ }
5185
+ }, toDisplayString($setup.ariaLiveMessage), 9, _hoisted_3)) : createCommentVNode("v-if", true)
5186
+ ], 64);
5187
+ }
5188
+ 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"]]);
5189
+ //#endregion
5159
5190
  //#region src/composables/useOnInitHandler.ts
5160
5191
  /**
5161
5192
  * Composable that handles the initialization of the viewport.
@@ -7587,6 +7618,6 @@ function reconnectEdge(oldEdge, newConnection, edges, options = { shouldReplaceI
7587
7618
  });
7588
7619
  }
7589
7620
  //#endregion
7590
- export { Background_default as Background, BaseEdge_default as BaseEdge, BezierEdge, ConnectionLineType, ConnectionMode, ControlButton_default as ControlButton, Controls_default as Controls, EdgeLabelRenderer_default as EdgeLabelRenderer, EdgeText_default as EdgeText, EdgeToolbar_default as EdgeToolbar, ErrorCode, Handle_default as Handle, MarkerType, MiniMap_default as MiniMap, MiniMapNode_default as MiniMapNode, NodeId as NodeIdInjection, ResizeControl_default as NodeResizeControl, NodeResizer_default as NodeResizer, NodeToolbar_default as NodeToolbar, PanOnScrollMode, Panel_default as Panel, Position, ResizeControlVariant, SelectionMode, SimpleBezierEdge, Slots, SmoothStepEdge, StepEdge, StraightEdge, VueFlow_default as VueFlow, VueFlowError, VueFlow as VueFlowInjection, VueFlowProvider_default as VueFlowProvider, 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 };
7621
+ export { Background_default as Background, BaseEdge_default as BaseEdge, BezierEdge, ConnectionLineType, ConnectionMode, ControlButton_default as ControlButton, Controls_default as Controls, EdgeLabelRenderer_default as EdgeLabelRenderer, EdgeText_default as EdgeText, EdgeToolbar_default as EdgeToolbar, ErrorCode, Handle_default as Handle, MarkerType, MiniMap_default as MiniMap, MiniMapNode_default as MiniMapNode, NodeId as NodeIdInjection, ResizeControl_default as NodeResizeControl, NodeResizer_default as NodeResizer, NodeToolbar_default as NodeToolbar, PanOnScrollMode, Panel_default as Panel, Position, ResizeControlVariant, SelectionMode, SimpleBezierEdge, Slots, SmoothStepEdge, StepEdge, StraightEdge, VueFlow_default as VueFlow, VueFlowError, VueFlow as VueFlowInjection, VueFlowProvider_default as VueFlowProvider, 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 };
7591
7622
 
7592
7623
  //# sourceMappingURL=index.mjs.map