@xyflow/vue 2.0.0-next.1 → 2.0.0-next.2
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/base.css +161 -79
- package/dist/index.d.mts +7 -8
- package/dist/index.d.ts +7 -8
- package/dist/index.js +2 -22
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -23
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +203 -133
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment, Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createPropsRestProxy, createTextVNode, createVNode, defineComponent, effectScope, getCurrentInstance, h, inject, isMemoSame, isRef, markRaw, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeMount, onBeforeUnmount, onMounted, onScopeDispose, onUnmounted, openBlock, provide, reactive, renderList, renderSlot, resolveComponent, resolveDynamicComponent, shallowRef, toDisplayString, toRaw, toRef, toRefs, toValue, unref, useAttrs, useId, useModel, useSlots, watch, watchEffect, withCtx } from "vue";
|
|
2
2
|
import { ConnectionLineType, ConnectionLineType as ConnectionLineType$1, ConnectionMode, ConnectionMode as ConnectionMode$1, PanOnScrollMode, PanOnScrollMode as PanOnScrollMode$1, Position, Position as Position$1, ResizeControlVariant, ResizeControlVariant as ResizeControlVariant$2, SelectionMode, SelectionMode as SelectionMode$1, XYDrag, XYHandle, XYMinimap, XYPanZoom, XYResizer, adoptUserNodes, areConnectionMapsEqual, areSetsEqual, calcAutoPan, clamp, clampPosition, clampPositionToParent, evaluateAbsolutePosition, fitViewport, getBezierEdgeCenter, getBezierEdgeCenter as getBezierEdgeCenter$1, getBezierPath, getBezierPath as getBezierPath$1, getBoundsOfBoxes, getBoundsOfRects, getBoundsOfRects as getBoundsOfRects$1, getConnectedEdges, getConnectedEdges as getConnectedEdges$1, getConnectionStatus, getDimensions, getEdgeId, getElementsToRemove, getElevatedEdgeZIndex, getEventPosition, getHandleBounds, getHandlePosition, getHostForElement, getIncomers, getMarkerId, getMarkerId as getMarkerId$1, getNodeDimensions, getNodeToolbarTransform, getNodesBounds, getNodesBounds as getNodesBounds$1, getNodesInside, getNodesInside as getNodesInside$1, getOutgoers, getOverlappingArea, getSmoothStepPath, getSmoothStepPath as getSmoothStepPath$1, getStraightPath, getStraightPath as getStraightPath$1, getViewportForBounds, getViewportForBounds as getViewportForBounds$1, handleConnectionChange, handleExpandParent, infiniteExtent, isCoordinateExtent, isEdgeBase, isEdgeBase as isEdgeBase$1, isEdgeVisible, isInternalNodeBase, isInternalNodeBase as isInternalNodeBase$1, isMacOs, isMacOs as isMacOs$1, isMouseEvent, isNodeBase, isNodeBase as isNodeBase$1, isRectObject, mergeAriaLabelConfig, nodeHasDimensions, nodeToRect, oppositePosition, panBy, pointToRendererPoint, pointToRendererPoint as pointToRendererPoint$1, rendererPointToPoint, rendererPointToPoint as rendererPointToPoint$1, updateAbsolutePositions } from "@xyflow/system";
|
|
3
|
-
import { onKeyStroke, until, useEventListener
|
|
3
|
+
import { onKeyStroke, until, useEventListener } from "@vueuse/core";
|
|
4
4
|
//#region src/context/index.ts
|
|
5
5
|
/** the curated instance (`useVueFlow()`) */
|
|
6
6
|
const VueFlow = Symbol("vueFlow");
|
|
@@ -4033,23 +4033,6 @@ function _sfc_render$11(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4033
4033
|
}
|
|
4034
4034
|
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"]]);
|
|
4035
4035
|
//#endregion
|
|
4036
|
-
//#region src/composables/useColorModeClass.ts
|
|
4037
|
-
/**
|
|
4038
|
-
* Resolves the `colorMode` prop to the `light`/`dark` class applied to the flow container, tracking
|
|
4039
|
-
* `prefers-color-scheme` reactively when `colorMode` is `system` (matching xyflow/react+svelte).
|
|
4040
|
-
*
|
|
4041
|
-
* Takes the state explicitly because it runs inside `<VueFlow>`'s own setup; defaults to `useStore()`.
|
|
4042
|
-
*
|
|
4043
|
-
* @internal
|
|
4044
|
-
*/
|
|
4045
|
-
function useColorModeClass(state = useStore()) {
|
|
4046
|
-
const prefersDark = useMediaQuery("(prefers-color-scheme: dark)");
|
|
4047
|
-
return computed(() => {
|
|
4048
|
-
if (state.colorMode === "system") return prefersDark.value ? "dark" : "light";
|
|
4049
|
-
return state.colorMode;
|
|
4050
|
-
});
|
|
4051
|
-
}
|
|
4052
|
-
//#endregion
|
|
4053
4036
|
//#region src/store/hooks.ts
|
|
4054
4037
|
function createHooks() {
|
|
4055
4038
|
return {
|
|
@@ -4167,7 +4150,6 @@ function useState() {
|
|
|
4167
4150
|
translateExtent: [[Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY], [Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY]],
|
|
4168
4151
|
nodeExtent: [[Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY], [Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY]],
|
|
4169
4152
|
nodeOrigin: [0, 0],
|
|
4170
|
-
colorMode: "light",
|
|
4171
4153
|
selectionMode: SelectionMode$1.Full,
|
|
4172
4154
|
paneDragging: false,
|
|
4173
4155
|
preventScrolling: true,
|
|
@@ -7108,7 +7090,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
7108
7090
|
type: Array,
|
|
7109
7091
|
required: false
|
|
7110
7092
|
},
|
|
7111
|
-
|
|
7093
|
+
forceColorMode: {
|
|
7112
7094
|
type: String,
|
|
7113
7095
|
required: false,
|
|
7114
7096
|
default: void 0
|
|
@@ -7360,7 +7342,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
7360
7342
|
useOnInitHandler(instance);
|
|
7361
7343
|
useSelectionChange(instance);
|
|
7362
7344
|
useStylesLoadedWarning(instance);
|
|
7363
|
-
const colorModeClass = useColorModeClass(state);
|
|
7364
7345
|
useViewportSync(modelViewport, state);
|
|
7365
7346
|
const stateRefs = storeToRefs(state);
|
|
7366
7347
|
provide(Slots$1, slots);
|
|
@@ -7379,7 +7360,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
7379
7360
|
instance,
|
|
7380
7361
|
state,
|
|
7381
7362
|
disposeWatchers,
|
|
7382
|
-
colorModeClass,
|
|
7383
7363
|
stateRefs,
|
|
7384
7364
|
A11yDescriptions: A11yDescriptions_default,
|
|
7385
7365
|
ZoomPane: ZoomPane_default
|
|
@@ -7394,7 +7374,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
7394
7374
|
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
7395
7375
|
return openBlock(), createElementBlock("div", {
|
|
7396
7376
|
ref: $setup.stateRefs.vueFlowRef,
|
|
7397
|
-
class: normalizeClass(["vue-flow", $setup.
|
|
7377
|
+
class: normalizeClass(["vue-flow", $setup.props.forceColorMode])
|
|
7398
7378
|
}, [
|
|
7399
7379
|
createCommentVNode(" the `zoom-pane` slot (affected by zooming & panning) renders inside the transformed Viewport via\n the provided `Slots` (see ZoomPaneSlot), not drilled through ZoomPane → Pane → Viewport "),
|
|
7400
7380
|
createVNode($setup["ZoomPane"]),
|