@m3ui-vue/m3ui-vue 1.10.2 → 1.11.0
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 +19 -4
- package/dist/API.md +195 -56
- package/dist/MButton-gWoOzFWf.js +284 -0
- package/dist/MButton-gWoOzFWf.js.map +1 -0
- package/dist/MColorPickerModal-CJYMvlgK.js +466 -0
- package/dist/MColorPickerModal-CJYMvlgK.js.map +1 -0
- package/dist/MDialog-CU8EYgCC.js +226 -0
- package/dist/MDialog-CU8EYgCC.js.map +1 -0
- package/dist/{MIcon-BSsJZhK7.js → MIcon-CkUc9kuQ.js} +10 -4
- package/dist/MIcon-CkUc9kuQ.js.map +1 -0
- package/dist/MIconButton-DTFOfsTy.js +317 -0
- package/dist/MIconButton-DTFOfsTy.js.map +1 -0
- package/dist/MListItem-Cdw2FqCT.js +1306 -0
- package/dist/MListItem-Cdw2FqCT.js.map +1 -0
- package/dist/MLoadingIndicator-BxAy2x7P.js +115 -0
- package/dist/MLoadingIndicator-BxAy2x7P.js.map +1 -0
- package/dist/{MMenuItem-US0Zbglq.js → MMenuItem-CEIKYvaX.js} +216 -214
- package/dist/MMenuItem-CEIKYvaX.js.map +1 -0
- package/dist/{MPdfViewer-DL9mRsd2.js → MPdfViewer-CEfyXGq2.js} +674 -671
- package/dist/MPdfViewer-CEfyXGq2.js.map +1 -0
- package/dist/MProgressBar-BzZMxq7M.js.map +1 -1
- package/dist/MSeekBar-B3_D-PwH.js +435 -0
- package/dist/MSeekBar-B3_D-PwH.js.map +1 -0
- package/dist/{MSegmentedButton-DMou-8sG.js → MSegmentedButton-Dg07j-4r.js} +4 -4
- package/dist/{MSegmentedButton-DMou-8sG.js.map → MSegmentedButton-Dg07j-4r.js.map} +1 -1
- package/dist/{MSignaturePad-WuvE_Cyl.js → MSignaturePad-3nddtLKI.js} +2 -2
- package/dist/{MSignaturePad-WuvE_Cyl.js.map → MSignaturePad-3nddtLKI.js.map} +1 -1
- package/dist/{MSlider-7TzhFHKS.js → MSlider-BrpLbqwt.js} +4 -4
- package/dist/{MSlider-7TzhFHKS.js.map → MSlider-BrpLbqwt.js.map} +1 -1
- package/dist/{MSpinner-CkIVBuGE.js → MSpinner-CLwzDH33.js} +2 -2
- package/dist/{MSpinner-CkIVBuGE.js.map → MSpinner-CLwzDH33.js.map} +1 -1
- package/dist/{MTextField-B6_iOczK.js → MTextField-CZRizAwA.js} +136 -134
- package/dist/MTextField-CZRizAwA.js.map +1 -0
- package/dist/{_useFieldValidation-COBJ1tWr.js → _useFieldValidation-DVcqyy9g.js} +2 -2
- package/dist/{_useFieldValidation-COBJ1tWr.js.map → _useFieldValidation-DVcqyy9g.js.map} +1 -1
- package/dist/api.json +1 -1
- package/dist/chart.js +1 -1
- package/dist/code-editor.js +3 -3
- package/dist/code-editor.js.map +1 -1
- package/dist/components/MAlert.vue.d.ts +1 -1
- package/dist/components/MAudioPlayer.vue.d.ts +3 -3
- package/dist/components/MAvatar.vue.d.ts +19 -1
- package/dist/components/MButton.vue.d.ts +2 -1
- package/dist/components/MChatBubble.vue.d.ts +2 -0
- package/dist/components/MCheckbox.vue.d.ts +2 -0
- package/dist/components/MDataTable.vue.d.ts +31 -3
- package/dist/components/MFlow.vue.d.ts +1 -1
- package/dist/components/MHotkeys.vue.d.ts +1 -0
- package/dist/components/MIcon.vue.d.ts +6 -0
- package/dist/components/MIconButton.vue.d.ts +5 -0
- package/dist/components/MKanban.vue.d.ts +1 -1
- package/dist/components/MLink.vue.d.ts +59 -0
- package/dist/components/MListItem.vue.d.ts +3 -1
- package/dist/components/MMapControl.vue.d.ts +1 -1
- package/dist/components/MNotificationCenter.vue.d.ts +1 -1
- package/dist/components/MNumberField.vue.d.ts +1 -1
- package/dist/components/MPagination.vue.d.ts +14 -1
- package/dist/components/MPdfSigner.vue.d.ts +2 -2
- package/dist/components/MRadio.vue.d.ts +2 -0
- package/dist/components/MRadioGroup.vue.d.ts +2 -0
- package/dist/components/MStatCard.vue.d.ts +2 -2
- package/dist/components/MSwitch.vue.d.ts +2 -0
- package/dist/components/MText.vue.d.ts +4 -2
- package/dist/components/MTextField.vue.d.ts +2 -0
- package/dist/components/_MDrawerItemList.vue.d.ts +6 -0
- package/dist/composables/_menuGroups.d.ts +10 -1
- package/dist/composables/_splitAttrs.d.ts +6 -0
- package/dist/composables/_springAnimation.d.ts +2 -2
- package/dist/composables/_useFocusTrap.d.ts +15 -0
- package/dist/composables/_usePaneResize.d.ts +1 -1
- package/dist/composables/_useSpring.d.ts +4 -4
- package/dist/composables/dynamicColor.d.ts +9 -1
- package/dist/composables/motion.d.ts +63 -0
- package/dist/composables/useConfirm.d.ts +28 -0
- package/dist/composables/useDevice.d.ts +8 -1
- package/dist/composables/useLocale.d.ts +14 -0
- package/dist/composables/useScrollReveal.d.ts +1 -1
- package/dist/composables/useTheme.d.ts +1 -0
- package/dist/composables/useToast.d.ts +7 -0
- package/dist/draw.js +556 -556
- package/dist/draw.js.map +1 -1
- package/dist/flow.js +854 -851
- package/dist/flow.js.map +1 -1
- package/dist/gantt.js +1118 -1096
- package/dist/gantt.js.map +1 -1
- package/dist/index.d.ts +8 -5
- package/dist/locales/index.d.ts +1 -0
- package/dist/locales/index.js +833 -1
- package/dist/locales/index.js.map +1 -1
- package/dist/locales/pl.d.ts +2 -0
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +10327 -9796
- package/dist/m3ui.js.map +1 -1
- package/dist/map.js +860 -860
- package/dist/map.js.map +1 -1
- package/dist/{material-color-utilities-CEFytLsr.js → material-color-utilities-BZsBNIhi.js} +276 -217
- package/dist/material-color-utilities-BZsBNIhi.js.map +1 -0
- package/dist/media.js +7 -7
- package/dist/{motion-BcejVTeX.js → motion-BqYcqcim.js} +15 -5
- package/dist/motion-BqYcqcim.js.map +1 -0
- package/dist/pdf-sign.js +140 -137
- package/dist/pdf-sign.js.map +1 -1
- package/dist/pdf.js +1 -1
- package/dist/plugin.d.ts +11 -0
- package/dist/rich-text-editor.js +7 -7
- package/dist/styles/theme.css +40 -0
- package/dist/styles.css +1 -1
- package/dist/terminal.js +1 -1
- package/dist/{useLocale-YRaOT12S.js → useLocale-BjcYauXr.js} +60 -4
- package/dist/useLocale-BjcYauXr.js.map +1 -0
- package/dist/{useThemeTokens-DyAdPQB0.js → useThemeTokens-D5nr5KHf.js} +28 -27
- package/dist/useThemeTokens-D5nr5KHf.js.map +1 -0
- package/package.json +17 -2
- package/src/__tests__/MAvatarImage.test.ts +37 -0
- package/src/__tests__/MDataTableControlled.test.ts +68 -0
- package/src/__tests__/MHotkeysSequence.test.ts +53 -0
- package/src/__tests__/MIconAxes.test.ts +16 -0
- package/src/__tests__/MIconButtonWidth.test.ts +22 -0
- package/src/__tests__/MLink.test.ts +46 -0
- package/src/__tests__/MPaginationPages.test.ts +43 -0
- package/src/__tests__/MTextEmphasized.test.ts +14 -0
- package/src/__tests__/controlDescription.test.ts +34 -0
- package/src/__tests__/customColor.test.ts +27 -0
- package/src/__tests__/dynamicColor.test.ts +3 -2
- package/src/__tests__/focusTrap.test.ts +124 -0
- package/src/__tests__/formatMessage.test.ts +20 -0
- package/src/__tests__/inputAttrs.test.ts +103 -0
- package/src/__tests__/localePresets.test.ts +2 -0
- package/src/__tests__/menuGroupsRemount.test.ts +40 -0
- package/src/__tests__/menuHydration.test.ts +41 -0
- package/src/__tests__/motionPrefs.test.ts +28 -0
- package/src/__tests__/ssr.test.ts +11 -0
- package/src/__tests__/ssrToast.test.ts +20 -0
- package/src/__tests__/toastDetails.test.ts +39 -0
- package/src/__tests__/useConfirm.test.ts +47 -0
- package/src/__tests__/useTheme.test.ts +14 -0
- package/src/__tests__/warningRole.test.ts +22 -0
- package/src/components/MAlert.vue +2 -2
- package/src/components/MAnimatedNumber.vue +9 -3
- package/src/components/MAutocomplete.vue +16 -4
- package/src/components/MAvailabilityCalendar.vue +3 -3
- package/src/components/MAvatar.vue +32 -5
- package/src/components/MAvatarGroup.vue +7 -2
- package/src/components/MBottomSheet.vue +18 -2
- package/src/components/MButton.vue +18 -5
- package/src/components/MCarousel.vue +3 -3
- package/src/components/MChatBubble.vue +14 -1
- package/src/components/MCheckbox.vue +21 -4
- package/src/components/MChip.vue +4 -2
- package/src/components/MCollapse.vue +7 -1
- package/src/components/MCommandPalette.vue +6 -2
- package/src/components/MContextMenu.vue +4 -4
- package/src/components/MCreditCardInput.vue +5 -0
- package/src/components/MDashboardGrid.vue +2 -1
- package/src/components/MDataTable.vue +63 -16
- package/src/components/MDialog.vue +21 -3
- package/src/components/MDiffViewer.vue +3 -3
- package/src/components/MDrawLayers.vue +3 -3
- package/src/components/MFabMenu.vue +7 -0
- package/src/components/MFloorPlan.vue +3 -3
- package/src/components/MFloorPlanInspector.vue +3 -3
- package/src/components/MFlow.vue +9 -5
- package/src/components/MFlowControls.vue +6 -0
- package/src/components/MFormBuilder.vue +1 -1
- package/src/components/MGantt.vue +10 -10
- package/src/components/MHotkeys.vue +61 -16
- package/src/components/MIcon.vue +17 -1
- package/src/components/MIconButton.vue +29 -6
- package/src/components/MImageCropper.vue +1 -1
- package/src/components/MKanban.vue +2 -1
- package/src/components/MLightbox.vue +5 -4
- package/src/components/MLink.vue +136 -0
- package/src/components/MListDetail.vue +7 -0
- package/src/components/MListItem.vue +7 -4
- package/src/components/MLoadingIndicator.vue +2 -1
- package/src/components/MMap.vue +3 -0
- package/src/components/MMapCluster.vue +2 -2
- package/src/components/MMapControl.vue +2 -2
- package/src/components/MMapMeasure.vue +1 -1
- package/src/components/MMaskField.vue +16 -3
- package/src/components/MMenu.vue +4 -4
- package/src/components/MMenuItem.vue +2 -2
- package/src/components/MMeterGroup.vue +3 -2
- package/src/components/MMortgageCalculator.vue +3 -3
- package/src/components/MMultiAutocomplete.vue +19 -7
- package/src/components/MMultiSelect.vue +19 -7
- package/src/components/MNavigationDrawer.vue +10 -3
- package/src/components/MNavigationRail.vue +5 -1
- package/src/components/MNotificationCenter.vue +2 -1
- package/src/components/MNotificationHost.vue +3 -3
- package/src/components/MNumberField.vue +23 -6
- package/src/components/MOdontogram.vue +4 -4
- package/src/components/MOrderBook.vue +4 -0
- package/src/components/MPagination.vue +91 -12
- package/src/components/MPdfSigner.vue +3 -3
- package/src/components/MPdfViewer.vue +7 -7
- package/src/components/MPhoneInput.vue +17 -4
- package/src/components/MProductConfigurator.vue +4 -4
- package/src/components/MProgressBar.vue +5 -0
- package/src/components/MQuiz.vue +8 -5
- package/src/components/MRadio.vue +24 -5
- package/src/components/MRadioGroup.vue +3 -0
- package/src/components/MReactions.vue +2 -2
- package/src/components/MResourceTimeline.vue +3 -3
- package/src/components/MResult.vue +1 -1
- package/src/components/MScrollField.vue +1 -1
- package/src/components/MSearchField.vue +6 -5
- package/src/components/MSeatMap.vue +5 -0
- package/src/components/MSeekBar.vue +3 -2
- package/src/components/MSelect.vue +16 -4
- package/src/components/MSideSheet.vue +25 -3
- package/src/components/MSimpleCarousel.vue +2 -2
- package/src/components/MSnackbar.vue +16 -13
- package/src/components/MSparkline.vue +2 -1
- package/src/components/MSpinner.vue +8 -0
- package/src/components/MSplitter.vue +1 -1
- package/src/components/MSpotlightSearch.vue +6 -2
- package/src/components/MSpreadsheet.vue +1 -1
- package/src/components/MStatCard.vue +2 -1
- package/src/components/MSwitch.vue +21 -4
- package/src/components/MTabs.vue +2 -1
- package/src/components/MTagInput.vue +19 -6
- package/src/components/MText.vue +23 -4
- package/src/components/MTextField.vue +25 -6
- package/src/components/MTimeline.vue +5 -5
- package/src/components/MToolbar.vue +2 -2
- package/src/components/MTour.vue +3 -0
- package/src/components/MTrackingTimeline.vue +6 -0
- package/src/components/MTypewriter.vue +7 -1
- package/src/components/MWindow.vue +10 -1
- package/src/components/_MColorPanel.vue +4 -4
- package/src/components/_MComment.vue +3 -2
- package/src/components/_MFlowNodeShell.vue +1 -1
- package/src/components/_MPdfPage.vue +1 -1
- package/src/components/_MTransferPane.vue +10 -0
- package/src/composables/_effectCanvas.ts +2 -1
- package/src/composables/_menuGroups.ts +10 -1
- package/src/composables/_splitAttrs.ts +29 -0
- package/src/composables/_springAnimation.ts +3 -3
- package/src/composables/_themeTransition.ts +3 -2
- package/src/composables/_useFocusTrap.ts +142 -0
- package/src/composables/_useMenuNav.ts +3 -3
- package/src/composables/_usePaneResize.ts +2 -1
- package/src/composables/_useSheetMotion.ts +3 -4
- package/src/composables/_useSpring.ts +16 -10
- package/src/composables/cron.ts +7 -6
- package/src/composables/dynamicColor.ts +21 -2
- package/src/composables/motion.ts +27 -0
- package/src/composables/useConfirm.ts +116 -0
- package/src/composables/useDevice.ts +23 -3
- package/src/composables/useFieldBg.ts +4 -0
- package/src/composables/useLocale.ts +74 -0
- package/src/composables/useNotification.ts +3 -0
- package/src/composables/useScrollReveal.ts +3 -3
- package/src/composables/useTheme.ts +8 -2
- package/src/composables/useToast.ts +27 -4
- package/src/directives/vSparkle.ts +2 -1
- package/src/index.ts +8 -5
- package/src/locales/ar.ts +7 -0
- package/src/locales/de.ts +7 -0
- package/src/locales/es.ts +7 -0
- package/src/locales/fr.ts +7 -0
- package/src/locales/index.ts +1 -0
- package/src/locales/ja.ts +7 -0
- package/src/locales/ko.ts +7 -0
- package/src/locales/pl.ts +807 -0
- package/src/locales/pt.ts +7 -0
- package/src/locales/zh.ts +7 -0
- package/src/plugin.ts +16 -0
- package/src/styles/theme.css +40 -0
- package/dist/MButton-B9RCM06i.js +0 -171
- package/dist/MButton-B9RCM06i.js.map +0 -1
- package/dist/MColorPickerModal-ChRtcZOo.js +0 -577
- package/dist/MColorPickerModal-ChRtcZOo.js.map +0 -1
- package/dist/MDialog-dk07tify.js +0 -167
- package/dist/MDialog-dk07tify.js.map +0 -1
- package/dist/MIcon-BSsJZhK7.js.map +0 -1
- package/dist/MIconButton-CrBPZidd.js +0 -288
- package/dist/MIconButton-CrBPZidd.js.map +0 -1
- package/dist/MListItem-h9H223vx.js +0 -1239
- package/dist/MListItem-h9H223vx.js.map +0 -1
- package/dist/MLoadingIndicator-YTV1Ov5w.js +0 -114
- package/dist/MLoadingIndicator-YTV1Ov5w.js.map +0 -1
- package/dist/MMenuItem-US0Zbglq.js.map +0 -1
- package/dist/MPdfViewer-DL9mRsd2.js.map +0 -1
- package/dist/MSeekBar-JFZcoJ8y.js +0 -434
- package/dist/MSeekBar-JFZcoJ8y.js.map +0 -1
- package/dist/MTextField-B6_iOczK.js.map +0 -1
- package/dist/material-color-utilities-CEFytLsr.js.map +0 -1
- package/dist/motion-BcejVTeX.js.map +0 -1
- package/dist/useLocale-YRaOT12S.js.map +0 -1
- package/dist/useThemeTokens-DyAdPQB0.js.map +0 -1
package/dist/flow.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { a as e, c as t, d as n, i as r, l as i, n as a, o, r as s, s as c, t as l, u } from "./flowPaths-BaH7yaUM.js";
|
|
2
|
-
import { r as d, t as f, u as p } from "./MIconButton-
|
|
3
|
-
import {
|
|
4
|
-
import { Fragment as
|
|
2
|
+
import { r as d, t as f, u as p } from "./MIconButton-DTFOfsTy.js";
|
|
3
|
+
import { a as m, i as h } from "./useLocale-BjcYauXr.js";
|
|
4
|
+
import { Fragment as g, Transition as _, computed as v, createBlock as y, createCommentVNode as b, createElementBlock as x, createElementVNode as S, createTextVNode as C, createVNode as w, defineComponent as T, inject as E, mergeProps as ee, nextTick as te, normalizeClass as D, normalizeStyle as O, onBeforeUnmount as ne, onMounted as re, openBlock as k, provide as ie, reactive as ae, ref as A, renderList as oe, renderSlot as se, shallowReactive as ce, shallowRef as le, toDisplayString as ue, toRaw as de, unref as j, useSlots as fe, vShow as pe, watch as me, withCtx as he, withDirectives as M, withModifiers as ge } from "vue";
|
|
5
5
|
// src/composables/useFlow.ts
|
|
6
|
-
var
|
|
7
|
-
function
|
|
8
|
-
let e =
|
|
6
|
+
var _e = Symbol("m3-flow"), ve = Symbol("m3-flow-node");
|
|
7
|
+
function ye() {
|
|
8
|
+
let e = E(_e, null);
|
|
9
9
|
if (!e) throw Error("useFlow() must be called inside <MFlow>");
|
|
10
10
|
return e;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
return
|
|
12
|
+
function be() {
|
|
13
|
+
return E(ve, null);
|
|
14
14
|
}
|
|
15
15
|
// src/composables/flowLayout.ts
|
|
16
16
|
function N(e, t, n) {
|
|
@@ -69,7 +69,7 @@ function P(e, t, n) {
|
|
|
69
69
|
}
|
|
70
70
|
return c;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function xe(e, t, n = {}) {
|
|
73
73
|
let r = N(e, t, n), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set(), o = r.ids.filter((e) => !r.inc.get(e).length);
|
|
74
74
|
!o.length && r.ids.length && o.push(r.ids[0]);
|
|
75
75
|
let s = /* @__PURE__ */ new Map(), c = [], l = (e) => {
|
|
@@ -93,7 +93,7 @@ function be(e, t, n = {}) {
|
|
|
93
93
|
for (let e of o) d(e), p(e, m), m += u.get(e) + r.gap * 2;
|
|
94
94
|
return P(r, f, s);
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function Se(e, t, n = {}) {
|
|
97
97
|
let r = N(e, t, n), i = /* @__PURE__ */ new Map(), a = new Map(r.ids.map((e) => [e, []])), o = (e) => {
|
|
98
98
|
i.set(e, 1);
|
|
99
99
|
for (let t of r.out.get(e)) i.get(t) !== 1 && (a.get(e).push(t), i.get(t) || o(t));
|
|
@@ -171,11 +171,11 @@ function xe(e, t, n = {}) {
|
|
|
171
171
|
var F = (e) => e.fn(e.scope);
|
|
172
172
|
F.props = ["fn", "scope"];
|
|
173
173
|
// src/components/MFlowHandle.vue?vue&type=script&setup=true&lang.ts
|
|
174
|
-
var
|
|
174
|
+
var Ce = [
|
|
175
175
|
"data-flow-handle",
|
|
176
176
|
"data-handle-id",
|
|
177
177
|
"data-flow-connectable"
|
|
178
|
-
], I = /* @__PURE__ */
|
|
178
|
+
], I = /* @__PURE__ */ T({
|
|
179
179
|
__name: "MFlowHandle",
|
|
180
180
|
props: {
|
|
181
181
|
type: { default: "source" },
|
|
@@ -187,21 +187,21 @@ var Se = [
|
|
|
187
187
|
}
|
|
188
188
|
},
|
|
189
189
|
setup(e) {
|
|
190
|
-
let t = e, n =
|
|
190
|
+
let t = e, n = E(_e, null), r = E(ve, null), i = A(), a = v(() => t.position ?? (t.type === "source" ? n?.direction.value === "vertical" ? "bottom" : "right" : n?.direction.value === "vertical" ? "top" : "left")), o = v(() => t.connectable && !!n?.nodesConnectable.value && r?.node.value.connectable !== !1), s = v(() => `${r?.id}:${t.id ?? ""}:${t.type}`), c = v(() => n?.connectionTarget.value?.key === s.value ? n.connectionTarget.value : null), l = {
|
|
191
191
|
auto: "top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",
|
|
192
192
|
top: "top-0 left-1/2 -translate-x-1/2 -translate-y-1/2",
|
|
193
193
|
right: "top-1/2 right-0 translate-x-1/2 -translate-y-1/2",
|
|
194
194
|
bottom: "bottom-0 left-1/2 -translate-x-1/2 translate-y-1/2",
|
|
195
195
|
left: "top-1/2 left-0 -translate-x-1/2 -translate-y-1/2"
|
|
196
196
|
}, u;
|
|
197
|
-
return
|
|
197
|
+
return re(() => {
|
|
198
198
|
n && r && (u = n.registerHandle(r.id, i.value, () => ({
|
|
199
199
|
id: t.id ?? null,
|
|
200
200
|
type: t.type,
|
|
201
201
|
position: a.value,
|
|
202
202
|
connectable: o.value
|
|
203
203
|
})));
|
|
204
|
-
}),
|
|
204
|
+
}), ne(() => u?.()), (t, n) => (k(), x("div", {
|
|
205
205
|
ref_key: "el",
|
|
206
206
|
ref: i,
|
|
207
207
|
class: D(["m3-flow-handle absolute z-10 size-2.5 rounded-full border-2 transition-[background-color,border-color,scale,opacity] duration-150 before:absolute before:-inset-2.5 before:rounded-full", [
|
|
@@ -213,25 +213,25 @@ var Se = [
|
|
|
213
213
|
"data-handle-id": e.id,
|
|
214
214
|
"data-flow-connectable": o.value,
|
|
215
215
|
"aria-hidden": "true"
|
|
216
|
-
}, null, 10,
|
|
216
|
+
}, null, 10, Ce));
|
|
217
217
|
}
|
|
218
218
|
}), L = { class: "flex items-center gap-3 p-3" }, R = {
|
|
219
219
|
class: "material-symbols-outlined text-[24px]",
|
|
220
220
|
"aria-hidden": "true"
|
|
221
|
-
},
|
|
221
|
+
}, we = { class: "min-w-0 flex-1" }, Te = {
|
|
222
222
|
key: 0,
|
|
223
223
|
class: "truncate text-title-small"
|
|
224
|
-
},
|
|
224
|
+
}, Ee = {
|
|
225
225
|
key: 1,
|
|
226
226
|
class: "truncate text-body-small text-on-surface-variant"
|
|
227
|
-
},
|
|
227
|
+
}, De = {
|
|
228
228
|
key: 0,
|
|
229
229
|
class: "shrink-0",
|
|
230
230
|
"data-flow-nodrag": ""
|
|
231
|
-
},
|
|
231
|
+
}, Oe = {
|
|
232
232
|
key: 0,
|
|
233
233
|
class: "px-3 pb-3"
|
|
234
|
-
},
|
|
234
|
+
}, ke = /* @__PURE__ */ T({
|
|
235
235
|
__name: "MFlowNode",
|
|
236
236
|
props: {
|
|
237
237
|
label: {},
|
|
@@ -244,7 +244,7 @@ var Se = [
|
|
|
244
244
|
targetPosition: {}
|
|
245
245
|
},
|
|
246
246
|
setup(e) {
|
|
247
|
-
let t = e, n =
|
|
247
|
+
let t = e, n = E(_e, null), r = E(ve, null), i = v(() => r?.selected.value ?? !1), a = v(() => r?.dragging.value ?? !1), o = v(() => {
|
|
248
248
|
let e = r?.node.value, i = e && n ? n.sidePositions(e) : {
|
|
249
249
|
source: "right",
|
|
250
250
|
target: "left"
|
|
@@ -264,71 +264,71 @@ var Se = [
|
|
|
264
264
|
error: "bg-error-container text-on-error-container",
|
|
265
265
|
neutral: "bg-surface-container-highest text-on-surface-variant"
|
|
266
266
|
};
|
|
267
|
-
return (t, n) => (k(),
|
|
267
|
+
return (t, n) => (k(), x("div", { class: D(["m3-flow-card rounded-md border text-on-surface transition-[box-shadow,border-color] duration-200", [
|
|
268
268
|
s[e.variant],
|
|
269
269
|
i.value && "border-primary! ring-1 ring-primary",
|
|
270
270
|
a.value ? "shadow-elevation-4!" : e.variant === "elevated" ? "hover:shadow-elevation-2" : "hover:shadow-elevation-1"
|
|
271
271
|
]]) }, [
|
|
272
|
-
|
|
273
|
-
|
|
272
|
+
S("div", L, [
|
|
273
|
+
se(t.$slots, "icon", {}, () => [e.icon ? (k(), x("span", {
|
|
274
274
|
key: 0,
|
|
275
275
|
class: D(["flex size-10 shrink-0 items-center justify-center rounded-sm", c[e.color]])
|
|
276
|
-
}, [
|
|
277
|
-
|
|
278
|
-
t.$slots.trailing ? (k(),
|
|
276
|
+
}, [S("span", R, ue(e.icon), 1)], 2)) : b("", !0)]),
|
|
277
|
+
S("div", we, [e.label ? (k(), x("div", Te, ue(e.label), 1)) : b("", !0), e.subtitle ? (k(), x("div", Ee, ue(e.subtitle), 1)) : b("", !0)]),
|
|
278
|
+
t.$slots.trailing ? (k(), x("div", De, [se(t.$slots, "trailing")])) : b("", !0)
|
|
279
279
|
]),
|
|
280
|
-
t.$slots.default ? (k(),
|
|
281
|
-
j(r) && (e.handles === "both" || e.handles === "target") ? (k(),
|
|
280
|
+
t.$slots.default ? (k(), x("div", Oe, [se(t.$slots, "default")])) : b("", !0),
|
|
281
|
+
j(r) && (e.handles === "both" || e.handles === "target") ? (k(), y(I, {
|
|
282
282
|
key: 1,
|
|
283
283
|
type: "target",
|
|
284
284
|
position: o.value.target
|
|
285
|
-
}, null, 8, ["position"])) :
|
|
286
|
-
j(r) && (e.handles === "both" || e.handles === "source") ? (k(),
|
|
285
|
+
}, null, 8, ["position"])) : b("", !0),
|
|
286
|
+
j(r) && (e.handles === "both" || e.handles === "source") ? (k(), y(I, {
|
|
287
287
|
key: 2,
|
|
288
288
|
type: "source",
|
|
289
289
|
position: o.value.source
|
|
290
|
-
}, null, 8, ["position"])) :
|
|
290
|
+
}, null, 8, ["position"])) : b("", !0)
|
|
291
291
|
], 2));
|
|
292
292
|
}
|
|
293
|
-
}),
|
|
293
|
+
}), Ae = [
|
|
294
294
|
"data-flow-node",
|
|
295
295
|
"data-selected",
|
|
296
296
|
"data-dragging",
|
|
297
297
|
"aria-roledescription",
|
|
298
298
|
"aria-label"
|
|
299
|
-
],
|
|
299
|
+
], je = {
|
|
300
300
|
key: 0,
|
|
301
301
|
class: "flex h-9 items-center gap-2 px-3 text-label-large text-on-surface-variant"
|
|
302
|
-
},
|
|
302
|
+
}, Me = {
|
|
303
303
|
key: 0,
|
|
304
304
|
class: "material-symbols-outlined text-[18px]"
|
|
305
|
-
},
|
|
305
|
+
}, Ne = { class: "truncate px-1" }, z = {
|
|
306
306
|
key: 0,
|
|
307
307
|
class: "absolute -top-1.5 -right-1.5 flex h-6 min-w-6 items-center justify-center rounded-full bg-tertiary px-1.5 text-label-small text-on-tertiary shadow-elevation-1"
|
|
308
|
-
},
|
|
308
|
+
}, Pe = /* @__PURE__ */ T({
|
|
309
309
|
__name: "_MFlowNodeShell",
|
|
310
310
|
props: {
|
|
311
311
|
node: {},
|
|
312
312
|
render: { type: Function }
|
|
313
313
|
},
|
|
314
314
|
setup(e) {
|
|
315
|
-
let t = e, n =
|
|
316
|
-
|
|
315
|
+
let t = e, n = E(_e), r = m(), i = A(), a = t.node.id, o = v(() => t.node), s = v(() => n.selectedNodes.value.has(a)), c = v(() => n.isLifted(a));
|
|
316
|
+
ie(ve, {
|
|
317
317
|
id: a,
|
|
318
318
|
node: o,
|
|
319
319
|
selected: s,
|
|
320
320
|
dragging: c
|
|
321
321
|
});
|
|
322
|
-
let l =
|
|
322
|
+
let l = v(() => t.node.type === "group"), u = v(() => t.node.data ?? {}), d = v(() => n.getAbsolutePosition(a)), f = v(() => l.value ? n.getSize(a) : {
|
|
323
323
|
width: t.node.width,
|
|
324
324
|
height: t.node.height
|
|
325
|
-
}), p =
|
|
325
|
+
}), p = v(() => {
|
|
326
326
|
switch (t.node.type) {
|
|
327
327
|
case "input": return "source";
|
|
328
328
|
case "output": return "target";
|
|
329
329
|
default: return "both";
|
|
330
330
|
}
|
|
331
|
-
}), h =
|
|
331
|
+
}), h = v(() => {
|
|
332
332
|
let e = t.node.data ?? {};
|
|
333
333
|
return {
|
|
334
334
|
size: e.size ?? 56,
|
|
@@ -343,16 +343,16 @@ var Se = [
|
|
|
343
343
|
error: "bg-error-container text-on-error-container",
|
|
344
344
|
neutral: "bg-surface-container-highest text-on-surface",
|
|
345
345
|
inverse: "bg-inverse-surface text-inverse-on-surface"
|
|
346
|
-
},
|
|
346
|
+
}, _ = {
|
|
347
347
|
primary: "ring-4 ring-primary/35",
|
|
348
348
|
secondary: "ring-4 ring-secondary/35",
|
|
349
349
|
tertiary: "ring-4 ring-tertiary/35",
|
|
350
350
|
error: "ring-4 ring-error/35"
|
|
351
|
-
},
|
|
352
|
-
return
|
|
351
|
+
}, T = v(() => t.node.draggable !== !1 && !n.locked.value);
|
|
352
|
+
return re(() => n.registerNodeEl(a, i.value)), ne(() => n.registerNodeEl(a, null)), (t, m) => (k(), x("div", {
|
|
353
353
|
ref_key: "el",
|
|
354
354
|
ref: i,
|
|
355
|
-
class: D(["m3-flow-node absolute top-0 left-0 rounded-md outline-none focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-secondary", [o.value.class,
|
|
355
|
+
class: D(["m3-flow-node absolute top-0 left-0 rounded-md outline-none focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-secondary", [o.value.class, T.value && (c.value ? "cursor-grabbing" : "cursor-grab")]]),
|
|
356
356
|
style: O({
|
|
357
357
|
transform: `translate(${d.value.x}px, ${d.value.y}px)`,
|
|
358
358
|
zIndex: j(n).zIndexOf(j(a)),
|
|
@@ -367,7 +367,7 @@ var Se = [
|
|
|
367
367
|
"aria-roledescription": j(r).flowNode,
|
|
368
368
|
"aria-label": u.value.label ?? j(a),
|
|
369
369
|
onKeydown: m[0] ||= (e) => j(n).onNodeKey(e, j(a))
|
|
370
|
-
}, [e.render ? (k(),
|
|
370
|
+
}, [e.render ? (k(), y(j(F), {
|
|
371
371
|
key: 0,
|
|
372
372
|
fn: e.render,
|
|
373
373
|
scope: {
|
|
@@ -376,10 +376,10 @@ var Se = [
|
|
|
376
376
|
selected: s.value,
|
|
377
377
|
dragging: c.value
|
|
378
378
|
}
|
|
379
|
-
}, null, 8, ["fn", "scope"])) : l.value ? (k(),
|
|
379
|
+
}, null, 8, ["fn", "scope"])) : l.value ? (k(), x("div", {
|
|
380
380
|
key: 1,
|
|
381
381
|
class: D(["size-full rounded-lg border bg-surface-container-low/70 transition-colors", s.value ? "border-primary" : "border-outline-variant"])
|
|
382
|
-
}, [u.value.label ? (k(),
|
|
382
|
+
}, [u.value.label ? (k(), x("div", je, [u.value.icon ? (k(), x("span", Me, ue(u.value.icon), 1)) : b("", !0), C(" " + ue(u.value.label), 1)])) : b("", !0)], 2)) : o.value.type === "circle" ? (k(), x("div", {
|
|
383
383
|
key: 2,
|
|
384
384
|
class: "relative",
|
|
385
385
|
style: O({
|
|
@@ -387,17 +387,17 @@ var Se = [
|
|
|
387
387
|
height: `${h.value.size}px`
|
|
388
388
|
})
|
|
389
389
|
}, [
|
|
390
|
-
|
|
390
|
+
S("div", { class: D(["m3-flow-circle flex size-full items-center justify-center rounded-full border-2 text-title-small", [
|
|
391
391
|
g[h.value.color],
|
|
392
392
|
s.value ? "border-primary" : "border-transparent",
|
|
393
|
-
h.value.ring &&
|
|
394
|
-
]]) }, [
|
|
395
|
-
h.value.badge !== void 0 && h.value.badge !== null && h.value.badge !== "" ? (k(),
|
|
396
|
-
|
|
393
|
+
h.value.ring && _[h.value.ring]
|
|
394
|
+
]]) }, [S("span", Ne, ue(u.value.label), 1)], 2),
|
|
395
|
+
h.value.badge !== void 0 && h.value.badge !== null && h.value.badge !== "" ? (k(), x("span", z, ue(h.value.badge), 1)) : b("", !0),
|
|
396
|
+
w(I, {
|
|
397
397
|
type: "source",
|
|
398
398
|
position: "right"
|
|
399
399
|
})
|
|
400
|
-
], 4)) : (k(),
|
|
400
|
+
], 4)) : (k(), y(ke, {
|
|
401
401
|
key: 3,
|
|
402
402
|
label: u.value.label ?? j(a),
|
|
403
403
|
subtitle: u.value.subtitle,
|
|
@@ -408,30 +408,30 @@ var Se = [
|
|
|
408
408
|
"subtitle",
|
|
409
409
|
"icon",
|
|
410
410
|
"handles"
|
|
411
|
-
]))], 46,
|
|
411
|
+
]))], 46, Ae));
|
|
412
412
|
}
|
|
413
|
-
}),
|
|
413
|
+
}), Fe = [
|
|
414
414
|
"data-flow-edge",
|
|
415
415
|
"tabindex",
|
|
416
416
|
"aria-label"
|
|
417
|
-
],
|
|
417
|
+
], Ie = ["d"], Le = ["d"], Re = ["d", "stroke-width"], ze = ["d"], Be = [
|
|
418
418
|
"data-flow-segment",
|
|
419
419
|
"x",
|
|
420
420
|
"y",
|
|
421
421
|
"width",
|
|
422
422
|
"height"
|
|
423
|
-
],
|
|
423
|
+
], Ve = [
|
|
424
424
|
"data-flow-reconnect",
|
|
425
425
|
"cx",
|
|
426
426
|
"cy"
|
|
427
|
-
],
|
|
427
|
+
], He = /* @__PURE__ */ T({
|
|
428
428
|
__name: "_MFlowEdge",
|
|
429
429
|
props: {
|
|
430
430
|
edge: {},
|
|
431
431
|
render: { type: Function }
|
|
432
432
|
},
|
|
433
433
|
setup(e) {
|
|
434
|
-
let t = e, n =
|
|
434
|
+
let t = e, n = E(_e), r = m(), i = v(() => n.edgeGeometry(t.edge)), a = v(() => n.selectedEdges.value.has(t.edge.id)), o = v(() => n.insertEdge.value === t.edge.id), s = v(() => t.edge.selectable !== !1 && !n.locked.value), c = v(() => a.value && n.isReconnectable(t.edge));
|
|
435
435
|
function u() {
|
|
436
436
|
let e = i.value;
|
|
437
437
|
if (!e) return null;
|
|
@@ -443,7 +443,7 @@ var Se = [
|
|
|
443
443
|
hh: r ? 20 : 12
|
|
444
444
|
} : null;
|
|
445
445
|
}
|
|
446
|
-
let d =
|
|
446
|
+
let d = v(() => {
|
|
447
447
|
if (!a.value || !n.isReroutable(t.edge)) return [];
|
|
448
448
|
i.value;
|
|
449
449
|
let e = n.edgeCorners(t.edge) ?? [], r = [], o = u();
|
|
@@ -484,65 +484,65 @@ var Se = [
|
|
|
484
484
|
function f(e, t, n, r, i) {
|
|
485
485
|
return !e || e === "none" ? "" : l(t - i * Math.cos(r), n - i * Math.sin(r), r, 9, e === "arrow-closed");
|
|
486
486
|
}
|
|
487
|
-
let p =
|
|
487
|
+
let p = v(() => {
|
|
488
488
|
let e = i.value;
|
|
489
489
|
return e ? f(t.edge.markerEnd ?? "arrow-closed", e.targetX, e.targetY, e.targetAngle, e.targetInset) : "";
|
|
490
|
-
}),
|
|
490
|
+
}), h = v(() => {
|
|
491
491
|
let e = i.value;
|
|
492
492
|
return e ? f(t.edge.markerStart, e.sourceX, e.sourceY, e.sourceAngle + Math.PI, e.sourceInset) : "";
|
|
493
|
-
}),
|
|
493
|
+
}), _ = v(() => {
|
|
494
494
|
let e = (e) => String(n.getNode(e)?.data?.label ?? e);
|
|
495
495
|
return r.flowEdge.replace("{source}", e(t.edge.source)).replace("{target}", e(t.edge.target));
|
|
496
|
-
}), C = /^(primary|secondary|tertiary|error|outline|outline-variant|on-surface|on-surface-variant|inverse-surface|inverse-primary)(-container)?$/, w =
|
|
496
|
+
}), C = /^(primary|secondary|tertiary|error|outline|outline-variant|on-surface|on-surface-variant|inverse-surface|inverse-primary)(-container)?$/, w = v(() => {
|
|
497
497
|
if (a.value || o.value) return "var(--color-primary)";
|
|
498
498
|
let e = t.edge.color;
|
|
499
499
|
return e ? C.test(e) ? `var(--color-${e})` : e : "var(--color-outline)";
|
|
500
|
-
}),
|
|
500
|
+
}), T = v(() => (t.edge.width ?? 2) + (o.value ? 2 : 0)), ee = v(() => ({
|
|
501
501
|
edge: t.edge,
|
|
502
502
|
selected: a.value,
|
|
503
503
|
highlighted: o.value,
|
|
504
504
|
...i.value
|
|
505
505
|
}));
|
|
506
|
-
return (t, r) => i.value ? (k(),
|
|
506
|
+
return (t, r) => i.value ? (k(), x("g", {
|
|
507
507
|
key: 0,
|
|
508
508
|
class: D(["m3-flow-edge outline-none", [e.edge.class, a.value && "m3-flow-edge-selected"]]),
|
|
509
509
|
"data-flow-edge": e.edge.id,
|
|
510
510
|
tabindex: s.value ? 0 : void 0,
|
|
511
|
-
"aria-label":
|
|
511
|
+
"aria-label": _.value,
|
|
512
512
|
role: "img",
|
|
513
513
|
onKeydown: r[0] ||= (t) => j(n).onEdgeKey(t, e.edge.id)
|
|
514
514
|
}, [
|
|
515
|
-
|
|
515
|
+
S("path", {
|
|
516
516
|
d: i.value.path,
|
|
517
517
|
fill: "none",
|
|
518
518
|
stroke: "transparent",
|
|
519
519
|
"stroke-width": "16",
|
|
520
520
|
style: { pointerEvents: "stroke" },
|
|
521
521
|
class: D(j(n).branching.value ? "cursor-crosshair" : s.value && "cursor-pointer")
|
|
522
|
-
}, null, 10,
|
|
523
|
-
o.value ? (k(),
|
|
522
|
+
}, null, 10, Ie),
|
|
523
|
+
o.value ? (k(), x("path", {
|
|
524
524
|
key: 0,
|
|
525
525
|
d: i.value.path,
|
|
526
526
|
fill: "none",
|
|
527
527
|
"stroke-width": "14",
|
|
528
528
|
"stroke-linecap": "round",
|
|
529
529
|
class: "m3-flow-edge-halo stroke-primary/25"
|
|
530
|
-
}, null, 8,
|
|
531
|
-
e.render ? (k(),
|
|
530
|
+
}, null, 8, Le)) : b("", !0),
|
|
531
|
+
e.render ? (k(), y(j(F), {
|
|
532
532
|
key: 1,
|
|
533
533
|
fn: e.render,
|
|
534
|
-
scope:
|
|
535
|
-
}, null, 8, ["fn", "scope"])) : (k(),
|
|
534
|
+
scope: ee.value
|
|
535
|
+
}, null, 8, ["fn", "scope"])) : (k(), x(g, { key: 2 }, [S("path", {
|
|
536
536
|
d: i.value.path,
|
|
537
537
|
fill: "none",
|
|
538
|
-
"stroke-width":
|
|
538
|
+
"stroke-width": T.value,
|
|
539
539
|
"stroke-linecap": "round",
|
|
540
540
|
class: D(["m3-flow-edge-line", [e.edge.animated === "reverse" ? "m3-flow-edge-animated m3-flow-edge-reverse" : e.edge.animated && "m3-flow-edge-animated", e.edge.dashed && !e.edge.animated && "m3-flow-edge-dashed"]]),
|
|
541
541
|
style: O({
|
|
542
542
|
stroke: w.value,
|
|
543
|
-
strokeWidth: `${
|
|
543
|
+
strokeWidth: `${T.value}px`
|
|
544
544
|
})
|
|
545
|
-
}, null, 14,
|
|
545
|
+
}, null, 14, Re), (k(!0), x(g, null, oe([p.value, h.value], (t, n) => M((k(), x("path", {
|
|
546
546
|
key: n,
|
|
547
547
|
d: t,
|
|
548
548
|
"stroke-width": "2",
|
|
@@ -553,8 +553,8 @@ var Se = [
|
|
|
553
553
|
stroke: w.value,
|
|
554
554
|
fill: (n === 0 ? e.edge.markerEnd ?? "arrow-closed" : e.edge.markerStart) === "arrow-closed" ? w.value : "none"
|
|
555
555
|
})
|
|
556
|
-
}, null, 12,
|
|
557
|
-
(k(!0),
|
|
556
|
+
}, null, 12, ze)), [[pe, t]])), 128))], 64)),
|
|
557
|
+
(k(!0), x(g, null, oe(d.value, (e) => (k(), x("rect", {
|
|
558
558
|
key: `s${e.i}`,
|
|
559
559
|
"data-flow-segment": e.i,
|
|
560
560
|
x: e.x - (e.horizontal ? 9 : 4),
|
|
@@ -568,8 +568,8 @@ var Se = [
|
|
|
568
568
|
pointerEvents: "all",
|
|
569
569
|
touchAction: "none"
|
|
570
570
|
}
|
|
571
|
-
}, null, 10,
|
|
572
|
-
c.value ? (k(),
|
|
571
|
+
}, null, 10, Be))), 128)),
|
|
572
|
+
c.value ? (k(), x(g, { key: 3 }, oe(["source", "target"], (e) => S("circle", {
|
|
573
573
|
key: e,
|
|
574
574
|
"data-flow-reconnect": e,
|
|
575
575
|
cx: e === "source" ? i.value.sourceX : i.value.targetX,
|
|
@@ -578,17 +578,17 @@ var Se = [
|
|
|
578
578
|
"stroke-width": "2",
|
|
579
579
|
class: "cursor-move fill-surface stroke-primary",
|
|
580
580
|
style: { pointerEvents: "all" }
|
|
581
|
-
}, null, 8,
|
|
582
|
-
], 42,
|
|
581
|
+
}, null, 8, Ve)), 64)) : b("", !0)
|
|
582
|
+
], 42, Fe)) : b("", !0);
|
|
583
583
|
}
|
|
584
|
-
}),
|
|
584
|
+
}), Ue = ["data-flow-edge"], We = { class: "flex items-center gap-1" }, Ge = ["data-flow-edge-delete", "aria-label"], Ke = /* @__PURE__ */ T({
|
|
585
585
|
__name: "_MFlowEdgeLabel",
|
|
586
586
|
props: {
|
|
587
587
|
edge: {},
|
|
588
588
|
render: { type: Function }
|
|
589
589
|
},
|
|
590
590
|
setup(e) {
|
|
591
|
-
let t = e, n =
|
|
591
|
+
let t = e, n = E(_e), r = v(() => n.edgeGeometry(t.edge)), i = v(() => n.selectedEdges.value.has(t.edge.id)), a = v(() => i.value && t.edge.deletable !== !1 && !n.locked.value), o = m();
|
|
592
592
|
function s(e) {
|
|
593
593
|
e.detail === 0 && n.remove({ edges: [t.edge.id] });
|
|
594
594
|
}
|
|
@@ -599,68 +599,68 @@ var Se = [
|
|
|
599
599
|
error: "bg-error-container text-on-error-container",
|
|
600
600
|
neutral: "bg-surface-container-high text-on-surface-variant"
|
|
601
601
|
};
|
|
602
|
-
return (t, n) => r.value ? (k(),
|
|
602
|
+
return (t, n) => r.value ? (k(), x("div", {
|
|
603
603
|
key: 0,
|
|
604
604
|
class: "m3-flow-edge-label absolute top-0 left-0 cursor-pointer",
|
|
605
605
|
style: O({ transform: `translate(${r.value.labelX}px, ${r.value.labelY}px) translate(-50%, -50%)` }),
|
|
606
606
|
"data-flow-edge": e.edge.id
|
|
607
|
-
}, [
|
|
607
|
+
}, [S("div", We, [e.render ? (k(), y(j(F), {
|
|
608
608
|
key: 0,
|
|
609
609
|
fn: e.render,
|
|
610
610
|
scope: {
|
|
611
611
|
edge: e.edge,
|
|
612
612
|
selected: i.value
|
|
613
613
|
}
|
|
614
|
-
}, null, 8, ["fn", "scope"])) : e.edge.label ? (k(),
|
|
614
|
+
}, null, 8, ["fn", "scope"])) : e.edge.label ? (k(), x("span", {
|
|
615
615
|
key: 1,
|
|
616
616
|
class: D(["block rounded-sm px-2 py-0.5 text-label-medium whitespace-nowrap transition-colors", i.value ? "bg-secondary-container text-on-secondary-container" : c[e.edge.labelTone ?? "neutral"]])
|
|
617
|
-
},
|
|
617
|
+
}, ue(e.edge.label), 3)) : b("", !0), a.value ? (k(), x("button", {
|
|
618
618
|
key: 2,
|
|
619
619
|
type: "button",
|
|
620
620
|
class: "m3-flow-edge-delete relative flex size-6 cursor-pointer items-center justify-center rounded-full bg-surface-container-highest text-on-surface-variant shadow-elevation-1 transition-colors outline-none before:absolute before:-inset-2 hover:bg-error-container hover:text-on-error-container focus-visible:ring-2 focus-visible:ring-secondary",
|
|
621
621
|
"data-flow-edge-delete": e.edge.id,
|
|
622
622
|
"aria-label": j(o).flowDeleteEdge,
|
|
623
623
|
onClick: s
|
|
624
|
-
}, [...n[0] ||= [
|
|
624
|
+
}, [...n[0] ||= [S("span", {
|
|
625
625
|
class: "material-symbols-outlined text-[16px]",
|
|
626
626
|
"aria-hidden": "true"
|
|
627
|
-
}, "close", -1)]], 8,
|
|
627
|
+
}, "close", -1)]], 8, Ge)) : b("", !0)])], 12, Ue)) : b("", !0);
|
|
628
628
|
}
|
|
629
|
-
}),
|
|
629
|
+
}), qe = ["aria-label"], Je = {
|
|
630
630
|
key: 0,
|
|
631
631
|
class: "pointer-events-none absolute inset-0 size-full",
|
|
632
632
|
"aria-hidden": "true"
|
|
633
|
-
},
|
|
633
|
+
}, Ye = [
|
|
634
634
|
"x",
|
|
635
635
|
"y",
|
|
636
636
|
"width",
|
|
637
637
|
"height"
|
|
638
|
-
],
|
|
638
|
+
], Xe = [
|
|
639
639
|
"cx",
|
|
640
640
|
"cy",
|
|
641
641
|
"r"
|
|
642
|
-
],
|
|
642
|
+
], Ze = ["d"], Qe = ["fill"], $e = {
|
|
643
643
|
class: "m3-flow-edges pointer-events-none absolute top-0 left-0 size-px overflow-visible",
|
|
644
644
|
"aria-hidden": "false"
|
|
645
|
-
},
|
|
645
|
+
}, et = ["d", "stroke-dasharray"], tt = { class: "m3-flow-edge-labels absolute top-0 left-0" }, nt = {
|
|
646
646
|
key: 0,
|
|
647
647
|
class: "pointer-events-none absolute top-0 left-0 size-px overflow-visible",
|
|
648
648
|
"aria-hidden": "true"
|
|
649
|
-
},
|
|
649
|
+
}, rt = [
|
|
650
650
|
"x1",
|
|
651
651
|
"x2",
|
|
652
652
|
"y1",
|
|
653
653
|
"y2"
|
|
654
|
-
],
|
|
654
|
+
], it = {
|
|
655
655
|
key: 2,
|
|
656
656
|
class: "pointer-events-none absolute inset-0 flex items-center justify-center"
|
|
657
|
-
},
|
|
657
|
+
}, at = { class: "pointer-events-auto" }, ot = {
|
|
658
658
|
class: "sr-only",
|
|
659
659
|
"aria-live": "polite"
|
|
660
|
-
},
|
|
660
|
+
}, st = null, ct = 0, lt = (e) => `${e}-${Math.random().toString(36).slice(2, 9)}`, ut = () => ({
|
|
661
661
|
nodes: [],
|
|
662
662
|
edges: []
|
|
663
|
-
}),
|
|
663
|
+
}), dt = /* @__PURE__ */ T({
|
|
664
664
|
inheritAttrs: !1,
|
|
665
665
|
__name: "MFlow",
|
|
666
666
|
props: {
|
|
@@ -770,84 +770,84 @@ var Se = [
|
|
|
770
770
|
label: {}
|
|
771
771
|
},
|
|
772
772
|
emits: /* @__PURE__ */ "update:nodes.update:edges.update:viewport.update:selection.update:locked.connect.connect-start.branch.connect-end.reconnect.reroute.insert.node-click.node-dblclick.node-contextmenu.node-drag-start.node-drag.node-drag-stop.edge-click.edge-dblclick.edge-contextmenu.pane-click.pane-contextmenu.pane-dblclick.delete.init".split("."),
|
|
773
|
-
setup(l, { expose: f, emit:
|
|
774
|
-
let
|
|
773
|
+
setup(l, { expose: f, emit: _ }) {
|
|
774
|
+
let C = l, w = _, T = fe(), E = m(), D = A(), pe = A(), he = (e) => !!e && e !== D.value && !pe.value?.contains(e), M = A({
|
|
775
775
|
width: 0,
|
|
776
776
|
height: 0
|
|
777
|
-
}),
|
|
778
|
-
|
|
779
|
-
},
|
|
780
|
-
|
|
781
|
-
e && !
|
|
782
|
-
}),
|
|
783
|
-
|
|
777
|
+
}), ge = A(!1), ve = A(""), ye = (e) => {
|
|
778
|
+
ve.value = "", te(() => ve.value = e);
|
|
779
|
+
}, be = (e) => C.getId?.(e) ?? lt(e === "node" ? "n" : "e"), N = le(C.nodes), P = le(C.edges), F = le(C.selection ?? ut()), Ce = A(C.locked);
|
|
780
|
+
me(() => C.selection, (e) => {
|
|
781
|
+
e && !pt(e, F.value) && (F.value = e);
|
|
782
|
+
}), me(() => C.locked, (e) => {
|
|
783
|
+
Ce.value = e;
|
|
784
784
|
});
|
|
785
|
-
let I =
|
|
786
|
-
get: () =>
|
|
785
|
+
let I = v({
|
|
786
|
+
get: () => Ce.value,
|
|
787
787
|
set: (e) => {
|
|
788
|
-
|
|
788
|
+
Ce.value = e, w("update:locked", e);
|
|
789
789
|
}
|
|
790
|
-
}), L =
|
|
790
|
+
}), L = v(() => new Map(N.value.map((e) => [e.id, e]))), R = v(() => new Map(P.value.map((e) => [e.id, e]))), we = (e) => L.value.get(e), Te = (e) => {
|
|
791
791
|
let t = L.value.get(e)?.parentId;
|
|
792
792
|
return t && L.value.has(t) ? t : void 0;
|
|
793
793
|
};
|
|
794
|
-
function
|
|
794
|
+
function Ee(e) {
|
|
795
795
|
let t = [];
|
|
796
|
-
for (let n =
|
|
796
|
+
for (let n = Te(e); n && t.length < 50; n = Te(n)) t.push(n);
|
|
797
797
|
return t;
|
|
798
798
|
}
|
|
799
|
-
let
|
|
800
|
-
function
|
|
799
|
+
let De = (e) => Ee(e).length;
|
|
800
|
+
function Oe(e) {
|
|
801
801
|
let t = L.value.get(e);
|
|
802
|
-
return !t || !!t.hidden ||
|
|
802
|
+
return !t || !!t.hidden || Ee(e).some((e) => L.value.get(e)?.hidden);
|
|
803
803
|
}
|
|
804
|
-
let
|
|
804
|
+
let ke = v(() => {
|
|
805
805
|
let e = /* @__PURE__ */ new Map();
|
|
806
806
|
for (let t of N.value) t.parentId && L.value.has(t.parentId) && (e.get(t.parentId) ?? e.set(t.parentId, []).get(t.parentId)).push(t.id);
|
|
807
807
|
return e;
|
|
808
808
|
});
|
|
809
|
-
function
|
|
810
|
-
let t = [], n = (e) => (
|
|
809
|
+
function Ae(e) {
|
|
810
|
+
let t = [], n = (e) => (ke.value.get(e) ?? []).forEach((e) => {
|
|
811
811
|
t.push(e), n(e);
|
|
812
812
|
});
|
|
813
813
|
return n(e), t;
|
|
814
814
|
}
|
|
815
|
-
let
|
|
815
|
+
let je = v(() => new Set(F.value.nodes)), Me = v(() => new Set(F.value.edges)), Ne = v(() => !!C.edgeBranching && Re.value && !I.value);
|
|
816
816
|
function z(e) {
|
|
817
817
|
let t = {
|
|
818
818
|
nodes: e.nodes ?? F.value.nodes,
|
|
819
819
|
edges: e.edges ?? F.value.edges
|
|
820
820
|
};
|
|
821
|
-
|
|
821
|
+
Fe(t.nodes, F.value.nodes) && Fe(t.edges, F.value.edges) || (F.value = t, w("update:selection", t));
|
|
822
822
|
}
|
|
823
|
-
let
|
|
823
|
+
let Fe = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), Ie = v(() => C.elementsSelectable && !I.value), Le = v(() => C.nodesDraggable && !I.value), Re = v(() => C.nodesConnectable && !I.value), ze = le([]), Be = le([]), Ve = null, Ue = () => ({
|
|
824
824
|
nodes: N.value,
|
|
825
825
|
edges: P.value
|
|
826
826
|
});
|
|
827
|
-
function
|
|
828
|
-
if (!
|
|
827
|
+
function We(e, t) {
|
|
828
|
+
if (!C.history) return;
|
|
829
829
|
let n = performance.now();
|
|
830
|
-
t &&
|
|
830
|
+
t && Ve?.key === t && n - Ve.at < 800 ? (Ve.at = n, Be.value = []) : (Ve = t ? {
|
|
831
831
|
key: t,
|
|
832
832
|
at: n
|
|
833
|
-
} : null,
|
|
833
|
+
} : null, ze.value = [...ze.value, e].slice(-C.historySize), Be.value = []);
|
|
834
834
|
}
|
|
835
|
-
let
|
|
836
|
-
function
|
|
837
|
-
|
|
838
|
-
|
|
835
|
+
let Ge = null, dt = !1;
|
|
836
|
+
function ft() {
|
|
837
|
+
dt || Ge || (Ge = Ue(), queueMicrotask(() => {
|
|
838
|
+
Ge && We(Ge), Ge = null;
|
|
839
839
|
}));
|
|
840
840
|
}
|
|
841
|
-
let
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
}),
|
|
845
|
-
|
|
841
|
+
let pt = (e, t) => de(e) === de(t);
|
|
842
|
+
me(() => C.nodes, (e) => {
|
|
843
|
+
pt(e, N.value) || (ft(), N.value = e);
|
|
844
|
+
}), me(() => C.edges, (e) => {
|
|
845
|
+
pt(e, P.value) || (ft(), P.value = e);
|
|
846
846
|
});
|
|
847
847
|
function B(e, t = {}) {
|
|
848
|
-
t.history !== !1 && Ue(
|
|
848
|
+
t.history !== !1 && We(Ue(), t.coalesce), dt || (dt = !0, te(() => dt = !1)), e.nodes && !pt(e.nodes, N.value) && (N.value = e.nodes, w("update:nodes", e.nodes)), e.edges && !pt(e.edges, P.value) && (P.value = e.edges, w("update:edges", e.edges));
|
|
849
849
|
}
|
|
850
|
-
function
|
|
850
|
+
function mt(e) {
|
|
851
851
|
B(e, { history: !1 });
|
|
852
852
|
let t = new Set(e.nodes.map((e) => e.id)), n = new Set(e.edges.map((e) => e.id));
|
|
853
853
|
z({
|
|
@@ -855,22 +855,22 @@ var Se = [
|
|
|
855
855
|
edges: F.value.edges.filter((e) => n.has(e))
|
|
856
856
|
});
|
|
857
857
|
}
|
|
858
|
-
function mt() {
|
|
859
|
-
let e = Re.value[Re.value.length - 1];
|
|
860
|
-
e && (ze.value = [...ze.value, He()], Re.value = Re.value.slice(0, -1), Be = null, pt(e));
|
|
861
|
-
}
|
|
862
858
|
function ht() {
|
|
863
859
|
let e = ze.value[ze.value.length - 1];
|
|
864
|
-
e && (
|
|
860
|
+
e && (Be.value = [...Be.value, Ue()], ze.value = ze.value.slice(0, -1), Ve = null, mt(e));
|
|
865
861
|
}
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
862
|
+
function gt() {
|
|
863
|
+
let e = Be.value[Be.value.length - 1];
|
|
864
|
+
e && (ze.value = [...ze.value, Ue()], Be.value = Be.value.slice(0, -1), Ve = null, mt(e));
|
|
865
|
+
}
|
|
866
|
+
let _t = v(() => ze.value.length > 0), vt = v(() => Be.value.length > 0), V = ce(/* @__PURE__ */ new Map()), H = /* @__PURE__ */ new Map(), yt = le(/* @__PURE__ */ new Set()), bt = !1, xt = /* @__PURE__ */ new Set();
|
|
867
|
+
function St() {
|
|
868
|
+
let e = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Set(), n = C.animate && ge.value && !bt && !p();
|
|
869
869
|
for (let r of N.value) {
|
|
870
|
-
e.add(r.id),
|
|
871
|
-
let i =
|
|
870
|
+
e.add(r.id), Oe(r.id) && t.add(r.id);
|
|
871
|
+
let i = xt.has(r.id) && !t.has(r.id), a = V.get(r.id), { x: o, y: s } = r.position;
|
|
872
872
|
if (!a) {
|
|
873
|
-
V.set(r.id,
|
|
873
|
+
V.set(r.id, ae({
|
|
874
874
|
x: o,
|
|
875
875
|
y: s
|
|
876
876
|
})), H.set(r.id, {
|
|
@@ -884,45 +884,45 @@ var Se = [
|
|
|
884
884
|
continue;
|
|
885
885
|
}
|
|
886
886
|
let c = H.get(r.id);
|
|
887
|
-
(c.tx !== o || c.ty !== s || i) && (c.tx = o, c.ty = s, !n || i ||
|
|
887
|
+
(c.tx !== o || c.ty !== s || i) && (c.tx = o, c.ty = s, !n || i || yt.value.has(r.id) ? (c.x = o, c.y = s, c.vx = c.vy = 0, a.x = o, a.y = s) : Dt());
|
|
888
888
|
}
|
|
889
889
|
for (let t of [...V.keys()]) e.has(t) || (V.delete(t), H.delete(t));
|
|
890
|
-
|
|
890
|
+
xt = t, bt = !1;
|
|
891
891
|
}
|
|
892
|
-
|
|
893
|
-
let
|
|
894
|
-
function
|
|
895
|
-
U || typeof requestAnimationFrame > "u" || (
|
|
892
|
+
me(N, St, { immediate: !0 });
|
|
893
|
+
let Ct = d.stiffness, wt = 2 * d.dampingRatio * Math.sqrt(Ct), Tt = .004, U = 0, Et = 0;
|
|
894
|
+
function Dt() {
|
|
895
|
+
U || typeof requestAnimationFrame > "u" || (Et = performance.now(), U = requestAnimationFrame(Ot));
|
|
896
896
|
}
|
|
897
|
-
function
|
|
897
|
+
function Ot(e) {
|
|
898
898
|
U = 0;
|
|
899
|
-
let t = Math.min((e -
|
|
900
|
-
|
|
899
|
+
let t = Math.min((e - Et) / 1e3, 1 / 20);
|
|
900
|
+
Et = e;
|
|
901
901
|
let n = !1;
|
|
902
902
|
for (let [e, r] of H) {
|
|
903
903
|
if (r.x === r.tx && r.y === r.ty && !r.vx && !r.vy) continue;
|
|
904
|
-
for (let e = 0; e < t; e +=
|
|
905
|
-
let n = Math.min(
|
|
906
|
-
r.vx += (-
|
|
904
|
+
for (let e = 0; e < t; e += Tt) {
|
|
905
|
+
let n = Math.min(Tt, t - e);
|
|
906
|
+
r.vx += (-Ct * (r.x - r.tx) - wt * r.vx) * n, r.vy += (-Ct * (r.y - r.ty) - wt * r.vy) * n, r.x += r.vx * n, r.y += r.vy * n;
|
|
907
907
|
}
|
|
908
908
|
Math.abs(r.x - r.tx) < .1 && Math.abs(r.y - r.ty) < .1 && Math.abs(r.vx) < 2 && Math.abs(r.vy) < 2 ? (r.x = r.tx, r.y = r.ty, r.vx = r.vy = 0) : n = !0;
|
|
909
909
|
let i = V.get(e);
|
|
910
910
|
i && (i.x = r.x, i.y = r.y);
|
|
911
911
|
}
|
|
912
|
-
|
|
912
|
+
yn(t) && (n = !0), Vr(t) && (n = !0), n && (U = requestAnimationFrame(Ot));
|
|
913
913
|
}
|
|
914
914
|
function W(e) {
|
|
915
915
|
let t = 0, n = 0, r = e;
|
|
916
916
|
for (let e = 0; r && e < 50; e++) {
|
|
917
917
|
let e = V.get(r), i = L.value.get(r);
|
|
918
|
-
t += e?.x ?? i?.position.x ?? 0, n += e?.y ?? i?.position.y ?? 0, r =
|
|
918
|
+
t += e?.x ?? i?.position.x ?? 0, n += e?.y ?? i?.position.y ?? 0, r = Te(r);
|
|
919
919
|
}
|
|
920
920
|
return {
|
|
921
921
|
x: t,
|
|
922
922
|
y: n
|
|
923
923
|
};
|
|
924
924
|
}
|
|
925
|
-
let
|
|
925
|
+
let kt = ce(/* @__PURE__ */ new Map()), At = ce(/* @__PURE__ */ new Map()), jt = /* @__PURE__ */ new Map(), Mt = /* @__PURE__ */ new Map(), G = ce(/* @__PURE__ */ new Map());
|
|
926
926
|
function K(e) {
|
|
927
927
|
let t = L.value.get(e);
|
|
928
928
|
if (!t) return {
|
|
@@ -937,8 +937,8 @@ var Se = [
|
|
|
937
937
|
let n = G.get(e);
|
|
938
938
|
if (n) return n;
|
|
939
939
|
let r = 200, i = 120;
|
|
940
|
-
for (let t of
|
|
941
|
-
if (
|
|
940
|
+
for (let t of ke.value.get(e) ?? []) {
|
|
941
|
+
if (Oe(t)) continue;
|
|
942
942
|
let e = V.get(t), n = K(t);
|
|
943
943
|
r = Math.max(r, (e?.x ?? 0) + n.width + 24), i = Math.max(i, (e?.y ?? 0) + n.height + 24);
|
|
944
944
|
}
|
|
@@ -947,23 +947,23 @@ var Se = [
|
|
|
947
947
|
height: t.height ?? Math.max(i, 60)
|
|
948
948
|
};
|
|
949
949
|
}
|
|
950
|
-
let n =
|
|
950
|
+
let n = kt.get(e);
|
|
951
951
|
return {
|
|
952
952
|
width: t.width ?? n?.width ?? 0,
|
|
953
953
|
height: t.height ?? n?.height ?? 0
|
|
954
954
|
};
|
|
955
955
|
}
|
|
956
|
-
function
|
|
957
|
-
let t =
|
|
956
|
+
function Nt(e) {
|
|
957
|
+
let t = jt.get(e);
|
|
958
958
|
if (!t) return;
|
|
959
|
-
let n = t.offsetWidth, r = t.offsetHeight, i =
|
|
960
|
-
i && i.width === n && i.height === r ||
|
|
959
|
+
let n = t.offsetWidth, r = t.offsetHeight, i = kt.get(e);
|
|
960
|
+
i && i.width === n && i.height === r || kt.set(e, {
|
|
961
961
|
width: n,
|
|
962
962
|
height: r
|
|
963
963
|
});
|
|
964
|
-
let a =
|
|
964
|
+
let a = Mt.get(e);
|
|
965
965
|
if (!a?.size) {
|
|
966
|
-
|
|
966
|
+
At.has(e) && At.delete(e);
|
|
967
967
|
return;
|
|
968
968
|
}
|
|
969
969
|
let o = t.getBoundingClientRect(), s = J.value.zoom || 1, c = [];
|
|
@@ -975,39 +975,39 @@ var Se = [
|
|
|
975
975
|
y: (t.top + t.height / 2 - o.top) / s
|
|
976
976
|
});
|
|
977
977
|
}
|
|
978
|
-
|
|
978
|
+
At.set(e, c);
|
|
979
979
|
}
|
|
980
|
-
let
|
|
981
|
-
function
|
|
982
|
-
|
|
983
|
-
let e =
|
|
984
|
-
|
|
980
|
+
let Pt = /* @__PURE__ */ new Set();
|
|
981
|
+
function Ft(e) {
|
|
982
|
+
Pt.add(e), Pt.size > 1 || te(() => {
|
|
983
|
+
let e = Pt;
|
|
984
|
+
Pt = /* @__PURE__ */ new Set(), e.forEach(Nt);
|
|
985
985
|
});
|
|
986
986
|
}
|
|
987
|
-
function
|
|
987
|
+
function It(e, t, n) {
|
|
988
988
|
let r = {
|
|
989
989
|
el: t,
|
|
990
990
|
info: n
|
|
991
991
|
};
|
|
992
|
-
return (
|
|
993
|
-
|
|
992
|
+
return (Mt.get(e) ?? Mt.set(e, /* @__PURE__ */ new Set()).get(e)).add(r), Ft(e), () => {
|
|
993
|
+
Mt.get(e)?.delete(r), Ft(e);
|
|
994
994
|
};
|
|
995
995
|
}
|
|
996
|
-
function
|
|
997
|
-
if (t)
|
|
996
|
+
function Lt(e, t) {
|
|
997
|
+
if (t) jt.set(e, t), Nt(e), ui?.observe(t);
|
|
998
998
|
else {
|
|
999
|
-
let t =
|
|
1000
|
-
t &&
|
|
999
|
+
let t = jt.get(e);
|
|
1000
|
+
t && ui?.unobserve(t), jt.delete(e), kt.delete(e), At.delete(e);
|
|
1001
1001
|
}
|
|
1002
1002
|
}
|
|
1003
|
-
let
|
|
1004
|
-
let t =
|
|
1003
|
+
let Rt = (e) => {
|
|
1004
|
+
let t = C.direction === "vertical";
|
|
1005
1005
|
return {
|
|
1006
1006
|
source: e.sourcePosition ?? (t ? "bottom" : "right"),
|
|
1007
1007
|
target: e.targetPosition ?? (t ? "top" : "left")
|
|
1008
1008
|
};
|
|
1009
1009
|
};
|
|
1010
|
-
function
|
|
1010
|
+
function zt(e, t) {
|
|
1011
1011
|
let n = W(e), r = K(e);
|
|
1012
1012
|
switch (t) {
|
|
1013
1013
|
case "top": return {
|
|
@@ -1028,40 +1028,40 @@ var Se = [
|
|
|
1028
1028
|
};
|
|
1029
1029
|
}
|
|
1030
1030
|
}
|
|
1031
|
-
function
|
|
1031
|
+
function Bt(e, t) {
|
|
1032
1032
|
let n = t.x - e.x, r = t.y - e.y;
|
|
1033
1033
|
return Math.abs(n) >= Math.abs(r) ? n >= 0 ? "right" : "left" : r >= 0 ? "bottom" : "top";
|
|
1034
1034
|
}
|
|
1035
|
-
let
|
|
1036
|
-
function
|
|
1037
|
-
let i =
|
|
1035
|
+
let Vt = (e, t, n, r) => e === "auto" ? n ? Bt(t, n) : r === "source" ? "right" : "left" : e;
|
|
1036
|
+
function Ht(e, t, n, r = null) {
|
|
1037
|
+
let i = Ut(e, t, n);
|
|
1038
1038
|
return i && {
|
|
1039
1039
|
...i,
|
|
1040
|
-
position:
|
|
1040
|
+
position: Vt(i.position, i, r, t)
|
|
1041
1041
|
};
|
|
1042
1042
|
}
|
|
1043
|
-
function
|
|
1043
|
+
function Ut(e, t, n) {
|
|
1044
1044
|
let r = L.value.get(e);
|
|
1045
1045
|
if (!r) return null;
|
|
1046
|
-
let i =
|
|
1046
|
+
let i = At.get(e)?.filter((e) => e.type === t), a = i?.length ? (n == null ? i[0] : i.find((e) => e.id === n)) ?? i[0] : void 0;
|
|
1047
1047
|
if (a) {
|
|
1048
1048
|
let t = W(e);
|
|
1049
1049
|
return {
|
|
1050
1050
|
x: t.x + a.x,
|
|
1051
1051
|
y: t.y + a.y,
|
|
1052
1052
|
position: a.position,
|
|
1053
|
-
inset:
|
|
1053
|
+
inset: Wt
|
|
1054
1054
|
};
|
|
1055
1055
|
}
|
|
1056
|
-
let o =
|
|
1056
|
+
let o = Rt(r)[t];
|
|
1057
1057
|
return {
|
|
1058
|
-
...
|
|
1058
|
+
...zt(e, o),
|
|
1059
1059
|
position: o,
|
|
1060
1060
|
inset: 0
|
|
1061
1061
|
};
|
|
1062
1062
|
}
|
|
1063
|
-
let
|
|
1064
|
-
function
|
|
1063
|
+
let Wt = 5;
|
|
1064
|
+
function Gt(e, n) {
|
|
1065
1065
|
switch (e) {
|
|
1066
1066
|
case "smoothstep": return o(n);
|
|
1067
1067
|
case "step": return c(n);
|
|
@@ -1069,8 +1069,8 @@ var Se = [
|
|
|
1069
1069
|
default: return r(n);
|
|
1070
1070
|
}
|
|
1071
1071
|
}
|
|
1072
|
-
let
|
|
1073
|
-
function
|
|
1072
|
+
let Kt = (e) => e.type ?? C.defaultEdgeOptions?.type ?? "bezier", q = (e) => e.pathType ?? C.defaultEdgeOptions?.pathType ?? Kt(e), qt = v(() => new Set(P.value.map((e) => `${e.source}>${e.target}`)));
|
|
1073
|
+
function Jt(e) {
|
|
1074
1074
|
let t = W(e), n = K(e);
|
|
1075
1075
|
return {
|
|
1076
1076
|
x: t.x + n.width / 2,
|
|
@@ -1078,10 +1078,10 @@ var Se = [
|
|
|
1078
1078
|
r: Math.min(n.width, n.height) / 2
|
|
1079
1079
|
};
|
|
1080
1080
|
}
|
|
1081
|
-
function
|
|
1082
|
-
let t = L.value.get(e.source)?.type === "circle", n = L.value.get(e.target)?.type === "circle", r = t ?
|
|
1081
|
+
function Yt(e) {
|
|
1082
|
+
let t = L.value.get(e.source)?.type === "circle", n = L.value.get(e.target)?.type === "circle", r = t ? Jt(e.source) : Ht(e.source, "source", e.sourceHandle), i = n ? Jt(e.target) : Ht(e.target, "target", e.targetHandle);
|
|
1083
1083
|
if (!r || !i) return null;
|
|
1084
|
-
let a = i.x - r.x, o = i.y - r.y, s = Math.hypot(a, o) || 1, c = a / s, l = o / s, u =
|
|
1084
|
+
let a = i.x - r.x, o = i.y - r.y, s = Math.hypot(a, o) || 1, c = a / s, l = o / s, u = qt.value.has(`${e.target}>${e.source}`) ? 6 : 0, d = -l * u, f = c * u, p = t ? r.r : 0, m = n ? i.r + 2 : 0, h = Math.abs(a) >= Math.abs(o), g = {
|
|
1085
1085
|
sourceX: r.x + c * p + d,
|
|
1086
1086
|
sourceY: r.y + l * p + f,
|
|
1087
1087
|
sourcePosition: h ? a >= 0 ? "right" : "left" : o >= 0 ? "bottom" : "top",
|
|
@@ -1091,35 +1091,35 @@ var Se = [
|
|
|
1091
1091
|
};
|
|
1092
1092
|
return {
|
|
1093
1093
|
...g,
|
|
1094
|
-
...
|
|
1094
|
+
...Gt(e.type ?? C.defaultEdgeOptions?.type ?? "straight", g),
|
|
1095
1095
|
sourceInset: 0,
|
|
1096
1096
|
targetInset: 0
|
|
1097
1097
|
};
|
|
1098
1098
|
}
|
|
1099
|
-
let
|
|
1100
|
-
function
|
|
1101
|
-
if (
|
|
1099
|
+
let Xt = (e) => L.value.get(e.source)?.type === "circle" || L.value.get(e.target)?.type === "circle", Zt = (e) => !Xt(e) && (q(e) === "smoothstep" || q(e) === "step");
|
|
1100
|
+
function Qt(e) {
|
|
1101
|
+
if (ir.value?.id === e.id) return ir.value.route;
|
|
1102
1102
|
if (e.route) {
|
|
1103
|
-
if (
|
|
1103
|
+
if (dn(e.source) && dn(e.target)) {
|
|
1104
1104
|
let t = V.get(e.source), n = L.value.get(e.source);
|
|
1105
|
-
if (t && n && (t.x !== n.position.x || t.y !== n.position.y)) return
|
|
1105
|
+
if (t && n && (t.x !== n.position.x || t.y !== n.position.y)) return $t(e, t.x - n.position.x, t.y - n.position.y);
|
|
1106
1106
|
}
|
|
1107
1107
|
return e.route;
|
|
1108
1108
|
}
|
|
1109
1109
|
}
|
|
1110
|
-
function
|
|
1111
|
-
let r =
|
|
1110
|
+
function $t(e, t, n) {
|
|
1111
|
+
let r = en(e)?.s, i = !r || r.position === "left" || r.position === "right";
|
|
1112
1112
|
return e.route.map((e, r) => e + (r % 2 == 0 === i ? t : n));
|
|
1113
1113
|
}
|
|
1114
|
-
function
|
|
1115
|
-
let t =
|
|
1114
|
+
function en(e) {
|
|
1115
|
+
let t = Ut(e.source, "source", e.sourceHandle), n = Ut(e.target, "target", e.targetHandle);
|
|
1116
1116
|
if (!t || !n) return null;
|
|
1117
1117
|
let r = {
|
|
1118
1118
|
...t,
|
|
1119
|
-
position: t.position === "auto" && e.sourcePosition ? e.sourcePosition :
|
|
1119
|
+
position: t.position === "auto" && e.sourcePosition ? e.sourcePosition : Vt(t.position, t, n, "source")
|
|
1120
1120
|
}, i = {
|
|
1121
1121
|
...n,
|
|
1122
|
-
position: n.position === "auto" && e.targetPosition ? e.targetPosition :
|
|
1122
|
+
position: n.position === "auto" && e.targetPosition ? e.targetPosition : Vt(n.position, n, t, "target")
|
|
1123
1123
|
};
|
|
1124
1124
|
return {
|
|
1125
1125
|
s: r,
|
|
@@ -1134,17 +1134,17 @@ var Se = [
|
|
|
1134
1134
|
}
|
|
1135
1135
|
};
|
|
1136
1136
|
}
|
|
1137
|
-
function
|
|
1138
|
-
if (
|
|
1139
|
-
let n =
|
|
1137
|
+
function tn(t) {
|
|
1138
|
+
if (Xt(t)) return Yt(t);
|
|
1139
|
+
let n = en(t);
|
|
1140
1140
|
if (!n) return null;
|
|
1141
|
-
let { s: r, t: i, ends: a } = n, o =
|
|
1141
|
+
let { s: r, t: i, ends: a } = n, o = Zt(t) ? Qt(t) : void 0, s = o ? e({
|
|
1142
1142
|
...a,
|
|
1143
1143
|
route: o,
|
|
1144
1144
|
borderRadius: q(t) === "step" ? 0 : 8
|
|
1145
|
-
}) :
|
|
1145
|
+
}) : Gt(q(t), {
|
|
1146
1146
|
...a,
|
|
1147
|
-
...
|
|
1147
|
+
...an.value.get(t.id)
|
|
1148
1148
|
});
|
|
1149
1149
|
return {
|
|
1150
1150
|
...a,
|
|
@@ -1153,20 +1153,20 @@ var Se = [
|
|
|
1153
1153
|
targetInset: i.inset
|
|
1154
1154
|
};
|
|
1155
1155
|
}
|
|
1156
|
-
function
|
|
1157
|
-
if (!
|
|
1158
|
-
let t =
|
|
1156
|
+
function nn(e) {
|
|
1157
|
+
if (!Zt(e)) return null;
|
|
1158
|
+
let t = en(e);
|
|
1159
1159
|
if (!t) return null;
|
|
1160
|
-
let r =
|
|
1160
|
+
let r = Qt(e);
|
|
1161
1161
|
return r ? u({
|
|
1162
1162
|
...t.ends,
|
|
1163
1163
|
route: r
|
|
1164
1164
|
}) : n({
|
|
1165
1165
|
...t.ends,
|
|
1166
|
-
...
|
|
1166
|
+
...an.value.get(e.id)
|
|
1167
1167
|
});
|
|
1168
1168
|
}
|
|
1169
|
-
function
|
|
1169
|
+
function rn(e) {
|
|
1170
1170
|
let t = {
|
|
1171
1171
|
left: -1,
|
|
1172
1172
|
right: 1,
|
|
@@ -1184,15 +1184,15 @@ var Se = [
|
|
|
1184
1184
|
max: Math.max(s, c)
|
|
1185
1185
|
};
|
|
1186
1186
|
}
|
|
1187
|
-
let
|
|
1188
|
-
let e = /* @__PURE__ */ new Map(), t =
|
|
1187
|
+
let an = v(() => {
|
|
1188
|
+
let e = /* @__PURE__ */ new Map(), t = C.edgeSpacing;
|
|
1189
1189
|
if (!t) return e;
|
|
1190
1190
|
let r = [], i = [];
|
|
1191
|
-
for (let e of
|
|
1192
|
-
if (!
|
|
1193
|
-
let t =
|
|
1191
|
+
for (let e of un.value) {
|
|
1192
|
+
if (!Zt(e)) continue;
|
|
1193
|
+
let t = en(e);
|
|
1194
1194
|
if (!t) continue;
|
|
1195
|
-
let a = `${e.source}\u0000${e.sourceHandle ?? ""}`, o =
|
|
1195
|
+
let a = `${e.source}\u0000${e.sourceHandle ?? ""}`, o = Qt(e), s = o ? null : rn(t.ends), c = o ? u({
|
|
1196
1196
|
...t.ends,
|
|
1197
1197
|
route: o
|
|
1198
1198
|
}) : n(t.ends);
|
|
@@ -1231,28 +1231,28 @@ var Se = [
|
|
|
1231
1231
|
});
|
|
1232
1232
|
}
|
|
1233
1233
|
return e;
|
|
1234
|
-
}),
|
|
1234
|
+
}), on = (e) => !I.value && Zt(e) && (e.reroutable ?? C.edgesReroutable), sn = v(() => N.value.filter((e) => !Oe(e.id))), cn = v(() => sn.value.filter((e) => e.type === "group").sort((e, t) => De(e.id) - De(t.id))), ln = v(() => sn.value.filter((e) => e.type !== "group")), un = v(() => P.value.filter((e) => !e.hidden && !Oe(e.source) && !Oe(e.target))), dn = (e) => yt.value.has(e) || Ee(e).some((e) => yt.value.has(e)), fn = (e) => (dn(e) ? 1e3 : 0) + De(e) * 10 + (je.value.has(e) ? 3 : 0), pn = (e) => T[`node-${e.type ?? "default"}`], mn = (e) => T[`edge-${Kt(e)}`], hn = (e) => !I.value && (e.reconnectable ?? C.edgesReconnectable), J = A({
|
|
1235
1235
|
x: 0,
|
|
1236
1236
|
y: 0,
|
|
1237
1237
|
zoom: 1,
|
|
1238
|
-
...
|
|
1238
|
+
...C.viewport
|
|
1239
1239
|
});
|
|
1240
|
-
|
|
1240
|
+
me(() => C.viewport, (e) => {
|
|
1241
1241
|
!e || e.x === J.value.x && e.y === J.value.y && e.zoom === J.value.zoom || (Y = null, J.value = { ...e });
|
|
1242
1242
|
});
|
|
1243
|
-
let
|
|
1244
|
-
function
|
|
1245
|
-
(e.x !== J.value.x || e.y !== J.value.y || e.zoom !== J.value.zoom) && (J.value = e,
|
|
1243
|
+
let gn = (e) => Math.min(C.maxZoom, Math.max(C.minZoom, e));
|
|
1244
|
+
function _n(e) {
|
|
1245
|
+
(e.x !== J.value.x || e.y !== J.value.y || e.zoom !== J.value.zoom) && (J.value = e, w("update:viewport", e));
|
|
1246
1246
|
}
|
|
1247
1247
|
let Y = null;
|
|
1248
|
-
function
|
|
1248
|
+
function vn(e, t = {}) {
|
|
1249
1249
|
let n = {
|
|
1250
1250
|
x: e.x ?? J.value.x,
|
|
1251
1251
|
y: e.y ?? J.value.y,
|
|
1252
|
-
zoom:
|
|
1252
|
+
zoom: gn(e.zoom ?? J.value.zoom)
|
|
1253
1253
|
};
|
|
1254
|
-
if (t.animate === !1 || !
|
|
1255
|
-
Y = null,
|
|
1254
|
+
if (t.animate === !1 || !ge.value || p() || typeof requestAnimationFrame > "u") {
|
|
1255
|
+
Y = null, _n(n);
|
|
1256
1256
|
return;
|
|
1257
1257
|
}
|
|
1258
1258
|
let r = Y;
|
|
@@ -1272,9 +1272,9 @@ var Se = [
|
|
|
1272
1272
|
v: r?.z.v ?? 0,
|
|
1273
1273
|
t: n.zoom
|
|
1274
1274
|
}
|
|
1275
|
-
},
|
|
1275
|
+
}, Dt();
|
|
1276
1276
|
}
|
|
1277
|
-
function
|
|
1277
|
+
function yn(e) {
|
|
1278
1278
|
let t = Y;
|
|
1279
1279
|
if (!t) return !1;
|
|
1280
1280
|
let n = !0;
|
|
@@ -1283,20 +1283,20 @@ var Se = [
|
|
|
1283
1283
|
t.y,
|
|
1284
1284
|
t.z
|
|
1285
1285
|
]) {
|
|
1286
|
-
for (let t = 0; t < e; t +=
|
|
1287
|
-
let n = Math.min(
|
|
1288
|
-
r.v += (-
|
|
1286
|
+
for (let t = 0; t < e; t += Tt) {
|
|
1287
|
+
let n = Math.min(Tt, e - t);
|
|
1288
|
+
r.v += (-Ct * (r.p - r.t) - wt * r.v) * n, r.p += r.v * n;
|
|
1289
1289
|
}
|
|
1290
1290
|
let i = r === t.z ? 5e-4 : .1;
|
|
1291
1291
|
Math.abs(r.p - r.t) < i && Math.abs(r.v) < i * 10 ? (r.p = r.t, r.v = 0) : n = !1;
|
|
1292
1292
|
}
|
|
1293
|
-
return
|
|
1293
|
+
return _n({
|
|
1294
1294
|
x: t.x.p,
|
|
1295
1295
|
y: t.y.p,
|
|
1296
1296
|
zoom: t.z.p
|
|
1297
1297
|
}), n && (Y = null), !n;
|
|
1298
1298
|
}
|
|
1299
|
-
function
|
|
1299
|
+
function bn() {
|
|
1300
1300
|
return D.value?.getBoundingClientRect() ?? {
|
|
1301
1301
|
left: 0,
|
|
1302
1302
|
top: 0,
|
|
@@ -1304,45 +1304,45 @@ var Se = [
|
|
|
1304
1304
|
height: M.value.height
|
|
1305
1305
|
};
|
|
1306
1306
|
}
|
|
1307
|
-
function
|
|
1308
|
-
let t =
|
|
1307
|
+
function xn(e) {
|
|
1308
|
+
let t = bn();
|
|
1309
1309
|
return {
|
|
1310
1310
|
x: (e.x - t.left - J.value.x) / J.value.zoom,
|
|
1311
1311
|
y: (e.y - t.top - J.value.y) / J.value.zoom
|
|
1312
1312
|
};
|
|
1313
1313
|
}
|
|
1314
|
-
function
|
|
1315
|
-
let t =
|
|
1314
|
+
function Sn(e) {
|
|
1315
|
+
let t = bn();
|
|
1316
1316
|
return {
|
|
1317
1317
|
x: e.x * J.value.zoom + J.value.x + t.left,
|
|
1318
1318
|
y: e.y * J.value.zoom + J.value.y + t.top
|
|
1319
1319
|
};
|
|
1320
1320
|
}
|
|
1321
|
-
function
|
|
1322
|
-
let i =
|
|
1321
|
+
function Cn(e, t, n, r = !1) {
|
|
1322
|
+
let i = gn(e), a = Y && r ? {
|
|
1323
1323
|
x: Y.x.t,
|
|
1324
1324
|
y: Y.y.t,
|
|
1325
1325
|
zoom: Y.z.t
|
|
1326
1326
|
} : J.value, o = (t - a.x) / a.zoom, s = (n - a.y) / a.zoom;
|
|
1327
|
-
|
|
1327
|
+
vn({
|
|
1328
1328
|
x: t - o * i,
|
|
1329
1329
|
y: n - s * i,
|
|
1330
1330
|
zoom: i
|
|
1331
1331
|
}, { animate: r });
|
|
1332
1332
|
}
|
|
1333
|
-
let
|
|
1334
|
-
function
|
|
1335
|
-
let r =
|
|
1336
|
-
|
|
1333
|
+
let wn = () => Y?.z.t ?? J.value.zoom, Tn = () => Cn(wn() * 1.25, M.value.width / 2, M.value.height / 2, !0), En = () => Cn(wn() / 1.25, M.value.width / 2, M.value.height / 2, !0), Dn = (e, t = {}) => Cn(e, M.value.width / 2, M.value.height / 2, t.animate ?? !0);
|
|
1334
|
+
function On(e, t, n = {}) {
|
|
1335
|
+
let r = gn(n.zoom ?? wn());
|
|
1336
|
+
vn({
|
|
1337
1337
|
x: M.value.width / 2 - e * r,
|
|
1338
1338
|
y: M.value.height / 2 - t * r,
|
|
1339
1339
|
zoom: r
|
|
1340
1340
|
}, { animate: n.animate ?? !0 });
|
|
1341
1341
|
}
|
|
1342
|
-
function
|
|
1342
|
+
function kn(e) {
|
|
1343
1343
|
let t = Infinity, n = Infinity, r = -Infinity, i = -Infinity;
|
|
1344
1344
|
for (let a of e) {
|
|
1345
|
-
if (
|
|
1345
|
+
if (Oe(a)) continue;
|
|
1346
1346
|
let e = W(a), o = K(a);
|
|
1347
1347
|
t = Math.min(t, e.x), n = Math.min(n, e.y), r = Math.max(r, e.x + o.width), i = Math.max(i, e.y + o.height);
|
|
1348
1348
|
}
|
|
@@ -1353,7 +1353,7 @@ var Se = [
|
|
|
1353
1353
|
height: i - n
|
|
1354
1354
|
} : null;
|
|
1355
1355
|
}
|
|
1356
|
-
function
|
|
1356
|
+
function An(e = {}) {
|
|
1357
1357
|
let t = e.nodes ?? N.value.map((e) => e.id), n = /* @__PURE__ */ new Map();
|
|
1358
1358
|
for (let [e, t] of H) {
|
|
1359
1359
|
let r = V.get(e);
|
|
@@ -1362,65 +1362,65 @@ var Se = [
|
|
|
1362
1362
|
y: r.y
|
|
1363
1363
|
}), r.x = t.tx, r.y = t.ty);
|
|
1364
1364
|
}
|
|
1365
|
-
let r =
|
|
1365
|
+
let r = kn(t);
|
|
1366
1366
|
for (let [e, t] of n) {
|
|
1367
1367
|
let n = V.get(e);
|
|
1368
1368
|
n.x = t.x, n.y = t.y;
|
|
1369
1369
|
}
|
|
1370
1370
|
if (!r || !M.value.width || !M.value.height) return;
|
|
1371
|
-
let i = e.padding ?? .1, a = M.value.width * (1 - 2 * i), o = M.value.height * (1 - 2 * i), s = Math.min(e.maxZoom ?? 1.5, Math.max(e.minZoom ??
|
|
1372
|
-
|
|
1373
|
-
zoom:
|
|
1371
|
+
let i = e.padding ?? .1, a = M.value.width * (1 - 2 * i), o = M.value.height * (1 - 2 * i), s = Math.min(e.maxZoom ?? 1.5, Math.max(e.minZoom ?? C.minZoom, Math.min(a / Math.max(1, r.width), o / Math.max(1, r.height))));
|
|
1372
|
+
On(r.x + r.width / 2, r.y + r.height / 2, {
|
|
1373
|
+
zoom: gn(s),
|
|
1374
1374
|
animate: e.animate ?? !0
|
|
1375
1375
|
});
|
|
1376
1376
|
}
|
|
1377
|
-
let
|
|
1378
|
-
function jn(e) {
|
|
1379
|
-
B({ nodes: [...N.value, ...An(e)] });
|
|
1380
|
-
}
|
|
1377
|
+
let jn = (e) => Array.isArray(e) ? e : [e];
|
|
1381
1378
|
function Mn(e) {
|
|
1382
|
-
B({
|
|
1379
|
+
B({ nodes: [...N.value, ...jn(e)] });
|
|
1383
1380
|
}
|
|
1384
1381
|
function Nn(e) {
|
|
1382
|
+
B({ edges: [...P.value, ...jn(e)] });
|
|
1383
|
+
}
|
|
1384
|
+
function Pn(e) {
|
|
1385
1385
|
B({
|
|
1386
1386
|
nodes: e.nodes,
|
|
1387
1387
|
edges: e.edges
|
|
1388
1388
|
});
|
|
1389
1389
|
}
|
|
1390
|
-
function
|
|
1390
|
+
function Fn(e, t) {
|
|
1391
1391
|
B({ nodes: N.value.map((n) => n.id === e ? typeof t == "function" ? t(n) : {
|
|
1392
1392
|
...n,
|
|
1393
1393
|
...t
|
|
1394
1394
|
} : n) });
|
|
1395
1395
|
}
|
|
1396
|
-
function
|
|
1396
|
+
function In(e, t) {
|
|
1397
1397
|
B({ edges: P.value.map((n) => n.id === e ? typeof t == "function" ? t(n) : {
|
|
1398
1398
|
...n,
|
|
1399
1399
|
...t
|
|
1400
1400
|
} : n) });
|
|
1401
1401
|
}
|
|
1402
|
-
function
|
|
1402
|
+
function Ln(e) {
|
|
1403
1403
|
let t = /* @__PURE__ */ new Set();
|
|
1404
|
-
for (let n of e.nodes ?? []) L.value.has(n) && (t.add(n),
|
|
1404
|
+
for (let n of e.nodes ?? []) L.value.has(n) && (t.add(n), Ae(n).forEach((e) => t.add(e)));
|
|
1405
1405
|
let n = new Set(e.edges ?? []), r = N.value.filter((e) => t.has(e.id)), i = P.value.filter((e) => n.has(e.id) || t.has(e.source) || t.has(e.target));
|
|
1406
1406
|
if (r.length || i.length) {
|
|
1407
|
-
if (
|
|
1408
|
-
let e =
|
|
1407
|
+
if (C.beforeDelete) {
|
|
1408
|
+
let e = C.beforeDelete({
|
|
1409
1409
|
nodes: r,
|
|
1410
1410
|
edges: i
|
|
1411
1411
|
});
|
|
1412
1412
|
if (e instanceof Promise) {
|
|
1413
1413
|
e.then((e) => {
|
|
1414
|
-
e &&
|
|
1414
|
+
e && Rn(t, new Set(i.map((e) => e.id)));
|
|
1415
1415
|
});
|
|
1416
1416
|
return;
|
|
1417
1417
|
}
|
|
1418
1418
|
if (!e) return;
|
|
1419
1419
|
}
|
|
1420
|
-
|
|
1420
|
+
Rn(t, new Set(i.map((e) => e.id)));
|
|
1421
1421
|
}
|
|
1422
1422
|
}
|
|
1423
|
-
function
|
|
1423
|
+
function Rn(e, t) {
|
|
1424
1424
|
let n = N.value.filter((t) => e.has(t.id)), r = P.value.filter((n) => t.has(n.id) || e.has(n.source) || e.has(n.target));
|
|
1425
1425
|
if (!n.length && !r.length) return;
|
|
1426
1426
|
let i = new Set(r);
|
|
@@ -1430,26 +1430,26 @@ var Se = [
|
|
|
1430
1430
|
}), z({
|
|
1431
1431
|
nodes: F.value.nodes.filter((t) => !e.has(t)),
|
|
1432
1432
|
edges: F.value.edges.filter((e) => !i.has(R.value.get(e)))
|
|
1433
|
-
}),
|
|
1433
|
+
}), w("delete", {
|
|
1434
1434
|
nodes: n,
|
|
1435
1435
|
edges: r
|
|
1436
|
-
}),
|
|
1436
|
+
}), ye(h(E.flowDeleted, { count: String(n.length + r.length) }, E.lang));
|
|
1437
1437
|
}
|
|
1438
|
-
function
|
|
1439
|
-
I.value ||
|
|
1438
|
+
function zn() {
|
|
1439
|
+
I.value || Ln({
|
|
1440
1440
|
nodes: F.value.nodes.filter((e) => L.value.get(e)?.deletable !== !1),
|
|
1441
1441
|
edges: F.value.edges.filter((e) => R.value.get(e)?.deletable !== !1)
|
|
1442
1442
|
});
|
|
1443
1443
|
}
|
|
1444
|
-
function
|
|
1445
|
-
|
|
1446
|
-
nodes:
|
|
1447
|
-
edges:
|
|
1444
|
+
function Bn() {
|
|
1445
|
+
Ie.value && z({
|
|
1446
|
+
nodes: sn.value.filter((e) => e.selectable !== !1).map((e) => e.id),
|
|
1447
|
+
edges: un.value.filter((e) => e.selectable !== !1).map((e) => e.id)
|
|
1448
1448
|
});
|
|
1449
1449
|
}
|
|
1450
|
-
function
|
|
1450
|
+
function Vn() {
|
|
1451
1451
|
let e = new Set(F.value.nodes);
|
|
1452
|
-
for (let t of [...e])
|
|
1452
|
+
for (let t of [...e]) Ae(t).forEach((t) => e.add(t));
|
|
1453
1453
|
return e.size ? {
|
|
1454
1454
|
nodes: N.value.filter((t) => e.has(t.id)).map((t) => {
|
|
1455
1455
|
if (t.parentId && !e.has(t.parentId)) {
|
|
@@ -1464,22 +1464,22 @@ var Se = [
|
|
|
1464
1464
|
edges: P.value.filter((t) => e.has(t.source) && e.has(t.target))
|
|
1465
1465
|
} : null;
|
|
1466
1466
|
}
|
|
1467
|
-
function Vn() {
|
|
1468
|
-
let e = Bn();
|
|
1469
|
-
e && (ot = e, st = 0);
|
|
1470
|
-
}
|
|
1471
1467
|
function Hn() {
|
|
1472
|
-
|
|
1468
|
+
let e = Vn();
|
|
1469
|
+
e && (st = e, ct = 0);
|
|
1473
1470
|
}
|
|
1474
|
-
function Un(
|
|
1475
|
-
|
|
1471
|
+
function Un() {
|
|
1472
|
+
I.value || (Hn(), zn());
|
|
1476
1473
|
}
|
|
1477
|
-
function Wn() {
|
|
1478
|
-
|
|
1479
|
-
e && !I.value && Gn(e, void 0, S.gridSize * 2);
|
|
1474
|
+
function Wn(e) {
|
|
1475
|
+
st?.nodes.length && !I.value && (ct++, Kn(st, e, C.gridSize * 2 * ct));
|
|
1480
1476
|
}
|
|
1481
|
-
function Gn(
|
|
1482
|
-
let
|
|
1477
|
+
function Gn() {
|
|
1478
|
+
let e = Vn();
|
|
1479
|
+
e && !I.value && Kn(e, void 0, C.gridSize * 2);
|
|
1480
|
+
}
|
|
1481
|
+
function Kn(e, t, n) {
|
|
1482
|
+
let r = e.nodes.filter((t) => !t.parentId || !e.nodes.some((e) => e.id === t.parentId)), i = Math.min(...r.map((e) => e.position.x)), a = Math.min(...r.map((e) => e.position.y)), o = C.gridSize, s = (e) => C.snapToGrid && o ? Math.round(e / o) * o : e, c = s(t ? t.x - i : n), l = s(t ? t.y - a : n), u = new Map(e.nodes.map((e) => [e.id, be("node")])), d = new Set(r.map((e) => e.id)), f = e.nodes.map((e) => ({
|
|
1483
1483
|
...e,
|
|
1484
1484
|
id: u.get(e.id),
|
|
1485
1485
|
parentId: e.parentId ? u.get(e.parentId) ?? e.parentId : void 0,
|
|
@@ -1489,11 +1489,11 @@ var Se = [
|
|
|
1489
1489
|
} : e.position
|
|
1490
1490
|
})), p = e.edges.map((e) => ({
|
|
1491
1491
|
...e,
|
|
1492
|
-
id:
|
|
1492
|
+
id: be("edge"),
|
|
1493
1493
|
source: u.get(e.source),
|
|
1494
1494
|
target: u.get(e.target)
|
|
1495
1495
|
}));
|
|
1496
|
-
|
|
1496
|
+
bt = !0, B({
|
|
1497
1497
|
nodes: [...N.value, ...f],
|
|
1498
1498
|
edges: p.length ? [...P.value, ...p] : void 0
|
|
1499
1499
|
}), z({
|
|
@@ -1501,15 +1501,15 @@ var Se = [
|
|
|
1501
1501
|
edges: p.map((e) => e.id)
|
|
1502
1502
|
});
|
|
1503
1503
|
}
|
|
1504
|
-
let
|
|
1505
|
-
async function
|
|
1506
|
-
let r = e ??
|
|
1507
|
-
...
|
|
1504
|
+
let qn = () => C.layoutOptions?.direction ?? (C.direction === "vertical" ? "TB" : "LR");
|
|
1505
|
+
async function Jn(e, t, n = {}) {
|
|
1506
|
+
let r = e ?? C.layout ?? "tree", i = r === "tree" ? xe : r === "layered" ? Se : r, a = new Map(N.value.filter((e) => !e.parentId).map((e) => [e.id, K(e.id)])), o = {
|
|
1507
|
+
...C.layoutOptions,
|
|
1508
1508
|
...t
|
|
1509
1509
|
}, s = await i(N.value, P.value, {
|
|
1510
1510
|
...o,
|
|
1511
1511
|
sizes: a,
|
|
1512
|
-
direction: o.direction ??
|
|
1512
|
+
direction: o.direction ?? qn()
|
|
1513
1513
|
}), c = !1, l = N.value.map((e) => {
|
|
1514
1514
|
let t = s[e.id];
|
|
1515
1515
|
return !t || Math.abs(t.x - e.position.x) < .5 && Math.abs(t.y - e.position.y) < .5 ? e : (c = !0, {
|
|
@@ -1522,66 +1522,66 @@ var Se = [
|
|
|
1522
1522
|
});
|
|
1523
1523
|
c && B({ nodes: l }, { history: n.history });
|
|
1524
1524
|
}
|
|
1525
|
-
let
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
() =>
|
|
1529
|
-
() => JSON.stringify(
|
|
1525
|
+
let Yn = v(() => sn.value.map((e) => e.id).join(",") + "|" + un.value.map((e) => `${e.source}>${e.target}`).join(","));
|
|
1526
|
+
me([
|
|
1527
|
+
Yn,
|
|
1528
|
+
() => C.direction,
|
|
1529
|
+
() => JSON.stringify(C.layoutOptions ?? {})
|
|
1530
1530
|
], () => {
|
|
1531
|
-
|
|
1532
|
-
await
|
|
1531
|
+
C.layout && ge.value && te(async () => {
|
|
1532
|
+
await Jn(null, void 0, { history: !1 }), C.fitView && An();
|
|
1533
1533
|
});
|
|
1534
1534
|
});
|
|
1535
|
-
let
|
|
1535
|
+
let Xn = "input, textarea, select, button, a, label, [contenteditable], [data-flow-nodrag]", X = null, Zn = null, Z = /* @__PURE__ */ new Map(), Qn = null, Q = {
|
|
1536
1536
|
x: 0,
|
|
1537
1537
|
y: 0,
|
|
1538
1538
|
inside: !1
|
|
1539
|
-
},
|
|
1540
|
-
function ir() {
|
|
1541
|
-
window.addEventListener("pointermove", hr), window.addEventListener("pointerup", _r), window.addEventListener("pointercancel", vr);
|
|
1542
|
-
}
|
|
1539
|
+
}, $n = A(null), $ = le(null), er = A(null), tr = v(() => !!$.value), nr = le([]), rr = A(!1), ir = le(null);
|
|
1543
1540
|
function ar() {
|
|
1544
|
-
window.
|
|
1541
|
+
window.addEventListener("pointermove", gr), window.addEventListener("pointerup", vr), window.addEventListener("pointercancel", yr);
|
|
1545
1542
|
}
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
e.cancelable && e.preventDefault();
|
|
1543
|
+
function or() {
|
|
1544
|
+
window.removeEventListener("pointermove", gr), window.removeEventListener("pointerup", vr), window.removeEventListener("pointercancel", yr), ur();
|
|
1549
1545
|
}
|
|
1546
|
+
let sr = [];
|
|
1550
1547
|
function cr(e) {
|
|
1551
|
-
|
|
1552
|
-
|
|
1548
|
+
e.cancelable && e.preventDefault();
|
|
1549
|
+
}
|
|
1550
|
+
function lr(e) {
|
|
1551
|
+
ur(), sr = e && e !== window ? [e, window] : [window];
|
|
1552
|
+
for (let e of sr) e.addEventListener("touchmove", cr, { passive: !1 });
|
|
1553
1553
|
}
|
|
1554
|
-
function
|
|
1555
|
-
for (let e of
|
|
1556
|
-
|
|
1554
|
+
function ur() {
|
|
1555
|
+
for (let e of sr) e.removeEventListener("touchmove", cr);
|
|
1556
|
+
sr = [];
|
|
1557
1557
|
}
|
|
1558
|
-
function
|
|
1558
|
+
function dr(e) {
|
|
1559
1559
|
let t = e.target;
|
|
1560
|
-
if (
|
|
1560
|
+
if (he(t)) return;
|
|
1561
1561
|
if (e.pointerType === "touch") {
|
|
1562
1562
|
if (X || Z.clear(), Z.set(e.pointerId, {
|
|
1563
1563
|
x: e.clientX,
|
|
1564
1564
|
y: e.clientY
|
|
1565
1565
|
}), Z.size === 2) {
|
|
1566
|
-
|
|
1566
|
+
br(), Cr();
|
|
1567
1567
|
return;
|
|
1568
1568
|
}
|
|
1569
1569
|
if (Z.size > 2) return;
|
|
1570
1570
|
}
|
|
1571
1571
|
if (X || e.button === 2) return;
|
|
1572
|
-
|
|
1573
|
-
let n = t.closest(
|
|
1572
|
+
Zn = t;
|
|
1573
|
+
let n = t.closest(Xn), r = n?.closest("[data-flow-node]");
|
|
1574
1574
|
n && r && n !== r || D.value?.focus({ preventScroll: !0 });
|
|
1575
1575
|
let i = t.closest("[data-flow-handle]"), a = t.closest("[data-flow-reconnect]"), o = t.closest("[data-flow-node]"), s = t.closest("[data-flow-edge]");
|
|
1576
|
-
if (e.button === 1) return
|
|
1576
|
+
if (e.button === 1) return pr(e);
|
|
1577
1577
|
let c = t.closest("[data-flow-edge-delete]");
|
|
1578
1578
|
if (c) {
|
|
1579
|
-
e.preventDefault(),
|
|
1579
|
+
e.preventDefault(), Ln({ edges: [c.dataset.flowEdgeDelete] });
|
|
1580
1580
|
return;
|
|
1581
1581
|
}
|
|
1582
1582
|
let l = t.closest("[data-flow-segment]");
|
|
1583
1583
|
if (l && s) {
|
|
1584
|
-
let t = R.value.get(s.dataset.flowEdge), n = t &&
|
|
1584
|
+
let t = R.value.get(s.dataset.flowEdge), n = t && on(t) ? nn(t) : null;
|
|
1585
1585
|
if (t && n) {
|
|
1586
1586
|
e.preventDefault(), X = {
|
|
1587
1587
|
kind: "reroute",
|
|
@@ -1592,19 +1592,19 @@ var Se = [
|
|
|
1592
1592
|
sx: e.clientX,
|
|
1593
1593
|
sy: e.clientY,
|
|
1594
1594
|
moved: !1
|
|
1595
|
-
},
|
|
1595
|
+
}, ar(), e.pointerType === "touch" && lr(null);
|
|
1596
1596
|
return;
|
|
1597
1597
|
}
|
|
1598
1598
|
}
|
|
1599
1599
|
if (a && s) {
|
|
1600
1600
|
let t = R.value.get(s.dataset.flowEdge);
|
|
1601
|
-
if (t &&
|
|
1601
|
+
if (t && hn(t)) return e.preventDefault(), Jr(e, t, a.dataset.flowReconnect);
|
|
1602
1602
|
}
|
|
1603
|
-
if (i && o && i.dataset.flowConnectable === "true" &&
|
|
1603
|
+
if (i && o && i.dataset.flowConnectable === "true" && Re.value) {
|
|
1604
1604
|
if (e.preventDefault(), e.stopPropagation(), i.dataset.flowHandle === "target") {
|
|
1605
|
-
let t = o.dataset.flowNode, n = i.dataset.handleId || null, r =
|
|
1605
|
+
let t = o.dataset.flowNode, n = i.dataset.handleId || null, r = un.value.filter((e) => e.target === t && (e.targetHandle ?? null) === n && hn(e)), a = r[r.length - 1];
|
|
1606
1606
|
if (a) {
|
|
1607
|
-
|
|
1607
|
+
Jr(e, a, "target");
|
|
1608
1608
|
let n = X;
|
|
1609
1609
|
n?.kind === "connect" && (n.tap = {
|
|
1610
1610
|
x: e.clientX,
|
|
@@ -1615,11 +1615,11 @@ var Se = [
|
|
|
1615
1615
|
return;
|
|
1616
1616
|
}
|
|
1617
1617
|
}
|
|
1618
|
-
return
|
|
1618
|
+
return Hr(e, o.dataset.flowNode, i.dataset.handleId || null, i.dataset.flowHandle);
|
|
1619
1619
|
}
|
|
1620
|
-
if (o) return t.closest(
|
|
1620
|
+
if (o) return t.closest(Xn) && t.closest(Xn) !== o ? void 0 : hr(e, o.dataset.flowNode);
|
|
1621
1621
|
if (s) {
|
|
1622
|
-
let t = e.pointerType === "touch", n = R.value.get(s.dataset.flowEdge), r = n &&
|
|
1622
|
+
let t = e.pointerType === "touch", n = R.value.get(s.dataset.flowEdge), r = n && Ne.value && (!t || Me.value.has(n.id)) ? n : void 0;
|
|
1623
1623
|
r && e.preventDefault(), X = {
|
|
1624
1624
|
kind: "pan",
|
|
1625
1625
|
id: e.pointerId,
|
|
@@ -1631,14 +1631,14 @@ var Se = [
|
|
|
1631
1631
|
target: "pane",
|
|
1632
1632
|
touch: t,
|
|
1633
1633
|
branch: r
|
|
1634
|
-
},
|
|
1634
|
+
}, ar();
|
|
1635
1635
|
} else {
|
|
1636
|
-
if ((e.shiftKey ||
|
|
1637
|
-
|
|
1636
|
+
if ((e.shiftKey || C.selectionOnDrag && e.pointerType !== "touch" || !C.panOnDrag) && Ie.value) return mr(e);
|
|
1637
|
+
pr(e);
|
|
1638
1638
|
}
|
|
1639
1639
|
}
|
|
1640
|
-
let
|
|
1641
|
-
function
|
|
1640
|
+
let fr;
|
|
1641
|
+
function pr(e) {
|
|
1642
1642
|
let t = e.pointerType === "touch", n = {
|
|
1643
1643
|
kind: "pan",
|
|
1644
1644
|
id: e.pointerId,
|
|
@@ -1650,9 +1650,9 @@ var Se = [
|
|
|
1650
1650
|
target: "pane",
|
|
1651
1651
|
touch: t
|
|
1652
1652
|
};
|
|
1653
|
-
X = n, Y = null,
|
|
1653
|
+
X = n, Y = null, ar(), clearTimeout(fr), t && Ie.value && (fr = setTimeout(() => {
|
|
1654
1654
|
if (X !== n || n.moved) return;
|
|
1655
|
-
let e =
|
|
1655
|
+
let e = bn(), t = n.sx - e.left, r = n.sy - e.top;
|
|
1656
1656
|
X = {
|
|
1657
1657
|
kind: "marquee",
|
|
1658
1658
|
id: n.id,
|
|
@@ -1662,7 +1662,7 @@ var Se = [
|
|
|
1662
1662
|
y: r,
|
|
1663
1663
|
additive: [...F.value.nodes],
|
|
1664
1664
|
moved: !0
|
|
1665
|
-
},
|
|
1665
|
+
}, $n.value = {
|
|
1666
1666
|
x: t,
|
|
1667
1667
|
y: r,
|
|
1668
1668
|
width: 0,
|
|
@@ -1670,8 +1670,8 @@ var Se = [
|
|
|
1670
1670
|
}, navigator.vibrate?.(10);
|
|
1671
1671
|
}, 450));
|
|
1672
1672
|
}
|
|
1673
|
-
function
|
|
1674
|
-
let t =
|
|
1673
|
+
function mr(e) {
|
|
1674
|
+
let t = bn();
|
|
1675
1675
|
X = {
|
|
1676
1676
|
kind: "marquee",
|
|
1677
1677
|
id: e.pointerId,
|
|
@@ -1681,17 +1681,17 @@ var Se = [
|
|
|
1681
1681
|
y: e.clientY - t.top,
|
|
1682
1682
|
additive: e.shiftKey ? [...F.value.nodes] : [],
|
|
1683
1683
|
moved: !1
|
|
1684
|
-
},
|
|
1684
|
+
}, ar();
|
|
1685
1685
|
}
|
|
1686
|
-
function
|
|
1686
|
+
function hr(e, t) {
|
|
1687
1687
|
let n = L.value.get(t);
|
|
1688
1688
|
if (!n) return;
|
|
1689
1689
|
let r = !1, i;
|
|
1690
|
-
if (
|
|
1690
|
+
if (Ie.value && n.selectable !== !1) {
|
|
1691
1691
|
if (e.shiftKey || e.metaKey || e.ctrlKey) {
|
|
1692
|
-
let e =
|
|
1692
|
+
let e = je.value.has(t);
|
|
1693
1693
|
if (z({ nodes: e ? F.value.nodes.filter((e) => e !== t) : [...F.value.nodes, t] }), e) return;
|
|
1694
|
-
} else
|
|
1694
|
+
} else je.value.has(t) ? r = !0 : i = () => z({
|
|
1695
1695
|
nodes: [t],
|
|
1696
1696
|
edges: []
|
|
1697
1697
|
});
|
|
@@ -1709,32 +1709,32 @@ var Se = [
|
|
|
1709
1709
|
moved: !1,
|
|
1710
1710
|
reselect: r,
|
|
1711
1711
|
select: a ? i : void 0
|
|
1712
|
-
},
|
|
1712
|
+
}, ar();
|
|
1713
1713
|
}
|
|
1714
|
-
function
|
|
1714
|
+
function gr(e) {
|
|
1715
1715
|
if (Q.x = e.clientX, Q.y = e.clientY, e.pointerType === "touch" && Z.has(e.pointerId) && (Z.set(e.pointerId, {
|
|
1716
1716
|
x: e.clientX,
|
|
1717
1717
|
y: e.clientY
|
|
1718
|
-
}),
|
|
1718
|
+
}), Qn)) return Tr();
|
|
1719
1719
|
let t = X;
|
|
1720
1720
|
if (t && t.kind !== "pinch" && t.id === e.pointerId) {
|
|
1721
1721
|
if (t.kind === "pan") {
|
|
1722
1722
|
let n = e.clientX - t.sx, r = e.clientY - t.sy;
|
|
1723
1723
|
if (!t.moved && Math.hypot(n, r) < (t.touch ? 6 : 4)) return;
|
|
1724
|
-
if (t.branch && !t.moved) return
|
|
1725
|
-
t.moved = !0, clearTimeout(
|
|
1724
|
+
if (t.branch && !t.moved) return Ur(t, t.branch, e);
|
|
1725
|
+
t.moved = !0, clearTimeout(fr), rr.value = !0, _n({
|
|
1726
1726
|
x: t.vx + n,
|
|
1727
1727
|
y: t.vy + r,
|
|
1728
1728
|
zoom: J.value.zoom
|
|
1729
1729
|
});
|
|
1730
1730
|
} else if (t.kind === "marquee") {
|
|
1731
|
-
let n =
|
|
1731
|
+
let n = bn();
|
|
1732
1732
|
if (t.x = e.clientX - n.left, t.y = e.clientY - n.top, !t.moved && Math.hypot(t.x - t.sx, t.y - t.sy) < 4) return;
|
|
1733
|
-
t.moved = !0,
|
|
1733
|
+
t.moved = !0, kr(t);
|
|
1734
1734
|
} else if (t.kind === "node") {
|
|
1735
1735
|
if (!t.active) {
|
|
1736
1736
|
if (Math.hypot(e.clientX - t.sx, e.clientY - t.sy) < (t.touch ? 6 : 4)) return;
|
|
1737
|
-
if (!
|
|
1737
|
+
if (!Le.value || !Ar(t, e)) {
|
|
1738
1738
|
X = {
|
|
1739
1739
|
kind: "pan",
|
|
1740
1740
|
id: t.id,
|
|
@@ -1748,19 +1748,19 @@ var Se = [
|
|
|
1748
1748
|
return;
|
|
1749
1749
|
}
|
|
1750
1750
|
}
|
|
1751
|
-
t.moved = !0,
|
|
1752
|
-
} else if (t.kind === "connect") t.moved = !0,
|
|
1751
|
+
t.moved = !0, Mr(t, e.clientX, e.clientY), Lr(t), w("node-drag", [...t.starts.keys()].map((e) => L.value.get(e)), e), Dt();
|
|
1752
|
+
} else if (t.kind === "connect") t.moved = !0, $r(t, e.clientX, e.clientY), Dt();
|
|
1753
1753
|
else if (t.kind === "reroute") {
|
|
1754
1754
|
if (!t.moved && Math.hypot(e.clientX - t.sx, e.clientY - t.sy) < (e.pointerType === "touch" ? 6 : 4)) return;
|
|
1755
|
-
t.moved = !0,
|
|
1755
|
+
t.moved = !0, ir.value = {
|
|
1756
1756
|
id: t.edge.id,
|
|
1757
|
-
route:
|
|
1757
|
+
route: _r(t, e)
|
|
1758
1758
|
};
|
|
1759
1759
|
}
|
|
1760
1760
|
}
|
|
1761
1761
|
}
|
|
1762
|
-
function
|
|
1763
|
-
let n = e.corners.map((e) => [e[0], e[1]]), r = e.segment, a = n[r], o = n[r + 1], s = Math.abs(a[1] - o[1]) < .01, c = +!!s, l =
|
|
1762
|
+
function _r(e, t) {
|
|
1763
|
+
let n = e.corners.map((e) => [e[0], e[1]]), r = e.segment, a = n[r], o = n[r + 1], s = Math.abs(a[1] - o[1]) < .01, c = +!!s, l = C.gridSize || 20, u = (e) => C.snapToGrid ? Math.round(e / l) * l : Math.round(e), d = (s ? t.clientY - e.sy : t.clientX - e.sx) / J.value.zoom, f = u(a[c] + d), p = r === 0, m = r === n.length - 2, h = c === 1 ? 0 : 1, g = Math.sign(o[h] - a[h]) || 1, _ = Math.abs(o[h] - a[h]), v = Math.min(l, _ / 3), y = (e, t) => c === 1 ? [e[0], t] : [t, e[1]], b = (e, t) => h === 0 ? [e[0] + t, e[1]] : [e[0], e[1] + t], x = [];
|
|
1764
1764
|
if (p) {
|
|
1765
1765
|
let e = b(a, g * v);
|
|
1766
1766
|
x.push(e, y(e, f));
|
|
@@ -1769,38 +1769,38 @@ var Se = [
|
|
|
1769
1769
|
let e = b(o, -g * v);
|
|
1770
1770
|
x.push(y(e, f), e);
|
|
1771
1771
|
} else x.push(y(o, f));
|
|
1772
|
-
let
|
|
1772
|
+
let S = [
|
|
1773
1773
|
...n.slice(0, p ? 1 : r),
|
|
1774
1774
|
...x,
|
|
1775
1775
|
...n.slice(m ? r + 1 : r + 2)
|
|
1776
|
-
], w =
|
|
1777
|
-
return i(
|
|
1776
|
+
], w = en(e.edge);
|
|
1777
|
+
return i(S, w?.s.position, w?.t.position);
|
|
1778
1778
|
}
|
|
1779
|
-
function
|
|
1780
|
-
if (Z.delete(e.pointerId),
|
|
1781
|
-
Z.size < 2 &&
|
|
1779
|
+
function vr(e) {
|
|
1780
|
+
if (Z.delete(e.pointerId), Qn) {
|
|
1781
|
+
Z.size < 2 && wr();
|
|
1782
1782
|
return;
|
|
1783
1783
|
}
|
|
1784
1784
|
let t = X;
|
|
1785
1785
|
if (t && t.kind !== "pinch" && t.id === e.pointerId) {
|
|
1786
|
-
if (X = null, clearTimeout(
|
|
1787
|
-
else if (t.kind === "marquee")
|
|
1786
|
+
if (X = null, clearTimeout(fr), or(), rr.value = !1, t.kind === "pan") t.moved || xr(e);
|
|
1787
|
+
else if (t.kind === "marquee") $n.value = null, t.moved || xr(e);
|
|
1788
1788
|
else if (t.kind === "node") {
|
|
1789
|
-
if (t.active)
|
|
1789
|
+
if (t.active) Br(t, e);
|
|
1790
1790
|
else {
|
|
1791
1791
|
t.select?.(), t.reselect && !e.shiftKey && z({
|
|
1792
1792
|
nodes: [t.nodeId],
|
|
1793
1793
|
edges: []
|
|
1794
1794
|
});
|
|
1795
1795
|
let n = L.value.get(t.nodeId);
|
|
1796
|
-
n &&
|
|
1796
|
+
n && w("node-click", n, e);
|
|
1797
1797
|
}
|
|
1798
|
-
} else if (t.kind === "connect")
|
|
1798
|
+
} else if (t.kind === "connect") ei(t, e);
|
|
1799
1799
|
else if (t.kind === "reroute") {
|
|
1800
|
-
let e =
|
|
1801
|
-
if (
|
|
1800
|
+
let e = ir.value;
|
|
1801
|
+
if (ir.value = null, t.moved && e) {
|
|
1802
1802
|
let n = R.value.get(t.edge.id);
|
|
1803
|
-
n && (
|
|
1803
|
+
n && (In(n.id, { route: e.route }), w("reroute", {
|
|
1804
1804
|
...n,
|
|
1805
1805
|
route: e.route
|
|
1806
1806
|
}));
|
|
@@ -1808,53 +1808,53 @@ var Se = [
|
|
|
1808
1808
|
}
|
|
1809
1809
|
}
|
|
1810
1810
|
}
|
|
1811
|
-
function
|
|
1812
|
-
clearTimeout(
|
|
1811
|
+
function yr(e) {
|
|
1812
|
+
clearTimeout(fr), Z.delete(e.pointerId), Qn ? Z.size < 2 && wr() : br();
|
|
1813
1813
|
}
|
|
1814
|
-
function
|
|
1814
|
+
function br() {
|
|
1815
1815
|
let e = X;
|
|
1816
|
-
if (X = null,
|
|
1816
|
+
if (X = null, or(), rr.value = !1, $n.value = null, e?.kind === "node" && e.active) {
|
|
1817
1817
|
for (let [t, n] of e.starts) {
|
|
1818
1818
|
let e = H.get(t);
|
|
1819
1819
|
e && (e.tx = n.x, e.ty = n.y);
|
|
1820
1820
|
}
|
|
1821
|
-
|
|
1821
|
+
yt.value = /* @__PURE__ */ new Set(), G.clear(), nr.value = [], Fr.value = null, Ir = null, Dt();
|
|
1822
1822
|
}
|
|
1823
|
-
e?.kind === "connect" && ($.value = null,
|
|
1823
|
+
e?.kind === "connect" && ($.value = null, er.value = null), e?.kind === "reroute" && (ir.value = null);
|
|
1824
1824
|
}
|
|
1825
|
-
function
|
|
1826
|
-
let t = (
|
|
1827
|
-
n ? (
|
|
1825
|
+
function xr(e) {
|
|
1826
|
+
let t = (Zn ?? e.target).closest("[data-flow-edge]"), n = t ? R.value.get(t.dataset.flowEdge) : void 0;
|
|
1827
|
+
n ? (Ie.value && n.selectable !== !1 && (e.shiftKey ? z({ edges: Me.value.has(n.id) ? F.value.edges.filter((e) => e !== n.id) : [...F.value.edges, n.id] }) : z({
|
|
1828
1828
|
nodes: [],
|
|
1829
1829
|
edges: [n.id]
|
|
1830
|
-
})),
|
|
1830
|
+
})), w("edge-click", n, e)) : (e.shiftKey || z(ut()), w("pane-click", xn({
|
|
1831
1831
|
x: e.clientX,
|
|
1832
1832
|
y: e.clientY
|
|
1833
1833
|
}), e));
|
|
1834
1834
|
}
|
|
1835
|
-
function
|
|
1836
|
-
let [e, t] = [...Z.values()], n =
|
|
1835
|
+
function Sr() {
|
|
1836
|
+
let [e, t] = [...Z.values()], n = bn();
|
|
1837
1837
|
return {
|
|
1838
1838
|
dist: Math.hypot(e.x - t.x, e.y - t.y) || 1,
|
|
1839
1839
|
cx: (e.x + t.x) / 2 - n.left,
|
|
1840
1840
|
cy: (e.y + t.y) / 2 - n.top
|
|
1841
1841
|
};
|
|
1842
1842
|
}
|
|
1843
|
-
function
|
|
1844
|
-
clearTimeout(
|
|
1845
|
-
let e =
|
|
1846
|
-
Y = null, X = { kind: "pinch" },
|
|
1843
|
+
function Cr() {
|
|
1844
|
+
clearTimeout(fr);
|
|
1845
|
+
let e = Sr();
|
|
1846
|
+
Y = null, X = { kind: "pinch" }, Qn = {
|
|
1847
1847
|
...e,
|
|
1848
1848
|
zoom: J.value.zoom,
|
|
1849
1849
|
fx: (e.cx - J.value.x) / J.value.zoom,
|
|
1850
1850
|
fy: (e.cy - J.value.y) / J.value.zoom
|
|
1851
|
-
},
|
|
1851
|
+
}, ar();
|
|
1852
1852
|
}
|
|
1853
|
-
function
|
|
1854
|
-
|
|
1853
|
+
function wr() {
|
|
1854
|
+
Qn = null;
|
|
1855
1855
|
let e = [...Z][0];
|
|
1856
1856
|
if (!e) {
|
|
1857
|
-
X = null,
|
|
1857
|
+
X = null, or();
|
|
1858
1858
|
return;
|
|
1859
1859
|
}
|
|
1860
1860
|
let [t, n] = e;
|
|
@@ -1870,83 +1870,83 @@ var Se = [
|
|
|
1870
1870
|
touch: !0
|
|
1871
1871
|
};
|
|
1872
1872
|
}
|
|
1873
|
-
function
|
|
1874
|
-
if (!
|
|
1875
|
-
let e =
|
|
1876
|
-
|
|
1877
|
-
x: e.cx -
|
|
1878
|
-
y: e.cy -
|
|
1873
|
+
function Tr() {
|
|
1874
|
+
if (!Qn || Z.size < 2) return;
|
|
1875
|
+
let e = Sr(), t = gn(Qn.zoom * e.dist / Qn.dist);
|
|
1876
|
+
_n({
|
|
1877
|
+
x: e.cx - Qn.fx * t,
|
|
1878
|
+
y: e.cy - Qn.fy * t,
|
|
1879
1879
|
zoom: t
|
|
1880
1880
|
});
|
|
1881
1881
|
}
|
|
1882
|
-
function
|
|
1882
|
+
function Er(e) {
|
|
1883
1883
|
let t = e.target;
|
|
1884
|
-
if (
|
|
1884
|
+
if (he(t) || t.closest("[data-flow-nowheel]")) return;
|
|
1885
1885
|
e.preventDefault();
|
|
1886
|
-
let n = e.deltaMode === 1 ? 16 : e.deltaMode === 2 ? M.value.height : 1, r =
|
|
1887
|
-
if (e.ctrlKey || e.metaKey ||
|
|
1886
|
+
let n = e.deltaMode === 1 ? 16 : e.deltaMode === 2 ? M.value.height : 1, r = bn();
|
|
1887
|
+
if (e.ctrlKey || e.metaKey || C.wheel === "zoom") {
|
|
1888
1888
|
let t = Math.max(-50, Math.min(50, e.deltaY * n));
|
|
1889
|
-
|
|
1889
|
+
Cn(J.value.zoom * Math.exp(-t * .01), e.clientX - r.left, e.clientY - r.top), Y = null;
|
|
1890
1890
|
return;
|
|
1891
1891
|
}
|
|
1892
1892
|
let i = (e.shiftKey && !e.deltaX ? e.deltaY : e.deltaX) * n, a = (e.shiftKey && !e.deltaX ? 0 : e.deltaY) * n;
|
|
1893
|
-
Y = null,
|
|
1893
|
+
Y = null, _n({
|
|
1894
1894
|
x: J.value.x - i,
|
|
1895
1895
|
y: J.value.y - a,
|
|
1896
1896
|
zoom: J.value.zoom
|
|
1897
1897
|
});
|
|
1898
1898
|
}
|
|
1899
|
-
function
|
|
1899
|
+
function Dr(e) {
|
|
1900
1900
|
let t = e.target;
|
|
1901
|
-
if (
|
|
1901
|
+
if (he(t)) return;
|
|
1902
1902
|
let n = t.closest("[data-flow-node]"), r = t.closest("[data-flow-edge]");
|
|
1903
1903
|
if (n) {
|
|
1904
1904
|
let t = L.value.get(n.dataset.flowNode);
|
|
1905
|
-
t &&
|
|
1905
|
+
t && w("node-dblclick", t, e);
|
|
1906
1906
|
} else if (r) {
|
|
1907
1907
|
let t = R.value.get(r.dataset.flowEdge);
|
|
1908
|
-
t &&
|
|
1909
|
-
} else if (
|
|
1908
|
+
t && w("edge-dblclick", t, e);
|
|
1909
|
+
} else if (w("pane-dblclick", xn({
|
|
1910
1910
|
x: e.clientX,
|
|
1911
1911
|
y: e.clientY
|
|
1912
|
-
}), e),
|
|
1913
|
-
let t =
|
|
1914
|
-
|
|
1912
|
+
}), e), C.zoomOnDoubleClick) {
|
|
1913
|
+
let t = bn();
|
|
1914
|
+
Cn(wn() * 2, e.clientX - t.left, e.clientY - t.top, !0);
|
|
1915
1915
|
}
|
|
1916
1916
|
}
|
|
1917
|
-
function
|
|
1917
|
+
function Or(e) {
|
|
1918
1918
|
let t = e.target;
|
|
1919
|
-
if (
|
|
1920
|
-
!
|
|
1919
|
+
if (he(t)) return;
|
|
1920
|
+
!C.nativeContextMenu && !t.closest("input, textarea, select, [contenteditable]") && e.preventDefault();
|
|
1921
1921
|
let n = t.closest("[data-flow-node]"), r = t.closest("[data-flow-edge]"), i = n ? L.value.get(n.dataset.flowNode) : void 0, a = r ? R.value.get(r.dataset.flowEdge) : void 0;
|
|
1922
|
-
i ?
|
|
1922
|
+
i ? w("node-contextmenu", i, e) : a ? w("edge-contextmenu", a, e) : w("pane-contextmenu", xn({
|
|
1923
1923
|
x: e.clientX,
|
|
1924
1924
|
y: e.clientY
|
|
1925
1925
|
}), e);
|
|
1926
1926
|
}
|
|
1927
|
-
function
|
|
1927
|
+
function kr(e) {
|
|
1928
1928
|
let t = Math.min(e.sx, e.x), n = Math.min(e.sy, e.y), r = Math.abs(e.x - e.sx), i = Math.abs(e.y - e.sy);
|
|
1929
|
-
|
|
1929
|
+
$n.value = {
|
|
1930
1930
|
x: t,
|
|
1931
1931
|
y: n,
|
|
1932
1932
|
width: r,
|
|
1933
1933
|
height: i
|
|
1934
1934
|
};
|
|
1935
|
-
let a = J.value.zoom, o = (t - J.value.x) / a, s = (n - J.value.y) / a, c = o + r / a, l = s + i / a, u =
|
|
1935
|
+
let a = J.value.zoom, o = (t - J.value.x) / a, s = (n - J.value.y) / a, c = o + r / a, l = s + i / a, u = sn.value.filter((e) => {
|
|
1936
1936
|
if (e.selectable === !1) return !1;
|
|
1937
1937
|
let t = W(e.id), n = K(e.id);
|
|
1938
1938
|
return t.x < c && t.x + n.width > o && t.y < l && t.y + n.height > s;
|
|
1939
1939
|
}).map((e) => e.id), d = [.../* @__PURE__ */ new Set([...e.additive, ...u])], f = new Set(d);
|
|
1940
1940
|
z({
|
|
1941
1941
|
nodes: d,
|
|
1942
|
-
edges:
|
|
1942
|
+
edges: un.value.filter((e) => e.selectable !== !1 && f.has(e.source) && f.has(e.target)).map((e) => e.id)
|
|
1943
1943
|
});
|
|
1944
1944
|
}
|
|
1945
|
-
function
|
|
1945
|
+
function Ar(e, t) {
|
|
1946
1946
|
e.select?.(), e.select = void 0;
|
|
1947
|
-
let n =
|
|
1947
|
+
let n = je.value.has(e.nodeId) ? F.value.nodes : [e.nodeId], r = n.filter((e) => {
|
|
1948
1948
|
let t = L.value.get(e);
|
|
1949
|
-
return t && t.draggable !== !1 && !
|
|
1949
|
+
return t && t.draggable !== !1 && !Oe(e) && !Ee(e).some((e) => n.includes(e));
|
|
1950
1950
|
});
|
|
1951
1951
|
if (!r.includes(e.nodeId) && L.value.get(e.nodeId)?.draggable === !1 || !r.length) return !1;
|
|
1952
1952
|
for (let t of r) {
|
|
@@ -1957,12 +1957,12 @@ var Se = [
|
|
|
1957
1957
|
});
|
|
1958
1958
|
}
|
|
1959
1959
|
e.active = !0;
|
|
1960
|
-
for (let e of r) for (let t of
|
|
1961
|
-
return
|
|
1960
|
+
for (let e of r) for (let t of Ee(e)) G.has(t) || G.set(t, K(t));
|
|
1961
|
+
return yt.value = new Set(r), document.body.style.userSelect = "none", w("node-drag-start", r.map((e) => L.value.get(e)), t), !0;
|
|
1962
1962
|
}
|
|
1963
|
-
function
|
|
1963
|
+
function jr(e, t) {
|
|
1964
1964
|
if (!L.value.has(e) || I.value) return;
|
|
1965
|
-
X &&
|
|
1965
|
+
X && br(), H.has(e) || St(), Ie.value && z({
|
|
1966
1966
|
nodes: [e],
|
|
1967
1967
|
edges: []
|
|
1968
1968
|
});
|
|
@@ -1978,22 +1978,22 @@ var Se = [
|
|
|
1978
1978
|
moved: !0,
|
|
1979
1979
|
reselect: !1
|
|
1980
1980
|
};
|
|
1981
|
-
X = n, Q.x = t.clientX, Q.y = t.clientY,
|
|
1981
|
+
X = n, Q.x = t.clientX, Q.y = t.clientY, ar(), n.touch && lr(t.target), Ar(n, t) || (X = null, or());
|
|
1982
1982
|
}
|
|
1983
|
-
function
|
|
1983
|
+
function Mr(e, t, n) {
|
|
1984
1984
|
let r = J.value.zoom, i = (t - e.sx) / r, a = (n - e.sy) / r, o = e.starts.get(e.nodeId) ?? [...e.starts.values()][0], s = e.starts.has(e.nodeId) ? e.nodeId : [...e.starts.keys()][0];
|
|
1985
|
-
if (
|
|
1986
|
-
let e =
|
|
1985
|
+
if (C.snapToGrid) {
|
|
1986
|
+
let e = C.gridSize, t = L.value.get(s)?.gridOffset ?? {
|
|
1987
1987
|
x: 0,
|
|
1988
1988
|
y: 0
|
|
1989
1989
|
};
|
|
1990
|
-
i = Math.round((o.x + t.x + i) / e) * e - o.x - t.x, a = Math.round((o.y + t.y + a) / e) * e - o.y - t.y,
|
|
1991
|
-
} else if (
|
|
1992
|
-
let e =
|
|
1990
|
+
i = Math.round((o.x + t.x + i) / e) * e - o.x - t.x, a = Math.round((o.y + t.y + a) / e) * e - o.y - t.y, nr.value = [];
|
|
1991
|
+
} else if (C.guides && e.starts.size === 1) {
|
|
1992
|
+
let e = Nr(s, o, i, a);
|
|
1993
1993
|
i = e.dx, a = e.dy;
|
|
1994
1994
|
}
|
|
1995
1995
|
for (let [t, n] of e.starts) {
|
|
1996
|
-
let e = n.x + i, r = n.y + a, o = L.value.get(t), s =
|
|
1996
|
+
let e = n.x + i, r = n.y + a, o = L.value.get(t), s = Te(t);
|
|
1997
1997
|
if (o.extent === "parent" && s) {
|
|
1998
1998
|
let n = K(s), i = K(t);
|
|
1999
1999
|
e = Math.max(0, Math.min(n.width - i.width, e)), r = Math.max(0, Math.min(n.height - i.height, r));
|
|
@@ -2004,8 +2004,8 @@ var Se = [
|
|
|
2004
2004
|
l.x = e, l.y = r;
|
|
2005
2005
|
}
|
|
2006
2006
|
}
|
|
2007
|
-
function
|
|
2008
|
-
let i =
|
|
2007
|
+
function Nr(e, t, n, r) {
|
|
2008
|
+
let i = Te(e) ? W(Te(e)) : {
|
|
2009
2009
|
x: 0,
|
|
2010
2010
|
y: 0
|
|
2011
2011
|
}, a = K(e), o = i.x + t.x + n, s = i.y + t.y + r, c = [
|
|
@@ -2018,10 +2018,10 @@ var Se = [
|
|
|
2018
2018
|
s + a.height
|
|
2019
2019
|
], u = 6 / J.value.zoom, d = null, f = null, p = /* @__PURE__ */ new Set([
|
|
2020
2020
|
e,
|
|
2021
|
-
...
|
|
2022
|
-
...
|
|
2021
|
+
...Ae(e),
|
|
2022
|
+
...Ee(e)
|
|
2023
2023
|
]);
|
|
2024
|
-
for (let e of
|
|
2024
|
+
for (let e of sn.value) {
|
|
2025
2025
|
if (p.has(e.id)) continue;
|
|
2026
2026
|
let t = W(e.id), n = K(e.id), r = [
|
|
2027
2027
|
t.x,
|
|
@@ -2069,44 +2069,44 @@ var Se = [
|
|
|
2069
2069
|
to: Math.max(e + a.width, f.box.x2)
|
|
2070
2070
|
});
|
|
2071
2071
|
}
|
|
2072
|
-
return
|
|
2072
|
+
return nr.value = m, {
|
|
2073
2073
|
dx: n,
|
|
2074
2074
|
dy: r
|
|
2075
2075
|
};
|
|
2076
2076
|
}
|
|
2077
|
-
function
|
|
2077
|
+
function Pr(e) {
|
|
2078
2078
|
let t, n = /* @__PURE__ */ new Set();
|
|
2079
2079
|
return typeof e == "string" ? (t = {
|
|
2080
2080
|
...W(e),
|
|
2081
2081
|
...K(e)
|
|
2082
|
-
}, n.add(e),
|
|
2082
|
+
}, n.add(e), Ae(e).forEach((e) => n.add(e)), Ee(e).forEach((e) => n.add(e))) : t = e, sn.value.filter((e) => {
|
|
2083
2083
|
if (n.has(e.id) || e.type === "group") return !1;
|
|
2084
2084
|
let r = W(e.id), i = K(e.id);
|
|
2085
2085
|
return r.x < t.x + t.width && r.x + i.width > t.x && r.y < t.y + t.height && r.y + i.height > t.y;
|
|
2086
2086
|
});
|
|
2087
2087
|
}
|
|
2088
|
-
let
|
|
2089
|
-
function Ir(e) {
|
|
2090
|
-
Fr = null;
|
|
2091
|
-
let t = Lr(e);
|
|
2092
|
-
Fr = t, Pr.value = t?.edge.id ?? null;
|
|
2093
|
-
}
|
|
2088
|
+
let Fr = A(null), Ir = null;
|
|
2094
2089
|
function Lr(e) {
|
|
2095
|
-
|
|
2090
|
+
Ir = null;
|
|
2091
|
+
let t = Rr(e);
|
|
2092
|
+
Ir = t, Fr.value = t?.edge.id ?? null;
|
|
2093
|
+
}
|
|
2094
|
+
function Rr(e) {
|
|
2095
|
+
if (!C.insertOnEdge || e.starts.size !== 1 || !Re.value) return null;
|
|
2096
2096
|
let t = [...e.starts.keys()][0], n = L.value.get(t);
|
|
2097
2097
|
if (!n || n.type === "group" || n.connectable === !1 || n.insertable === !1 || P.value.some((e) => e.source === t || e.target === t)) return null;
|
|
2098
|
-
let r = null, i = null, o =
|
|
2098
|
+
let r = null, i = null, o = At.get(t);
|
|
2099
2099
|
if (o?.length) {
|
|
2100
2100
|
let e = o.find((e) => e.type === "target" && e.connectable), t = o.find((e) => e.type === "source" && e.connectable);
|
|
2101
2101
|
if (!e && n.type !== "circle" || !t && n.type !== "circle") return null;
|
|
2102
2102
|
r = e?.id ?? null, i = t?.id ?? null;
|
|
2103
2103
|
}
|
|
2104
2104
|
let c = W(t), l = K(t), u = c.x + l.width / 2, d = c.y + l.height / 2, f = Math.max(8 / J.value.zoom, Math.min(l.width, l.height) / 2), p = null;
|
|
2105
|
-
for (let e of
|
|
2105
|
+
for (let e of un.value) {
|
|
2106
2106
|
if (e.deletable === !1) continue;
|
|
2107
|
-
let t =
|
|
2107
|
+
let t = tn(e);
|
|
2108
2108
|
if (!t) continue;
|
|
2109
|
-
let n = a(u, d,
|
|
2109
|
+
let n = a(u, d, nn(e) ?? s(q(e), t));
|
|
2110
2110
|
n <= f && (!p || n < p.d) && (p = {
|
|
2111
2111
|
edge: e,
|
|
2112
2112
|
d: n
|
|
@@ -2124,16 +2124,16 @@ var Se = [
|
|
|
2124
2124
|
target: m.target,
|
|
2125
2125
|
targetHandle: m.targetHandle ?? null
|
|
2126
2126
|
};
|
|
2127
|
-
return !
|
|
2127
|
+
return !Zr(h) || !Zr(g) ? null : {
|
|
2128
2128
|
node: t,
|
|
2129
2129
|
edge: m,
|
|
2130
2130
|
connections: [h, g]
|
|
2131
2131
|
};
|
|
2132
2132
|
}
|
|
2133
|
-
function
|
|
2133
|
+
function zr(e, t) {
|
|
2134
2134
|
let n = new Map(e.map((e) => [e.id, e])), r = n.get(t.edge.source), i = n.get(t.node), a = n.get(t.edge.target);
|
|
2135
2135
|
if (!r || !i || !a || r.parentId !== i.parentId || i.parentId !== a.parentId) return e;
|
|
2136
|
-
let o =
|
|
2136
|
+
let o = C.direction !== "vertical", s = o ? "x" : "y", c = (e) => o ? K(e).width : K(e).height, l = r.position[s] + c(r.id);
|
|
2137
2137
|
if (a.position[s] < l) return e;
|
|
2138
2138
|
let u = Math.max(i.position[s], l + 48), d = Math.max(0, u + c(i.id) + 48 - a.position[s]), f = /* @__PURE__ */ new Set();
|
|
2139
2139
|
if (d > 0) {
|
|
@@ -2161,36 +2161,36 @@ var Se = [
|
|
|
2161
2161
|
}
|
|
2162
2162
|
} : e);
|
|
2163
2163
|
}
|
|
2164
|
-
function
|
|
2164
|
+
function Br(e, t) {
|
|
2165
2165
|
document.body.style.userSelect = "";
|
|
2166
|
-
let n =
|
|
2167
|
-
|
|
2166
|
+
let n = Ir;
|
|
2167
|
+
Ir = null, Fr.value = null;
|
|
2168
2168
|
let r;
|
|
2169
|
-
if (n &&
|
|
2169
|
+
if (n && C.autoConnect) {
|
|
2170
2170
|
let { id: e, label: t, source: i, target: a, sourceHandle: o, targetHandle: s, ...c } = n.edge;
|
|
2171
2171
|
r = n.connections.map((e) => ({
|
|
2172
2172
|
...c,
|
|
2173
|
-
id:
|
|
2173
|
+
id: be("edge"),
|
|
2174
2174
|
...e
|
|
2175
2175
|
}));
|
|
2176
2176
|
}
|
|
2177
|
-
|
|
2177
|
+
nr.value = [];
|
|
2178
2178
|
let i = [...e.starts.keys()].filter((t) => {
|
|
2179
2179
|
let n = H.get(t), r = e.starts.get(t);
|
|
2180
2180
|
return n.tx !== r.x || n.ty !== r.y;
|
|
2181
2181
|
}), a = /* @__PURE__ */ new Map();
|
|
2182
|
-
if (
|
|
2183
|
-
let n =
|
|
2182
|
+
if (C.dropIntoGroups) {
|
|
2183
|
+
let n = xn({
|
|
2184
2184
|
x: t.clientX,
|
|
2185
2185
|
y: t.clientY
|
|
2186
2186
|
});
|
|
2187
2187
|
for (let t of e.starts.keys()) {
|
|
2188
2188
|
let e = L.value.get(t);
|
|
2189
2189
|
if (e.type === "group") continue;
|
|
2190
|
-
let r = /* @__PURE__ */ new Set([t, ...
|
|
2190
|
+
let r = /* @__PURE__ */ new Set([t, ...Ae(t)]), i = cn.value.filter((e) => !r.has(e.id)).filter((e) => {
|
|
2191
2191
|
let t = W(e.id), r = K(e.id);
|
|
2192
2192
|
return n.x >= t.x && n.x <= t.x + r.width && n.y >= t.y && n.y <= t.y + r.height;
|
|
2193
|
-
}).sort((e, t) =>
|
|
2193
|
+
}).sort((e, t) => De(t.id) - De(e.id))[0];
|
|
2194
2194
|
(i?.id ?? void 0) !== (e.parentId ?? void 0) && a.set(t, i?.id);
|
|
2195
2195
|
}
|
|
2196
2196
|
}
|
|
@@ -2222,43 +2222,43 @@ var Se = [
|
|
|
2222
2222
|
position: r
|
|
2223
2223
|
};
|
|
2224
2224
|
return i ? o.parentId = i : delete o.parentId, o;
|
|
2225
|
-
}), s = r && n ?
|
|
2225
|
+
}), s = r && n ? zr(o, n) : o, c = e.starts.get(e.nodeId), l = H.get(e.nodeId), u = r ? [...P.value.filter((e) => e !== n.edge), ...r] : void 0;
|
|
2226
2226
|
c && l && !a.size && (l.tx !== c.x || l.ty !== c.y) && P.value.some((e) => e.route && t.has(e.source) && t.has(e.target)) && (u = (u ?? P.value).map((e) => e.route && t.has(e.source) && t.has(e.target) ? {
|
|
2227
2227
|
...e,
|
|
2228
|
-
route:
|
|
2229
|
-
} : e)), r && (
|
|
2228
|
+
route: $t(e, l.tx - c.x, l.ty - c.y)
|
|
2229
|
+
} : e)), r && (yt.value = /* @__PURE__ */ new Set()), B({
|
|
2230
2230
|
nodes: s,
|
|
2231
2231
|
edges: u
|
|
2232
2232
|
});
|
|
2233
2233
|
let d = L.value.get(e.nodeId);
|
|
2234
|
-
d &&
|
|
2234
|
+
d && ye(h(E.flowMoved, { label: ni(d) }, E.lang));
|
|
2235
2235
|
}
|
|
2236
|
-
|
|
2236
|
+
yt.value = /* @__PURE__ */ new Set(), G.clear();
|
|
2237
2237
|
let o = [...e.starts.keys()].map((e) => L.value.get(e)).filter(Boolean);
|
|
2238
|
-
n &&
|
|
2238
|
+
n && w("insert", {
|
|
2239
2239
|
node: L.value.get(n.node),
|
|
2240
2240
|
edge: n.edge,
|
|
2241
2241
|
connections: n.connections
|
|
2242
|
-
}),
|
|
2242
|
+
}), w("node-drag-stop", {
|
|
2243
2243
|
nodes: o,
|
|
2244
|
-
intersecting:
|
|
2244
|
+
intersecting: Pr(e.nodeId),
|
|
2245
2245
|
event: t
|
|
2246
2246
|
});
|
|
2247
2247
|
}
|
|
2248
|
-
function
|
|
2248
|
+
function Vr(e) {
|
|
2249
2249
|
let t = X;
|
|
2250
2250
|
if (!t || t.kind !== "node" && t.kind !== "connect" || !t.moved) return !1;
|
|
2251
|
-
let n =
|
|
2251
|
+
let n = bn(), r = Q.x - n.left, i = Q.y - n.top, a = r < 40 ? 1 - r / 40 : r > n.width - 40 ? -(1 - (n.width - r) / 40) : 0, o = i < 40 ? 1 - i / 40 : i > n.height - 40 ? -(1 - (n.height - i) / 40) : 0;
|
|
2252
2252
|
if (!a && !o) return !1;
|
|
2253
2253
|
let s = Math.max(-1, Math.min(1, a)) * 600 * e, c = Math.max(-1, Math.min(1, o)) * 600 * e;
|
|
2254
|
-
return
|
|
2254
|
+
return _n({
|
|
2255
2255
|
x: J.value.x + s,
|
|
2256
2256
|
y: J.value.y + c,
|
|
2257
2257
|
zoom: J.value.zoom
|
|
2258
|
-
}), t.kind === "node" ? (t.sx += s, t.sy += c,
|
|
2258
|
+
}), t.kind === "node" ? (t.sx += s, t.sy += c, Mr(t, Q.x, Q.y)) : $r(t, Q.x, Q.y), !0;
|
|
2259
2259
|
}
|
|
2260
|
-
function
|
|
2261
|
-
let i =
|
|
2260
|
+
function Hr(e, t, n, r) {
|
|
2261
|
+
let i = Ut(t, r, n);
|
|
2262
2262
|
i && (X = {
|
|
2263
2263
|
kind: "connect",
|
|
2264
2264
|
id: e.pointerId,
|
|
@@ -2282,17 +2282,17 @@ var Se = [
|
|
|
2282
2282
|
},
|
|
2283
2283
|
toPosition: null,
|
|
2284
2284
|
type: r,
|
|
2285
|
-
edgeType: q({ ...
|
|
2286
|
-
}, Q.x = e.clientX, Q.y = e.clientY,
|
|
2285
|
+
edgeType: q({ ...C.defaultEdgeOptions })
|
|
2286
|
+
}, Q.x = e.clientX, Q.y = e.clientY, w("connect-start", {
|
|
2287
2287
|
nodeId: t,
|
|
2288
2288
|
handleId: n,
|
|
2289
2289
|
type: r
|
|
2290
|
-
}),
|
|
2290
|
+
}), ar());
|
|
2291
2291
|
}
|
|
2292
|
-
function
|
|
2293
|
-
let r =
|
|
2292
|
+
function Ur(e, t, n) {
|
|
2293
|
+
let r = Ut(t.source, "source", t.sourceHandle);
|
|
2294
2294
|
if (!r) return;
|
|
2295
|
-
let i = t.sourceHandle ?? null, { direction: a, segment: o, ...s } =
|
|
2295
|
+
let i = t.sourceHandle ?? null, { direction: a, segment: o, ...s } = Wr(t, xn({
|
|
2296
2296
|
x: e.sx,
|
|
2297
2297
|
y: e.sy
|
|
2298
2298
|
})), c = {
|
|
@@ -2321,20 +2321,20 @@ var Se = [
|
|
|
2321
2321
|
toPosition: null,
|
|
2322
2322
|
type: "source",
|
|
2323
2323
|
edgeType: q(t)
|
|
2324
|
-
},
|
|
2324
|
+
}, w("connect-start", {
|
|
2325
2325
|
nodeId: t.source,
|
|
2326
2326
|
handleId: i,
|
|
2327
2327
|
type: "source"
|
|
2328
|
-
}),
|
|
2328
|
+
}), $r(c, n.clientX, n.clientY), Dt();
|
|
2329
2329
|
}
|
|
2330
|
-
function
|
|
2331
|
-
let n =
|
|
2330
|
+
function Wr(e, t) {
|
|
2331
|
+
let n = tn(e);
|
|
2332
2332
|
if (!n) return {
|
|
2333
2333
|
...t,
|
|
2334
2334
|
direction: "right",
|
|
2335
2335
|
segment: 0
|
|
2336
2336
|
};
|
|
2337
|
-
let r =
|
|
2337
|
+
let r = nn(e) ?? s(q(e), n), i = {
|
|
2338
2338
|
x: t.x,
|
|
2339
2339
|
y: t.y,
|
|
2340
2340
|
d: Infinity,
|
|
@@ -2353,8 +2353,8 @@ var Se = [
|
|
|
2353
2353
|
i: e - 1
|
|
2354
2354
|
});
|
|
2355
2355
|
}
|
|
2356
|
-
let { x: a, y: o } = i, c =
|
|
2357
|
-
if (
|
|
2356
|
+
let { x: a, y: o } = i, c = C.gridSize || 20;
|
|
2357
|
+
if (C.snapToGrid) {
|
|
2358
2358
|
let e = (e, t, n) => Math.max(Math.min(t, n), Math.min(Math.max(t, n), e));
|
|
2359
2359
|
Math.abs(i.a[1] - i.b[1]) < .01 ? a = e(Math.round(a / c) * c, i.a[0], i.b[0]) : Math.abs(i.a[0] - i.b[0]) < .01 && (o = e(Math.round(o / c) * c, i.a[1], i.b[1]));
|
|
2360
2360
|
}
|
|
@@ -2366,43 +2366,43 @@ var Se = [
|
|
|
2366
2366
|
segment: i.i
|
|
2367
2367
|
};
|
|
2368
2368
|
}
|
|
2369
|
-
function
|
|
2369
|
+
function Gr(e, t = {}) {
|
|
2370
2370
|
let n = t.radius ?? 8, r = null;
|
|
2371
|
-
for (let i of
|
|
2371
|
+
for (let i of un.value) {
|
|
2372
2372
|
if (t.ignore?.(i)) continue;
|
|
2373
|
-
let o =
|
|
2373
|
+
let o = tn(i);
|
|
2374
2374
|
if (!o) continue;
|
|
2375
|
-
let c = a(e.x, e.y,
|
|
2375
|
+
let c = a(e.x, e.y, nn(i) ?? s(q(i), o));
|
|
2376
2376
|
c <= n && (!r || c < r.d) && (r = {
|
|
2377
2377
|
edge: i,
|
|
2378
2378
|
d: c
|
|
2379
2379
|
});
|
|
2380
2380
|
}
|
|
2381
2381
|
if (!r) return null;
|
|
2382
|
-
let { direction: i, segment: o, ...c } =
|
|
2382
|
+
let { direction: i, segment: o, ...c } = Wr(r.edge, e);
|
|
2383
2383
|
return {
|
|
2384
2384
|
edge: r.edge,
|
|
2385
2385
|
position: c,
|
|
2386
2386
|
direction: i,
|
|
2387
|
-
routes:
|
|
2387
|
+
routes: Kr(r.edge, c, o, i)
|
|
2388
2388
|
};
|
|
2389
2389
|
}
|
|
2390
|
-
function
|
|
2391
|
-
let a =
|
|
2390
|
+
function Kr(e, t, n, r) {
|
|
2391
|
+
let a = nn(e), o = en(e);
|
|
2392
2392
|
if (!a || !o || !e.route) return;
|
|
2393
|
-
let s = [t.x, t.y], c =
|
|
2393
|
+
let s = [t.x, t.y], c = qr[r];
|
|
2394
2394
|
return {
|
|
2395
2395
|
before: i([...a.slice(0, n + 1), s], o.s.position, c),
|
|
2396
2396
|
after: i([s, ...a.slice(n + 1)], r, o.t.position)
|
|
2397
2397
|
};
|
|
2398
2398
|
}
|
|
2399
|
-
let
|
|
2399
|
+
let qr = {
|
|
2400
2400
|
top: "bottom",
|
|
2401
2401
|
bottom: "top",
|
|
2402
2402
|
left: "right",
|
|
2403
2403
|
right: "left"
|
|
2404
2404
|
};
|
|
2405
|
-
function
|
|
2405
|
+
function Jr(e, t, n) {
|
|
2406
2406
|
let r = n === "target" ? {
|
|
2407
2407
|
nodeId: t.source,
|
|
2408
2408
|
handleId: t.sourceHandle ?? null,
|
|
@@ -2411,7 +2411,7 @@ var Se = [
|
|
|
2411
2411
|
nodeId: t.target,
|
|
2412
2412
|
handleId: t.targetHandle ?? null,
|
|
2413
2413
|
type: "target"
|
|
2414
|
-
}, i =
|
|
2414
|
+
}, i = Ut(r.nodeId, r.type, r.handleId);
|
|
2415
2415
|
if (!i) return;
|
|
2416
2416
|
X = {
|
|
2417
2417
|
kind: "connect",
|
|
@@ -2423,7 +2423,7 @@ var Se = [
|
|
|
2423
2423
|
},
|
|
2424
2424
|
moved: !1
|
|
2425
2425
|
};
|
|
2426
|
-
let a =
|
|
2426
|
+
let a = xn({
|
|
2427
2427
|
x: e.clientX,
|
|
2428
2428
|
y: e.clientY
|
|
2429
2429
|
});
|
|
@@ -2433,10 +2433,10 @@ var Se = [
|
|
|
2433
2433
|
toPosition: null,
|
|
2434
2434
|
type: r.type,
|
|
2435
2435
|
edgeType: q(t)
|
|
2436
|
-
}, Q.x = e.clientX, Q.y = e.clientY,
|
|
2436
|
+
}, Q.x = e.clientX, Q.y = e.clientY, ar();
|
|
2437
2437
|
}
|
|
2438
|
-
let
|
|
2439
|
-
function
|
|
2438
|
+
let Yr = (e, t) => `${e}:${t.id ?? ""}:${t.type}`;
|
|
2439
|
+
function Xr(e, t, n) {
|
|
2440
2440
|
return e.type === "source" ? {
|
|
2441
2441
|
source: e.nodeId,
|
|
2442
2442
|
sourceHandle: e.handleId,
|
|
@@ -2449,18 +2449,18 @@ var Se = [
|
|
|
2449
2449
|
targetHandle: e.handleId
|
|
2450
2450
|
};
|
|
2451
2451
|
}
|
|
2452
|
-
function
|
|
2453
|
-
return e.source === e.target || P.value.some((n) => n !== t && n.source === e.source && n.target === e.target && (n.sourceHandle ?? null) === e.sourceHandle && (n.targetHandle ?? null) === e.targetHandle) ? !1 : !
|
|
2452
|
+
function Zr(e, t) {
|
|
2453
|
+
return e.source === e.target || P.value.some((n) => n !== t && n.source === e.source && n.target === e.target && (n.sourceHandle ?? null) === e.sourceHandle && (n.targetHandle ?? null) === e.targetHandle) ? !1 : !C.isValidConnection || C.isValidConnection(e);
|
|
2454
2454
|
}
|
|
2455
|
-
let
|
|
2456
|
-
function
|
|
2457
|
-
let r =
|
|
2455
|
+
let Qr = null;
|
|
2456
|
+
function $r(e, t, n) {
|
|
2457
|
+
let r = xn({
|
|
2458
2458
|
x: t,
|
|
2459
2459
|
y: n
|
|
2460
|
-
}), i = e.from.type === "source" ? "target" : "source", a =
|
|
2461
|
-
for (let e of
|
|
2460
|
+
}), i = e.from.type === "source" ? "target" : "source", a = C.connectionRadius / J.value.zoom, o = null;
|
|
2461
|
+
for (let e of sn.value) {
|
|
2462
2462
|
if (e.connectable === !1) continue;
|
|
2463
|
-
let t = W(e.id), n = K(e.id), s = r.x >= t.x && r.x <= t.x + n.width && r.y >= t.y && r.y <= t.y + n.height, c = (
|
|
2463
|
+
let t = W(e.id), n = K(e.id), s = r.x >= t.x && r.x <= t.x + n.width && r.y >= t.y && r.y <= t.y + n.height, c = (At.get(e.id) ?? []).filter((e) => e.type === i && e.connectable);
|
|
2464
2464
|
if (c.length) for (let n of c) {
|
|
2465
2465
|
let i = t.x + n.x, c = t.y + n.y, l = Math.hypot(i - r.x, c - r.y);
|
|
2466
2466
|
(l <= a || s) && (!o || l < o.d) && (o = {
|
|
@@ -2473,7 +2473,7 @@ var Se = [
|
|
|
2473
2473
|
});
|
|
2474
2474
|
}
|
|
2475
2475
|
else if (s) {
|
|
2476
|
-
let t =
|
|
2476
|
+
let t = Rt(e)[i], n = zt(e.id, t), a = Math.hypot(n.x - r.x, n.y - r.y);
|
|
2477
2477
|
(!o || a < o.d) && (o = {
|
|
2478
2478
|
nodeId: e.id,
|
|
2479
2479
|
h: null,
|
|
@@ -2487,13 +2487,13 @@ var Se = [
|
|
|
2487
2487
|
o && o.nodeId === e.from.nodeId && (o = null);
|
|
2488
2488
|
let s = $.value;
|
|
2489
2489
|
if (o) {
|
|
2490
|
-
let t = Xr(
|
|
2491
|
-
|
|
2490
|
+
let t = Zr(Xr(e.from, o.nodeId, o.h?.id ?? null), e.reconnect?.edge);
|
|
2491
|
+
Qr = {
|
|
2492
2492
|
nodeId: o.nodeId,
|
|
2493
2493
|
handleId: o.h?.id ?? null,
|
|
2494
2494
|
valid: t
|
|
2495
|
-
},
|
|
2496
|
-
key:
|
|
2495
|
+
}, er.value = {
|
|
2496
|
+
key: Yr(o.nodeId, {
|
|
2497
2497
|
id: o.h?.id ?? null,
|
|
2498
2498
|
type: i
|
|
2499
2499
|
}),
|
|
@@ -2506,74 +2506,77 @@ var Se = [
|
|
|
2506
2506
|
} : r,
|
|
2507
2507
|
toPosition: t ? o.position : null
|
|
2508
2508
|
};
|
|
2509
|
-
} else
|
|
2509
|
+
} else Qr = null, er.value = null, $.value = {
|
|
2510
2510
|
...s,
|
|
2511
2511
|
to: r,
|
|
2512
2512
|
toPosition: null
|
|
2513
2513
|
};
|
|
2514
2514
|
}
|
|
2515
|
-
function
|
|
2516
|
-
let n =
|
|
2517
|
-
|
|
2518
|
-
let r =
|
|
2515
|
+
function ei(e, t) {
|
|
2516
|
+
let n = Qr;
|
|
2517
|
+
Qr = null, $.value = null, er.value = null;
|
|
2518
|
+
let r = xn({
|
|
2519
2519
|
x: t.clientX,
|
|
2520
2520
|
y: t.clientY
|
|
2521
2521
|
}), i = e.tap;
|
|
2522
2522
|
if (i && Math.hypot(t.clientX - i.x, t.clientY - i.y) < (i.touch ? 6 : 4)) {
|
|
2523
2523
|
let n = L.value.get(i.nodeId);
|
|
2524
|
-
n &&
|
|
2524
|
+
n && Ie.value && n.selectable !== !1 && z({
|
|
2525
2525
|
nodes: [n.id],
|
|
2526
2526
|
edges: []
|
|
2527
|
-
}), n &&
|
|
2527
|
+
}), n && w("node-click", n, t), w("connect-end", {
|
|
2528
2528
|
connection: null,
|
|
2529
2529
|
position: r,
|
|
2530
2530
|
from: e.from
|
|
2531
2531
|
});
|
|
2532
2532
|
return;
|
|
2533
2533
|
}
|
|
2534
|
-
let a = n?.valid ?
|
|
2534
|
+
let a = n?.valid ? Xr(e.from, n.nodeId, n.handleId) : null;
|
|
2535
2535
|
if (e.reconnect) {
|
|
2536
2536
|
let t = e.reconnect.edge;
|
|
2537
|
-
a ? (
|
|
2537
|
+
a ? (w("reconnect", {
|
|
2538
2538
|
edge: t,
|
|
2539
2539
|
connection: a
|
|
2540
|
-
}),
|
|
2540
|
+
}), C.autoConnect && In(t.id, {
|
|
2541
2541
|
source: a.source,
|
|
2542
2542
|
target: a.target,
|
|
2543
2543
|
sourceHandle: a.sourceHandle,
|
|
2544
2544
|
targetHandle: a.targetHandle,
|
|
2545
2545
|
route: void 0,
|
|
2546
2546
|
[e.reconnect.end === "source" ? "sourcePosition" : "targetPosition"]: void 0
|
|
2547
|
-
})) : e.moved && !n && t.deletable !== !1 &&
|
|
2547
|
+
})) : e.moved && !n && t.deletable !== !1 && Ln({ edges: [t.id] });
|
|
2548
2548
|
} else {
|
|
2549
2549
|
if (e.branch) {
|
|
2550
2550
|
let t = e.branch;
|
|
2551
|
-
if (
|
|
2551
|
+
if (w("branch", {
|
|
2552
2552
|
edge: t.edge,
|
|
2553
2553
|
connection: a,
|
|
2554
2554
|
position: t.at,
|
|
2555
2555
|
direction: t.direction,
|
|
2556
2556
|
end: r,
|
|
2557
|
-
routes:
|
|
2558
|
-
}),
|
|
2557
|
+
routes: Kr(t.edge, t.at, t.segment, t.direction)
|
|
2558
|
+
}), C.edgeBranching === "junction") return;
|
|
2559
2559
|
}
|
|
2560
|
-
if (a && (
|
|
2561
|
-
|
|
2562
|
-
...
|
|
2563
|
-
id:
|
|
2560
|
+
if (a && (w("connect", a), C.autoConnect)) {
|
|
2561
|
+
Nn({
|
|
2562
|
+
...C.defaultEdgeOptions,
|
|
2563
|
+
id: be("edge"),
|
|
2564
2564
|
...a
|
|
2565
2565
|
});
|
|
2566
2566
|
let e = L.value.get(a.source), t = L.value.get(a.target);
|
|
2567
|
-
e && t &&
|
|
2567
|
+
e && t && ye(h(E.flowConnected, {
|
|
2568
|
+
source: ni(e),
|
|
2569
|
+
target: ni(t)
|
|
2570
|
+
}, E.lang));
|
|
2568
2571
|
}
|
|
2569
|
-
|
|
2572
|
+
w("connect-end", {
|
|
2570
2573
|
connection: a,
|
|
2571
2574
|
position: r,
|
|
2572
2575
|
from: e.from
|
|
2573
2576
|
});
|
|
2574
2577
|
}
|
|
2575
2578
|
}
|
|
2576
|
-
let
|
|
2579
|
+
let ti = v(() => {
|
|
2577
2580
|
let e = $.value;
|
|
2578
2581
|
if (!e) return "";
|
|
2579
2582
|
let t = e.type === "target", n = {
|
|
@@ -2581,7 +2584,7 @@ var Se = [
|
|
|
2581
2584
|
bottom: "top",
|
|
2582
2585
|
left: "right",
|
|
2583
2586
|
right: "left"
|
|
2584
|
-
}, r =
|
|
2587
|
+
}, r = Vt(e.from.position, e.from, e.to, e.type), i = e.toPosition && e.toPosition !== "auto" ? e.toPosition : e.toPosition === "auto" ? Bt(e.to, e.from) : n[r], a = t ? {
|
|
2585
2588
|
sourceX: e.to.x,
|
|
2586
2589
|
sourceY: e.to.y,
|
|
2587
2590
|
sourcePosition: i,
|
|
@@ -2596,63 +2599,63 @@ var Se = [
|
|
|
2596
2599
|
targetY: e.to.y,
|
|
2597
2600
|
targetPosition: i
|
|
2598
2601
|
};
|
|
2599
|
-
return
|
|
2600
|
-
}),
|
|
2601
|
-
function
|
|
2602
|
+
return Gt(e.edgeType, a).path;
|
|
2603
|
+
}), ni = (e) => String(e.data?.label ?? e.id);
|
|
2604
|
+
function ri(e) {
|
|
2602
2605
|
return !!e?.closest?.("input, textarea, select, [contenteditable]:not([contenteditable=\"false\"])");
|
|
2603
2606
|
}
|
|
2604
|
-
function
|
|
2605
|
-
if (
|
|
2607
|
+
function ii(e) {
|
|
2608
|
+
if (ri(e.target)) return;
|
|
2606
2609
|
let t = e.ctrlKey || e.metaKey, n = e.key.toLowerCase();
|
|
2607
2610
|
if (e.key === "Escape") {
|
|
2608
|
-
if (X)
|
|
2609
|
-
else if (F.value.nodes.length || F.value.edges.length) z(
|
|
2611
|
+
if (X) br();
|
|
2612
|
+
else if (F.value.nodes.length || F.value.edges.length) z(ut());
|
|
2610
2613
|
else return;
|
|
2611
2614
|
e.preventDefault(), e.stopPropagation();
|
|
2612
2615
|
return;
|
|
2613
2616
|
}
|
|
2614
2617
|
if (t && n === "z" && !e.shiftKey) {
|
|
2615
|
-
e.preventDefault(),
|
|
2618
|
+
e.preventDefault(), ht();
|
|
2616
2619
|
return;
|
|
2617
2620
|
}
|
|
2618
2621
|
if (t && (n === "z" && e.shiftKey || n === "y")) {
|
|
2619
|
-
e.preventDefault(),
|
|
2622
|
+
e.preventDefault(), gt();
|
|
2620
2623
|
return;
|
|
2621
2624
|
}
|
|
2622
2625
|
if (t && n === "a") {
|
|
2623
|
-
e.preventDefault(),
|
|
2626
|
+
e.preventDefault(), Bn();
|
|
2624
2627
|
return;
|
|
2625
2628
|
}
|
|
2626
2629
|
if (t && n === "c") {
|
|
2627
|
-
|
|
2630
|
+
Hn();
|
|
2628
2631
|
return;
|
|
2629
2632
|
}
|
|
2630
2633
|
if (t && n === "x") {
|
|
2631
|
-
e.preventDefault(),
|
|
2634
|
+
e.preventDefault(), Un();
|
|
2632
2635
|
return;
|
|
2633
2636
|
}
|
|
2634
2637
|
if (t && n === "d") {
|
|
2635
|
-
e.preventDefault(),
|
|
2638
|
+
e.preventDefault(), Gn();
|
|
2636
2639
|
return;
|
|
2637
2640
|
}
|
|
2638
2641
|
if (t && n === "v") {
|
|
2639
|
-
e.preventDefault(),
|
|
2642
|
+
e.preventDefault(), Wn(Q.inside ? xn(Q) : void 0);
|
|
2640
2643
|
return;
|
|
2641
2644
|
}
|
|
2642
|
-
if (
|
|
2643
|
-
e.preventDefault(),
|
|
2645
|
+
if (C.deleteKeys?.includes(e.key)) {
|
|
2646
|
+
e.preventDefault(), zn();
|
|
2644
2647
|
return;
|
|
2645
2648
|
}
|
|
2646
2649
|
if (!t && (e.key === "+" || e.key === "=")) {
|
|
2647
|
-
e.preventDefault(),
|
|
2650
|
+
e.preventDefault(), Tn();
|
|
2648
2651
|
return;
|
|
2649
2652
|
}
|
|
2650
2653
|
if (!t && (e.key === "-" || e.key === "_")) {
|
|
2651
|
-
e.preventDefault(),
|
|
2654
|
+
e.preventDefault(), En();
|
|
2652
2655
|
return;
|
|
2653
2656
|
}
|
|
2654
2657
|
if (e.key === "!" || e.shiftKey && e.code === "Digit1") {
|
|
2655
|
-
e.preventDefault(),
|
|
2658
|
+
e.preventDefault(), An();
|
|
2656
2659
|
return;
|
|
2657
2660
|
}
|
|
2658
2661
|
let r = {
|
|
@@ -2661,11 +2664,11 @@ var Se = [
|
|
|
2661
2664
|
ArrowUp: [0, -1],
|
|
2662
2665
|
ArrowDown: [0, 1]
|
|
2663
2666
|
}[e.key];
|
|
2664
|
-
if (r && F.value.nodes.length &&
|
|
2667
|
+
if (r && F.value.nodes.length && Le.value) {
|
|
2665
2668
|
e.preventDefault();
|
|
2666
|
-
let t =
|
|
2669
|
+
let t = C.snapToGrid ? C.gridSize : e.shiftKey ? 50 : 10, n = F.value.nodes, i = new Set(n.filter((e) => L.value.get(e)?.draggable !== !1 && !Ee(e).some((e) => n.includes(e))));
|
|
2667
2670
|
if (!i.size) return;
|
|
2668
|
-
|
|
2671
|
+
bt = !0, B({ nodes: N.value.map((e) => i.has(e.id) ? {
|
|
2669
2672
|
...e,
|
|
2670
2673
|
position: {
|
|
2671
2674
|
x: e.position.x + r[0] * t,
|
|
@@ -2673,27 +2676,27 @@ var Se = [
|
|
|
2673
2676
|
}
|
|
2674
2677
|
} : e) }, { coalesce: `move:${[...i].join(",")}` });
|
|
2675
2678
|
let a = L.value.get([...i][0]);
|
|
2676
|
-
a &&
|
|
2677
|
-
} else r && !F.value.nodes.length && (e.preventDefault(),
|
|
2679
|
+
a && ye(h(E.flowMoved, { label: ni(a) }, E.lang));
|
|
2680
|
+
} else r && !F.value.nodes.length && (e.preventDefault(), _n({
|
|
2678
2681
|
x: J.value.x - r[0] * 40,
|
|
2679
2682
|
y: J.value.y - r[1] * 40,
|
|
2680
2683
|
zoom: J.value.zoom
|
|
2681
2684
|
}));
|
|
2682
2685
|
}
|
|
2683
|
-
function
|
|
2684
|
-
|
|
2686
|
+
function ai(e, t) {
|
|
2687
|
+
ri(e.target) || e.target.dataset.flowNode !== t || (e.key === "Enter" || e.key === " ") && Ie.value && (e.preventDefault(), e.shiftKey ? z({ nodes: je.value.has(t) ? F.value.nodes.filter((e) => e !== t) : [...F.value.nodes, t] }) : z({
|
|
2685
2688
|
nodes: [t],
|
|
2686
2689
|
edges: []
|
|
2687
2690
|
}));
|
|
2688
2691
|
}
|
|
2689
|
-
function
|
|
2690
|
-
(e.key === "Enter" || e.key === " ") &&
|
|
2692
|
+
function oi(e, t) {
|
|
2693
|
+
(e.key === "Enter" || e.key === " ") && Ie.value && (e.preventDefault(), z({
|
|
2691
2694
|
nodes: [],
|
|
2692
2695
|
edges: [t]
|
|
2693
2696
|
}));
|
|
2694
2697
|
}
|
|
2695
|
-
let
|
|
2696
|
-
let e =
|
|
2698
|
+
let si = `m3-flow-bg-${Math.random().toString(36).slice(2, 8)}`, ci = v(() => {
|
|
2699
|
+
let e = C.gridSize * J.value.zoom;
|
|
2697
2700
|
for (; e < 10;) e *= 2;
|
|
2698
2701
|
return {
|
|
2699
2702
|
gap: e,
|
|
@@ -2701,172 +2704,172 @@ var Se = [
|
|
|
2701
2704
|
y: (J.value.y % e + e) % e,
|
|
2702
2705
|
r: Math.max(.6, Math.min(1.4, J.value.zoom))
|
|
2703
2706
|
};
|
|
2704
|
-
}),
|
|
2705
|
-
nodes:
|
|
2706
|
-
edges:
|
|
2707
|
+
}), li = {
|
|
2708
|
+
nodes: v(() => N.value),
|
|
2709
|
+
edges: v(() => P.value),
|
|
2707
2710
|
viewport: J,
|
|
2708
|
-
minZoom:
|
|
2709
|
-
maxZoom:
|
|
2710
|
-
selection:
|
|
2711
|
+
minZoom: v(() => C.minZoom),
|
|
2712
|
+
maxZoom: v(() => C.maxZoom),
|
|
2713
|
+
selection: v(() => F.value),
|
|
2711
2714
|
size: M,
|
|
2712
2715
|
locked: I,
|
|
2713
|
-
getNode:
|
|
2716
|
+
getNode: we,
|
|
2714
2717
|
getAbsolutePosition: W,
|
|
2715
2718
|
getSize: K,
|
|
2716
|
-
getIntersectingNodes:
|
|
2717
|
-
getEdgeAt:
|
|
2718
|
-
screenToFlow:
|
|
2719
|
-
flowToScreen:
|
|
2720
|
-
setViewport:
|
|
2721
|
-
fitView:
|
|
2722
|
-
setCenter:
|
|
2723
|
-
zoomIn:
|
|
2724
|
-
zoomOut:
|
|
2725
|
-
zoomTo:
|
|
2726
|
-
addNodes:
|
|
2727
|
-
change:
|
|
2728
|
-
addEdges:
|
|
2729
|
-
updateNode:
|
|
2730
|
-
updateEdge:
|
|
2731
|
-
remove:
|
|
2719
|
+
getIntersectingNodes: Pr,
|
|
2720
|
+
getEdgeAt: Gr,
|
|
2721
|
+
screenToFlow: xn,
|
|
2722
|
+
flowToScreen: Sn,
|
|
2723
|
+
setViewport: vn,
|
|
2724
|
+
fitView: An,
|
|
2725
|
+
setCenter: On,
|
|
2726
|
+
zoomIn: Tn,
|
|
2727
|
+
zoomOut: En,
|
|
2728
|
+
zoomTo: Dn,
|
|
2729
|
+
addNodes: Mn,
|
|
2730
|
+
change: Pn,
|
|
2731
|
+
addEdges: Nn,
|
|
2732
|
+
updateNode: Fn,
|
|
2733
|
+
updateEdge: In,
|
|
2734
|
+
remove: Ln,
|
|
2732
2735
|
setSelection: z,
|
|
2733
|
-
layout: (e, t) =>
|
|
2734
|
-
undo:
|
|
2735
|
-
redo:
|
|
2736
|
-
canUndo:
|
|
2737
|
-
canRedo:
|
|
2738
|
-
copy:
|
|
2739
|
-
cut:
|
|
2740
|
-
paste:
|
|
2741
|
-
duplicate:
|
|
2736
|
+
layout: (e, t) => Jn(e, t),
|
|
2737
|
+
undo: ht,
|
|
2738
|
+
redo: gt,
|
|
2739
|
+
canUndo: _t,
|
|
2740
|
+
canRedo: vt,
|
|
2741
|
+
copy: Hn,
|
|
2742
|
+
cut: Un,
|
|
2743
|
+
paste: Wn,
|
|
2744
|
+
duplicate: Gn,
|
|
2742
2745
|
getEdgePath: (e) => {
|
|
2743
2746
|
let t = R.value.get(e);
|
|
2744
|
-
return (t &&
|
|
2747
|
+
return (t && tn(t)?.path) ?? null;
|
|
2745
2748
|
},
|
|
2746
|
-
startDrag:
|
|
2747
|
-
registerHandle:
|
|
2748
|
-
measureNode:
|
|
2749
|
-
startConnection:
|
|
2750
|
-
connectionTarget:
|
|
2751
|
-
connecting:
|
|
2752
|
-
insertEdge:
|
|
2753
|
-
branching:
|
|
2754
|
-
nodesConnectable:
|
|
2755
|
-
direction:
|
|
2756
|
-
registerNodeEl:
|
|
2757
|
-
selectedNodes:
|
|
2758
|
-
selectedEdges:
|
|
2759
|
-
dragging:
|
|
2760
|
-
isLifted:
|
|
2761
|
-
zIndexOf:
|
|
2762
|
-
edgeGeometry:
|
|
2763
|
-
isReconnectable:
|
|
2764
|
-
isReroutable:
|
|
2765
|
-
edgeCorners:
|
|
2766
|
-
sidePositions:
|
|
2767
|
-
onNodeKey:
|
|
2768
|
-
onEdgeKey:
|
|
2749
|
+
startDrag: jr,
|
|
2750
|
+
registerHandle: It,
|
|
2751
|
+
measureNode: Ft,
|
|
2752
|
+
startConnection: Hr,
|
|
2753
|
+
connectionTarget: er,
|
|
2754
|
+
connecting: tr,
|
|
2755
|
+
insertEdge: Fr,
|
|
2756
|
+
branching: Ne,
|
|
2757
|
+
nodesConnectable: Re,
|
|
2758
|
+
direction: v(() => C.direction),
|
|
2759
|
+
registerNodeEl: Lt,
|
|
2760
|
+
selectedNodes: je,
|
|
2761
|
+
selectedEdges: Me,
|
|
2762
|
+
dragging: yt,
|
|
2763
|
+
isLifted: dn,
|
|
2764
|
+
zIndexOf: fn,
|
|
2765
|
+
edgeGeometry: tn,
|
|
2766
|
+
isReconnectable: hn,
|
|
2767
|
+
isReroutable: on,
|
|
2768
|
+
edgeCorners: nn,
|
|
2769
|
+
sidePositions: Rt,
|
|
2770
|
+
onNodeKey: ai,
|
|
2771
|
+
onEdgeKey: oi
|
|
2769
2772
|
};
|
|
2770
|
-
|
|
2771
|
-
let
|
|
2772
|
-
return
|
|
2773
|
+
ie(_e, li);
|
|
2774
|
+
let ui;
|
|
2775
|
+
return re(async () => {
|
|
2773
2776
|
let e = D.value;
|
|
2774
|
-
e.addEventListener("wheel",
|
|
2777
|
+
e.addEventListener("wheel", Er, { passive: !1 });
|
|
2775
2778
|
let t = new ResizeObserver(() => {
|
|
2776
2779
|
M.value = {
|
|
2777
2780
|
width: e.clientWidth,
|
|
2778
2781
|
height: e.clientHeight
|
|
2779
2782
|
};
|
|
2780
2783
|
});
|
|
2781
|
-
t.observe(e),
|
|
2784
|
+
t.observe(e), ne(() => t.disconnect()), M.value = {
|
|
2782
2785
|
width: e.clientWidth,
|
|
2783
2786
|
height: e.clientHeight
|
|
2784
|
-
},
|
|
2787
|
+
}, ui = new ResizeObserver((e) => {
|
|
2785
2788
|
for (let t of e) {
|
|
2786
2789
|
let e = t.target.dataset.flowNode;
|
|
2787
|
-
e &&
|
|
2790
|
+
e && Nt(e);
|
|
2788
2791
|
}
|
|
2789
2792
|
});
|
|
2790
|
-
for (let [e, t] of
|
|
2791
|
-
await
|
|
2792
|
-
}),
|
|
2793
|
-
D.value?.removeEventListener("wheel",
|
|
2794
|
-
}), f(
|
|
2793
|
+
for (let [e, t] of jt) ui.observe(t), Nt(e);
|
|
2794
|
+
await te(), C.layout && await Jn(null, void 0, { history: !1 }), await te(), C.fitView && An({ animate: !1 }), ge.value = !0, w("init", li);
|
|
2795
|
+
}), ne(() => {
|
|
2796
|
+
D.value?.removeEventListener("wheel", Er), or(), ui?.disconnect(), U && cancelAnimationFrame(U), clearTimeout(fr), document.body.style.userSelect = "";
|
|
2797
|
+
}), f(li), (e, t) => (k(), x("div", ee({
|
|
2795
2798
|
ref_key: "root",
|
|
2796
2799
|
ref: D
|
|
2797
2800
|
}, e.$attrs, {
|
|
2798
|
-
class: ["m3-flow overflow-hidden bg-surface outline-none select-none", [
|
|
2801
|
+
class: ["m3-flow overflow-hidden bg-surface outline-none select-none", [rr.value && "cursor-grabbing", I.value && "m3-flow-locked"]],
|
|
2799
2802
|
tabindex: "0",
|
|
2800
2803
|
role: "application",
|
|
2801
|
-
"aria-label": l.label ?? j(
|
|
2804
|
+
"aria-label": l.label ?? j(E).flowCanvas,
|
|
2802
2805
|
"aria-roledescription": "flow",
|
|
2803
|
-
onPointerdown:
|
|
2806
|
+
onPointerdown: dr,
|
|
2804
2807
|
onPointerenter: t[0] ||= (e) => Q.inside = !0,
|
|
2805
2808
|
onPointerleave: t[1] ||= (e) => Q.inside = !1,
|
|
2806
|
-
onDblclick:
|
|
2807
|
-
onContextmenu:
|
|
2808
|
-
onKeydown:
|
|
2809
|
+
onDblclick: Dr,
|
|
2810
|
+
onContextmenu: Or,
|
|
2811
|
+
onKeydown: ii
|
|
2809
2812
|
}), [
|
|
2810
|
-
l.background === "none" ?
|
|
2811
|
-
id:
|
|
2812
|
-
x:
|
|
2813
|
-
y:
|
|
2814
|
-
width:
|
|
2815
|
-
height:
|
|
2813
|
+
l.background === "none" ? b("", !0) : (k(), x("svg", Je, [S("defs", null, [S("pattern", {
|
|
2814
|
+
id: si,
|
|
2815
|
+
x: ci.value.x,
|
|
2816
|
+
y: ci.value.y,
|
|
2817
|
+
width: ci.value.gap,
|
|
2818
|
+
height: ci.value.gap,
|
|
2816
2819
|
patternUnits: "userSpaceOnUse"
|
|
2817
|
-
}, [l.background === "dots" ? (k(),
|
|
2820
|
+
}, [l.background === "dots" ? (k(), x("circle", {
|
|
2818
2821
|
key: 0,
|
|
2819
|
-
cx:
|
|
2820
|
-
cy:
|
|
2821
|
-
r:
|
|
2822
|
+
cx: ci.value.r,
|
|
2823
|
+
cy: ci.value.r,
|
|
2824
|
+
r: ci.value.r,
|
|
2822
2825
|
class: "fill-outline-variant"
|
|
2823
|
-
}, null, 8,
|
|
2826
|
+
}, null, 8, Xe)) : (k(), x("path", {
|
|
2824
2827
|
key: 1,
|
|
2825
|
-
d: `M${
|
|
2828
|
+
d: `M${ci.value.gap} 0 L0 0 0 ${ci.value.gap}`,
|
|
2826
2829
|
fill: "none",
|
|
2827
2830
|
class: "stroke-outline-variant",
|
|
2828
2831
|
"stroke-width": "1"
|
|
2829
|
-
}, null, 8,
|
|
2832
|
+
}, null, 8, Ze))], 8, Ye)]), S("rect", {
|
|
2830
2833
|
width: "100%",
|
|
2831
2834
|
height: "100%",
|
|
2832
|
-
fill: `url(#${
|
|
2833
|
-
}, null, 8,
|
|
2834
|
-
|
|
2835
|
+
fill: `url(#${si})`
|
|
2836
|
+
}, null, 8, Qe)])),
|
|
2837
|
+
S("div", {
|
|
2835
2838
|
ref_key: "layer",
|
|
2836
|
-
ref:
|
|
2839
|
+
ref: pe,
|
|
2837
2840
|
class: "m3-flow-viewport absolute top-0 left-0 origin-top-left",
|
|
2838
2841
|
style: O({
|
|
2839
2842
|
transform: `translate(${J.value.x}px, ${J.value.y}px) scale(${J.value.zoom})`,
|
|
2840
|
-
visibility:
|
|
2843
|
+
visibility: ge.value ? void 0 : "hidden"
|
|
2841
2844
|
})
|
|
2842
2845
|
}, [
|
|
2843
|
-
(k(!0),
|
|
2846
|
+
(k(!0), x(g, null, oe(cn.value, (e) => (k(), y(Pe, {
|
|
2844
2847
|
key: e.id,
|
|
2845
2848
|
node: e,
|
|
2846
|
-
render:
|
|
2849
|
+
render: pn(e)
|
|
2847
2850
|
}, null, 8, ["node", "render"]))), 128)),
|
|
2848
|
-
(k(),
|
|
2851
|
+
(k(), x("svg", $e, [(k(!0), x(g, null, oe(un.value, (e) => (k(), y(He, {
|
|
2849
2852
|
key: e.id,
|
|
2850
2853
|
edge: e,
|
|
2851
|
-
render:
|
|
2852
|
-
}, null, 8, ["edge", "render"]))), 128)), $.value ? (k(),
|
|
2854
|
+
render: mn(e)
|
|
2855
|
+
}, null, 8, ["edge", "render"]))), 128)), $.value ? (k(), x("path", {
|
|
2853
2856
|
key: 0,
|
|
2854
2857
|
class: "m3-flow-connection-line fill-none stroke-primary",
|
|
2855
|
-
d:
|
|
2858
|
+
d: ti.value,
|
|
2856
2859
|
"stroke-width": "2",
|
|
2857
|
-
"stroke-dasharray":
|
|
2858
|
-
}, null, 8,
|
|
2859
|
-
|
|
2860
|
+
"stroke-dasharray": er.value?.valid ? void 0 : "6 4"
|
|
2861
|
+
}, null, 8, et)) : b("", !0)])),
|
|
2862
|
+
S("div", tt, [(k(!0), x(g, null, oe(un.value, (t) => (k(), x(g, { key: t.id }, [t.label || e.$slots["edge-label"] || Me.value.has(t.id) ? (k(), y(Ke, {
|
|
2860
2863
|
key: 0,
|
|
2861
2864
|
edge: t,
|
|
2862
2865
|
render: e.$slots["edge-label"]
|
|
2863
|
-
}, null, 8, ["edge", "render"])) :
|
|
2864
|
-
(k(!0),
|
|
2866
|
+
}, null, 8, ["edge", "render"])) : b("", !0)], 64))), 128))]),
|
|
2867
|
+
(k(!0), x(g, null, oe(ln.value, (e) => (k(), y(Pe, {
|
|
2865
2868
|
key: e.id,
|
|
2866
2869
|
node: e,
|
|
2867
|
-
render:
|
|
2870
|
+
render: pn(e)
|
|
2868
2871
|
}, null, 8, ["node", "render"]))), 128)),
|
|
2869
|
-
|
|
2872
|
+
nr.value.length ? (k(), x("svg", nt, [(k(!0), x(g, null, oe(nr.value, (e, t) => (k(), x("line", {
|
|
2870
2873
|
key: t,
|
|
2871
2874
|
class: "stroke-primary",
|
|
2872
2875
|
"stroke-width": "1",
|
|
@@ -2875,24 +2878,24 @@ var Se = [
|
|
|
2875
2878
|
x2: e.x ?? e.to,
|
|
2876
2879
|
y1: e.y ?? e.from,
|
|
2877
2880
|
y2: e.y ?? e.to
|
|
2878
|
-
}, null, 8,
|
|
2881
|
+
}, null, 8, rt))), 128))])) : b("", !0)
|
|
2879
2882
|
], 4),
|
|
2880
|
-
|
|
2883
|
+
$n.value ? (k(), x("div", {
|
|
2881
2884
|
key: 1,
|
|
2882
2885
|
class: "m3-flow-marquee pointer-events-none absolute rounded-xs border border-primary bg-primary/8",
|
|
2883
2886
|
style: O({
|
|
2884
|
-
left: `${
|
|
2885
|
-
top: `${
|
|
2886
|
-
width: `${
|
|
2887
|
-
height: `${
|
|
2887
|
+
left: `${$n.value.x}px`,
|
|
2888
|
+
top: `${$n.value.y}px`,
|
|
2889
|
+
width: `${$n.value.width}px`,
|
|
2890
|
+
height: `${$n.value.height}px`
|
|
2888
2891
|
})
|
|
2889
|
-
}, null, 4)) :
|
|
2890
|
-
!N.value.length && e.$slots.empty ? (k(),
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
], 16,
|
|
2892
|
+
}, null, 4)) : b("", !0),
|
|
2893
|
+
!N.value.length && e.$slots.empty ? (k(), x("div", it, [S("div", at, [se(e.$slots, "empty")])])) : b("", !0),
|
|
2894
|
+
se(e.$slots, "default", { flow: li }),
|
|
2895
|
+
S("div", ot, ue(ve.value), 1)
|
|
2896
|
+
], 16, qe));
|
|
2894
2897
|
}
|
|
2895
|
-
}),
|
|
2898
|
+
}), ft = {
|
|
2896
2899
|
"top-left": "top-0 left-0",
|
|
2897
2900
|
"top-center": "top-0 left-1/2 -translate-x-1/2",
|
|
2898
2901
|
"top-right": "top-0 right-0",
|
|
@@ -2901,7 +2904,7 @@ var Se = [
|
|
|
2901
2904
|
"bottom-right": "bottom-0 right-0",
|
|
2902
2905
|
"center-left": "top-1/2 left-0 -translate-y-1/2",
|
|
2903
2906
|
"center-right": "top-1/2 right-0 -translate-y-1/2"
|
|
2904
|
-
},
|
|
2907
|
+
}, pt = ["aria-orientation"], B = /* @__PURE__ */ T({
|
|
2905
2908
|
__name: "MFlowControls",
|
|
2906
2909
|
props: {
|
|
2907
2910
|
position: { default: "bottom-left" },
|
|
@@ -2928,82 +2931,82 @@ var Se = [
|
|
|
2928
2931
|
}
|
|
2929
2932
|
},
|
|
2930
2933
|
setup(e) {
|
|
2931
|
-
let t = e, n =
|
|
2934
|
+
let t = e, n = ye(), r = m(), i = v(() => t.orientation === "vertical"), a = v(() => {
|
|
2932
2935
|
let e = n.selection.value;
|
|
2933
2936
|
return {
|
|
2934
2937
|
nodes: e.nodes.filter((e) => n.getNode(e)?.deletable !== !1),
|
|
2935
2938
|
edges: e.edges.filter((e) => n.edges.value.find((t) => t.id === e)?.deletable !== !1)
|
|
2936
2939
|
};
|
|
2937
|
-
}), o =
|
|
2938
|
-
return (t, s) => (k(),
|
|
2939
|
-
class: D(["m3-flow-controls absolute z-20 m-4 flex gap-1 rounded-full bg-surface-container p-1 shadow-elevation-3", [j(
|
|
2940
|
+
}), o = v(() => t.delete && !n.locked.value && a.value.nodes.length + a.value.edges.length > 0);
|
|
2941
|
+
return (t, s) => (k(), x("div", {
|
|
2942
|
+
class: D(["m3-flow-controls absolute z-20 m-4 flex gap-1 rounded-full bg-surface-container p-1 shadow-elevation-3", [j(ft)[e.position], i.value ? "flex-col" : "flex-row"]]),
|
|
2940
2943
|
role: "toolbar",
|
|
2941
2944
|
"aria-orientation": e.orientation
|
|
2942
2945
|
}, [
|
|
2943
|
-
e.zoom ? (k(),
|
|
2946
|
+
e.zoom ? (k(), x(g, { key: 0 }, [w(f, {
|
|
2944
2947
|
icon: "add",
|
|
2945
2948
|
label: j(r).flowZoomIn,
|
|
2946
2949
|
disabled: j(n).viewport.value.zoom >= j(n).maxZoom.value - .001,
|
|
2947
2950
|
onClick: s[0] ||= (e) => j(n).zoomIn()
|
|
2948
|
-
}, null, 8, ["label", "disabled"]),
|
|
2951
|
+
}, null, 8, ["label", "disabled"]), w(f, {
|
|
2949
2952
|
icon: "remove",
|
|
2950
2953
|
label: j(r).flowZoomOut,
|
|
2951
2954
|
disabled: j(n).viewport.value.zoom <= j(n).minZoom.value + .001,
|
|
2952
2955
|
onClick: s[1] ||= (e) => j(n).zoomOut()
|
|
2953
|
-
}, null, 8, ["label", "disabled"])], 64)) :
|
|
2954
|
-
e.fit ? (k(),
|
|
2956
|
+
}, null, 8, ["label", "disabled"])], 64)) : b("", !0),
|
|
2957
|
+
e.fit ? (k(), y(f, {
|
|
2955
2958
|
key: 1,
|
|
2956
2959
|
icon: "fit_screen",
|
|
2957
2960
|
label: j(r).flowFitView,
|
|
2958
2961
|
onClick: s[2] ||= (e) => j(n).fitView()
|
|
2959
|
-
}, null, 8, ["label"])) :
|
|
2960
|
-
e.history ? (k(),
|
|
2962
|
+
}, null, 8, ["label"])) : b("", !0),
|
|
2963
|
+
e.history ? (k(), x(g, { key: 2 }, [w(f, {
|
|
2961
2964
|
icon: "undo",
|
|
2962
2965
|
label: j(r).flowUndo,
|
|
2963
2966
|
disabled: !j(n).canUndo.value,
|
|
2964
2967
|
onClick: s[3] ||= (e) => j(n).undo()
|
|
2965
|
-
}, null, 8, ["label", "disabled"]),
|
|
2968
|
+
}, null, 8, ["label", "disabled"]), w(f, {
|
|
2966
2969
|
icon: "redo",
|
|
2967
2970
|
label: j(r).flowRedo,
|
|
2968
2971
|
disabled: !j(n).canRedo.value,
|
|
2969
2972
|
onClick: s[4] ||= (e) => j(n).redo()
|
|
2970
|
-
}, null, 8, ["label", "disabled"])], 64)) :
|
|
2971
|
-
|
|
2972
|
-
default:
|
|
2973
|
+
}, null, 8, ["label", "disabled"])], 64)) : b("", !0),
|
|
2974
|
+
w(_, { name: i.value ? "m3-flow-ctl-v" : "m3-flow-ctl-h" }, {
|
|
2975
|
+
default: he(() => [o.value ? (k(), y(f, {
|
|
2973
2976
|
key: 0,
|
|
2974
2977
|
icon: "delete",
|
|
2975
2978
|
label: j(r).flowDelete,
|
|
2976
2979
|
color: "error",
|
|
2977
2980
|
onClick: s[5] ||= (e) => j(n).remove(a.value)
|
|
2978
|
-
}, null, 8, ["label"])) :
|
|
2981
|
+
}, null, 8, ["label"])) : b("", !0)]),
|
|
2979
2982
|
_: 1
|
|
2980
2983
|
}, 8, ["name"]),
|
|
2981
|
-
e.lock ? (k(),
|
|
2984
|
+
e.lock ? (k(), y(f, {
|
|
2982
2985
|
key: 3,
|
|
2983
2986
|
icon: j(n).locked.value ? "lock" : "lock_open",
|
|
2984
2987
|
label: j(n).locked.value ? j(r).flowUnlock : j(r).flowLock,
|
|
2985
2988
|
onClick: s[6] ||= (e) => j(n).locked.value = !j(n).locked.value
|
|
2986
|
-
}, null, 8, ["icon", "label"])) :
|
|
2987
|
-
|
|
2988
|
-
], 10,
|
|
2989
|
+
}, null, 8, ["icon", "label"])) : b("", !0),
|
|
2990
|
+
se(t.$slots, "default")
|
|
2991
|
+
], 10, pt));
|
|
2989
2992
|
}
|
|
2990
|
-
}),
|
|
2993
|
+
}), mt = [
|
|
2991
2994
|
"width",
|
|
2992
2995
|
"height",
|
|
2993
2996
|
"viewBox",
|
|
2994
2997
|
"aria-label"
|
|
2995
|
-
],
|
|
2998
|
+
], ht = [
|
|
2996
2999
|
"x",
|
|
2997
3000
|
"y",
|
|
2998
3001
|
"width",
|
|
2999
3002
|
"height",
|
|
3000
3003
|
"rx"
|
|
3001
|
-
],
|
|
3004
|
+
], gt = ["d"], _t = [
|
|
3002
3005
|
"x",
|
|
3003
3006
|
"y",
|
|
3004
3007
|
"width",
|
|
3005
3008
|
"height"
|
|
3006
|
-
],
|
|
3009
|
+
], vt = /* @__PURE__ */ T({
|
|
3007
3010
|
__name: "MFlowMinimap",
|
|
3008
3011
|
props: {
|
|
3009
3012
|
position: { default: "bottom-right" },
|
|
@@ -3020,11 +3023,11 @@ var Se = [
|
|
|
3020
3023
|
}
|
|
3021
3024
|
},
|
|
3022
3025
|
setup(e) {
|
|
3023
|
-
let t = e, n =
|
|
3026
|
+
let t = e, n = ye(), r = m(), i = A(), a = v(() => n.nodes.value.filter((e) => !e.hidden).map((e) => ({
|
|
3024
3027
|
node: e,
|
|
3025
3028
|
...n.getAbsolutePosition(e.id),
|
|
3026
3029
|
...n.getSize(e.id)
|
|
3027
|
-
})).filter((e) => e.width > 0 && e.height > 0)), o =
|
|
3030
|
+
})).filter((e) => e.width > 0 && e.height > 0)), o = v(() => {
|
|
3028
3031
|
let e = n.viewport.value, t = n.size.value;
|
|
3029
3032
|
return {
|
|
3030
3033
|
x: -e.x / e.zoom,
|
|
@@ -3032,7 +3035,7 @@ var Se = [
|
|
|
3032
3035
|
width: t.width / e.zoom,
|
|
3033
3036
|
height: t.height / e.zoom
|
|
3034
3037
|
};
|
|
3035
|
-
}), s = null, c =
|
|
3038
|
+
}), s = null, c = v(() => {
|
|
3036
3039
|
if (s) return s;
|
|
3037
3040
|
let e = o.value.x, n = o.value.y, r = e + o.value.width, i = n + o.value.height;
|
|
3038
3041
|
for (let t of a.value) e = Math.min(e, t.x), n = Math.min(n, t.y), r = Math.max(r, t.x + t.width), i = Math.max(i, t.y + t.height);
|
|
@@ -3043,7 +3046,7 @@ var Se = [
|
|
|
3043
3046
|
width: d,
|
|
3044
3047
|
height: f
|
|
3045
3048
|
};
|
|
3046
|
-
}), l =
|
|
3049
|
+
}), l = v(() => {
|
|
3047
3050
|
let e = c.value, t = o.value;
|
|
3048
3051
|
return `M${e.x},${e.y}h${e.width}v${e.height}h${-e.width}Z M${t.x},${t.y}v${t.height}h${t.width}v${-t.height}Z`;
|
|
3049
3052
|
});
|
|
@@ -3068,13 +3071,13 @@ var Se = [
|
|
|
3068
3071
|
function p() {
|
|
3069
3072
|
s = null;
|
|
3070
3073
|
}
|
|
3071
|
-
function
|
|
3074
|
+
function h(e) {
|
|
3072
3075
|
t.zoomable && n.zoomTo(n.viewport.value.zoom * Math.exp(-Math.max(-50, Math.min(50, e.deltaY)) * .01), { animate: !1 });
|
|
3073
3076
|
}
|
|
3074
|
-
return (t, s) => (k(),
|
|
3075
|
-
class: D(["m3-flow-minimap absolute z-20 m-4 overflow-hidden rounded-lg bg-surface-container shadow-elevation-3", j(
|
|
3076
|
-
onWheel:
|
|
3077
|
-
}, [(k(),
|
|
3077
|
+
return (t, s) => (k(), x("div", {
|
|
3078
|
+
class: D(["m3-flow-minimap absolute z-20 m-4 overflow-hidden rounded-lg bg-surface-container shadow-elevation-3", j(ft)[e.position]]),
|
|
3079
|
+
onWheel: ge(h, ["stop", "prevent"])
|
|
3080
|
+
}, [(k(), x("svg", {
|
|
3078
3081
|
ref_key: "svg",
|
|
3079
3082
|
ref: i,
|
|
3080
3083
|
width: e.width,
|
|
@@ -3088,7 +3091,7 @@ var Se = [
|
|
|
3088
3091
|
onPointerup: p,
|
|
3089
3092
|
onPointercancel: p
|
|
3090
3093
|
}, [
|
|
3091
|
-
(k(!0),
|
|
3094
|
+
(k(!0), x(g, null, oe(a.value, (t) => (k(), x("rect", {
|
|
3092
3095
|
key: t.node.id,
|
|
3093
3096
|
x: t.x,
|
|
3094
3097
|
y: t.y,
|
|
@@ -3098,13 +3101,13 @@ var Se = [
|
|
|
3098
3101
|
class: D(t.node.type === "group" ? "fill-none stroke-outline-variant" : !e.nodeColor?.(t.node) && (j(n).selection.value.nodes.includes(t.node.id) ? "fill-primary" : "fill-outline-variant")),
|
|
3099
3102
|
style: O(t.node.type !== "group" && e.nodeColor?.(t.node) ? { fill: e.nodeColor(t.node) } : void 0),
|
|
3100
3103
|
"vector-effect": "non-scaling-stroke"
|
|
3101
|
-
}, null, 14,
|
|
3102
|
-
|
|
3104
|
+
}, null, 14, ht))), 128)),
|
|
3105
|
+
S("path", {
|
|
3103
3106
|
d: l.value,
|
|
3104
3107
|
"fill-rule": "evenodd",
|
|
3105
3108
|
class: "fill-on-surface/8"
|
|
3106
|
-
}, null, 8,
|
|
3107
|
-
|
|
3109
|
+
}, null, 8, gt),
|
|
3110
|
+
S("rect", {
|
|
3108
3111
|
x: o.value.x,
|
|
3109
3112
|
y: o.value.y,
|
|
3110
3113
|
width: o.value.width,
|
|
@@ -3113,8 +3116,8 @@ var Se = [
|
|
|
3113
3116
|
class: "stroke-primary",
|
|
3114
3117
|
"stroke-width": "1.5",
|
|
3115
3118
|
"vector-effect": "non-scaling-stroke"
|
|
3116
|
-
}, null, 8,
|
|
3117
|
-
], 42,
|
|
3119
|
+
}, null, 8, _t)
|
|
3120
|
+
], 42, mt))], 34));
|
|
3118
3121
|
}
|
|
3119
3122
|
}), V = /* @__PURE__ */ new Set([
|
|
3120
3123
|
"primary",
|
|
@@ -3128,20 +3131,20 @@ var Se = [
|
|
|
3128
3131
|
"success",
|
|
3129
3132
|
"on-surface",
|
|
3130
3133
|
"on-surface-variant"
|
|
3131
|
-
]), H = 24,
|
|
3132
|
-
function
|
|
3134
|
+
]), H = 24, yt = 36, bt = 56;
|
|
3135
|
+
function xt(e) {
|
|
3133
3136
|
return e === "horizontal" ? "LR" : e === "vertical" || !e ? "TB" : e;
|
|
3134
3137
|
}
|
|
3135
|
-
function
|
|
3138
|
+
function St(e) {
|
|
3136
3139
|
return e === "LR" || e === "RL" ? "horizontal" : "vertical";
|
|
3137
3140
|
}
|
|
3138
|
-
function
|
|
3141
|
+
function Ct(e) {
|
|
3139
3142
|
if (e.width && e.height) return {
|
|
3140
3143
|
width: e.width,
|
|
3141
3144
|
height: e.height
|
|
3142
3145
|
};
|
|
3143
3146
|
if (e.type === "circle") {
|
|
3144
|
-
let t = e.data?.size ??
|
|
3147
|
+
let t = e.data?.size ?? bt;
|
|
3145
3148
|
return {
|
|
3146
3149
|
width: t,
|
|
3147
3150
|
height: t
|
|
@@ -3153,13 +3156,13 @@ function St(e) {
|
|
|
3153
3156
|
height: 36 + t.reduce((e, t) => e + Math.max(1, Math.ceil(t.length * 8 / (r - 40))), 0) * 20
|
|
3154
3157
|
};
|
|
3155
3158
|
}
|
|
3156
|
-
function
|
|
3159
|
+
function wt(e, t, n, r) {
|
|
3157
3160
|
let i = new Map(e.map((e) => [e.id, e])), a = /* @__PURE__ */ new Map();
|
|
3158
3161
|
for (let t of e) {
|
|
3159
3162
|
let e = t.parentId && i.has(t.parentId) ? t.parentId : void 0;
|
|
3160
3163
|
a.has(e) || a.set(e, []), a.get(e).push(t);
|
|
3161
3164
|
}
|
|
3162
|
-
let o = r.sizes instanceof Map ? r.sizes : new Map(Object.entries(r.sizes ?? {})), s = /* @__PURE__ */ new Map(), c = n === "tree" ?
|
|
3165
|
+
let o = r.sizes instanceof Map ? r.sizes : new Map(Object.entries(r.sizes ?? {})), s = /* @__PURE__ */ new Map(), c = n === "tree" ? xe : Se, l = (e, t) => {
|
|
3163
3166
|
let n = i.get(e);
|
|
3164
3167
|
for (let e = 0; n && e < 100; e++) {
|
|
3165
3168
|
let e = n.parentId && i.has(n.parentId) ? n.parentId : void 0;
|
|
@@ -3172,9 +3175,9 @@ function Ct(e, t, n, r) {
|
|
|
3172
3175
|
let t = u(e.id);
|
|
3173
3176
|
s.set(e.id, {
|
|
3174
3177
|
width: Math.max(200, t.width + 48),
|
|
3175
|
-
height: Math.max(120, t.height +
|
|
3178
|
+
height: Math.max(120, t.height + yt + H)
|
|
3176
3179
|
});
|
|
3177
|
-
} else s.set(e.id, o.get(e.id) ??
|
|
3180
|
+
} else s.set(e.id, o.get(e.id) ?? Ct(e));
|
|
3178
3181
|
let i = n.map((e) => ({
|
|
3179
3182
|
...e,
|
|
3180
3183
|
parentId: void 0
|
|
@@ -3202,7 +3205,7 @@ function Ct(e, t, n, r) {
|
|
|
3202
3205
|
width: 0,
|
|
3203
3206
|
height: 0
|
|
3204
3207
|
};
|
|
3205
|
-
let _ = e === void 0 ? -p : H - p, v = e === void 0 ? -m :
|
|
3208
|
+
let _ = e === void 0 ? -p : H - p, v = e === void 0 ? -m : yt - m;
|
|
3206
3209
|
for (let e of n) {
|
|
3207
3210
|
let t = f[e.id] ?? {
|
|
3208
3211
|
x: 0,
|
|
@@ -3220,8 +3223,8 @@ function Ct(e, t, n, r) {
|
|
|
3220
3223
|
};
|
|
3221
3224
|
u(void 0);
|
|
3222
3225
|
}
|
|
3223
|
-
function
|
|
3224
|
-
return n || t.layout === !1 ||
|
|
3226
|
+
function Tt(e, t, n) {
|
|
3227
|
+
return n || t.layout === !1 || wt(e.nodes, e.edges, t.layout ?? "layered", {
|
|
3225
3228
|
direction: e.rankdir,
|
|
3226
3229
|
...t.layoutOptions
|
|
3227
3230
|
}), e;
|
|
@@ -3232,7 +3235,7 @@ var U = class extends SyntaxError {
|
|
|
3232
3235
|
super(`${e} (line ${r.length}, column ${r.at(-1).length + 1})`);
|
|
3233
3236
|
}
|
|
3234
3237
|
};
|
|
3235
|
-
function
|
|
3238
|
+
function Et(e) {
|
|
3236
3239
|
let t = [], n = 0, r = e.length;
|
|
3237
3240
|
for (; n < r;) {
|
|
3238
3241
|
let i = e[n];
|
|
@@ -3339,10 +3342,10 @@ function Tt(e) {
|
|
|
3339
3342
|
}
|
|
3340
3343
|
return t;
|
|
3341
3344
|
}
|
|
3342
|
-
function
|
|
3345
|
+
function Dt(e) {
|
|
3343
3346
|
return e.replace(/<br\s*\/?>/gi, "\n").replace(/<[^>]*>/g, "").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, "\"").replace(/'|'/g, "'").replace(/ /g, " ").replace(/&/g, "&").trim();
|
|
3344
3347
|
}
|
|
3345
|
-
function
|
|
3348
|
+
function Ot(e, t, n) {
|
|
3346
3349
|
return e.replace(/\\N/g, t).replace(/\\G/g, n).replace(/\\[nlr]/g, "\n").replace(/\\(.)/g, "$1").replace(/\n$/, "");
|
|
3347
3350
|
}
|
|
3348
3351
|
function W(e) {
|
|
@@ -3350,12 +3353,12 @@ function W(e) {
|
|
|
3350
3353
|
let t = e.split(":")[0].split(";")[0].trim().replace(/^\/[^/]*\//, "");
|
|
3351
3354
|
return /^#[0-9a-f]{6}([0-9a-f]{2})?$/i.test(t) ? t.slice(0, 7) + (t.length > 7 ? t.slice(7) : "") : /^[a-z]+$/i.test(t) ? t.toLowerCase() : void 0;
|
|
3352
3355
|
}
|
|
3353
|
-
function
|
|
3356
|
+
function kt(e, t) {
|
|
3354
3357
|
let n = e.dir ?? (t ? "forward" : "none"), r = (e) => e === "none" ? "none" : e && /vee|open|empty|normal-o|o/.test(e) && e !== "normal" ? "arrow" : "arrow-closed", i = n === "forward" || n === "both" ? r(e.arrowhead) : "none", a = n === "back" || n === "both" ? r(e.arrowtail) : "none", o = {};
|
|
3355
3358
|
return i !== "arrow-closed" && (o.markerEnd = i), a !== "none" && (o.markerStart = a), o;
|
|
3356
3359
|
}
|
|
3357
|
-
function
|
|
3358
|
-
let n =
|
|
3360
|
+
function At(e, t = {}) {
|
|
3361
|
+
let n = Et(e), r = 0, i = (e = 0) => n[r + e], a = (e, t = 0) => {
|
|
3359
3362
|
let n = i(t);
|
|
3360
3363
|
return !!n && n.t === "p" && n.v === e;
|
|
3361
3364
|
}, o = (e, t = 0) => {
|
|
@@ -3365,7 +3368,7 @@ function kt(e, t = {}) {
|
|
|
3365
3368
|
throw new U(t, e, i()?.at ?? e.length);
|
|
3366
3369
|
}, c = (e) => a(e) ? n[r++] : s(`Expected "${e}"`), l = () => {
|
|
3367
3370
|
let e = i();
|
|
3368
|
-
return !e || e.t !== "id" ? s("Expected an id") : (r++, e.html ?
|
|
3371
|
+
return !e || e.t !== "id" ? s("Expected an id") : (r++, e.html ? Dt(e.v) : e.v);
|
|
3369
3372
|
}, u = !1;
|
|
3370
3373
|
o("strict") && (u = !0, r++);
|
|
3371
3374
|
let d;
|
|
@@ -3425,8 +3428,8 @@ function kt(e, t = {}) {
|
|
|
3425
3428
|
}
|
|
3426
3429
|
return c("{"), T(n), c("}"), n;
|
|
3427
3430
|
}, T = (e) => {
|
|
3428
|
-
for (; i() && !a("}");)
|
|
3429
|
-
},
|
|
3431
|
+
for (; i() && !a("}");) E(e), (a(";") || a(",")) && r++;
|
|
3432
|
+
}, E = (e) => {
|
|
3430
3433
|
if ((o("graph") || o("node") || o("edge")) && a("[", 1)) {
|
|
3431
3434
|
let t = i().v.toLowerCase();
|
|
3432
3435
|
r++, Object.assign(e[t], b());
|
|
@@ -3458,34 +3461,34 @@ function kt(e, t = {}) {
|
|
|
3458
3461
|
if (u && v.has(a)) continue;
|
|
3459
3462
|
v.add(a);
|
|
3460
3463
|
let o = { ...c };
|
|
3461
|
-
n.port && (o.tailport = n.port), r.port && (o.headport = r.port), g.push(
|
|
3464
|
+
n.port && (o.tailport = n.port), r.port && (o.headport = r.port), g.push(jt(e, i, o, g.length, d, t));
|
|
3462
3465
|
}
|
|
3463
3466
|
}
|
|
3464
|
-
},
|
|
3467
|
+
}, ee = {
|
|
3465
3468
|
node: {},
|
|
3466
3469
|
edge: {},
|
|
3467
3470
|
graph: {},
|
|
3468
3471
|
members: /* @__PURE__ */ new Set()
|
|
3469
3472
|
};
|
|
3470
|
-
c("{"), T(
|
|
3471
|
-
let
|
|
3473
|
+
c("{"), T(ee), c("}"), i() && s("Unexpected text after the graph");
|
|
3474
|
+
let te = /* @__PURE__ */ new Set();
|
|
3472
3475
|
for (let e of g) {
|
|
3473
|
-
for (;
|
|
3474
|
-
|
|
3476
|
+
for (; te.has(e.id);) e.id = `${e.id}_`;
|
|
3477
|
+
te.add(e.id);
|
|
3475
3478
|
}
|
|
3476
|
-
let
|
|
3479
|
+
let D = p.some((e) => e.type !== "group");
|
|
3477
3480
|
for (let e of p) {
|
|
3478
3481
|
if (e.type === "group") {
|
|
3479
3482
|
let t = _.get(e.id);
|
|
3480
3483
|
e.data = {
|
|
3481
|
-
label: t.label === void 0 ? void 0 :
|
|
3484
|
+
label: t.label === void 0 ? void 0 : Ot(t.label, e.id, f ?? ""),
|
|
3482
3485
|
attrs: { ...t }
|
|
3483
3486
|
};
|
|
3484
3487
|
continue;
|
|
3485
3488
|
}
|
|
3486
3489
|
let n = m.get(e.id), r = h.get(e.id);
|
|
3487
3490
|
r && (e.parentId = r);
|
|
3488
|
-
let i = n.label === void 0 ? e.id :
|
|
3491
|
+
let i = n.label === void 0 ? e.id : Ot(n.label, e.id, f ?? ""), a = n.shape?.toLowerCase();
|
|
3489
3492
|
a === "circle" || a === "doublecircle" || a === "point" || a === "mcircle" ? (e.type = "circle", e.data = {
|
|
3490
3493
|
label: a === "point" ? "" : i,
|
|
3491
3494
|
...a === "doublecircle" ? { ring: "primary" } : {},
|
|
@@ -3496,46 +3499,46 @@ function kt(e, t = {}) {
|
|
|
3496
3499
|
}), /\binvis\b/.test(n.style ?? "") && (e.hidden = !0);
|
|
3497
3500
|
let o = /^\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)/.exec(n.pos ?? "");
|
|
3498
3501
|
if (o) {
|
|
3499
|
-
let t =
|
|
3502
|
+
let t = Ct(e);
|
|
3500
3503
|
e.position = {
|
|
3501
3504
|
x: Number(o[1]) * 4 / 3 - t.width / 2,
|
|
3502
3505
|
y: -Number(o[2]) * 4 / 3 - t.height / 2
|
|
3503
3506
|
};
|
|
3504
|
-
} else
|
|
3507
|
+
} else D = !1;
|
|
3505
3508
|
}
|
|
3506
|
-
if (
|
|
3509
|
+
if (D) {
|
|
3507
3510
|
let e = p.filter((e) => e.type !== "group"), t = Math.min(...e.map((e) => e.position.x)), n = Math.min(...e.map((e) => e.position.y));
|
|
3508
3511
|
for (let r of e) r.position = {
|
|
3509
3512
|
x: Math.round(r.position.x - t),
|
|
3510
3513
|
y: Math.round(r.position.y - n)
|
|
3511
3514
|
};
|
|
3512
|
-
p.some((e) => e.type === "group") &&
|
|
3515
|
+
p.some((e) => e.type === "group") && wt(p.filter((e) => e.type === "group" || e.parentId), [], "layered", {});
|
|
3513
3516
|
}
|
|
3514
|
-
let
|
|
3515
|
-
return
|
|
3517
|
+
let O = (ee.graph.rankdir ?? "").toUpperCase(), ne = O === "LR" || O === "RL" || O === "BT" ? O : "TB";
|
|
3518
|
+
return Tt({
|
|
3516
3519
|
nodes: p,
|
|
3517
3520
|
edges: g,
|
|
3518
3521
|
rankdir: ne,
|
|
3519
|
-
direction:
|
|
3522
|
+
direction: St(ne),
|
|
3520
3523
|
directed: d,
|
|
3521
|
-
attrs: { ...
|
|
3524
|
+
attrs: { ...ee.graph },
|
|
3522
3525
|
...f === void 0 ? {} : { name: f },
|
|
3523
|
-
...
|
|
3524
|
-
}, t,
|
|
3526
|
+
...ee.graph.label === void 0 ? {} : { label: Ot(ee.graph.label, "", f ?? "") }
|
|
3527
|
+
}, t, D && !p.some((e) => e.type === "group"));
|
|
3525
3528
|
}
|
|
3526
|
-
function
|
|
3529
|
+
function jt(e, t, n, r, i, a) {
|
|
3527
3530
|
let o = {
|
|
3528
3531
|
id: n.id ?? `e${r + 1}`,
|
|
3529
3532
|
source: e,
|
|
3530
3533
|
target: t
|
|
3531
3534
|
};
|
|
3532
|
-
a.edgeType && (o.type = a.edgeType), n.label !== void 0 && (o.label =
|
|
3535
|
+
a.edgeType && (o.type = a.edgeType), n.label !== void 0 && (o.label = Ot(n.label, "", ""));
|
|
3533
3536
|
let s = n.style ?? "";
|
|
3534
3537
|
/\b(dashed|dotted)\b/.test(s) && (o.dashed = !0), /\binvis\b/.test(s) && (o.hidden = !0);
|
|
3535
3538
|
let c = W(n.color);
|
|
3536
|
-
return c && (o.color = c), n.penwidth && Number(n.penwidth) > 0 ? o.width = Number(n.penwidth) * 2 : /\bbold\b/.test(s) && (o.width = 4), Object.assign(o,
|
|
3539
|
+
return c && (o.color = c), n.penwidth && Number(n.penwidth) > 0 ? o.width = Number(n.penwidth) * 2 : /\bbold\b/.test(s) && (o.width = 4), Object.assign(o, kt(n, i)), o.data = { attrs: n }, o;
|
|
3537
3540
|
}
|
|
3538
|
-
var
|
|
3541
|
+
var Mt = /* @__PURE__ */ new Set([
|
|
3539
3542
|
"strict",
|
|
3540
3543
|
"graph",
|
|
3541
3544
|
"digraph",
|
|
@@ -3544,18 +3547,18 @@ var jt = /* @__PURE__ */ new Set([
|
|
|
3544
3547
|
"subgraph"
|
|
3545
3548
|
]);
|
|
3546
3549
|
function G(e) {
|
|
3547
|
-
return /^[A-Za-z_][\w]*$/.test(e) && !
|
|
3550
|
+
return /^[A-Za-z_][\w]*$/.test(e) && !Mt.has(e.toLowerCase()) || /^-?(?:\.\d+|\d+(?:\.\d*)?)$/.test(e) ? e : `"${e.replace(/\\/g, "\\\\").replace(/"/g, "\\\"").replace(/\n/g, "\\n")}"`;
|
|
3548
3551
|
}
|
|
3549
3552
|
function K(e) {
|
|
3550
3553
|
let t = Object.entries(e).map(([e, t]) => `${G(e)}=${G(t)}`);
|
|
3551
3554
|
return t.length ? ` [${t.join(", ")}]` : "";
|
|
3552
3555
|
}
|
|
3553
|
-
var
|
|
3556
|
+
var Nt = /* @__PURE__ */ new Set([
|
|
3554
3557
|
"label",
|
|
3555
3558
|
"pos",
|
|
3556
3559
|
"shape",
|
|
3557
3560
|
"style"
|
|
3558
|
-
]),
|
|
3561
|
+
]), Pt = /* @__PURE__ */ new Set([
|
|
3559
3562
|
"label",
|
|
3560
3563
|
"color",
|
|
3561
3564
|
"penwidth",
|
|
@@ -3567,16 +3570,16 @@ var Mt = /* @__PURE__ */ new Set([
|
|
|
3567
3570
|
"tailport",
|
|
3568
3571
|
"headport"
|
|
3569
3572
|
]);
|
|
3570
|
-
function
|
|
3573
|
+
function Ft(e, t) {
|
|
3571
3574
|
let n = e?.attrs, r = {};
|
|
3572
3575
|
if (n && typeof n == "object") for (let [e, i] of Object.entries(n)) !t.has(e) && typeof i == "string" && (r[e] = i);
|
|
3573
3576
|
return r;
|
|
3574
3577
|
}
|
|
3575
|
-
function
|
|
3578
|
+
function It(e) {
|
|
3576
3579
|
let t = e.data?.label;
|
|
3577
3580
|
return t == null ? void 0 : String(t);
|
|
3578
3581
|
}
|
|
3579
|
-
function
|
|
3582
|
+
function Lt(e) {
|
|
3580
3583
|
let t = new Map(e.map((e) => [e.id, e])), n = /* @__PURE__ */ new Map(), r = (e, i = 0) => {
|
|
3581
3584
|
if (n.has(e.id)) return n.get(e.id);
|
|
3582
3585
|
let a = e.parentId && t.has(e.parentId) && i < 100 ? r(t.get(e.parentId), i + 1) : {
|
|
@@ -3590,7 +3593,7 @@ function It(e) {
|
|
|
3590
3593
|
};
|
|
3591
3594
|
return r;
|
|
3592
3595
|
}
|
|
3593
|
-
function
|
|
3596
|
+
function Rt(e) {
|
|
3594
3597
|
let t = new Set(e.map((e) => e.id)), n = /* @__PURE__ */ new Map();
|
|
3595
3598
|
for (let r of e) {
|
|
3596
3599
|
let e = r.parentId && t.has(r.parentId) ? r.parentId : void 0;
|
|
@@ -3598,25 +3601,25 @@ function Lt(e) {
|
|
|
3598
3601
|
}
|
|
3599
3602
|
return n;
|
|
3600
3603
|
}
|
|
3601
|
-
function
|
|
3602
|
-
let r = n.directed ?? !0, i = [`${r ? "digraph" : "graph"}${n.name ? ` ${G(n.name)}` : ""} {`], a =
|
|
3604
|
+
function zt(e, t, n = {}) {
|
|
3605
|
+
let r = n.directed ?? !0, i = [`${r ? "digraph" : "graph"}${n.name ? ` ${G(n.name)}` : ""} {`], a = xt(n.direction);
|
|
3603
3606
|
a !== "TB" && i.push(` rankdir=${a};`);
|
|
3604
|
-
let o =
|
|
3607
|
+
let o = Rt(e), s = Lt(e), c = n.sizes instanceof Map ? n.sizes : new Map(Object.entries(n.sizes ?? {})), l = (e, t) => {
|
|
3605
3608
|
for (let r of o.get(e) ?? []) {
|
|
3606
|
-
let e =
|
|
3609
|
+
let e = It(r);
|
|
3607
3610
|
if (r.type === "group") {
|
|
3608
3611
|
let n = /^cluster/i.test(r.id) ? r.id : `cluster_${r.id}`;
|
|
3609
3612
|
i.push(`${t}subgraph ${G(n)} {`);
|
|
3610
|
-
let a =
|
|
3613
|
+
let a = Ft(r.data, Nt);
|
|
3611
3614
|
e && (a.label = e);
|
|
3612
3615
|
for (let [e, n] of Object.entries(a)) i.push(`${t} ${G(e)}=${G(n)};`);
|
|
3613
3616
|
l(r.id, t + " "), i.push(`${t}}`);
|
|
3614
3617
|
continue;
|
|
3615
3618
|
}
|
|
3616
|
-
let a =
|
|
3619
|
+
let a = Ft(r.data, Nt);
|
|
3617
3620
|
if (e !== void 0 && e !== r.id && (a.label = e), r.type === "circle" ? a.shape = r.data?.ring ? "doublecircle" : "circle" : r.data?.attrs?.shape && (a.shape = r.data.attrs.shape), r.hidden && (a.style = "invis"), n.positions) {
|
|
3618
|
-
let e = s(r), t = c.get(r.id) ??
|
|
3619
|
-
a.pos = `${
|
|
3621
|
+
let e = s(r), t = c.get(r.id) ?? Ct(r);
|
|
3622
|
+
a.pos = `${Bt((e.x + t.width / 2) * .75)},${Bt(-(e.y + t.height / 2) * .75)}`;
|
|
3620
3623
|
}
|
|
3621
3624
|
i.push(`${t}${G(r.id)}${K(a)};`);
|
|
3622
3625
|
}
|
|
@@ -3624,8 +3627,8 @@ function Rt(e, t, n = {}) {
|
|
|
3624
3627
|
l(void 0, " ");
|
|
3625
3628
|
let u = r ? "->" : "--";
|
|
3626
3629
|
for (let e of t) {
|
|
3627
|
-
let t =
|
|
3628
|
-
e.label && (t.label = e.label), e.color && !V.has(e.color) && !e.color.startsWith("var(") && (t.color = e.color), e.width && e.width !== 2 && (t.penwidth = String(
|
|
3630
|
+
let t = Ft(e.data, Pt);
|
|
3631
|
+
e.label && (t.label = e.label), e.color && !V.has(e.color) && !e.color.startsWith("var(") && (t.color = e.color), e.width && e.width !== 2 && (t.penwidth = String(Bt(e.width / 2)));
|
|
3629
3632
|
let n = [e.dashed ? "dashed" : "", e.hidden ? "invis" : ""].filter(Boolean).join(",");
|
|
3630
3633
|
n && (t.style = n);
|
|
3631
3634
|
let a = e.markerEnd ?? "arrow-closed", o = e.markerStart ?? "none";
|
|
@@ -3635,10 +3638,10 @@ function Rt(e, t, n = {}) {
|
|
|
3635
3638
|
}
|
|
3636
3639
|
return i.push("}"), i.join("\n") + "\n";
|
|
3637
3640
|
}
|
|
3638
|
-
function
|
|
3641
|
+
function Bt(e) {
|
|
3639
3642
|
return Math.round(e * 100) / 100;
|
|
3640
3643
|
}
|
|
3641
|
-
var
|
|
3644
|
+
var Vt = [
|
|
3642
3645
|
{
|
|
3643
3646
|
open: "(((",
|
|
3644
3647
|
close: ")))",
|
|
@@ -3709,7 +3712,7 @@ var Bt = [
|
|
|
3709
3712
|
close: "}",
|
|
3710
3713
|
shape: "diamond"
|
|
3711
3714
|
}
|
|
3712
|
-
],
|
|
3715
|
+
], Ht = /^(classDef|class|style|linkStyle|click|accTitle|accDescr|direction)\b/, Ut = /* @__PURE__ */ new Set([
|
|
3713
3716
|
"end",
|
|
3714
3717
|
"graph",
|
|
3715
3718
|
"flowchart",
|
|
@@ -3721,7 +3724,7 @@ var Bt = [
|
|
|
3721
3724
|
"click",
|
|
3722
3725
|
"direction"
|
|
3723
3726
|
]);
|
|
3724
|
-
function
|
|
3727
|
+
function Wt(e) {
|
|
3725
3728
|
let t = e.trim();
|
|
3726
3729
|
return t.startsWith("\"") && t.endsWith("\"") && t.length > 1 && (t = t.slice(1, -1)), t.startsWith("`") && t.endsWith("`") && t.length > 1 && (t = t.slice(1, -1).replace(/\*\*|__|\*|_/g, "")), t.replace(/<br\s*\/?>/gi, "\n").replace(/#quot;/g, "\"").replace(/#(\d+);/g, (e, t) => String.fromCodePoint(Number(t))).replace(/#([a-z]+);/gi, (e, t) => ({
|
|
3727
3730
|
amp: "&",
|
|
@@ -3731,7 +3734,7 @@ function Ut(e) {
|
|
|
3731
3734
|
apos: "'"
|
|
3732
3735
|
})[t.toLowerCase()] ?? e);
|
|
3733
3736
|
}
|
|
3734
|
-
function
|
|
3737
|
+
function Gt(e) {
|
|
3735
3738
|
let t = [], n = 0, r = !1, i = 0;
|
|
3736
3739
|
for (let a = 0; a <= e.length; a++) {
|
|
3737
3740
|
let o = e[a];
|
|
@@ -3745,8 +3748,8 @@ function Wt(e) {
|
|
|
3745
3748
|
}
|
|
3746
3749
|
return t;
|
|
3747
3750
|
}
|
|
3748
|
-
function
|
|
3749
|
-
let n =
|
|
3751
|
+
function Kt(e, t = {}) {
|
|
3752
|
+
let n = Gt(e.replace(/^\s*---\n[\s\S]*?\n---\s*\n/, (e) => "\n".repeat(e.split("\n").length - 1))), r = n.shift(), i = r && /^(flowchart|graph)(?:\s+(TB|TD|BT|RL|LR))?\s*(.*)$/i.exec(r.text);
|
|
3750
3753
|
if (!r || !i) throw new U("Expected \"flowchart\" or \"graph\"", e, r?.at ?? 0);
|
|
3751
3754
|
let a = (i[2] ?? "TB").toUpperCase(), o = a === "TD" ? "TB" : a;
|
|
3752
3755
|
i[3] && n.unshift({
|
|
@@ -3774,7 +3777,7 @@ function Gt(e, t = {}) {
|
|
|
3774
3777
|
}
|
|
3775
3778
|
let a = /^subgraph\s+(.+)$/i.exec(r);
|
|
3776
3779
|
if (a) {
|
|
3777
|
-
let e = a[1].trim(), t = /^([\w-]+)\s*\[(.*)\]$/.exec(e), n = t ? t[1] : /^[\w-]+$/.test(e) ? e : e.replace(/^"|"$/g, ""), r =
|
|
3780
|
+
let e = a[1].trim(), t = /^([\w-]+)\s*\[(.*)\]$/.exec(e), n = t ? t[1] : /^[\w-]+$/.test(e) ? e : e.replace(/^"|"$/g, ""), r = Wt(t ? t[2] : e), i = c.get(n) ?? {
|
|
3778
3781
|
id: n,
|
|
3779
3782
|
position: {
|
|
3780
3783
|
x: 0,
|
|
@@ -3784,7 +3787,7 @@ function Gt(e, t = {}) {
|
|
|
3784
3787
|
i.type = "group", i.data = { label: r }, u.length ? i.parentId = u.at(-1) : delete i.parentId, c.has(n) || (c.set(n, i), s.push(i)), u.push(n);
|
|
3785
3788
|
continue;
|
|
3786
3789
|
}
|
|
3787
|
-
if (
|
|
3790
|
+
if (Ht.test(r)) continue;
|
|
3788
3791
|
let o = 0, f = () => {
|
|
3789
3792
|
for (; o < r.length && /\s/.test(r[o]);) o++;
|
|
3790
3793
|
}, p = () => {
|
|
@@ -3798,12 +3801,12 @@ function Gt(e, t = {}) {
|
|
|
3798
3801
|
let e = r.indexOf("}", o);
|
|
3799
3802
|
e < 0 && n("Unclosed \"@{\"", o);
|
|
3800
3803
|
let t = r.slice(o + 2, e), s = /\bshape\s*:\s*([\w-]+)/.exec(t), c = /\blabel\s*:\s*("(?:[^"\\]|\\.)*"|[^,}]+)/.exec(t);
|
|
3801
|
-
s && (a = s[1].toLowerCase()), c && (i =
|
|
3802
|
-
} else for (let e of
|
|
3804
|
+
s && (a = s[1].toLowerCase()), c && (i = Wt(c[1])), o = e + 1;
|
|
3805
|
+
} else for (let e of Vt) {
|
|
3803
3806
|
if (!r.startsWith(e.open, o)) continue;
|
|
3804
3807
|
let t = o + e.open.length, n = r[t] === "\"" ? r.indexOf("\"", t + 1) + 1 : t, s = r.indexOf(e.close, n);
|
|
3805
3808
|
if (!(n === 0 || s < 0)) {
|
|
3806
|
-
i =
|
|
3809
|
+
i = Wt(r.slice(t, s)), a = e.shape, o = s + e.close.length;
|
|
3807
3810
|
break;
|
|
3808
3811
|
}
|
|
3809
3812
|
}
|
|
@@ -3824,7 +3827,7 @@ function Gt(e, t = {}) {
|
|
|
3824
3827
|
line: e ? "dotted" : t[2] === "==" ? "thick" : "solid",
|
|
3825
3828
|
start: t[1] ?? "",
|
|
3826
3829
|
end: r === "-" || r === "=" ? "" : r,
|
|
3827
|
-
label:
|
|
3830
|
+
label: Wt(t[3]),
|
|
3828
3831
|
raw: t[0]
|
|
3829
3832
|
}, o += t[0].length;
|
|
3830
3833
|
} else if (i) {
|
|
@@ -3836,7 +3839,7 @@ function Gt(e, t = {}) {
|
|
|
3836
3839
|
raw: i[0]
|
|
3837
3840
|
}, o += i[0].length, f(), r[o] === "|") {
|
|
3838
3841
|
let e = r.indexOf("|", o + 1);
|
|
3839
|
-
e < 0 && n("Unclosed \"|\"", o), a.label =
|
|
3842
|
+
e < 0 && n("Unclosed \"|\"", o), a.label = Wt(r.slice(o + 1, e)), o = e + 1;
|
|
3840
3843
|
}
|
|
3841
3844
|
} else return null;
|
|
3842
3845
|
return a;
|
|
@@ -3845,19 +3848,19 @@ function Gt(e, t = {}) {
|
|
|
3845
3848
|
let e = h();
|
|
3846
3849
|
e || n(`Unexpected "${r.slice(o, o + 12)}"`, o);
|
|
3847
3850
|
let i = m();
|
|
3848
|
-
for (let n of g) for (let r of i) l.push(
|
|
3851
|
+
for (let n of g) for (let r of i) l.push(qt(n, r, e, l.length, t));
|
|
3849
3852
|
g = i;
|
|
3850
3853
|
}
|
|
3851
3854
|
}
|
|
3852
3855
|
if (u.length) throw new U(`Subgraph "${u.at(-1)}" has no "end"`, e, e.length);
|
|
3853
|
-
let f = [], p =
|
|
3856
|
+
let f = [], p = Rt(s), m = (e) => {
|
|
3854
3857
|
for (let t of p.get(e) ?? []) f.push(t), m(t.id);
|
|
3855
3858
|
};
|
|
3856
|
-
return m(void 0),
|
|
3859
|
+
return m(void 0), Tt({
|
|
3857
3860
|
nodes: f,
|
|
3858
3861
|
edges: l,
|
|
3859
3862
|
rankdir: o,
|
|
3860
|
-
direction:
|
|
3863
|
+
direction: St(o),
|
|
3861
3864
|
directed: !0,
|
|
3862
3865
|
attrs: {}
|
|
3863
3866
|
}, t, !1);
|
|
@@ -3865,7 +3868,7 @@ function Gt(e, t = {}) {
|
|
|
3865
3868
|
function q(e) {
|
|
3866
3869
|
return e === ">" || e === "<" ? "arrow-closed" : e === "o" || e === "x" ? "arrow" : "none";
|
|
3867
3870
|
}
|
|
3868
|
-
function
|
|
3871
|
+
function qt(e, t, n, r, i) {
|
|
3869
3872
|
let a = {
|
|
3870
3873
|
id: `e${r + 1}`,
|
|
3871
3874
|
source: e,
|
|
@@ -3875,26 +3878,26 @@ function Kt(e, t, n, r, i) {
|
|
|
3875
3878
|
let o = q(n.end);
|
|
3876
3879
|
return o !== "arrow-closed" && (a.markerEnd = o), n.start && (a.markerStart = q(n.start)), a.data = { link: n.raw.replace(/\s+/g, " ") }, a;
|
|
3877
3880
|
}
|
|
3878
|
-
function
|
|
3881
|
+
function Jt(e) {
|
|
3879
3882
|
return `"${e.replace(/"/g, "#quot;").replace(/\n/g, "<br>")}"`;
|
|
3880
3883
|
}
|
|
3881
|
-
var
|
|
3882
|
-
function
|
|
3883
|
-
let r = [`flowchart ${
|
|
3884
|
+
var Yt = new Map(Vt.map((e) => [e.shape, e]));
|
|
3885
|
+
function Xt(e, t, n = {}) {
|
|
3886
|
+
let r = [`flowchart ${xt(n.direction)}`], i = /* @__PURE__ */ new Map(), a = 0, o = /* @__PURE__ */ new Set();
|
|
3884
3887
|
for (let t of e) {
|
|
3885
|
-
let e = /^[A-Za-z_][\w-]*$/.test(t.id) && !t.id.endsWith("-") && !
|
|
3888
|
+
let e = /^[A-Za-z_][\w-]*$/.test(t.id) && !t.id.endsWith("-") && !Ut.has(t.id.toLowerCase()) ? t.id : "";
|
|
3886
3889
|
for (; !e || o.has(e);) e = `n${++a}`;
|
|
3887
3890
|
o.add(e), i.set(t.id, e);
|
|
3888
3891
|
}
|
|
3889
|
-
let s =
|
|
3892
|
+
let s = Rt(e), c = (e, t) => {
|
|
3890
3893
|
for (let n of s.get(e) ?? []) {
|
|
3891
|
-
let e = i.get(n.id), a =
|
|
3894
|
+
let e = i.get(n.id), a = It(n);
|
|
3892
3895
|
if (n.type === "group") {
|
|
3893
|
-
r.push(`${t}subgraph ${e}[${
|
|
3896
|
+
r.push(`${t}subgraph ${e}[${Jt(a ?? n.id)}]`), c(n.id, t + " "), r.push(`${t}end`);
|
|
3894
3897
|
continue;
|
|
3895
3898
|
}
|
|
3896
|
-
let o = n.data ?? {}, s = n.type === "circle" ? o.ring ? "doublecircle" : "circle" : o.shape &&
|
|
3897
|
-
r.push(`${t}${e}${l ? `${l.open}${
|
|
3899
|
+
let o = n.data ?? {}, s = n.type === "circle" ? o.ring ? "doublecircle" : "circle" : o.shape && Yt.has(o.shape) ? o.shape : a !== void 0 && a !== n.id ? "rect" : "", l = s ? Yt.get(s) : void 0;
|
|
3900
|
+
r.push(`${t}${e}${l ? `${l.open}${Jt(a ?? n.id)}${l.close}` : ""}`);
|
|
3898
3901
|
}
|
|
3899
3902
|
};
|
|
3900
3903
|
c(void 0, " ");
|
|
@@ -3905,10 +3908,10 @@ function Yt(e, t, n = {}) {
|
|
|
3905
3908
|
let t = a !== "none", n = o === "none" ? "" : "<";
|
|
3906
3909
|
s = e.dashed ? `${n}-.${t ? "->" : "-"}` : (e.width ?? 2) >= 3 ? `${n}==${t ? ">" : "="}` : `${n}--${t ? ">" : "-"}`;
|
|
3907
3910
|
}
|
|
3908
|
-
r.push(` ${t} ${s}${e.label && !e.hidden ? `|${
|
|
3911
|
+
r.push(` ${t} ${s}${e.label && !e.hidden ? `|${Jt(e.label)}|` : ""} ${n}`);
|
|
3909
3912
|
}
|
|
3910
3913
|
return r.join("\n") + "\n";
|
|
3911
3914
|
}
|
|
3912
|
-
export {
|
|
3915
|
+
export { dt as MFlow, B as MFlowControls, I as MFlowHandle, vt as MFlowMinimap, ke as MFlowNode, l as arrowPath, r as getBezierPath, e as getRoutedPath, o as getSmoothStepPath, c as getStepPath, t as getStraightPath, Se as layoutLayered, xe as layoutTree, At as parseDot, Kt as parseMermaid, i as pointsToRoute, u as routePoints, n as smoothStepPoints, zt as toDot, Xt as toMermaid, ye as useFlow, be as useFlowNode };
|
|
3913
3916
|
|
|
3914
3917
|
//# sourceMappingURL=flow.js.map
|