@plume-canvas/canvas-render 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -611,28 +611,28 @@ function an(e, t, n) {
|
|
|
611
611
|
bottom: nn(n, tn.bottom)
|
|
612
612
|
} : e;
|
|
613
613
|
}
|
|
614
|
-
function
|
|
614
|
+
function J(e, t) {
|
|
615
615
|
return typeof e == "number" && Number.isFinite(e) && e > 0 ? e : t;
|
|
616
616
|
}
|
|
617
|
-
function
|
|
617
|
+
function on(e, t) {
|
|
618
618
|
return typeof e == "number" && Number.isFinite(e) && e >= 0 ? Math.floor(e) : t;
|
|
619
619
|
}
|
|
620
|
-
function
|
|
621
|
-
let t =
|
|
620
|
+
function sn(e) {
|
|
621
|
+
let t = J(e("panelWidth"), J(e("panelImageWidth"), J(e("panelTextWidth"), q.panelWidth)));
|
|
622
622
|
return {
|
|
623
623
|
panelWidth: t,
|
|
624
624
|
imageWidth: t,
|
|
625
625
|
textWidth: t,
|
|
626
|
-
editorMinWidth:
|
|
627
|
-
editorMinHeight:
|
|
628
|
-
editorMaxHeight:
|
|
629
|
-
aiVisibleCount:
|
|
626
|
+
editorMinWidth: J(e("panelEditorMinWidth"), q.editorMinWidth),
|
|
627
|
+
editorMinHeight: J(e("panelEditorMinHeight"), q.editorMinHeight),
|
|
628
|
+
editorMaxHeight: J(e("panelEditorMaxHeight"), q.editorMaxHeight),
|
|
629
|
+
aiVisibleCount: on(e("panelAiVisibleCount"), q.aiVisibleCount)
|
|
630
630
|
};
|
|
631
631
|
}
|
|
632
|
-
function
|
|
632
|
+
function cn(e, t, n) {
|
|
633
633
|
switch (t) {
|
|
634
634
|
case "panelWidth": {
|
|
635
|
-
let t =
|
|
635
|
+
let t = J(n, q.panelWidth);
|
|
636
636
|
return {
|
|
637
637
|
...e,
|
|
638
638
|
panelWidth: t,
|
|
@@ -642,7 +642,7 @@ function ln(e, t, n) {
|
|
|
642
642
|
}
|
|
643
643
|
case "panelImageWidth":
|
|
644
644
|
case "panelTextWidth": {
|
|
645
|
-
let t =
|
|
645
|
+
let t = J(n, q.panelWidth);
|
|
646
646
|
return {
|
|
647
647
|
...e,
|
|
648
648
|
panelWidth: t,
|
|
@@ -652,24 +652,24 @@ function ln(e, t, n) {
|
|
|
652
652
|
}
|
|
653
653
|
case "panelEditorMinWidth": return {
|
|
654
654
|
...e,
|
|
655
|
-
editorMinWidth:
|
|
655
|
+
editorMinWidth: J(n, q.editorMinWidth)
|
|
656
656
|
};
|
|
657
657
|
case "panelEditorMinHeight": return {
|
|
658
658
|
...e,
|
|
659
|
-
editorMinHeight:
|
|
659
|
+
editorMinHeight: J(n, q.editorMinHeight)
|
|
660
660
|
};
|
|
661
661
|
case "panelEditorMaxHeight": return {
|
|
662
662
|
...e,
|
|
663
|
-
editorMaxHeight:
|
|
663
|
+
editorMaxHeight: J(n, q.editorMaxHeight)
|
|
664
664
|
};
|
|
665
665
|
case "panelAiVisibleCount": return {
|
|
666
666
|
...e,
|
|
667
|
-
aiVisibleCount:
|
|
667
|
+
aiVisibleCount: on(n, q.aiVisibleCount)
|
|
668
668
|
};
|
|
669
669
|
default: return e;
|
|
670
670
|
}
|
|
671
671
|
}
|
|
672
|
-
function
|
|
672
|
+
function ln() {
|
|
673
673
|
let { ctx: e } = Xt(), t = e.get("settings"), n = T({ ...tn });
|
|
674
674
|
if (!t || typeof t.onChange != "function") return n;
|
|
675
675
|
n.value = rn((e) => t.get(e));
|
|
@@ -678,31 +678,31 @@ function un() {
|
|
|
678
678
|
});
|
|
679
679
|
return v(() => r.dispose()), n;
|
|
680
680
|
}
|
|
681
|
-
function
|
|
681
|
+
function un() {
|
|
682
682
|
let { ctx: e } = Xt(), t = e.get("settings"), n = T({ ...q });
|
|
683
683
|
if (!t || typeof t.onChange != "function") return n;
|
|
684
|
-
n.value =
|
|
684
|
+
n.value = sn((e) => t.get(e));
|
|
685
685
|
let r = t.onChange((e, t) => {
|
|
686
|
-
n.value =
|
|
686
|
+
n.value = cn(n.value, e, t);
|
|
687
687
|
});
|
|
688
688
|
return v(() => r.dispose()), n;
|
|
689
689
|
}
|
|
690
|
-
function
|
|
690
|
+
function dn(e, t) {
|
|
691
691
|
let n = nn(t, 0);
|
|
692
692
|
return e === "top" ? { bottom: `calc(100% + ${n}px)` } : { top: `calc(100% + ${n}px)` };
|
|
693
693
|
}
|
|
694
|
-
function
|
|
694
|
+
function fn(e) {
|
|
695
695
|
let t = typeof e.zoom == "number" && Number.isFinite(e.zoom) && e.zoom > 0 ? e.zoom : 1;
|
|
696
696
|
return {
|
|
697
697
|
left: "50%",
|
|
698
|
-
...
|
|
698
|
+
...dn(e.side, e.offset),
|
|
699
699
|
transform: `translateX(-50%) scale(${1 / t})`,
|
|
700
700
|
transformOrigin: e.side === "top" ? "center bottom" : "center top"
|
|
701
701
|
};
|
|
702
702
|
}
|
|
703
703
|
//#endregion
|
|
704
704
|
//#region src/contracts/canvasInteractionSettings.ts
|
|
705
|
-
var
|
|
705
|
+
var pn = "常规/画布", mn = Object.freeze({
|
|
706
706
|
nodesDraggable: !0,
|
|
707
707
|
nodesConnectable: !0,
|
|
708
708
|
elementsSelectable: !0,
|
|
@@ -725,83 +725,83 @@ var mn = "常规/画布", hn = Object.freeze({
|
|
|
725
725
|
preventScrolling: !0,
|
|
726
726
|
snapGrid: [15, 15]
|
|
727
727
|
});
|
|
728
|
-
function
|
|
728
|
+
function Y(e, t, n) {
|
|
729
729
|
return {
|
|
730
730
|
type: "boolean",
|
|
731
|
-
default:
|
|
731
|
+
default: mn[e],
|
|
732
732
|
label: t,
|
|
733
733
|
...n ? { description: n } : {},
|
|
734
|
-
group:
|
|
734
|
+
group: pn
|
|
735
735
|
};
|
|
736
736
|
}
|
|
737
|
-
function
|
|
737
|
+
function hn(e, t, n, r, i, a) {
|
|
738
738
|
return {
|
|
739
739
|
type: "number",
|
|
740
|
-
default:
|
|
740
|
+
default: mn[e],
|
|
741
741
|
min: n,
|
|
742
742
|
max: r,
|
|
743
743
|
step: i,
|
|
744
744
|
label: t,
|
|
745
745
|
...a ? { description: a } : {},
|
|
746
|
-
group:
|
|
746
|
+
group: pn
|
|
747
747
|
};
|
|
748
748
|
}
|
|
749
|
-
var
|
|
750
|
-
nodesDraggable:
|
|
751
|
-
nodesConnectable:
|
|
752
|
-
elementsSelectable:
|
|
753
|
-
selectNodesOnDrag:
|
|
754
|
-
snapToGrid:
|
|
755
|
-
snapGridX:
|
|
756
|
-
snapGridY:
|
|
757
|
-
zoomOnScroll:
|
|
758
|
-
zoomOnPinch:
|
|
759
|
-
panOnScroll:
|
|
760
|
-
panOnDrag:
|
|
761
|
-
zoomOnDoubleClick:
|
|
762
|
-
minZoom:
|
|
763
|
-
maxZoom:
|
|
764
|
-
preventScrolling:
|
|
765
|
-
visibleCullEnabled:
|
|
766
|
-
visibleCullBuffer:
|
|
767
|
-
cullCompactShells:
|
|
768
|
-
dragRapidMode:
|
|
749
|
+
var gn = {
|
|
750
|
+
nodesDraggable: Y("nodesDraggable", "节点可拖拽", "关闭后节点不能拖动(画布只读平移时常用)。"),
|
|
751
|
+
nodesConnectable: Y("nodesConnectable", "节点可连线", "关闭后不能从端口拖出连线。"),
|
|
752
|
+
elementsSelectable: Y("elementsSelectable", "元素可选中", "关闭后节点/边不能被点选与框选。"),
|
|
753
|
+
selectNodesOnDrag: Y("selectNodesOnDrag", "拖拽选中", "开启后拖动未选中的节点会顺手选中它。"),
|
|
754
|
+
snapToGrid: Y("snapToGrid", "网格吸附", "开启后节点移动时吸附到网格,位置按网格间距取整。"),
|
|
755
|
+
snapGridX: hn("snapGridX", "网格间距 X", 5, 200, 1, "网格吸附的水平间距(px);关闭吸附时不生效。"),
|
|
756
|
+
snapGridY: hn("snapGridY", "网格间距 Y", 5, 200, 1, "网格吸附的垂直间距(px);关闭吸附时不生效。"),
|
|
757
|
+
zoomOnScroll: Y("zoomOnScroll", "滚轮缩放", "开启后鼠标滚轮缩放画布。"),
|
|
758
|
+
zoomOnPinch: Y("zoomOnPinch", "双指缩放", "开启后触控板捏合/双指滑动缩放画布。"),
|
|
759
|
+
panOnScroll: Y("panOnScroll", "滚轮平移", "开启后滚轮平移画布(与滚轮缩放互斥使用更合理,同开以缩放优先)。"),
|
|
760
|
+
panOnDrag: Y("panOnDrag", "拖拽平移", "开启后按住空白处拖动平移画布。"),
|
|
761
|
+
zoomOnDoubleClick: Y("zoomOnDoubleClick", "双击缩放", "开启后双击空白处放大画布。"),
|
|
762
|
+
minZoom: hn("minZoom", "最小缩放", .05, 2, .05, "画布能缩小到的下限(0.2 = 缩到 20%)。"),
|
|
763
|
+
maxZoom: hn("maxZoom", "最大缩放", 1, 8, .5, "画布能放大到的上限(2 = 放大到 200%)。"),
|
|
764
|
+
preventScrolling: Y("preventScrolling", "阻止页面滚动", "鼠标在画布上滚动时不带动外层页面滚动(嵌入长页面时按需关)。"),
|
|
765
|
+
visibleCullEnabled: Y("visibleCullEnabled", "视口外节点降级绘制", "视口外的节点不再完整绘制(内容由壳按状态降级),节点多时拖动/缩放更流畅;与其相连的连线保持完整。选中状态不受影响(全选仍选中全部)。"),
|
|
766
|
+
visibleCullBuffer: hn("visibleCullBuffer", "剔除缓冲距离", 0, 2e3, 50, "视口外多远范围内的节点仍渲染(画布像素)。太小快速拖动会闪白,太大省不了多少。"),
|
|
767
|
+
cullCompactShells: Y("cullCompactShells", "屏外壳压缩", "视口外且没有连线牵扯的节点连壳都不渲染(画布超多节点时大幅降内存/CPU)。代价:这类节点快速拖回视野时可能闪一帧(缓冲带已兜住慢速平移)。与其相连跨屏连线的节点不受影响,连线保持完整。"),
|
|
768
|
+
dragRapidMode: Y("dragRapidMode", "拖拽快速模式", "拖动画布时画面略糊换流畅(松手恢复清晰)。注意:大画布(节点很多)开启可能导致系统卡死,保持关闭。")
|
|
769
769
|
};
|
|
770
|
-
function
|
|
770
|
+
function _n(e, t) {
|
|
771
771
|
return typeof e == "boolean" ? e : t;
|
|
772
772
|
}
|
|
773
|
-
function
|
|
773
|
+
function vn(e, t, n, r) {
|
|
774
774
|
return typeof e != "number" || !Number.isFinite(e) || e < n || e > r ? t : e;
|
|
775
775
|
}
|
|
776
|
-
var
|
|
777
|
-
function
|
|
778
|
-
let t =
|
|
776
|
+
var yn = Object.keys(gn);
|
|
777
|
+
function bn(e) {
|
|
778
|
+
let t = gn[e];
|
|
779
779
|
return {
|
|
780
780
|
min: t.min ?? -Infinity,
|
|
781
781
|
max: t.max ?? Infinity
|
|
782
782
|
};
|
|
783
783
|
}
|
|
784
|
-
function
|
|
785
|
-
let t =
|
|
786
|
-
for (let r of
|
|
784
|
+
function xn(e) {
|
|
785
|
+
let t = mn, n = { ...t };
|
|
786
|
+
for (let r of yn) {
|
|
787
787
|
let i = e(r);
|
|
788
788
|
if (i === void 0) continue;
|
|
789
|
-
let a =
|
|
790
|
-
n[r] = a.type === "boolean" ?
|
|
789
|
+
let a = gn[r], o = t[r];
|
|
790
|
+
n[r] = a.type === "boolean" ? _n(i, o) : vn(i, o, bn(r).min, bn(r).max);
|
|
791
791
|
}
|
|
792
792
|
return n.snapGrid = [n.snapGridX, n.snapGridY], n;
|
|
793
793
|
}
|
|
794
|
-
function
|
|
795
|
-
return t in
|
|
794
|
+
function Sn(e, t, n) {
|
|
795
|
+
return t in gn ? xn((r) => r === t ? n : e[r]) : e;
|
|
796
796
|
}
|
|
797
|
-
function
|
|
798
|
-
if (!(t in
|
|
799
|
-
let r =
|
|
797
|
+
function Cn(e, t, n) {
|
|
798
|
+
if (!(t in gn)) return !1;
|
|
799
|
+
let r = Sn(e, t, n);
|
|
800
800
|
return JSON.stringify(r) === JSON.stringify(e) ? !1 : (Object.assign(e, r), !0);
|
|
801
801
|
}
|
|
802
802
|
//#endregion
|
|
803
803
|
//#region src/contracts/themePalette.ts
|
|
804
|
-
var
|
|
804
|
+
var wn = Object.freeze([
|
|
805
805
|
{
|
|
806
806
|
key: "accentColor",
|
|
807
807
|
cssVar: "--ui-accent",
|
|
@@ -851,34 +851,34 @@ var Tn = Object.freeze([
|
|
|
851
851
|
dark: "#22d3ee",
|
|
852
852
|
optional: !0
|
|
853
853
|
}
|
|
854
|
-
]),
|
|
855
|
-
function
|
|
854
|
+
]), Tn = "外观/主题配色", En = "外观/暗色主题配色";
|
|
855
|
+
function Dn(e) {
|
|
856
856
|
return e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
857
857
|
}
|
|
858
|
-
function
|
|
858
|
+
function On(e) {
|
|
859
859
|
return `${e}Light`;
|
|
860
860
|
}
|
|
861
|
-
function
|
|
861
|
+
function kn(e) {
|
|
862
862
|
return `${e}Dark`;
|
|
863
863
|
}
|
|
864
|
-
function
|
|
865
|
-
return `--uic-${
|
|
864
|
+
function An(e, t) {
|
|
865
|
+
return `--uic-${Dn(e)}-${t}`;
|
|
866
866
|
}
|
|
867
|
-
function
|
|
867
|
+
function jn() {
|
|
868
868
|
let e = [];
|
|
869
|
-
for (let t of
|
|
869
|
+
for (let t of wn) for (let n of ["light", "dark"]) e.push({
|
|
870
870
|
token: t,
|
|
871
871
|
mode: n,
|
|
872
|
-
settingKey: n === "light" ?
|
|
873
|
-
cssVar:
|
|
872
|
+
settingKey: n === "light" ? On(t.key) : kn(t.key),
|
|
873
|
+
cssVar: An(t.key, n),
|
|
874
874
|
default: n === "light" ? t.light : t.dark,
|
|
875
|
-
group: n === "light" ?
|
|
875
|
+
group: n === "light" ? Tn : En
|
|
876
876
|
});
|
|
877
877
|
return e;
|
|
878
878
|
}
|
|
879
|
-
function
|
|
879
|
+
function Mn() {
|
|
880
880
|
let e = {};
|
|
881
|
-
for (let t of
|
|
881
|
+
for (let t of jn()) e[t.settingKey] = {
|
|
882
882
|
type: "color",
|
|
883
883
|
default: t.default,
|
|
884
884
|
label: t.token.label,
|
|
@@ -888,15 +888,15 @@ function Nn() {
|
|
|
888
888
|
};
|
|
889
889
|
return e;
|
|
890
890
|
}
|
|
891
|
-
function
|
|
892
|
-
return
|
|
891
|
+
function Nn() {
|
|
892
|
+
return jn().map((e) => e.cssVar);
|
|
893
893
|
}
|
|
894
|
-
function
|
|
895
|
-
return
|
|
894
|
+
function Pn(e) {
|
|
895
|
+
return jn().some((t) => t.settingKey === e);
|
|
896
896
|
}
|
|
897
|
-
function
|
|
897
|
+
function Fn(e) {
|
|
898
898
|
let t = [];
|
|
899
|
-
for (let n of
|
|
899
|
+
for (let n of jn()) {
|
|
900
900
|
let r = e(n.settingKey);
|
|
901
901
|
if (typeof r != "string") continue;
|
|
902
902
|
let i = r.trim();
|
|
@@ -917,33 +917,33 @@ function In(e) {
|
|
|
917
917
|
}
|
|
918
918
|
return t;
|
|
919
919
|
}
|
|
920
|
-
function
|
|
921
|
-
let r =
|
|
920
|
+
function In(e, t, n) {
|
|
921
|
+
let r = jn().find((e) => e.token.key === t && e.mode === n);
|
|
922
922
|
if (!r) return;
|
|
923
923
|
let i = e(r.settingKey);
|
|
924
|
-
return i == null ? r.default : (typeof i == "string" ? i.trim() : "") || (r.token.optional ?
|
|
924
|
+
return i == null ? r.default : (typeof i == "string" ? i.trim() : "") || (r.token.optional ? In(e, "accentColor", n) : r.default);
|
|
925
925
|
}
|
|
926
|
-
function
|
|
926
|
+
function Ln(e) {
|
|
927
927
|
let t = e ?? (typeof document > "u" ? null : document.documentElement);
|
|
928
928
|
return t && t.classList.contains("dark") ? "dark" : "light";
|
|
929
929
|
}
|
|
930
|
-
function
|
|
930
|
+
function Rn(e, t) {
|
|
931
931
|
let n = t ?? (typeof document > "u" ? null : document.documentElement);
|
|
932
932
|
if (!n || typeof MutationObserver > "u") return () => {};
|
|
933
|
-
let r =
|
|
933
|
+
let r = Bn(n);
|
|
934
934
|
return r.subscribers.add(e), r.ensure(), () => {
|
|
935
935
|
r.subscribers.delete(e), r.releaseIfIdle();
|
|
936
936
|
};
|
|
937
937
|
}
|
|
938
|
-
var
|
|
939
|
-
function
|
|
940
|
-
let t =
|
|
938
|
+
var zn = /* @__PURE__ */ new WeakMap();
|
|
939
|
+
function Bn(e) {
|
|
940
|
+
let t = zn.get(e);
|
|
941
941
|
if (t) return t;
|
|
942
942
|
let n = /* @__PURE__ */ new Set(), r, i = {
|
|
943
943
|
subscribers: n,
|
|
944
944
|
ensure() {
|
|
945
945
|
r || (r = new MutationObserver(() => {
|
|
946
|
-
let t =
|
|
946
|
+
let t = Ln(e);
|
|
947
947
|
for (let e of [...n]) try {
|
|
948
948
|
e(t);
|
|
949
949
|
} catch {}
|
|
@@ -953,16 +953,16 @@ function Vn(e) {
|
|
|
953
953
|
}));
|
|
954
954
|
},
|
|
955
955
|
releaseIfIdle() {
|
|
956
|
-
n.size > 0 || (r?.disconnect(), r = void 0,
|
|
956
|
+
n.size > 0 || (r?.disconnect(), r = void 0, zn.delete(e));
|
|
957
957
|
}
|
|
958
958
|
};
|
|
959
|
-
return
|
|
959
|
+
return zn.set(e, i), i;
|
|
960
960
|
}
|
|
961
|
-
var
|
|
961
|
+
var Vn = "canvas-theme-palette";
|
|
962
962
|
//#endregion
|
|
963
963
|
//#region src/host/themePaletteSettings.ts
|
|
964
|
-
function
|
|
965
|
-
let t =
|
|
964
|
+
function Hn(e) {
|
|
965
|
+
let t = Mn(), n = Object.keys(t)[0];
|
|
966
966
|
if (n && e.has(n)) return;
|
|
967
967
|
let r = /* @__PURE__ */ new Map();
|
|
968
968
|
for (let [e, n] of Object.entries(t)) {
|
|
@@ -971,30 +971,30 @@ function Un(e) {
|
|
|
971
971
|
}
|
|
972
972
|
for (let [t, n] of r) e.define(t, n, "canvas-render");
|
|
973
973
|
}
|
|
974
|
-
function
|
|
974
|
+
function Un(e, t) {
|
|
975
975
|
let n = t ?? (typeof document > "u" ? void 0 : document.documentElement);
|
|
976
976
|
if (!n) return () => {};
|
|
977
977
|
let r = () => {
|
|
978
|
-
let t = new Map(
|
|
979
|
-
for (let e of
|
|
978
|
+
let t = new Map(Fn((t) => e?.get(t)).map((e) => [e.name, e.value]));
|
|
979
|
+
for (let e of jn()) {
|
|
980
980
|
let r = t.get(e.cssVar);
|
|
981
981
|
r !== void 0 && r !== "" ? n.style.setProperty(e.cssVar, r) : n.style.removeProperty(e.cssVar);
|
|
982
982
|
}
|
|
983
983
|
};
|
|
984
984
|
if (r(), !e) return () => {};
|
|
985
985
|
let i = e.onChange((e) => {
|
|
986
|
-
|
|
986
|
+
Pn(e) && r();
|
|
987
987
|
});
|
|
988
988
|
return () => {
|
|
989
989
|
i.dispose();
|
|
990
|
-
for (let e of
|
|
990
|
+
for (let e of Nn()) n.style.removeProperty(e);
|
|
991
991
|
};
|
|
992
992
|
}
|
|
993
993
|
//#endregion
|
|
994
994
|
//#region src/contracts/themeModeSettings.ts
|
|
995
|
-
var
|
|
995
|
+
var Wn = "themeMode", Gn = "外观/主题模式", Kn = "dark", qn = { [Wn]: {
|
|
996
996
|
type: "select",
|
|
997
|
-
default:
|
|
997
|
+
default: Kn,
|
|
998
998
|
label: "主题模式",
|
|
999
999
|
description: "整界面亮色 / 暗色。切换后立即生效,并随其他设置一起记住(刷新不回退)。",
|
|
1000
1000
|
options: [{
|
|
@@ -1005,20 +1005,20 @@ var Gn = "themeMode", Kn = "外观/主题模式", qn = "dark", Jn = { [Gn]: {
|
|
|
1005
1005
|
label: "亮色"
|
|
1006
1006
|
}]
|
|
1007
1007
|
} };
|
|
1008
|
-
function
|
|
1009
|
-
let t = e(
|
|
1010
|
-
return t === "light" || t === "dark" ? t :
|
|
1008
|
+
function Jn(e) {
|
|
1009
|
+
let t = e(Wn);
|
|
1010
|
+
return t === "light" || t === "dark" ? t : Kn;
|
|
1011
1011
|
}
|
|
1012
|
-
function
|
|
1012
|
+
function Yn(e, t) {
|
|
1013
1013
|
let n = t ?? (typeof document > "u" ? void 0 : document.documentElement);
|
|
1014
1014
|
return n ? (n.classList.toggle("dark", e === "dark"), !0) : !1;
|
|
1015
1015
|
}
|
|
1016
|
-
function
|
|
1017
|
-
return e.has("themeMode") ? !1 : (e.define(
|
|
1016
|
+
function Xn(e) {
|
|
1017
|
+
return e.has("themeMode") ? !1 : (e.define(Gn, qn, "canvas-render"), !0);
|
|
1018
1018
|
}
|
|
1019
|
-
function
|
|
1019
|
+
function Zn(e, t) {
|
|
1020
1020
|
let n = () => {
|
|
1021
|
-
|
|
1021
|
+
Yn(Jn((t) => e?.get(t)), t);
|
|
1022
1022
|
};
|
|
1023
1023
|
if (n(), !e) return () => {};
|
|
1024
1024
|
let r = e.onChange((e) => {
|
|
@@ -1028,15 +1028,15 @@ function Qn(e, t) {
|
|
|
1028
1028
|
}
|
|
1029
1029
|
//#endregion
|
|
1030
1030
|
//#region src/contracts/useThemeColor.ts
|
|
1031
|
-
function
|
|
1032
|
-
let { ctx: n } = Xt(), r = n.get("settings"), i = (t) =>
|
|
1031
|
+
function Qn(e, t) {
|
|
1032
|
+
let { ctx: n } = Xt(), r = n.get("settings"), i = (t) => In((e) => r?.get(e), e, t) ?? "", a = T(i(Ln(t))), o = [];
|
|
1033
1033
|
if (r && typeof r.onChange == "function") {
|
|
1034
1034
|
let e = r.onChange(() => {
|
|
1035
|
-
a.value = i(
|
|
1035
|
+
a.value = i(Ln(t));
|
|
1036
1036
|
});
|
|
1037
1037
|
o.push(() => e.dispose());
|
|
1038
1038
|
}
|
|
1039
|
-
return o.push(
|
|
1039
|
+
return o.push(Rn((e) => {
|
|
1040
1040
|
a.value = i(e);
|
|
1041
1041
|
}, t)), v(() => {
|
|
1042
1042
|
for (let e of o) e();
|
|
@@ -1044,12 +1044,12 @@ function $n(e, t) {
|
|
|
1044
1044
|
}
|
|
1045
1045
|
//#endregion
|
|
1046
1046
|
//#region src/contracts/themePreview.ts
|
|
1047
|
-
var
|
|
1047
|
+
var $n = "theme-preview", er = {
|
|
1048
1048
|
x: 0,
|
|
1049
1049
|
y: 0,
|
|
1050
1050
|
w: 720,
|
|
1051
1051
|
h: 400
|
|
1052
|
-
},
|
|
1052
|
+
}, tr = Object.freeze([{
|
|
1053
1053
|
id: "preview-a",
|
|
1054
1054
|
kind: "text",
|
|
1055
1055
|
title: "灵感速记",
|
|
@@ -1066,7 +1066,7 @@ var er = "theme-preview", tr = {
|
|
|
1066
1066
|
w: 292,
|
|
1067
1067
|
h: 184
|
|
1068
1068
|
}]);
|
|
1069
|
-
function
|
|
1069
|
+
function nr(e) {
|
|
1070
1070
|
let t = Infinity, n = Infinity, r = -Infinity, i = -Infinity;
|
|
1071
1071
|
for (let a of e) !Number.isFinite(a.x) || !Number.isFinite(a.y) || a.w <= 0 || a.h <= 0 || (t = Math.min(t, a.x), n = Math.min(n, a.y), r = Math.max(r, a.x + a.w), i = Math.max(i, a.y + a.h));
|
|
1072
1072
|
return Number.isFinite(t) ? {
|
|
@@ -1076,7 +1076,7 @@ function rr(e) {
|
|
|
1076
1076
|
h: i - n
|
|
1077
1077
|
} : null;
|
|
1078
1078
|
}
|
|
1079
|
-
function
|
|
1079
|
+
function rr(e) {
|
|
1080
1080
|
let t = {};
|
|
1081
1081
|
for (let n of e) t[n.id] = {
|
|
1082
1082
|
x: n.x,
|
|
@@ -1086,7 +1086,7 @@ function ir(e) {
|
|
|
1086
1086
|
};
|
|
1087
1087
|
return t;
|
|
1088
1088
|
}
|
|
1089
|
-
var
|
|
1089
|
+
var ir = new Set([
|
|
1090
1090
|
"edgeFlowColor",
|
|
1091
1091
|
"alignGuideColor",
|
|
1092
1092
|
"multiSelectBoxColor",
|
|
@@ -1095,20 +1095,20 @@ var ar = new Set([
|
|
|
1095
1095
|
"pathColor",
|
|
1096
1096
|
"bladeColor"
|
|
1097
1097
|
]);
|
|
1098
|
-
function
|
|
1098
|
+
function ar(e, t, n, r) {
|
|
1099
1099
|
let i = e(t + (n === "dark" ? "Dark" : "Light")) ?? e(t);
|
|
1100
|
-
return (typeof i == "string" ? i.trim() : "") || (t !== "accentColor" &&
|
|
1100
|
+
return (typeof i == "string" ? i.trim() : "") || (t !== "accentColor" && ir.has(t) ? ar(e, "accentColor", n, r) : r);
|
|
1101
1101
|
}
|
|
1102
1102
|
//#endregion
|
|
1103
1103
|
//#region src/contracts/nodeSelection.ts
|
|
1104
|
-
function
|
|
1104
|
+
function or(e, t) {
|
|
1105
1105
|
return e ? e.ids.size === 1 && e.has(t) : !1;
|
|
1106
1106
|
}
|
|
1107
|
-
function
|
|
1107
|
+
function sr(e) {
|
|
1108
1108
|
let { ctx: t } = Wt(), n = T(!1), r = t.get("selection");
|
|
1109
1109
|
if (!r || typeof r.onChange != "function" || !r.ids) return n;
|
|
1110
1110
|
let i = () => {
|
|
1111
|
-
n.value =
|
|
1111
|
+
n.value = or(r, e);
|
|
1112
1112
|
};
|
|
1113
1113
|
i();
|
|
1114
1114
|
let a = r.onChange(i);
|
|
@@ -1116,12 +1116,12 @@ function cr(e) {
|
|
|
1116
1116
|
}
|
|
1117
1117
|
//#endregion
|
|
1118
1118
|
//#region src/crop/mediaFit.ts
|
|
1119
|
-
var
|
|
1119
|
+
var cr = [
|
|
1120
1120
|
"nw",
|
|
1121
1121
|
"ne",
|
|
1122
1122
|
"sw",
|
|
1123
1123
|
"se"
|
|
1124
|
-
],
|
|
1124
|
+
], lr = [
|
|
1125
1125
|
"nw",
|
|
1126
1126
|
"n",
|
|
1127
1127
|
"ne",
|
|
@@ -1130,12 +1130,12 @@ var lr = [
|
|
|
1130
1130
|
"s",
|
|
1131
1131
|
"sw",
|
|
1132
1132
|
"w"
|
|
1133
|
-
],
|
|
1134
|
-
function
|
|
1133
|
+
], ur = 20, dr = 8, fr = .8;
|
|
1134
|
+
function X(e, t = 1) {
|
|
1135
1135
|
return Number.isFinite(e) && e > 0 ? e : t;
|
|
1136
1136
|
}
|
|
1137
|
-
function
|
|
1138
|
-
let i =
|
|
1137
|
+
function pr(e, t, n, r) {
|
|
1138
|
+
let i = X(e), a = X(t), o = X(n), s = X(r), c = i / a, l = o / s, u, d, f, p;
|
|
1139
1139
|
return l > c ? (u = i, d = i / l, f = 0, p = (a - d) / 2) : (d = a, u = a * l, f = (i - u) / 2, p = 0), {
|
|
1140
1140
|
dw: u,
|
|
1141
1141
|
dh: d,
|
|
@@ -1144,28 +1144,28 @@ function mr(e, t, n, r) {
|
|
|
1144
1144
|
scale: u / o
|
|
1145
1145
|
};
|
|
1146
1146
|
}
|
|
1147
|
-
function
|
|
1148
|
-
return Math.max(20, 8 /
|
|
1147
|
+
function mr(e) {
|
|
1148
|
+
return Math.max(20, 8 / X(e));
|
|
1149
1149
|
}
|
|
1150
|
-
function
|
|
1151
|
-
let r =
|
|
1152
|
-
return
|
|
1150
|
+
function hr(e, t, n) {
|
|
1151
|
+
let r = X(e), i = X(t), a = Math.min(r, i) * fr;
|
|
1152
|
+
return _r({
|
|
1153
1153
|
x: (r - a) / 2,
|
|
1154
1154
|
y: (i - a) / 2,
|
|
1155
1155
|
width: a,
|
|
1156
1156
|
height: a
|
|
1157
|
-
}, r, i,
|
|
1157
|
+
}, r, i, mr(n));
|
|
1158
1158
|
}
|
|
1159
|
-
function
|
|
1159
|
+
function gr(e, t) {
|
|
1160
1160
|
return {
|
|
1161
1161
|
x: 0,
|
|
1162
1162
|
y: 0,
|
|
1163
|
-
width:
|
|
1164
|
-
height:
|
|
1163
|
+
width: X(e),
|
|
1164
|
+
height: X(t)
|
|
1165
1165
|
};
|
|
1166
1166
|
}
|
|
1167
|
-
function
|
|
1168
|
-
let i =
|
|
1167
|
+
function _r(e, t, n, r) {
|
|
1168
|
+
let i = X(t), a = X(n), o = Math.min(Math.max(r, 1), i), s = Math.min(Math.max(r, 1), a), c = Math.min(Math.max(e.width, o), i), l = Math.min(Math.max(e.height, s), a);
|
|
1169
1169
|
return {
|
|
1170
1170
|
x: Math.min(Math.max(e.x, 0), i - c),
|
|
1171
1171
|
y: Math.min(Math.max(e.y, 0), a - l),
|
|
@@ -1173,8 +1173,8 @@ function vr(e, t, n, r) {
|
|
|
1173
1173
|
height: l
|
|
1174
1174
|
};
|
|
1175
1175
|
}
|
|
1176
|
-
function
|
|
1177
|
-
let r =
|
|
1176
|
+
function vr(e, t, n) {
|
|
1177
|
+
let r = X(t), i = X(n), a = Math.min(e.x, 0), o = Math.min(e.y, 0), s = Math.max(e.x + e.width, r), c = Math.max(e.y + e.height, i);
|
|
1178
1178
|
return {
|
|
1179
1179
|
x: a,
|
|
1180
1180
|
y: o,
|
|
@@ -1182,16 +1182,16 @@ function yr(e, t, n) {
|
|
|
1182
1182
|
height: c - o
|
|
1183
1183
|
};
|
|
1184
1184
|
}
|
|
1185
|
-
function
|
|
1186
|
-
return
|
|
1185
|
+
function yr(e, t, n, r, i, a) {
|
|
1186
|
+
return _r({
|
|
1187
1187
|
...e,
|
|
1188
1188
|
x: e.x + t,
|
|
1189
1189
|
y: e.y + n
|
|
1190
1190
|
}, r, i, a);
|
|
1191
1191
|
}
|
|
1192
|
-
function
|
|
1193
|
-
let a =
|
|
1194
|
-
if (!(e.x <= 0 && e.y <= 0 && s >= a && c >= o)) return
|
|
1192
|
+
function br(e, t, n, r, i) {
|
|
1193
|
+
let a = X(r), o = X(i), s = e.x + e.width, c = e.y + e.height;
|
|
1194
|
+
if (!(e.x <= 0 && e.y <= 0 && s >= a && c >= o)) return vr(e, a, o);
|
|
1195
1195
|
let l = Math.max(a - s, Math.min(t, -e.x)), u = Math.max(o - c, Math.min(n, -e.y));
|
|
1196
1196
|
return {
|
|
1197
1197
|
x: e.x + l,
|
|
@@ -1200,28 +1200,28 @@ function xr(e, t, n, r, i) {
|
|
|
1200
1200
|
height: e.height
|
|
1201
1201
|
};
|
|
1202
1202
|
}
|
|
1203
|
-
function
|
|
1203
|
+
function xr(e) {
|
|
1204
1204
|
return e === "nw" || e === "w" || e === "sw";
|
|
1205
1205
|
}
|
|
1206
|
-
function
|
|
1206
|
+
function Sr(e) {
|
|
1207
1207
|
return e === "ne" || e === "e" || e === "se";
|
|
1208
1208
|
}
|
|
1209
|
-
function
|
|
1209
|
+
function Cr(e) {
|
|
1210
1210
|
return e === "nw" || e === "n" || e === "ne";
|
|
1211
1211
|
}
|
|
1212
|
-
function
|
|
1212
|
+
function wr(e) {
|
|
1213
1213
|
return e === "sw" || e === "s" || e === "se";
|
|
1214
1214
|
}
|
|
1215
|
-
function
|
|
1216
|
-
let s =
|
|
1217
|
-
if (
|
|
1215
|
+
function Tr(e, t, n, r, i, a, o) {
|
|
1216
|
+
let s = X(i), c = X(a), l = Math.min(Math.max(o, 1), s), u = Math.min(Math.max(o, 1), c), d = e.x + e.width, f = e.y + e.height, p = e.x, m = e.y, h = e.width, g = e.height;
|
|
1217
|
+
if (xr(t)) {
|
|
1218
1218
|
let t = Math.min(Math.max(e.x + n, 0), d - l);
|
|
1219
1219
|
p = t, h = d - t;
|
|
1220
|
-
} else
|
|
1221
|
-
if (
|
|
1220
|
+
} else Sr(t) && (h = Math.min(Math.max(e.width + n, l), s - e.x));
|
|
1221
|
+
if (Cr(t)) {
|
|
1222
1222
|
let t = Math.min(Math.max(e.y + r, 0), f - u);
|
|
1223
1223
|
m = t, g = f - t;
|
|
1224
|
-
} else
|
|
1224
|
+
} else wr(t) && (g = Math.min(Math.max(e.height + r, u), c - e.y));
|
|
1225
1225
|
return {
|
|
1226
1226
|
x: p,
|
|
1227
1227
|
y: m,
|
|
@@ -1229,16 +1229,16 @@ function Er(e, t, n, r, i, a, o) {
|
|
|
1229
1229
|
height: g
|
|
1230
1230
|
};
|
|
1231
1231
|
}
|
|
1232
|
-
function
|
|
1233
|
-
let o =
|
|
1234
|
-
return
|
|
1232
|
+
function Er(e, t, n, r, i, a) {
|
|
1233
|
+
let o = X(i), s = X(a), c = e.x + e.width, l = e.y + e.height, u = e.x, d = e.y, f = e.width, p = e.height;
|
|
1234
|
+
return xr(t) ? (u = Math.min(0, e.x + n), f = c - u) : Sr(t) && (f = Math.max(o - e.x, e.width + n)), Cr(t) ? (d = Math.min(0, e.y + r), p = l - d) : wr(t) && (p = Math.max(s - e.y, e.height + r)), {
|
|
1235
1235
|
x: u,
|
|
1236
1236
|
y: d,
|
|
1237
1237
|
width: f,
|
|
1238
1238
|
height: p
|
|
1239
1239
|
};
|
|
1240
1240
|
}
|
|
1241
|
-
function
|
|
1241
|
+
function Dr(e, t) {
|
|
1242
1242
|
return {
|
|
1243
1243
|
x: t.ox + e.x * t.scale,
|
|
1244
1244
|
y: t.oy + e.y * t.scale,
|
|
@@ -1246,18 +1246,18 @@ function Or(e, t) {
|
|
|
1246
1246
|
height: e.height * t.scale
|
|
1247
1247
|
};
|
|
1248
1248
|
}
|
|
1249
|
-
function
|
|
1250
|
-
let i =
|
|
1249
|
+
function Or(e, t, n, r = 1) {
|
|
1250
|
+
let i = X(n) * X(r);
|
|
1251
1251
|
return {
|
|
1252
1252
|
dx: e / i,
|
|
1253
1253
|
dy: t / i
|
|
1254
1254
|
};
|
|
1255
1255
|
}
|
|
1256
|
-
function
|
|
1257
|
-
let n =
|
|
1256
|
+
function kr(e, t) {
|
|
1257
|
+
let n = X(t, 0), r = X(e, 0);
|
|
1258
1258
|
return n <= 0 || r <= 0 ? 1 : r / n;
|
|
1259
1259
|
}
|
|
1260
|
-
function
|
|
1260
|
+
function Ar(e) {
|
|
1261
1261
|
let t = Math.round(e.x), n = Math.round(e.y);
|
|
1262
1262
|
return {
|
|
1263
1263
|
x: t,
|
|
@@ -1266,12 +1266,12 @@ function jr(e) {
|
|
|
1266
1266
|
height: Math.max(1, Math.round(e.y + e.height) - n)
|
|
1267
1267
|
};
|
|
1268
1268
|
}
|
|
1269
|
-
function
|
|
1269
|
+
function jr(e) {
|
|
1270
1270
|
return e ? Number.isFinite(e.x) && Number.isFinite(e.y) && Number.isFinite(e.width) && Number.isFinite(e.height) && e.width > 0 && e.height > 0 : !1;
|
|
1271
1271
|
}
|
|
1272
|
-
function
|
|
1273
|
-
if (!
|
|
1274
|
-
let r =
|
|
1272
|
+
function Mr(e, t, n) {
|
|
1273
|
+
if (!jr(e)) return {};
|
|
1274
|
+
let r = X(t, 0), i = X(n, 0);
|
|
1275
1275
|
if (r <= 0 || i <= 0) return {};
|
|
1276
1276
|
let a = (e) => String(e * 100) + "%";
|
|
1277
1277
|
return {
|
|
@@ -1281,12 +1281,12 @@ function Nr(e, t, n) {
|
|
|
1281
1281
|
top: a(-e.y / e.height)
|
|
1282
1282
|
};
|
|
1283
1283
|
}
|
|
1284
|
-
function
|
|
1285
|
-
let a =
|
|
1284
|
+
function Nr(e, t, n, r, i) {
|
|
1285
|
+
let a = Mr(e, t, n);
|
|
1286
1286
|
if (Object.keys(a).length === 0) return a;
|
|
1287
|
-
let o =
|
|
1287
|
+
let o = X(r ?? 0, 0), s = X(i ?? 0, 0);
|
|
1288
1288
|
if (o <= 0 || s <= 0) return a;
|
|
1289
|
-
let c = e, l =
|
|
1289
|
+
let c = e, l = X(t, 0), u = X(n, 0);
|
|
1290
1290
|
if (l <= 0 || u <= 0) return a;
|
|
1291
1291
|
let d = Math.max(o / c.width, s / c.height);
|
|
1292
1292
|
if (!Number.isFinite(d) || d <= 0) return a;
|
|
@@ -1302,7 +1302,7 @@ function Pr(e, t, n, r, i) {
|
|
|
1302
1302
|
}
|
|
1303
1303
|
//#endregion
|
|
1304
1304
|
//#region src/crop/cropRatio.ts
|
|
1305
|
-
var
|
|
1305
|
+
var Pr = [
|
|
1306
1306
|
{
|
|
1307
1307
|
value: "free",
|
|
1308
1308
|
label: "自由",
|
|
@@ -1343,15 +1343,15 @@ var Fr = [
|
|
|
1343
1343
|
label: "2:3",
|
|
1344
1344
|
ratio: 2 / 3
|
|
1345
1345
|
}
|
|
1346
|
-
],
|
|
1347
|
-
function
|
|
1346
|
+
], Fr = "free";
|
|
1347
|
+
function Ir(e) {
|
|
1348
1348
|
if (!e) return null;
|
|
1349
|
-
let t =
|
|
1349
|
+
let t = Pr.find((t) => t.value === e);
|
|
1350
1350
|
if (!t) return null;
|
|
1351
1351
|
let n = t.ratio;
|
|
1352
1352
|
return typeof n == "number" && Number.isFinite(n) && n > 0 ? n : null;
|
|
1353
1353
|
}
|
|
1354
|
-
function
|
|
1354
|
+
function Lr(e, t, n) {
|
|
1355
1355
|
if (t === null || !Number.isFinite(t) || t <= 0 || !(e.width > 0) || !(e.height > 0)) return e;
|
|
1356
1356
|
let r = n.width > 0 ? n.width : e.width, i = n.height > 0 ? n.height : e.height, a = n.minEdge && n.minEdge > 0 ? n.minEdge : 1, o = Math.min(e.width, e.height), s = t >= 1 ? o * t : o, c = t >= 1 ? o : o / t, l = Math.min(1, r / s, i / c);
|
|
1357
1357
|
s *= l, c *= l;
|
|
@@ -1367,14 +1367,14 @@ function Rr(e, t, n) {
|
|
|
1367
1367
|
}
|
|
1368
1368
|
//#endregion
|
|
1369
1369
|
//#region src/crop/editingViewport.ts
|
|
1370
|
-
function
|
|
1370
|
+
function Rr(e, t) {
|
|
1371
1371
|
return typeof e == "number" && Number.isFinite(e) && e > 0 ? e : t;
|
|
1372
1372
|
}
|
|
1373
|
-
var
|
|
1374
|
-
function
|
|
1375
|
-
let t =
|
|
1373
|
+
var zr = .6, Br = .1, Vr = 4;
|
|
1374
|
+
function Hr(e) {
|
|
1375
|
+
let t = Rr(e.node.width, 0), n = Rr(e.node.height, 0), r = Rr(e.visible.width, 0), i = Rr(e.visible.height, 0);
|
|
1376
1376
|
if (t <= 0 || n <= 0 || r <= 0 || i <= 0) return null;
|
|
1377
|
-
let a = typeof e.margin == "number" && Number.isFinite(e.margin) && e.margin >= 0 ? e.margin :
|
|
1377
|
+
let a = typeof e.margin == "number" && Number.isFinite(e.margin) && e.margin >= 0 ? e.margin : zr;
|
|
1378
1378
|
return {
|
|
1379
1379
|
node: {
|
|
1380
1380
|
x: e.node.x,
|
|
@@ -1388,14 +1388,14 @@ function Ur(e) {
|
|
|
1388
1388
|
width: r,
|
|
1389
1389
|
height: i
|
|
1390
1390
|
},
|
|
1391
|
-
zoom:
|
|
1391
|
+
zoom: Rr(e.zoom, 1),
|
|
1392
1392
|
margin: a,
|
|
1393
|
-
minZoom:
|
|
1394
|
-
maxZoom:
|
|
1393
|
+
minZoom: Rr(e.minZoom, Br),
|
|
1394
|
+
maxZoom: Rr(e.maxZoom, 4)
|
|
1395
1395
|
};
|
|
1396
1396
|
}
|
|
1397
|
-
function
|
|
1398
|
-
let t =
|
|
1397
|
+
function Ur(e) {
|
|
1398
|
+
let t = Hr(e);
|
|
1399
1399
|
if (!t) return null;
|
|
1400
1400
|
let n = t.node.width * (1 + t.margin * 2), r = t.node.height * (1 + t.margin * 2), i = t.visible.width * t.zoom, a = t.visible.height * t.zoom, o = Math.min(i / n, a / r), s = Math.min(Math.max(o, t.minZoom), t.maxZoom);
|
|
1401
1401
|
return {
|
|
@@ -1404,8 +1404,8 @@ function Wr(e) {
|
|
|
1404
1404
|
zoom: s
|
|
1405
1405
|
};
|
|
1406
1406
|
}
|
|
1407
|
-
function
|
|
1408
|
-
let t =
|
|
1407
|
+
function Wr(e) {
|
|
1408
|
+
let t = Hr(e);
|
|
1409
1409
|
if (!t) return !1;
|
|
1410
1410
|
let n = t.node.width * t.margin, r = t.node.height * t.margin;
|
|
1411
1411
|
if (t.node.width + n * 2 > t.visible.width + .5 || t.node.height + r * 2 > t.visible.height + .5) return !0;
|
|
@@ -1414,7 +1414,7 @@ function Gr(e) {
|
|
|
1414
1414
|
}
|
|
1415
1415
|
//#endregion
|
|
1416
1416
|
//#region src/crop/fitEditingNode.ts
|
|
1417
|
-
function
|
|
1417
|
+
function Gr(e, t) {
|
|
1418
1418
|
let n = e.get("view"), r = n?.getNodeRect(t);
|
|
1419
1419
|
if (!r || !n) return !1;
|
|
1420
1420
|
let i = n.getPaneEl?.() ?? null, a = i?.clientWidth ?? (typeof window < "u" ? window.innerWidth : 0), o = i?.clientHeight ?? (typeof window < "u" ? window.innerHeight : 0);
|
|
@@ -1434,21 +1434,21 @@ function Kr(e, t) {
|
|
|
1434
1434
|
},
|
|
1435
1435
|
zoom: c
|
|
1436
1436
|
};
|
|
1437
|
-
if (!
|
|
1438
|
-
let u =
|
|
1437
|
+
if (!Wr(l)) return !1;
|
|
1438
|
+
let u = Ur(l);
|
|
1439
1439
|
return u ? (n.setCenter(u.centerX, u.centerY, u.zoom), !0) : !1;
|
|
1440
1440
|
}
|
|
1441
1441
|
//#endregion
|
|
1442
1442
|
//#region src/crop/MediaFrameOverlay.vue?vue&type=script&setup=true&lang.ts
|
|
1443
|
-
var
|
|
1443
|
+
var Kr = { class: "mfo-size" }, qr = {
|
|
1444
1444
|
key: 0,
|
|
1445
1445
|
class: "mfo-grid",
|
|
1446
1446
|
"aria-hidden": "true"
|
|
1447
|
-
},
|
|
1447
|
+
}, Jr = [
|
|
1448
1448
|
"title",
|
|
1449
1449
|
"aria-label",
|
|
1450
1450
|
"onPointerdown"
|
|
1451
|
-
],
|
|
1451
|
+
], Yr = /*@__PURE__*/ u({
|
|
1452
1452
|
__name: "MediaFrameOverlay",
|
|
1453
1453
|
props: {
|
|
1454
1454
|
mode: { default: "crop" },
|
|
@@ -1467,22 +1467,22 @@ var qr = { class: "mfo-size" }, Jr = {
|
|
|
1467
1467
|
"update:ratioValue"
|
|
1468
1468
|
],
|
|
1469
1469
|
setup(e, { emit: n }) {
|
|
1470
|
-
let r = e, a = n, l = T(null), u = T(1), d = T(1), f = T(1), p = i(() => r.mediaWidth > 0 ? r.mediaWidth : u.value), m = i(() => r.mediaHeight > 0 ? r.mediaHeight : d.value), h = i(() =>
|
|
1470
|
+
let r = e, a = n, l = T(null), u = T(1), d = T(1), f = T(1), p = i(() => r.mediaWidth > 0 ? r.mediaWidth : u.value), m = i(() => r.mediaHeight > 0 ? r.mediaHeight : d.value), h = i(() => pr(u.value, d.value, p.value, m.value)), g = i(() => mr(h.value.scale)), b = i(() => r.mode === "expand"), x = lr, C = T({
|
|
1471
1471
|
x: 0,
|
|
1472
1472
|
y: 0,
|
|
1473
1473
|
width: 0,
|
|
1474
1474
|
height: 0
|
|
1475
1475
|
});
|
|
1476
1476
|
function w(e) {
|
|
1477
|
-
return b.value ?
|
|
1477
|
+
return b.value ? vr(e, p.value, m.value) : _r(e, p.value, m.value, g.value);
|
|
1478
1478
|
}
|
|
1479
1479
|
function D() {
|
|
1480
1480
|
let e = r.draftRect ?? r.initialRect;
|
|
1481
|
-
return
|
|
1481
|
+
return jr(e) ? w(e) : b.value ? gr(p.value, m.value) : hr(p.value, m.value, h.value.scale);
|
|
1482
1482
|
}
|
|
1483
1483
|
N(() => r.ratioValue, (e) => {
|
|
1484
1484
|
if (r.mode !== "crop") return;
|
|
1485
|
-
let t =
|
|
1485
|
+
let t = Lr(C.value, Ir(e), {
|
|
1486
1486
|
width: p.value,
|
|
1487
1487
|
height: m.value,
|
|
1488
1488
|
minEdge: g.value
|
|
@@ -1494,7 +1494,7 @@ var qr = { class: "mfo-size" }, Jr = {
|
|
|
1494
1494
|
let e = l.value;
|
|
1495
1495
|
if (!e) return;
|
|
1496
1496
|
let t = e.clientWidth, n = e.clientHeight;
|
|
1497
|
-
t > 0 && n > 0 && (u.value = t, d.value = n), f.value =
|
|
1497
|
+
t > 0 && n > 0 && (u.value = t, d.value = n), f.value = kr(e.getBoundingClientRect().width, t);
|
|
1498
1498
|
}
|
|
1499
1499
|
let P = null;
|
|
1500
1500
|
function F(e, t) {
|
|
@@ -1514,7 +1514,7 @@ var qr = { class: "mfo-size" }, Jr = {
|
|
|
1514
1514
|
function I(e) {
|
|
1515
1515
|
if (!O) return;
|
|
1516
1516
|
e.stopPropagation();
|
|
1517
|
-
let t =
|
|
1517
|
+
let t = Or(e.clientX - O.startX, e.clientY - O.startY, h.value.scale, f.value), n = O.kind === "move" ? b.value ? br(O.from, t.dx, t.dy, p.value, m.value) : yr(O.from, t.dx, t.dy, p.value, m.value, g.value) : b.value ? Er(O.from, O.dir, t.dx, t.dy, p.value, m.value) : Tr(O.from, O.dir, t.dx, t.dy, p.value, m.value, g.value);
|
|
1518
1518
|
C.value = n, a("update:draft", n);
|
|
1519
1519
|
}
|
|
1520
1520
|
function L(e) {
|
|
@@ -1535,7 +1535,7 @@ var qr = { class: "mfo-size" }, Jr = {
|
|
|
1535
1535
|
}), v(() => {
|
|
1536
1536
|
window.removeEventListener("keydown", R), P?.disconnect(), P = null, O = null, k.value = !1;
|
|
1537
1537
|
});
|
|
1538
|
-
let B = i(() =>
|
|
1538
|
+
let B = i(() => Dr(C.value, h.value)), V = i(() => ({
|
|
1539
1539
|
left: U(B.value.x),
|
|
1540
1540
|
top: U(B.value.y),
|
|
1541
1541
|
width: W(B.value.width),
|
|
@@ -1673,7 +1673,7 @@ var qr = { class: "mfo-size" }, Jr = {
|
|
|
1673
1673
|
class: "mfo-frame",
|
|
1674
1674
|
style: _(V.value),
|
|
1675
1675
|
onPointerdown: F
|
|
1676
|
-
}, [c("span",
|
|
1676
|
+
}, [c("span", Kr, j(G.value), 1), k.value ? (S(), s("div", qr, [...n[0] ||= [
|
|
1677
1677
|
c("span", {
|
|
1678
1678
|
class: "mfo-grid-line mfo-grid-line--h",
|
|
1679
1679
|
style: { top: "33.333%" }
|
|
@@ -1699,16 +1699,16 @@ var qr = { class: "mfo-size" }, Jr = {
|
|
|
1699
1699
|
title: "拖动调整(" + e + ")",
|
|
1700
1700
|
"aria-label": "拖动调整(" + e + ")",
|
|
1701
1701
|
onPointerdown: (t) => F(t, e)
|
|
1702
|
-
}, null, 44,
|
|
1702
|
+
}, null, 44, Jr))), 128))
|
|
1703
1703
|
], 544));
|
|
1704
1704
|
}
|
|
1705
|
-
}),
|
|
1705
|
+
}), Xr = (e, t) => {
|
|
1706
1706
|
let n = e.__vccOpts || e;
|
|
1707
1707
|
for (let [e, r] of t) n[e] = r;
|
|
1708
1708
|
return n;
|
|
1709
|
-
},
|
|
1710
|
-
function
|
|
1711
|
-
let t = `[v2:${e}]`, n = () =>
|
|
1709
|
+
}, Zr = /*#__PURE__*/ Xr(Yr, [["__scopeId", "data-v-ef25dfdd"]]), Qr = {};
|
|
1710
|
+
function $r(e) {
|
|
1711
|
+
let t = `[v2:${e}]`, n = () => Qr[e] !== !1;
|
|
1712
1712
|
return {
|
|
1713
1713
|
debug: (...e) => {
|
|
1714
1714
|
n() && typeof localStorage < "u" && localStorage.getItem("v2debug") === "1" && console.log(t, ...e);
|
|
@@ -1726,7 +1726,7 @@ function ei(e) {
|
|
|
1726
1726
|
}
|
|
1727
1727
|
//#endregion
|
|
1728
1728
|
//#region ../vue-render/src/SlotHost.vue
|
|
1729
|
-
var
|
|
1729
|
+
var ei = /* @__PURE__ */ u({
|
|
1730
1730
|
__name: "SlotHost",
|
|
1731
1731
|
props: {
|
|
1732
1732
|
slot: {},
|
|
@@ -1766,7 +1766,7 @@ var ti = /* @__PURE__ */ u({
|
|
|
1766
1766
|
"data-slot-after"
|
|
1767
1767
|
]))), 128));
|
|
1768
1768
|
}
|
|
1769
|
-
}),
|
|
1769
|
+
}), ti = ["d"], ni = /* @__PURE__ */ u({
|
|
1770
1770
|
__name: "ConnectionLineHost",
|
|
1771
1771
|
props: {
|
|
1772
1772
|
lineProps: {},
|
|
@@ -1811,12 +1811,12 @@ var ti = /* @__PURE__ */ u({
|
|
|
1811
1811
|
stroke: "var(--ui-edge-rail, #b1b1b7)",
|
|
1812
1812
|
"stroke-width": "1.5",
|
|
1813
1813
|
"stroke-dasharray": "5 5"
|
|
1814
|
-
}, null, 8,
|
|
1814
|
+
}, null, 8, ti));
|
|
1815
1815
|
}
|
|
1816
1816
|
});
|
|
1817
1817
|
//#endregion
|
|
1818
1818
|
//#region src/host/useNodeMeasure.ts
|
|
1819
|
-
function
|
|
1819
|
+
function ri(e) {
|
|
1820
1820
|
if (!e) return null;
|
|
1821
1821
|
let t = e.querySelector(".vue-flow__nodes");
|
|
1822
1822
|
if (t) return t;
|
|
@@ -1826,7 +1826,7 @@ function ii(e) {
|
|
|
1826
1826
|
}
|
|
1827
1827
|
return e;
|
|
1828
1828
|
}
|
|
1829
|
-
function
|
|
1829
|
+
function ii(e) {
|
|
1830
1830
|
let { nodeLayout: t, container: n, scheduleImmediate: r = (e) => requestAnimationFrame(e) } = e, i = /* @__PURE__ */ new Set(), a = typeof ResizeObserver < "u" && typeof MutationObserver < "u", o = null, s = null;
|
|
1831
1831
|
function c() {
|
|
1832
1832
|
return a ? (o || (o = new ResizeObserver((e) => {
|
|
@@ -1878,21 +1878,21 @@ function ai(e) {
|
|
|
1878
1878
|
}
|
|
1879
1879
|
//#endregion
|
|
1880
1880
|
//#region src/host/rapidModeStyle.ts
|
|
1881
|
-
var
|
|
1882
|
-
function
|
|
1883
|
-
if (e) for (let [t, n] of Object.entries(
|
|
1881
|
+
var ai = { backfaceVisibility: "hidden" };
|
|
1882
|
+
function oi(e) {
|
|
1883
|
+
if (e) for (let [t, n] of Object.entries(ai)) e.style[t] = n;
|
|
1884
1884
|
}
|
|
1885
|
-
function
|
|
1886
|
-
if (e) for (let t of Object.keys(
|
|
1885
|
+
function si(e) {
|
|
1886
|
+
if (e) for (let t of Object.keys(ai)) e.style[t] = "";
|
|
1887
1887
|
}
|
|
1888
1888
|
//#endregion
|
|
1889
1889
|
//#region src/host/paneSize.ts
|
|
1890
|
-
function
|
|
1890
|
+
function ci(e) {
|
|
1891
1891
|
if (!e || typeof e.getBoundingClientRect != "function") return null;
|
|
1892
1892
|
let t = e.getBoundingClientRect();
|
|
1893
1893
|
return !(t.width > 0) || !(t.height > 0) ? null : t;
|
|
1894
1894
|
}
|
|
1895
|
-
function
|
|
1895
|
+
function li(e) {
|
|
1896
1896
|
let t = null, n = null, r = !1, i = -1, a = -1, o = !1, s = typeof ResizeObserver < "u";
|
|
1897
1897
|
function c(t) {
|
|
1898
1898
|
if (!o) {
|
|
@@ -1904,7 +1904,7 @@ function ui(e) {
|
|
|
1904
1904
|
}
|
|
1905
1905
|
}
|
|
1906
1906
|
function l() {
|
|
1907
|
-
c(
|
|
1907
|
+
c(ci(t));
|
|
1908
1908
|
}
|
|
1909
1909
|
function u() {
|
|
1910
1910
|
l();
|
|
@@ -1934,24 +1934,24 @@ function ui(e) {
|
|
|
1934
1934
|
}
|
|
1935
1935
|
//#endregion
|
|
1936
1936
|
//#region src/geometry/visibleArea.ts
|
|
1937
|
-
function
|
|
1937
|
+
function ui(e) {
|
|
1938
1938
|
return e === 0 ? 0 : e;
|
|
1939
1939
|
}
|
|
1940
|
-
function
|
|
1940
|
+
function di(e, t, n) {
|
|
1941
1941
|
let r = e.zoom || 1;
|
|
1942
1942
|
return {
|
|
1943
|
-
x:
|
|
1944
|
-
y:
|
|
1943
|
+
x: ui(-e.x / r),
|
|
1944
|
+
y: ui(-e.y / r),
|
|
1945
1945
|
w: t / r,
|
|
1946
1946
|
h: n / r
|
|
1947
1947
|
};
|
|
1948
1948
|
}
|
|
1949
|
-
function
|
|
1949
|
+
function fi(e, t) {
|
|
1950
1950
|
if (e.w <= 0 || e.h <= 0 || t.w <= 0 || t.h <= 0) return !1;
|
|
1951
1951
|
let n = e.x + e.w, r = e.y + e.h, i = t.x + t.w, a = t.y + t.h;
|
|
1952
1952
|
return e.x < i && n > t.x && e.y < a && r > t.y;
|
|
1953
1953
|
}
|
|
1954
|
-
function
|
|
1954
|
+
function pi(e, t) {
|
|
1955
1955
|
return {
|
|
1956
1956
|
x: e.x - t,
|
|
1957
1957
|
y: e.y - t,
|
|
@@ -1961,12 +1961,12 @@ function mi(e, t) {
|
|
|
1961
1961
|
}
|
|
1962
1962
|
//#endregion
|
|
1963
1963
|
//#region src/host/instanceDom.ts
|
|
1964
|
-
function
|
|
1964
|
+
function mi(e, t) {
|
|
1965
1965
|
return e ? e.querySelector(`.vue-flow__node[data-id="${t}"]`) : null;
|
|
1966
1966
|
}
|
|
1967
1967
|
//#endregion
|
|
1968
1968
|
//#region src/host/CanvasSurface.vue
|
|
1969
|
-
var
|
|
1969
|
+
var hi = /*#__PURE__*/ Xr(/* @__PURE__ */ u({
|
|
1970
1970
|
__name: "CanvasSurface",
|
|
1971
1971
|
props: {
|
|
1972
1972
|
host: {},
|
|
@@ -2027,13 +2027,13 @@ var gi = /*#__PURE__*/ Zr(/* @__PURE__ */ u({
|
|
|
2027
2027
|
zoom: e.zoom
|
|
2028
2028
|
});
|
|
2029
2029
|
}, { immediate: !0 });
|
|
2030
|
-
let g = A(null), b = T(null), x =
|
|
2030
|
+
let g = A(null), b = T(null), x = li((e) => {
|
|
2031
2031
|
g.value = e, f.setPaneRect(e);
|
|
2032
2032
|
});
|
|
2033
2033
|
N(g, R);
|
|
2034
2034
|
function w() {
|
|
2035
2035
|
let e = j.value;
|
|
2036
|
-
b.value = e?.querySelector(".vue-flow__pane") ?? null, F.value =
|
|
2036
|
+
b.value = e?.querySelector(".vue-flow__pane") ?? null, F.value = ri(e), x.observe(b.value);
|
|
2037
2037
|
}
|
|
2038
2038
|
let E = T(null);
|
|
2039
2039
|
C(Zt, E);
|
|
@@ -2050,13 +2050,13 @@ var gi = /*#__PURE__*/ Zr(/* @__PURE__ */ u({
|
|
|
2050
2050
|
I.value = null;
|
|
2051
2051
|
return;
|
|
2052
2052
|
}
|
|
2053
|
-
I.value =
|
|
2053
|
+
I.value = di(h.value, e.width, e.height);
|
|
2054
2054
|
}
|
|
2055
2055
|
N(h, R);
|
|
2056
2056
|
let z = null;
|
|
2057
2057
|
N(h, () => {
|
|
2058
|
-
n.interactionSettings.dragRapidMode && (
|
|
2059
|
-
z = null,
|
|
2058
|
+
n.interactionSettings.dragRapidMode && (oi(j.value?.querySelector(".vue-flow__nodes")), z && clearTimeout(z), z = setTimeout(() => {
|
|
2059
|
+
z = null, si(j.value?.querySelector(".vue-flow__nodes"));
|
|
2060
2060
|
}, 300));
|
|
2061
2061
|
}), N(I, (e) => {
|
|
2062
2062
|
n.onVisibleRectChange?.(e);
|
|
@@ -2078,8 +2078,8 @@ var gi = /*#__PURE__*/ Zr(/* @__PURE__ */ u({
|
|
|
2078
2078
|
function G(e = 0) {
|
|
2079
2079
|
let t = I.value;
|
|
2080
2080
|
if (!t) return [];
|
|
2081
|
-
let n = e > 0 ?
|
|
2082
|
-
return u.get("view").getAllRects().filter((e) =>
|
|
2081
|
+
let n = e > 0 ? pi(t, e) : t;
|
|
2082
|
+
return u.get("view").getAllRects().filter((e) => fi(e, n));
|
|
2083
2083
|
}
|
|
2084
2084
|
C(Ut, {
|
|
2085
2085
|
ctx: r.ctx,
|
|
@@ -2099,7 +2099,7 @@ var gi = /*#__PURE__*/ Zr(/* @__PURE__ */ u({
|
|
|
2099
2099
|
visibleRect: I,
|
|
2100
2100
|
visibleNodes: G
|
|
2101
2101
|
});
|
|
2102
|
-
let te =
|
|
2102
|
+
let te = ii({
|
|
2103
2103
|
nodeLayout: r.view,
|
|
2104
2104
|
container: () => F.value
|
|
2105
2105
|
});
|
|
@@ -2163,7 +2163,7 @@ var gi = /*#__PURE__*/ Zr(/* @__PURE__ */ u({
|
|
|
2163
2163
|
getRootEl: () => j.value,
|
|
2164
2164
|
getRendererEl: () => F.value,
|
|
2165
2165
|
getPaneEl: () => b.value,
|
|
2166
|
-
queryNodeEl: (e) =>
|
|
2166
|
+
queryNodeEl: (e) => mi(j.value, e)
|
|
2167
2167
|
};
|
|
2168
2168
|
n.host?.view.attachBackend(e), f.attachFlow(e), f.attachNodeVisual(d), f.attachPositionReader((e) => {
|
|
2169
2169
|
let t = (d.getNodes.value ?? []).find((t) => t.id === e);
|
|
@@ -2172,17 +2172,17 @@ var gi = /*#__PURE__*/ Zr(/* @__PURE__ */ u({
|
|
|
2172
2172
|
rootEl: () => j.value,
|
|
2173
2173
|
rendererEl: () => F.value,
|
|
2174
2174
|
paneEl: () => b.value,
|
|
2175
|
-
queryNodeEl: (e) =>
|
|
2175
|
+
queryNodeEl: (e) => mi(j.value, e)
|
|
2176
2176
|
}, g.value), te.start();
|
|
2177
2177
|
}), N(() => n.nodeEpoch, () => {
|
|
2178
2178
|
j.value && (w(), f.attachDom({
|
|
2179
2179
|
rootEl: () => j.value,
|
|
2180
2180
|
rendererEl: () => F.value,
|
|
2181
2181
|
paneEl: () => b.value,
|
|
2182
|
-
queryNodeEl: (e) =>
|
|
2182
|
+
queryNodeEl: (e) => mi(j.value, e)
|
|
2183
2183
|
}, g.value), te.start());
|
|
2184
2184
|
}, { flush: "post" }), t({
|
|
2185
|
-
queryNodeEl: (e) =>
|
|
2185
|
+
queryNodeEl: (e) => mi(j.value, e),
|
|
2186
2186
|
getViewport: () => {
|
|
2187
2187
|
let e = d.viewport.value;
|
|
2188
2188
|
return e ? {
|
|
@@ -2322,7 +2322,7 @@ var gi = /*#__PURE__*/ Zr(/* @__PURE__ */ u({
|
|
|
2322
2322
|
onEdgeContextMenu: e.onEdgeContextMenu,
|
|
2323
2323
|
onPaneContextMenu: e.onPaneContextMenu
|
|
2324
2324
|
}, {
|
|
2325
|
-
"connection-line": P((t) => [l(
|
|
2325
|
+
"connection-line": P((t) => [l(ni, {
|
|
2326
2326
|
"line-props": t,
|
|
2327
2327
|
"connection-line": e.connectionLineComp,
|
|
2328
2328
|
state: e.connectionState,
|
|
@@ -2339,7 +2339,7 @@ var gi = /*#__PURE__*/ Zr(/* @__PURE__ */ u({
|
|
|
2339
2339
|
c("div", {
|
|
2340
2340
|
class: "csurface-overlay",
|
|
2341
2341
|
style: _({ zIndex: M(K).overlay })
|
|
2342
|
-
}, [l(
|
|
2342
|
+
}, [l(ei, {
|
|
2343
2343
|
slot: "overlay",
|
|
2344
2344
|
"item-class": "csurface-overlay-item"
|
|
2345
2345
|
})], 4),
|
|
@@ -2358,7 +2358,7 @@ var gi = /*#__PURE__*/ Zr(/* @__PURE__ */ u({
|
|
|
2358
2358
|
}), [["__scopeId", "data-v-118f8447"]]);
|
|
2359
2359
|
//#endregion
|
|
2360
2360
|
//#region src/host/canvasHostCore.ts
|
|
2361
|
-
function
|
|
2361
|
+
function gi(e) {
|
|
2362
2362
|
let { size: t, ...n } = e;
|
|
2363
2363
|
return t === void 0 ? { data: n } : {
|
|
2364
2364
|
data: n,
|
|
@@ -2368,7 +2368,7 @@ function _i(e) {
|
|
|
2368
2368
|
}
|
|
2369
2369
|
};
|
|
2370
2370
|
}
|
|
2371
|
-
function
|
|
2371
|
+
function _i(e, t, n, r, i) {
|
|
2372
2372
|
return e.getNodes().map((a) => {
|
|
2373
2373
|
let o = t ? t.has(a.id) : !1, s = {
|
|
2374
2374
|
id: a.id,
|
|
@@ -2403,7 +2403,7 @@ function vi(e, t, n, r, i) {
|
|
|
2403
2403
|
}), Le(a) && (s.draggable = !1, s.selectable = !1, s.deletable = !1, s.focusable = !1, s.zIndex = K.tempNode), s;
|
|
2404
2404
|
});
|
|
2405
2405
|
}
|
|
2406
|
-
function
|
|
2406
|
+
function vi(e, t) {
|
|
2407
2407
|
return !t || t.size === 0 ? e : e.map((e) => {
|
|
2408
2408
|
let n = t.get(e.id);
|
|
2409
2409
|
return n ? {
|
|
@@ -2415,7 +2415,7 @@ function yi(e, t) {
|
|
|
2415
2415
|
} : e;
|
|
2416
2416
|
});
|
|
2417
2417
|
}
|
|
2418
|
-
function
|
|
2418
|
+
function yi(e, t, n, r) {
|
|
2419
2419
|
let i = /* @__PURE__ */ new Set();
|
|
2420
2420
|
for (let t of e) i.add(t);
|
|
2421
2421
|
for (let e of r ?? []) i.add(e);
|
|
@@ -2430,10 +2430,10 @@ function bi(e, t, n, r) {
|
|
|
2430
2430
|
for (let e = 0; e < o.length; e++) for (let t of a.get(o[e]) ?? []) i.has(t) || (i.add(t), o.push(t));
|
|
2431
2431
|
return i;
|
|
2432
2432
|
}
|
|
2433
|
-
function
|
|
2433
|
+
function bi(e, t, n) {
|
|
2434
2434
|
return e || t > 0 || n;
|
|
2435
2435
|
}
|
|
2436
|
-
function
|
|
2436
|
+
function xi(e, t, n, r, i) {
|
|
2437
2437
|
let a = /* @__PURE__ */ new Set();
|
|
2438
2438
|
for (let o of e) if (t.has(o)) {
|
|
2439
2439
|
if (n) {
|
|
@@ -2444,20 +2444,20 @@ function Si(e, t, n, r, i) {
|
|
|
2444
2444
|
}
|
|
2445
2445
|
return a;
|
|
2446
2446
|
}
|
|
2447
|
-
function
|
|
2447
|
+
function Si(e, t) {
|
|
2448
2448
|
return e.filter((e) => t.has(e.source) && t.has(e.target));
|
|
2449
2449
|
}
|
|
2450
|
-
function
|
|
2450
|
+
function Ci(e, t) {
|
|
2451
2451
|
for (let n of t) if (e.x >= n.x && e.x <= n.x + n.w && e.y >= n.y && e.y <= n.y + n.h) return n.id;
|
|
2452
2452
|
return null;
|
|
2453
2453
|
}
|
|
2454
|
-
function
|
|
2454
|
+
function wi(e) {
|
|
2455
2455
|
return `nodeShell:${e}`;
|
|
2456
2456
|
}
|
|
2457
|
-
function
|
|
2457
|
+
function Ti(e, t, n) {
|
|
2458
2458
|
let r = e?.get("nodeShell"), i = e?.get("edge"), a = e?.get("background"), o = e?.get("connectionLine"), s = e?.get("edgeDefaultType") ?? "custom", c = [...t], l = {};
|
|
2459
2459
|
for (let t of c) {
|
|
2460
|
-
let i = e?.get(
|
|
2460
|
+
let i = e?.get(wi(t)), a = i === void 0 ? r : i, o = n === void 0 ? void 0 : n.has(t) ? n.resolve(t, a) : n.has("*") ? n.resolve("*", a) : void 0;
|
|
2461
2461
|
o === void 0 ? a !== void 0 && (l[t] = a) : l[t] = o;
|
|
2462
2462
|
}
|
|
2463
2463
|
return {
|
|
@@ -2470,7 +2470,7 @@ function Ei(e, t, n) {
|
|
|
2470
2470
|
nodeTypes: c
|
|
2471
2471
|
};
|
|
2472
2472
|
}
|
|
2473
|
-
var
|
|
2473
|
+
var Ei = {
|
|
2474
2474
|
edgeType: "adaptive",
|
|
2475
2475
|
edgeLineWidth: 2,
|
|
2476
2476
|
edgeColor: "#3b82f6",
|
|
@@ -2492,7 +2492,7 @@ var Di = {
|
|
|
2492
2492
|
edgeAvoidMargin: 18,
|
|
2493
2493
|
edgeAvoidRadius: 8,
|
|
2494
2494
|
edgeAvoidClearance: 6
|
|
2495
|
-
},
|
|
2495
|
+
}, Di = {
|
|
2496
2496
|
handleRestOffset: 36,
|
|
2497
2497
|
handleCursorGap: 24,
|
|
2498
2498
|
handleButtonSize: 32,
|
|
@@ -2501,12 +2501,12 @@ var Di = {
|
|
|
2501
2501
|
portZoneOffset: 0,
|
|
2502
2502
|
portZoneShape: "arc",
|
|
2503
2503
|
portZoneArcRatio: .8
|
|
2504
|
-
},
|
|
2504
|
+
}, Oi = {
|
|
2505
2505
|
handleDebug: !0,
|
|
2506
2506
|
connectionSnapDebugVisible: !0,
|
|
2507
2507
|
slotDebug: !1
|
|
2508
2508
|
};
|
|
2509
|
-
function
|
|
2509
|
+
function ki(e, t, n) {
|
|
2510
2510
|
return e.filter((e) => t.has(e.source) && t.has(e.target)).map((e) => ({
|
|
2511
2511
|
id: e.id,
|
|
2512
2512
|
type: e.type ?? "custom",
|
|
@@ -2525,13 +2525,13 @@ function Ai(e, t, n) {
|
|
|
2525
2525
|
}
|
|
2526
2526
|
//#endregion
|
|
2527
2527
|
//#region src/host/visibleCull.ts
|
|
2528
|
-
function
|
|
2528
|
+
function Ai(e, t) {
|
|
2529
2529
|
if (!t.enabled || !e) return null;
|
|
2530
|
-
let n =
|
|
2531
|
-
return (e) =>
|
|
2530
|
+
let n = pi(e, Math.max(0, t.buffer));
|
|
2531
|
+
return (e) => fi(e, n);
|
|
2532
2532
|
}
|
|
2533
|
-
function
|
|
2534
|
-
let i =
|
|
2533
|
+
function ji(e, t, n, r) {
|
|
2534
|
+
let i = Ai(t, n);
|
|
2535
2535
|
if (!i) return null;
|
|
2536
2536
|
let a = /* @__PURE__ */ new Set();
|
|
2537
2537
|
for (let t of e.getAllRects()) (r?.has(t.id) || i(t)) && a.add(t.id);
|
|
@@ -2539,7 +2539,7 @@ function Mi(e, t, n, r) {
|
|
|
2539
2539
|
}
|
|
2540
2540
|
//#endregion
|
|
2541
2541
|
//#region src/host/canvas-host/useCanvasCulling.ts
|
|
2542
|
-
function
|
|
2542
|
+
function Mi(e) {
|
|
2543
2543
|
let { hostRef: t, surfaceRef: n, interactionSettings: r } = e, i = A(null);
|
|
2544
2544
|
function a(e) {
|
|
2545
2545
|
let t = i.value;
|
|
@@ -2599,7 +2599,7 @@ function Ni(e) {
|
|
|
2599
2599
|
}
|
|
2600
2600
|
}
|
|
2601
2601
|
for (let e of a) p.has(e) && m.add(e);
|
|
2602
|
-
let s =
|
|
2602
|
+
let s = xi(d, i, e.isNodeDragging(), p, m);
|
|
2603
2603
|
if (s.size !== d.size) {
|
|
2604
2604
|
if (s.size === 0) {
|
|
2605
2605
|
h();
|
|
@@ -2615,7 +2615,7 @@ function Ni(e) {
|
|
|
2615
2615
|
f = new Set(e);
|
|
2616
2616
|
let r = [], i = /* @__PURE__ */ new Map();
|
|
2617
2617
|
for (let e of n.nodeStore.getNodes()) r.push(e.id), i.set(e.id, e.parentId);
|
|
2618
|
-
d =
|
|
2618
|
+
d = yi(f, r, i), b();
|
|
2619
2619
|
}
|
|
2620
2620
|
function v() {
|
|
2621
2621
|
try {
|
|
@@ -2638,7 +2638,7 @@ function Ni(e) {
|
|
|
2638
2638
|
if (!r || !d) {
|
|
2639
2639
|
let t = [], r = /* @__PURE__ */ new Map();
|
|
2640
2640
|
for (let n of e.nodeStore.getNodes()) t.push(n.id), r.set(n.id, n.parentId);
|
|
2641
|
-
d =
|
|
2641
|
+
d = yi(f, t, r, n.ids), p = new Set(n.ids);
|
|
2642
2642
|
}
|
|
2643
2643
|
for (let e of [...m]) d && !d.has(e) && m.delete(e);
|
|
2644
2644
|
return d;
|
|
@@ -2653,19 +2653,19 @@ function Ni(e) {
|
|
|
2653
2653
|
}
|
|
2654
2654
|
let o = d && d.size > 0 ? d : void 0;
|
|
2655
2655
|
if (i) {
|
|
2656
|
-
a(
|
|
2656
|
+
a(ji(e.view, i, l(), o));
|
|
2657
2657
|
return;
|
|
2658
2658
|
}
|
|
2659
2659
|
if (typeof window > "u") {
|
|
2660
2660
|
a(null);
|
|
2661
2661
|
return;
|
|
2662
2662
|
}
|
|
2663
|
-
let s =
|
|
2663
|
+
let s = di({
|
|
2664
2664
|
x: 0,
|
|
2665
2665
|
y: 0,
|
|
2666
2666
|
zoom: 1
|
|
2667
2667
|
}, window.innerWidth, window.innerHeight);
|
|
2668
|
-
a(
|
|
2668
|
+
a(ji(e.view, s, l(), o));
|
|
2669
2669
|
}
|
|
2670
2670
|
function x() {
|
|
2671
2671
|
let i = t.value;
|
|
@@ -2674,21 +2674,21 @@ function Ni(e) {
|
|
|
2674
2674
|
a(null);
|
|
2675
2675
|
return;
|
|
2676
2676
|
}
|
|
2677
|
-
let o = v()?.ids.size ?? 0, s =
|
|
2677
|
+
let o = v()?.ids.size ?? 0, s = bi(e.isNodeDragging(), o, !!d) ? y() : void 0, c = n.value?.getVisibleRect?.() ?? null;
|
|
2678
2678
|
if (c) {
|
|
2679
|
-
a(
|
|
2679
|
+
a(ji(i.view, c, l(), s));
|
|
2680
2680
|
return;
|
|
2681
2681
|
}
|
|
2682
2682
|
if (typeof window > "u") {
|
|
2683
2683
|
a(null);
|
|
2684
2684
|
return;
|
|
2685
2685
|
}
|
|
2686
|
-
let u =
|
|
2686
|
+
let u = di({
|
|
2687
2687
|
x: 0,
|
|
2688
2688
|
y: 0,
|
|
2689
2689
|
zoom: 1
|
|
2690
2690
|
}, window.innerWidth, window.innerHeight);
|
|
2691
|
-
a(
|
|
2691
|
+
a(ji(i.view, u, l(), s));
|
|
2692
2692
|
}
|
|
2693
2693
|
function S() {
|
|
2694
2694
|
c ||= requestAnimationFrame(() => {
|
|
@@ -2713,18 +2713,18 @@ function Ni(e) {
|
|
|
2713
2713
|
}
|
|
2714
2714
|
//#endregion
|
|
2715
2715
|
//#region src/host/canvas-host/useCanvasLayer.ts
|
|
2716
|
-
function
|
|
2716
|
+
function Ni(e) {
|
|
2717
2717
|
let { hostRef: t } = e;
|
|
2718
2718
|
function n(e, n) {
|
|
2719
2719
|
let r = t.value;
|
|
2720
2720
|
if (!r || !r.nodeStore.getNode(e)) return;
|
|
2721
|
-
let { data: i, size: a } =
|
|
2721
|
+
let { data: i, size: a } = gi(n);
|
|
2722
2722
|
r.graph.updateNode(e, a === void 0 ? { data: i } : {
|
|
2723
2723
|
data: i,
|
|
2724
2724
|
size: a
|
|
2725
2725
|
});
|
|
2726
2726
|
}
|
|
2727
|
-
let r = e.props.nodeWrite ?? n, i = w({ ...
|
|
2727
|
+
let r = e.props.nodeWrite ?? n, i = w({ ...Ei }), a = w({ ...Di }), o = w({ ...Oi }), s = w({ ...Tt });
|
|
2728
2728
|
return {
|
|
2729
2729
|
nodeWrite: r,
|
|
2730
2730
|
edgeVisualToProvide: e.props.edgeVisual ?? i,
|
|
@@ -2735,17 +2735,17 @@ function Pi(e) {
|
|
|
2735
2735
|
}
|
|
2736
2736
|
//#endregion
|
|
2737
2737
|
//#region src/host/canvas-host/helpers.ts
|
|
2738
|
-
function
|
|
2738
|
+
function Pi(e) {
|
|
2739
2739
|
return e?.edgeOnTop ?? !1;
|
|
2740
2740
|
}
|
|
2741
2741
|
//#endregion
|
|
2742
2742
|
//#region src/host/canvas-host/useCanvasRenderState.ts
|
|
2743
|
-
function
|
|
2743
|
+
function Fi(e) {
|
|
2744
2744
|
let { hostRef: t, surfaceRef: n, cullIds: r } = e, i = T([]), a = T([]), o = T(!1), s = T(!1), c = 0, l = /* @__PURE__ */ new Set(), u = [];
|
|
2745
2745
|
function d() {
|
|
2746
2746
|
let a = t.value;
|
|
2747
2747
|
if (!a) return;
|
|
2748
|
-
let o =
|
|
2748
|
+
let o = vi(_i(a.nodeStore, a.selection.ids, r.value, e.linkedIds(), e.compactShellsEnabled()), n.value?.getDraggingNodePositions?.());
|
|
2749
2749
|
if (c) {
|
|
2750
2750
|
let e = new Set(i.value.map((e) => e.id)), t = new Map(o.map((e) => [e.id, e]));
|
|
2751
2751
|
i.value = i.value.map((e) => t.get(e.id) ?? e);
|
|
@@ -2772,8 +2772,8 @@ function Ii(e) {
|
|
|
2772
2772
|
function p() {
|
|
2773
2773
|
let n = t.value;
|
|
2774
2774
|
if (!n) return;
|
|
2775
|
-
let r = new Set(n.nodeStore.getNodes().map((e) => e.id)), c =
|
|
2776
|
-
a.value =
|
|
2775
|
+
let r = new Set(n.nodeStore.getNodes().map((e) => e.id)), c = Pi(e.edgeVisual());
|
|
2776
|
+
a.value = ki(n.edgeStore.getEdges(), r, c ? void 0 : n.selection.ids).map((e) => c && e.zIndex !== K.tempEdge ? {
|
|
2777
2777
|
...e,
|
|
2778
2778
|
zIndex: K.edgeTop
|
|
2779
2779
|
} : e), e.pruneDragProtection(), e.refreshCull(), e.rebuildLinkedIds(), d();
|
|
@@ -2795,12 +2795,12 @@ function Ii(e) {
|
|
|
2795
2795
|
}
|
|
2796
2796
|
//#endregion
|
|
2797
2797
|
//#region src/host/canvas-host/useCanvasTheme.ts
|
|
2798
|
-
function
|
|
2798
|
+
function Ii(e) {
|
|
2799
2799
|
let t = A({}), n = A({}), r = A(void 0), i = A(void 0), a = T("custom"), o = T(0);
|
|
2800
2800
|
function s() {
|
|
2801
2801
|
let o = e.value;
|
|
2802
2802
|
if (!o) return !1;
|
|
2803
|
-
let s = !1, u =
|
|
2803
|
+
let s = !1, u = Ti(o.themeRegistry, [...o.nodeStore.types.keys(), ...o.nodeStore.orphanTypes()], o.ctx.registryOf("node/shell")), d = {};
|
|
2804
2804
|
for (let e of u.nodeTypes) {
|
|
2805
2805
|
let t = u.nodeShells[e];
|
|
2806
2806
|
t != null && (d[e] = t);
|
|
@@ -2837,7 +2837,7 @@ function Li(e) {
|
|
|
2837
2837
|
}
|
|
2838
2838
|
//#endregion
|
|
2839
2839
|
//#region src/host/canvas-host/useCanvasViewport.ts
|
|
2840
|
-
function
|
|
2840
|
+
function Li(e) {
|
|
2841
2841
|
let { hostRef: t, surfaceRef: n } = e, r, i = A(null), a = !1;
|
|
2842
2842
|
function o() {
|
|
2843
2843
|
let n = t.value;
|
|
@@ -2878,7 +2878,7 @@ function Ri(e) {
|
|
|
2878
2878
|
}
|
|
2879
2879
|
//#endregion
|
|
2880
2880
|
//#region src/host/renderEvents.ts
|
|
2881
|
-
var
|
|
2881
|
+
var Z = {
|
|
2882
2882
|
NodeDragStart: "canvas:node:drag-start",
|
|
2883
2883
|
NodeDrag: "canvas:node:drag",
|
|
2884
2884
|
NodeDragEnd: "canvas:node:drag-end",
|
|
@@ -2893,8 +2893,8 @@ var X = {
|
|
|
2893
2893
|
ContextMenuNode: "canvas:context-menu:node",
|
|
2894
2894
|
ContextMenuEdge: "canvas:context-menu:edge"
|
|
2895
2895
|
};
|
|
2896
|
-
for (let e of Object.values(
|
|
2897
|
-
function
|
|
2896
|
+
for (let e of Object.values(Z)) $e(e);
|
|
2897
|
+
function Ri(e) {
|
|
2898
2898
|
if (!e.node?.id) return null;
|
|
2899
2899
|
let t = e.node.computedPosition ?? e.node.position;
|
|
2900
2900
|
return {
|
|
@@ -2910,12 +2910,12 @@ function zi(e) {
|
|
|
2910
2910
|
}
|
|
2911
2911
|
//#endregion
|
|
2912
2912
|
//#region src/host/canvas-host/useCanvasViewportMove.ts
|
|
2913
|
-
function
|
|
2913
|
+
function zi(e) {
|
|
2914
2914
|
function t() {
|
|
2915
|
-
e.onUserMove?.(), xt(e.interaction), i(
|
|
2915
|
+
e.onUserMove?.(), xt(e.interaction), i(Z.MoveStart);
|
|
2916
2916
|
}
|
|
2917
2917
|
function n() {
|
|
2918
|
-
St(e.interaction), i(
|
|
2918
|
+
St(e.interaction), i(Z.MoveEnd), e.persistViewport() && e.persist();
|
|
2919
2919
|
}
|
|
2920
2920
|
function r() {
|
|
2921
2921
|
e.interaction.activity.value.paneDragging && (e.log.log("paneDragging 兜底复位(未收到配对 moveEnd,疑似漏发)"), St(e.interaction));
|
|
@@ -2938,56 +2938,56 @@ function Bi(e) {
|
|
|
2938
2938
|
}
|
|
2939
2939
|
//#endregion
|
|
2940
2940
|
//#region src/host/selectionInteractions.ts
|
|
2941
|
-
function
|
|
2941
|
+
function Bi(e, t, n = {}) {
|
|
2942
2942
|
if (n.shiftKey) return e.has(t) ? (e.remove(t), !0) : (e.add(t), !0);
|
|
2943
2943
|
e.clearEdges();
|
|
2944
2944
|
let r = !e.has(t) || e.edgeIds.size > 0 || e.ids.size !== 1;
|
|
2945
2945
|
return e.set(new Set([t])), r;
|
|
2946
2946
|
}
|
|
2947
|
-
function
|
|
2947
|
+
function Vi(e, t, n = {}) {
|
|
2948
2948
|
if (n.shiftKey) return e.hasEdge(t) ? (e.removeEdge(t), !0) : (e.addEdge(t), !0);
|
|
2949
2949
|
e.clearNodes();
|
|
2950
2950
|
let r = !e.hasEdge(t) || e.ids.size > 0 || e.edgeIds.size !== 1;
|
|
2951
2951
|
return e.setEdges(new Set([t])), r;
|
|
2952
2952
|
}
|
|
2953
|
-
function
|
|
2953
|
+
function Hi(e) {
|
|
2954
2954
|
let t = e.ids.size > 0 || e.edgeIds.size > 0;
|
|
2955
2955
|
return t && e.clear(), t;
|
|
2956
2956
|
}
|
|
2957
|
-
function
|
|
2957
|
+
function Ui(e, t, n) {
|
|
2958
2958
|
return !n.enabled || !n.selectable || e.has(t) ? !1 : (e.set(new Set([t])), !0);
|
|
2959
2959
|
}
|
|
2960
2960
|
//#endregion
|
|
2961
2961
|
//#region src/host/canvas-host/useCanvasSelection.ts
|
|
2962
|
-
function
|
|
2962
|
+
function Wi(e) {
|
|
2963
2963
|
let { hostRef: t } = e, n = T(/* @__PURE__ */ new Set()), r = T(/* @__PURE__ */ new Set()), i = {
|
|
2964
2964
|
selectedNodeIds: n,
|
|
2965
2965
|
selectedEdgeIds: r
|
|
2966
2966
|
};
|
|
2967
2967
|
function a() {
|
|
2968
2968
|
let i = t.value;
|
|
2969
|
-
i && (n.value = new Set(i.selection.ids), r.value = new Set(i.selection.edgeIds), e.syncFromStore(), i.ctx.emit(
|
|
2969
|
+
i && (n.value = new Set(i.selection.ids), r.value = new Set(i.selection.edgeIds), e.syncFromStore(), i.ctx.emit(Z.SelectionChange, {
|
|
2970
2970
|
nodeIds: [...i.selection.ids],
|
|
2971
2971
|
edgeIds: [...i.selection.edgeIds]
|
|
2972
2972
|
}));
|
|
2973
2973
|
}
|
|
2974
2974
|
function o(e) {
|
|
2975
2975
|
let n = t.value;
|
|
2976
|
-
n && (
|
|
2976
|
+
n && (Bi(n.selection, e.node.id, { shiftKey: e.event.shiftKey }), n.ctx.emit(Z.NodeClick, {
|
|
2977
2977
|
nodeId: e.node.id,
|
|
2978
2978
|
shiftKey: e.event.shiftKey
|
|
2979
2979
|
}));
|
|
2980
2980
|
}
|
|
2981
2981
|
function s(e) {
|
|
2982
2982
|
let n = t.value;
|
|
2983
|
-
n && (
|
|
2983
|
+
n && (Vi(n.selection, e.edge.id, { shiftKey: e.event.shiftKey }), n.ctx.emit(Z.EdgeClick, {
|
|
2984
2984
|
edgeId: e.edge.id,
|
|
2985
2985
|
shiftKey: e.event.shiftKey
|
|
2986
2986
|
}));
|
|
2987
2987
|
}
|
|
2988
2988
|
function c() {
|
|
2989
2989
|
let e = t.value;
|
|
2990
|
-
e && (
|
|
2990
|
+
e && (Hi(e.selection), e.ctx.emit(Z.PaneClick, {}));
|
|
2991
2991
|
}
|
|
2992
2992
|
return {
|
|
2993
2993
|
edgeSelection: i,
|
|
@@ -2999,17 +2999,17 @@ function Gi(e) {
|
|
|
2999
2999
|
}
|
|
3000
3000
|
//#endregion
|
|
3001
3001
|
//#region src/host/canvas-host/useCanvasNodeDrag.ts
|
|
3002
|
-
function
|
|
3002
|
+
function Gi(e) {
|
|
3003
3003
|
let { hostRef: t, surfaceRef: n, interaction: r } = e, i = 0;
|
|
3004
3004
|
function a(n) {
|
|
3005
3005
|
_t(r, n.node.id), e.primeDragProtection([...n.nodes.map((e) => e.id), n.node.id]);
|
|
3006
3006
|
let i = t.value;
|
|
3007
|
-
i &&
|
|
3007
|
+
i && Ui(i.selection, n.node.id, {
|
|
3008
3008
|
enabled: e.interactionSettings.selectNodesOnDrag,
|
|
3009
3009
|
selectable: e.interactionSettings.elementsSelectable
|
|
3010
3010
|
});
|
|
3011
|
-
let a =
|
|
3012
|
-
a && t.value?.ctx.emit(
|
|
3011
|
+
let a = Ri(n);
|
|
3012
|
+
a && t.value?.ctx.emit(Z.NodeDragStart, a);
|
|
3013
3013
|
}
|
|
3014
3014
|
function o(n) {
|
|
3015
3015
|
vt(r), e.clearDragProtection();
|
|
@@ -3031,7 +3031,7 @@ function Ki(e) {
|
|
|
3031
3031
|
y: e.y
|
|
3032
3032
|
} }
|
|
3033
3033
|
})));
|
|
3034
|
-
for (let e of a) i.ctx.emit(
|
|
3034
|
+
for (let e of a) i.ctx.emit(Z.NodeDragEnd, {
|
|
3035
3035
|
nodeId: e.id,
|
|
3036
3036
|
position: i.view.absolutePosition(e.id)
|
|
3037
3037
|
});
|
|
@@ -3039,8 +3039,8 @@ function Ki(e) {
|
|
|
3039
3039
|
function s(e) {
|
|
3040
3040
|
i ||= requestAnimationFrame(() => {
|
|
3041
3041
|
i = 0;
|
|
3042
|
-
let n = t.value, r =
|
|
3043
|
-
n && r && n.ctx.emit(
|
|
3042
|
+
let n = t.value, r = Ri(e);
|
|
3043
|
+
n && r && n.ctx.emit(Z.NodeDrag, r);
|
|
3044
3044
|
});
|
|
3045
3045
|
}
|
|
3046
3046
|
function c() {
|
|
@@ -3055,7 +3055,7 @@ function Ki(e) {
|
|
|
3055
3055
|
}
|
|
3056
3056
|
//#endregion
|
|
3057
3057
|
//#region src/host/canvas-host/useCanvasConnections.ts
|
|
3058
|
-
function
|
|
3058
|
+
function Ki(e) {
|
|
3059
3059
|
let { hostRef: t, surfaceRef: n } = e, r = st(), i = A(null);
|
|
3060
3060
|
function a(n, r, i, a, o = !1) {
|
|
3061
3061
|
let s = t.value;
|
|
@@ -3147,14 +3147,14 @@ function qi(e) {
|
|
|
3147
3147
|
let t = a(c.source, c.target);
|
|
3148
3148
|
t.ok ? O(c.source, c.target) : e.log.warn(`drop ${c.source}→${c.target} 非法:${t.reason}`);
|
|
3149
3149
|
} else {
|
|
3150
|
-
let r =
|
|
3150
|
+
let r = Ci(s.point, S().map((e) => ({
|
|
3151
3151
|
id: e.id,
|
|
3152
3152
|
x: e.x,
|
|
3153
3153
|
y: e.y,
|
|
3154
3154
|
w: e.width,
|
|
3155
3155
|
h: e.height
|
|
3156
3156
|
})));
|
|
3157
|
-
r ? e.log.log(`drop 落在节点 ${r} 上但连接不成立(非法/方向不符),不广播空白`) : t.value?.ctx.emit(
|
|
3157
|
+
r ? e.log.log(`drop 落在节点 ${r} 上但连接不成立(非法/方向不符),不广播空白`) : t.value?.ctx.emit(Z.ConnectionDropBlank, {
|
|
3158
3158
|
clientX: n.clientX,
|
|
3159
3159
|
clientY: n.clientY,
|
|
3160
3160
|
flowPosition: {
|
|
@@ -3311,7 +3311,7 @@ function qi(e) {
|
|
|
3311
3311
|
}
|
|
3312
3312
|
//#endregion
|
|
3313
3313
|
//#region src/host/canvas-host/useCanvasKeyboard.ts
|
|
3314
|
-
function
|
|
3314
|
+
function qi(e) {
|
|
3315
3315
|
function t(t) {
|
|
3316
3316
|
let n = t.target;
|
|
3317
3317
|
if (n && (n.tagName === "TEXTAREA" || n.tagName === "INPUT" || n.isContentEditable)) return;
|
|
@@ -3327,7 +3327,7 @@ function Ji(e) {
|
|
|
3327
3327
|
}
|
|
3328
3328
|
//#endregion
|
|
3329
3329
|
//#region src/host/canvas-host/useCanvasClipboard.ts
|
|
3330
|
-
function
|
|
3330
|
+
function Ji(e) {
|
|
3331
3331
|
function t(t) {
|
|
3332
3332
|
let n = t.target;
|
|
3333
3333
|
if (n && (n.tagName === "TEXTAREA" || n.tagName === "INPUT" || n.isContentEditable)) return;
|
|
@@ -3362,7 +3362,7 @@ function Yi(e) {
|
|
|
3362
3362
|
}
|
|
3363
3363
|
//#endregion
|
|
3364
3364
|
//#region src/host/canvas-host/useCanvasContextMenu.ts
|
|
3365
|
-
function
|
|
3365
|
+
function Yi(e) {
|
|
3366
3366
|
function t(t) {
|
|
3367
3367
|
let n = t.event;
|
|
3368
3368
|
n.preventDefault(), e.emitContextMenu({
|
|
@@ -3372,7 +3372,7 @@ function Xi(e) {
|
|
|
3372
3372
|
nodeId: t.node.id
|
|
3373
3373
|
});
|
|
3374
3374
|
let r = e.hostRef.value, i = r?.nodeStore.getNode(t.node.id);
|
|
3375
|
-
r?.ctx.emit(
|
|
3375
|
+
r?.ctx.emit(Z.ContextMenuNode, {
|
|
3376
3376
|
clientX: n.clientX,
|
|
3377
3377
|
clientY: n.clientY,
|
|
3378
3378
|
flowPosition: e.clientToFlow(n.clientX, n.clientY),
|
|
@@ -3387,7 +3387,7 @@ function Xi(e) {
|
|
|
3387
3387
|
clientX: n.clientX,
|
|
3388
3388
|
clientY: n.clientY,
|
|
3389
3389
|
edgeId: t.edge.id
|
|
3390
|
-
}), e.hostRef.value?.ctx.emit(
|
|
3390
|
+
}), e.hostRef.value?.ctx.emit(Z.ContextMenuEdge, {
|
|
3391
3391
|
clientX: n.clientX,
|
|
3392
3392
|
clientY: n.clientY,
|
|
3393
3393
|
flowPosition: e.clientToFlow(n.clientX, n.clientY),
|
|
@@ -3399,7 +3399,7 @@ function Xi(e) {
|
|
|
3399
3399
|
kind: "pane",
|
|
3400
3400
|
clientX: t.clientX,
|
|
3401
3401
|
clientY: t.clientY
|
|
3402
|
-
}), e.hostRef.value?.ctx.emit(
|
|
3402
|
+
}), e.hostRef.value?.ctx.emit(Z.ContextMenuPane, {
|
|
3403
3403
|
clientX: t.clientX,
|
|
3404
3404
|
clientY: t.clientY,
|
|
3405
3405
|
flowPosition: e.clientToFlow(t.clientX, t.clientY)
|
|
@@ -3413,7 +3413,7 @@ function Xi(e) {
|
|
|
3413
3413
|
}
|
|
3414
3414
|
//#endregion
|
|
3415
3415
|
//#region src/host/canvas-host/useCanvasSave.ts
|
|
3416
|
-
function
|
|
3416
|
+
function Xi(e) {
|
|
3417
3417
|
function t() {
|
|
3418
3418
|
let t = e.hostRef.value;
|
|
3419
3419
|
if (t) {
|
|
@@ -3446,13 +3446,13 @@ function Zi(e) {
|
|
|
3446
3446
|
}
|
|
3447
3447
|
//#endregion
|
|
3448
3448
|
//#region src/host/canvas-host/useCanvasLifecycle.ts
|
|
3449
|
-
function
|
|
3449
|
+
function Zi(e) {
|
|
3450
3450
|
let { host: t, hostRef: n, mountError: r, interactionSettings: i, interaction: a, nodeEpoch: o } = e, s = [], c = !1, l = !1, u = !1, d, f, p, m;
|
|
3451
3451
|
y(async () => {
|
|
3452
3452
|
try {
|
|
3453
3453
|
let r = t.ctx.get("settings");
|
|
3454
|
-
Object.assign(i,
|
|
3455
|
-
|
|
3454
|
+
Object.assign(i, xn((e) => r.get(e))), s.push(r.onChange((t, n) => {
|
|
3455
|
+
Cn(i, t, n), /^(image|video)Default(Width|Height)$/.test(t) && e.syncNodesFromStore(), (t === "visibleCullEnabled" || t === "visibleCullBuffer" || t === "cullCompactShells") && (e.refreshCull(), e.rebuildLinkedIds(), e.syncNodesFromStore());
|
|
3456
3456
|
})), d = t.nodeStore.subscribe(e.syncFromStore), f = t.edgeStore.subscribe(e.syncFromStore), m = N(() => e.edgeVisualToProvide?.edgeOnTop, () => {
|
|
3457
3457
|
n.value && e.syncFromStore();
|
|
3458
3458
|
}), p = t.selection.onChange(e.syncSelected), e.syncSelected(), e.applyTheme(), e.syncFromStore();
|
|
@@ -3492,16 +3492,16 @@ function Qi(e) {
|
|
|
3492
3492
|
}
|
|
3493
3493
|
//#endregion
|
|
3494
3494
|
//#region src/host/CanvasHost.vue?vue&type=script&setup=true&lang.ts
|
|
3495
|
-
var
|
|
3495
|
+
var Qi = {
|
|
3496
3496
|
key: 0,
|
|
3497
3497
|
class: "chost-status"
|
|
3498
|
-
},
|
|
3498
|
+
}, $i = {
|
|
3499
3499
|
key: 1,
|
|
3500
3500
|
class: "chost-status chost-err"
|
|
3501
|
-
},
|
|
3501
|
+
}, ea = {
|
|
3502
3502
|
key: 2,
|
|
3503
3503
|
class: "chost-canvas"
|
|
3504
|
-
},
|
|
3504
|
+
}, ta = /*#__PURE__*/ Xr(/* @__PURE__ */ u({
|
|
3505
3505
|
__name: "CanvasHost",
|
|
3506
3506
|
props: {
|
|
3507
3507
|
nodeWrite: {},
|
|
@@ -3520,16 +3520,16 @@ var $i = {
|
|
|
3520
3520
|
"plugin-issue"
|
|
3521
3521
|
],
|
|
3522
3522
|
setup(e, { expose: t, emit: n }) {
|
|
3523
|
-
let r =
|
|
3523
|
+
let r = $r("canvas-host"), i = e, a = n, { host: c, api: u, manager: d } = Yt(), f = A(c), p = T(!1), m = T(""), h = T(null), g = A(), _ = c.nodeRegistry, { nodeWrite: v, edgeVisualToProvide: y, handleToProvide: b, debugToProvide: x, snapZoneToProvide: C } = Ni({
|
|
3524
3524
|
hostRef: f,
|
|
3525
3525
|
props: i
|
|
3526
|
-
}), E = w(
|
|
3526
|
+
}), E = w(xn(() => void 0)), O = mt(), k = Mi({
|
|
3527
3527
|
hostRef: f,
|
|
3528
3528
|
surfaceRef: g,
|
|
3529
3529
|
interactionSettings: E,
|
|
3530
3530
|
isNodeDragging: () => O.activity.value.nodeDragging,
|
|
3531
3531
|
syncNodesFromStore: () => L()
|
|
3532
|
-
}), N =
|
|
3532
|
+
}), N = Ii(f), { nodes: F, edges: I, syncNodesFromStore: L, syncFromStore: R, dispose: z } = Fi({
|
|
3533
3533
|
hostRef: f,
|
|
3534
3534
|
surfaceRef: g,
|
|
3535
3535
|
cullIds: k.cullIds,
|
|
@@ -3540,23 +3540,23 @@ var $i = {
|
|
|
3540
3540
|
refreshCull: k.refreshCull,
|
|
3541
3541
|
rebuildLinkedIds: k.rebuildLinkedIds,
|
|
3542
3542
|
log: r
|
|
3543
|
-
}), B =
|
|
3543
|
+
}), B = Wi({
|
|
3544
3544
|
hostRef: f,
|
|
3545
3545
|
syncFromStore: R
|
|
3546
|
-
}), V =
|
|
3546
|
+
}), V = Ki({
|
|
3547
3547
|
hostRef: f,
|
|
3548
3548
|
surfaceRef: g,
|
|
3549
3549
|
edges: () => I.value,
|
|
3550
3550
|
edgeDefaultType: () => N.edgeDefaultType.value,
|
|
3551
3551
|
log: r
|
|
3552
|
-
}), ee =
|
|
3552
|
+
}), ee = Gi({
|
|
3553
3553
|
hostRef: f,
|
|
3554
3554
|
surfaceRef: g,
|
|
3555
3555
|
interaction: O,
|
|
3556
3556
|
interactionSettings: E,
|
|
3557
3557
|
primeDragProtection: k.primeDragProtection,
|
|
3558
3558
|
clearDragProtection: k.clearDragProtection
|
|
3559
|
-
}), H =
|
|
3559
|
+
}), H = Li({
|
|
3560
3560
|
hostRef: f,
|
|
3561
3561
|
surfaceRef: g,
|
|
3562
3562
|
persistViewport: () => i.persistViewport,
|
|
@@ -3565,7 +3565,7 @@ var $i = {
|
|
|
3565
3565
|
w: h.value?.clientWidth ?? 1,
|
|
3566
3566
|
h: h.value?.clientHeight ?? 1
|
|
3567
3567
|
})
|
|
3568
|
-
}), U =
|
|
3568
|
+
}), U = zi({
|
|
3569
3569
|
hostRef: f,
|
|
3570
3570
|
surfaceRef: g,
|
|
3571
3571
|
interaction: O,
|
|
@@ -3573,18 +3573,18 @@ var $i = {
|
|
|
3573
3573
|
persist: H.persistViewport,
|
|
3574
3574
|
onUserMove: H.markUserMoved,
|
|
3575
3575
|
log: r
|
|
3576
|
-
}), W =
|
|
3576
|
+
}), W = qi({
|
|
3577
3577
|
commands: () => f.value?.ctx.tryGet("canvas"),
|
|
3578
3578
|
executeContext: () => f.value?.ctx,
|
|
3579
3579
|
syncFromStore: R
|
|
3580
|
-
}), G =
|
|
3580
|
+
}), G = Ji({
|
|
3581
3581
|
hostRef: f,
|
|
3582
3582
|
syncFromStore: R
|
|
3583
|
-
}), te =
|
|
3583
|
+
}), te = Yi({
|
|
3584
3584
|
hostRef: f,
|
|
3585
3585
|
clientToFlow: V.clientToFlow,
|
|
3586
3586
|
emitContextMenu: (e) => a("context-menu", e)
|
|
3587
|
-
}), ne =
|
|
3587
|
+
}), ne = Xi({ hostRef: f });
|
|
3588
3588
|
H.restoreOnRemount();
|
|
3589
3589
|
let re = c.ctx.tryGet("canvasBoot");
|
|
3590
3590
|
async function ie() {
|
|
@@ -3594,7 +3594,7 @@ var $i = {
|
|
|
3594
3594
|
let e = c.view.getChromeBars();
|
|
3595
3595
|
return e.top > 0 || e.bottom > 0 || e.left > 0 || e.right > 0 || typeof requestAnimationFrame != "function" ? Promise.resolve() : new Promise((e) => requestAnimationFrame(() => e()));
|
|
3596
3596
|
}
|
|
3597
|
-
return
|
|
3597
|
+
return Zi({
|
|
3598
3598
|
host: c,
|
|
3599
3599
|
hostRef: f,
|
|
3600
3600
|
emitReady: (e) => a("ready", e),
|
|
@@ -3639,7 +3639,7 @@ var $i = {
|
|
|
3639
3639
|
ref_key: "chostEl",
|
|
3640
3640
|
ref: h,
|
|
3641
3641
|
class: "chost"
|
|
3642
|
-
}, [p.value ? m.value ? (S(), s("div",
|
|
3642
|
+
}, [p.value ? m.value ? (S(), s("div", $i, "画布初始化失败:" + j(m.value), 1)) : o("", !0) : (S(), s("div", Qi, "正在准备画布…")), p.value ? (S(), s("div", ea, [l(hi, {
|
|
3643
3643
|
ref_key: "surfaceRef",
|
|
3644
3644
|
ref: g,
|
|
3645
3645
|
host: f.value,
|
|
@@ -3685,17 +3685,17 @@ var $i = {
|
|
|
3685
3685
|
_: 3
|
|
3686
3686
|
}, 8, /* @__PURE__ */ "host.registry.node-write.handle-params.edge-visual.debug-visual.snap-zone.edge-selection.nodes.initial-viewport.edges.node-types.edge-types.background-comp.connection-line-comp.node-epoch.interaction-settings.on-visible-rect-change.is-valid-connection.connection-state.interaction.drag-flow-point.on-connect.on-connect-start.on-connect-end.validate-edge.on-node-click.on-edge-click.on-node-drag.on-node-drag-start.on-node-drag-stop.on-move-start.on-move-end.on-pane-click.on-node-context-menu.on-edge-context-menu.on-pane-context-menu".split("."))])) : o("", !0)], 512));
|
|
3687
3687
|
}
|
|
3688
|
-
}), [["__scopeId", "data-v-eac2c790"]]),
|
|
3689
|
-
function
|
|
3688
|
+
}), [["__scopeId", "data-v-eac2c790"]]), na = 40, ra = 24, ia = .01;
|
|
3689
|
+
function aa(e) {
|
|
3690
3690
|
return typeof e == "number" && Number.isFinite(e) && e > 0 ? e : void 0;
|
|
3691
3691
|
}
|
|
3692
|
-
function
|
|
3692
|
+
function oa(e) {
|
|
3693
3693
|
return {
|
|
3694
|
-
w: Math.max(1, Math.round(
|
|
3695
|
-
h: Math.max(1, Math.round(
|
|
3694
|
+
w: Math.max(1, Math.round(aa(e?.w) ?? 320)),
|
|
3695
|
+
h: Math.max(1, Math.round(aa(e?.h) ?? 240))
|
|
3696
3696
|
};
|
|
3697
3697
|
}
|
|
3698
|
-
function
|
|
3698
|
+
function sa(e, t) {
|
|
3699
3699
|
return {
|
|
3700
3700
|
x: e.x,
|
|
3701
3701
|
y: e.y,
|
|
@@ -3703,27 +3703,27 @@ function ca(e, t) {
|
|
|
3703
3703
|
h: t.h
|
|
3704
3704
|
};
|
|
3705
3705
|
}
|
|
3706
|
-
function
|
|
3707
|
-
return e.x >= t.x -
|
|
3706
|
+
function ca(e, t) {
|
|
3707
|
+
return e.x >= t.x - ia && e.y >= t.y - ia && e.x + e.w <= t.x + t.w + ia && e.y + e.h <= t.y + t.h + ia;
|
|
3708
3708
|
}
|
|
3709
|
-
function
|
|
3710
|
-
let i =
|
|
3711
|
-
return n && !
|
|
3709
|
+
function la(e, t, n, r) {
|
|
3710
|
+
let i = sa(e, t);
|
|
3711
|
+
return n && !ca(i, n) ? !1 : !r.some((e) => fi(i, e));
|
|
3712
3712
|
}
|
|
3713
|
-
function
|
|
3713
|
+
function ua(e) {
|
|
3714
3714
|
return {
|
|
3715
3715
|
x: Math.round(e.x),
|
|
3716
3716
|
y: Math.round(e.y)
|
|
3717
3717
|
};
|
|
3718
3718
|
}
|
|
3719
|
-
function
|
|
3719
|
+
function da(e, t, n) {
|
|
3720
3720
|
let r = Math.max(n.x, n.x + n.w - t.w), i = Math.max(n.y, n.y + n.h - t.h);
|
|
3721
3721
|
return {
|
|
3722
3722
|
x: Math.min(Math.max(e.x, n.x), r),
|
|
3723
3723
|
y: Math.min(Math.max(e.y, n.y), i)
|
|
3724
3724
|
};
|
|
3725
3725
|
}
|
|
3726
|
-
function
|
|
3726
|
+
function fa(e) {
|
|
3727
3727
|
let t = [
|
|
3728
3728
|
"right",
|
|
3729
3729
|
"bottom",
|
|
@@ -3732,7 +3732,7 @@ function pa(e) {
|
|
|
3732
3732
|
];
|
|
3733
3733
|
return e === "auto" ? t : [e, ...t.filter((t) => t !== e)];
|
|
3734
3734
|
}
|
|
3735
|
-
function
|
|
3735
|
+
function pa(e, t, n, r) {
|
|
3736
3736
|
let i = [], a = [
|
|
3737
3737
|
0,
|
|
3738
3738
|
1,
|
|
@@ -3744,7 +3744,7 @@ function ma(e, t, n, r) {
|
|
|
3744
3744
|
4,
|
|
3745
3745
|
-4
|
|
3746
3746
|
];
|
|
3747
|
-
for (let o of
|
|
3747
|
+
for (let o of fa(r)) for (let r of a) r === 0 && (o === "right" ? i.push({
|
|
3748
3748
|
x: e.x + e.w + n,
|
|
3749
3749
|
y: e.y
|
|
3750
3750
|
}) : o === "left" ? i.push({
|
|
@@ -3757,7 +3757,7 @@ function ma(e, t, n, r) {
|
|
|
3757
3757
|
x: e.x,
|
|
3758
3758
|
y: e.y - t.h - n
|
|
3759
3759
|
}));
|
|
3760
|
-
for (let o of
|
|
3760
|
+
for (let o of fa(r)) for (let r of a) r !== 0 && (o === "right" ? i.push({
|
|
3761
3761
|
x: e.x + e.w + n,
|
|
3762
3762
|
y: e.y + r * (t.h + n)
|
|
3763
3763
|
}) : o === "left" ? i.push({
|
|
@@ -3772,16 +3772,16 @@ function ma(e, t, n, r) {
|
|
|
3772
3772
|
}));
|
|
3773
3773
|
return i;
|
|
3774
3774
|
}
|
|
3775
|
-
function
|
|
3775
|
+
function ma(e, t, n) {
|
|
3776
3776
|
let r = Math.max(24, Math.min(t.w + 40, 160)), i = Math.max(24, Math.min(t.h + 40, 160)), a = [];
|
|
3777
|
-
for (let n = e.y; n <= e.y + Math.max(0, e.h - t.h) +
|
|
3777
|
+
for (let n = e.y; n <= e.y + Math.max(0, e.h - t.h) + ia; n += i) for (let i = e.x; i <= e.x + Math.max(0, e.w - t.w) + ia; i += r) a.push({
|
|
3778
3778
|
x: i,
|
|
3779
3779
|
y: n
|
|
3780
3780
|
});
|
|
3781
3781
|
return a.sort((e, t) => (e.x - n.x) ** 2 + (e.y - n.y) ** 2 - ((t.x - n.x) ** 2 + (t.y - n.y) ** 2));
|
|
3782
3782
|
}
|
|
3783
|
-
function
|
|
3784
|
-
let t =
|
|
3783
|
+
function ha(e) {
|
|
3784
|
+
let t = oa(e.size), n = Math.max(0, aa(e.gap) ?? 40), r = Math.max(0, aa(e.margin) ?? 24), i = e.obstacles ?? [], a = e.visible && e.visible.w > 0 && e.visible.h > 0 ? e.visible : null, o = a ? {
|
|
3785
3785
|
x: a.x + r,
|
|
3786
3786
|
y: a.y + r,
|
|
3787
3787
|
w: Math.max(0, a.w - r * 2),
|
|
@@ -3818,64 +3818,64 @@ function ga(e) {
|
|
|
3818
3818
|
x: 0,
|
|
3819
3819
|
y: 0
|
|
3820
3820
|
};
|
|
3821
|
-
})(), u = (e) => !i.some((n) =>
|
|
3822
|
-
if (
|
|
3821
|
+
})(), u = (e) => !i.some((n) => fi(sa(e, t), n));
|
|
3822
|
+
if (la(l, t, s, i)) return ua(l);
|
|
3823
3823
|
if (c) {
|
|
3824
|
-
for (let r of
|
|
3824
|
+
for (let r of pa(c, t, n, e.side ?? "auto")) if (la(r, t, s, i)) return ua(r);
|
|
3825
3825
|
}
|
|
3826
3826
|
if (s) {
|
|
3827
|
-
for (let e of
|
|
3827
|
+
for (let e of ma(s, t, l)) if (la(e, t, s, i)) return ua(e);
|
|
3828
3828
|
}
|
|
3829
|
-
if (u(l)) return
|
|
3829
|
+
if (u(l)) return ua(l);
|
|
3830
3830
|
if (c) {
|
|
3831
|
-
for (let r of
|
|
3831
|
+
for (let r of pa(c, t, n, e.side ?? "auto")) if (u(r)) return ua(r);
|
|
3832
3832
|
}
|
|
3833
|
-
return
|
|
3833
|
+
return ua(s ? da(l, t, s) : l);
|
|
3834
3834
|
}
|
|
3835
3835
|
//#endregion
|
|
3836
3836
|
//#region src/contracts/standardCapabilities.ts
|
|
3837
|
-
var
|
|
3838
|
-
function
|
|
3837
|
+
var ga = "media/creator";
|
|
3838
|
+
function _a(e) {
|
|
3839
3839
|
try {
|
|
3840
3840
|
return e.get("doc");
|
|
3841
3841
|
} catch {
|
|
3842
3842
|
return;
|
|
3843
3843
|
}
|
|
3844
3844
|
}
|
|
3845
|
-
function
|
|
3845
|
+
function va(e) {
|
|
3846
3846
|
try {
|
|
3847
3847
|
return e.get("resources");
|
|
3848
3848
|
} catch {
|
|
3849
3849
|
return;
|
|
3850
3850
|
}
|
|
3851
3851
|
}
|
|
3852
|
-
function
|
|
3852
|
+
function ya(e, t) {
|
|
3853
3853
|
try {
|
|
3854
3854
|
return e.get(t);
|
|
3855
3855
|
} catch {
|
|
3856
3856
|
return;
|
|
3857
3857
|
}
|
|
3858
3858
|
}
|
|
3859
|
-
function
|
|
3859
|
+
function ba(e) {
|
|
3860
3860
|
if (!e) return null;
|
|
3861
3861
|
let t = e.getPaneEl?.() ?? e.getRendererEl?.();
|
|
3862
3862
|
if (!t) return null;
|
|
3863
3863
|
let n = t.clientWidth, r = t.clientHeight;
|
|
3864
3864
|
if (!(n > 0) || !(r > 0)) return null;
|
|
3865
3865
|
try {
|
|
3866
|
-
return
|
|
3866
|
+
return di(e.getViewport(), n, r);
|
|
3867
3867
|
} catch {
|
|
3868
3868
|
return null;
|
|
3869
3869
|
}
|
|
3870
3870
|
}
|
|
3871
|
-
function
|
|
3871
|
+
function xa(e) {
|
|
3872
3872
|
try {
|
|
3873
|
-
return e.registryOf(
|
|
3873
|
+
return e.registryOf(ga);
|
|
3874
3874
|
} catch {
|
|
3875
3875
|
return;
|
|
3876
3876
|
}
|
|
3877
3877
|
}
|
|
3878
|
-
function
|
|
3878
|
+
function Sa(e, t = {}) {
|
|
3879
3879
|
let n = typeof e.getNodes == "function" ? e.getNodes() : [], r = typeof e.getEdges == "function" ? e.getEdges() : [];
|
|
3880
3880
|
if (t.includeTransient === !0) return {
|
|
3881
3881
|
nodes: n,
|
|
@@ -3891,9 +3891,9 @@ function Ca(e, t = {}) {
|
|
|
3891
3891
|
edges: r.filter((e) => !i.has(e.source) && !i.has(e.target))
|
|
3892
3892
|
};
|
|
3893
3893
|
}
|
|
3894
|
-
function
|
|
3894
|
+
function Ca(e, t) {
|
|
3895
3895
|
let n = (t) => {
|
|
3896
|
-
let n =
|
|
3896
|
+
let n = _a(e);
|
|
3897
3897
|
if (!n) return {
|
|
3898
3898
|
doc: void 0,
|
|
3899
3899
|
graph: {
|
|
@@ -3902,7 +3902,7 @@ function wa(e, t) {
|
|
|
3902
3902
|
},
|
|
3903
3903
|
byId: /* @__PURE__ */ new Map()
|
|
3904
3904
|
};
|
|
3905
|
-
let r =
|
|
3905
|
+
let r = Sa(n, t), i = /* @__PURE__ */ new Map();
|
|
3906
3906
|
for (let e of r.nodes) i.set(e.id, e);
|
|
3907
3907
|
return {
|
|
3908
3908
|
doc: n,
|
|
@@ -3989,7 +3989,7 @@ function wa(e, t) {
|
|
|
3989
3989
|
return o.join(e);
|
|
3990
3990
|
},
|
|
3991
3991
|
subscribe: (t) => {
|
|
3992
|
-
let n =
|
|
3992
|
+
let n = _a(e);
|
|
3993
3993
|
if (!n) return () => {};
|
|
3994
3994
|
let r = n.subscribe(() => t());
|
|
3995
3995
|
return () => r();
|
|
@@ -4005,18 +4005,18 @@ function wa(e, t) {
|
|
|
4005
4005
|
order: (e) => Ue(n(e).graph, t.id, e)
|
|
4006
4006
|
};
|
|
4007
4007
|
}
|
|
4008
|
-
function
|
|
4008
|
+
function wa(e) {
|
|
4009
4009
|
return {
|
|
4010
4010
|
put: (t, n) => {
|
|
4011
|
-
let r =
|
|
4011
|
+
let r = va(e);
|
|
4012
4012
|
return typeof r?.put == "function" ? r.put(t, n) : Promise.reject(/* @__PURE__ */ Error("[capability] media.put 不可用:本宿主没装 ctx.resources(资源服务)"));
|
|
4013
4013
|
},
|
|
4014
4014
|
resolve: (t) => {
|
|
4015
|
-
let n =
|
|
4015
|
+
let n = va(e);
|
|
4016
4016
|
return typeof n?.resolve == "function" ? n.resolve(t) : Promise.resolve(void 0);
|
|
4017
4017
|
},
|
|
4018
4018
|
addNode: (t, n, r, i) => {
|
|
4019
|
-
let a =
|
|
4019
|
+
let a = xa(e)?.top(t)?.value;
|
|
4020
4020
|
if (typeof a?.addNode != "function") return;
|
|
4021
4021
|
let o = {
|
|
4022
4022
|
kind: t,
|
|
@@ -4026,9 +4026,9 @@ function Ta(e) {
|
|
|
4026
4026
|
meta: i?.meta
|
|
4027
4027
|
};
|
|
4028
4028
|
if (!i?.sourceNodeId) return a.addNode(o);
|
|
4029
|
-
let s =
|
|
4029
|
+
let s = _a(e), c = i.sourceNodeId, l = s?.getNode(c);
|
|
4030
4030
|
if (!s || !l) return a.addNode(o);
|
|
4031
|
-
let u =
|
|
4031
|
+
let u = ya(e, "view"), d = ya(e, "view"), f = i.nodeType ?? t, p = s.types?.get(f)?.defaultSize, m = u?.getNodeRect(c) ?? {
|
|
4032
4032
|
id: c,
|
|
4033
4033
|
x: l.position?.x ?? 0,
|
|
4034
4034
|
y: l.position?.y ?? 0,
|
|
@@ -4040,14 +4040,14 @@ function Ta(e) {
|
|
|
4040
4040
|
y: e.position?.y ?? 0,
|
|
4041
4041
|
w: s.types?.get(e.type)?.defaultSize?.w ?? 320,
|
|
4042
4042
|
h: s.types?.get(e.type)?.defaultSize?.h ?? 240
|
|
4043
|
-
})), g =
|
|
4043
|
+
})), g = ha({
|
|
4044
4044
|
size: p ?? {
|
|
4045
4045
|
w: 320,
|
|
4046
4046
|
h: 240
|
|
4047
4047
|
},
|
|
4048
4048
|
source: m,
|
|
4049
4049
|
obstacles: h,
|
|
4050
|
-
visible:
|
|
4050
|
+
visible: ba(d),
|
|
4051
4051
|
...i.gap === void 0 ? {} : { gap: i.gap },
|
|
4052
4052
|
...i.side === void 0 ? {} : { side: i.side }
|
|
4053
4053
|
});
|
|
@@ -4075,11 +4075,11 @@ function Ta(e) {
|
|
|
4075
4075
|
}
|
|
4076
4076
|
},
|
|
4077
4077
|
applyToNode: (t, n, r, i) => {
|
|
4078
|
-
let a =
|
|
4078
|
+
let a = _a(e), o = a?.getNode(t);
|
|
4079
4079
|
if (!o) return !1;
|
|
4080
4080
|
let s = a?.types?.get(o.type)?.produces?.[n];
|
|
4081
4081
|
if (!s) return !1;
|
|
4082
|
-
let c =
|
|
4082
|
+
let c = xa(e)?.top(s.kind)?.value;
|
|
4083
4083
|
return typeof c?.applyToNode == "function" ? c.applyToNode({
|
|
4084
4084
|
kind: s.kind,
|
|
4085
4085
|
nodeId: t,
|
|
@@ -4089,12 +4089,12 @@ function Ta(e) {
|
|
|
4089
4089
|
}) === !0 : !1;
|
|
4090
4090
|
},
|
|
4091
4091
|
available: () => {
|
|
4092
|
-
let t =
|
|
4092
|
+
let t = xa(e);
|
|
4093
4093
|
return t ? t.keys().filter((e) => typeof t.top(e)?.value.addNode == "function").sort() : [];
|
|
4094
4094
|
}
|
|
4095
4095
|
};
|
|
4096
4096
|
}
|
|
4097
|
-
function
|
|
4097
|
+
function Ta(e) {
|
|
4098
4098
|
try {
|
|
4099
4099
|
let t = e.registryOf("capability").top("media")?.value;
|
|
4100
4100
|
return typeof t == "function" ? t({ ctx: e }) : void 0;
|
|
@@ -4102,7 +4102,7 @@ function Ea(e) {
|
|
|
4102
4102
|
return;
|
|
4103
4103
|
}
|
|
4104
4104
|
}
|
|
4105
|
-
function
|
|
4105
|
+
function Ea(e) {
|
|
4106
4106
|
let t = () => e.get("view"), n = () => e.get("tools");
|
|
4107
4107
|
return {
|
|
4108
4108
|
node: (e) => ({
|
|
@@ -4162,36 +4162,36 @@ function Da(e) {
|
|
|
4162
4162
|
return i ? i.invoke(e, t, r) : Promise.reject(/* @__PURE__ */ Error("[capability] tools 能力不可用:本宿主没装 ctx.tools(生成工具注册表)"));
|
|
4163
4163
|
}
|
|
4164
4164
|
}),
|
|
4165
|
-
upstream: (e) =>
|
|
4165
|
+
upstream: (e) => Ca(e.ctx, {
|
|
4166
4166
|
id: e.id,
|
|
4167
4167
|
type: e.type
|
|
4168
4168
|
}),
|
|
4169
|
-
media: (e) =>
|
|
4169
|
+
media: (e) => wa(e.ctx)
|
|
4170
4170
|
};
|
|
4171
4171
|
}
|
|
4172
4172
|
//#endregion
|
|
4173
4173
|
//#region src/renderPlugin.ts
|
|
4174
|
-
var
|
|
4175
|
-
function
|
|
4174
|
+
var Da = "canvas-render", Oa = [], ka = "host:standard", Aa = 100;
|
|
4175
|
+
function ja(e) {
|
|
4176
4176
|
let t = e.registryOf("capability");
|
|
4177
|
-
for (let [n, r] of Object.entries(
|
|
4178
|
-
id:
|
|
4179
|
-
order:
|
|
4177
|
+
for (let [n, r] of Object.entries(Ea(e))) t.get(n, ka) || t.add(n, r, {
|
|
4178
|
+
id: ka,
|
|
4179
|
+
order: Aa
|
|
4180
4180
|
});
|
|
4181
4181
|
}
|
|
4182
|
-
var
|
|
4183
|
-
name:
|
|
4184
|
-
inject:
|
|
4182
|
+
var Ma = {
|
|
4183
|
+
name: Da,
|
|
4184
|
+
inject: Oa,
|
|
4185
4185
|
apply(e) {
|
|
4186
|
-
|
|
4186
|
+
ja(e);
|
|
4187
4187
|
}
|
|
4188
4188
|
};
|
|
4189
4189
|
//#endregion
|
|
4190
4190
|
//#region src/host/pluginManager.ts
|
|
4191
|
-
function
|
|
4191
|
+
function Na(e) {
|
|
4192
4192
|
return typeof e.module == "function" ? "lazy" : typeof e.url == "string" ? "url" : typeof e.text == "string" ? "text" : "inline";
|
|
4193
4193
|
}
|
|
4194
|
-
async function
|
|
4194
|
+
async function Pa(e) {
|
|
4195
4195
|
let t = await import(
|
|
4196
4196
|
/* @vite-ignore */
|
|
4197
4197
|
`data:text/javascript,${encodeURIComponent(e)}`
|
|
@@ -4199,22 +4199,22 @@ async function Fa(e) {
|
|
|
4199
4199
|
if (!n || typeof n.name != "string") throw Error("[pluginManager] 单文件插件需导出 name(与 apply/…)。");
|
|
4200
4200
|
return n;
|
|
4201
4201
|
}
|
|
4202
|
-
async function
|
|
4202
|
+
async function Fa(e) {
|
|
4203
4203
|
let t = await fetch(e);
|
|
4204
4204
|
if (!t.ok) throw Error(`[pluginManager] 拉取插件 URL 失败: ${e} (${t.status})`);
|
|
4205
|
-
return
|
|
4205
|
+
return Pa(await t.text());
|
|
4206
4206
|
}
|
|
4207
|
-
async function
|
|
4208
|
-
return "module" in e ? e.module() : "url" in e ?
|
|
4207
|
+
async function Ia(e) {
|
|
4208
|
+
return "module" in e ? e.module() : "url" in e ? Fa(e.url) : "text" in e ? Pa(e.text) : e;
|
|
4209
4209
|
}
|
|
4210
|
-
function
|
|
4210
|
+
function La(e, t = {}) {
|
|
4211
4211
|
let n = /* @__PURE__ */ new Map(), r = new Set(t.hiddenPlugins ?? []);
|
|
4212
4212
|
function i(t, n) {
|
|
4213
4213
|
let r = e.canUninstall(t);
|
|
4214
4214
|
if (!r.ok) throw Error(`[pluginManager] cannot uninstall plugin "${t}" (${r.reason}) during ${n}`);
|
|
4215
4215
|
}
|
|
4216
4216
|
async function a(t, r) {
|
|
4217
|
-
let i = await
|
|
4217
|
+
let i = await Ia(t), a = i.name;
|
|
4218
4218
|
if (e.listPlugins().includes(a)) {
|
|
4219
4219
|
if (!e.canUninstall(a).ok) throw Error(`[pluginManager] core plugin cannot be replaced by another implementation of the same name: "${a}"`);
|
|
4220
4220
|
e.uninstallPlugin(a);
|
|
@@ -4249,7 +4249,7 @@ function Ra(e, t = {}) {
|
|
|
4249
4249
|
n.delete(t), e.uninstallPlugin(t);
|
|
4250
4250
|
return;
|
|
4251
4251
|
}
|
|
4252
|
-
let o = await
|
|
4252
|
+
let o = await Ia(r);
|
|
4253
4253
|
e.uninstallPlugin(t), e.installPlugin(o, a), n.set(t, a);
|
|
4254
4254
|
},
|
|
4255
4255
|
list() {
|
|
@@ -4284,7 +4284,7 @@ function Ra(e, t = {}) {
|
|
|
4284
4284
|
}
|
|
4285
4285
|
//#endregion
|
|
4286
4286
|
//#region src/tip/TipLayer.vue
|
|
4287
|
-
var
|
|
4287
|
+
var Ra = /* @__PURE__ */ u({
|
|
4288
4288
|
inheritAttrs: !1,
|
|
4289
4289
|
__name: "TipLayer",
|
|
4290
4290
|
setup(e) {
|
|
@@ -4312,7 +4312,7 @@ var za = /* @__PURE__ */ u({
|
|
|
4312
4312
|
})
|
|
4313
4313
|
}, j(l.value), 5)) : o("", !0)]));
|
|
4314
4314
|
}
|
|
4315
|
-
}),
|
|
4315
|
+
}), za = class {
|
|
4316
4316
|
store;
|
|
4317
4317
|
measured = /* @__PURE__ */ new Map();
|
|
4318
4318
|
constructor(e) {
|
|
@@ -4371,7 +4371,7 @@ var za = /* @__PURE__ */ u({
|
|
|
4371
4371
|
childrenOf(e) {
|
|
4372
4372
|
return this.store.getNodes().filter((t) => t.parentId === e).map((e) => this.getNodeRect(e.id)).filter(Boolean);
|
|
4373
4373
|
}
|
|
4374
|
-
},
|
|
4374
|
+
}, Ba = class {
|
|
4375
4375
|
backend;
|
|
4376
4376
|
constructor(e) {
|
|
4377
4377
|
this.backend = e;
|
|
@@ -4438,18 +4438,18 @@ var za = /* @__PURE__ */ u({
|
|
|
4438
4438
|
queryNodeEl(e) {
|
|
4439
4439
|
return this.requireBackend()?.queryNodeEl?.(e) ?? null;
|
|
4440
4440
|
}
|
|
4441
|
-
},
|
|
4441
|
+
}, Va = {
|
|
4442
4442
|
minZoom: .1,
|
|
4443
4443
|
maxZoom: 4,
|
|
4444
4444
|
durationMs: 320
|
|
4445
4445
|
};
|
|
4446
|
-
function
|
|
4446
|
+
function Ha(e, t, n) {
|
|
4447
4447
|
return Math.min(Math.max(e, t), n);
|
|
4448
4448
|
}
|
|
4449
|
-
function
|
|
4449
|
+
function Ua(e, t = 0) {
|
|
4450
4450
|
return typeof e == "number" && Number.isFinite(e) && e >= 0 ? e : t;
|
|
4451
4451
|
}
|
|
4452
|
-
function
|
|
4452
|
+
function Wa(e) {
|
|
4453
4453
|
let t = e[0] ?? 0, n = e[1] ?? t;
|
|
4454
4454
|
return {
|
|
4455
4455
|
top: t,
|
|
@@ -4458,7 +4458,7 @@ function Ga(e) {
|
|
|
4458
4458
|
left: e[3] ?? n
|
|
4459
4459
|
};
|
|
4460
4460
|
}
|
|
4461
|
-
function
|
|
4461
|
+
function Ga(e, t) {
|
|
4462
4462
|
if (e === void 0) return {
|
|
4463
4463
|
top: 0,
|
|
4464
4464
|
right: 0,
|
|
@@ -4473,9 +4473,9 @@ function Ka(e, t) {
|
|
|
4473
4473
|
left: 0
|
|
4474
4474
|
};
|
|
4475
4475
|
let r = n.every((e) => e <= 1), i = Math.min(Math.max(t.w, 0), Math.max(t.h, 0)), a = n.map((e) => r ? e * i : e);
|
|
4476
|
-
return
|
|
4476
|
+
return Wa(a.length > 4 ? a.slice(0, 4) : a);
|
|
4477
4477
|
}
|
|
4478
|
-
function
|
|
4478
|
+
function Ka(e) {
|
|
4479
4479
|
let t = e.opts ?? {}, n = e.viewportState ?? {
|
|
4480
4480
|
x: 0,
|
|
4481
4481
|
y: 0,
|
|
@@ -4500,7 +4500,7 @@ function qa(e) {
|
|
|
4500
4500
|
zoom: r
|
|
4501
4501
|
};
|
|
4502
4502
|
}
|
|
4503
|
-
let d = t.includeBars ?? "none", f = d === "top" || d === "both", p = d === "bottom" || d === "both", m = f ?
|
|
4503
|
+
let d = t.includeBars ?? "none", f = d === "top" || d === "both", p = d === "bottom" || d === "both", m = f ? Ua(e.barHeight?.top) : 0, h = p ? Ua(e.barHeight?.bottom) : 0, g = Ua(e.nodeTopBarHeight), _ = Ga(t.padding, {
|
|
4504
4504
|
w: i,
|
|
4505
4505
|
h: a
|
|
4506
4506
|
}), v = Math.max(a - 1, 0), y = Math.max(i - 1, 0), b = m + _.top, x = h + _.bottom, S = g, C = _.left, w = _.right, T = b + x, E = C + w;
|
|
@@ -4513,14 +4513,14 @@ function qa(e) {
|
|
|
4513
4513
|
C *= e, w *= e;
|
|
4514
4514
|
}
|
|
4515
4515
|
let D = Math.max(i - C - w, 1), O = Math.max(a - b - x, 1), k = C + D / 2, A = b + O / 2, j = r;
|
|
4516
|
-
if (typeof t.zoom == "number") j =
|
|
4516
|
+
if (typeof t.zoom == "number") j = Ha(t.zoom, t.minZoom ?? Va.minZoom, t.maxZoom ?? Va.maxZoom);
|
|
4517
4517
|
else if (t.keepZoom) j = r;
|
|
4518
4518
|
else if (typeof t.heightRatio == "number") {
|
|
4519
|
-
let e =
|
|
4520
|
-
j =
|
|
4519
|
+
let e = Ha(t.heightRatio, .05, 1);
|
|
4520
|
+
j = Ha(Math.max(O - S - 0, 1) * e / Math.max(u.height, 1), t.minZoom ?? Va.minZoom, t.maxZoom ?? Va.maxZoom);
|
|
4521
4521
|
} else {
|
|
4522
4522
|
let e = Math.max(D - 0, 1), n = Math.max(O - S - 0, 1);
|
|
4523
|
-
j =
|
|
4523
|
+
j = Ha(Math.min(e / Math.max(u.width, 1), n / Math.max(u.height, 1)), t.minZoom ?? Va.minZoom, t.maxZoom ?? Va.maxZoom);
|
|
4524
4524
|
}
|
|
4525
4525
|
let M = u.x + u.width / 2, N = u.y + u.height / 2, P = A + S / 2, F = {
|
|
4526
4526
|
x: k - M * j,
|
|
@@ -4535,7 +4535,7 @@ function qa(e) {
|
|
|
4535
4535
|
}
|
|
4536
4536
|
//#endregion
|
|
4537
4537
|
//#region src/view/viewService.ts
|
|
4538
|
-
var
|
|
4538
|
+
var qa = 48, Ja = 1.25, Ya = class {
|
|
4539
4539
|
layout;
|
|
4540
4540
|
viewport;
|
|
4541
4541
|
chromeBars = {
|
|
@@ -4545,7 +4545,7 @@ var Ja = 48, Ya = class {
|
|
|
4545
4545
|
right: 0
|
|
4546
4546
|
};
|
|
4547
4547
|
constructor(e) {
|
|
4548
|
-
this.layout = e.layout ?? new
|
|
4548
|
+
this.layout = e.layout ?? new za(e.nodeStore), this.viewport = e.viewport ?? new Ba();
|
|
4549
4549
|
}
|
|
4550
4550
|
setMeasuredSize(e, t, n) {
|
|
4551
4551
|
this.layout.setMeasuredSize(e, t, n);
|
|
@@ -4593,7 +4593,7 @@ var Ja = 48, Ya = class {
|
|
|
4593
4593
|
let t = e.includeBars ?? "none", n = t === "top" || t === "both", r = t === "bottom" || t === "both", i = n ? this.chromeBars.top : 0, a = r ? this.chromeBars.bottom : 0, o = this.viewport.getRootEl() ?? this.viewport.getPaneEl(), s = {
|
|
4594
4594
|
w: o?.clientWidth ?? 1,
|
|
4595
4595
|
h: o?.clientHeight ?? 1
|
|
4596
|
-
}, c =
|
|
4596
|
+
}, c = Ga(e.padding, s);
|
|
4597
4597
|
return {
|
|
4598
4598
|
top: i + c.top,
|
|
4599
4599
|
right: c.right,
|
|
@@ -4656,7 +4656,7 @@ var Ja = 48, Ya = class {
|
|
|
4656
4656
|
let s = t.includeNodeTopBar ? this.nodeTopBarScreen(e, r) : void 0, c = t.includeBars ?? "none", l = c === "top" || c === "both", u = c === "bottom" || c === "both", d = {
|
|
4657
4657
|
top: l ? this.chromeBars.top : 0,
|
|
4658
4658
|
bottom: u ? this.chromeBars.bottom : 0
|
|
4659
|
-
}, f =
|
|
4659
|
+
}, f = Ka({
|
|
4660
4660
|
rects: e,
|
|
4661
4661
|
viewport: o,
|
|
4662
4662
|
viewportState: this.viewport.getViewport(),
|
|
@@ -4683,6 +4683,7 @@ var Ja = 48, Ya = class {
|
|
|
4683
4683
|
includeBars: "both",
|
|
4684
4684
|
includeNodeTopBar: !0,
|
|
4685
4685
|
animate: !1,
|
|
4686
|
+
maxZoom: Ja,
|
|
4686
4687
|
...t
|
|
4687
4688
|
}, e);
|
|
4688
4689
|
}
|
|
@@ -5029,11 +5030,11 @@ async function no(e = {}) {
|
|
|
5029
5030
|
e.ctx && t.installPlugin(a.plugin);
|
|
5030
5031
|
let { save: o, doc: s, nodeStore: c, edgeStore: l, resources: u, nodeRegistry: d, themeRegistry: f, selection: p, history: m, graph: h, command: g, nodeFactory: _ } = a.services, v = new Ya({
|
|
5031
5032
|
nodeStore: c,
|
|
5032
|
-
layout: new
|
|
5033
|
-
viewport: new
|
|
5033
|
+
layout: new za(c),
|
|
5034
|
+
viewport: new Ba()
|
|
5034
5035
|
}), y = t.hasService("view") ? void 0 : t.inject("view", v), b = to(), x = t.hasService("canvasBoot") ? void 0 : t.inject("canvasBoot", b);
|
|
5035
|
-
e.ctx || t.plugin(a.plugin),
|
|
5036
|
-
let S =
|
|
5036
|
+
e.ctx || t.plugin(a.plugin), ja(t);
|
|
5037
|
+
let S = La(t, { hiddenPlugins: [a.name, W] }), C = new Za(t), w = t.hasService("canvas") ? void 0 : t.inject("canvas", C), T = new $a();
|
|
5037
5038
|
T.docPeek = s;
|
|
5038
5039
|
let E = t.hasService("nodeToolbar") ? void 0 : t.inject("nodeToolbar", T), D = () => {
|
|
5039
5040
|
y?.(), x?.(), w?.(), E?.(), a.services.revokeDoc?.(), a.services.revokeNodeGeometry?.(), a.services.revokeSelection?.();
|
|
@@ -5041,7 +5042,7 @@ async function no(e = {}) {
|
|
|
5041
5042
|
if (t.slots.register("overlay", {
|
|
5042
5043
|
id: "canvas-render/tip-layer",
|
|
5043
5044
|
order: 95,
|
|
5044
|
-
component:
|
|
5045
|
+
component: Ra,
|
|
5045
5046
|
meta: { title: "鼠标提示" }
|
|
5046
5047
|
}), e.manifest) t.getState() !== "started" && await t.start(), await S.applyManifest(e.manifest);
|
|
5047
5048
|
else if (t.getState() === "created") {
|
|
@@ -5056,10 +5057,10 @@ async function no(e = {}) {
|
|
|
5056
5057
|
}
|
|
5057
5058
|
g.setContext(t);
|
|
5058
5059
|
let O = t.get("settings");
|
|
5059
|
-
O.has("nodesDraggable") || O.define(
|
|
5060
|
+
O.has("nodesDraggable") || O.define(pn, gn, "canvas-render"), Hn(O), Xn(O);
|
|
5060
5061
|
let k = a.services.settingsPersist;
|
|
5061
5062
|
k && await o.settings.restore();
|
|
5062
|
-
let A =
|
|
5063
|
+
let A = Un(O), j = Zn(O), M = [];
|
|
5063
5064
|
for (let n of e.sessionHooks ?? []) try {
|
|
5064
5065
|
let e = n.onCanvasReady(t);
|
|
5065
5066
|
typeof e == "function" && M.push(e);
|
|
@@ -5138,7 +5139,7 @@ async function no(e = {}) {
|
|
|
5138
5139
|
}
|
|
5139
5140
|
//#endregion
|
|
5140
5141
|
//#region src/host/CanvasProvider.vue?vue&type=script&setup=true&lang.ts
|
|
5141
|
-
var ro = { class: "canvas-provider-root" }, io = { class: "canvas-provider-status is-error" }, ao = /*#__PURE__*/
|
|
5142
|
+
var ro = { class: "canvas-provider-root" }, io = { class: "canvas-provider-status is-error" }, ao = /*#__PURE__*/ Xr(/* @__PURE__ */ u({
|
|
5142
5143
|
__name: "CanvasProvider",
|
|
5143
5144
|
props: {
|
|
5144
5145
|
plugins: { default: () => [] },
|
|
@@ -5459,7 +5460,7 @@ var Uo = { class: "psd-title-block" }, Wo = { class: "psd-eyebrow" }, Go = { cla
|
|
|
5459
5460
|
"stroke-width": "2",
|
|
5460
5461
|
"stroke-linecap": "round",
|
|
5461
5462
|
"stroke-linejoin": "round"
|
|
5462
|
-
}, Yo = ["title", "onKeydown"], Xo = 240,
|
|
5463
|
+
}, Yo = ["title", "onKeydown"], Xo = 240, Zo = 40, Qo = 7, $o = 34, es = 4, ts = 18, ns = 520, rs = 360, is = 10, as = /*#__PURE__*/ Xr(/* @__PURE__ */ u({
|
|
5463
5464
|
__name: "SettingsShell",
|
|
5464
5465
|
props: {
|
|
5465
5466
|
title: { default: "设置" },
|
|
@@ -5491,10 +5492,10 @@ var Uo = { class: "psd-title-block" }, Wo = { class: "psd-eyebrow" }, Go = { cla
|
|
|
5491
5492
|
height: typeof window < "u" ? Math.min(Math.floor(.68 * window.innerHeight), 780) : 780
|
|
5492
5493
|
}), R = T(null);
|
|
5493
5494
|
function z(e) {
|
|
5494
|
-
let t = window.innerWidth, n = window.innerHeight, r = Math.max(
|
|
5495
|
+
let t = window.innerWidth, n = window.innerHeight, r = Math.max(ns, t - is * 2), i = Math.max(rs, n - is * 2), a = Math.max(ns, Math.min(e.width, r)), o = Math.max(rs, Math.min(e.height, i)), s = t - a - is, c = n - o - is;
|
|
5495
5496
|
return {
|
|
5496
|
-
left: Math.min(Math.max(
|
|
5497
|
-
top: Math.min(Math.max(
|
|
5497
|
+
left: Math.min(Math.max(is, e.left), Math.max(is, s)),
|
|
5498
|
+
top: Math.min(Math.max(is, e.top), Math.max(is, c)),
|
|
5498
5499
|
width: a,
|
|
5499
5500
|
height: o
|
|
5500
5501
|
};
|
|
@@ -5534,11 +5535,11 @@ var Uo = { class: "psd-title-block" }, Wo = { class: "psd-eyebrow" }, Go = { cla
|
|
|
5534
5535
|
}
|
|
5535
5536
|
function W() {
|
|
5536
5537
|
if (!x.value) return;
|
|
5537
|
-
let e = window.innerWidth, t = O.value.left +
|
|
5538
|
-
t <=
|
|
5538
|
+
let e = window.innerWidth, t = O.value.left + Zo / 2;
|
|
5539
|
+
t <= ts ? (E.value = -1, w.value = !0) : t >= e - ts ? (E.value = 1, w.value = !0) : (E.value = 0, w.value = !1), ne();
|
|
5539
5540
|
}
|
|
5540
5541
|
function G() {
|
|
5541
|
-
let e = w.value ?
|
|
5542
|
+
let e = w.value ? Qo : Zo, t = w.value ? $o : Zo;
|
|
5542
5543
|
return {
|
|
5543
5544
|
x: e / 2,
|
|
5544
5545
|
y: t / 2
|
|
@@ -5549,7 +5550,7 @@ var Uo = { class: "psd-title-block" }, Wo = { class: "psd-eyebrow" }, Go = { cla
|
|
|
5549
5550
|
return r + "px " + i + "px";
|
|
5550
5551
|
}
|
|
5551
5552
|
function ne() {
|
|
5552
|
-
let e = w.value ?
|
|
5553
|
+
let e = w.value ? Qo : Zo, t = w.value ? $o : Zo, n = window.innerWidth, r = window.innerHeight, i = O.value.left;
|
|
5553
5554
|
E.value === -1 ? i = 0 : E.value === 1 && (i = n - e);
|
|
5554
5555
|
let a = Math.min(Math.max(0, O.value.top), Math.max(0, r - t));
|
|
5555
5556
|
O.value = {
|
|
@@ -5558,8 +5559,8 @@ var Uo = { class: "psd-title-block" }, Wo = { class: "psd-eyebrow" }, Go = { cla
|
|
|
5558
5559
|
}, L.value = {
|
|
5559
5560
|
left: i + G().x,
|
|
5560
5561
|
top: a + G().y,
|
|
5561
|
-
width:
|
|
5562
|
-
height:
|
|
5562
|
+
width: ns,
|
|
5563
|
+
height: rs
|
|
5563
5564
|
};
|
|
5564
5565
|
}
|
|
5565
5566
|
let re = !1, ie = !1, ae = !1, oe = 0, se = 0, ce = 0, le = 0;
|
|
@@ -5569,7 +5570,7 @@ var Uo = { class: "psd-title-block" }, Wo = { class: "psd-eyebrow" }, Go = { cla
|
|
|
5569
5570
|
function de(e) {
|
|
5570
5571
|
if (re) {
|
|
5571
5572
|
if (!ie) {
|
|
5572
|
-
if (Math.abs(e.clientX - ce) + Math.abs(e.clientY - le) <
|
|
5573
|
+
if (Math.abs(e.clientX - ce) + Math.abs(e.clientY - le) < es) return;
|
|
5573
5574
|
ie = !0, w.value = !1, E.value = 0;
|
|
5574
5575
|
}
|
|
5575
5576
|
O.value = {
|
|
@@ -5611,8 +5612,8 @@ var Uo = { class: "psd-title-block" }, Wo = { class: "psd-eyebrow" }, Go = { cla
|
|
|
5611
5612
|
let be = !1, xe = 0, Se = 0, Ce = {
|
|
5612
5613
|
left: 0,
|
|
5613
5614
|
top: 0,
|
|
5614
|
-
width:
|
|
5615
|
-
height:
|
|
5615
|
+
width: ns,
|
|
5616
|
+
height: rs
|
|
5616
5617
|
};
|
|
5617
5618
|
function we(e) {
|
|
5618
5619
|
b.value && (be = !0, xe = e.clientX, Se = e.clientY, Ce = { ...L.value }, e.preventDefault(), e.stopPropagation());
|
|
@@ -5638,27 +5639,27 @@ var Uo = { class: "psd-title-block" }, Wo = { class: "psd-eyebrow" }, Go = { cla
|
|
|
5638
5639
|
position: "fixed",
|
|
5639
5640
|
left: (t ? t.left : e.left) + "px",
|
|
5640
5641
|
top: (t ? t.top : e.top) + "px",
|
|
5641
|
-
width: (x.value ?
|
|
5642
|
-
height: (x.value ?
|
|
5642
|
+
width: (x.value ? ns : e.width) + "px",
|
|
5643
|
+
height: (x.value ? rs : e.height) + "px",
|
|
5643
5644
|
animation: "none"
|
|
5644
5645
|
};
|
|
5645
5646
|
if (x.value) {
|
|
5646
|
-
let t = w.value ?
|
|
5647
|
+
let t = w.value ? Qo : Zo, r = w.value ? $o : Zo, i = C.value && A.value ? A.value : {
|
|
5647
5648
|
left: e.left,
|
|
5648
5649
|
top: e.top,
|
|
5649
|
-
width:
|
|
5650
|
-
height:
|
|
5650
|
+
width: ns,
|
|
5651
|
+
height: rs
|
|
5651
5652
|
};
|
|
5652
5653
|
n.left = i.left + "px", n.top = i.top + "px", n.width = i.width + "px", n.height = i.height + "px";
|
|
5653
5654
|
let a = t / i.width, o = r / i.height;
|
|
5654
5655
|
n.transformOrigin = te(G(), a, o), n.transform = "scale(" + a + ", " + o + ")", n.borderRadius = w.value ? "4px" : "999px", C.value || (n.opacity = "0");
|
|
5655
5656
|
} else if (t) {
|
|
5656
|
-
let t = w.value ?
|
|
5657
|
+
let t = w.value ? Qo : Zo, r = w.value ? $o : Zo, i = t / e.width, a = r / e.height;
|
|
5657
5658
|
n.transformOrigin = te(G(), i, a), n.transform = "scale(" + i + ", " + a + ")", n.opacity = "0";
|
|
5658
5659
|
}
|
|
5659
5660
|
return n;
|
|
5660
5661
|
}), ke = i(() => {
|
|
5661
|
-
let e = w.value ?
|
|
5662
|
+
let e = w.value ? Qo : Zo, t = w.value ? $o : Zo;
|
|
5662
5663
|
return {
|
|
5663
5664
|
left: O.value.left + "px",
|
|
5664
5665
|
top: O.value.top + "px",
|
|
@@ -5771,10 +5772,10 @@ var Uo = { class: "psd-title-block" }, Wo = { class: "psd-eyebrow" }, Go = { cla
|
|
|
5771
5772
|
r: "3.2"
|
|
5772
5773
|
}), c("path", { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 1 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 1 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 1 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 1 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z" })], -1)]], 46, Yo)) : o("", !0)]))], 64));
|
|
5773
5774
|
}
|
|
5774
|
-
}), [["__scopeId", "data-v-4b425c39"]]),
|
|
5775
|
+
}), [["__scopeId", "data-v-4b425c39"]]), os = {
|
|
5775
5776
|
key: 1,
|
|
5776
5777
|
class: "sh-empty"
|
|
5777
|
-
},
|
|
5778
|
+
}, ss = /*#__PURE__*/ Xr(/* @__PURE__ */ u({
|
|
5778
5779
|
__name: "SettingsHost",
|
|
5779
5780
|
props: { emptyHint: {} },
|
|
5780
5781
|
setup(e) {
|
|
@@ -5791,15 +5792,15 @@ var Uo = { class: "psd-title-block" }, Wo = { class: "psd-eyebrow" }, Go = { cla
|
|
|
5791
5792
|
function d() {
|
|
5792
5793
|
t.emit("settings:ui-close");
|
|
5793
5794
|
}
|
|
5794
|
-
return (t, n) => c.value ? (S(), a(
|
|
5795
|
+
return (t, n) => c.value ? (S(), a(as, {
|
|
5795
5796
|
key: 0,
|
|
5796
5797
|
onClose: d
|
|
5797
5798
|
}, {
|
|
5798
5799
|
default: P(() => [(S(), a(O(c.value), { settings: M(r) }, null, 8, ["settings"]))]),
|
|
5799
5800
|
_: 1
|
|
5800
|
-
})) : e.emptyHint ? (S(), s("div",
|
|
5801
|
+
})) : e.emptyHint ? (S(), s("div", os, j(e.emptyHint), 1)) : o("", !0);
|
|
5801
5802
|
}
|
|
5802
|
-
}), [["__scopeId", "data-v-020d0ba2"]]),
|
|
5803
|
+
}), [["__scopeId", "data-v-020d0ba2"]]), cs = u({
|
|
5803
5804
|
name: "SlotAnchor",
|
|
5804
5805
|
inheritAttrs: !1,
|
|
5805
5806
|
props: {
|
|
@@ -5823,7 +5824,7 @@ var Uo = { class: "psd-title-block" }, Wo = { class: "psd-eyebrow" }, Go = { cla
|
|
|
5823
5824
|
setup() {
|
|
5824
5825
|
return () => null;
|
|
5825
5826
|
}
|
|
5826
|
-
}),
|
|
5827
|
+
}), ls = 1e3, us = u({
|
|
5827
5828
|
name: "SlotComposer",
|
|
5828
5829
|
inheritAttrs: !1,
|
|
5829
5830
|
props: {
|
|
@@ -5878,7 +5879,7 @@ var Uo = { class: "psd-title-block" }, Wo = { class: "psd-eyebrow" }, Go = { cla
|
|
|
5878
5879
|
continue;
|
|
5879
5880
|
}
|
|
5880
5881
|
if (a.type !== e) {
|
|
5881
|
-
if (a.type ===
|
|
5882
|
+
if (a.type === cs) {
|
|
5882
5883
|
let e = a.props, t = e && typeof e.id == "string" ? e.id : "";
|
|
5883
5884
|
if (!Xe(t)) {
|
|
5884
5885
|
c.has("bad-anchor:" + t) || (c.add("bad-anchor:" + t), console.warn("[SlotComposer] SlotAnchor 的 id 必须是 owner/name 形式(如 host/agent);收到:" + t));
|
|
@@ -5886,7 +5887,7 @@ var Uo = { class: "psd-title-block" }, Wo = { class: "psd-eyebrow" }, Go = { cla
|
|
|
5886
5887
|
}
|
|
5887
5888
|
n.push({
|
|
5888
5889
|
id: t,
|
|
5889
|
-
order: typeof e?.order == "number" ? e.order :
|
|
5890
|
+
order: typeof e?.order == "number" ? e.order : ls,
|
|
5890
5891
|
...typeof e?.before == "string" ? { before: e.before } : {},
|
|
5891
5892
|
...typeof e?.after == "string" ? { after: e.after } : {},
|
|
5892
5893
|
component: void 0,
|
|
@@ -5897,7 +5898,7 @@ var Uo = { class: "psd-title-block" }, Wo = { class: "psd-eyebrow" }, Go = { cla
|
|
|
5897
5898
|
}
|
|
5898
5899
|
n.push({
|
|
5899
5900
|
id: "host/anonymous-" + n.length,
|
|
5900
|
-
order:
|
|
5901
|
+
order: ls,
|
|
5901
5902
|
component: void 0,
|
|
5902
5903
|
source: "host",
|
|
5903
5904
|
content: [a]
|
|
@@ -5953,25 +5954,25 @@ var Uo = { class: "psd-title-block" }, Wo = { class: "psd-eyebrow" }, Go = { cla
|
|
|
5953
5954
|
}, t);
|
|
5954
5955
|
};
|
|
5955
5956
|
}
|
|
5956
|
-
}),
|
|
5957
|
+
}), ds = { class: "pk-toolbar-icon" }, fs = ["innerHTML"], ps = /* @__PURE__ */ u({
|
|
5957
5958
|
__name: "ToolbarIcon",
|
|
5958
5959
|
props: { icon: {} },
|
|
5959
5960
|
setup(e) {
|
|
5960
5961
|
let t = e, n = i(() => Je(t.icon));
|
|
5961
|
-
return (t, r) => (S(), s("span",
|
|
5962
|
+
return (t, r) => (S(), s("span", ds, [n.value === "html" ? (S(), s("span", {
|
|
5962
5963
|
key: 0,
|
|
5963
5964
|
innerHTML: e.icon
|
|
5964
|
-
}, null, 8,
|
|
5965
|
+
}, null, 8, fs)) : n.value === "component" ? (S(), a(O(e.icon), { key: 1 })) : o("", !0)]));
|
|
5965
5966
|
}
|
|
5966
5967
|
});
|
|
5967
5968
|
//#endregion
|
|
5968
5969
|
//#region ../vue-render/src/components/slotComposer.ts
|
|
5969
|
-
function
|
|
5970
|
+
function ms(e, t) {
|
|
5970
5971
|
return [...e, ...t];
|
|
5971
5972
|
}
|
|
5972
5973
|
//#endregion
|
|
5973
5974
|
//#region src/theme/defaults.ts
|
|
5974
|
-
var
|
|
5975
|
+
var hs = {
|
|
5975
5976
|
edgeType: "adaptive",
|
|
5976
5977
|
edgeLineWidth: 1.5,
|
|
5977
5978
|
edgeDashed: !1,
|
|
@@ -5991,7 +5992,7 @@ var ms = {
|
|
|
5991
5992
|
edgeAvoidMargin: 18,
|
|
5992
5993
|
edgeAvoidRadius: 8,
|
|
5993
5994
|
edgeAvoidClearance: 6
|
|
5994
|
-
},
|
|
5995
|
+
}, gs = {
|
|
5995
5996
|
handleRestOffset: 36,
|
|
5996
5997
|
handleCursorGap: 24,
|
|
5997
5998
|
handleButtonSize: 32,
|
|
@@ -6000,25 +6001,25 @@ var ms = {
|
|
|
6000
6001
|
portZoneOffset: 0,
|
|
6001
6002
|
portZoneShape: "arc",
|
|
6002
6003
|
portZoneArcRatio: .8
|
|
6003
|
-
},
|
|
6004
|
+
}, _s = {
|
|
6004
6005
|
handleDebug: !1,
|
|
6005
6006
|
connectionSnapDebugVisible: !1,
|
|
6006
6007
|
slotDebug: !1,
|
|
6007
6008
|
uiKitDebug: !1
|
|
6008
|
-
},
|
|
6009
|
+
}, vs = {
|
|
6009
6010
|
heightRatio: .8,
|
|
6010
6011
|
width: 24,
|
|
6011
6012
|
offset: 0,
|
|
6012
6013
|
shape: "rect"
|
|
6013
|
-
},
|
|
6014
|
+
}, ys = {
|
|
6014
6015
|
toolbarTopOffset: 6,
|
|
6015
6016
|
toolbarBottomOffset: 6
|
|
6016
|
-
},
|
|
6017
|
+
}, bs = Object.keys(hs), xs = Object.keys(gs), Ss = Object.keys(_s), Cs = Object.keys(vs), Q = {
|
|
6017
6018
|
Left: "left",
|
|
6018
6019
|
Right: "right",
|
|
6019
6020
|
Top: "top",
|
|
6020
6021
|
Bottom: "bottom"
|
|
6021
|
-
},
|
|
6022
|
+
}, ws = {
|
|
6022
6023
|
minCurvature: 80,
|
|
6023
6024
|
stepOffset: 20,
|
|
6024
6025
|
smoothRadius: 5,
|
|
@@ -6026,7 +6027,7 @@ var ms = {
|
|
|
6026
6027
|
avoidRadius: 8,
|
|
6027
6028
|
avoidClearance: 6
|
|
6028
6029
|
};
|
|
6029
|
-
function
|
|
6030
|
+
function Ts(e, t, n = {}) {
|
|
6030
6031
|
let r = n.minPad ?? 2, i = typeof t == "number" ? () => t : t;
|
|
6031
6032
|
return e.map((t, n) => {
|
|
6032
6033
|
let a = Math.max(0, i(n)), o = (e) => e === Infinity || a <= 0 ? a : Math.min(a, Math.max(Math.min(r, a), (e - 2) / 2)), s = Infinity, c = Infinity, l = Infinity, u = Infinity, d = t.x + t.w, f = t.y + t.h;
|
|
@@ -6043,7 +6044,7 @@ function ws(e, t, n = {}) {
|
|
|
6043
6044
|
};
|
|
6044
6045
|
});
|
|
6045
6046
|
}
|
|
6046
|
-
function
|
|
6047
|
+
function Es(e, t) {
|
|
6047
6048
|
let n = Math.max(0, t.left), r = Math.max(0, t.right), i = Math.max(0, t.top), a = Math.max(0, t.bottom);
|
|
6048
6049
|
return {
|
|
6049
6050
|
...e,
|
|
@@ -6053,7 +6054,7 @@ function Ts(e, t) {
|
|
|
6053
6054
|
h: e.h + i + a
|
|
6054
6055
|
};
|
|
6055
6056
|
}
|
|
6056
|
-
var
|
|
6057
|
+
var Ds = {
|
|
6057
6058
|
[Q.Left]: {
|
|
6058
6059
|
x: -1,
|
|
6059
6060
|
y: 0
|
|
@@ -6071,7 +6072,7 @@ var Es = {
|
|
|
6071
6072
|
y: 1
|
|
6072
6073
|
}
|
|
6073
6074
|
};
|
|
6074
|
-
function
|
|
6075
|
+
function Os({ source: e, sourcePosition: t = Q.Bottom, target: n }) {
|
|
6075
6076
|
return t === Q.Left || t === Q.Right ? e.x < n.x ? {
|
|
6076
6077
|
x: 1,
|
|
6077
6078
|
y: 0
|
|
@@ -6089,7 +6090,7 @@ function Ds({ source: e, sourcePosition: t = Q.Bottom, target: n }) {
|
|
|
6089
6090
|
function $(e, t) {
|
|
6090
6091
|
return Math.sqrt((t.x - e.x) ** 2 + (t.y - e.y) ** 2);
|
|
6091
6092
|
}
|
|
6092
|
-
function
|
|
6093
|
+
function ks({ sourceX: e, sourceY: t, targetX: n, targetY: r }) {
|
|
6093
6094
|
let i = Math.abs(n - e) / 2, a = n < e ? n + i : n - i, o = Math.abs(r - t) / 2;
|
|
6094
6095
|
return [
|
|
6095
6096
|
a,
|
|
@@ -6098,14 +6099,14 @@ function Os({ sourceX: e, sourceY: t, targetX: n, targetY: r }) {
|
|
|
6098
6099
|
o
|
|
6099
6100
|
];
|
|
6100
6101
|
}
|
|
6101
|
-
function
|
|
6102
|
-
let o =
|
|
6102
|
+
function As({ source: e, sourcePosition: t, target: n, targetPosition: r, center: i, offset: a }) {
|
|
6103
|
+
let o = Ds[t], s = Ds[r], c = {
|
|
6103
6104
|
x: e.x + o.x * a,
|
|
6104
6105
|
y: e.y + o.y * a
|
|
6105
6106
|
}, l = {
|
|
6106
6107
|
x: n.x + s.x * a,
|
|
6107
6108
|
y: n.y + s.y * a
|
|
6108
|
-
}, u =
|
|
6109
|
+
}, u = Os({
|
|
6109
6110
|
source: c,
|
|
6110
6111
|
sourcePosition: t,
|
|
6111
6112
|
target: l
|
|
@@ -6115,7 +6116,7 @@ function ks({ source: e, sourcePosition: t, target: n, targetPosition: r, center
|
|
|
6115
6116
|
}, _ = {
|
|
6116
6117
|
x: 0,
|
|
6117
6118
|
y: 0
|
|
6118
|
-
}, [v, y] =
|
|
6119
|
+
}, [v, y] = ks({
|
|
6119
6120
|
sourceX: e.x,
|
|
6120
6121
|
sourceY: e.y,
|
|
6121
6122
|
targetX: n.x,
|
|
@@ -6182,7 +6183,7 @@ function ks({ source: e, sourcePosition: t, target: n, targetPosition: r, center
|
|
|
6182
6183
|
h
|
|
6183
6184
|
];
|
|
6184
6185
|
}
|
|
6185
|
-
function
|
|
6186
|
+
function js(e, t, n, r) {
|
|
6186
6187
|
let i = Math.min($(e, t) / 2, $(t, n) / 2, r), { x: a, y: o } = t;
|
|
6187
6188
|
if (e.x === a && a === n.x || e.y === o && o === n.y) return `L${a} ${o}`;
|
|
6188
6189
|
if (e.y === o) {
|
|
@@ -6192,11 +6193,11 @@ function As(e, t, n, r) {
|
|
|
6192
6193
|
let s = e.x < n.x ? 1 : -1;
|
|
6193
6194
|
return `L ${a},${o + i * (e.y < n.y ? -1 : 1)}Q ${a},${o} ${a + i * s},${o}`;
|
|
6194
6195
|
}
|
|
6195
|
-
function
|
|
6196
|
+
function Ms(e, t) {
|
|
6196
6197
|
let n = {
|
|
6197
|
-
...
|
|
6198
|
+
...ws,
|
|
6198
6199
|
...e
|
|
6199
|
-
}, r = e.offset ?? n.stepOffset, { sourceX: i, sourceY: a, sourcePosition: o, targetX: s, targetY: c, targetPosition: l, centerX: u, centerY: d } = e, [f] =
|
|
6200
|
+
}, r = e.offset ?? n.stepOffset, { sourceX: i, sourceY: a, sourcePosition: o, targetX: s, targetY: c, targetPosition: l, centerX: u, centerY: d } = e, [f] = As({
|
|
6200
6201
|
source: {
|
|
6201
6202
|
x: i,
|
|
6202
6203
|
y: a
|
|
@@ -6215,20 +6216,20 @@ function js(e, t) {
|
|
|
6215
6216
|
});
|
|
6216
6217
|
return [f.reduce((e, n, r) => {
|
|
6217
6218
|
let i;
|
|
6218
|
-
return i = r > 0 && r < f.length - 1 ?
|
|
6219
|
+
return i = r > 0 && r < f.length - 1 ? js(f[r - 1], n, f[r + 1], t) : `${r === 0 ? "M" : "L"}${n.x} ${n.y}`, e + i;
|
|
6219
6220
|
}, ""), f];
|
|
6220
6221
|
}
|
|
6221
|
-
function
|
|
6222
|
-
return
|
|
6222
|
+
function Ns(e) {
|
|
6223
|
+
return Ds[e];
|
|
6223
6224
|
}
|
|
6224
|
-
function
|
|
6225
|
+
function Ps(e, t, n, r, i, a) {
|
|
6225
6226
|
let o = {
|
|
6226
6227
|
x: e,
|
|
6227
6228
|
y: t
|
|
6228
6229
|
}, s = {
|
|
6229
6230
|
x: n,
|
|
6230
6231
|
y: r
|
|
6231
|
-
}, c =
|
|
6232
|
+
}, c = Ns(i), l = Ns(a), u = $(o, s), d = c.x * l.x + c.y * l.y < -.5, f = (s.x - o.x) * c.x + (s.y - o.y) * c.y, p, m;
|
|
6232
6233
|
if (d && f >= 0) {
|
|
6233
6234
|
let e = Math.min(f * .5, 180);
|
|
6234
6235
|
p = e, m = e;
|
|
@@ -6244,15 +6245,15 @@ function Ns(e, t, n, r, i, a) {
|
|
|
6244
6245
|
}
|
|
6245
6246
|
};
|
|
6246
6247
|
}
|
|
6247
|
-
function
|
|
6248
|
-
let { c1: o, c2: s } =
|
|
6248
|
+
function Fs(e, t, n, r, i, a) {
|
|
6249
|
+
let { c1: o, c2: s } = Ps(e, t, n, r, i, a);
|
|
6249
6250
|
return `M ${e} ${t} C ${o.x} ${o.y}, ${s.x} ${s.y}, ${n} ${r}`;
|
|
6250
6251
|
}
|
|
6251
|
-
function
|
|
6252
|
+
function Is(e, t, n) {
|
|
6252
6253
|
let r = t.x + n, i = t.y + n, a = t.x + t.w - n, o = t.y + t.h - n;
|
|
6253
6254
|
return e.x > r && e.x < a && e.y > i && e.y < o;
|
|
6254
6255
|
}
|
|
6255
|
-
function
|
|
6256
|
+
function Ls(e, t, n, r) {
|
|
6256
6257
|
let i = n.x + r, a = n.y + r, o = n.x + n.w - r, s = n.y + n.h - r;
|
|
6257
6258
|
if (o <= i || s <= a) return !1;
|
|
6258
6259
|
let c = t.x - e.x, l = t.y - e.y, u = 0, d = 1, f = [
|
|
@@ -6283,19 +6284,19 @@ function Is(e, t, n, r) {
|
|
|
6283
6284
|
}
|
|
6284
6285
|
return u < d - 1e-7;
|
|
6285
6286
|
}
|
|
6286
|
-
function
|
|
6287
|
+
function Rs(e) {
|
|
6287
6288
|
let t = e.slice().sort((e, t) => e - t), n = [];
|
|
6288
6289
|
for (let e of t) (!n.length || Math.abs(e - n[n.length - 1]) > .001) && n.push(e);
|
|
6289
6290
|
return n;
|
|
6290
6291
|
}
|
|
6291
|
-
function
|
|
6292
|
-
let t =
|
|
6292
|
+
function zs(e) {
|
|
6293
|
+
let t = Rs(e);
|
|
6293
6294
|
if (!t.length) return [];
|
|
6294
6295
|
let n = [t[0]];
|
|
6295
6296
|
for (let e = 1; e < t.length; e++) t[e] - t[e - 1] > 2 && n.push((t[e - 1] + t[e]) / 2), n.push(t[e]);
|
|
6296
6297
|
return n;
|
|
6297
6298
|
}
|
|
6298
|
-
var
|
|
6299
|
+
var Bs = class {
|
|
6299
6300
|
items = [];
|
|
6300
6301
|
size() {
|
|
6301
6302
|
return this.items.length;
|
|
@@ -6326,11 +6327,11 @@ var zs = class {
|
|
|
6326
6327
|
return t;
|
|
6327
6328
|
}
|
|
6328
6329
|
};
|
|
6329
|
-
function
|
|
6330
|
+
function Vs(e, t, n) {
|
|
6330
6331
|
if ($(e, t) < .5) return [e, t];
|
|
6331
6332
|
let r = [e.x, t.x], i = [e.y, t.y];
|
|
6332
6333
|
for (let e of n) r.push(e.x, e.x + e.w), i.push(e.y, e.y + e.h);
|
|
6333
|
-
let a =
|
|
6334
|
+
let a = zs(r), o = zs(i), s = a.length, c = o.length;
|
|
6334
6335
|
if (!s || !c) return null;
|
|
6335
6336
|
let l = a.findIndex((t) => Math.abs(t - e.x) < .001), u = a.findIndex((e) => Math.abs(e - t.x) < .001), d = o.findIndex((t) => Math.abs(t - e.y) < .001), f = o.findIndex((e) => Math.abs(e - t.y) < .001);
|
|
6336
6337
|
if (l < 0 || d < 0 || u < 0 || f < 0) return null;
|
|
@@ -6339,10 +6340,10 @@ function Bs(e, t, n) {
|
|
|
6339
6340
|
y: o[Math.floor(e / s)]
|
|
6340
6341
|
}), m = (e) => {
|
|
6341
6342
|
let t = p(e);
|
|
6342
|
-
for (let e of n) if (
|
|
6343
|
+
for (let e of n) if (Is(t, e, .35)) return !1;
|
|
6343
6344
|
return !0;
|
|
6344
6345
|
}, h = (e, t) => {
|
|
6345
|
-
for (let r of n) if (
|
|
6346
|
+
for (let r of n) if (Ls(e, t, r, .45)) return !1;
|
|
6346
6347
|
return !0;
|
|
6347
6348
|
}, g = d * s + l, _ = f * s + u;
|
|
6348
6349
|
if (!m(g) || !m(_)) return null;
|
|
@@ -6350,7 +6351,7 @@ function Bs(e, t, n) {
|
|
|
6350
6351
|
y.fill(Infinity), b.fill(-1);
|
|
6351
6352
|
let S = g * 5 + 4, C = p(_);
|
|
6352
6353
|
y[S] = 0;
|
|
6353
|
-
let w = new
|
|
6354
|
+
let w = new Bs();
|
|
6354
6355
|
w.push({
|
|
6355
6356
|
key: S,
|
|
6356
6357
|
g: 0,
|
|
@@ -6406,7 +6407,7 @@ function Bs(e, t, n) {
|
|
|
6406
6407
|
for (; O !== -1 && !k.has(O) && (k.add(O), D.push(p(Math.floor(O / 5))), O !== S);) O = b[O];
|
|
6407
6408
|
return D.reverse(), D;
|
|
6408
6409
|
}
|
|
6409
|
-
function
|
|
6410
|
+
function Hs(e) {
|
|
6410
6411
|
let t = [];
|
|
6411
6412
|
for (let n of e) {
|
|
6412
6413
|
let e = t.length ? t[t.length - 1] : null;
|
|
@@ -6428,8 +6429,8 @@ function Vs(e) {
|
|
|
6428
6429
|
}
|
|
6429
6430
|
return t;
|
|
6430
6431
|
}
|
|
6431
|
-
function
|
|
6432
|
-
let n =
|
|
6432
|
+
function Us(e, t) {
|
|
6433
|
+
let n = Hs(e);
|
|
6433
6434
|
if (!n.length) return {
|
|
6434
6435
|
d: "",
|
|
6435
6436
|
segments: [],
|
|
@@ -6479,11 +6480,11 @@ function Hs(e, t) {
|
|
|
6479
6480
|
fallback: !1
|
|
6480
6481
|
};
|
|
6481
6482
|
}
|
|
6482
|
-
function
|
|
6483
|
-
let c = Math.max(0, o.avoidMargin) + Math.max(0, o.avoidClearance), l =
|
|
6483
|
+
function Ws(e, t, n, r, i, a, o, s) {
|
|
6484
|
+
let c = Math.max(0, o.avoidMargin) + Math.max(0, o.avoidClearance), l = Ns(i), u = Ns(a), d = s ?? [], f = Ts(d, (e) => {
|
|
6484
6485
|
let t = d[e];
|
|
6485
6486
|
return t.role === "source" || t.role === "target" || t.endpoint ? c : Math.max(0, t.inflate ?? c);
|
|
6486
|
-
}), p = d.map((e, t) =>
|
|
6487
|
+
}), p = d.map((e, t) => Es(e, f[t])), m = d.find((e) => e.role === "source"), h = d.find((e) => e.role === "target"), g = Math.min(o.avoidRadius, Math.max(1, c * .55)), _ = (e) => p.every((t) => !Is(e, t, .6)), v = (e, t, n) => {
|
|
6487
6488
|
for (let r = 1; r <= c + 160; r++) {
|
|
6488
6489
|
let i = {
|
|
6489
6490
|
x: e + n.x * r,
|
|
@@ -6504,15 +6505,15 @@ function Us(e, t, n, r, i, a, o, s) {
|
|
|
6504
6505
|
if (((t.x - e.x) * r.x + (t.y - e.y) * r.y) * i <= 0) return !1;
|
|
6505
6506
|
continue;
|
|
6506
6507
|
}
|
|
6507
|
-
if (
|
|
6508
|
+
if (Ls(e, t, i, .4)) return !1;
|
|
6508
6509
|
}
|
|
6509
6510
|
return !0;
|
|
6510
6511
|
}, S = (e) => {
|
|
6511
6512
|
for (let t = 1; t < e.length; t++) if (!x(e[t - 1], e[t], t, e.length)) return !1;
|
|
6512
6513
|
return !0;
|
|
6513
|
-
}, C =
|
|
6514
|
+
}, C = Vs(y, b, p);
|
|
6514
6515
|
if (C) {
|
|
6515
|
-
let i =
|
|
6516
|
+
let i = Hs([
|
|
6516
6517
|
{
|
|
6517
6518
|
x: e,
|
|
6518
6519
|
y: t
|
|
@@ -6523,7 +6524,7 @@ function Us(e, t, n, r, i, a, o, s) {
|
|
|
6523
6524
|
y: r
|
|
6524
6525
|
}
|
|
6525
6526
|
]);
|
|
6526
|
-
if (S(i)) return
|
|
6527
|
+
if (S(i)) return Us(i, g);
|
|
6527
6528
|
}
|
|
6528
6529
|
if (p.length) {
|
|
6529
6530
|
let i = Math.min(...p.map((e) => e.x)), a = Math.max(...p.map((e) => e.x + e.w)), o = Math.min(...p.map((e) => e.y)), s = Math.max(...p.map((e) => e.y + e.h)), c = [
|
|
@@ -6609,13 +6610,13 @@ function Us(e, t, n, r, i, a, o, s) {
|
|
|
6609
6610
|
]
|
|
6610
6611
|
], l = null, u = Infinity;
|
|
6611
6612
|
for (let e of c) {
|
|
6612
|
-
let t =
|
|
6613
|
+
let t = Hs(e);
|
|
6613
6614
|
if (!S(t)) continue;
|
|
6614
6615
|
let n = 0;
|
|
6615
6616
|
for (let e = 1; e < t.length; e++) n += $(t[e - 1], t[e]);
|
|
6616
6617
|
n < u && (u = n, l = t);
|
|
6617
6618
|
}
|
|
6618
|
-
if (l) return
|
|
6619
|
+
if (l) return Us(l, g);
|
|
6619
6620
|
}
|
|
6620
6621
|
if (m && h) {
|
|
6621
6622
|
let i = Math.min(m.x, h.x), a = Math.max(m.x + m.w, h.x + h.w), o = Math.min(m.y, h.y), s = Math.max(m.y + m.h, h.y + h.h), c = [
|
|
@@ -6725,23 +6726,23 @@ function Us(e, t, n, r, i, a, o, s) {
|
|
|
6725
6726
|
]
|
|
6726
6727
|
], l = null, u = Infinity;
|
|
6727
6728
|
for (let e of c) {
|
|
6728
|
-
let t =
|
|
6729
|
+
let t = Hs(e), n = 0, r = !1;
|
|
6729
6730
|
for (let e = 1; e < t.length; e++) {
|
|
6730
6731
|
n += $(t[e - 1], t[e]);
|
|
6731
|
-
for (let n of [m, h]) e > 1 &&
|
|
6732
|
+
for (let n of [m, h]) e > 1 && Ls(t[e - 1], t[e], n, .5) && (r = !0);
|
|
6732
6733
|
}
|
|
6733
6734
|
r || n < u && (u = n, l = t);
|
|
6734
6735
|
}
|
|
6735
|
-
if (l) return
|
|
6736
|
+
if (l) return Us(l, Math.min(g, 4));
|
|
6736
6737
|
}
|
|
6737
6738
|
return {
|
|
6738
|
-
d:
|
|
6739
|
+
d: Fs(e, t, n, r, i, a),
|
|
6739
6740
|
segments: [],
|
|
6740
6741
|
points: [],
|
|
6741
6742
|
fallback: !0
|
|
6742
6743
|
};
|
|
6743
6744
|
}
|
|
6744
|
-
function
|
|
6745
|
+
function Gs(e, t) {
|
|
6745
6746
|
if (!e.length) return {
|
|
6746
6747
|
x: 0,
|
|
6747
6748
|
y: 0
|
|
@@ -6791,17 +6792,17 @@ function Ws(e, t) {
|
|
|
6791
6792
|
y: a.b.y
|
|
6792
6793
|
};
|
|
6793
6794
|
}
|
|
6794
|
-
function
|
|
6795
|
+
function Ks(e, t, n, r, i, a, o, s, c) {
|
|
6795
6796
|
let l = {
|
|
6796
|
-
...
|
|
6797
|
+
...ws,
|
|
6797
6798
|
...s || {}
|
|
6798
6799
|
};
|
|
6799
6800
|
switch (o) {
|
|
6800
|
-
case "adaptive": return
|
|
6801
|
-
case "avoid": return
|
|
6801
|
+
case "adaptive": return Fs(e, t, n, r, i, a);
|
|
6802
|
+
case "avoid": return Ws(e, t, n, r, i, a, l, c).d;
|
|
6802
6803
|
case "straight": return `M ${e} ${t} L ${n} ${r}`;
|
|
6803
6804
|
case "step": {
|
|
6804
|
-
let [o] =
|
|
6805
|
+
let [o] = Ms({
|
|
6805
6806
|
sourceX: e,
|
|
6806
6807
|
sourceY: t,
|
|
6807
6808
|
sourcePosition: i,
|
|
@@ -6814,7 +6815,7 @@ function Gs(e, t, n, r, i, a, o, s, c) {
|
|
|
6814
6815
|
return o;
|
|
6815
6816
|
}
|
|
6816
6817
|
case "smoothstep": {
|
|
6817
|
-
let [o] =
|
|
6818
|
+
let [o] = Ms({
|
|
6818
6819
|
sourceX: e,
|
|
6819
6820
|
sourceY: t,
|
|
6820
6821
|
sourcePosition: i,
|
|
@@ -6832,29 +6833,29 @@ function Gs(e, t, n, r, i, a, o, s, c) {
|
|
|
6832
6833
|
}
|
|
6833
6834
|
}
|
|
6834
6835
|
}
|
|
6835
|
-
function
|
|
6836
|
+
function qs(e, t, n, r, i, a, o, s, c, l) {
|
|
6836
6837
|
let u = {
|
|
6837
|
-
...
|
|
6838
|
+
...ws,
|
|
6838
6839
|
...c || {}
|
|
6839
6840
|
};
|
|
6840
6841
|
switch (s) {
|
|
6841
6842
|
case "adaptive": {
|
|
6842
|
-
let { c1: s, c2: c } =
|
|
6843
|
+
let { c1: s, c2: c } = Ps(t, n, r, i, a, o), l = 1 - e;
|
|
6843
6844
|
return {
|
|
6844
6845
|
x: l ** 3 * t + 3 * l ** 2 * e * s.x + 3 * l * e ** 2 * c.x + e ** 3 * r,
|
|
6845
6846
|
y: l ** 3 * n + 3 * l ** 2 * e * s.y + 3 * l * e ** 2 * c.y + e ** 3 * i
|
|
6846
6847
|
};
|
|
6847
6848
|
}
|
|
6848
6849
|
case "avoid": {
|
|
6849
|
-
let s =
|
|
6850
|
+
let s = Ws(t, n, r, i, a, o, u, l);
|
|
6850
6851
|
if (s.fallback) {
|
|
6851
|
-
let { c1: s, c2: c } =
|
|
6852
|
+
let { c1: s, c2: c } = Ps(t, n, r, i, a, o), l = 1 - e;
|
|
6852
6853
|
return {
|
|
6853
6854
|
x: l ** 3 * t + 3 * l ** 2 * e * s.x + 3 * l * e ** 2 * c.x + e ** 3 * r,
|
|
6854
6855
|
y: l ** 3 * n + 3 * l ** 2 * e * s.y + 3 * l * e ** 2 * c.y + e ** 3 * i
|
|
6855
6856
|
};
|
|
6856
6857
|
}
|
|
6857
|
-
return
|
|
6858
|
+
return Gs(s.segments, e);
|
|
6858
6859
|
}
|
|
6859
6860
|
case "straight": return {
|
|
6860
6861
|
x: t + (r - t) * e,
|
|
@@ -6862,7 +6863,7 @@ function Ks(e, t, n, r, i, a, o, s, c, l) {
|
|
|
6862
6863
|
};
|
|
6863
6864
|
case "step":
|
|
6864
6865
|
case "smoothstep": {
|
|
6865
|
-
let c = s === "smoothstep" ? u.smoothRadius : 0, [, l] =
|
|
6866
|
+
let c = s === "smoothstep" ? u.smoothRadius : 0, [, l] = Ms({
|
|
6866
6867
|
sourceX: t,
|
|
6867
6868
|
sourceY: n,
|
|
6868
6869
|
sourcePosition: a,
|
|
@@ -6886,14 +6887,14 @@ function Ks(e, t, n, r, i, a, o, s, c, l) {
|
|
|
6886
6887
|
}
|
|
6887
6888
|
}
|
|
6888
6889
|
}
|
|
6889
|
-
function
|
|
6890
|
+
function Js(e, t, n, r, i, a, o, s, c, l, u) {
|
|
6890
6891
|
let d = {
|
|
6891
6892
|
x: 0,
|
|
6892
6893
|
y: 0,
|
|
6893
6894
|
dist: Infinity
|
|
6894
6895
|
};
|
|
6895
6896
|
for (let f = 0; f <= 50; f++) {
|
|
6896
|
-
let p =
|
|
6897
|
+
let p = qs(f / 50, n, r, i, a, o, s, c, l, u), m = (p.x - e) ** 2 + (p.y - t) ** 2;
|
|
6897
6898
|
m < d.dist && (d = {
|
|
6898
6899
|
...p,
|
|
6899
6900
|
dist: m
|
|
@@ -6906,7 +6907,7 @@ function qs(e, t, n, r, i, a, o, s, c, l, u) {
|
|
|
6906
6907
|
}
|
|
6907
6908
|
//#endregion
|
|
6908
6909
|
//#region src/host/canvasSession.ts
|
|
6909
|
-
function
|
|
6910
|
+
function Ys(e) {
|
|
6910
6911
|
let t = [], n = /* @__PURE__ */ new Set(), r = (e) => {
|
|
6911
6912
|
if (!e || typeof e != "object") return;
|
|
6912
6913
|
let r = e;
|
|
@@ -6923,18 +6924,18 @@ function Js(e) {
|
|
|
6923
6924
|
for (let t of e.ctx.listPlugins()) i.has(t) && r(e.ctx.pluginModule(t));
|
|
6924
6925
|
return t;
|
|
6925
6926
|
}
|
|
6926
|
-
var
|
|
6927
|
-
function
|
|
6928
|
-
return
|
|
6929
|
-
}
|
|
6930
|
-
async function $s(e) {
|
|
6931
|
-
let t = Zs.then(() => ec(e));
|
|
6932
|
-
return Zs = t.then(() => void 0, () => void 0), t;
|
|
6927
|
+
var Xs, Zs = 0, Qs = Promise.resolve();
|
|
6928
|
+
function $s() {
|
|
6929
|
+
return Xs !== void 0;
|
|
6933
6930
|
}
|
|
6934
6931
|
async function ec(e) {
|
|
6935
|
-
let t =
|
|
6936
|
-
|
|
6937
|
-
|
|
6932
|
+
let t = Qs.then(() => tc(e));
|
|
6933
|
+
return Qs = t.then(() => void 0, () => void 0), t;
|
|
6934
|
+
}
|
|
6935
|
+
async function tc(e) {
|
|
6936
|
+
let t = ++Zs;
|
|
6937
|
+
Xs && await nc();
|
|
6938
|
+
let n = Ys(e).flatMap((e) => typeof e.onCanvasReady == "function" ? [{
|
|
6938
6939
|
name: e.name ?? "?",
|
|
6939
6940
|
onCanvasReady: e.onCanvasReady
|
|
6940
6941
|
}] : []), r = await no({
|
|
@@ -6948,7 +6949,7 @@ async function ec(e) {
|
|
|
6948
6949
|
seedDefault: e.seed,
|
|
6949
6950
|
dev: e.dev
|
|
6950
6951
|
});
|
|
6951
|
-
if (t !==
|
|
6952
|
+
if (t !== Zs) throw r.host.stop(), Error("[canvas-data] superseded by a newer mount");
|
|
6952
6953
|
e.windowKey && r.exposeToWindow(e.windowKey);
|
|
6953
6954
|
let i = r.sessionDisposers, a = !1, o = {
|
|
6954
6955
|
ctx: r.host.ctx,
|
|
@@ -6957,7 +6958,7 @@ async function ec(e) {
|
|
|
6957
6958
|
manager: r.manager,
|
|
6958
6959
|
dispose: async () => {
|
|
6959
6960
|
if (!a) {
|
|
6960
|
-
a = !0,
|
|
6961
|
+
a = !0, Xs === o && (Xs = void 0);
|
|
6961
6962
|
try {
|
|
6962
6963
|
await r.host.save.flush();
|
|
6963
6964
|
} catch {}
|
|
@@ -6968,22 +6969,22 @@ async function ec(e) {
|
|
|
6968
6969
|
}
|
|
6969
6970
|
}
|
|
6970
6971
|
};
|
|
6971
|
-
return
|
|
6972
|
+
return Xs = o, o;
|
|
6972
6973
|
}
|
|
6973
|
-
async function
|
|
6974
|
-
let e =
|
|
6974
|
+
async function nc() {
|
|
6975
|
+
let e = Xs;
|
|
6975
6976
|
e && await e.dispose();
|
|
6976
6977
|
}
|
|
6977
6978
|
//#endregion
|
|
6978
6979
|
//#region src/utils/coalesce.ts
|
|
6979
|
-
function
|
|
6980
|
+
function rc(e) {
|
|
6980
6981
|
let t = globalThis;
|
|
6981
6982
|
return typeof t.requestAnimationFrame == "function" ? t.requestAnimationFrame(e) : setTimeout(e, 0);
|
|
6982
6983
|
}
|
|
6983
|
-
function
|
|
6984
|
+
function ic(e) {
|
|
6984
6985
|
return (t) => e.push(t);
|
|
6985
6986
|
}
|
|
6986
|
-
function
|
|
6987
|
+
function ac(e, t = rc, n = 120) {
|
|
6987
6988
|
let r = /* @__PURE__ */ new Map(), i = !1, a, o;
|
|
6988
6989
|
function s() {
|
|
6989
6990
|
let e = globalThis;
|
|
@@ -7008,6 +7009,6 @@ function ic(e, t = nc, n = 120) {
|
|
|
7008
7009
|
};
|
|
7009
7010
|
}
|
|
7010
7011
|
//#endregion
|
|
7011
|
-
export {
|
|
7012
|
+
export { lr as ALL_DIRS, te as CANVAS_CLIPBOARD_MIME, ne as CANVAS_CLIPBOARD_PAYLOAD_VERSION, re as CANVAS_CLIPBOARD_TEXT_PREFIX, Jt as CANVAS_CONTEXT_KEY, mn as CANVAS_INTERACTION_DEFAULTS, pn as CANVAS_INTERACTION_GROUP, gn as CANVAS_INTERACTION_SCHEMA, Mo as CAPABILITY_BAG_KEY, No as CAPABILITY_SCOPE_KEY, ae as CLIPBOARD_COPY_KEY, se as CLIPBOARD_COPY_KIND, le as CLIPBOARD_CUT_KEY, de as CLIPBOARD_PASTE_KEY, pe as CLIPBOARD_PASTE_KIND, cr as CORNER_DIRS, Pr as CROP_RATIO_OPTIONS, Qt as CanvasFlowNotReadyError, ta as CanvasHost, ao as CanvasProvider, Za as CanvasService, Ss as DEBUG_SETTING_KEYS, fr as DEFAULT_CROP_RATIO, Fr as DEFAULT_CROP_RATIO_VALUE, Oi as DEFAULT_DEBUG_VISUAL, Ei as DEFAULT_EDGE_VISUAL, zr as DEFAULT_EDITING_MARGIN, Vr as DEFAULT_EDITING_MAX_ZOOM, Br as DEFAULT_EDITING_MIN_ZOOM, q as DEFAULT_GEN_PANEL_METRICS, Di as DEFAULT_HANDLE_VISUAL, Vt as DEFAULT_REASON_TEXT, Tt as DEFAULT_SNAP_ZONE_CONFIG, _s as DEFAULT_THEME_DEBUG, hs as DEFAULT_THEME_EDGE, gs as DEFAULT_THEME_HANDLE, ys as DEFAULT_THEME_LAYOUT, vs as DEFAULT_THEME_SNAP_ZONE, tn as DEFAULT_TOOLBAR_OFFSETS, Co as DROPDOWN_CLOSE_ALL_EVENT, bs as EDGE_SETTING_KEYS, Q as EdgeDirection, ot as FEEDBACK_SERVICE, xs as HANDLE_SETTING_KEYS, R as Handle, K as LAYERS, ga as MEDIA_CREATOR_FIELD, dr as MIN_FRAME_DISPLAY_EDGE, ur as MIN_FRAME_MEDIA, Zr as MediaFrameOverlay, Zt as NODE_TOOLBAR_HOST_KEY, za as NodeLayoutService, $a as NodeToolbarService, na as PLACEMENT_GAP, ra as PLACEMENT_MARGIN, z as Position, Ut as RENDER_CONTEXT_KEY, Vo as RegionEntryHost, Z as RenderEvents, oo as SETTINGS_FIELD_RENDERER, Cs as SNAP_ZONE_SETTING_KEYS, qa as STARTUP_FOCUS_PADDING, wo as SUB_MENU_CLOSE_EVENT, ss as SettingsHost, as as SettingsShell, cs as SlotAnchor, us as SlotComposer, ei as SlotHost, En as THEME_COLOR_DARK_GROUP, Tn as THEME_COLOR_LIGHT_GROUP, wn as THEME_COLOR_TOKENS, Kn as THEME_MODE_DEFAULT, Gn as THEME_MODE_GROUP, Wn as THEME_MODE_KEY, qn as THEME_MODE_SCHEMA, Vn as THEME_PALETTE_PLUGIN_NAME, er as THEME_PREVIEW_ARTBOARD, tr as THEME_PREVIEW_NODES, $n as THEME_PREVIEW_SLOT, ps as ToolbarIcon, co as UI_NAMES, Ya as ViewService, Ba as ViewportService, Sn as applyCanvasInteractionChange, Cn as applyCanvasInteractionChangeInto, cn as applyGenPanelMetricChange, an as applyOffsetChange, Lr as applyRatio, Yn as applyThemeMode, Ti as assembleTheme, ct as beginConnection, _t as beginNodeDrag, yt as beginNodeResize, Ct as beginSelecting, xt as beginViewportMove, Do as broadcastCloseAllDropdowns, Eo as broadcastSubMenuOpen, be as buildClipboardPastePayload, Se as buildClipboardWritePayload, Ks as buildEdgePath, Mn as buildThemeColorConfig, Te as canvasClipboardMarker, Ee as canvasClipboardPayload, Ma as canvasRenderPlugin, Da as canvasRenderPluginName, zo as capabilityField, Oo as claimDropdownExclusive, _r as clampCropRect, vr as clampExpandRect, gt as clearActivity, Vi as clickEdge, Bi as clickNode, Hi as clickPane, Ao as closeAllDropdowns, To as closeAllSubMenus, Nt as closestZone, jt as computeBodyZones, Ka as computeFitTo, pr as computeMediaFit, Ot as computeSideBandRect, At as computeSnapZoneSides, kt as computeSnapZones, It as contentTypeAccepted, en as createCanvasFlowController, Io as createCapabilityCache, Bo as createCapabilityNodeContext, ac as createCoalescer, st as createConnectionState, at as createFeedbackService, mt as createInteractionState, wa as createMediaCapability, Xa as createNotifyService, La as createPluginManager, no as createPlumeHost, Ea as createStandardCapabilities, Ca as createUpstreamCapability, $r as createV2Logger, Ln as currentThemeMode, Lt as decideCapacity, hr as defaultCropRect, gr as defaultExpandRect, Xn as defineThemeModeSetting, Hn as defineThemePaletteSettings, Me as dispatchClipboardPaste, Pe as dispatchClipboardWrite, ki as edgesFromStore, pt as emptyActivity, lt as endConnection, vt as endNodeDrag, bt as endNodeResize, wt as endSelecting, St as endViewportMove, Rt as evaluateContentConnect, pi as expandRect, rt as feedbackDebugSnapshot, nt as feedbackService, Js as findClosestPointOnPath, Gr as fitEditingNodeIntoView, Nr as framedMediaBoxStyle, Mr as framedMediaStyle, V as getBezierPath, ut as getSourceHandle, $s as hasActiveCanvasSession, Ie as hasCanvasClipboardMarker, Mt as hitTest, ft as hoverWriter, rr as indexPreviewRects, so as injectSettingsFieldRenderer, Zn as installThemeMode, Un as installThemePalette, dt as isConnectionSource, Pt as isReverse, Ye as isSlotItemId, Ze as isSlotName, or as isSoleSelected, Pn as isThemeColorKey, jr as isUsableRect, ic as manualScheduler, Ta as mediaCapabilityOf, ms as mergeSlotEntries, mr as minFrameEdge, ec as mountCanvas, yr as moveCropRect, br as moveExpandRect, wi as nodeShellSlot, _i as nodesFromStore, zt as oldestIncomingToEvict, jo as openDropdownCount, ze as parseCanvasClipboardText, ha as placeAdjacent, Ro as provideCapabilityBag, Si as pruneDanglingEdges, rc as rafScheduler, Ir as ratioOf, Be as readCanvasClipboardPayload, ar as readPreviewColor, Ht as reasonText, Dr as rectToDisplay, fi as rectsOverlap, ja as registerStandardCapabilities, ko as releaseDropdown, Tr as resizeCropRect, Er as resizeExpandRect, xn as resolveCanvasInteraction, Ur as resolveEditingViewport, Ft as resolveFeedback, sn as resolveGenPanelMetrics, fn as resolveNodeSlotStyle, kr as resolveScreenPerCss, Fn as resolveThemeColorOverrides, In as resolveThemeColorValue, Jn as resolveThemeMode, rn as resolveToolbarOffsets, qs as sampleEdgePath, Or as screenDeltaToMedia, tt as setFeedbackService, vo as setStaticUiCatalog, go as setUiCatalogHost, Ho as settingsSourceFrom, Wr as shouldFitEditingViewport, Na as sourceKind, it as splitDescription, gi as splitNodeWritePatch, kn as themeColorDarkKey, An as themeColorInlineVar, On as themeColorLightKey, jn as themeColorSlots, Nn as themeColorVarNames, Ri as toDragPayload, Ar as toPixelRect, dn as toolbarOffsetStyle, lo as uiComponent, xo as uiComponentOutside, po as uiComponentRefs, yo as uiComponentStatic, mo as uiNames, bo as uiStaticNames, nr as unionPreviewRect, nc as unmountCanvas, ht as updateActivity, Yt as useCanvasContext, Xt as useCanvasContextOrRender, Wt as useCanvasRender, Po as useCapabilities, Fo as useCapability, ee as useConnection, un as useGenPanelMetrics, sr as useSoleNodeSelected, Qn as useThemeColor, ln as useToolbarOffsets, uo as useUiComponent, fo as useUiComponentRefs, H as useVueFlow, di as viewportRectInFlow, Rn as watchThemeMode, Et as zoneDirectionAnchor };
|
|
7012
7013
|
|
|
7013
7014
|
//# sourceMappingURL=index.js.map
|