@advocado-labs/cado-editor 1.0.4 → 1.0.5
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/assets/value-BUbTZYaX.js.map +1 -1
- package/dist/cado-editor.js +773 -755
- package/dist/cado-editor.js.map +1 -1
- package/dist/cado-editor.umd.cjs +20 -19
- package/dist/cado-editor.umd.cjs.map +1 -1
- package/package.json +1 -1
package/dist/cado-editor.js
CHANGED
|
@@ -6,7 +6,7 @@ var e = Object.defineProperty, t = (t, n) => {
|
|
|
6
6
|
enumerable: !0
|
|
7
7
|
});
|
|
8
8
|
return n || e(r, Symbol.toStringTag, { value: "Module" }), r;
|
|
9
|
-
}, n = "1.0.
|
|
9
|
+
}, n = "1.0.5", r;
|
|
10
10
|
(function(e) {
|
|
11
11
|
e.HALF = "half", e.ONE_THIRD = "one-third", e.QUARTER = "quarter";
|
|
12
12
|
})(r ||= {});
|
|
@@ -5332,7 +5332,7 @@ function Bn(e, t, n, r) {
|
|
|
5332
5332
|
}
|
|
5333
5333
|
c.valueList?.length && Bn(e, c.valueList, n, r);
|
|
5334
5334
|
let u = [...We];
|
|
5335
|
-
|
|
5335
|
+
nr(c) || u.push(...je), ce(u, s), V(u, i, c);
|
|
5336
5336
|
}
|
|
5337
5337
|
}
|
|
5338
5338
|
function Vn(e, t) {
|
|
@@ -5376,7 +5376,7 @@ function Un(e) {
|
|
|
5376
5376
|
});
|
|
5377
5377
|
for (let r = 1; r < e.length; r++) {
|
|
5378
5378
|
let i = e[r], a = i.rowFlex || null;
|
|
5379
|
-
n === a && !
|
|
5379
|
+
n === a && !nr(i) && !nr(e[r - 1]) ? t[t.length - 1].data.push(i) : (t.push({
|
|
5380
5380
|
rowFlex: a,
|
|
5381
5381
|
data: [i]
|
|
5382
5382
|
}), n = a);
|
|
@@ -5478,7 +5478,7 @@ function Wn(e, t) {
|
|
|
5478
5478
|
let t = a[e], n = !t.rowFlex || t.rowFlex === p.LEFT, o = document.createElement("div");
|
|
5479
5479
|
if (!n) {
|
|
5480
5480
|
let e = t.data[0];
|
|
5481
|
-
|
|
5481
|
+
nr(e) ? (o.style.display = "flex", o.style.justifyContent = Fn(e.rowFlex)) : (o.style.textAlign = Pn(t.rowFlex), t.rowFlex === "justify" && (o.style.textAlignLast = "justify"));
|
|
5482
5482
|
}
|
|
5483
5483
|
o.innerHTML = r(t.data).innerHTML, n ? o.childNodes.forEach((e) => {
|
|
5484
5484
|
i.append(e.cloneNode(!0));
|
|
@@ -5486,8 +5486,20 @@ function Wn(e, t) {
|
|
|
5486
5486
|
}
|
|
5487
5487
|
return i;
|
|
5488
5488
|
}
|
|
5489
|
-
var Gn = "rgb(1, 2, 3)";
|
|
5490
|
-
function
|
|
5489
|
+
var Gn = "rgb(1, 2, 3)", Kn = /^\d+(\.\d+)?$/, qn = /(^|;)\s*(page-)?break-after\s*:\s*(page|always)\s*(;|$)/i;
|
|
5490
|
+
function Jn(e) {
|
|
5491
|
+
let t = e;
|
|
5492
|
+
for (; t;) {
|
|
5493
|
+
let e = t.style?.lineHeight;
|
|
5494
|
+
if (e && Kn.test(e)) return Number(e);
|
|
5495
|
+
t = t.parentElement;
|
|
5496
|
+
}
|
|
5497
|
+
return null;
|
|
5498
|
+
}
|
|
5499
|
+
function Yn(e) {
|
|
5500
|
+
return e.nodeType !== 1 || e.textContent?.trim() ? !1 : qn.test(e.getAttribute("style") || "");
|
|
5501
|
+
}
|
|
5502
|
+
function Xn(e) {
|
|
5491
5503
|
if (!e || e.nodeType !== 3) return null;
|
|
5492
5504
|
let t = e.parentNode, n = t.nodeName === "FONT" ? t.parentNode : t, r = Nn(n), i = e.textContent, a = window.getComputedStyle(n);
|
|
5493
5505
|
if (!i || n.nodeName === "STYLE") return null;
|
|
@@ -5497,21 +5509,23 @@ function Kn(e) {
|
|
|
5497
5509
|
italic: a.fontStyle.includes("italic"),
|
|
5498
5510
|
size: Math.floor(parseFloat(a.fontSize))
|
|
5499
5511
|
};
|
|
5500
|
-
|
|
5512
|
+
a.color !== Gn && (o.color = a.color), n.nodeName === "SUB" || a.verticalAlign === "sub" ? o.type = w.SUBSCRIPT : (n.nodeName === "SUP" || a.verticalAlign === "super") && (o.type = w.SUPERSCRIPT), r !== p.LEFT && (o.rowFlex = r), a.backgroundColor !== "rgba(0, 0, 0, 0)" && (o.highlight = a.backgroundColor), a.textDecorationLine.includes("underline") && (o.underline = !0), a.textDecorationLine.includes("line-through") && (o.strikeout = !0);
|
|
5513
|
+
let s = Jn(n);
|
|
5514
|
+
return s !== null && (o.rowMargin = s), o;
|
|
5501
5515
|
}
|
|
5502
|
-
function
|
|
5503
|
-
let n = Tn({}), r = t.width ?? n.width, i = t.margins ?? n.margins, a = t.innerWidth ?? r - i[1] - i[3], o = (e) => e ?
|
|
5516
|
+
function Zn(e, t = {}) {
|
|
5517
|
+
let n = Tn({}), r = t.width ?? n.width, i = t.margins ?? n.margins, a = t.innerWidth ?? r - i[1] - i[3], o = (e) => e ? Qn(e, { innerWidth: a }) : [];
|
|
5504
5518
|
return {
|
|
5505
5519
|
header: o(e.header),
|
|
5506
5520
|
main: o(e.main),
|
|
5507
5521
|
footer: o(e.footer)
|
|
5508
5522
|
};
|
|
5509
5523
|
}
|
|
5510
|
-
function
|
|
5524
|
+
function Qn(e, t) {
|
|
5511
5525
|
let n = [];
|
|
5512
5526
|
function r(e) {
|
|
5513
5527
|
if (e.nodeType === 3) {
|
|
5514
|
-
let t =
|
|
5528
|
+
let t = Xn(e);
|
|
5515
5529
|
t && n.push(t);
|
|
5516
5530
|
} else if (e.nodeType === 1) {
|
|
5517
5531
|
let i = e.childNodes;
|
|
@@ -5527,7 +5541,7 @@ function Jn(e, t) {
|
|
|
5527
5541
|
url: e.href
|
|
5528
5542
|
});
|
|
5529
5543
|
} else if (/H[1-6]/.test(a.nodeName)) {
|
|
5530
|
-
let e =
|
|
5544
|
+
let e = Qn(rr(a, "div").outerHTML, t);
|
|
5531
5545
|
n.push({
|
|
5532
5546
|
value: "",
|
|
5533
5547
|
type: w.TITLE,
|
|
@@ -5548,7 +5562,7 @@ function Jn(e, t) {
|
|
|
5548
5562
|
if (c.tagName !== "LI") return;
|
|
5549
5563
|
let l = c.cloneNode(!0);
|
|
5550
5564
|
l.querySelectorAll("ul,ol").forEach((e) => e.remove());
|
|
5551
|
-
let u =
|
|
5565
|
+
let u = Qn(l.innerHTML, t);
|
|
5552
5566
|
u.forEach((e) => {
|
|
5553
5567
|
e.value === "\n" && (e.listWrap = !0), e.listId = r, e.listType = a, o && (e.listStyle = o), e.listLevel = n;
|
|
5554
5568
|
}), u.unshift({
|
|
@@ -5563,7 +5577,11 @@ function Jn(e, t) {
|
|
|
5563
5577
|
}), s;
|
|
5564
5578
|
};
|
|
5565
5579
|
r.valueList = i(e, 0), n.push(r);
|
|
5566
|
-
} else if (a
|
|
5580
|
+
} else if (Yn(a)) n.push({
|
|
5581
|
+
value: "\n",
|
|
5582
|
+
type: w.PAGE_BREAK
|
|
5583
|
+
});
|
|
5584
|
+
else if (a.nodeName === "HR") n.push({
|
|
5567
5585
|
value: "\n",
|
|
5568
5586
|
type: w.SEPARATOR
|
|
5569
5587
|
});
|
|
@@ -5617,7 +5635,7 @@ function Jn(e, t) {
|
|
|
5617
5635
|
tdList: []
|
|
5618
5636
|
};
|
|
5619
5637
|
e.querySelectorAll("th,td").forEach((e) => {
|
|
5620
|
-
let n = e, r =
|
|
5638
|
+
let n = e, r = Qn(n.innerHTML, t), a = {
|
|
5621
5639
|
colspan: n.colSpan,
|
|
5622
5640
|
rowspan: n.rowSpan,
|
|
5623
5641
|
value: r,
|
|
@@ -5660,7 +5678,7 @@ function Jn(e, t) {
|
|
|
5660
5678
|
e.nodeType !== 1 && !e.textContent?.trim() && s.push(e);
|
|
5661
5679
|
}), s.forEach((e) => e.remove()), r(o), i.remove(), n;
|
|
5662
5680
|
}
|
|
5663
|
-
function
|
|
5681
|
+
function $n(e, t = {}) {
|
|
5664
5682
|
function n(e) {
|
|
5665
5683
|
let t = "";
|
|
5666
5684
|
for (let r = 0; r < e.length; r++) {
|
|
@@ -5699,30 +5717,30 @@ function Yn(e, t = {}) {
|
|
|
5699
5717
|
}
|
|
5700
5718
|
return n(X(e, { isClone: t.isClone !== !1 }));
|
|
5701
5719
|
}
|
|
5702
|
-
function
|
|
5720
|
+
function er(e) {
|
|
5703
5721
|
if (!e || typeof e != "object") return e;
|
|
5704
5722
|
if (Array.isArray(e)) {
|
|
5705
5723
|
let t = e, n = Array(t.length);
|
|
5706
|
-
for (let e = 0; e < t.length; e++) n[e] =
|
|
5724
|
+
for (let e = 0; e < t.length; e++) n[e] = er(t[e]);
|
|
5707
5725
|
return n;
|
|
5708
5726
|
}
|
|
5709
5727
|
let t = {};
|
|
5710
5728
|
for (let n in e) {
|
|
5711
5729
|
if (n === "metrics" || n === "style") continue;
|
|
5712
5730
|
let r = e[n];
|
|
5713
|
-
t[n] = r && typeof r == "object" ?
|
|
5731
|
+
t[n] = r && typeof r == "object" ? er(r) : r;
|
|
5714
5732
|
}
|
|
5715
5733
|
return t;
|
|
5716
5734
|
}
|
|
5717
|
-
function
|
|
5735
|
+
function tr(e) {
|
|
5718
5736
|
let t = Array(e.length);
|
|
5719
|
-
for (let n = 0; n < e.length; n++) t[n] =
|
|
5737
|
+
for (let n = 0; n < e.length; n++) t[n] = er(e[n]);
|
|
5720
5738
|
return t;
|
|
5721
5739
|
}
|
|
5722
|
-
function
|
|
5740
|
+
function nr(e) {
|
|
5723
5741
|
return !!e?.type && (qe.includes(e.type) || e.imgDisplay === a.INLINE);
|
|
5724
5742
|
}
|
|
5725
|
-
function
|
|
5743
|
+
function rr(e, t) {
|
|
5726
5744
|
let n = document.createElement(t);
|
|
5727
5745
|
for (let t = 0; t < e.attributes.length; t++) {
|
|
5728
5746
|
let r = e.attributes[t];
|
|
@@ -5730,7 +5748,7 @@ function $n(e, t) {
|
|
|
5730
5748
|
}
|
|
5731
5749
|
return n.innerHTML = e.innerHTML, n;
|
|
5732
5750
|
}
|
|
5733
|
-
function
|
|
5751
|
+
function ir(e) {
|
|
5734
5752
|
let t = [];
|
|
5735
5753
|
for (let n = 0; n < e.length; n++) {
|
|
5736
5754
|
let r = e[n];
|
|
@@ -5738,10 +5756,10 @@ function er(e) {
|
|
|
5738
5756
|
}
|
|
5739
5757
|
return t;
|
|
5740
5758
|
}
|
|
5741
|
-
function
|
|
5759
|
+
function ar(e, t) {
|
|
5742
5760
|
for (let n = e.length - 1; n >= 0; n--) e[n].imgFloatPosition?.pageNo === t && e.splice(n, 1);
|
|
5743
5761
|
}
|
|
5744
|
-
function
|
|
5762
|
+
function or(e, t, n = o.BEFORE, r) {
|
|
5745
5763
|
if (!e[t]?.hide && !e[t]?.control?.hide && !e[t]?.area?.hide && !r?.(e[t])) return t;
|
|
5746
5764
|
let i = t;
|
|
5747
5765
|
if (n === o.BEFORE) for (i = t - 1; i > 0;) {
|
|
@@ -5754,7 +5772,7 @@ function nr(e, t, n = o.BEFORE, r) {
|
|
|
5754
5772
|
}
|
|
5755
5773
|
return i;
|
|
5756
5774
|
}
|
|
5757
|
-
function
|
|
5775
|
+
function sr(e, t, n, r) {
|
|
5758
5776
|
let i = t + n;
|
|
5759
5777
|
if (i < 0 || i >= e.length || e[i].controlId === r) return i;
|
|
5760
5778
|
for (; i >= 0 && i < e.length;) {
|
|
@@ -5763,7 +5781,7 @@ function rr(e, t, n, r) {
|
|
|
5763
5781
|
}
|
|
5764
5782
|
return i;
|
|
5765
5783
|
}
|
|
5766
|
-
function
|
|
5784
|
+
function cr(e, t) {
|
|
5767
5785
|
let n = e[t]?.controlId;
|
|
5768
5786
|
if (!n) return null;
|
|
5769
5787
|
let r = t;
|
|
@@ -5773,30 +5791,30 @@ function ir(e, t) {
|
|
|
5773
5791
|
r--;
|
|
5774
5792
|
}
|
|
5775
5793
|
let i = e[r - 1]?.controlId;
|
|
5776
|
-
return i && i !== n ?
|
|
5794
|
+
return i && i !== n ? cr(e, r - 1) : n;
|
|
5777
5795
|
}
|
|
5778
|
-
function
|
|
5796
|
+
function lr(e, t) {
|
|
5779
5797
|
for (let n of e) {
|
|
5780
|
-
if (t(n), n.type === w.TABLE) for (let e of n.trList || []) for (let n of e.tdList)
|
|
5781
|
-
n.valueList &&
|
|
5798
|
+
if (t(n), n.type === w.TABLE) for (let e of n.trList || []) for (let n of e.tdList) lr(n.value, t);
|
|
5799
|
+
n.valueList && lr(n.valueList, t);
|
|
5782
5800
|
}
|
|
5783
5801
|
}
|
|
5784
5802
|
//#endregion
|
|
5785
5803
|
//#region src/editor/utils/clipboard.ts
|
|
5786
|
-
function
|
|
5804
|
+
function ur(e) {
|
|
5787
5805
|
localStorage.setItem(Ce, JSON.stringify({
|
|
5788
5806
|
text: e.text,
|
|
5789
5807
|
elementList: e.elementList
|
|
5790
5808
|
}));
|
|
5791
5809
|
}
|
|
5792
|
-
function
|
|
5810
|
+
function dr() {
|
|
5793
5811
|
let e = localStorage.getItem(Ce);
|
|
5794
5812
|
return e ? JSON.parse(e) : null;
|
|
5795
5813
|
}
|
|
5796
|
-
function
|
|
5814
|
+
function fr() {
|
|
5797
5815
|
localStorage.removeItem(Ce);
|
|
5798
5816
|
}
|
|
5799
|
-
async function
|
|
5817
|
+
async function pr(e, t, n) {
|
|
5800
5818
|
if (!e && !t && !n.length) return;
|
|
5801
5819
|
let r = new Blob([e], { type: "text/plain" }), i = new Blob([t], { type: "text/html" });
|
|
5802
5820
|
if (window.ClipboardItem) {
|
|
@@ -5811,20 +5829,20 @@ async function lr(e, t, n) {
|
|
|
5811
5829
|
let n = window.getSelection(), r = document.createRange(), i = document.createElement("span");
|
|
5812
5830
|
i.innerText = "\n", e.append(i), r.selectNodeContents(e), n?.removeAllRanges(), n?.addRange(r), document.execCommand("copy"), e.remove();
|
|
5813
5831
|
}
|
|
5814
|
-
|
|
5832
|
+
ur({
|
|
5815
5833
|
text: e,
|
|
5816
5834
|
elementList: n
|
|
5817
5835
|
});
|
|
5818
5836
|
}
|
|
5819
|
-
async function
|
|
5837
|
+
async function mr(e, t) {
|
|
5820
5838
|
let n = On(e), r = Wn(n, t);
|
|
5821
5839
|
document.body.append(r);
|
|
5822
5840
|
let i = r.innerText;
|
|
5823
5841
|
r.remove();
|
|
5824
5842
|
let a = r.innerHTML;
|
|
5825
|
-
(i || a || n.length) && await
|
|
5843
|
+
(i || a || n.length) && await pr(i, a, X(n, { isClone: !1 }));
|
|
5826
5844
|
}
|
|
5827
|
-
function
|
|
5845
|
+
function hr(e) {
|
|
5828
5846
|
let t = !1;
|
|
5829
5847
|
for (let n = 0; n < e.items.length; n++) if (e.items[n].kind === "file") {
|
|
5830
5848
|
t = !0;
|
|
@@ -5834,7 +5852,7 @@ function dr(e) {
|
|
|
5834
5852
|
}
|
|
5835
5853
|
//#endregion
|
|
5836
5854
|
//#region src/editor/core/event/handlers/paste.ts
|
|
5837
|
-
function
|
|
5855
|
+
function gr(e, t) {
|
|
5838
5856
|
let n = e.getDraw();
|
|
5839
5857
|
if (n.isReadonly() || n.isDisabled() || n.getControl().getIsDisabledPasteControl()) return;
|
|
5840
5858
|
let r = n.getRange(), { startIndex: i } = r.getRange(), a = n.getElementList();
|
|
@@ -5860,35 +5878,35 @@ function fr(e, t) {
|
|
|
5860
5878
|
editorOptions: n.getOptions()
|
|
5861
5879
|
});
|
|
5862
5880
|
}
|
|
5863
|
-
|
|
5881
|
+
lr(t, (e) => {
|
|
5864
5882
|
delete e.trace;
|
|
5865
5883
|
}), n.insertElementList(t);
|
|
5866
5884
|
}
|
|
5867
|
-
function
|
|
5885
|
+
function _r(e, t) {
|
|
5868
5886
|
let n = e.getDraw();
|
|
5869
|
-
n.isReadonly() || n.isDisabled() ||
|
|
5887
|
+
n.isReadonly() || n.isDisabled() || gr(e, Qn(t, { innerWidth: n.getOriginalInnerWidth() }));
|
|
5870
5888
|
}
|
|
5871
|
-
function
|
|
5889
|
+
function vr(e, t) {
|
|
5872
5890
|
let n = e.getDraw();
|
|
5873
5891
|
if (n.isReadonly() || n.isDisabled()) return;
|
|
5874
5892
|
let { pasteImage: r } = n.getOverride();
|
|
5875
5893
|
r && r(t)?.preventDefault !== !1 || n.getImageUpload()?.insertFile(t);
|
|
5876
5894
|
}
|
|
5877
|
-
function
|
|
5895
|
+
function yr(e, t) {
|
|
5878
5896
|
let n = e.getDraw();
|
|
5879
5897
|
if (n.isReadonly() || n.isDisabled()) return;
|
|
5880
5898
|
let r = t.clipboardData;
|
|
5881
5899
|
if (!r) return;
|
|
5882
5900
|
let { paste: i } = n.getOverride();
|
|
5883
5901
|
if (i && i(t)?.preventDefault !== !1) return;
|
|
5884
|
-
if (!
|
|
5885
|
-
let t = r.getData("text"), n =
|
|
5902
|
+
if (!hr(r)) {
|
|
5903
|
+
let t = r.getData("text"), n = dr();
|
|
5886
5904
|
if (n && ve(t) === ve(n.text)) {
|
|
5887
|
-
|
|
5905
|
+
gr(e, n.elementList);
|
|
5888
5906
|
return;
|
|
5889
5907
|
}
|
|
5890
5908
|
}
|
|
5891
|
-
|
|
5909
|
+
fr();
|
|
5892
5910
|
let a = !1;
|
|
5893
5911
|
for (let e = 0; e < r.items.length; e++) if (r.items[e].type === "text/html") {
|
|
5894
5912
|
a = !0;
|
|
@@ -5905,27 +5923,27 @@ function hr(e, t) {
|
|
|
5905
5923
|
}
|
|
5906
5924
|
if (n.type === "text/html" && a) {
|
|
5907
5925
|
n.getAsString((t) => {
|
|
5908
|
-
|
|
5926
|
+
_r(e, t);
|
|
5909
5927
|
});
|
|
5910
5928
|
break;
|
|
5911
5929
|
}
|
|
5912
5930
|
} else if (n.kind === "file" && n.type.includes("image")) {
|
|
5913
5931
|
let t = n.getAsFile();
|
|
5914
|
-
t &&
|
|
5932
|
+
t && vr(e, t);
|
|
5915
5933
|
}
|
|
5916
5934
|
}
|
|
5917
5935
|
}
|
|
5918
|
-
async function
|
|
5936
|
+
async function br(e, t) {
|
|
5919
5937
|
let n = e.getDraw();
|
|
5920
5938
|
if (n.isReadonly() || n.isDisabled()) return;
|
|
5921
5939
|
let { paste: r } = n.getOverride();
|
|
5922
5940
|
if (r && r()?.preventDefault !== !1) return;
|
|
5923
|
-
let i = await navigator.clipboard.readText(), a =
|
|
5941
|
+
let i = await navigator.clipboard.readText(), a = dr();
|
|
5924
5942
|
if (a && ve(i) === ve(a.text)) {
|
|
5925
|
-
|
|
5943
|
+
gr(e, a.elementList);
|
|
5926
5944
|
return;
|
|
5927
5945
|
}
|
|
5928
|
-
if (
|
|
5946
|
+
if (fr(), t?.isPlainText) i && e.input(i);
|
|
5929
5947
|
else {
|
|
5930
5948
|
let t = await navigator.clipboard.read(), n = !1;
|
|
5931
5949
|
for (let e of t) if (e.types.includes("text/html")) {
|
|
@@ -5937,16 +5955,16 @@ async function gr(e, t) {
|
|
|
5937
5955
|
t && e.input(t);
|
|
5938
5956
|
} else if (r.types.includes("text/html") && n) {
|
|
5939
5957
|
let t = await (await r.getType("text/html")).text();
|
|
5940
|
-
t &&
|
|
5958
|
+
t && _r(e, t);
|
|
5941
5959
|
} else if (r.types.some((e) => e.startsWith("image/"))) {
|
|
5942
5960
|
let t = r.types.find((e) => e.startsWith("image/"));
|
|
5943
|
-
|
|
5961
|
+
vr(e, await r.getType(t));
|
|
5944
5962
|
}
|
|
5945
5963
|
}
|
|
5946
5964
|
}
|
|
5947
5965
|
//#endregion
|
|
5948
5966
|
//#region src/editor/core/cursor/CursorAgent.ts
|
|
5949
|
-
var
|
|
5967
|
+
var xr = class {
|
|
5950
5968
|
draw;
|
|
5951
5969
|
container;
|
|
5952
5970
|
agentCursorDom;
|
|
@@ -5989,7 +6007,7 @@ var _r = class {
|
|
|
5989
6007
|
t && this.canvasEvent.input(t), this.eventBus.isSubscribe("input") && this.eventBus.emit("input", e);
|
|
5990
6008
|
}
|
|
5991
6009
|
_paste(e) {
|
|
5992
|
-
this.draw.isReadonly() || e.clipboardData && (
|
|
6010
|
+
this.draw.isReadonly() || e.clipboardData && (yr(this.canvasEvent, e), e.preventDefault());
|
|
5993
6011
|
}
|
|
5994
6012
|
_compositionstart() {
|
|
5995
6013
|
this.canvasEvent.compositionstart();
|
|
@@ -5997,11 +6015,11 @@ var _r = class {
|
|
|
5997
6015
|
_compositionend(e) {
|
|
5998
6016
|
this.canvasEvent.compositionend(e);
|
|
5999
6017
|
}
|
|
6000
|
-
},
|
|
6001
|
-
function
|
|
6018
|
+
}, Sr = Object.values(U);
|
|
6019
|
+
function Cr(e) {
|
|
6002
6020
|
return !!e && !e.type && e.value === "";
|
|
6003
6021
|
}
|
|
6004
|
-
var
|
|
6022
|
+
var wr = class {
|
|
6005
6023
|
draw;
|
|
6006
6024
|
options;
|
|
6007
6025
|
ui;
|
|
@@ -6053,12 +6071,12 @@ var br = class {
|
|
|
6053
6071
|
let a = t.getElementList();
|
|
6054
6072
|
if (t.getIsEmptyDocument() && this.options.placeholder.data) return null;
|
|
6055
6073
|
let o = a[r], s = a[r + 1];
|
|
6056
|
-
return !
|
|
6074
|
+
return !Cr(o) || s && !Cr(s) ? null : o;
|
|
6057
6075
|
}
|
|
6058
6076
|
_getText() {
|
|
6059
6077
|
let e = this.draw.getI18n(), t = this.draw.getRange().getDefaultTitle();
|
|
6060
6078
|
if (t) {
|
|
6061
|
-
let n =
|
|
6079
|
+
let n = Sr.indexOf(t.level) + 1;
|
|
6062
6080
|
return e.t("linePlaceholder.heading").replace("{level}", String(n));
|
|
6063
6081
|
}
|
|
6064
6082
|
let { text: n } = this.options.linePlaceholder;
|
|
@@ -6077,7 +6095,7 @@ var br = class {
|
|
|
6077
6095
|
userSelect: "none"
|
|
6078
6096
|
}), e.style.setProperty("--ce-line-placeholder-color", this.options.linePlaceholder.color), e.setAttribute("aria-hidden", "true"), this.draw.getContainer().append(e), this.dom = e, e;
|
|
6079
6097
|
}
|
|
6080
|
-
},
|
|
6098
|
+
}, Tr = class {
|
|
6081
6099
|
ANIMATION_CLASS = "ce-cursor--animation";
|
|
6082
6100
|
BLINK_KEYFRAMES = [
|
|
6083
6101
|
{
|
|
@@ -6121,7 +6139,7 @@ var br = class {
|
|
|
6121
6139
|
display: "none",
|
|
6122
6140
|
position: "absolute",
|
|
6123
6141
|
pointerEvents: "none"
|
|
6124
|
-
}), this.container.append(this.cursorDom), this.cursorAgent = new
|
|
6142
|
+
}), this.container.append(this.cursorDom), this.cursorAgent = new xr(e, t), this.blinkTimeout = null, this.blinkAnimation = null, this.linePlaceholder = new wr(e);
|
|
6125
6143
|
}
|
|
6126
6144
|
getCursorDom() {
|
|
6127
6145
|
return this.cursorDom;
|
|
@@ -6221,13 +6239,13 @@ var br = class {
|
|
|
6221
6239
|
u ? o.scroll(e, t - (s.top - f)) : o.scroll(e, t + f - s.bottom);
|
|
6222
6240
|
}
|
|
6223
6241
|
}
|
|
6224
|
-
},
|
|
6242
|
+
}, Er;
|
|
6225
6243
|
(function(e) {
|
|
6226
6244
|
e[e.LEFT = 0] = "LEFT", e[e.CENTER = 1] = "CENTER", e[e.RIGHT = 2] = "RIGHT";
|
|
6227
|
-
})(
|
|
6245
|
+
})(Er ||= {});
|
|
6228
6246
|
//#endregion
|
|
6229
6247
|
//#region src/editor/utils/hotkey.ts
|
|
6230
|
-
function
|
|
6248
|
+
function Dr(e) {
|
|
6231
6249
|
return Ee ? e.metaKey : e.ctrlKey;
|
|
6232
6250
|
}
|
|
6233
6251
|
//#endregion
|
|
@@ -6238,7 +6256,7 @@ var Z;
|
|
|
6238
6256
|
})(Z ||= {});
|
|
6239
6257
|
//#endregion
|
|
6240
6258
|
//#region src/editor/core/draw/control/checkbox/CheckboxControl.ts
|
|
6241
|
-
var
|
|
6259
|
+
var Or = class {
|
|
6242
6260
|
element;
|
|
6243
6261
|
control;
|
|
6244
6262
|
constructor(e, t) {
|
|
@@ -6308,7 +6326,7 @@ var wr = class {
|
|
|
6308
6326
|
cut() {
|
|
6309
6327
|
return -1;
|
|
6310
6328
|
}
|
|
6311
|
-
},
|
|
6329
|
+
}, kr = class extends Or {
|
|
6312
6330
|
setSelect(e, t = {}, n = {}) {
|
|
6313
6331
|
if (!n.isIgnoreDisabledRule && this.control.getIsDisabledControl(t)) return;
|
|
6314
6332
|
let { control: r } = this.element, i = t.elementList || this.control.getElementList(), { startIndex: a } = t.range || this.control.getRange(), o = i[a], s = a;
|
|
@@ -6339,11 +6357,11 @@ var wr = class {
|
|
|
6339
6357
|
};
|
|
6340
6358
|
//#endregion
|
|
6341
6359
|
//#region src/editor/core/event/handlers/mousedown.ts
|
|
6342
|
-
function
|
|
6360
|
+
function Ar(e) {
|
|
6343
6361
|
let t = e.getDraw(), n = t.getPosition(), r = t.getRange();
|
|
6344
6362
|
e.isAllowDrag = !0, e.cacheRange = N(r.getRange()), e.cacheElementList = t.getElementList(), e.cachePositionList = n.getPositionList(), e.cachePositionContext = n.getPositionContext();
|
|
6345
6363
|
}
|
|
6346
|
-
function
|
|
6364
|
+
function jr(e, t) {
|
|
6347
6365
|
let { checkbox: n, control: r } = e;
|
|
6348
6366
|
if (!r) t.getCheckboxParticle().setSelect(e);
|
|
6349
6367
|
else {
|
|
@@ -6353,22 +6371,22 @@ function Dr(e, t) {
|
|
|
6353
6371
|
~t && e.splice(t, 1);
|
|
6354
6372
|
} else n?.code && e.push(n.code);
|
|
6355
6373
|
let i = t.getControl().getActiveControl();
|
|
6356
|
-
i instanceof
|
|
6374
|
+
i instanceof Or && i.setSelect(e);
|
|
6357
6375
|
}
|
|
6358
6376
|
}
|
|
6359
|
-
function
|
|
6377
|
+
function Mr(e, t) {
|
|
6360
6378
|
let { radio: n, control: r } = e;
|
|
6361
6379
|
if (!r) t.getRadioParticle().setSelect(e);
|
|
6362
6380
|
else {
|
|
6363
6381
|
let e = n?.code ? [n.code] : [], r = t.getControl().getActiveControl();
|
|
6364
|
-
r instanceof
|
|
6382
|
+
r instanceof kr && r.setSelect(e);
|
|
6365
6383
|
}
|
|
6366
6384
|
}
|
|
6367
|
-
function
|
|
6385
|
+
function Nr(e, t) {
|
|
6368
6386
|
let n = t.getDraw(), r = n.isReadonly(), i = n.getRange(), o = n.getPosition(), s = i.getRange();
|
|
6369
|
-
if (e.button ===
|
|
6387
|
+
if (e.button === Er.RIGHT && (s.isCrossRowCol || !i.getIsCollapsed())) return;
|
|
6370
6388
|
if (!t.isAllowDrag && !r && s.startIndex !== s.endIndex && i.getIsPointInRange(e.offsetX, e.offsetY)) {
|
|
6371
|
-
|
|
6389
|
+
Ar(t);
|
|
6372
6390
|
return;
|
|
6373
6391
|
}
|
|
6374
6392
|
let c = e.target.dataset.index;
|
|
@@ -6392,18 +6410,18 @@ function kr(e, t) {
|
|
|
6392
6410
|
let { startIndex: e } = i.getRange();
|
|
6393
6411
|
~e && o.getPositionContext().tdId === l.tdId && (O > e ? a = e : s = e);
|
|
6394
6412
|
}
|
|
6395
|
-
if (i.setRange(a, s), o.setCursorPosition(D[O]), r = n.isReadonly(), j && !r)
|
|
6396
|
-
else if (M && !r)
|
|
6413
|
+
if (i.setRange(a, s), o.setCursorPosition(D[O]), r = n.isReadonly(), j && !r) jr(k, n);
|
|
6414
|
+
else if (M && !r) Mr(k, n);
|
|
6397
6415
|
else if (k.controlComponent === G.VALUE && (k.control?.type === W.CHECKBOX || k.control?.type === W.RADIO)) {
|
|
6398
6416
|
let e = O;
|
|
6399
6417
|
for (; e > 0;) {
|
|
6400
6418
|
let t = E[e];
|
|
6401
6419
|
if (t.controlComponent === G.CHECKBOX) {
|
|
6402
|
-
|
|
6420
|
+
jr(t, n);
|
|
6403
6421
|
break;
|
|
6404
6422
|
}
|
|
6405
6423
|
if (t.controlComponent === G.RADIO) {
|
|
6406
|
-
|
|
6424
|
+
Mr(t, n);
|
|
6407
6425
|
break;
|
|
6408
6426
|
}
|
|
6409
6427
|
e--;
|
|
@@ -6424,7 +6442,7 @@ function kr(e, t) {
|
|
|
6424
6442
|
let F = n.getPreviewer();
|
|
6425
6443
|
if (F.clearResizer(), A) {
|
|
6426
6444
|
let i = { dragDisable: r || !k.controlId && n.getMode() === g.FORM };
|
|
6427
|
-
k.type === w.LATEX && (i.mime = "svg", i.srcKey = "laTexSVG"), F.drawResizer(k, D[O], i), n.getCursor().drawCursor({ isShow: !1 }),
|
|
6445
|
+
k.type === w.LATEX && (i.mime = "svg", i.srcKey = "laTexSVG"), F.drawResizer(k, D[O], i), n.getCursor().drawCursor({ isShow: !1 }), Ar(t), (k.imgDisplay === a.SURROUND || k.imgDisplay === a.FLOAT_TOP || k.imgDisplay === a.FLOAT_BOTTOM) && n.getImageParticle().createFloatImage(k), P.isSubscribe("imageMousedown") && P.emit("imageMousedown", {
|
|
6428
6446
|
evt: e,
|
|
6429
6447
|
element: k
|
|
6430
6448
|
});
|
|
@@ -6432,7 +6450,7 @@ function kr(e, t) {
|
|
|
6432
6450
|
let I = n.getTableTool();
|
|
6433
6451
|
I.dispose(), v && !r && n.getMode() !== g.FORM && I.render();
|
|
6434
6452
|
let L = n.getHyperlinkParticle();
|
|
6435
|
-
if (L.clearHyperlinkPopup(), k.type === w.HYPERLINK && (
|
|
6453
|
+
if (L.clearHyperlinkPopup(), k.type === w.HYPERLINK && (Dr(e) ? L.openHyperlink(k) : L.drawHyperlinkPopup(k, D[O])), n.getZone().isMainActive() && f && P.isSubscribe("spellcheckClick")) {
|
|
6436
6454
|
let t = v ? {
|
|
6437
6455
|
tableId: y,
|
|
6438
6456
|
tableIndex: d,
|
|
@@ -6450,14 +6468,14 @@ function kr(e, t) {
|
|
|
6450
6468
|
}
|
|
6451
6469
|
//#endregion
|
|
6452
6470
|
//#region src/editor/core/event/handlers/mouseup.ts
|
|
6453
|
-
function
|
|
6471
|
+
function Pr(e) {
|
|
6454
6472
|
let t = I();
|
|
6455
6473
|
return Reflect.set(e, "dragId", t), t;
|
|
6456
6474
|
}
|
|
6457
|
-
function
|
|
6475
|
+
function Fr(e, t) {
|
|
6458
6476
|
return t.findIndex((t) => t.dragId === e);
|
|
6459
6477
|
}
|
|
6460
|
-
function
|
|
6478
|
+
function Ir(e, t, n, r, i) {
|
|
6461
6479
|
let o = n.getDraw(), s = o.getPosition();
|
|
6462
6480
|
if (e.imgDisplay === a.SURROUND || e.imgDisplay === a.FLOAT_TOP || e.imgDisplay === a.FLOAT_BOTTOM) {
|
|
6463
6481
|
let a = t.offsetX - n.mouseDownStartPosition.x, c = t.offsetY - n.mouseDownStartPosition.y, l = e.imgFloatPosition, u = r?.isTable, d = i.isTable, f = l.x + a, p = l.y + c, m = o.getPageNo();
|
|
@@ -6489,7 +6507,7 @@ function Mr(e, t, n, r, i) {
|
|
|
6489
6507
|
}
|
|
6490
6508
|
o.getImageParticle().destroyFloatImage();
|
|
6491
6509
|
}
|
|
6492
|
-
function
|
|
6510
|
+
function Lr(e, t) {
|
|
6493
6511
|
if (t.isAllowDrop) {
|
|
6494
6512
|
let n = t.getDraw();
|
|
6495
6513
|
if (n.isReadonly() || n.isDisabled()) {
|
|
@@ -6503,7 +6521,7 @@ function Nr(e, t) {
|
|
|
6503
6521
|
if (p) {
|
|
6504
6522
|
let s = l[h];
|
|
6505
6523
|
if (s.type === w.IMAGE || s.type === w.LATEX) {
|
|
6506
|
-
if (
|
|
6524
|
+
if (Ir(s, e, t, t.cachePositionContext, o), s.imgDisplay === a.SURROUND || s.imgDisplay === a.FLOAT_TOP || s.imgDisplay === a.FLOAT_BOTTOM) n.getPreviewer().drawResizer(s), r = !0;
|
|
6507
6525
|
else {
|
|
6508
6526
|
let e = u[h];
|
|
6509
6527
|
n.getPreviewer().drawResizer(s, e);
|
|
@@ -6546,15 +6564,15 @@ function Nr(e, t) {
|
|
|
6546
6564
|
}), t;
|
|
6547
6565
|
}
|
|
6548
6566
|
});
|
|
6549
|
-
Bn(y, S, f.startIndex, { editorOptions: n.getOptions() }),
|
|
6567
|
+
Bn(y, S, f.startIndex, { editorOptions: n.getOptions() }), lr(S, (e) => {
|
|
6550
6568
|
delete e.trace;
|
|
6551
6569
|
}), n.getTraceParticle().markElementListInserted(S);
|
|
6552
|
-
let C = l[m], T = u[m], E =
|
|
6570
|
+
let C = l[m], T = u[m], E = Pr(l[m]), D = Pr(l[h]), O = S.length, k = f.startIndex, A = k + O, j = v.getActiveControl();
|
|
6553
6571
|
if (j && l[k].controlComponent !== G.POSTFIX ? (A = j.setValue(S), k = A - O) : n.spliceElementList(y, k + 1, 0, S), !~A) {
|
|
6554
6572
|
n.render({ isSetCursor: !1 });
|
|
6555
6573
|
return;
|
|
6556
6574
|
}
|
|
6557
|
-
let M =
|
|
6575
|
+
let M = Pr(y[k]), ee = Pr(y[A]), P = Fr(E, l), F = Fr(D, l), I = l[F];
|
|
6558
6576
|
if (I.controlId && I.controlComponent !== G.POSTFIX) s.replaceRange({
|
|
6559
6577
|
...c,
|
|
6560
6578
|
startIndex: P,
|
|
@@ -6573,12 +6591,12 @@ function Nr(e, t) {
|
|
|
6573
6591
|
...o,
|
|
6574
6592
|
index: ne
|
|
6575
6593
|
}));
|
|
6576
|
-
let re =
|
|
6594
|
+
let re = Fr(M, y), R = Fr(ee, y);
|
|
6577
6595
|
s.setRange(p ? R : re, R, f.tableId, f.startTdIndex, f.endTdIndex, f.startTrIndex, f.endTrIndex), n.clearSideEffect();
|
|
6578
6596
|
let z = null;
|
|
6579
6597
|
if (p) {
|
|
6580
6598
|
let r = n.getElementList()[R];
|
|
6581
|
-
(r.type === w.IMAGE || r.type === w.LATEX) && (
|
|
6599
|
+
(r.type === w.IMAGE || r.type === w.LATEX) && (Ir(r, e, t, t.cachePositionContext, o), z = r);
|
|
6582
6600
|
}
|
|
6583
6601
|
if (n.render({ isSetCursor: !1 }), j ? v.emitControlContentChange() : C.controlId && v.emitControlContentChange({
|
|
6584
6602
|
context: {
|
|
@@ -6597,7 +6615,7 @@ function Nr(e, t) {
|
|
|
6597
6615
|
}
|
|
6598
6616
|
//#endregion
|
|
6599
6617
|
//#region src/editor/core/event/handlers/mouseleave.ts
|
|
6600
|
-
function
|
|
6618
|
+
function Rr(e, t) {
|
|
6601
6619
|
let n = t.getDraw();
|
|
6602
6620
|
if (n.getTraceParticle().clearTracePopup(), !n.getOptions().pageOuterSelectionDisable) return;
|
|
6603
6621
|
let { x: r, y: i, width: a, height: o } = n.getPageContainer().getBoundingClientRect();
|
|
@@ -6605,7 +6623,7 @@ function Pr(e, t) {
|
|
|
6605
6623
|
}
|
|
6606
6624
|
//#endregion
|
|
6607
6625
|
//#region src/editor/core/event/handlers/mousemove.ts
|
|
6608
|
-
function
|
|
6626
|
+
function zr(e, t) {
|
|
6609
6627
|
let n = t.getDraw();
|
|
6610
6628
|
if (n.getTraceParticle().handleMouseMove(e), n.getHintParticle().handleMouseMove(e), t.isAllowDrag) {
|
|
6611
6629
|
let r = e.offsetX, i = e.offsetY, { startIndex: o, endIndex: s } = t.cacheRange, c = t.cachePositionList;
|
|
@@ -6657,7 +6675,7 @@ function Fr(e, t) {
|
|
|
6657
6675
|
}
|
|
6658
6676
|
//#endregion
|
|
6659
6677
|
//#region src/editor/core/event/handlers/keydown/backspace.ts
|
|
6660
|
-
function
|
|
6678
|
+
function Br(e) {
|
|
6661
6679
|
let t = e.getDraw(), n = t.getTraceParticle(), r = t.getRange(), i = r.getRange(), a = t.getElementList(), o = i.startIndex, s = a[o];
|
|
6662
6680
|
if (!s || !s.hide && !s.control?.hide && !s.area?.hide && !n.isTraceHidden(s)) return;
|
|
6663
6681
|
let c = !1;
|
|
@@ -6677,12 +6695,12 @@ function Ir(e) {
|
|
|
6677
6695
|
e.setCursorPosition(n[o]);
|
|
6678
6696
|
}
|
|
6679
6697
|
}
|
|
6680
|
-
function
|
|
6698
|
+
function Vr(e, t) {
|
|
6681
6699
|
let n = t.getDraw();
|
|
6682
6700
|
if (n.isReadonly()) return;
|
|
6683
6701
|
let r = n.getRange();
|
|
6684
6702
|
if (!r.getIsCanInput()) return;
|
|
6685
|
-
r.getIsCollapsed() &&
|
|
6703
|
+
r.getIsCollapsed() && Br(t);
|
|
6686
6704
|
let i = n.getControl(), { startIndex: a, endIndex: o, isCrossRowCol: s } = r.getRange(), c;
|
|
6687
6705
|
if (s) {
|
|
6688
6706
|
let e = n.getTableParticle().getRangeRowCol();
|
|
@@ -6734,7 +6752,7 @@ function Lr(e, t) {
|
|
|
6734
6752
|
}
|
|
6735
6753
|
//#endregion
|
|
6736
6754
|
//#region src/editor/core/event/handlers/keydown/delete.ts
|
|
6737
|
-
function
|
|
6755
|
+
function Hr(e) {
|
|
6738
6756
|
let t = e.getDraw(), n = t.getTraceParticle(), r = t.getRange(), i = r.getRange(), a = t.getElementList(), o = i.startIndex + 1, s = a[o];
|
|
6739
6757
|
if (!s || !s.hide && !s.control?.hide && !s.area?.hide && !n.isTraceHidden(s)) return;
|
|
6740
6758
|
let c = !1;
|
|
@@ -6754,14 +6772,14 @@ function Rr(e) {
|
|
|
6754
6772
|
e.setCursorPosition(n[o - 1]);
|
|
6755
6773
|
}
|
|
6756
6774
|
}
|
|
6757
|
-
function
|
|
6775
|
+
function Ur(e, t) {
|
|
6758
6776
|
let n = t.getDraw();
|
|
6759
6777
|
if (n.isReadonly()) return;
|
|
6760
6778
|
let r = n.getRange();
|
|
6761
6779
|
if (!r.getIsCanInput()) return;
|
|
6762
6780
|
let { isCrossRowCol: i } = r.getRange(), { startIndex: a, endIndex: o } = r.getRange(), s = r.getIsCollapsed(), c = n.getElementList(), l = n.getControl();
|
|
6763
6781
|
if (s) {
|
|
6764
|
-
|
|
6782
|
+
Hr(t);
|
|
6765
6783
|
let e = r.getRange();
|
|
6766
6784
|
a = e.startIndex, o = e.endIndex;
|
|
6767
6785
|
}
|
|
@@ -6815,11 +6833,11 @@ function zr(e, t) {
|
|
|
6815
6833
|
}
|
|
6816
6834
|
//#endregion
|
|
6817
6835
|
//#region src/editor/core/event/handlers/keydown/enter.ts
|
|
6818
|
-
function
|
|
6836
|
+
function Wr(e, t, n, r) {
|
|
6819
6837
|
let i = e[n], a = e[n - 1];
|
|
6820
6838
|
return r && n > 0 && i?.listId && i.value === "" && a?.listId && a.listId !== i.listId ? n - 1 : t;
|
|
6821
6839
|
}
|
|
6822
|
-
function
|
|
6840
|
+
function Gr(e, t, n) {
|
|
6823
6841
|
if (t.listId && t.listLevel === void 0) for (let r = n; r >= 0; r--) {
|
|
6824
6842
|
let n = e[r];
|
|
6825
6843
|
if (n.listId !== t.listId) break;
|
|
@@ -6829,7 +6847,7 @@ function Vr(e, t, n) {
|
|
|
6829
6847
|
}
|
|
6830
6848
|
}
|
|
6831
6849
|
}
|
|
6832
|
-
function
|
|
6850
|
+
function Kr(e, t) {
|
|
6833
6851
|
let n = t.getDraw();
|
|
6834
6852
|
if (n.isReadonly()) return;
|
|
6835
6853
|
let r = n.getRange();
|
|
@@ -6841,7 +6859,7 @@ function Hr(e, t) {
|
|
|
6841
6859
|
}
|
|
6842
6860
|
let u = { value: "" };
|
|
6843
6861
|
e.shiftKey && c.listId && (u.listWrap = !0);
|
|
6844
|
-
let d =
|
|
6862
|
+
let d = Wr(s, i, a, o);
|
|
6845
6863
|
if (Bn(s, [u], d, {
|
|
6846
6864
|
isBreakWhenWrap: !0,
|
|
6847
6865
|
editorOptions: n.getOptions()
|
|
@@ -6855,7 +6873,7 @@ function Hr(e, t) {
|
|
|
6855
6873
|
});
|
|
6856
6874
|
}
|
|
6857
6875
|
}
|
|
6858
|
-
|
|
6876
|
+
Gr(s, u, d);
|
|
6859
6877
|
let f = n.getControl(), p = f.getActiveControl();
|
|
6860
6878
|
n.getTraceParticle().markElementListInserted([u]);
|
|
6861
6879
|
let m;
|
|
@@ -6881,7 +6899,7 @@ function Hr(e, t) {
|
|
|
6881
6899
|
}
|
|
6882
6900
|
//#endregion
|
|
6883
6901
|
//#region src/editor/core/event/handlers/keydown/left.ts
|
|
6884
|
-
function
|
|
6902
|
+
function qr(e, t) {
|
|
6885
6903
|
let n = t.getDraw();
|
|
6886
6904
|
if (n.isReadonly()) return;
|
|
6887
6905
|
let r = n.getPosition(), i = r.getCursorPosition();
|
|
@@ -6948,7 +6966,7 @@ function Ur(e, t) {
|
|
|
6948
6966
|
}
|
|
6949
6967
|
if (!~_ || !~v) return;
|
|
6950
6968
|
let y = n.getTraceParticle(), b = n.getElementList();
|
|
6951
|
-
_ =
|
|
6969
|
+
_ = or(b, _, o.BEFORE, (e) => y.isTraceHidden(e)), v = or(b, v, o.BEFORE, (e) => y.isTraceHidden(e)), c.setRange(_, v);
|
|
6952
6970
|
let x = _ === v;
|
|
6953
6971
|
if (n.render({
|
|
6954
6972
|
curIndex: x ? _ : void 0,
|
|
@@ -6959,14 +6977,14 @@ function Ur(e, t) {
|
|
|
6959
6977
|
let e = r.getPositionList(), t = e[_];
|
|
6960
6978
|
if (t?.isLastLetter && t.value !== "" && _ + 1 < e.length) {
|
|
6961
6979
|
let t = e[_ + 1], r = b[_], i = b[_ + 1];
|
|
6962
|
-
t.value !== "" && !
|
|
6980
|
+
t.value !== "" && !nr(i) && r.listId === i.listId && n.getCursor().drawCursor({ hitLineStartIndex: _ + 1 });
|
|
6963
6981
|
}
|
|
6964
6982
|
}
|
|
6965
6983
|
e.preventDefault();
|
|
6966
6984
|
}
|
|
6967
6985
|
//#endregion
|
|
6968
6986
|
//#region src/editor/core/event/handlers/keydown/right.ts
|
|
6969
|
-
function
|
|
6987
|
+
function Jr(e, t) {
|
|
6970
6988
|
let n = t.getDraw();
|
|
6971
6989
|
if (n.isReadonly()) return;
|
|
6972
6990
|
let r = n.getPosition(), i = r.getCursorPosition();
|
|
@@ -7034,7 +7052,7 @@ function Wr(e, t) {
|
|
|
7034
7052
|
let b = p.length - 1;
|
|
7035
7053
|
if (v > b || y > b) return;
|
|
7036
7054
|
let x = n.getTraceParticle(), S = n.getElementList();
|
|
7037
|
-
v =
|
|
7055
|
+
v = or(S, v, o.AFTER, (e) => x.isTraceHidden(e)), y = or(S, y, o.AFTER, (e) => x.isTraceHidden(e)), l.setRange(v, y);
|
|
7038
7056
|
let C = v === y;
|
|
7039
7057
|
if (n.render({
|
|
7040
7058
|
curIndex: C ? v : void 0,
|
|
@@ -7045,14 +7063,14 @@ function Wr(e, t) {
|
|
|
7045
7063
|
let e = s[v];
|
|
7046
7064
|
if (e?.isLastLetter && e.value !== "" && v + 1 < s.length) {
|
|
7047
7065
|
let e = s[v + 1], t = p[v], r = p[v + 1];
|
|
7048
|
-
e.value !== "" && !
|
|
7066
|
+
e.value !== "" && !nr(r) && t.listId === r.listId && n.getCursor().drawCursor({ hitLineStartIndex: v + 1 });
|
|
7049
7067
|
}
|
|
7050
7068
|
}
|
|
7051
7069
|
e.preventDefault();
|
|
7052
7070
|
}
|
|
7053
7071
|
//#endregion
|
|
7054
7072
|
//#region src/editor/core/event/handlers/keydown/tab.ts
|
|
7055
|
-
function
|
|
7073
|
+
function Yr(e, t) {
|
|
7056
7074
|
let n = t.getDraw();
|
|
7057
7075
|
if (n.isReadonly()) return;
|
|
7058
7076
|
e.preventDefault();
|
|
@@ -7075,7 +7093,7 @@ function Gr(e, t) {
|
|
|
7075
7093
|
}
|
|
7076
7094
|
//#endregion
|
|
7077
7095
|
//#region src/editor/core/event/handlers/keydown/updown.ts
|
|
7078
|
-
function
|
|
7096
|
+
function Xr(e) {
|
|
7079
7097
|
let { positionList: t, index: n, isUp: r, rowNo: i, cursorX: a } = e, o = -1, s = [];
|
|
7080
7098
|
if (r) {
|
|
7081
7099
|
let e = n - 1;
|
|
@@ -7105,7 +7123,7 @@ function Kr(e) {
|
|
|
7105
7123
|
}
|
|
7106
7124
|
return o;
|
|
7107
7125
|
}
|
|
7108
|
-
function
|
|
7126
|
+
function Zr(e, t) {
|
|
7109
7127
|
let n = t.getDraw();
|
|
7110
7128
|
if (n.isReadonly()) return;
|
|
7111
7129
|
let r = n.getPosition(), i = r.getCursorPosition();
|
|
@@ -7172,7 +7190,7 @@ function qr(e, t) {
|
|
|
7172
7190
|
e.shiftKey && (t = o === i.index ? c[s] : c[o]);
|
|
7173
7191
|
let { index: a, rowNo: f, rowIndex: p, coordinate: { rightTop: [m] } } = t;
|
|
7174
7192
|
if (l && p === 0 || !l && p === n.getRowCount() - 1) return;
|
|
7175
|
-
let h =
|
|
7193
|
+
let h = Xr({
|
|
7176
7194
|
positionList: c,
|
|
7177
7195
|
index: a,
|
|
7178
7196
|
rowNo: f,
|
|
@@ -7189,7 +7207,7 @@ function qr(e, t) {
|
|
|
7189
7207
|
for (let i = 0; i < r.length; i++) {
|
|
7190
7208
|
let c = r[i], u = c.x * e + t[3], d = c.width * e;
|
|
7191
7209
|
if (m >= u && m <= u + d) {
|
|
7192
|
-
let e = c.positionList, t = e[e.length - 1], r =
|
|
7210
|
+
let e = c.positionList, t = e[e.length - 1], r = Xr({
|
|
7193
7211
|
positionList: e,
|
|
7194
7212
|
index: t.index + 1,
|
|
7195
7213
|
rowNo: t.rowNo - 1,
|
|
@@ -7206,7 +7224,7 @@ function qr(e, t) {
|
|
|
7206
7224
|
for (let i = 0; i < r.length; i++) {
|
|
7207
7225
|
let c = r[i], u = c.x * e + t[3], d = c.width * e;
|
|
7208
7226
|
if (m >= u && m <= u + d) {
|
|
7209
|
-
let e = c.positionList, t =
|
|
7227
|
+
let e = c.positionList, t = Xr({
|
|
7210
7228
|
positionList: e,
|
|
7211
7229
|
index: -1,
|
|
7212
7230
|
rowNo: -1,
|
|
@@ -7247,7 +7265,7 @@ function qr(e, t) {
|
|
|
7247
7265
|
}
|
|
7248
7266
|
//#endregion
|
|
7249
7267
|
//#region src/editor/core/event/handlers/keydown/home.ts
|
|
7250
|
-
function
|
|
7268
|
+
function Qr(e, t) {
|
|
7251
7269
|
let n = t.getDraw();
|
|
7252
7270
|
if (n.isReadonly()) return;
|
|
7253
7271
|
let r = n.getPosition(), i = r.getCursorPosition();
|
|
@@ -7270,7 +7288,7 @@ function Jr(e, t) {
|
|
|
7270
7288
|
}
|
|
7271
7289
|
//#endregion
|
|
7272
7290
|
//#region src/editor/core/event/handlers/keydown/end.ts
|
|
7273
|
-
function
|
|
7291
|
+
function $r(e, t) {
|
|
7274
7292
|
let n = t.getDraw();
|
|
7275
7293
|
if (n.isReadonly()) return;
|
|
7276
7294
|
let r = n.getPosition(), i = r.getCursorPosition();
|
|
@@ -7293,28 +7311,28 @@ function Yr(e, t) {
|
|
|
7293
7311
|
}
|
|
7294
7312
|
//#endregion
|
|
7295
7313
|
//#region src/editor/core/event/handlers/keydown/index.ts
|
|
7296
|
-
function
|
|
7314
|
+
function ei(e, t) {
|
|
7297
7315
|
if (t.isComposing) return;
|
|
7298
7316
|
let n = t.getDraw();
|
|
7299
7317
|
if (!n.getSlashMenu()?.handleKeydown(e)) {
|
|
7300
|
-
if (e.key === Z.ESC && n.getBubbleMenu()?.dismiss(), e.key === Z.Backspace)
|
|
7301
|
-
else if (e.key === Z.Delete)
|
|
7302
|
-
else if (e.key === Z.Enter)
|
|
7303
|
-
else if (e.key === Z.Left) Ee && e.metaKey ?
|
|
7304
|
-
else if (e.key === Z.Right) Ee && e.metaKey ?
|
|
7305
|
-
else if (e.key === Z.Up || e.key === Z.Down)
|
|
7306
|
-
else if (e.key === Z.Home)
|
|
7307
|
-
else if (e.key === Z.End)
|
|
7308
|
-
else if (
|
|
7318
|
+
if (e.key === Z.ESC && n.getBubbleMenu()?.dismiss(), e.key === Z.Backspace) Vr(e, t);
|
|
7319
|
+
else if (e.key === Z.Delete) Ur(e, t);
|
|
7320
|
+
else if (e.key === Z.Enter) Kr(e, t);
|
|
7321
|
+
else if (e.key === Z.Left) Ee && e.metaKey ? Qr(e, t) : qr(e, t);
|
|
7322
|
+
else if (e.key === Z.Right) Ee && e.metaKey ? $r(e, t) : Jr(e, t);
|
|
7323
|
+
else if (e.key === Z.Up || e.key === Z.Down) Zr(e, t);
|
|
7324
|
+
else if (e.key === Z.Home) Qr(e, t);
|
|
7325
|
+
else if (e.key === Z.End) $r(e, t);
|
|
7326
|
+
else if (Dr(e) && e.key.toLocaleLowerCase() === Z.Z) {
|
|
7309
7327
|
if (n.isReadonly() && n.getMode() !== g.FORM) return;
|
|
7310
7328
|
n.getHistoryManager().undo(), e.preventDefault();
|
|
7311
|
-
} else if (
|
|
7329
|
+
} else if (Dr(e) && e.key.toLocaleLowerCase() === Z.Y) {
|
|
7312
7330
|
if (n.isReadonly() && n.getMode() !== g.FORM) return;
|
|
7313
7331
|
n.getHistoryManager().redo(), e.preventDefault();
|
|
7314
|
-
} else if (
|
|
7315
|
-
else if (
|
|
7316
|
-
else if (
|
|
7317
|
-
else if (
|
|
7332
|
+
} else if (Dr(e) && e.key.toLocaleLowerCase() === Z.C) t.copy(), e.preventDefault();
|
|
7333
|
+
else if (Dr(e) && e.key.toLocaleLowerCase() === Z.X) t.cut(), e.preventDefault();
|
|
7334
|
+
else if (Dr(e) && e.key.toLocaleLowerCase() === Z.A) t.selectAll(), e.preventDefault();
|
|
7335
|
+
else if (Dr(e) && e.key.toLocaleLowerCase() === Z.S) {
|
|
7318
7336
|
if (n.isReadonly()) return;
|
|
7319
7337
|
let t = n.getListener();
|
|
7320
7338
|
t.saved && t.saved(n.getValue());
|
|
@@ -7324,12 +7342,12 @@ function Xr(e, t) {
|
|
|
7324
7342
|
t.clearPainterStyle();
|
|
7325
7343
|
let r = n.getZone();
|
|
7326
7344
|
r.isMainActive() || r.setZone(_.MAIN), e.preventDefault();
|
|
7327
|
-
} else e.key === Z.TAB &&
|
|
7345
|
+
} else e.key === Z.TAB && Yr(e, t);
|
|
7328
7346
|
}
|
|
7329
7347
|
}
|
|
7330
7348
|
//#endregion
|
|
7331
7349
|
//#region src/editor/core/event/handlers/input.ts
|
|
7332
|
-
function
|
|
7350
|
+
function ti(e, t) {
|
|
7333
7351
|
let n = t.getDraw();
|
|
7334
7352
|
if (n.isReadonly() || n.isDisabled()) return;
|
|
7335
7353
|
let r = n.getPosition().getCursorPosition();
|
|
@@ -7339,7 +7357,7 @@ function Zr(e, t) {
|
|
|
7339
7357
|
let a = n.getRange();
|
|
7340
7358
|
if (!a.getIsCanInput()) return;
|
|
7341
7359
|
let o = a.getDefaultStyle() || t.compositionInfo?.defaultStyle || null, s = a.getDefaultTitle() || t.compositionInfo?.defaultTitle || null;
|
|
7342
|
-
|
|
7360
|
+
ni(t), i || n.getCursor().clearAgentDomValue();
|
|
7343
7361
|
let { TEXT: c, HYPERLINK: l, SUBSCRIPT: u, SUPERSCRIPT: d, DATE: f, TAB: p } = w, m = e.replaceAll("\n", ""), { startIndex: h, endIndex: g } = a.getRange(), _ = n.getElementList(), v = a.getRangeAnchorStyle(_, g);
|
|
7344
7362
|
if (!v) return;
|
|
7345
7363
|
let y = n.isDesignMode(), b = L(m).map((e) => {
|
|
@@ -7380,7 +7398,7 @@ function Zr(e, t) {
|
|
|
7380
7398
|
defaultTitle: s
|
|
7381
7399
|
});
|
|
7382
7400
|
}
|
|
7383
|
-
function
|
|
7401
|
+
function ni(e) {
|
|
7384
7402
|
if (!e.compositionInfo) return;
|
|
7385
7403
|
let { elementList: t, startIndex: n, endIndex: r } = e.compositionInfo;
|
|
7386
7404
|
t.splice(n + 1, r - n);
|
|
@@ -7389,7 +7407,7 @@ function Qr(e) {
|
|
|
7389
7407
|
}
|
|
7390
7408
|
//#endregion
|
|
7391
7409
|
//#region src/editor/core/event/handlers/cut.ts
|
|
7392
|
-
async function
|
|
7410
|
+
async function ri(e) {
|
|
7393
7411
|
let t = e.getDraw(), n = t.getRange(), { startIndex: r, endIndex: i } = n.getRange();
|
|
7394
7412
|
if (!~r && !~i || t.isReadonly() || !n.getIsCanInput()) return;
|
|
7395
7413
|
let a = t.getElementList(), o = r, s = i;
|
|
@@ -7404,13 +7422,13 @@ async function $r(e) {
|
|
|
7404
7422
|
o = l < 0 ? 0 : l, s = c[c.length - 1];
|
|
7405
7423
|
}
|
|
7406
7424
|
let c = t.getOptions();
|
|
7407
|
-
await
|
|
7425
|
+
await mr(a.slice(o + 1, s + 1), c);
|
|
7408
7426
|
let l = t.getControl(), u;
|
|
7409
7427
|
l.getActiveControl() && l.getIsRangeWithinControl() ? (u = l.cut(), l.emitControlContentChange()) : (t.deleteElementList(a, o + 1, s - o), u = o), n.setRange(u, u), t.render({ curIndex: u });
|
|
7410
7428
|
}
|
|
7411
7429
|
//#endregion
|
|
7412
7430
|
//#region src/editor/core/event/handlers/copy.ts
|
|
7413
|
-
async function
|
|
7431
|
+
async function ii(e, t) {
|
|
7414
7432
|
let n = e.getDraw(), { copy: r } = n.getOverride();
|
|
7415
7433
|
if (r && r()?.preventDefault !== !1) return;
|
|
7416
7434
|
let i = n.getRange(), a = null;
|
|
@@ -7437,11 +7455,11 @@ async function ei(e, t) {
|
|
|
7437
7455
|
}
|
|
7438
7456
|
a = X([r]);
|
|
7439
7457
|
} else a = i.getIsCollapsed() ? i.getRangeRowElementList() : i.getSelectionElementList();
|
|
7440
|
-
t?.isPlainText && a?.length && (a = [{ value:
|
|
7458
|
+
t?.isPlainText && a?.length && (a = [{ value: $n(On(a)) }]), a?.length && await mr(a, n.getOptions());
|
|
7441
7459
|
}
|
|
7442
7460
|
//#endregion
|
|
7443
7461
|
//#region src/editor/core/event/handlers/drop.ts
|
|
7444
|
-
function
|
|
7462
|
+
function ai(e, t) {
|
|
7445
7463
|
let { drop: n } = t.getDraw().getOverride();
|
|
7446
7464
|
if (n && n(e)?.preventDefault !== !1) return;
|
|
7447
7465
|
e.preventDefault();
|
|
@@ -7452,13 +7470,13 @@ function ti(e, t) {
|
|
|
7452
7470
|
if (!n) return;
|
|
7453
7471
|
for (let e = 0; e < n.length; e++) {
|
|
7454
7472
|
let r = n[e];
|
|
7455
|
-
r.type.startsWith("image") &&
|
|
7473
|
+
r.type.startsWith("image") && vr(t, r);
|
|
7456
7474
|
}
|
|
7457
7475
|
}
|
|
7458
7476
|
}
|
|
7459
7477
|
//#endregion
|
|
7460
7478
|
//#region src/editor/core/event/handlers/click.ts
|
|
7461
|
-
function
|
|
7479
|
+
function oi(e) {
|
|
7462
7480
|
if (!Intl.Segmenter) return null;
|
|
7463
7481
|
let t = e.getDraw(), n = t.getPosition().getCursorPosition();
|
|
7464
7482
|
if (!n) return null;
|
|
@@ -7479,7 +7497,7 @@ function ni(e) {
|
|
|
7479
7497
|
endIndex: l
|
|
7480
7498
|
} : null;
|
|
7481
7499
|
}
|
|
7482
|
-
function
|
|
7500
|
+
function si(e) {
|
|
7483
7501
|
let t = e.getDraw(), n = t.getPosition().getCursorPosition();
|
|
7484
7502
|
if (!n) return null;
|
|
7485
7503
|
let { value: r, index: i } = n, a = t.getLetterReg(), o = 0, s = 0, c = E.test(r);
|
|
@@ -7503,7 +7521,7 @@ function ri(e) {
|
|
|
7503
7521
|
endIndex: i + s
|
|
7504
7522
|
};
|
|
7505
7523
|
}
|
|
7506
|
-
function
|
|
7524
|
+
function ci(e, t) {
|
|
7507
7525
|
let n = e.getDraw(), r = n.getPosition(), i = r.getPositionByXY({
|
|
7508
7526
|
x: t.offsetX,
|
|
7509
7527
|
y: t.offsetY
|
|
@@ -7522,14 +7540,14 @@ function ii(e, t) {
|
|
|
7522
7540
|
return;
|
|
7523
7541
|
}
|
|
7524
7542
|
if ((i.isCheckbox || i.isRadio) && i.isDirectHit) return;
|
|
7525
|
-
let a = n.getRange(), o =
|
|
7543
|
+
let a = n.getRange(), o = oi(e) || si(e);
|
|
7526
7544
|
o && (a.setRange(o.startIndex, o.endIndex), n.render({
|
|
7527
7545
|
isSubmitHistory: !1,
|
|
7528
7546
|
isSetCursor: !1,
|
|
7529
7547
|
isCompute: !1
|
|
7530
7548
|
}), a.setRangeStyle());
|
|
7531
7549
|
}
|
|
7532
|
-
function
|
|
7550
|
+
function li(e) {
|
|
7533
7551
|
let t = e.getDraw(), n = t.getControl();
|
|
7534
7552
|
if (n.getActiveControl() && n.selectValue()) return;
|
|
7535
7553
|
let r = t.getPosition().getCursorPosition();
|
|
@@ -7555,23 +7573,23 @@ function ai(e) {
|
|
|
7555
7573
|
isCompute: !1
|
|
7556
7574
|
});
|
|
7557
7575
|
}
|
|
7558
|
-
var
|
|
7559
|
-
dblclick:
|
|
7560
|
-
threeClick:
|
|
7576
|
+
var ui = {
|
|
7577
|
+
dblclick: ci,
|
|
7578
|
+
threeClick: li
|
|
7561
7579
|
};
|
|
7562
7580
|
//#endregion
|
|
7563
7581
|
//#region src/editor/core/event/handlers/composition.ts
|
|
7564
|
-
function
|
|
7582
|
+
function di(e) {
|
|
7565
7583
|
e.isComposing = !0;
|
|
7566
7584
|
}
|
|
7567
|
-
function
|
|
7585
|
+
function fi(e, t) {
|
|
7568
7586
|
e.isComposing = !1;
|
|
7569
7587
|
let n = e.getDraw();
|
|
7570
7588
|
if (t.data) ke ? setTimeout(() => {
|
|
7571
|
-
e.compositionInfo &&
|
|
7572
|
-
}, 1) : e.compositionInfo &&
|
|
7589
|
+
e.compositionInfo && ti(t.data, e);
|
|
7590
|
+
}, 1) : e.compositionInfo && ti(t.data, e);
|
|
7573
7591
|
else {
|
|
7574
|
-
|
|
7592
|
+
ni(e);
|
|
7575
7593
|
let { endIndex: t } = n.getRange().getRange();
|
|
7576
7594
|
n.render({
|
|
7577
7595
|
curIndex: t,
|
|
@@ -7580,13 +7598,13 @@ function ci(e, t) {
|
|
|
7580
7598
|
}
|
|
7581
7599
|
n.getCursor().clearAgentDomValue();
|
|
7582
7600
|
}
|
|
7583
|
-
var
|
|
7584
|
-
compositionstart:
|
|
7585
|
-
compositionend:
|
|
7601
|
+
var pi = {
|
|
7602
|
+
compositionstart: di,
|
|
7603
|
+
compositionend: fi
|
|
7586
7604
|
};
|
|
7587
7605
|
//#endregion
|
|
7588
7606
|
//#region src/editor/core/event/handlers/drag.ts
|
|
7589
|
-
function
|
|
7607
|
+
function mi(e, t) {
|
|
7590
7608
|
let n = t.getDraw();
|
|
7591
7609
|
if (n.isReadonly()) return;
|
|
7592
7610
|
e.preventDefault();
|
|
@@ -7613,7 +7631,7 @@ function ui(e, t) {
|
|
|
7613
7631
|
isFocus: !1
|
|
7614
7632
|
});
|
|
7615
7633
|
}
|
|
7616
|
-
var
|
|
7634
|
+
var hi = { dragover: mi }, gi = class {
|
|
7617
7635
|
isAllowSelection;
|
|
7618
7636
|
isComposing;
|
|
7619
7637
|
compositionInfo;
|
|
@@ -7654,7 +7672,7 @@ var di = { dragover: ui }, fi = class {
|
|
|
7654
7672
|
if (!e || this.draw.isReadonly() || this.draw.isDisabled()) return;
|
|
7655
7673
|
let t = this.range.getSelection();
|
|
7656
7674
|
if (!t) {
|
|
7657
|
-
let e =
|
|
7675
|
+
let e = oi(this);
|
|
7658
7676
|
e && (t = this.draw.getElementList().slice(e.startIndex + 1, e.endIndex + 1));
|
|
7659
7677
|
}
|
|
7660
7678
|
if (!t) return;
|
|
@@ -7697,51 +7715,51 @@ var di = { dragover: ui }, fi = class {
|
|
|
7697
7715
|
}
|
|
7698
7716
|
}
|
|
7699
7717
|
mousemove(e) {
|
|
7700
|
-
|
|
7718
|
+
zr(e, this);
|
|
7701
7719
|
}
|
|
7702
7720
|
mousedown(e) {
|
|
7703
|
-
|
|
7721
|
+
Nr(e, this);
|
|
7704
7722
|
}
|
|
7705
7723
|
click() {
|
|
7706
7724
|
De && !this.draw.isReadonly() && this.draw.getCursor().getAgentDom().focus();
|
|
7707
7725
|
}
|
|
7708
7726
|
mouseup(e) {
|
|
7709
|
-
|
|
7727
|
+
Lr(e, this);
|
|
7710
7728
|
}
|
|
7711
7729
|
mouseleave(e) {
|
|
7712
|
-
|
|
7730
|
+
Rr(e, this);
|
|
7713
7731
|
}
|
|
7714
7732
|
keydown(e) {
|
|
7715
|
-
|
|
7733
|
+
ei(e, this);
|
|
7716
7734
|
}
|
|
7717
7735
|
dblclick(e) {
|
|
7718
|
-
|
|
7736
|
+
ui.dblclick(this, e);
|
|
7719
7737
|
}
|
|
7720
7738
|
threeClick() {
|
|
7721
|
-
|
|
7739
|
+
ui.threeClick(this);
|
|
7722
7740
|
}
|
|
7723
7741
|
input(e) {
|
|
7724
|
-
|
|
7742
|
+
ti(e, this);
|
|
7725
7743
|
}
|
|
7726
7744
|
async cut() {
|
|
7727
|
-
await
|
|
7745
|
+
await ri(this);
|
|
7728
7746
|
}
|
|
7729
7747
|
async copy(e) {
|
|
7730
|
-
await
|
|
7748
|
+
await ii(this, e);
|
|
7731
7749
|
}
|
|
7732
7750
|
compositionstart() {
|
|
7733
|
-
|
|
7751
|
+
pi.compositionstart(this);
|
|
7734
7752
|
}
|
|
7735
7753
|
compositionend(e) {
|
|
7736
|
-
|
|
7754
|
+
pi.compositionend(this, e);
|
|
7737
7755
|
}
|
|
7738
7756
|
drop(e) {
|
|
7739
|
-
|
|
7757
|
+
ai(e, this);
|
|
7740
7758
|
}
|
|
7741
7759
|
dragover(e) {
|
|
7742
|
-
|
|
7760
|
+
hi.dragover(e, this);
|
|
7743
7761
|
}
|
|
7744
|
-
},
|
|
7762
|
+
}, _i = { PAGE_SCALE: "pageScale" }, vi = class {
|
|
7745
7763
|
draw;
|
|
7746
7764
|
options;
|
|
7747
7765
|
cursor;
|
|
@@ -7791,7 +7809,7 @@ var di = { dragover: ui }, fi = class {
|
|
|
7791
7809
|
});
|
|
7792
7810
|
}
|
|
7793
7811
|
setPageScale = (e) => {
|
|
7794
|
-
if (this.options.shortcutDisableKeys.includes(
|
|
7812
|
+
if (this.options.shortcutDisableKeys.includes(_i.PAGE_SCALE) || !e.ctrlKey) return;
|
|
7795
7813
|
let t = e.target;
|
|
7796
7814
|
if (!(t instanceof Node) || !this.draw.getContainer().contains(t)) return;
|
|
7797
7815
|
e.preventDefault();
|
|
@@ -7818,7 +7836,7 @@ var di = { dragover: ui }, fi = class {
|
|
|
7818
7836
|
_handleDprChange = () => {
|
|
7819
7837
|
this.draw.setPageDevicePixel();
|
|
7820
7838
|
};
|
|
7821
|
-
},
|
|
7839
|
+
}, yi = class {
|
|
7822
7840
|
undoStack = [];
|
|
7823
7841
|
redoStack = [];
|
|
7824
7842
|
maxRecordCount;
|
|
@@ -7859,7 +7877,7 @@ var di = { dragover: ui }, fi = class {
|
|
|
7859
7877
|
popUndo() {
|
|
7860
7878
|
return this.undoStack.pop();
|
|
7861
7879
|
}
|
|
7862
|
-
},
|
|
7880
|
+
}, bi = class {
|
|
7863
7881
|
options;
|
|
7864
7882
|
container;
|
|
7865
7883
|
eventBus;
|
|
@@ -7922,22 +7940,22 @@ var di = { dragover: ui }, fi = class {
|
|
|
7922
7940
|
this.emit(e, { visible: !1 });
|
|
7923
7941
|
});
|
|
7924
7942
|
}
|
|
7925
|
-
},
|
|
7926
|
-
function
|
|
7943
|
+
}, xi = 1e-6;
|
|
7944
|
+
function Si(e) {
|
|
7927
7945
|
let t = parseFloat(e.style.width);
|
|
7928
7946
|
return t ? e.width / t : 1;
|
|
7929
7947
|
}
|
|
7930
|
-
function
|
|
7948
|
+
function Ci(e) {
|
|
7931
7949
|
let t = /(\d+(?:\.\d+)?)px/.exec(e);
|
|
7932
7950
|
return t ? Number(t[1]) : 16;
|
|
7933
7951
|
}
|
|
7934
|
-
function
|
|
7952
|
+
function wi(e, t, n, r) {
|
|
7935
7953
|
if (!t.trim()) return null;
|
|
7936
7954
|
let i = e.getTransform();
|
|
7937
|
-
if (Math.abs(i.b) >
|
|
7938
|
-
let a = e.measureText(t), o =
|
|
7955
|
+
if (Math.abs(i.b) > xi || Math.abs(i.c) > xi) return null;
|
|
7956
|
+
let a = e.measureText(t), o = Ci(e.font), s = a.fontBoundingBoxAscent || a.actualBoundingBoxAscent || o * .8, c = a.fontBoundingBoxDescent || a.actualBoundingBoxDescent || o * .2, l = a.width, u = n;
|
|
7939
7957
|
e.textAlign === "center" ? u -= l / 2 : (e.textAlign === "right" || e.textAlign === "end") && (u -= l);
|
|
7940
|
-
let d =
|
|
7958
|
+
let d = Si(e.canvas);
|
|
7941
7959
|
return {
|
|
7942
7960
|
text: t,
|
|
7943
7961
|
font: e.font,
|
|
@@ -7957,14 +7975,14 @@ function bi(e, t, n, r) {
|
|
|
7957
7975
|
]
|
|
7958
7976
|
};
|
|
7959
7977
|
}
|
|
7960
|
-
function
|
|
7978
|
+
function Ti(e, t) {
|
|
7961
7979
|
let n = [], r = [];
|
|
7962
7980
|
e().forEach((e, t) => {
|
|
7963
7981
|
let i = e.getContext("2d");
|
|
7964
7982
|
if (!i) return;
|
|
7965
7983
|
let a = Object.prototype.hasOwnProperty.call(i, "fillText"), o = i.fillText;
|
|
7966
7984
|
i.fillText = function(e, r, i, a) {
|
|
7967
|
-
let s =
|
|
7985
|
+
let s = wi(this, String(e), r, i);
|
|
7968
7986
|
return s && (n[t] ??= [], n[t].push(s)), a === void 0 ? o.call(this, e, r, i) : o.call(this, e, r, i, a);
|
|
7969
7987
|
}, r.push(() => {
|
|
7970
7988
|
a ? i.fillText = o : delete i.fillText;
|
|
@@ -7979,7 +7997,7 @@ function xi(e, t) {
|
|
|
7979
7997
|
r.forEach((e) => e());
|
|
7980
7998
|
}
|
|
7981
7999
|
}
|
|
7982
|
-
function
|
|
8000
|
+
function Ei(e, t = []) {
|
|
7983
8001
|
let n = e.createElement("div");
|
|
7984
8002
|
n.setAttribute("data-ce-text-layer", ""), n.style.position = "absolute", n.style.left = "0", n.style.top = "0", n.style.width = "100%", n.style.height = "100%";
|
|
7985
8003
|
for (let r of t) {
|
|
@@ -7988,7 +8006,7 @@ function Si(e, t = []) {
|
|
|
7988
8006
|
}
|
|
7989
8007
|
return n;
|
|
7990
8008
|
}
|
|
7991
|
-
function
|
|
8009
|
+
function Di(e) {
|
|
7992
8010
|
e.querySelectorAll("[data-ce-text-layer] span[data-ce-width]").forEach((e) => {
|
|
7993
8011
|
let t = Number(e.getAttribute("data-ce-width")), n = e.offsetWidth;
|
|
7994
8012
|
if (!t || !n) return;
|
|
@@ -7998,7 +8016,7 @@ function Ci(e) {
|
|
|
7998
8016
|
}
|
|
7999
8017
|
//#endregion
|
|
8000
8018
|
//#region src/editor/core/position/Position.ts
|
|
8001
|
-
var
|
|
8019
|
+
var Oi = class {
|
|
8002
8020
|
cursorPosition;
|
|
8003
8021
|
positionContext;
|
|
8004
8022
|
positionList;
|
|
@@ -8660,7 +8678,7 @@ var wi = class {
|
|
|
8660
8678
|
}
|
|
8661
8679
|
setSurroundPosition(e) {
|
|
8662
8680
|
let { scale: t } = this.options, { pageNo: n, row: r, rowElement: i, rowElementRect: a, surroundElementList: o, availableWidth: s } = e, c = a.x, l = 0;
|
|
8663
|
-
if (o.length && !
|
|
8681
|
+
if (o.length && !nr(i) && !i.control?.minWidth) for (let e = 0; e < o.length; e++) {
|
|
8664
8682
|
let u = o[e], d = u.imgFloatPosition;
|
|
8665
8683
|
if (d.pageNo !== n) continue;
|
|
8666
8684
|
let f = {
|
|
@@ -8684,7 +8702,7 @@ var wi = class {
|
|
|
8684
8702
|
rowIncreaseWidth: l
|
|
8685
8703
|
};
|
|
8686
8704
|
}
|
|
8687
|
-
},
|
|
8705
|
+
}, ki = class {
|
|
8688
8706
|
draw;
|
|
8689
8707
|
options;
|
|
8690
8708
|
range;
|
|
@@ -9032,7 +9050,7 @@ var wi = class {
|
|
|
9032
9050
|
let e = this.getTextLikeSelection();
|
|
9033
9051
|
return e ? e.filter((e) => !Dn(e)).map((e) => e.value).join("").replace(/* @__PURE__ */ RegExp("", "g"), "") : "";
|
|
9034
9052
|
}
|
|
9035
|
-
},
|
|
9053
|
+
}, Ai = class {
|
|
9036
9054
|
draw;
|
|
9037
9055
|
options;
|
|
9038
9056
|
imageCache;
|
|
@@ -9079,7 +9097,7 @@ var wi = class {
|
|
|
9079
9097
|
this._renderBackgroundColor(e, r, n, i);
|
|
9080
9098
|
}
|
|
9081
9099
|
}
|
|
9082
|
-
},
|
|
9100
|
+
}, ji = class {
|
|
9083
9101
|
fillRect;
|
|
9084
9102
|
fillColor;
|
|
9085
9103
|
fillDecorationStyle;
|
|
@@ -9102,7 +9120,7 @@ var wi = class {
|
|
|
9102
9120
|
}
|
|
9103
9121
|
s && (this.fillRect.x = t, this.fillRect.y = n), i && this.fillRect.height < i && (this.fillRect.height = i), this.fillRect.width += r, this.fillColor = a, this.fillDecorationStyle = o;
|
|
9104
9122
|
}
|
|
9105
|
-
},
|
|
9123
|
+
}, Mi = class extends ji {
|
|
9106
9124
|
options;
|
|
9107
9125
|
constructor(e) {
|
|
9108
9126
|
super(), this.options = e.getOptions();
|
|
@@ -9112,7 +9130,7 @@ var wi = class {
|
|
|
9112
9130
|
let { highlightAlpha: t } = this.options, { x: n, y: r, width: i, height: a } = this.fillRect;
|
|
9113
9131
|
e.save(), e.globalAlpha = t, e.fillStyle = this.fillColor, e.fillRect(n, r, i, a), e.restore(), this.clearFillInfo();
|
|
9114
9132
|
}
|
|
9115
|
-
},
|
|
9133
|
+
}, Ni = class {
|
|
9116
9134
|
draw;
|
|
9117
9135
|
options;
|
|
9118
9136
|
constructor(e) {
|
|
@@ -9131,7 +9149,7 @@ var wi = class {
|
|
|
9131
9149
|
let { top: l, bottom: u } = this.getIndicatorBounds(t, s), d = [o[3], l], f = [i - o[1], l], p = [o[3], u], m = [i - o[1], u];
|
|
9132
9150
|
e.moveTo(d[0] - c, d[1]), e.lineTo(...d), e.lineTo(d[0], d[1] - c), e.moveTo(f[0] + c, f[1]), e.lineTo(...f), e.lineTo(f[0], f[1] - c), e.moveTo(p[0] - c, p[1]), e.lineTo(...p), e.lineTo(p[0], p[1] + c), e.moveTo(m[0] + c, m[1]), e.lineTo(...m), e.lineTo(m[0], m[1] + c), e.stroke(), e.restore();
|
|
9133
9151
|
}
|
|
9134
|
-
},
|
|
9152
|
+
}, Pi = class {
|
|
9135
9153
|
draw;
|
|
9136
9154
|
options;
|
|
9137
9155
|
position;
|
|
@@ -9439,7 +9457,7 @@ var wi = class {
|
|
|
9439
9457
|
this.draw.getRange().setRange(a, a), this.draw.render({ curIndex: a });
|
|
9440
9458
|
}
|
|
9441
9459
|
}
|
|
9442
|
-
},
|
|
9460
|
+
}, Fi = class {
|
|
9443
9461
|
options;
|
|
9444
9462
|
draw;
|
|
9445
9463
|
position;
|
|
@@ -9577,7 +9595,7 @@ var wi = class {
|
|
|
9577
9595
|
}
|
|
9578
9596
|
e.restore();
|
|
9579
9597
|
}
|
|
9580
|
-
},
|
|
9598
|
+
}, Ii = class extends ji {
|
|
9581
9599
|
options;
|
|
9582
9600
|
constructor(e) {
|
|
9583
9601
|
super(), this.options = e.getOptions();
|
|
@@ -9589,17 +9607,17 @@ var wi = class {
|
|
|
9589
9607
|
let o = i + .5;
|
|
9590
9608
|
e.beginPath(), e.moveTo(r, o), e.lineTo(r + a, o), e.stroke(), e.restore(), this.clearFillInfo();
|
|
9591
9609
|
}
|
|
9592
|
-
},
|
|
9610
|
+
}, Li;
|
|
9593
9611
|
(function(e) {
|
|
9594
9612
|
e.SOLID = "solid", e.DOUBLE = "double", e.DASHED = "dashed", e.DOTTED = "dotted", e.WAVY = "wavy";
|
|
9595
|
-
})(
|
|
9596
|
-
var
|
|
9613
|
+
})(Li ||= {});
|
|
9614
|
+
var Ri;
|
|
9597
9615
|
(function(e) {
|
|
9598
9616
|
e.SOLID = "solid", e.DASHED = "dashed", e.DOTTED = "dotted";
|
|
9599
|
-
})(
|
|
9617
|
+
})(Ri ||= {});
|
|
9600
9618
|
//#endregion
|
|
9601
9619
|
//#region src/editor/core/draw/richtext/Underline.ts
|
|
9602
|
-
var
|
|
9620
|
+
var zi = class extends ji {
|
|
9603
9621
|
options;
|
|
9604
9622
|
constructor(e) {
|
|
9605
9623
|
super(), this.options = e.getOptions();
|
|
@@ -9607,10 +9625,10 @@ var Fi = class extends Di {
|
|
|
9607
9625
|
_drawLine(e, t, n, r, i) {
|
|
9608
9626
|
let a = t + r;
|
|
9609
9627
|
switch (e.beginPath(), i) {
|
|
9610
|
-
case
|
|
9628
|
+
case Ri.DASHED:
|
|
9611
9629
|
e.setLineDash([3, 1]);
|
|
9612
9630
|
break;
|
|
9613
|
-
case
|
|
9631
|
+
case Ri.DOTTED: e.setLineDash([1, 1]);
|
|
9614
9632
|
}
|
|
9615
9633
|
e.moveTo(t, n), e.lineTo(a, n), e.stroke();
|
|
9616
9634
|
}
|
|
@@ -9633,23 +9651,23 @@ var Fi = class extends Di {
|
|
|
9633
9651
|
e.save(), e.strokeStyle = this.fillColor || t, e.lineWidth = n;
|
|
9634
9652
|
let o = Math.floor(i + 2 * e.lineWidth) + .5;
|
|
9635
9653
|
switch (this.fillDecorationStyle) {
|
|
9636
|
-
case
|
|
9654
|
+
case Li.WAVY:
|
|
9637
9655
|
this._drawWave(e, r, o, a);
|
|
9638
9656
|
break;
|
|
9639
|
-
case
|
|
9657
|
+
case Li.DOUBLE:
|
|
9640
9658
|
this._drawDouble(e, r, o, a);
|
|
9641
9659
|
break;
|
|
9642
|
-
case
|
|
9643
|
-
this._drawLine(e, r, o, a,
|
|
9660
|
+
case Li.DASHED:
|
|
9661
|
+
this._drawLine(e, r, o, a, Ri.DASHED);
|
|
9644
9662
|
break;
|
|
9645
|
-
case
|
|
9646
|
-
this._drawLine(e, r, o, a,
|
|
9663
|
+
case Li.DOTTED:
|
|
9664
|
+
this._drawLine(e, r, o, a, Ri.DOTTED);
|
|
9647
9665
|
break;
|
|
9648
9666
|
default: this._drawLine(e, r, o, a);
|
|
9649
9667
|
}
|
|
9650
9668
|
e.restore(), this.clearFillInfo();
|
|
9651
9669
|
}
|
|
9652
|
-
},
|
|
9670
|
+
}, Bi = class {
|
|
9653
9671
|
draw;
|
|
9654
9672
|
options;
|
|
9655
9673
|
ctx;
|
|
@@ -9722,7 +9740,7 @@ var Fi = class extends Di {
|
|
|
9722
9740
|
_render() {
|
|
9723
9741
|
this.text && ~this.curX && ~this.curY && (this.ctx.save(), this.ctx.font = this.curStyle, this.ctx.fillStyle = this.curColor || this.options.defaultColor, this.ctx.fillText(this.text, this.curX, this.curY), this.ctx.restore());
|
|
9724
9742
|
}
|
|
9725
|
-
},
|
|
9743
|
+
}, Vi = class e {
|
|
9726
9744
|
draw;
|
|
9727
9745
|
options;
|
|
9728
9746
|
constructor(e) {
|
|
@@ -9744,7 +9762,7 @@ var Fi = class extends Di {
|
|
|
9744
9762
|
let b = 0, { width: x } = t.measureText(f);
|
|
9745
9763
|
b = s === p.CENTER ? (g - x) / 2 : s === p.RIGHT ? g - x - v[1] : v[3], t.fillText(f, b, y), t.restore();
|
|
9746
9764
|
}
|
|
9747
|
-
},
|
|
9765
|
+
}, Hi = class {
|
|
9748
9766
|
draw;
|
|
9749
9767
|
options;
|
|
9750
9768
|
scrollContainer;
|
|
@@ -9782,7 +9800,7 @@ var Fi = class extends Di {
|
|
|
9782
9800
|
let { intersectionPageNo: e, visiblePageNoList: t } = this.getPageVisibleInfo();
|
|
9783
9801
|
this.draw.setIntersectionPageNo(e), this.draw.setVisiblePageNoList(t);
|
|
9784
9802
|
}, 150);
|
|
9785
|
-
},
|
|
9803
|
+
}, Ui = class {
|
|
9786
9804
|
step = 5;
|
|
9787
9805
|
thresholdPoints = [
|
|
9788
9806
|
70,
|
|
@@ -9836,7 +9854,7 @@ var Fi = class extends Di {
|
|
|
9836
9854
|
_stopMove() {
|
|
9837
9855
|
this.requestAnimationFrameId && (window.cancelAnimationFrame(this.requestAnimationFrameId), this.requestAnimationFrameId = null, this.isMoving = !1);
|
|
9838
9856
|
}
|
|
9839
|
-
},
|
|
9857
|
+
}, Wi = class {
|
|
9840
9858
|
draw;
|
|
9841
9859
|
range;
|
|
9842
9860
|
options;
|
|
@@ -10138,7 +10156,7 @@ var Fi = class extends Di {
|
|
|
10138
10156
|
let a = this._getDrawTdList(t, i);
|
|
10139
10157
|
this._drawBackgroundColor(e, n, r, a), this._drawBorder(e, t, n, r, a, i);
|
|
10140
10158
|
}
|
|
10141
|
-
},
|
|
10159
|
+
}, Gi = class {
|
|
10142
10160
|
draw;
|
|
10143
10161
|
options;
|
|
10144
10162
|
tableParticle;
|
|
@@ -10393,13 +10411,13 @@ var Fi = class extends Di {
|
|
|
10393
10411
|
!r && e >= 0 && (t > e || n > e) && this.draw.getRange().setRange(Math.min(t, e), Math.min(n, e));
|
|
10394
10412
|
}
|
|
10395
10413
|
}
|
|
10396
|
-
},
|
|
10414
|
+
}, Ki;
|
|
10397
10415
|
(function(e) {
|
|
10398
10416
|
e.ROW = "row", e.COL = "col";
|
|
10399
|
-
})(
|
|
10417
|
+
})(Ki ||= {});
|
|
10400
10418
|
//#endregion
|
|
10401
10419
|
//#region src/editor/core/draw/particle/table/TableTool.ts
|
|
10402
|
-
var
|
|
10420
|
+
var qi = class {
|
|
10403
10421
|
MIN_TD_WIDTH = 20;
|
|
10404
10422
|
ROW_COL_OFFSET = 18;
|
|
10405
10423
|
ROW_COL_QUICK_WIDTH = 16;
|
|
@@ -10496,7 +10514,7 @@ var Ui = class {
|
|
|
10496
10514
|
evt: e,
|
|
10497
10515
|
element: i,
|
|
10498
10516
|
index: t,
|
|
10499
|
-
order:
|
|
10517
|
+
order: Ki.ROW
|
|
10500
10518
|
});
|
|
10501
10519
|
}, r.append(a), r.style.height = `${n}px`, D.append(r);
|
|
10502
10520
|
}
|
|
@@ -10537,7 +10555,7 @@ var Ui = class {
|
|
|
10537
10555
|
evt: e,
|
|
10538
10556
|
element: i,
|
|
10539
10557
|
index: t,
|
|
10540
|
-
order:
|
|
10558
|
+
order: Ki.COL
|
|
10541
10559
|
});
|
|
10542
10560
|
}, r.append(a), r.style.width = `${n}px`, A.append(r);
|
|
10543
10561
|
}
|
|
@@ -10560,31 +10578,31 @@ var Ui = class {
|
|
|
10560
10578
|
t = a - r, n = this.draw.getTableParticle().getTdWindowOffsetY(r, d);
|
|
10561
10579
|
}
|
|
10562
10580
|
let r = document.createElement("div");
|
|
10563
|
-
this.draw.getUi().applyClass(r, "tableTool", "borderRow", "ce-table-tool__border__row"), this._setBorderHandleStyle(r,
|
|
10581
|
+
this.draw.getUi().applyClass(r, "tableTool", "borderRow", "ce-table-tool__border__row"), this._setBorderHandleStyle(r, Ki.ROW), r.style.width = `${e.width * o}px`, r.style.height = `${this.BORDER_VALUE}px`, r.style.top = `${(e.y + t) * o + n - this.BORDER_VALUE / 2}px`, r.style.left = `${e.x * o}px`, r.onmousedown = (t) => {
|
|
10564
10582
|
this._mousedown({
|
|
10565
10583
|
evt: t,
|
|
10566
10584
|
element: i,
|
|
10567
10585
|
index: e.rowIndex + e.rowspan - 1,
|
|
10568
|
-
order:
|
|
10586
|
+
order: Ki.ROW
|
|
10569
10587
|
});
|
|
10570
10588
|
}, M.appendChild(r);
|
|
10571
10589
|
let a = document.createElement("div");
|
|
10572
|
-
if (this.draw.getUi().applyClass(a, "tableTool", "borderCol", "ce-table-tool__border__col"), this._setBorderHandleStyle(a,
|
|
10590
|
+
if (this.draw.getUi().applyClass(a, "tableTool", "borderCol", "ce-table-tool__border__col"), this._setBorderHandleStyle(a, Ki.COL), a.style.width = `${this.BORDER_VALUE}px`, a.style.height = `${t * o}px`, a.style.top = `${e.y * o + n}px`, a.style.left = `${(e.x + e.width) * o - this.BORDER_VALUE / 2}px`, a.onmousedown = (t) => {
|
|
10573
10591
|
this._mousedown({
|
|
10574
10592
|
evt: t,
|
|
10575
10593
|
element: i,
|
|
10576
10594
|
index: e.colIndex + e.colspan - 1,
|
|
10577
|
-
order:
|
|
10595
|
+
order: Ki.COL
|
|
10578
10596
|
});
|
|
10579
10597
|
}, M.appendChild(a), s && e.colIndex === 0) {
|
|
10580
10598
|
let r = document.createElement("div");
|
|
10581
|
-
this.draw.getUi().applyClass(r, "tableTool", "borderCol", "ce-table-tool__border__col"), this._setBorderHandleStyle(r,
|
|
10599
|
+
this.draw.getUi().applyClass(r, "tableTool", "borderCol", "ce-table-tool__border__col"), this._setBorderHandleStyle(r, Ki.COL), r.style.width = `${this.BORDER_VALUE}px`, r.style.height = `${t * o}px`, r.style.top = `${e.y * o + n}px`, r.style.left = `${e.x * o - this.BORDER_VALUE / 2}px`, r.onmousedown = (e) => {
|
|
10582
10600
|
this._mousedown({
|
|
10583
10601
|
evt: e,
|
|
10584
10602
|
element: i,
|
|
10585
10603
|
index: 0,
|
|
10586
10604
|
isLeftStartBorder: !0,
|
|
10587
|
-
order:
|
|
10605
|
+
order: Ki.COL
|
|
10588
10606
|
});
|
|
10589
10607
|
}, M.appendChild(r);
|
|
10590
10608
|
}
|
|
@@ -10601,7 +10619,7 @@ var Ui = class {
|
|
|
10601
10619
|
_setBorderHandleStyle(e, t) {
|
|
10602
10620
|
Object.assign(e.style, {
|
|
10603
10621
|
position: "absolute",
|
|
10604
|
-
cursor: t ===
|
|
10622
|
+
cursor: t === Ki.ROW ? "row-resize" : "col-resize",
|
|
10605
10623
|
pointerEvents: "auto"
|
|
10606
10624
|
});
|
|
10607
10625
|
}
|
|
@@ -10620,14 +10638,14 @@ var Ui = class {
|
|
|
10620
10638
|
let f = t.target, p = this.canvas.getBoundingClientRect(), m = window.getComputedStyle(f).cursor;
|
|
10621
10639
|
document.body.style.cursor = m, this.canvas.style.cursor = m;
|
|
10622
10640
|
let h = 0, g = 0, _ = document.createElement("div");
|
|
10623
|
-
this.draw.getUi().applyClass(_, "tableTool", "anchorLine", "ce-table-anchor__line"), _.style.position = "absolute", _.style.zIndex = this.ANCHOR_Z_INDEX, r ===
|
|
10641
|
+
this.draw.getUi().applyClass(_, "tableTool", "anchorLine", "ce-table-anchor__line"), _.style.position = "absolute", _.style.zIndex = this.ANCHOR_Z_INDEX, r === Ki.ROW ? (_.classList.add("ce-table-anchor__line__row"), _.dataset.axis = "row", _.style.width = `${c}px`, h = u, g = d + this.mousedownY - p.top) : (_.classList.add("ce-table-anchor__line__col"), _.dataset.axis = "col", _.style.height = `${l}px`, h = this.mousedownX - p.left, g = d), _.style.left = `${h}px`, _.style.top = `${g}px`, this.container.append(_), this.anchorLine = _;
|
|
10624
10642
|
let v = 0, y = 0, b = (e) => {
|
|
10625
10643
|
let t = this._mousemove(e, r, h, g);
|
|
10626
10644
|
t && (v = t.dx, y = t.dy);
|
|
10627
10645
|
};
|
|
10628
10646
|
document.addEventListener("mousemove", b), document.addEventListener("mouseup", () => {
|
|
10629
10647
|
let e = !1, t = v / o, c = y / o;
|
|
10630
|
-
if (r ===
|
|
10648
|
+
if (r === Ki.ROW) {
|
|
10631
10649
|
let t = i.trList, r = t[n] || t[n - 1], { defaultTrMinHeight: a } = this.options.table;
|
|
10632
10650
|
c < 0 && r.height + c < a && (c = a - r.height), c && (r.height += c, r.minHeight = r.height, e = !0);
|
|
10633
10651
|
} else {
|
|
@@ -10658,16 +10676,16 @@ var Ui = class {
|
|
|
10658
10676
|
_mousemove(e, t, n, r) {
|
|
10659
10677
|
if (!this.anchorLine) return null;
|
|
10660
10678
|
let i = e.x - this.mousedownX, a = e.y - this.mousedownY;
|
|
10661
|
-
return t ===
|
|
10679
|
+
return t === Ki.ROW ? this.anchorLine.style.top = `${r + a}px` : this.anchorLine.style.left = `${n + i}px`, e.preventDefault(), {
|
|
10662
10680
|
dx: i,
|
|
10663
10681
|
dy: a
|
|
10664
10682
|
};
|
|
10665
10683
|
}
|
|
10666
|
-
},
|
|
10684
|
+
}, Ji;
|
|
10667
10685
|
(function(e) {
|
|
10668
10686
|
e.LEFT = "left", e.RIGHT = "right", e.TOP = "top", e.BOTTOM = "bottom";
|
|
10669
|
-
})(
|
|
10670
|
-
var
|
|
10687
|
+
})(Ji ||= {});
|
|
10688
|
+
var Yi = class {
|
|
10671
10689
|
MM_PX = 96 / 25.4;
|
|
10672
10690
|
HANDLE_HIT_TOLERANCE = 7;
|
|
10673
10691
|
MIN_INNER_SIZE = 100;
|
|
@@ -10773,11 +10791,11 @@ var Gi = class {
|
|
|
10773
10791
|
}
|
|
10774
10792
|
_getHitMarginSideX(e) {
|
|
10775
10793
|
let t = this.draw.getWidth(), n = this.draw.getMargins();
|
|
10776
|
-
return Math.abs(e - n[3]) <= this.HANDLE_HIT_TOLERANCE ?
|
|
10794
|
+
return Math.abs(e - n[3]) <= this.HANDLE_HIT_TOLERANCE ? Ji.LEFT : Math.abs(e - (t - n[1])) <= this.HANDLE_HIT_TOLERANCE ? Ji.RIGHT : null;
|
|
10777
10795
|
}
|
|
10778
10796
|
_getHitMarginSideY(e) {
|
|
10779
10797
|
let t = this.draw.getHeight(), n = this.draw.getMargins();
|
|
10780
|
-
return Math.abs(e - n[0]) <= this.HANDLE_HIT_TOLERANCE ?
|
|
10798
|
+
return Math.abs(e - n[0]) <= this.HANDLE_HIT_TOLERANCE ? Ji.TOP : Math.abs(e - (t - n[2])) <= this.HANDLE_HIT_TOLERANCE ? Ji.BOTTOM : null;
|
|
10781
10799
|
}
|
|
10782
10800
|
_getRelativeX(e) {
|
|
10783
10801
|
if (!this.rulerContainer) return 0;
|
|
@@ -10819,12 +10837,12 @@ var Gi = class {
|
|
|
10819
10837
|
_dragMargin(e) {
|
|
10820
10838
|
if (!this.dragSide || !this.dragOriginMargins || !this.rulerContainer) return;
|
|
10821
10839
|
let t = this.options.scale, n = [...this.dragOriginMargins];
|
|
10822
|
-
if (this.dragSide ===
|
|
10840
|
+
if (this.dragSide === Ji.LEFT || this.dragSide === Ji.RIGHT) {
|
|
10823
10841
|
let r = this.draw.getOriginalWidth(), i = (e.clientX - this.dragStartPosition) / t;
|
|
10824
|
-
this.dragSide ===
|
|
10842
|
+
this.dragSide === Ji.LEFT ? n[3] = this.clampMargin(n[3] + i, r - n[1] - this.MIN_INNER_SIZE) : n[1] = this.clampMargin(n[1] - i, r - n[3] - this.MIN_INNER_SIZE);
|
|
10825
10843
|
} else {
|
|
10826
10844
|
let r = this.draw.getOriginalHeight(), i = (e.clientY - this.dragStartPosition) / t;
|
|
10827
|
-
this.dragSide ===
|
|
10845
|
+
this.dragSide === Ji.TOP ? n[0] = this.clampMargin(n[0] + i, r - n[2] - this.MIN_INNER_SIZE) : n[2] = this.clampMargin(n[2] - i, r - n[0] - this.MIN_INNER_SIZE);
|
|
10828
10846
|
}
|
|
10829
10847
|
this._setDisplayedMargins(n.map((e) => Math.round(e)));
|
|
10830
10848
|
}
|
|
@@ -10843,7 +10861,7 @@ var Gi = class {
|
|
|
10843
10861
|
];
|
|
10844
10862
|
r.join() !== n.join() && this.draw.setPaperMargin(r);
|
|
10845
10863
|
}
|
|
10846
|
-
},
|
|
10864
|
+
}, Xi = class {
|
|
10847
10865
|
draw;
|
|
10848
10866
|
options;
|
|
10849
10867
|
container;
|
|
@@ -10898,7 +10916,7 @@ var Gi = class {
|
|
|
10898
10916
|
render(e, t, n, r) {
|
|
10899
10917
|
e.save(), e.font = t.style, t.color ||= this.options.defaultHyperlinkColor, e.fillStyle = t.color, t.underline === void 0 && (t.underline = !0), e.fillText(t.value, n, r), e.restore();
|
|
10900
10918
|
}
|
|
10901
|
-
},
|
|
10919
|
+
}, Zi = class {
|
|
10902
10920
|
draw;
|
|
10903
10921
|
options;
|
|
10904
10922
|
container;
|
|
@@ -10996,7 +11014,7 @@ var Gi = class {
|
|
|
10996
11014
|
td: c
|
|
10997
11015
|
}, this.draw.getPageNo()), this.lastHoverKey = l);
|
|
10998
11016
|
}
|
|
10999
|
-
},
|
|
11017
|
+
}, Qi = class {
|
|
11000
11018
|
draw;
|
|
11001
11019
|
options;
|
|
11002
11020
|
container;
|
|
@@ -11154,7 +11172,7 @@ var Gi = class {
|
|
|
11154
11172
|
_markElementList(e, t) {
|
|
11155
11173
|
if (this.options.trace.disabled) return;
|
|
11156
11174
|
let n = this.options.trace.author, r = Date.now();
|
|
11157
|
-
|
|
11175
|
+
lr(e, (e) => {
|
|
11158
11176
|
let i = e.trace || [];
|
|
11159
11177
|
i[i.length - 1]?.type !== t && (e.trace = [...i, {
|
|
11160
11178
|
type: t,
|
|
@@ -11174,7 +11192,7 @@ var Gi = class {
|
|
|
11174
11192
|
}
|
|
11175
11193
|
return this._markElementList(n, q.DELETED), n;
|
|
11176
11194
|
}
|
|
11177
|
-
},
|
|
11195
|
+
}, $i = class {
|
|
11178
11196
|
options;
|
|
11179
11197
|
constructor(e) {
|
|
11180
11198
|
this.options = e.getOptions();
|
|
@@ -11188,7 +11206,7 @@ var Gi = class {
|
|
|
11188
11206
|
_drawRoundedRect(e, t, n, r, i, a) {
|
|
11189
11207
|
e.beginPath(), e.moveTo(t + a, n), e.lineTo(t + r - a, n), e.quadraticCurveTo(t + r, n, t + r, n + a), e.lineTo(t + r, n + i - a), e.quadraticCurveTo(t + r, n + i, t + r - a, n + i), e.lineTo(t + a, n + i), e.quadraticCurveTo(t, n + i, t, n + i - a), e.lineTo(t, n + a), e.quadraticCurveTo(t, n, t + a, n), e.closePath();
|
|
11190
11208
|
}
|
|
11191
|
-
},
|
|
11209
|
+
}, ea = class {
|
|
11192
11210
|
draw;
|
|
11193
11211
|
position;
|
|
11194
11212
|
zone;
|
|
@@ -11225,7 +11243,7 @@ var Gi = class {
|
|
|
11225
11243
|
return t;
|
|
11226
11244
|
}
|
|
11227
11245
|
_computeRowList(e) {
|
|
11228
|
-
let t = this.draw.getMargins(e), n = this.draw.getInnerWidth(e), r =
|
|
11246
|
+
let t = this.draw.getMargins(e), n = this.draw.getInnerWidth(e), r = ir(this.elementList);
|
|
11229
11247
|
return this.draw.computeRowList({
|
|
11230
11248
|
startX: t[3],
|
|
11231
11249
|
startY: this.getHeaderTop(),
|
|
@@ -11293,21 +11311,21 @@ var Gi = class {
|
|
|
11293
11311
|
zone: _.HEADER
|
|
11294
11312
|
}), e.restore();
|
|
11295
11313
|
}
|
|
11296
|
-
},
|
|
11314
|
+
}, ta = class {
|
|
11297
11315
|
getOffsetY(e) {
|
|
11298
11316
|
return -e.metrics.height / 2;
|
|
11299
11317
|
}
|
|
11300
11318
|
render(e, t, n, r) {
|
|
11301
11319
|
e.save(), e.font = t.style, t.color && (e.fillStyle = t.color), e.fillText(t.value, n, r + this.getOffsetY(t)), e.restore();
|
|
11302
11320
|
}
|
|
11303
|
-
},
|
|
11321
|
+
}, na = class {
|
|
11304
11322
|
getOffsetY(e) {
|
|
11305
11323
|
return e.metrics.height / 2;
|
|
11306
11324
|
}
|
|
11307
11325
|
render(e, t, n, r) {
|
|
11308
11326
|
e.save(), e.font = t.style, t.color && (e.fillStyle = t.color), e.fillText(t.value, n, r + this.getOffsetY(t)), e.restore();
|
|
11309
11327
|
}
|
|
11310
|
-
},
|
|
11328
|
+
}, ra = class {
|
|
11311
11329
|
options;
|
|
11312
11330
|
constructor(e) {
|
|
11313
11331
|
this.options = e.getOptions();
|
|
@@ -11319,7 +11337,7 @@ var Gi = class {
|
|
|
11319
11337
|
let s = Math.round(r);
|
|
11320
11338
|
e.translate(0, e.lineWidth / 2), e.beginPath(), e.moveTo(n, s), e.lineTo(n + t.width * i, s), e.stroke(), e.restore();
|
|
11321
11339
|
}
|
|
11322
|
-
},
|
|
11340
|
+
}, ia = class {
|
|
11323
11341
|
draw;
|
|
11324
11342
|
options;
|
|
11325
11343
|
i18n;
|
|
@@ -11332,7 +11350,7 @@ var Gi = class {
|
|
|
11332
11350
|
let p = e.measureText(s), m = (d - p.width) / 2;
|
|
11333
11351
|
e.setLineDash(o), e.translate(0, .5 + f), e.beginPath(), e.moveTo(n, r), e.lineTo(n + m, r), e.moveTo(n + m + p.width, r), e.lineTo(n + d, r), e.stroke(), e.fillText(s, n + m, r + p.actualBoundingBoxAscent - u / 2), e.restore();
|
|
11334
11352
|
}
|
|
11335
|
-
},
|
|
11353
|
+
}, aa = class {
|
|
11336
11354
|
draw;
|
|
11337
11355
|
options;
|
|
11338
11356
|
imageCache;
|
|
@@ -11344,9 +11362,9 @@ var Gi = class {
|
|
|
11344
11362
|
let { watermark: { data: n, opacity: r, font: i, size: a, color: o, repeat: s, gap: c, numberType: l }, scale: u } = this.options, { width: d, height: f } = this.draw.getPageSize(t);
|
|
11345
11363
|
e.save(), e.globalAlpha = r, e.font = `${a * u}px ${i}`;
|
|
11346
11364
|
let p = n, m = new RegExp(Yt.PAGE_NO);
|
|
11347
|
-
m.test(p) && (p =
|
|
11365
|
+
m.test(p) && (p = Vi.formatNumberPlaceholder(p, t + 1, m, l));
|
|
11348
11366
|
let h = new RegExp(Yt.PAGE_COUNT);
|
|
11349
|
-
h.test(p) && (p =
|
|
11367
|
+
h.test(p) && (p = Vi.formatNumberPlaceholder(p, this.draw.getPageCount(), h, l));
|
|
11350
11368
|
let g = e.measureText(p);
|
|
11351
11369
|
if (s) {
|
|
11352
11370
|
let t = this.draw.getPagePixelRatio(), n = document.createElement("canvas"), r = n.getContext("2d"), s = g.width, l = g.actualBoundingBoxAscent + g.actualBoundingBoxDescent, m = Math.sqrt(s ** 2 + l ** 2), h = m + 2 * c[0] * u, _ = m + 2 * c[1] * u;
|
|
@@ -11414,7 +11432,7 @@ var Gi = class {
|
|
|
11414
11432
|
render(e, t) {
|
|
11415
11433
|
this.draw.getWatermarkEditor()?.isEditing() || (this.options.watermark.type === tn.IMAGE ? this.renderImage(e, t) : this.renderText(e, t));
|
|
11416
11434
|
}
|
|
11417
|
-
},
|
|
11435
|
+
}, oa = class {
|
|
11418
11436
|
draw;
|
|
11419
11437
|
control;
|
|
11420
11438
|
options;
|
|
@@ -11497,7 +11515,7 @@ var Gi = class {
|
|
|
11497
11515
|
}
|
|
11498
11516
|
e.restore();
|
|
11499
11517
|
}
|
|
11500
|
-
},
|
|
11518
|
+
}, sa = class {
|
|
11501
11519
|
borderRect;
|
|
11502
11520
|
options;
|
|
11503
11521
|
constructor(e) {
|
|
@@ -11519,7 +11537,7 @@ var Gi = class {
|
|
|
11519
11537
|
let { scale: t, control: { borderWidth: n, borderColor: r } } = this.options, { x: i, y: a, width: o, height: s } = this.borderRect;
|
|
11520
11538
|
e.save(), e.translate(0, 1 * t), e.lineWidth = n * t, e.strokeStyle = r, e.beginPath(), e.rect(i, a, o, s), e.stroke(), e.restore(), this.clearBorderInfo();
|
|
11521
11539
|
}
|
|
11522
|
-
},
|
|
11540
|
+
}, ca = class {
|
|
11523
11541
|
draw;
|
|
11524
11542
|
element;
|
|
11525
11543
|
control;
|
|
@@ -11747,7 +11765,7 @@ var Gi = class {
|
|
|
11747
11765
|
destroy() {
|
|
11748
11766
|
this.isPopup && (this.selectDom?.remove(), this.selectDom = null, this.isPopup = !1, this.ui.isHeadless("selectControl") && this.ui.emit("uiSelectControl", { visible: !1 }));
|
|
11749
11767
|
}
|
|
11750
|
-
},
|
|
11768
|
+
}, la = class {
|
|
11751
11769
|
element;
|
|
11752
11770
|
control;
|
|
11753
11771
|
options;
|
|
@@ -11766,7 +11784,7 @@ var Gi = class {
|
|
|
11766
11784
|
r.controlComponent === G.VALUE && !Dn(r) && i.push(r);
|
|
11767
11785
|
let a = n;
|
|
11768
11786
|
for (; a > 0;) {
|
|
11769
|
-
let e =
|
|
11787
|
+
let e = sr(t, a, -1, r.controlId);
|
|
11770
11788
|
if (e < 0) break;
|
|
11771
11789
|
let n = t[e];
|
|
11772
11790
|
if (n.controlId !== r.controlId || n.controlComponent === G.PREFIX || n.controlComponent === G.PRE_TEXT) break;
|
|
@@ -11774,7 +11792,7 @@ var Gi = class {
|
|
|
11774
11792
|
}
|
|
11775
11793
|
let o = n + 1;
|
|
11776
11794
|
for (; o < t.length;) {
|
|
11777
|
-
let e =
|
|
11795
|
+
let e = sr(t, o, 1, r.controlId);
|
|
11778
11796
|
if (e < 0 || e >= t.length) break;
|
|
11779
11797
|
let n = t[e];
|
|
11780
11798
|
if (n.controlId !== r.controlId || n.controlComponent === G.POSTFIX || n.controlComponent === G.POST_TEXT) break;
|
|
@@ -11848,7 +11866,7 @@ var Gi = class {
|
|
|
11848
11866
|
})(Q ||= {});
|
|
11849
11867
|
//#endregion
|
|
11850
11868
|
//#region src/editor/core/draw/particle/date/DatePicker.ts
|
|
11851
|
-
var
|
|
11869
|
+
var ua = "YYYY-MM-DD HH:mm:ss", da = class {
|
|
11852
11870
|
draw;
|
|
11853
11871
|
ui;
|
|
11854
11872
|
options;
|
|
@@ -12026,7 +12044,7 @@ var oa = "YYYY-MM-DD HH:mm:ss", sa = class {
|
|
|
12026
12044
|
this.pickDate = new Date(this.now);
|
|
12027
12045
|
}
|
|
12028
12046
|
_getDateFormat() {
|
|
12029
|
-
return this.renderOptions?.dateFormat ??
|
|
12047
|
+
return this.renderOptions?.dateFormat ?? ua;
|
|
12030
12048
|
}
|
|
12031
12049
|
_getDatePickerType(e) {
|
|
12032
12050
|
if (!e) return Q.DATE;
|
|
@@ -12335,7 +12353,7 @@ var oa = "YYYY-MM-DD HH:mm:ss", sa = class {
|
|
|
12335
12353
|
destroy() {
|
|
12336
12354
|
this._toggleVisible(!1), this.dom?.container.remove();
|
|
12337
12355
|
}
|
|
12338
|
-
},
|
|
12356
|
+
}, fa = class {
|
|
12339
12357
|
draw;
|
|
12340
12358
|
element;
|
|
12341
12359
|
control;
|
|
@@ -12448,7 +12466,7 @@ var oa = "YYYY-MM-DD HH:mm:ss", sa = class {
|
|
|
12448
12466
|
if (!e) return;
|
|
12449
12467
|
let t = this.draw.getElementList(), { startIndex: n } = this.control.getRange();
|
|
12450
12468
|
if (t[n + 1]?.controlId !== this.element.controlId) return;
|
|
12451
|
-
this.datePicker = new
|
|
12469
|
+
this.datePicker = new da(this.draw, {
|
|
12452
12470
|
onSubmit: this._setDate.bind(this),
|
|
12453
12471
|
onClear: () => this._setDate(""),
|
|
12454
12472
|
onClose: () => this.destroy()
|
|
@@ -12472,7 +12490,7 @@ var oa = "YYYY-MM-DD HH:mm:ss", sa = class {
|
|
|
12472
12490
|
}
|
|
12473
12491
|
this.destroy();
|
|
12474
12492
|
}
|
|
12475
|
-
},
|
|
12493
|
+
}, pa = [
|
|
12476
12494
|
[
|
|
12477
12495
|
{
|
|
12478
12496
|
key: "C",
|
|
@@ -12560,7 +12578,7 @@ var oa = "YYYY-MM-DD HH:mm:ss", sa = class {
|
|
|
12560
12578
|
span: 2
|
|
12561
12579
|
}
|
|
12562
12580
|
]
|
|
12563
|
-
],
|
|
12581
|
+
], ma = new Set(pa.flatMap((e) => e.map((e) => e.key))), ha = /^[\d.+\-*/%e\s]*$/, ga = class {
|
|
12564
12582
|
control;
|
|
12565
12583
|
ui;
|
|
12566
12584
|
controlId;
|
|
@@ -12590,7 +12608,7 @@ var oa = "YYYY-MM-DD HH:mm:ss", sa = class {
|
|
|
12590
12608
|
let n = document.createElement("div");
|
|
12591
12609
|
this.ui.applyClass(n, "calculator", "display", "ce-calculator-display"), n.textContent = this.displayText;
|
|
12592
12610
|
let r = document.createElement("div");
|
|
12593
|
-
this.ui.applyClass(r, "calculator", "buttons", "ce-calculator-buttons"),
|
|
12611
|
+
this.ui.applyClass(r, "calculator", "buttons", "ce-calculator-buttons"), pa.forEach((e) => {
|
|
12594
12612
|
e.forEach((e) => {
|
|
12595
12613
|
let t = document.createElement("button");
|
|
12596
12614
|
this.ui.applyClass(t, "calculator", "button", "ce-calculator-button"), e.type !== K.NUMBER && t.classList.add(e.type), this.ui.setState(t, e.type, !0), t.textContent = e.key, t.onclick = () => this._press(e.key), e.span && (t.style.gridColumn = `span ${e.span}`), r.appendChild(t);
|
|
@@ -12604,7 +12622,7 @@ var oa = "YYYY-MM-DD HH:mm:ss", sa = class {
|
|
|
12604
12622
|
controlId: this.controlId,
|
|
12605
12623
|
expression: this.currentExpression,
|
|
12606
12624
|
display: this.displayText,
|
|
12607
|
-
keys:
|
|
12625
|
+
keys: pa.map((e) => e.map((e) => ({ ...e }))),
|
|
12608
12626
|
input: (e) => this._press(e),
|
|
12609
12627
|
clear: () => this._press("C"),
|
|
12610
12628
|
backspace: () => this._press("←"),
|
|
@@ -12615,7 +12633,7 @@ var oa = "YYYY-MM-DD HH:mm:ss", sa = class {
|
|
|
12615
12633
|
});
|
|
12616
12634
|
}
|
|
12617
12635
|
_press(e) {
|
|
12618
|
-
if (this.anchor &&
|
|
12636
|
+
if (this.anchor && ma.has(e)) {
|
|
12619
12637
|
if (e === "C") this.currentExpression = "", this.displayText = "0";
|
|
12620
12638
|
else if (e === "←") this.currentExpression = this.currentExpression.slice(0, -1), this.displayText = this.currentExpression || "0";
|
|
12621
12639
|
else if (e === "=") {
|
|
@@ -12639,7 +12657,7 @@ var oa = "YYYY-MM-DD HH:mm:ss", sa = class {
|
|
|
12639
12657
|
this.anchor && (this.anchor = null, this.calculatorDom ? (this.calculatorDom.remove(), this.calculatorDom = null, this.displayDom = null) : this.ui.emit("uiCalculator", { visible: !1 }));
|
|
12640
12658
|
}
|
|
12641
12659
|
calculate(e) {
|
|
12642
|
-
if (!e.trim() || !
|
|
12660
|
+
if (!e.trim() || !ha.test(e)) return NaN;
|
|
12643
12661
|
let t;
|
|
12644
12662
|
try {
|
|
12645
12663
|
t = Function("return " + e)();
|
|
@@ -12648,7 +12666,7 @@ var oa = "YYYY-MM-DD HH:mm:ss", sa = class {
|
|
|
12648
12666
|
}
|
|
12649
12667
|
return typeof t == "number" ? !Number.isFinite(t) || Number.isInteger(t) ? t : parseFloat(t.toFixed(10)) : NaN;
|
|
12650
12668
|
}
|
|
12651
|
-
},
|
|
12669
|
+
}, _a = class extends la {
|
|
12652
12670
|
isPopup;
|
|
12653
12671
|
calculator;
|
|
12654
12672
|
constructor(e, t) {
|
|
@@ -12706,7 +12724,7 @@ var oa = "YYYY-MM-DD HH:mm:ss", sa = class {
|
|
|
12706
12724
|
if (this.isPopup || !e || this.control.getIsDisabledControl() || !this.control.getIsRangeWithinControl()) return;
|
|
12707
12725
|
let { startIndex: t } = this.control.getRange();
|
|
12708
12726
|
if (this.control.getElementList()[t + 1]?.controlId === this.element.controlId) {
|
|
12709
|
-
if (this.calculator = new
|
|
12727
|
+
if (this.calculator = new ga({
|
|
12710
12728
|
control: this.control,
|
|
12711
12729
|
controlId: this.element.controlId,
|
|
12712
12730
|
onCalculate: (e) => {
|
|
@@ -12723,7 +12741,7 @@ var oa = "YYYY-MM-DD HH:mm:ss", sa = class {
|
|
|
12723
12741
|
destroy() {
|
|
12724
12742
|
this.isPopup &&= (this.calculator?.destroy(), this.calculator = null, !1);
|
|
12725
12743
|
}
|
|
12726
|
-
},
|
|
12744
|
+
}, va = class {
|
|
12727
12745
|
controlBorder;
|
|
12728
12746
|
draw;
|
|
12729
12747
|
range;
|
|
@@ -12736,7 +12754,7 @@ var oa = "YYYY-MM-DD HH:mm:ss", sa = class {
|
|
|
12736
12754
|
activeControlValue;
|
|
12737
12755
|
preElement;
|
|
12738
12756
|
constructor(e) {
|
|
12739
|
-
this.controlBorder = new
|
|
12757
|
+
this.controlBorder = new sa(e), this.draw = e, this.range = e.getRange(), this.listener = e.getListener(), this.eventBus = e.getEventBus(), this.controlSearch = new oa(this), this.options = e.getOptions(), this.controlOptions = this.options.control, this.activeControl = null, this.activeControlValue = [], this.preElement = null;
|
|
12740
12758
|
}
|
|
12741
12759
|
setHighlightList(e) {
|
|
12742
12760
|
this.controlSearch.setHighlightList(e);
|
|
@@ -12804,7 +12822,7 @@ var oa = "YYYY-MM-DD HH:mm:ss", sa = class {
|
|
|
12804
12822
|
if (!~e && !~t) return !1;
|
|
12805
12823
|
let n = this.getElementList(), r = n[e];
|
|
12806
12824
|
if (e === t && r.controlComponent === G.POSTFIX) return !0;
|
|
12807
|
-
let i = n[t], a =
|
|
12825
|
+
let i = n[t], a = cr(n, e), o = cr(n, t);
|
|
12808
12826
|
return !!(a && a === o && i.controlComponent !== G.POSTFIX);
|
|
12809
12827
|
}
|
|
12810
12828
|
getIsRangeInPostfix() {
|
|
@@ -12815,7 +12833,7 @@ var oa = "YYYY-MM-DD HH:mm:ss", sa = class {
|
|
|
12815
12833
|
getIsRangeWithinControl() {
|
|
12816
12834
|
let { startIndex: e, endIndex: t } = this.getRange();
|
|
12817
12835
|
if (!~e && !~t) return !1;
|
|
12818
|
-
let n = this.getElementList(), r = n[t], i =
|
|
12836
|
+
let n = this.getElementList(), r = n[t], i = cr(n, e), a = cr(n, t);
|
|
12819
12837
|
return !!(i && i === a && r.controlComponent !== G.POSTFIX);
|
|
12820
12838
|
}
|
|
12821
12839
|
getIsElementListContainFullControl(e) {
|
|
@@ -12846,7 +12864,7 @@ var oa = "YYYY-MM-DD HH:mm:ss", sa = class {
|
|
|
12846
12864
|
if (n.controlComponent === G.PREFIX || n.controlComponent === G.PRE_TEXT) {
|
|
12847
12865
|
let r = t;
|
|
12848
12866
|
for (; r < e.length;) {
|
|
12849
|
-
let t =
|
|
12867
|
+
let t = sr(e, r, 1, n.controlId);
|
|
12850
12868
|
if (t < 0 || t >= e.length) return !1;
|
|
12851
12869
|
let i = e[t];
|
|
12852
12870
|
if (i.controlId !== n.controlId) return !1;
|
|
@@ -12858,7 +12876,7 @@ var oa = "YYYY-MM-DD HH:mm:ss", sa = class {
|
|
|
12858
12876
|
if (n.controlComponent === G.POSTFIX || n.controlComponent === G.POST_TEXT) {
|
|
12859
12877
|
let r = t;
|
|
12860
12878
|
for (; r >= 0;) {
|
|
12861
|
-
let t =
|
|
12879
|
+
let t = sr(e, r, -1, n.controlId);
|
|
12862
12880
|
if (t < 0) return !1;
|
|
12863
12881
|
let i = e[t];
|
|
12864
12882
|
if (i.controlId !== n.controlId) return !1;
|
|
@@ -12896,7 +12914,7 @@ var oa = "YYYY-MM-DD HH:mm:ss", sa = class {
|
|
|
12896
12914
|
getValueRange(e = {}) {
|
|
12897
12915
|
let t = e.elementList || this.getElementList(), { startIndex: n } = e.range || this.getRange(), r = t[n], i = n;
|
|
12898
12916
|
for (; i > 0;) {
|
|
12899
|
-
let e =
|
|
12917
|
+
let e = sr(t, i, -1, r.controlId);
|
|
12900
12918
|
if (e < 0) break;
|
|
12901
12919
|
let n = t[e];
|
|
12902
12920
|
if (n.controlId !== r.controlId || n.controlComponent === G.PREFIX || n.controlComponent === G.PRE_TEXT) {
|
|
@@ -12907,7 +12925,7 @@ var oa = "YYYY-MM-DD HH:mm:ss", sa = class {
|
|
|
12907
12925
|
}
|
|
12908
12926
|
let a = n;
|
|
12909
12927
|
for (; a < t.length;) {
|
|
12910
|
-
let e =
|
|
12928
|
+
let e = sr(t, a, 1, r.controlId);
|
|
12911
12929
|
if (e < 0 || e >= t.length) break;
|
|
12912
12930
|
let n = t[e];
|
|
12913
12931
|
if (n.controlId !== r.controlId || n.controlComponent === G.POSTFIX || n.controlComponent === G.POST_TEXT) break;
|
|
@@ -12929,7 +12947,7 @@ var oa = "YYYY-MM-DD HH:mm:ss", sa = class {
|
|
|
12929
12947
|
if (!r?.controlId) return [];
|
|
12930
12948
|
let i = [r], a = n;
|
|
12931
12949
|
for (; a > 0;) {
|
|
12932
|
-
let e =
|
|
12950
|
+
let e = sr(t, a, -1, r.controlId);
|
|
12933
12951
|
if (e < 0) break;
|
|
12934
12952
|
let n = t[e];
|
|
12935
12953
|
if (n.controlId !== r.controlId) break;
|
|
@@ -12937,7 +12955,7 @@ var oa = "YYYY-MM-DD HH:mm:ss", sa = class {
|
|
|
12937
12955
|
}
|
|
12938
12956
|
let o = n;
|
|
12939
12957
|
for (; o < t.length;) {
|
|
12940
|
-
let e =
|
|
12958
|
+
let e = sr(t, o, 1, r.controlId);
|
|
12941
12959
|
if (e < 0 || e >= t.length) break;
|
|
12942
12960
|
let n = t[e];
|
|
12943
12961
|
if (n.controlId !== r.controlId) break;
|
|
@@ -12964,7 +12982,7 @@ var oa = "YYYY-MM-DD HH:mm:ss", sa = class {
|
|
|
12964
12982
|
initControl() {
|
|
12965
12983
|
let e = this.getElementList()[this.getRange().startIndex];
|
|
12966
12984
|
if (this.activeControl) {
|
|
12967
|
-
(this.activeControl instanceof
|
|
12985
|
+
(this.activeControl instanceof ca || this.activeControl instanceof fa || this.activeControl instanceof _a) && (e.controlComponent === G.POSTFIX ? this.activeControl.destroy() : this.activeControl.awake()), this.preElement?.controlId === e.controlId && (e.controlComponent === G.POSTFIX ? this.emitControlChange(Nt.INACTIVE) : this.preElement?.controlComponent === G.POSTFIX && this.emitControlChange(Nt.ACTIVE));
|
|
12968
12986
|
let t = this.activeControl.getElement();
|
|
12969
12987
|
if (e.controlId === t.controlId) {
|
|
12970
12988
|
this.updateActiveControlValue(), this.preElement = e;
|
|
@@ -12973,17 +12991,17 @@ var oa = "YYYY-MM-DD HH:mm:ss", sa = class {
|
|
|
12973
12991
|
}
|
|
12974
12992
|
if (this.destroyControl(), this.draw.isReadonly()) return;
|
|
12975
12993
|
let t = e.control;
|
|
12976
|
-
if (t.type === W.TEXT) this.activeControl = new
|
|
12994
|
+
if (t.type === W.TEXT) this.activeControl = new la(e, this);
|
|
12977
12995
|
else if (t.type === W.SELECT) {
|
|
12978
|
-
let t = new
|
|
12996
|
+
let t = new ca(e, this);
|
|
12979
12997
|
this.activeControl = t, t.awake();
|
|
12980
|
-
} else if (t.type === W.CHECKBOX) this.activeControl = new
|
|
12981
|
-
else if (t.type === W.RADIO) this.activeControl = new
|
|
12998
|
+
} else if (t.type === W.CHECKBOX) this.activeControl = new Or(e, this);
|
|
12999
|
+
else if (t.type === W.RADIO) this.activeControl = new kr(e, this);
|
|
12982
13000
|
else if (t.type === W.DATE) {
|
|
12983
|
-
let t = new
|
|
13001
|
+
let t = new fa(e, this);
|
|
12984
13002
|
this.activeControl = t, t.awake();
|
|
12985
13003
|
} else if (t.type === W.NUMBER) {
|
|
12986
|
-
let t = new
|
|
13004
|
+
let t = new _a(e, this);
|
|
12987
13005
|
this.activeControl = t, t.awake();
|
|
12988
13006
|
}
|
|
12989
13007
|
this.updateActiveControlValue(), this.preElement = e, e.controlComponent !== G.POSTFIX && this.emitControlChange(Nt.ACTIVE);
|
|
@@ -12991,7 +13009,7 @@ var oa = "YYYY-MM-DD HH:mm:ss", sa = class {
|
|
|
12991
13009
|
destroyControl(e = {}) {
|
|
12992
13010
|
if (!this.activeControl) return;
|
|
12993
13011
|
let { isEmitEvent: t = !0 } = e;
|
|
12994
|
-
(this.activeControl instanceof
|
|
13012
|
+
(this.activeControl instanceof ca || this.activeControl instanceof fa || this.activeControl instanceof _a) && this.activeControl.destroy(), t && this.preElement?.controlComponent !== G.POSTFIX && this.emitControlChange(Nt.INACTIVE), this.preElement = null, this.activeControl = null, this.activeControlValue = [];
|
|
12995
13013
|
}
|
|
12996
13014
|
repaintControl(e = {}) {
|
|
12997
13015
|
let { curIndex: t, isCompute: n = !0, isSubmitHistory: r = !0, isSetCursor: i = !0 } = e;
|
|
@@ -13024,7 +13042,7 @@ var oa = "YYYY-MM-DD HH:mm:ss", sa = class {
|
|
|
13024
13042
|
reAwakeControl() {
|
|
13025
13043
|
if (!this.activeControl) return;
|
|
13026
13044
|
let e = this.getElementList()[this.getRange().startIndex];
|
|
13027
|
-
this.activeControl.setElement(e), (this.activeControl instanceof
|
|
13045
|
+
this.activeControl.setElement(e), (this.activeControl instanceof fa || this.activeControl instanceof ca || this.activeControl instanceof _a) && this.activeControl.getIsPopup() && (this.activeControl.destroy(), this.activeControl.awake());
|
|
13028
13046
|
}
|
|
13029
13047
|
selectValue() {
|
|
13030
13048
|
let e = this.getElementList(), { startIndex: t } = this.getRange(), n = e[t];
|
|
@@ -13058,7 +13076,7 @@ var oa = "YYYY-MM-DD HH:mm:ss", sa = class {
|
|
|
13058
13076
|
e.isTable ? (a = a[t].trList[n].tdList[r].value, s = a[i]) : s = a[t];
|
|
13059
13077
|
let l = this.draw.getTraceParticle();
|
|
13060
13078
|
if (!this.draw.isDesignMode() && (s.hide || s.control?.hide || s.area?.hide || l.isTraceHidden(s))) {
|
|
13061
|
-
let e =
|
|
13079
|
+
let e = or(a, c, o.BEFORE, (e) => l.isTraceHidden(e));
|
|
13062
13080
|
return {
|
|
13063
13081
|
newIndex: e,
|
|
13064
13082
|
newElement: a[e]
|
|
@@ -13135,7 +13153,7 @@ var oa = "YYYY-MM-DD HH:mm:ss", sa = class {
|
|
|
13135
13153
|
let i = -1, a = -1, o = e;
|
|
13136
13154
|
if (r.controlComponent === G.PREFIX || r.controlComponent === G.PRE_TEXT) i = this.getControlStartIndex(n, o, r.controlId) - 1;
|
|
13137
13155
|
else for (; o > 0;) {
|
|
13138
|
-
let e =
|
|
13156
|
+
let e = sr(n, o, -1, r.controlId);
|
|
13139
13157
|
if (e < 0) break;
|
|
13140
13158
|
let t = n[e];
|
|
13141
13159
|
if (t.controlId !== r.controlId) {
|
|
@@ -13156,7 +13174,7 @@ var oa = "YYYY-MM-DD HH:mm:ss", sa = class {
|
|
|
13156
13174
|
a = this.getControlEndIndex(n, s, r.controlId);
|
|
13157
13175
|
break;
|
|
13158
13176
|
}
|
|
13159
|
-
let t =
|
|
13177
|
+
let t = sr(n, s, 1, r.controlId);
|
|
13160
13178
|
if (t >= n.length) {
|
|
13161
13179
|
a = t - 1;
|
|
13162
13180
|
break;
|
|
@@ -13209,7 +13227,7 @@ var oa = "YYYY-MM-DD HH:mm:ss", sa = class {
|
|
|
13209
13227
|
};
|
|
13210
13228
|
let a = r;
|
|
13211
13229
|
for (; a > 0;) {
|
|
13212
|
-
let t =
|
|
13230
|
+
let t = sr(n, a, -1, i.controlId);
|
|
13213
13231
|
if (t < 0) break;
|
|
13214
13232
|
let r = n[t];
|
|
13215
13233
|
if (r.controlId !== i.controlId) break;
|
|
@@ -13220,7 +13238,7 @@ var oa = "YYYY-MM-DD HH:mm:ss", sa = class {
|
|
|
13220
13238
|
}
|
|
13221
13239
|
let o = r;
|
|
13222
13240
|
for (; o < n.length;) {
|
|
13223
|
-
let t =
|
|
13241
|
+
let t = sr(n, o, 1, i.controlId);
|
|
13224
13242
|
if (t < 0 || t >= n.length) break;
|
|
13225
13243
|
let r = n[t];
|
|
13226
13244
|
if (r.controlId !== i.controlId) break;
|
|
@@ -13364,26 +13382,26 @@ var oa = "YYYY-MM-DD HH:mm:ss", sa = class {
|
|
|
13364
13382
|
isHandleFirstElement: !1,
|
|
13365
13383
|
editorOptions: this.options
|
|
13366
13384
|
});
|
|
13367
|
-
let t = new
|
|
13385
|
+
let t = new la(o, this);
|
|
13368
13386
|
this.activeControl = t, e.length ? t.setValue(e, g, _) : t.clearValue(g, _);
|
|
13369
13387
|
} else if (d === W.SELECT) {
|
|
13370
13388
|
if (Array.isArray(c)) continue;
|
|
13371
|
-
let e = new
|
|
13389
|
+
let e = new ca(o, this);
|
|
13372
13390
|
this.activeControl = e, c ? e.setSelect(c, g, _) : e.clearSelect(g, _);
|
|
13373
13391
|
} else if (d === W.CHECKBOX) {
|
|
13374
13392
|
if (Array.isArray(c)) continue;
|
|
13375
|
-
let e = new
|
|
13393
|
+
let e = new Or(o, this);
|
|
13376
13394
|
this.activeControl = e;
|
|
13377
13395
|
let t = c ? c.split(",") : [];
|
|
13378
13396
|
e.setSelect(t, g, _);
|
|
13379
13397
|
} else if (d === W.RADIO) {
|
|
13380
13398
|
if (Array.isArray(c)) continue;
|
|
13381
|
-
let e = new
|
|
13399
|
+
let e = new kr(o, this);
|
|
13382
13400
|
this.activeControl = e;
|
|
13383
13401
|
let t = c ? [c] : [];
|
|
13384
13402
|
e.setSelect(t, g, _);
|
|
13385
13403
|
} else if (d === W.DATE) {
|
|
13386
|
-
let e = new
|
|
13404
|
+
let e = new fa(o, this);
|
|
13387
13405
|
this.activeControl = e, z(c) ? (c.length && Y(c, {
|
|
13388
13406
|
isHandleFirstElement: !1,
|
|
13389
13407
|
editorOptions: this.options
|
|
@@ -13394,7 +13412,7 @@ var oa = "YYYY-MM-DD HH:mm:ss", sa = class {
|
|
|
13394
13412
|
isHandleFirstElement: !1,
|
|
13395
13413
|
editorOptions: this.options
|
|
13396
13414
|
});
|
|
13397
|
-
let t = new
|
|
13415
|
+
let t = new _a(o, this);
|
|
13398
13416
|
this.activeControl = t, e.length ? t.setValue(e, g, _) : t.clearValue(g, _);
|
|
13399
13417
|
}
|
|
13400
13418
|
this.emitControlContentChange({ context: g }), this.activeControl = null;
|
|
@@ -13739,14 +13757,14 @@ var oa = "YYYY-MM-DD HH:mm:ss", sa = class {
|
|
|
13739
13757
|
(function(e) {
|
|
13740
13758
|
e.IDENT = "IDENT", e.STRING = "STRING", e.NUMBER = "NUMBER", e.BOOLEAN = "BOOLEAN", e.NULL = "NULL", e.SELF = "SELF", e.OP = "OP", e.LPAREN = "LPAREN", e.RPAREN = "RPAREN", e.LBRACKET = "LBRACKET", e.RBRACKET = "RBRACKET", e.COMMA = "COMMA";
|
|
13741
13759
|
})($ ||= {});
|
|
13742
|
-
var
|
|
13760
|
+
var ya = [
|
|
13743
13761
|
"==",
|
|
13744
13762
|
"!=",
|
|
13745
13763
|
">=",
|
|
13746
13764
|
"<=",
|
|
13747
13765
|
"&&",
|
|
13748
13766
|
"||"
|
|
13749
|
-
],
|
|
13767
|
+
], ba = [
|
|
13750
13768
|
">",
|
|
13751
13769
|
"<",
|
|
13752
13770
|
"!",
|
|
@@ -13754,14 +13772,14 @@ var ha = [
|
|
|
13754
13772
|
"*",
|
|
13755
13773
|
"/",
|
|
13756
13774
|
"%"
|
|
13757
|
-
],
|
|
13775
|
+
], xa = {
|
|
13758
13776
|
"(": $.LPAREN,
|
|
13759
13777
|
")": $.RPAREN,
|
|
13760
13778
|
"[": $.LBRACKET,
|
|
13761
13779
|
"]": $.RBRACKET,
|
|
13762
13780
|
",": $.COMMA
|
|
13763
|
-
},
|
|
13764
|
-
function
|
|
13781
|
+
}, Sa = /[A-Za-z_$\u4e00-\u9fa5]/, Ca = /[A-Za-z0-9_$\u4e00-\u9fa5]/;
|
|
13782
|
+
function wa(e) {
|
|
13765
13783
|
let t = [], n = 0, r = () => {
|
|
13766
13784
|
let e = t[t.length - 1];
|
|
13767
13785
|
return !e || e.type === $.OP || e.type === $.LPAREN || e.type === $.LBRACKET || e.type === $.COMMA;
|
|
@@ -13772,7 +13790,7 @@ function ba(e) {
|
|
|
13772
13790
|
n++;
|
|
13773
13791
|
continue;
|
|
13774
13792
|
}
|
|
13775
|
-
let a =
|
|
13793
|
+
let a = xa[i];
|
|
13776
13794
|
if (a) {
|
|
13777
13795
|
t.push({
|
|
13778
13796
|
type: a,
|
|
@@ -13815,7 +13833,7 @@ function ba(e) {
|
|
|
13815
13833
|
}
|
|
13816
13834
|
if (i === "@") {
|
|
13817
13835
|
let r = n + 1;
|
|
13818
|
-
for (; r < e.length &&
|
|
13836
|
+
for (; r < e.length && Ca.test(e[r]);) r++;
|
|
13819
13837
|
let i = e.slice(n + 1, r);
|
|
13820
13838
|
if (i !== "self") throw Error(`Unknown reserved word "@${i}"; only @self allowed`);
|
|
13821
13839
|
t.push({
|
|
@@ -13825,14 +13843,14 @@ function ba(e) {
|
|
|
13825
13843
|
continue;
|
|
13826
13844
|
}
|
|
13827
13845
|
let s = e.slice(n, n + 2);
|
|
13828
|
-
if (
|
|
13846
|
+
if (ya.includes(s)) {
|
|
13829
13847
|
t.push({
|
|
13830
13848
|
type: $.OP,
|
|
13831
13849
|
value: s
|
|
13832
13850
|
}), n += 2;
|
|
13833
13851
|
continue;
|
|
13834
13852
|
}
|
|
13835
|
-
if (
|
|
13853
|
+
if (ba.includes(i)) {
|
|
13836
13854
|
t.push({
|
|
13837
13855
|
type: $.OP,
|
|
13838
13856
|
value: i
|
|
@@ -13840,9 +13858,9 @@ function ba(e) {
|
|
|
13840
13858
|
continue;
|
|
13841
13859
|
}
|
|
13842
13860
|
if (i === "=" || i === "&" || i === "|") throw Error(`Invalid operator "${i}"; use == / && / ||`);
|
|
13843
|
-
if (
|
|
13861
|
+
if (Sa.test(i)) {
|
|
13844
13862
|
let r = n;
|
|
13845
|
-
for (; r < e.length &&
|
|
13863
|
+
for (; r < e.length && Ca.test(e[r]);) r++;
|
|
13846
13864
|
let i = e.slice(n, r);
|
|
13847
13865
|
i === "true" || i === "false" ? t.push({
|
|
13848
13866
|
type: $.BOOLEAN,
|
|
@@ -13862,19 +13880,19 @@ function ba(e) {
|
|
|
13862
13880
|
}
|
|
13863
13881
|
//#endregion
|
|
13864
13882
|
//#region src/editor/core/cascade/expression/parser.ts
|
|
13865
|
-
var
|
|
13883
|
+
var Ta = [
|
|
13866
13884
|
"==",
|
|
13867
13885
|
"!=",
|
|
13868
13886
|
">",
|
|
13869
13887
|
">=",
|
|
13870
13888
|
"<",
|
|
13871
13889
|
"<="
|
|
13872
|
-
],
|
|
13890
|
+
], Ea = ["+", "-"], Da = [
|
|
13873
13891
|
"*",
|
|
13874
13892
|
"/",
|
|
13875
13893
|
"%"
|
|
13876
13894
|
];
|
|
13877
|
-
function
|
|
13895
|
+
function Oa(e) {
|
|
13878
13896
|
let t = 0, n = () => e[t], r = () => e[t++], i = (e, t) => {
|
|
13879
13897
|
let n = r();
|
|
13880
13898
|
if (!n || n.type !== e || t && n.value !== t) throw Error(`Expression syntax error: expected ${t || e}`);
|
|
@@ -13902,7 +13920,7 @@ function wa(e) {
|
|
|
13902
13920
|
argument: c()
|
|
13903
13921
|
}) : l(), l = () => {
|
|
13904
13922
|
let e = u(), t = n();
|
|
13905
|
-
return t?.type === $.OP &&
|
|
13923
|
+
return t?.type === $.OP && Ta.includes(t.value) || t?.type === $.IDENT && t.value === "in" ? (r(), {
|
|
13906
13924
|
type: "compare",
|
|
13907
13925
|
op: t.value,
|
|
13908
13926
|
left: e,
|
|
@@ -13910,7 +13928,7 @@ function wa(e) {
|
|
|
13910
13928
|
}) : e;
|
|
13911
13929
|
}, u = () => {
|
|
13912
13930
|
let e = d();
|
|
13913
|
-
for (; n()?.type === $.OP &&
|
|
13931
|
+
for (; n()?.type === $.OP && Ea.includes(n().value);) e = {
|
|
13914
13932
|
type: "arithmetic",
|
|
13915
13933
|
op: r().value,
|
|
13916
13934
|
left: e,
|
|
@@ -13919,7 +13937,7 @@ function wa(e) {
|
|
|
13919
13937
|
return e;
|
|
13920
13938
|
}, d = () => {
|
|
13921
13939
|
let e = f();
|
|
13922
|
-
for (; n()?.type === $.OP &&
|
|
13940
|
+
for (; n()?.type === $.OP && Da.includes(n().value);) e = {
|
|
13923
13941
|
type: "arithmetic",
|
|
13924
13942
|
op: r().value,
|
|
13925
13943
|
left: e,
|
|
@@ -13998,14 +14016,14 @@ function wa(e) {
|
|
|
13998
14016
|
}
|
|
13999
14017
|
//#endregion
|
|
14000
14018
|
//#region src/editor/core/cascade/expression/evaluator.ts
|
|
14001
|
-
var
|
|
14002
|
-
function
|
|
14019
|
+
var ka = /^\d{4}-\d{2}-\d{2}/;
|
|
14020
|
+
function Aa(e) {
|
|
14003
14021
|
return e.codes ? e.codes.length === 0 : e.code === void 0 ? !e.text || !e.text.trim() : !e.code;
|
|
14004
14022
|
}
|
|
14005
|
-
function
|
|
14006
|
-
return e.kind === "resolved" ? !
|
|
14023
|
+
function ja(e) {
|
|
14024
|
+
return e.kind === "resolved" ? !Aa(e.value) : !!e.value;
|
|
14007
14025
|
}
|
|
14008
|
-
function
|
|
14026
|
+
function Ma(e) {
|
|
14009
14027
|
if (e.kind === "plain") {
|
|
14010
14028
|
let t = e.value;
|
|
14011
14029
|
return t == null ? null : typeof t == "number" || typeof t == "string" ? t : typeof t == "boolean" ? t ? "true" : "false" : String(t);
|
|
@@ -14013,36 +14031,36 @@ function Oa(e) {
|
|
|
14013
14031
|
let t = e.value;
|
|
14014
14032
|
return t.codes ? t.codes.join(",") : t.code === void 0 ? t.text ?? null : t.code;
|
|
14015
14033
|
}
|
|
14016
|
-
function
|
|
14034
|
+
function Na(e) {
|
|
14017
14035
|
if (e === null) return null;
|
|
14018
14036
|
if (e === "today") {
|
|
14019
14037
|
let e = /* @__PURE__ */ new Date();
|
|
14020
14038
|
return new Date(e.getFullYear(), e.getMonth(), e.getDate()).getTime();
|
|
14021
14039
|
}
|
|
14022
|
-
if (typeof e == "string" &&
|
|
14040
|
+
if (typeof e == "string" && ka.test(e)) {
|
|
14023
14041
|
let t = new Date(e).getTime();
|
|
14024
14042
|
return Number.isNaN(t) ? null : t;
|
|
14025
14043
|
}
|
|
14026
14044
|
return null;
|
|
14027
14045
|
}
|
|
14028
|
-
function
|
|
14046
|
+
function Pa(e, t, n) {
|
|
14029
14047
|
if (e === "in") {
|
|
14030
14048
|
let e = n.kind === "plain" ? n.value : null;
|
|
14031
14049
|
if (!Array.isArray(e)) return !1;
|
|
14032
14050
|
if (t.kind === "resolved" && t.value.codes) return t.value.codes.some((t) => e.some((e) => String(e) === t));
|
|
14033
|
-
let r =
|
|
14051
|
+
let r = Ma(t);
|
|
14034
14052
|
return e.some((e) => String(e) === String(r));
|
|
14035
14053
|
}
|
|
14036
|
-
let r =
|
|
14054
|
+
let r = Ma(t), i = Ma(n);
|
|
14037
14055
|
if (e === "==") return String(r) === String(i);
|
|
14038
14056
|
if (e === "!=") return String(r) !== String(i);
|
|
14039
14057
|
if (r === null || i === null) return !1;
|
|
14040
|
-
if (t.kind === "resolved" && t.value.isDate || i === "today" || typeof i == "string" &&
|
|
14041
|
-
let t =
|
|
14042
|
-
return t === null || n === null ? !1 :
|
|
14058
|
+
if (t.kind === "resolved" && t.value.isDate || i === "today" || typeof i == "string" && ka.test(i)) {
|
|
14059
|
+
let t = Na(r), n = typeof i == "number" && Number.isFinite(i) ? i : Na(i);
|
|
14060
|
+
return t === null || n === null ? !1 : Fa(e, t, n);
|
|
14043
14061
|
}
|
|
14044
14062
|
let a = Number(r), o = Number(i), s = String(r).trim() !== "" && Number.isFinite(a), c = String(i).trim() !== "" && Number.isFinite(o);
|
|
14045
|
-
if (s && c) return
|
|
14063
|
+
if (s && c) return Fa(e, a, o);
|
|
14046
14064
|
if (s || c) return !1;
|
|
14047
14065
|
let l = String(r), u = String(i);
|
|
14048
14066
|
switch (e) {
|
|
@@ -14053,7 +14071,7 @@ function Aa(e, t, n) {
|
|
|
14053
14071
|
default: return !1;
|
|
14054
14072
|
}
|
|
14055
14073
|
}
|
|
14056
|
-
function
|
|
14074
|
+
function Fa(e, t, n) {
|
|
14057
14075
|
switch (e) {
|
|
14058
14076
|
case ">": return t > n;
|
|
14059
14077
|
case ">=": return t >= n;
|
|
@@ -14062,7 +14080,7 @@ function ja(e, t, n) {
|
|
|
14062
14080
|
default: return !1;
|
|
14063
14081
|
}
|
|
14064
14082
|
}
|
|
14065
|
-
function
|
|
14083
|
+
function Ia(e, t, n) {
|
|
14066
14084
|
if (t === null || n === null) return null;
|
|
14067
14085
|
if (e === "+") {
|
|
14068
14086
|
let e = String(t), r = String(n), i = Number(t), a = Number(n);
|
|
@@ -14078,21 +14096,21 @@ function Ma(e, t, n) {
|
|
|
14078
14096
|
default: return null;
|
|
14079
14097
|
}
|
|
14080
14098
|
}
|
|
14081
|
-
function
|
|
14099
|
+
function La(e, t) {
|
|
14082
14100
|
let n = (e) => {
|
|
14083
14101
|
let n = t[e];
|
|
14084
14102
|
if (n?.kind === "resolved") return n.value;
|
|
14085
|
-
let r = n ?
|
|
14103
|
+
let r = n ? Ma(n) : null;
|
|
14086
14104
|
return { text: r === null ? null : String(r) };
|
|
14087
14105
|
};
|
|
14088
14106
|
switch (e) {
|
|
14089
14107
|
case "empty": return {
|
|
14090
14108
|
kind: "plain",
|
|
14091
|
-
value:
|
|
14109
|
+
value: Aa(n(0))
|
|
14092
14110
|
};
|
|
14093
14111
|
case "notEmpty": return {
|
|
14094
14112
|
kind: "plain",
|
|
14095
|
-
value: !
|
|
14113
|
+
value: !Aa(n(0))
|
|
14096
14114
|
};
|
|
14097
14115
|
case "len": return {
|
|
14098
14116
|
kind: "plain",
|
|
@@ -14103,7 +14121,7 @@ function Na(e, t) {
|
|
|
14103
14121
|
value: n(0).codes?.length ?? 0
|
|
14104
14122
|
};
|
|
14105
14123
|
case "contains": {
|
|
14106
|
-
let e = n(0), r =
|
|
14124
|
+
let e = n(0), r = Ma(t[1]);
|
|
14107
14125
|
return r === null ? {
|
|
14108
14126
|
kind: "plain",
|
|
14109
14127
|
value: !1
|
|
@@ -14116,7 +14134,7 @@ function Na(e, t) {
|
|
|
14116
14134
|
};
|
|
14117
14135
|
}
|
|
14118
14136
|
case "round": {
|
|
14119
|
-
let e =
|
|
14137
|
+
let e = Ma(t[0]);
|
|
14120
14138
|
if (e === null) return {
|
|
14121
14139
|
kind: "plain",
|
|
14122
14140
|
value: null
|
|
@@ -14126,7 +14144,7 @@ function Na(e, t) {
|
|
|
14126
14144
|
kind: "plain",
|
|
14127
14145
|
value: null
|
|
14128
14146
|
};
|
|
14129
|
-
let r = t[1] ? Number(
|
|
14147
|
+
let r = t[1] ? Number(Ma(t[1])) : 0, i = 10 ** (Number.isFinite(r) ? r : 0);
|
|
14130
14148
|
return {
|
|
14131
14149
|
kind: "plain",
|
|
14132
14150
|
value: Math.round(n * i) / i
|
|
@@ -14135,7 +14153,7 @@ function Na(e, t) {
|
|
|
14135
14153
|
case "floor":
|
|
14136
14154
|
case "ceil":
|
|
14137
14155
|
case "abs": {
|
|
14138
|
-
let n =
|
|
14156
|
+
let n = Ma(t[0]);
|
|
14139
14157
|
if (n === null) return {
|
|
14140
14158
|
kind: "plain",
|
|
14141
14159
|
value: null
|
|
@@ -14151,7 +14169,7 @@ function Na(e, t) {
|
|
|
14151
14169
|
}
|
|
14152
14170
|
case "min":
|
|
14153
14171
|
case "max": {
|
|
14154
|
-
let n = t.map((e) => Number(
|
|
14172
|
+
let n = t.map((e) => Number(Ma(e))).filter((e) => Number.isFinite(e));
|
|
14155
14173
|
return n.length ? {
|
|
14156
14174
|
kind: "plain",
|
|
14157
14175
|
value: e === "min" ? Math.min(...n) : Math.max(...n)
|
|
@@ -14161,7 +14179,7 @@ function Na(e, t) {
|
|
|
14161
14179
|
};
|
|
14162
14180
|
}
|
|
14163
14181
|
case "power": {
|
|
14164
|
-
let e =
|
|
14182
|
+
let e = Ma(t[0]), n = t[1] ? Ma(t[1]) : null;
|
|
14165
14183
|
if (e === null || n === null) return {
|
|
14166
14184
|
kind: "plain",
|
|
14167
14185
|
value: null
|
|
@@ -14176,7 +14194,7 @@ function Na(e, t) {
|
|
|
14176
14194
|
};
|
|
14177
14195
|
}
|
|
14178
14196
|
case "sqrt": {
|
|
14179
|
-
let e =
|
|
14197
|
+
let e = Ma(t[0]);
|
|
14180
14198
|
if (e === null) return {
|
|
14181
14199
|
kind: "plain",
|
|
14182
14200
|
value: null
|
|
@@ -14195,12 +14213,12 @@ function Na(e, t) {
|
|
|
14195
14213
|
value: Date.now()
|
|
14196
14214
|
};
|
|
14197
14215
|
case "datediff": {
|
|
14198
|
-
let e =
|
|
14216
|
+
let e = Na(Ma(t[0])), n = Na(Ma(t[1]));
|
|
14199
14217
|
if (e === null || n === null) return {
|
|
14200
14218
|
kind: "plain",
|
|
14201
14219
|
value: null
|
|
14202
14220
|
};
|
|
14203
|
-
let r = t[2] ? String(
|
|
14221
|
+
let r = t[2] ? String(Ma(t[2])) : "d", i = r === "h" ? 36e5 : r === "m" ? 6e4 : r === "s" ? 1e3 : 864e5;
|
|
14204
14222
|
return {
|
|
14205
14223
|
kind: "plain",
|
|
14206
14224
|
value: (e - n) / i
|
|
@@ -14209,11 +14227,11 @@ function Na(e, t) {
|
|
|
14209
14227
|
default: throw Error(`Unknown function: ${e}`);
|
|
14210
14228
|
}
|
|
14211
14229
|
}
|
|
14212
|
-
function
|
|
14230
|
+
function Ra(e, t) {
|
|
14213
14231
|
switch (e.type) {
|
|
14214
14232
|
case "literal": return Array.isArray(e.value) ? {
|
|
14215
14233
|
kind: "plain",
|
|
14216
|
-
value: e.value.map((e) =>
|
|
14234
|
+
value: e.value.map((e) => Ma(Ra(e, t)))
|
|
14217
14235
|
} : {
|
|
14218
14236
|
kind: "plain",
|
|
14219
14237
|
value: e.value
|
|
@@ -14224,51 +14242,51 @@ function Pa(e, t) {
|
|
|
14224
14242
|
};
|
|
14225
14243
|
case "logical": return e.op === "&&" ? {
|
|
14226
14244
|
kind: "plain",
|
|
14227
|
-
value:
|
|
14245
|
+
value: ja(Ra(e.left, t)) && ja(Ra(e.right, t))
|
|
14228
14246
|
} : {
|
|
14229
14247
|
kind: "plain",
|
|
14230
|
-
value:
|
|
14248
|
+
value: ja(Ra(e.left, t)) || ja(Ra(e.right, t))
|
|
14231
14249
|
};
|
|
14232
14250
|
case "not": return {
|
|
14233
14251
|
kind: "plain",
|
|
14234
|
-
value: !
|
|
14252
|
+
value: !ja(Ra(e.argument, t))
|
|
14235
14253
|
};
|
|
14236
14254
|
case "compare": return {
|
|
14237
14255
|
kind: "plain",
|
|
14238
|
-
value:
|
|
14256
|
+
value: Pa(e.op, Ra(e.left, t), Ra(e.right, t))
|
|
14239
14257
|
};
|
|
14240
14258
|
case "arithmetic": return {
|
|
14241
14259
|
kind: "plain",
|
|
14242
|
-
value:
|
|
14260
|
+
value: Ia(e.op, Ma(Ra(e.left, t)), Ma(Ra(e.right, t)))
|
|
14243
14261
|
};
|
|
14244
14262
|
case "call":
|
|
14245
14263
|
if (e.name === "if") {
|
|
14246
|
-
let n = e.args[0], r = n ?
|
|
14247
|
-
return i ?
|
|
14264
|
+
let n = e.args[0], r = n ? ja(Ra(n, t)) : !1, i = e.args[r ? 1 : 2];
|
|
14265
|
+
return i ? Ra(i, t) : {
|
|
14248
14266
|
kind: "plain",
|
|
14249
14267
|
value: null
|
|
14250
14268
|
};
|
|
14251
14269
|
}
|
|
14252
|
-
return
|
|
14270
|
+
return La(e.name, e.args.map((e) => Ra(e, t)));
|
|
14253
14271
|
}
|
|
14254
14272
|
}
|
|
14255
|
-
function
|
|
14256
|
-
return
|
|
14273
|
+
function za(e, t) {
|
|
14274
|
+
return ja(Ra(e, t));
|
|
14257
14275
|
}
|
|
14258
|
-
function
|
|
14259
|
-
return
|
|
14276
|
+
function Ba(e, t) {
|
|
14277
|
+
return Ma(Ra(e, t));
|
|
14260
14278
|
}
|
|
14261
14279
|
//#endregion
|
|
14262
14280
|
//#region src/editor/core/cascade/CascadeManager.ts
|
|
14263
|
-
function
|
|
14281
|
+
function Va(e) {
|
|
14264
14282
|
return typeof e == "string" ? e : String(Number.isInteger(e) ? e : parseFloat(e.toPrecision(12)));
|
|
14265
14283
|
}
|
|
14266
|
-
var
|
|
14284
|
+
var Ha = 10, Ua = [
|
|
14267
14285
|
"hide",
|
|
14268
14286
|
"required",
|
|
14269
14287
|
"disabled",
|
|
14270
14288
|
"deletable"
|
|
14271
|
-
],
|
|
14289
|
+
], Wa = class {
|
|
14272
14290
|
draw;
|
|
14273
14291
|
control;
|
|
14274
14292
|
eventBus;
|
|
@@ -14313,7 +14331,7 @@ var Ra = 10, za = [
|
|
|
14313
14331
|
if (r.add(a), a.cascade?.length) for (let t of a.cascade) {
|
|
14314
14332
|
let n = null;
|
|
14315
14333
|
try {
|
|
14316
|
-
n = wa(
|
|
14334
|
+
n = Oa(wa(t.expression));
|
|
14317
14335
|
} catch (e) {
|
|
14318
14336
|
console.warn(`[cascade] Parse error: ${t.expression}`, e);
|
|
14319
14337
|
}
|
|
@@ -14326,7 +14344,7 @@ var Ra = 10, za = [
|
|
|
14326
14344
|
if (a.compute && o.controlId) {
|
|
14327
14345
|
let e = null;
|
|
14328
14346
|
try {
|
|
14329
|
-
e = wa(
|
|
14347
|
+
e = Oa(wa(a.compute));
|
|
14330
14348
|
} catch (e) {
|
|
14331
14349
|
console.warn(`[cascade] Compute parse error: ${a.compute}`, e);
|
|
14332
14350
|
}
|
|
@@ -14446,10 +14464,10 @@ var Ra = 10, za = [
|
|
|
14446
14464
|
let e = n.control;
|
|
14447
14465
|
if (!e) continue;
|
|
14448
14466
|
let i = !t.has(e);
|
|
14449
|
-
for (let t of
|
|
14467
|
+
for (let t of Ua) t in r && (this.recordControlBaseline(n, t), i && e[t] !== r[t] && (e[t] = r[t], o = !0));
|
|
14450
14468
|
t.add(e);
|
|
14451
14469
|
}
|
|
14452
|
-
} else for (let t of e) for (let e of
|
|
14470
|
+
} else for (let t of e) for (let e of Ua) o = this.restoreControlBaseline(t, e) || o;
|
|
14453
14471
|
} else {
|
|
14454
14472
|
let n = this.findTitleRangeElements(e.conceptId || "");
|
|
14455
14473
|
for (let e of n) o = t && r && "hide" in r ? this.writeWithBaseline(e, "elementHide", () => e.hide, (t) => {
|
|
@@ -14464,7 +14482,7 @@ var Ra = 10, za = [
|
|
|
14464
14482
|
if (!n.ast) continue;
|
|
14465
14483
|
let e = null;
|
|
14466
14484
|
try {
|
|
14467
|
-
e =
|
|
14485
|
+
e = Ba(n.ast, {
|
|
14468
14486
|
resolve: this.resolveIdentifier,
|
|
14469
14487
|
resolveSelf: () => this.resolveByControlId(n.controlId)
|
|
14470
14488
|
});
|
|
@@ -14472,7 +14490,7 @@ var Ra = 10, za = [
|
|
|
14472
14490
|
console.warn(`[cascade] Compute eval error: ${n.expression}`, e);
|
|
14473
14491
|
continue;
|
|
14474
14492
|
}
|
|
14475
|
-
let r = e === null ? null :
|
|
14493
|
+
let r = e === null ? null : Va(e);
|
|
14476
14494
|
(this.control.getValueById({ id: n.controlId })[0]?.value ?? null) !== r && t.push({
|
|
14477
14495
|
id: n.controlId,
|
|
14478
14496
|
value: r
|
|
@@ -14490,7 +14508,7 @@ var Ra = 10, za = [
|
|
|
14490
14508
|
let e = 0;
|
|
14491
14509
|
do
|
|
14492
14510
|
this.needsRerun = !1, this.executePass(), e++;
|
|
14493
|
-
while (this.needsRerun && e <
|
|
14511
|
+
while (this.needsRerun && e < Ha);
|
|
14494
14512
|
this.needsRerun && console.warn("[cascade] Max iterations exceeded, possible compute loop");
|
|
14495
14513
|
} finally {
|
|
14496
14514
|
this.isExecuting = !1, this.needsRerun = !1;
|
|
@@ -14505,7 +14523,7 @@ var Ra = 10, za = [
|
|
|
14505
14523
|
for (let { rule: t, ast: i, hostControlId: a } of e) {
|
|
14506
14524
|
let e = !1;
|
|
14507
14525
|
if (i) try {
|
|
14508
|
-
e =
|
|
14526
|
+
e = za(i, {
|
|
14509
14527
|
resolve: this.resolveIdentifier,
|
|
14510
14528
|
resolveSelf: () => this.resolveByControlId(a)
|
|
14511
14529
|
});
|
|
@@ -14525,7 +14543,7 @@ var Ra = 10, za = [
|
|
|
14525
14543
|
});
|
|
14526
14544
|
}
|
|
14527
14545
|
}
|
|
14528
|
-
},
|
|
14546
|
+
}, Ga = class {
|
|
14529
14547
|
draw;
|
|
14530
14548
|
control;
|
|
14531
14549
|
i18n;
|
|
@@ -14628,7 +14646,7 @@ var Ra = 10, za = [
|
|
|
14628
14646
|
}
|
|
14629
14647
|
return this.lastErrorBackgroundColor = t, this.highlightedControlIds.size && this.applyHighlight(t), n;
|
|
14630
14648
|
}
|
|
14631
|
-
},
|
|
14649
|
+
}, Ka = class {
|
|
14632
14650
|
draw;
|
|
14633
14651
|
options;
|
|
14634
14652
|
constructor(e) {
|
|
@@ -14654,7 +14672,7 @@ var Ra = 10, za = [
|
|
|
14654
14672
|
let _ = Math.round(n + o * m), v = Math.round(a - h.height + s), y = h.width - o * 2 * m, b = h.height;
|
|
14655
14673
|
t.save(), t.beginPath(), t.translate(.5, .5), g?.value ? (t.fillStyle = u, t.fillRect(_, v, y, b), t.beginPath(), t.lineWidth = s, t.strokeStyle = d, t.rect(_, v, y, b), t.stroke(), t.beginPath(), t.strokeStyle = f, t.lineWidth = s * 2 * m, t.moveTo(_ + 2 * m, v + b / 2), t.lineTo(_ + y / 2, v + b - 3 * m), t.lineTo(_ + y - 2 * m, v + 3 * m), t.stroke()) : (t.fillStyle = c, t.fillRect(_, v, y, b), t.beginPath(), t.lineWidth = s, t.strokeStyle = l, t.rect(_, v, y, b), t.stroke()), t.closePath(), t.restore();
|
|
14656
14674
|
}
|
|
14657
|
-
},
|
|
14675
|
+
}, qa = class {
|
|
14658
14676
|
draw;
|
|
14659
14677
|
options;
|
|
14660
14678
|
constructor(e) {
|
|
@@ -14683,15 +14701,15 @@ var Ra = 10, za = [
|
|
|
14683
14701
|
};
|
|
14684
14702
|
//#endregion
|
|
14685
14703
|
//#region src/editor/utils/table.ts
|
|
14686
|
-
function
|
|
14704
|
+
function Ja(e) {
|
|
14687
14705
|
return e.reduce((e, t) => e + t.width, 0);
|
|
14688
14706
|
}
|
|
14689
|
-
function
|
|
14690
|
-
let r =
|
|
14707
|
+
function Ya(e, t, n) {
|
|
14708
|
+
let r = Ja(e);
|
|
14691
14709
|
for (; r > t;) {
|
|
14692
14710
|
let i = e.filter((e) => e.width > n);
|
|
14693
14711
|
if (!i.length) return;
|
|
14694
|
-
let a =
|
|
14712
|
+
let a = Ja(i), o = t - (r - a);
|
|
14695
14713
|
if (o <= 0) {
|
|
14696
14714
|
i.forEach((e) => e.width = n);
|
|
14697
14715
|
return;
|
|
@@ -14700,87 +14718,87 @@ function Ga(e, t, n) {
|
|
|
14700
14718
|
i.forEach((e) => {
|
|
14701
14719
|
e.width = Math.max(n, e.width * s);
|
|
14702
14720
|
});
|
|
14703
|
-
let c =
|
|
14721
|
+
let c = Ja(e);
|
|
14704
14722
|
if (c >= r) return;
|
|
14705
14723
|
r = c;
|
|
14706
14724
|
}
|
|
14707
14725
|
}
|
|
14708
|
-
function
|
|
14709
|
-
let n =
|
|
14726
|
+
function Xa(e, t) {
|
|
14727
|
+
let n = Ja(e);
|
|
14710
14728
|
if (!n || n === t) return;
|
|
14711
14729
|
let r = t / n;
|
|
14712
14730
|
for (let t = 0; t < e.length; t++) e[t].width *= r;
|
|
14713
14731
|
}
|
|
14714
14732
|
//#endregion
|
|
14715
14733
|
//#region src/editor/core/worker/works/wordCount.ts?worker&inline
|
|
14716
|
-
var
|
|
14717
|
-
function
|
|
14734
|
+
var Za = "(function(){let e=/* @__PURE__ */ function(e){return e.INSERTED=`inserted`,e.DELETED=`deleted`,e}({});function t(n){let r=``,i=0;for(;i<n.length;){let a=n[i],o=a.trace;if(o?.length&&o[o.length-1].type===e.DELETED){i++;continue}if(a.type===`table`){if(a.trList)for(let e=0;e<a.trList.length;e++){let n=a.trList[e];for(let e=0;e<n.tdList.length;e++){let i=n.tdList[e];r+=t(i.value)}}}else if(a.type===`hyperlink`){let e=a.hyperlinkId,o=[];for(;i<n.length;){let t=n[i];if(e!==t.hyperlinkId){i--;break}delete t.type,o.push(t),i++}r+=t(o)}else if(a.type===`latex`)r+=a.value;else if(a.controlId){if(!a.control?.hide){let e=a.controlId,o=[];for(;i<n.length;){let t=n[i];if(e!==t.controlId){i--;break}t.controlComponent===`value`&&(delete t.controlId,o.push(t)),i++}r+=t(o)}}else(!a.type||a.type===`text`)&&!a.area?.hide&&(r+=a.value);i++}return r}function n(e){let t=[],n=``,r=()=>{n&&=(t.push(n),``)},i=e=>e<=32||e===160||e>=8192&&e<=8202||e===8239||e===12288||e>=8203&&e<=8207||e>=8234&&e<=8238||e===8288||e===65279,a=e=>e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122,o=e=>e>=33&&e<=47||e>=58&&e<=64||e>=91&&e<=96||e>=123&&e<=126,s=e=>e===123||e===125;for(let c of e){let e=c.charCodeAt(0);if(i(e)){r();continue}if(a(e)||s(e)||o(e)){n+=c;continue}r(),t.push(c)}return r(),t}onmessage=e=>{let r=e.data,i=n(t(r).replace(/* @__PURE__ */ RegExp(`^`),``).replace(/* @__PURE__ */ RegExp(``,`g`),`\n`));postMessage(i.length)}})();\n//# sourceMappingURL=wordCount-xSvDqE7d.js.map", Qa = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", Za], { type: "text/javascript;charset=utf-8" });
|
|
14735
|
+
function $a(e) {
|
|
14718
14736
|
let t;
|
|
14719
14737
|
try {
|
|
14720
|
-
if (t =
|
|
14738
|
+
if (t = Qa && (self.URL || self.webkitURL).createObjectURL(Qa), !t) throw "";
|
|
14721
14739
|
let n = new Worker(t, { name: e?.name });
|
|
14722
14740
|
return n.addEventListener("error", () => {
|
|
14723
14741
|
(self.URL || self.webkitURL).revokeObjectURL(t);
|
|
14724
14742
|
}), n;
|
|
14725
14743
|
} catch {
|
|
14726
|
-
return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
14744
|
+
return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(Za), { name: e?.name });
|
|
14727
14745
|
}
|
|
14728
14746
|
}
|
|
14729
14747
|
//#endregion
|
|
14730
14748
|
//#region src/editor/core/worker/works/catalog.ts?worker&inline
|
|
14731
|
-
var
|
|
14732
|
-
function
|
|
14749
|
+
var eo = "(function(){let e={first:1,second:2,third:3,fourth:4,fifth:5,sixth:6},t=[`text`,`hyperlink`,`subscript`,`superscript`,`control`,`date`,`label`];function n(e){return!e.type||t.includes(e.type)}function r(t){let{elementList:r,positionList:i}=t,a=[],o=0;for(;o<r.length;){let e=r[o],t=(e,t,r)=>{let a=e.titleId,s={type:`title`,value:``,level:e.level,titleId:a,pageNo:i[o].pageNo},c=[];for(;r<t.length;){let e=t[r];if(a!==e.titleId){r--;break}c.push(e),r++}return s.value=c.filter(e=>n(e)).map(e=>e.value).join(``).replace(/* @__PURE__ */ RegExp(``,`g`),``),{position:r,titleElement:s}};if(e.titleId){let{position:n,titleElement:i}=t(e,r,o);o=n,a.push(i)}if(e.type===`table`){let n=e.trList;for(let e=0;e<n.length;e++){let r=n[e];for(let e=0;e<r.tdList.length;e++){let n=r.tdList[e].value;if(n.length>1){let e=1;for(;e<n.length;){if(n[e]?.titleId){let{titleElement:r,position:i}=t(n[e],n,e);a.push(r),e=i}e++}}}}}o++}if(!a.length)return null;let s=(t,n)=>{let r=n.subCatalog[n.subCatalog.length-1],i=e[r?.level],a=e[t.level];r&&a>i?s(t,r):n.subCatalog.push({id:t.titleId,name:t.value,level:t.level,pageNo:t.pageNo,subCatalog:[]})},c=[];for(let t=0;t<a.length;t++){let n=a[t],r=c[c.length-1],i=e[r?.level],o=e[n.level];r&&o>i?s(n,r):c.push({id:n.titleId,name:n.value,level:n.level,pageNo:n.pageNo,subCatalog:[]})}return c}onmessage=e=>{let t=e.data,n=r(t);postMessage(n)}})();\n//# sourceMappingURL=catalog-I5Jqg37f.js.map", to = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", eo], { type: "text/javascript;charset=utf-8" });
|
|
14750
|
+
function no(e) {
|
|
14733
14751
|
let t;
|
|
14734
14752
|
try {
|
|
14735
|
-
if (t =
|
|
14753
|
+
if (t = to && (self.URL || self.webkitURL).createObjectURL(to), !t) throw "";
|
|
14736
14754
|
let n = new Worker(t, { name: e?.name });
|
|
14737
14755
|
return n.addEventListener("error", () => {
|
|
14738
14756
|
(self.URL || self.webkitURL).revokeObjectURL(t);
|
|
14739
14757
|
}), n;
|
|
14740
14758
|
} catch {
|
|
14741
|
-
return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
14759
|
+
return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(eo), { name: e?.name });
|
|
14742
14760
|
}
|
|
14743
14761
|
}
|
|
14744
14762
|
//#endregion
|
|
14745
14763
|
//#region src/editor/core/worker/works/group.ts?worker&inline
|
|
14746
|
-
var
|
|
14747
|
-
function
|
|
14764
|
+
var ro = "(function(){function e(t){let n=[];for(let r of t){if(r.type===`table`){let t=r.trList;for(let r=0;r<t.length;r++){let i=t[r];for(let t=0;t<i.tdList.length;t++){let r=i.tdList[t];n.push(...e(r.value))}}}if(r.groupIds)for(let e of r.groupIds)n.includes(e)||n.push(e)}return n}onmessage=t=>{let n=t.data,r=e(n);postMessage(r)}})();\n//# sourceMappingURL=group-BZtj1M7o.js.map", io = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", ro], { type: "text/javascript;charset=utf-8" });
|
|
14765
|
+
function ao(e) {
|
|
14748
14766
|
let t;
|
|
14749
14767
|
try {
|
|
14750
|
-
if (t =
|
|
14768
|
+
if (t = io && (self.URL || self.webkitURL).createObjectURL(io), !t) throw "";
|
|
14751
14769
|
let n = new Worker(t, { name: e?.name });
|
|
14752
14770
|
return n.addEventListener("error", () => {
|
|
14753
14771
|
(self.URL || self.webkitURL).revokeObjectURL(t);
|
|
14754
14772
|
}), n;
|
|
14755
14773
|
} catch {
|
|
14756
|
-
return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
14774
|
+
return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(ro), { name: e?.name });
|
|
14757
14775
|
}
|
|
14758
14776
|
}
|
|
14759
14777
|
//#endregion
|
|
14760
14778
|
//#region src/editor/core/worker/works/value.ts?worker&inline
|
|
14761
|
-
var
|
|
14762
|
-
function
|
|
14779
|
+
var oo = "(function(){let e=/* @__PURE__ */ function(e){return e.HALF=`half`,e.ONE_THIRD=`one-third`,e.QUARTER=`quarter`,e}({}),t=/* @__PURE__ */ function(e){return e.ARABIC=`arabic`,e.CHINESE=`chinese`,e}({});e.HALF,e.ONE_THIRD,e.QUARTER;function n(e){if(typeof structuredClone==`function`)return structuredClone(e);if(!e||typeof e!=`object`)return e;let t={};return Array.isArray(e)?t=e.map(e=>n(e)):Object.keys(e).forEach(r=>{t[r]=n(e[r])}),t}function r(e,t){let n={};for(let r in e)t.includes(r)&&(n[r]=e[r]);return n}function i(e,t){return e.length===t.length&&!e.some(e=>!t.includes(e))}let a=/* @__PURE__ */ function(e){return e.TEXT=`text`,e.IMAGE=`image`,e.TABLE=`table`,e.HYPERLINK=`hyperlink`,e.SUPERSCRIPT=`superscript`,e.SUBSCRIPT=`subscript`,e.SEPARATOR=`separator`,e.PAGE_BREAK=`pageBreak`,e.CONTROL=`control`,e.AREA=`area`,e.CHECKBOX=`checkbox`,e.RADIO=`radio`,e.LATEX=`latex`,e.TAB=`tab`,e.DATE=`date`,e.BLOCK=`block`,e.TITLE=`title`,e.LIST=`list`,e.LABEL=`label`,e}({}),o=[`rowFlex`,`rowMargin`],s=/* @__PURE__ */ `type.font.size.bold.color.italic.highlight.underline.strikeout.rowFlex.rowMargin.dashArray.trList.tableToolDisabled.borderType.borderColor.translateX.width.height.url.colgroup.valueList.control.checkbox.radio.dateFormat.block.level.title.listType.listStyle.listWrap.listLevel.groupIds.conceptId.imgDisplay.imgFloatPosition.imgToolDisabled.imgPreviewDisabled.imgCrop.imgCaption.textDecoration.extension.externalId.areaId.area.hide.label.labelId.lineWidth.trace.paperDirection.hint`.split(`.`),c=[`conceptId`,`extension`,`externalId`,`verticalAlign`,`backgroundColor`,`borderTypes`,`slashTypes`,`disabled`,`deletable`],l=[`tdId`,`trId`,`tableId`],u=[`level`,`titleId`,`title`],d=[`listId`,`listType`,`listStyle`,`listLevel`],f=[`font`,`size`,`bold`,`highlight`,`italic`,`strikeout`],p=[`areaId`,`area`];[...l,...u,...d,...p],a.TEXT,a.HYPERLINK,a.SUBSCRIPT,a.SUPERSCRIPT,a.CONTROL,a.DATE,a.IMAGE,a.LATEX,a.BLOCK,a.PAGE_BREAK,a.SEPARATOR,a.TABLE,a.TITLE,a.LIST;let m=/* @__PURE__ */ function(e){return e.UL=`ul`,e.OL=`ol`,e}({}),h=/* @__PURE__ */ function(e){return e.DISC=`disc`,e.CIRCLE=`circle`,e.SQUARE=`square`,e.CHECKBOX=`checkbox`,e}({}),g=/* @__PURE__ */ function(e){return e.DISC=`disc`,e.CIRCLE=`circle`,e.SQUARE=`square`,e.DECIMAL=`decimal`,e.CHECKBOX=`checkbox`,e}({});h.DISC,h.CIRCLE,h.SQUARE,h.CHECKBOX,m.OL,m.UL,g.DISC,g.CIRCLE,g.SQUARE,g.DECIMAL,g.CHECKBOX;let _=/* @__PURE__ */ function(e){return e.FIRST=`first`,e.SECOND=`second`,e.THIRD=`third`,e.FOURTH=`fourth`,e.FIFTH=`fifth`,e.SIXTH=`sixth`,e}({});_.FIRST,_.SECOND,_.THIRD,_.FOURTH,_.FIFTH,_.SIXTH,_.FIRST,_.SECOND,_.THIRD,_.FOURTH,_.FIFTH,_.SIXTH,_.FIRST,_.SECOND,_.THIRD,_.FOURTH,_.FIFTH,_.SIXTH;let v=/* @__PURE__ */ function(e){return e.PREFIX=`prefix`,e.POSTFIX=`postfix`,e.PRE_TEXT=`preText`,e.POST_TEXT=`postText`,e.PLACEHOLDER=`placeholder`,e.VALUE=`value`,e.CHECKBOX=`checkbox`,e.RADIO=`radio`,e}({}),y=/* @__PURE__ */ function(e){return e.PAGING=`paging`,e.CONTINUITY=`continuity`,e}({}),b=/* @__PURE__ */ function(e){return e.LEFT=`left`,e.CENTER=`center`,e.RIGHT=`right`,e.ALIGNMENT=`alignment`,e.JUSTIFY=`justify`,e}({}),x=/* @__PURE__ */ function(e){return e.CONTAIN=`contain`,e.COVER=`cover`,e}({}),S=/* @__PURE__ */ function(e){return e.REPEAT=`repeat`,e.NO_REPEAT=`no-repeat`,e.REPEAT_X=`repeat-x`,e.REPEAT_Y=`repeat-y`,e}({});x.COVER,S.NO_REPEAT;let C=/* @__PURE__ */ function(e){return e.TOP=`top`,e.MIDDLE=`middle`,e.BOTTOM=`bottom`,e}({});C.BOTTOM,e.HALF,e.HALF,b.CENTER,{PAGE_NO:`{pageNo}`,PAGE_COUNT:`{pageCount}`}.PAGE_NO,t.ARABIC,C.BOTTOM;let w=/* @__PURE__ */ function(e){return e.TEXT=`text`,e.IMAGE=`image`,e}({}),T=/* @__PURE__ */ function(e){return e.BOTTOM=`bottom`,e.TOP=`top`,e}({});w.TEXT,t.ARABIC,T.BOTTOM,(/* @__PURE__ */ function(e){return e.PAGE=`page`,e.CONTINUITY=`continuity`,e}({})).CONTINUITY,y.CONTINUITY;function E(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r=0;r<n.length;r++){let a=n[r];if(a!==`value`&&!(a===`groupIds`&&Array.isArray(e[a])&&Array.isArray(t[a])&&i(e[a],t[a]))){if(a===`trace`){let n=e[a]||[],r=t[a]||[];if(n.length!==r.length)return!1;for(let e=0;e<n.length;e++){let t=n[e],i=r[e];if(t.type!==i.type||t.author!==i.author||t.timestamp!==i.timestamp)return!1}continue}if(e[a]!==t[a])return!1}}return!0}function D(e,t={}){let{extraPickAttrs:n}=t,r=[...s];n&&r.push(...n);let i={value:e.value===``?`\n`:e.value};return r.forEach(t=>{let n=e[t];n!==void 0&&(i[t]=n)}),i}function O(e,t={}){let{extraPickAttrs:i,isClassifyArea:s=!1,isClone:l=!0,isListValue:u=!1}=t,d=l?n(e):e,p=[],m=0;for(;m<d.length;){let e=d[m];if(m===0&&e.value===``&&!e.listId&&(!e.type||e.type===a.TEXT)){m++;continue}if(e.areaId){let n=e.areaId,r=e.area,i=[];for(;m<d.length;){let e=d[m];if(n!==e.areaId){m--;break}delete e.area,delete e.areaId,i.push(e),m++}let o=O(i,t);if(s){let t={type:a.AREA,value:``,areaId:n,area:r};t.valueList=o,e=t}else{p.splice(m,0,...o);continue}}else if(e.titleId&&e.level){let n=e.titleId;if(n){let r=e.level,i={type:a.TITLE,title:e.title,titleId:n,value:``,level:r},o=[];for(;m<d.length;){let e=d[m];if(n!==e.titleId){m--;break}delete e.level,delete e.title,o.push(e),m++}i.valueList=O(o,t),e=i}}else if(!u&&e.listId&&e.listType){let n=e.listId;if(n){let r=e.listType,i=e.listStyle,o={type:a.LIST,value:``,listId:n,listType:r,listStyle:i},s=[];for(;m<d.length;){let e=d[m];if(!e.listId||r!==e.listType){m--;break}delete e.listType,delete e.listStyle,s.push(e),m++}o.valueList=O(s,{...t,isListValue:!0}),e=o}}else if(e.type===a.TABLE){if(e.trList)for(let n=0;n<e.trList.length;n++){let r=e.trList[n];delete r.id;for(let e=0;e<r.tdList.length;e++){let n=r.tdList[e],i={colspan:n.colspan,rowspan:n.rowspan,value:O(n.value,{...t,isClassifyArea:!0})};c.forEach(e=>{let t=n[e];t!==void 0&&(i[e]=t)}),r.tdList[e]=i}}}else if(e.type===a.HYPERLINK){let n=e.hyperlinkId;if(n){let r={type:a.HYPERLINK,value:``,url:e.url},i=[];for(;m<d.length;){let e=d[m];if(n!==e.hyperlinkId){m--;break}delete e.type,delete e.url,i.push(e),m++}r.valueList=O(i,t),e=r}}else if(e.type===a.DATE){let n=e.dateId;if(n){let r={type:a.DATE,value:``,dateFormat:e.dateFormat},i=[];for(;m<d.length;){let e=d[m];if(n!==e.dateId){m--;break}delete e.type,delete e.dateFormat,i.push(e),m++}r.valueList=O(i,t),e=r}}else if(e.controlId){let n=e.controlId;if(e.controlComponent===v.PREFIX){let s=[],c=!1,l=m;for(;l<d.length;){let e=d[l];if(e.controlId===n){if(e.controlComponent===v.VALUE&&(delete e.control,delete e.controlId,s.push(e)),e.controlComponent===v.POSTFIX){c=!0,l++;break}l++;continue}if(e.controlComponent===v.PREFIX){let n=l;for(;n<d.length;){let t=d[n];if(t.controlId===e.controlId&&t.controlComponent===v.POSTFIX)break;n++}let r=O(d.slice(l,Math.min(n+1,d.length)),t)[0];r&&s.push(r),l=n+1;continue}break}if(c){let c=r(e,f),u={...e.control,...c},d={...r(e,o),type:a.CONTROL,value:``,control:u,controlId:n,trace:e.trace};d.control.value=O(s,t),e=D(d,{extraPickAttrs:i}),m+=l-m-1}}if(e.controlComponent&&(delete e.control,delete e.controlId,e.controlComponent!==v.VALUE&&e.controlComponent!==v.PRE_TEXT&&e.controlComponent!==v.POST_TEXT)){m++;continue}}let n=D(e,{extraPickAttrs:i});if(!e.type||e.type===a.TEXT||e.type===a.SUBSCRIPT||e.type===a.SUPERSCRIPT)for(;m<d.length;){let e=d[m+1];if(m++,e&&E(n,D(e,{extraPickAttrs:i}))){let t=e.value===``?`\n`:e.value;n.value+=t}else break}else m++;p.push(n)}return p}onmessage=e=>{let{options:t,data:n}=e.data,{extraPickAttrs:r=[]}=t||{},i={header:O(n.header,{extraPickAttrs:r,isClone:!1}),main:O(n.main,{extraPickAttrs:r,isClassifyArea:!0,isClone:!1}),footer:O(n.footer,{extraPickAttrs:r,isClone:!1})};postMessage(i)}})();\n//# sourceMappingURL=value-BUbTZYaX.js.map", so = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", oo], { type: "text/javascript;charset=utf-8" });
|
|
14780
|
+
function co(e) {
|
|
14763
14781
|
let t;
|
|
14764
14782
|
try {
|
|
14765
|
-
if (t =
|
|
14783
|
+
if (t = so && (self.URL || self.webkitURL).createObjectURL(so), !t) throw "";
|
|
14766
14784
|
let n = new Worker(t, { name: e?.name });
|
|
14767
14785
|
return n.addEventListener("error", () => {
|
|
14768
14786
|
(self.URL || self.webkitURL).revokeObjectURL(t);
|
|
14769
14787
|
}), n;
|
|
14770
14788
|
} catch {
|
|
14771
|
-
return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
14789
|
+
return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(oo), { name: e?.name });
|
|
14772
14790
|
}
|
|
14773
14791
|
}
|
|
14774
14792
|
//#endregion
|
|
14775
14793
|
//#region src/editor/core/worker/WorkerManager.ts
|
|
14776
|
-
var
|
|
14794
|
+
var lo = class {
|
|
14777
14795
|
draw;
|
|
14778
14796
|
wordCountWorker;
|
|
14779
14797
|
catalogWorker;
|
|
14780
14798
|
groupWorker;
|
|
14781
14799
|
valueWorker;
|
|
14782
14800
|
constructor(e) {
|
|
14783
|
-
this.draw = e, this.wordCountWorker = new
|
|
14801
|
+
this.draw = e, this.wordCountWorker = new $a(), this.catalogWorker = new no(), this.groupWorker = new ao(), this.valueWorker = new co();
|
|
14784
14802
|
}
|
|
14785
14803
|
getWordCount() {
|
|
14786
14804
|
return new Promise((e, t) => {
|
|
@@ -14837,7 +14855,7 @@ var ao = class {
|
|
|
14837
14855
|
destroy() {
|
|
14838
14856
|
this.wordCountWorker.terminate(), this.catalogWorker.terminate(), this.groupWorker.terminate(), this.valueWorker.terminate();
|
|
14839
14857
|
}
|
|
14840
|
-
},
|
|
14858
|
+
}, uo = [
|
|
14841
14859
|
"nw-resize",
|
|
14842
14860
|
"n-resize",
|
|
14843
14861
|
"ne-resize",
|
|
@@ -14847,13 +14865,13 @@ var ao = class {
|
|
|
14847
14865
|
"sw-resize",
|
|
14848
14866
|
"w-resize"
|
|
14849
14867
|
];
|
|
14850
|
-
function
|
|
14868
|
+
function fo(e, t, n) {
|
|
14851
14869
|
let { scale: r, resizerColor: i, resizerSize: a } = t, o = document.createElement("div");
|
|
14852
14870
|
e.applyClass(o, "resizer", "selection", "ce-resizer-selection"), o.style.display = "none", o.style.position = "absolute", o.style.pointerEvents = "none", o.style.setProperty("--ce-resizer-color", i), o.style.setProperty("--ce-resizer-border-width", `${r}px`);
|
|
14853
14871
|
let s = [];
|
|
14854
14872
|
for (let t = 0; t < 8; t++) {
|
|
14855
14873
|
let r = document.createElement("div");
|
|
14856
|
-
e.applyClass(r, "resizer", "handle", "ce-resizer-handle", "resizer-handle", `handle-${t}`), r.setAttribute("data-index", String(t)), r.style.position = "absolute", r.style.zIndex = "9", r.style.boxSizing = "border-box", r.style.width = `${a * 2}px`, r.style.height = `${a * 2}px`, r.style.pointerEvents = "auto", r.style.cursor =
|
|
14874
|
+
e.applyClass(r, "resizer", "handle", "ce-resizer-handle", "resizer-handle", `handle-${t}`), r.setAttribute("data-index", String(t)), r.style.position = "absolute", r.style.zIndex = "9", r.style.boxSizing = "border-box", r.style.width = `${a * 2}px`, r.style.height = `${a * 2}px`, r.style.pointerEvents = "auto", r.style.cursor = uo[t], r.onmousedown = n, o.append(r), s.push(r);
|
|
14857
14875
|
}
|
|
14858
14876
|
return {
|
|
14859
14877
|
resizerSelection: o,
|
|
@@ -14862,7 +14880,7 @@ function so(e, t, n) {
|
|
|
14862
14880
|
}
|
|
14863
14881
|
//#endregion
|
|
14864
14882
|
//#region src/editor/core/draw/particle/previewer/Previewer.ts
|
|
14865
|
-
var
|
|
14883
|
+
var po = class {
|
|
14866
14884
|
container;
|
|
14867
14885
|
canvas;
|
|
14868
14886
|
draw;
|
|
@@ -14914,7 +14932,7 @@ var co = class {
|
|
|
14914
14932
|
};
|
|
14915
14933
|
}
|
|
14916
14934
|
_createResizerDom() {
|
|
14917
|
-
let { resizerSelection: e, resizerHandleList: t } =
|
|
14935
|
+
let { resizerSelection: e, resizerHandleList: t } = fo(this.ui, this.options, this._mousedown.bind(this));
|
|
14918
14936
|
this.container.append(e);
|
|
14919
14937
|
let n = document.createElement("div");
|
|
14920
14938
|
this.ui.applyClass(n, "resizer", "sizeView", "ce-resizer-size-view"), n.style.position = "absolute", n.style.zIndex = "9", n.style.left = "0", n.style.top = "-30px";
|
|
@@ -15147,13 +15165,13 @@ var co = class {
|
|
|
15147
15165
|
destroy() {
|
|
15148
15166
|
this.clearResizer(), this._clearPreviewer();
|
|
15149
15167
|
}
|
|
15150
|
-
},
|
|
15168
|
+
}, mo = class {
|
|
15151
15169
|
draw;
|
|
15152
15170
|
range;
|
|
15153
15171
|
datePicker;
|
|
15154
15172
|
options;
|
|
15155
15173
|
constructor(e) {
|
|
15156
|
-
this.draw = e, this.options = e.getOptions(), this.range = e.getRange(), this.datePicker = new
|
|
15174
|
+
this.draw = e, this.options = e.getOptions(), this.range = e.getRange(), this.datePicker = new da(e, { onSubmit: this._setValue.bind(this) });
|
|
15157
15175
|
}
|
|
15158
15176
|
_setValue(e) {
|
|
15159
15177
|
if (!e) return;
|
|
@@ -15203,7 +15221,7 @@ var co = class {
|
|
|
15203
15221
|
dateFormat: e.dateFormat
|
|
15204
15222
|
});
|
|
15205
15223
|
}
|
|
15206
|
-
},
|
|
15224
|
+
}, ho = class {
|
|
15207
15225
|
element;
|
|
15208
15226
|
videoCache;
|
|
15209
15227
|
constructor(e) {
|
|
@@ -15231,7 +15249,7 @@ var co = class {
|
|
|
15231
15249
|
let t = this.element.block, n = document.createElement("video");
|
|
15232
15250
|
n.style.display = "block", n.style.width = "100%", n.style.height = "100%", n.src = t.videoBlock?.src || "", n.controls = !0, e.append(n);
|
|
15233
15251
|
}
|
|
15234
|
-
},
|
|
15252
|
+
}, go = class {
|
|
15235
15253
|
draw;
|
|
15236
15254
|
options;
|
|
15237
15255
|
element;
|
|
@@ -15269,7 +15287,7 @@ var co = class {
|
|
|
15269
15287
|
_createBlockItem() {
|
|
15270
15288
|
let e = document.createElement("div");
|
|
15271
15289
|
this.draw.getUi().applyClass(e, "block", "item", "ce-block-item"), e.style.position = "absolute", e.style.zIndex = "0";
|
|
15272
|
-
let { resizerSelection: t, resizerHandleList: n } =
|
|
15290
|
+
let { resizerSelection: t, resizerHandleList: n } = fo(this.draw.getUi(), this.options, this._mousedown.bind(this)), r = document.createElement("div");
|
|
15273
15291
|
return this.draw.getUi().applyClass(r, "resizer", "mask", "ce-resizer-mask"), r.style.display = "none", r.style.position = "absolute", r.style.left = "0", r.style.top = "0", r.style.right = "0", r.style.bottom = "0", r.style.zIndex = "1", e.append(r), e.onmouseenter = () => {
|
|
15274
15292
|
if (this.draw.isReadonly()) return;
|
|
15275
15293
|
let { width: e, height: n } = this.element.metrics;
|
|
@@ -15353,7 +15371,7 @@ var co = class {
|
|
|
15353
15371
|
if (i.type === jt.VIDEO) {
|
|
15354
15372
|
if (this.blockItem.style.display = "none", this.blockCache.has(this.element.id)) this.blockCache.get(this.element.id).snapshot(e, n, r);
|
|
15355
15373
|
else {
|
|
15356
|
-
this.block = new
|
|
15374
|
+
this.block = new ho(this.element);
|
|
15357
15375
|
let t = this.block.snapshot(e, n, r);
|
|
15358
15376
|
this.draw.getImageObserver().add(t), this.blockCache.set(this.element.id, this.block);
|
|
15359
15377
|
}
|
|
@@ -15361,7 +15379,7 @@ var co = class {
|
|
|
15361
15379
|
}
|
|
15362
15380
|
render() {
|
|
15363
15381
|
let e = this.element.block;
|
|
15364
|
-
e.type === jt.IFRAME ? (this.block = new Xe(this.element), this.block.render(this.blockItem)) : e.type === jt.VIDEO && (this.block = new
|
|
15382
|
+
e.type === jt.IFRAME ? (this.block = new Xe(this.element), this.block.render(this.blockItem)) : e.type === jt.VIDEO && (this.block = new ho(this.element), this.block.render(this.blockItem));
|
|
15365
15383
|
let t = this.blockItem.lastElementChild;
|
|
15366
15384
|
if (t && t !== this.resizerMask) {
|
|
15367
15385
|
let n = e.type === jt.IFRAME ? "iframe" : "video";
|
|
@@ -15382,7 +15400,7 @@ var co = class {
|
|
|
15382
15400
|
remove() {
|
|
15383
15401
|
this.blockItem.remove();
|
|
15384
15402
|
}
|
|
15385
|
-
},
|
|
15403
|
+
}, _o = class {
|
|
15386
15404
|
draw;
|
|
15387
15405
|
options;
|
|
15388
15406
|
container;
|
|
@@ -15403,7 +15421,7 @@ var co = class {
|
|
|
15403
15421
|
}
|
|
15404
15422
|
render(e, t, n, r, i) {
|
|
15405
15423
|
let a = n.id, o = this.blockMap.get(a);
|
|
15406
|
-
o || (o = new
|
|
15424
|
+
o || (o = new go(this, n), o.render(), this.blockMap.set(a, o)), this.draw.isPrintMode() ? o.snapshot(e, t, r, i) : o.setClientRects(t, r, i), o.setStatus();
|
|
15407
15425
|
}
|
|
15408
15426
|
clear() {
|
|
15409
15427
|
if (!this.blockMap.size) return;
|
|
@@ -15458,7 +15476,7 @@ var co = class {
|
|
|
15458
15476
|
});
|
|
15459
15477
|
}), e;
|
|
15460
15478
|
}
|
|
15461
|
-
},
|
|
15479
|
+
}, vo = {
|
|
15462
15480
|
contextmenu: {
|
|
15463
15481
|
global: {
|
|
15464
15482
|
cut: "剪切",
|
|
@@ -15619,7 +15637,7 @@ var co = class {
|
|
|
15619
15637
|
centerVertically: "垂直居中",
|
|
15620
15638
|
confirm: "完成"
|
|
15621
15639
|
}
|
|
15622
|
-
},
|
|
15640
|
+
}, yo = {
|
|
15623
15641
|
contextmenu: {
|
|
15624
15642
|
global: {
|
|
15625
15643
|
cut: "Cut",
|
|
@@ -15780,7 +15798,7 @@ var co = class {
|
|
|
15780
15798
|
centerVertically: "Center vertically",
|
|
15781
15799
|
confirm: "Done"
|
|
15782
15800
|
}
|
|
15783
|
-
},
|
|
15801
|
+
}, bo = {
|
|
15784
15802
|
contextmenu: {
|
|
15785
15803
|
global: {
|
|
15786
15804
|
cut: "Recortar",
|
|
@@ -15941,20 +15959,20 @@ var co = class {
|
|
|
15941
15959
|
centerVertically: "Centralizar na vertical",
|
|
15942
15960
|
confirm: "Confirmar"
|
|
15943
15961
|
}
|
|
15944
|
-
},
|
|
15962
|
+
}, xo = class {
|
|
15945
15963
|
currentLocale;
|
|
15946
15964
|
langMap = /* @__PURE__ */ new Map([
|
|
15947
|
-
["zhCN",
|
|
15948
|
-
["en",
|
|
15949
|
-
["ptBR",
|
|
15950
|
-
["pt-BR",
|
|
15965
|
+
["zhCN", vo],
|
|
15966
|
+
["en", yo],
|
|
15967
|
+
["ptBR", bo],
|
|
15968
|
+
["pt-BR", bo]
|
|
15951
15969
|
]);
|
|
15952
15970
|
constructor(e) {
|
|
15953
15971
|
this.currentLocale = e;
|
|
15954
15972
|
}
|
|
15955
15973
|
registerLangMap(e, t) {
|
|
15956
15974
|
let n = this.langMap.get(e);
|
|
15957
|
-
this.langMap.set(e, ae(n ||
|
|
15975
|
+
this.langMap.set(e, ae(n || yo, t));
|
|
15958
15976
|
}
|
|
15959
15977
|
getLocale() {
|
|
15960
15978
|
return this.currentLocale;
|
|
@@ -15963,7 +15981,7 @@ var co = class {
|
|
|
15963
15981
|
this.currentLocale = e;
|
|
15964
15982
|
}
|
|
15965
15983
|
getLang() {
|
|
15966
|
-
return this.langMap.get(this.currentLocale) ||
|
|
15984
|
+
return this.langMap.get(this.currentLocale) || yo;
|
|
15967
15985
|
}
|
|
15968
15986
|
t(e) {
|
|
15969
15987
|
let t = e.split("."), n = "", r = this.getLang();
|
|
@@ -15974,7 +15992,7 @@ var co = class {
|
|
|
15974
15992
|
}
|
|
15975
15993
|
return n;
|
|
15976
15994
|
}
|
|
15977
|
-
},
|
|
15995
|
+
}, So = class {
|
|
15978
15996
|
promiseList;
|
|
15979
15997
|
constructor() {
|
|
15980
15998
|
this.promiseList = [];
|
|
@@ -15988,7 +16006,7 @@ var co = class {
|
|
|
15988
16006
|
allSettled() {
|
|
15989
16007
|
return Promise.allSettled(this.promiseList);
|
|
15990
16008
|
}
|
|
15991
|
-
},
|
|
16009
|
+
}, Co = class {
|
|
15992
16010
|
draw;
|
|
15993
16011
|
zone;
|
|
15994
16012
|
i18n;
|
|
@@ -16057,7 +16075,7 @@ var co = class {
|
|
|
16057
16075
|
let { tipContainer: o, tipContent: s } = this._getZoneTipDom();
|
|
16058
16076
|
o.classList.add("show"), this.ui.setState(o, "show", !0), o.style.display = "flex", o.style.left = `${t}px`, o.style.top = `${n}px`, s.innerText = a;
|
|
16059
16077
|
}
|
|
16060
|
-
},
|
|
16078
|
+
}, wo = class {
|
|
16061
16079
|
INDICATOR_PADDING = 2;
|
|
16062
16080
|
INDICATOR_TITLE_TRANSLATE = [20, 5];
|
|
16063
16081
|
draw;
|
|
@@ -16067,7 +16085,7 @@ var co = class {
|
|
|
16067
16085
|
currentZone;
|
|
16068
16086
|
indicatorContainer;
|
|
16069
16087
|
constructor(e) {
|
|
16070
|
-
this.draw = e, this.i18n = e.getI18n(), this.options = e.getOptions(), this.container = e.getContainer(), this.currentZone = _.MAIN, this.indicatorContainer = null, this.options.zone.tipDisabled || new
|
|
16088
|
+
this.draw = e, this.i18n = e.getI18n(), this.options = e.getOptions(), this.container = e.getContainer(), this.currentZone = _.MAIN, this.indicatorContainer = null, this.options.zone.tipDisabled || new Co(e, this);
|
|
16071
16089
|
}
|
|
16072
16090
|
isHeaderActive() {
|
|
16073
16091
|
return this.getZone() === _.HEADER;
|
|
@@ -16120,7 +16138,7 @@ var co = class {
|
|
|
16120
16138
|
_clearZoneIndicator() {
|
|
16121
16139
|
this.indicatorContainer?.remove(), this.indicatorContainer = null;
|
|
16122
16140
|
}
|
|
16123
|
-
},
|
|
16141
|
+
}, To = class {
|
|
16124
16142
|
draw;
|
|
16125
16143
|
position;
|
|
16126
16144
|
zone;
|
|
@@ -16222,7 +16240,7 @@ var co = class {
|
|
|
16222
16240
|
zone: _.FOOTER
|
|
16223
16241
|
}), e.restore();
|
|
16224
16242
|
}
|
|
16225
|
-
},
|
|
16243
|
+
}, Eo = class {
|
|
16226
16244
|
draw;
|
|
16227
16245
|
range;
|
|
16228
16246
|
options;
|
|
@@ -16498,7 +16516,7 @@ var co = class {
|
|
|
16498
16516
|
e.save(), e.font = this.getListFontStyle(r, u), e.fillText(t, m, h), e.restore();
|
|
16499
16517
|
}
|
|
16500
16518
|
}
|
|
16501
|
-
},
|
|
16519
|
+
}, Do = class e {
|
|
16502
16520
|
options;
|
|
16503
16521
|
static WIDTH = 12;
|
|
16504
16522
|
static HEIGHT = 9;
|
|
@@ -16512,7 +16530,7 @@ var co = class {
|
|
|
16512
16530
|
let c = i - e.HEIGHT * a / 2, l = r + n.metrics.width;
|
|
16513
16531
|
t.translate(l, c), t.scale(a, a), t.strokeStyle = o, t.lineWidth = s, t.lineCap = "round", t.lineJoin = "round", t.beginPath(), t.moveTo(8, 0), t.lineTo(12, 0), t.lineTo(12, 6), t.lineTo(3, 6), t.moveTo(3, 6), t.lineTo(6, 3), t.moveTo(3, 6), t.lineTo(6, 9), t.stroke(), t.closePath(), t.restore();
|
|
16514
16532
|
}
|
|
16515
|
-
},
|
|
16533
|
+
}, Oo = class {
|
|
16516
16534
|
draw;
|
|
16517
16535
|
position;
|
|
16518
16536
|
options;
|
|
@@ -16537,7 +16555,7 @@ var co = class {
|
|
|
16537
16555
|
}
|
|
16538
16556
|
_computePositionList(e) {
|
|
16539
16557
|
let { lineBreak: t, scale: n } = this.options, r = this.draw.getHeader().getExtraHeight(), i = this.draw.getInnerWidth(), a = this.draw.getMargins(), o = a[3];
|
|
16540
|
-
t.disabled || (o += (
|
|
16558
|
+
t.disabled || (o += (Do.WIDTH + Do.GAP) * n);
|
|
16541
16559
|
let s = e?.startY || a[0] + r;
|
|
16542
16560
|
this.position.computePageRowPosition({
|
|
16543
16561
|
positionList: this.positionList,
|
|
@@ -16572,7 +16590,7 @@ var co = class {
|
|
|
16572
16590
|
isDrawLineBreak: !1
|
|
16573
16591
|
}), e.restore();
|
|
16574
16592
|
}
|
|
16575
|
-
},
|
|
16593
|
+
}, ko = class {
|
|
16576
16594
|
draw;
|
|
16577
16595
|
options;
|
|
16578
16596
|
range;
|
|
@@ -16677,7 +16695,7 @@ var co = class {
|
|
|
16677
16695
|
n?.includes(s) ? (e.globalAlpha = a, e.fillStyle = o) : (e.globalAlpha = i, e.fillStyle = r), e.fillRect(c, l, u, d);
|
|
16678
16696
|
}), e.restore(), this.clearFillInfo();
|
|
16679
16697
|
}
|
|
16680
|
-
},
|
|
16698
|
+
}, Ao = class {
|
|
16681
16699
|
options;
|
|
16682
16700
|
constructor(e) {
|
|
16683
16701
|
this.options = e.getOptions();
|
|
@@ -16686,7 +16704,7 @@ var co = class {
|
|
|
16686
16704
|
let { scale: i, whiteSpace: { color: a, radius: o } } = this.options, s = t.metrics;
|
|
16687
16705
|
e.save(), e.fillStyle = a, e.beginPath(), e.arc(n + s.width / 2, r, o * i, 0, Math.PI * 2), e.fill(), e.closePath(), e.restore();
|
|
16688
16706
|
}
|
|
16689
|
-
},
|
|
16707
|
+
}, jo = class {
|
|
16690
16708
|
draw;
|
|
16691
16709
|
eventBus;
|
|
16692
16710
|
pageContainer;
|
|
@@ -16711,7 +16729,7 @@ var co = class {
|
|
|
16711
16729
|
_click(e) {
|
|
16712
16730
|
this.eventBus.isSubscribe("click") && this.eventBus.emit("click", e);
|
|
16713
16731
|
}
|
|
16714
|
-
},
|
|
16732
|
+
}, Mo = class {
|
|
16715
16733
|
draw;
|
|
16716
16734
|
options;
|
|
16717
16735
|
constructor(e) {
|
|
@@ -16726,7 +16744,7 @@ var co = class {
|
|
|
16726
16744
|
}
|
|
16727
16745
|
e.restore();
|
|
16728
16746
|
}
|
|
16729
|
-
},
|
|
16747
|
+
}, No = class {
|
|
16730
16748
|
draw;
|
|
16731
16749
|
header;
|
|
16732
16750
|
footer;
|
|
@@ -16743,13 +16761,13 @@ var co = class {
|
|
|
16743
16761
|
};
|
|
16744
16762
|
//#endregion
|
|
16745
16763
|
//#region src/editor/core/actuator/handlers/positionContextChange.ts
|
|
16746
|
-
function
|
|
16764
|
+
function Po(e, t) {
|
|
16747
16765
|
let { value: n, oldValue: r } = t;
|
|
16748
16766
|
r.isTable && !n.isTable && e.getTableTool().dispose();
|
|
16749
16767
|
}
|
|
16750
16768
|
//#endregion
|
|
16751
16769
|
//#region src/editor/core/actuator/Actuator.ts
|
|
16752
|
-
var
|
|
16770
|
+
var Fo = class {
|
|
16753
16771
|
draw;
|
|
16754
16772
|
eventBus;
|
|
16755
16773
|
constructor(e) {
|
|
@@ -16757,10 +16775,10 @@ var jo = class {
|
|
|
16757
16775
|
}
|
|
16758
16776
|
execute() {
|
|
16759
16777
|
this.eventBus.on("positionContextChange", (e) => {
|
|
16760
|
-
|
|
16778
|
+
Po(this.draw, e);
|
|
16761
16779
|
});
|
|
16762
16780
|
}
|
|
16763
|
-
},
|
|
16781
|
+
}, Io = class {
|
|
16764
16782
|
draw;
|
|
16765
16783
|
range;
|
|
16766
16784
|
position;
|
|
@@ -17296,7 +17314,7 @@ var jo = class {
|
|
|
17296
17314
|
}
|
|
17297
17315
|
}
|
|
17298
17316
|
for (let e = 0; e < s.length; e++) c[e] && (s[e].width = Math.max(r, c[e]));
|
|
17299
|
-
a || (
|
|
17317
|
+
a || (Ya(s, this.draw.getOriginalInnerWidth(), r), n.translateX = 0);
|
|
17300
17318
|
let { endIndex: l } = this.range.getRange();
|
|
17301
17319
|
this.draw.render({ curIndex: l }), this.tableTool.render();
|
|
17302
17320
|
}
|
|
@@ -17305,7 +17323,7 @@ var jo = class {
|
|
|
17305
17323
|
if (!e.isTable) return;
|
|
17306
17324
|
let { index: t } = e, n = this.draw.getOriginalElementList()[t];
|
|
17307
17325
|
if (n?.type !== w.TABLE) return;
|
|
17308
|
-
|
|
17326
|
+
Xa(n.colgroup, this.draw.getOriginalInnerWidth()), n.translateX = 0;
|
|
17309
17327
|
let { endIndex: r } = this.range.getRange();
|
|
17310
17328
|
this.draw.render({ curIndex: r }), this.tableTool.render();
|
|
17311
17329
|
}
|
|
@@ -17329,13 +17347,13 @@ var jo = class {
|
|
|
17329
17347
|
isSubmitHistory: !1
|
|
17330
17348
|
});
|
|
17331
17349
|
}
|
|
17332
|
-
},
|
|
17350
|
+
}, Lo;
|
|
17333
17351
|
(function(e) {
|
|
17334
17352
|
e.EDIT = "edit", e.READONLY = "readonly", e.FORM = "form";
|
|
17335
|
-
})(
|
|
17353
|
+
})(Lo ||= {});
|
|
17336
17354
|
//#endregion
|
|
17337
17355
|
//#region src/editor/core/draw/interactive/Area.ts
|
|
17338
|
-
var
|
|
17356
|
+
var Ro = class {
|
|
17339
17357
|
draw;
|
|
17340
17358
|
zone;
|
|
17341
17359
|
range;
|
|
@@ -17361,9 +17379,9 @@ var Po = class {
|
|
|
17361
17379
|
let e = this.getActiveAreaInfo();
|
|
17362
17380
|
if (!e?.area) return !1;
|
|
17363
17381
|
switch (e.area.mode) {
|
|
17364
|
-
case
|
|
17365
|
-
case
|
|
17366
|
-
case
|
|
17382
|
+
case Lo.EDIT: return !1;
|
|
17383
|
+
case Lo.READONLY: return !0;
|
|
17384
|
+
case Lo.FORM: return !this.draw.getControl().getIsRangeWithinControl();
|
|
17367
17385
|
default: return !1;
|
|
17368
17386
|
}
|
|
17369
17387
|
}
|
|
@@ -17398,7 +17416,7 @@ var Po = class {
|
|
|
17398
17416
|
if (!s.length) continue;
|
|
17399
17417
|
e.translate(.5, .5);
|
|
17400
17418
|
let c = s[0], l = s[s.length - 1], u = i[1].tableCell, d = !!u, f = this.draw.getTdPadding(), p = d ? u.tablePosition.coordinate.leftTop[0] + u.td.x * this.options.scale + f[3] : n[3], m = Math.ceil(c.coordinate.leftTop[1]), h = Math.ceil(l.coordinate.rightBottom[1] - m), g = d ? u.td.width * this.options.scale - f[1] - f[3] : r;
|
|
17401
|
-
a.backgroundColor && (e.fillStyle = a.backgroundColor, e.fillRect(p, m, g, h)), a.borderColor && (e.strokeStyle = a.borderColor, e.strokeRect(p, m, g, h)), a.placeholder && o.length <= 1 && new
|
|
17419
|
+
a.backgroundColor && (e.fillStyle = a.backgroundColor, e.fillRect(p, m, g, h)), a.borderColor && (e.strokeStyle = a.borderColor, e.strokeRect(p, m, g, h)), a.placeholder && o.length <= 1 && new Oo(this.draw).render(e, {
|
|
17402
17420
|
placeholder: {
|
|
17403
17421
|
...Zt,
|
|
17404
17422
|
...a.placeholder
|
|
@@ -17517,7 +17535,7 @@ var Po = class {
|
|
|
17517
17535
|
let { positionList: r } = n, i = n.sourceElementList;
|
|
17518
17536
|
this.draw.deleteElementList(i, r[0].index, r.length, { isIgnoreDeletedRule: !0 }), this.draw.render({ isSetCursor: !1 });
|
|
17519
17537
|
}
|
|
17520
|
-
},
|
|
17538
|
+
}, zo = class {
|
|
17521
17539
|
draw;
|
|
17522
17540
|
options;
|
|
17523
17541
|
imageCache;
|
|
@@ -17565,7 +17583,7 @@ var Po = class {
|
|
|
17565
17583
|
}
|
|
17566
17584
|
}
|
|
17567
17585
|
}
|
|
17568
|
-
},
|
|
17586
|
+
}, Bo = class {
|
|
17569
17587
|
draw;
|
|
17570
17588
|
options;
|
|
17571
17589
|
data;
|
|
@@ -17630,7 +17648,7 @@ var Po = class {
|
|
|
17630
17648
|
}
|
|
17631
17649
|
e.restore();
|
|
17632
17650
|
}
|
|
17633
|
-
},
|
|
17651
|
+
}, Vo = class {
|
|
17634
17652
|
draw;
|
|
17635
17653
|
options;
|
|
17636
17654
|
canvas;
|
|
@@ -17690,7 +17708,7 @@ var Po = class {
|
|
|
17690
17708
|
destroy() {
|
|
17691
17709
|
this.canvas.remove(), this._removeEvent();
|
|
17692
17710
|
}
|
|
17693
|
-
},
|
|
17711
|
+
}, Ho = class {
|
|
17694
17712
|
draw;
|
|
17695
17713
|
i18n;
|
|
17696
17714
|
disabled;
|
|
@@ -17739,7 +17757,7 @@ var Po = class {
|
|
|
17739
17757
|
destroy() {
|
|
17740
17758
|
this.disabled || (this.rangeChangeHandler && this.draw.getEventBus().off("rangeChange", this.rangeChangeHandler), this.assertiveDom?.parentElement?.remove());
|
|
17741
17759
|
}
|
|
17742
|
-
},
|
|
17760
|
+
}, Uo = class {
|
|
17743
17761
|
container;
|
|
17744
17762
|
pageContainer;
|
|
17745
17763
|
pageList;
|
|
@@ -17840,7 +17858,7 @@ var Po = class {
|
|
|
17840
17858
|
imageUpload = null;
|
|
17841
17859
|
flowResizeObserver = null;
|
|
17842
17860
|
constructor(e, t, n, r, i, a) {
|
|
17843
|
-
this.container = this._wrapContainer(e), this.pageList = [], this.ctxList = [], this.pageNo = 0, this.renderCount = 0, this.pagePixelRatio = null, this.mode = t.mode, this.options = t, this.elementList = n.main, this.pageDirectionList = [t.paperDirection], this.listener = r, this.eventBus = i, this.override = a, this._syncFlowWidth(), this._formatContainer(), this.ui = new
|
|
17861
|
+
this.container = this._wrapContainer(e), this.pageList = [], this.ctxList = [], this.pageNo = 0, this.renderCount = 0, this.pagePixelRatio = null, this.mode = t.mode, this.options = t, this.elementList = n.main, this.pageDirectionList = [t.paperDirection], this.listener = r, this.eventBus = i, this.override = a, this._syncFlowWidth(), this._formatContainer(), this.ui = new bi(t.ui, this.container, i), this.ui.applyClass(this.container, "page", "root", "ce-editor"), this.pageContainer = this._createPageContainer(), this._createPage(0), this.i18n = new xo(t.locale), this.historyManager = new yi(this), this.position = new Oi(this), this.zone = new wo(this), this.range = new ki(this), this.margin = new Ni(this), this.background = new Ai(this), this.badge = new zo(this), this.magnifier = new Vo(this), this.search = new Pi(this), this.spellcheck = new Fi(this), this.group = new ko(this), this.area = new Ro(this), this.underline = new zi(this), this.strikeout = new Ii(this), this.highlight = new Mi(this), this.previewer = new po(this), this.imageParticle = new Ze(this), this.laTexParticle = new vt(this), this.textParticle = new Bi(this), this.tableParticle = new Wi(this), this.tablePaging = new Gi(this), this.rawRowList = [], this.isElementListTruncated = !1, this.incrementalRowComputer = new T(this), this.tableTool = new qi(this), this.tableOperate = new Io(this), this.pageNumber = new Vi(this), this.lineNumber = new Mo(this), this.waterMark = new aa(this), this.placeholder = new Oo(this), this.header = new ea(this, n.header), this.footer = new To(this, n.footer), this.hyperlinkParticle = new Xi(this), this.hintParticle = new Zi(this), this.traceParticle = new Qi(this), this.labelParticle = new $i(this), this.dateParticle = new mo(this), this.separatorParticle = new ra(this), this.pageBreakParticle = new ia(this), this.superscriptParticle = new ta(), this.subscriptParticle = new na(), this.checkboxParticle = new Ka(this), this.radioParticle = new qa(this), this.blockParticle = new _o(this), this.listParticle = new Eo(this), this.lineBreakParticle = new Do(this), this.whiteSpaceParticle = new Ao(this), this.control = new va(this), this.cascadeManager = new Wa(this), this.validate = new Ga(this), this.pageBorder = new No(this), this.graffiti = new Bo(this, n.graffiti), this.columnManager = new C(this), this.ruler = new Yi(this), this.scrollObserver = new Hi(this), this.selectionObserver = new Ui(this), this.imageObserver = new So(), new jo(this), this.canvasEvent = new gi(this), this.cursor = new Tr(this, this.canvasEvent), this.canvasEvent.register(), this.globalEvent = new vi(this, this.canvasEvent), this.globalEvent.register(), this.workerManager = new lo(this), new Fo(this), this.accessibility = new Ho(this);
|
|
17844
17862
|
let { letterClass: o } = t;
|
|
17845
17863
|
this.LETTER_REG = RegExp(`[${o.join("")}]`), this.WORD_LIKE_REG = RegExp(`${o.map((e) => `[^${e}][${e}]`).join("|")}`), this.rowList = [], this.pageRowList = [], this.painterStyle = null, this.painterOptions = null, this.visiblePageNoList = [], this.intersectionPageNo = 0, this.lazyRenderIntersectionObserver = null, this.printModeData = null, this.controlMinWidthPlaceholderElementListSet = /* @__PURE__ */ new WeakSet(), this.mode === g.PRINT && this.setPrintData(), this.render({
|
|
17846
17864
|
isInit: !0,
|
|
@@ -18438,7 +18456,7 @@ var Po = class {
|
|
|
18438
18456
|
isSetCursor: !1,
|
|
18439
18457
|
isSubmitHistory: !1
|
|
18440
18458
|
}), l = [];
|
|
18441
|
-
t ? l =
|
|
18459
|
+
t ? l = Ti(() => this.pageList, c).textLayerList : c(), await this.imageObserver.allSettled(), i && await this.blockParticle.drawIframeToPage(this.pageList, i);
|
|
18442
18460
|
let u = this.pageList.map((e) => e.toDataURL());
|
|
18443
18461
|
return n && this.setPagePixelRatio(null), s && s(), o && this.setMode(a), {
|
|
18444
18462
|
dataUrlList: u,
|
|
@@ -18748,7 +18766,7 @@ var Po = class {
|
|
|
18748
18766
|
let t = a[e];
|
|
18749
18767
|
t.height = Math.max(o, t.minHeight || 0), t.minHeight = t.height;
|
|
18750
18768
|
}
|
|
18751
|
-
_ || (
|
|
18769
|
+
_ || (Ya(s.colgroup, this.getOriginalInnerWidth(), g), s.translateX = 0), this.tableParticle.computeRowColInfo(s);
|
|
18752
18770
|
for (let t = 0; t < a.length; t++) {
|
|
18753
18771
|
let n = a[t];
|
|
18754
18772
|
for (let o = 0; o < n.tdList.length; o++) {
|
|
@@ -18901,7 +18919,7 @@ var Po = class {
|
|
|
18901
18919
|
}
|
|
18902
18920
|
}
|
|
18903
18921
|
s.listId && (e.isList = !0, e.offsetX = (S.get(s.listId) || 0) + (s.listLevel ? this.listParticle.LIST_INDENT_WIDTH * s.listLevel * f : 0), e.listIndex = I.get(s.listId) ?? 0), e.offsetY = !i && s.area?.top && s.areaId !== n[t - 1]?.areaId ? s.area.top * f : 0, C.push(e);
|
|
18904
|
-
} else e.resume && o.elementList.length === 0 && t !== 0 && (s.listId && (o.isList = !0, o.offsetX = (S.get(s.listId) || 0) + (s.listLevel ? this.listParticle.LIST_INDENT_WIDTH * s.listLevel * f : 0), o.listIndex = I.get(s.listId) ?? 0), o.offsetY = !i && s.area?.top && s.areaId !== n[t - 1]?.areaId ? s.area.top * f : 0), o.width += z.width, t === 0 && (
|
|
18922
|
+
} else e.resume && o.elementList.length === 0 && t !== 0 && (s.listId && (o.isList = !0, o.offsetX = (S.get(s.listId) || 0) + (s.listLevel ? this.listParticle.LIST_INDENT_WIDTH * s.listLevel * f : 0), o.listIndex = I.get(s.listId) ?? 0), o.offsetY = !i && s.area?.top && s.areaId !== n[t - 1]?.areaId ? s.area.top * f : 0), o.width += z.width, t === 0 && (nr(n[1]) || n[1]?.areaId) ? (o.height = y, o.ascent = y) : o.height < se && (o.height = se, o.ascent = oe), o.elementList.push(V);
|
|
18905
18923
|
if (me || t === n.length - 1) {
|
|
18906
18924
|
if (!this.isDesignMode() && o.height > 0) {
|
|
18907
18925
|
let e = o.elementList.filter((e) => e.value !== "");
|
|
@@ -18922,7 +18940,7 @@ var Po = class {
|
|
|
18922
18940
|
let e = s.type === w.PAGE_BREAK, t = s.paperDirection || this.options.paperDirection;
|
|
18923
18941
|
e && t !== j && (j = t, M = this.getMargins(j), ee = this.getWidth(j) - M[1] - M[3], N = M[3], P = this.getHeight(j), T = this.columnManager.getLayout(j), E = !!T && T.count > 1);
|
|
18924
18942
|
let n = this.getMainOuterHeight(A, j);
|
|
18925
|
-
(k - F + n + se > P || e) && (!e && E && T && te < T.count - 1 ? (te += 1, k = F, O = N + (T.offsets[te] || 0)) : (
|
|
18943
|
+
(k - F + n + se > P || e) && (!e && E && T && te < T.count - 1 ? (te += 1, k = F, O = N + (T.offsets[te] || 0)) : (ar(u, A), A += 1, te = 0, F = M[0] + this.getHeader().getExtraHeight(A), k = F, O = N + (T && T.offsets[0] || 0)));
|
|
18926
18944
|
}
|
|
18927
18945
|
let a = C[C.length - 1];
|
|
18928
18946
|
a && E && a.columnIndex !== void 0 && (a.columnIndex = te), V.left = 0;
|
|
@@ -19203,7 +19221,7 @@ var Po = class {
|
|
|
19203
19221
|
pageHeight: i,
|
|
19204
19222
|
isPagingMode: f,
|
|
19205
19223
|
innerWidth: d,
|
|
19206
|
-
surroundElementList:
|
|
19224
|
+
surroundElementList: ir(this.elementList),
|
|
19207
19225
|
elementList: this.elementList
|
|
19208
19226
|
}, u = this.incrementalRowComputer.tryCompute(this.incrementalRowComputer.consumeDirtyRange(), o);
|
|
19209
19227
|
this.rawRowList = u?.rowList ?? this.computeRowList(o), this.incrementalRowComputer.observeLayout(), this.rowList = f ? this.tablePaging.splitTableRowAcrossPages(this.rawRowList) : this.rawRowList, this.isElementListTruncated = !1, this.pageRowList = this._computePageList();
|
|
@@ -19246,7 +19264,7 @@ var Po = class {
|
|
|
19246
19264
|
}
|
|
19247
19265
|
submitHistory(e) {
|
|
19248
19266
|
if (this.options.historyMaxRecordCount === 0) return;
|
|
19249
|
-
let t = this.position.getPositionContext(), n =
|
|
19267
|
+
let t = this.position.getPositionContext(), n = tr(this.elementList), r = tr(this.header.getElementList()), i = tr(this.footer.getElementList()), a = N(this.range.getRange()), o = this.pageNo, s = N(t), c = this.zone.getZone();
|
|
19250
19268
|
this.historyManager.execute(() => {
|
|
19251
19269
|
this.zone.setZone(c), this.setPageNo(o), this.position.setPositionContext(N(s)), this.header.setElementList(N(r)), this.footer.setElementList(N(i)), this.elementList = N(n), this.range.replaceRange(N(a)), this.render({
|
|
19252
19270
|
curIndex: e,
|
|
@@ -19261,7 +19279,7 @@ var Po = class {
|
|
|
19261
19279
|
clearSideEffect() {
|
|
19262
19280
|
this.getPreviewer().clearResizer(), this.getTableTool().dispose(), this.getHyperlinkParticle().clearHyperlinkPopup(), this.getHintParticle().clearHintPopup(), this.getTraceParticle().clearTracePopup(), this.getDateParticle().clearDatePicker();
|
|
19263
19281
|
}
|
|
19264
|
-
},
|
|
19282
|
+
}, Wo = class {
|
|
19265
19283
|
executeMode;
|
|
19266
19284
|
executeCut;
|
|
19267
19285
|
executeCopy;
|
|
@@ -19438,7 +19456,7 @@ var Po = class {
|
|
|
19438
19456
|
};
|
|
19439
19457
|
//#endregion
|
|
19440
19458
|
//#region src/editor/utils/paragraph.ts
|
|
19441
|
-
function
|
|
19459
|
+
function Go(e, t) {
|
|
19442
19460
|
let n = 0;
|
|
19443
19461
|
for (let r = 1; r < t; r++) {
|
|
19444
19462
|
let t = e[r], i = e[r - 1];
|
|
@@ -19448,7 +19466,7 @@ function Vo(e, t) {
|
|
|
19448
19466
|
}
|
|
19449
19467
|
//#endregion
|
|
19450
19468
|
//#region src/editor/utils/print.ts
|
|
19451
|
-
function
|
|
19469
|
+
function Ko(e, t) {
|
|
19452
19470
|
return e === 1125 && t === 1593 ? {
|
|
19453
19471
|
size: "a3",
|
|
19454
19472
|
width: "297mm",
|
|
@@ -19467,17 +19485,17 @@ function Ho(e, t) {
|
|
|
19467
19485
|
height: `${t}px`
|
|
19468
19486
|
};
|
|
19469
19487
|
}
|
|
19470
|
-
async function
|
|
19488
|
+
async function qo(e, t) {
|
|
19471
19489
|
let { width: n, height: r, direction: i = b.VERTICAL, pageDirections: a, iframeInfoList: o = [], textLayerList: s = [] } = t, c = document.createElement("iframe");
|
|
19472
19490
|
c.style.visibility = "hidden", c.style.position = "absolute", c.style.left = "0", c.style.top = "0", c.style.width = "0", c.style.height = "0", c.style.border = "none", document.body.append(c);
|
|
19473
19491
|
let l = c.contentWindow, u = l.document;
|
|
19474
19492
|
u.open();
|
|
19475
|
-
let d = document.createElement("div"), f =
|
|
19493
|
+
let d = document.createElement("div"), f = Ko(n, r), p = (e) => a?.[e] || i, m = p(0), h = p(e.length - 1), g = e.some((e, t) => p(t) !== m);
|
|
19476
19494
|
e.forEach((t, n) => {
|
|
19477
19495
|
let r = p(n), i = document.createElement("div");
|
|
19478
19496
|
i.style.position = "relative", i.style.width = r === b.HORIZONTAL ? f.height : f.width, i.style.height = r === b.HORIZONTAL ? f.width : f.height, g && n < e.length - 1 && i.style.setProperty("page", r === b.HORIZONTAL ? "cado-editor-landscape" : "cado-editor-portrait");
|
|
19479
19497
|
let a = document.createElement("img");
|
|
19480
|
-
a.style.width = "100%", a.style.height = "100%", a.style.position = "absolute", a.style.left = "0", a.style.top = "0", a.src = t, i.append(a), s[n]?.length && i.append(
|
|
19498
|
+
a.style.width = "100%", a.style.height = "100%", a.style.position = "absolute", a.style.left = "0", a.style.top = "0", a.src = t, i.append(a), s[n]?.length && i.append(Ei(document, s[n])), (o[n] || []).forEach((e) => {
|
|
19481
19499
|
let t = document.createElement("iframe");
|
|
19482
19500
|
if (t.style.position = "absolute", t.style.left = `${e.x}px`, t.style.top = `${e.y}px`, t.style.width = `${e.width}px`, t.style.height = `${e.height}px`, t.style.border = "none", e.src) t.src = e.src;
|
|
19483
19501
|
else if (e.srcdoc) {
|
|
@@ -19508,13 +19526,13 @@ async function Uo(e, t) {
|
|
|
19508
19526
|
margin: 0;
|
|
19509
19527
|
size: ${f.size} ${m === b.HORIZONTAL ? "landscape" : "portrait"};
|
|
19510
19528
|
}`}`;
|
|
19511
|
-
_.append(document.createTextNode(v)), u.write(`${_.outerHTML}${d.innerHTML}`), o.length && await
|
|
19512
|
-
|
|
19529
|
+
_.append(document.createTextNode(v)), u.write(`${_.outerHTML}${d.innerHTML}`), o.length && await Jo(u), setTimeout(async () => {
|
|
19530
|
+
Di(u), l.print(), u.close(), window.addEventListener("mouseover", () => {
|
|
19513
19531
|
c?.remove();
|
|
19514
19532
|
}, { once: !0 });
|
|
19515
19533
|
});
|
|
19516
19534
|
}
|
|
19517
|
-
async function
|
|
19535
|
+
async function Jo(e) {
|
|
19518
19536
|
let t = Array.from(e.querySelectorAll("iframe")).map((e) => new Promise((t) => {
|
|
19519
19537
|
e.srcdoc ? e.contentWindow?.addEventListener("message", (e) => {
|
|
19520
19538
|
e.data.type === "__LOADED_TO_CADO_EDITOR__" && t(!0);
|
|
@@ -19524,7 +19542,7 @@ async function Wo(e) {
|
|
|
19524
19542
|
}
|
|
19525
19543
|
//#endregion
|
|
19526
19544
|
//#region src/editor/utils/diff.ts
|
|
19527
|
-
function
|
|
19545
|
+
function Yo(e, t, n) {
|
|
19528
19546
|
if (!n) return;
|
|
19529
19547
|
let r = e[e.length - 1];
|
|
19530
19548
|
r && r.type === t ? r.value += n : e.push({
|
|
@@ -19532,7 +19550,7 @@ function Go(e, t, n) {
|
|
|
19532
19550
|
value: n
|
|
19533
19551
|
});
|
|
19534
19552
|
}
|
|
19535
|
-
function
|
|
19553
|
+
function Xo(e, t) {
|
|
19536
19554
|
let n = e.length, r = t.length, i = Math.ceil((n + r) / 2), a = n - r, o = i, s = Array(2 * i + 1).fill(0), c = Array(2 * i + 1).fill(0);
|
|
19537
19555
|
for (let l = 0; l <= i; l++) {
|
|
19538
19556
|
for (let i = -l; i <= l; i += 2) {
|
|
@@ -19574,30 +19592,30 @@ function Ko(e, t) {
|
|
|
19574
19592
|
d: n + r
|
|
19575
19593
|
};
|
|
19576
19594
|
}
|
|
19577
|
-
function
|
|
19595
|
+
function Zo(e, t, n, r, i, a, o) {
|
|
19578
19596
|
let s = 0;
|
|
19579
19597
|
for (; t + s < n && i + s < a && e[t + s] === r[i + s];) s++;
|
|
19580
|
-
s &&
|
|
19598
|
+
s && Yo(o, "equal", e.slice(t, t + s).join("")), t += s, i += s;
|
|
19581
19599
|
let c = 0;
|
|
19582
19600
|
for (; n - 1 - c >= t && a - 1 - c >= i && e[n - 1 - c] === r[a - 1 - c];) c++;
|
|
19583
19601
|
let l = n - c, u = a - c;
|
|
19584
|
-
if (t >= l)
|
|
19585
|
-
else if (i >= u)
|
|
19602
|
+
if (t >= l) Yo(o, "insert", r.slice(i, u).join(""));
|
|
19603
|
+
else if (i >= u) Yo(o, "delete", e.slice(t, l).join(""));
|
|
19586
19604
|
else {
|
|
19587
|
-
let n = e.slice(t, l), a = r.slice(i, u), s =
|
|
19588
|
-
s.d <= 1 ? (
|
|
19605
|
+
let n = e.slice(t, l), a = r.slice(i, u), s = Xo(n, a);
|
|
19606
|
+
s.d <= 1 ? (Yo(o, "delete", n.join("")), Yo(o, "insert", a.join(""))) : (Zo(e, t, t + s.x, r, i, i + s.y, o), (s.u !== s.x || s.v !== s.y) && Yo(o, "equal", n.slice(s.x, s.u).join("")), Zo(e, t + s.u, l, r, i + s.v, u, o));
|
|
19589
19607
|
}
|
|
19590
|
-
c &&
|
|
19608
|
+
c && Yo(o, "equal", e.slice(l, n).join(""));
|
|
19591
19609
|
}
|
|
19592
|
-
function
|
|
19610
|
+
function Qo(e, t) {
|
|
19593
19611
|
let n = [...e], r = [...t], i = [];
|
|
19594
|
-
return
|
|
19612
|
+
return Zo(n, 0, n.length, r, 0, r.length, i), i;
|
|
19595
19613
|
}
|
|
19596
|
-
function
|
|
19614
|
+
function $o(e) {
|
|
19597
19615
|
let t = e.split("\n");
|
|
19598
19616
|
return t.map((e, n) => n < t.length - 1 ? `${e}\n` : e);
|
|
19599
19617
|
}
|
|
19600
|
-
function
|
|
19618
|
+
function es(e, t) {
|
|
19601
19619
|
if (e === t) return 1;
|
|
19602
19620
|
if (!e.length || !t.length) return 0;
|
|
19603
19621
|
let n = (n) => {
|
|
@@ -19616,31 +19634,31 @@ function Xo(e, t) {
|
|
|
19616
19634
|
};
|
|
19617
19635
|
return Math.max(n(1), n(2));
|
|
19618
19636
|
}
|
|
19619
|
-
var
|
|
19620
|
-
function
|
|
19621
|
-
let r =
|
|
19637
|
+
var ts = .5;
|
|
19638
|
+
function ns(e, t, n) {
|
|
19639
|
+
let r = $o(t), i = $o(n), a = Math.max(r.length, i.length);
|
|
19622
19640
|
for (let t = 0; t < a; t++) {
|
|
19623
19641
|
let n = r[t], a = i[t];
|
|
19624
|
-
if (n !== void 0 && a !== void 0 && (n === a ||
|
|
19625
|
-
else n !== void 0 &&
|
|
19642
|
+
if (n !== void 0 && a !== void 0 && (n === a || es(n, a) >= ts)) for (let t of Qo(n, a)) Yo(e, t.type, t.value);
|
|
19643
|
+
else n !== void 0 && Yo(e, "delete", n), a !== void 0 && Yo(e, "insert", a);
|
|
19626
19644
|
}
|
|
19627
19645
|
}
|
|
19628
|
-
function
|
|
19629
|
-
if (!e.includes("\n") && !t.includes("\n")) return
|
|
19630
|
-
let n =
|
|
19631
|
-
|
|
19646
|
+
function rs(e, t) {
|
|
19647
|
+
if (!e.includes("\n") && !t.includes("\n")) return Qo(e, t);
|
|
19648
|
+
let n = $o(e), r = $o(t), i = [];
|
|
19649
|
+
Zo(n, 0, n.length, r, 0, r.length, i);
|
|
19632
19650
|
let a = [];
|
|
19633
19651
|
for (let e = 0; e < i.length; e++) {
|
|
19634
19652
|
let t = i[e], n = i[e + 1];
|
|
19635
|
-
t.type === "delete" && n?.type === "insert" ? (
|
|
19653
|
+
t.type === "delete" && n?.type === "insert" ? (ns(a, t.value, n.value), e++) : t.type === "insert" && n?.type === "delete" ? (ns(a, n.value, t.value), e++) : Yo(a, t.type, t.value);
|
|
19636
19654
|
}
|
|
19637
19655
|
return a;
|
|
19638
19656
|
}
|
|
19639
|
-
function
|
|
19657
|
+
function is(e) {
|
|
19640
19658
|
let t = e[0], n = t.control?.conceptId || t.controlId;
|
|
19641
19659
|
return n ? `control:${n}` : t.type === w.LIST && t.listId ? `list:${t.listId}` : t.type === w.TITLE && t.titleId ? `title:${t.titleId}` : t.type === w.HYPERLINK && t.url ? `hyperlink:${t.url}` : null;
|
|
19642
19660
|
}
|
|
19643
|
-
function
|
|
19661
|
+
function as(e) {
|
|
19644
19662
|
let t = [[]], n = [];
|
|
19645
19663
|
return e.forEach((e, r) => {
|
|
19646
19664
|
if (Ln(e)) {
|
|
@@ -19660,13 +19678,13 @@ function ts(e) {
|
|
|
19660
19678
|
elements: [e],
|
|
19661
19679
|
key: null
|
|
19662
19680
|
};
|
|
19663
|
-
a.key =
|
|
19681
|
+
a.key = is(a.elements), n.push(a), t.push([]);
|
|
19664
19682
|
}), {
|
|
19665
19683
|
segments: t,
|
|
19666
19684
|
anchors: n
|
|
19667
19685
|
};
|
|
19668
19686
|
}
|
|
19669
|
-
function
|
|
19687
|
+
function os(e, t, n, r) {
|
|
19670
19688
|
let i = [], a = () => {
|
|
19671
19689
|
if (!i.length) return;
|
|
19672
19690
|
let n = t[i[0].elementIndex], a = {
|
|
@@ -19678,45 +19696,45 @@ function ns(e, t, n, r) {
|
|
|
19678
19696
|
for (let e of n) i.length && e.elementIndex !== i[0].elementIndex && a(), i.push(e);
|
|
19679
19697
|
a();
|
|
19680
19698
|
}
|
|
19681
|
-
function
|
|
19699
|
+
function ss(e, t) {
|
|
19682
19700
|
for (let n of e) {
|
|
19683
19701
|
let e = n.trace || [];
|
|
19684
|
-
e[e.length - 1]?.type !== t && (n.trace = [...e, { type: t }]), n.control?.value &&
|
|
19685
|
-
for (let e of n.trList || []) for (let n of e.tdList)
|
|
19702
|
+
e[e.length - 1]?.type !== t && (n.trace = [...e, { type: t }]), n.control?.value && ss(n.control.value, t), n.valueList && ss(n.valueList, t);
|
|
19703
|
+
for (let e of n.trList || []) for (let n of e.tdList) ss(n.value, t);
|
|
19686
19704
|
}
|
|
19687
19705
|
}
|
|
19688
|
-
function
|
|
19706
|
+
function cs(e, t) {
|
|
19689
19707
|
let n = e || [], r = t || [], i = [], a = Math.min(n.length, r.length);
|
|
19690
19708
|
for (let e = 0; e < a; e++) {
|
|
19691
19709
|
let t = r[e], a = n[e].tdList, o = t.tdList, s = Math.min(a.length, o.length);
|
|
19692
|
-
for (let e = 0; e < s; e++) o[e].value =
|
|
19693
|
-
for (let e = s; e < a.length; e++)
|
|
19694
|
-
for (let e = s; e < o.length; e++)
|
|
19710
|
+
for (let e = 0; e < s; e++) o[e].value = hs(a[e].value, o[e].value);
|
|
19711
|
+
for (let e = s; e < a.length; e++) ss(a[e].value, q.DELETED), t.tdList.push(a[e]);
|
|
19712
|
+
for (let e = s; e < o.length; e++) ss(o[e].value, q.INSERTED);
|
|
19695
19713
|
i.push(t);
|
|
19696
19714
|
}
|
|
19697
19715
|
for (let e = a; e < n.length; e++) {
|
|
19698
|
-
for (let t of n[e].tdList)
|
|
19716
|
+
for (let t of n[e].tdList) ss(t.value, q.DELETED);
|
|
19699
19717
|
i.push(n[e]);
|
|
19700
19718
|
}
|
|
19701
19719
|
for (let e = a; e < r.length; e++) {
|
|
19702
|
-
for (let t of r[e].tdList)
|
|
19720
|
+
for (let t of r[e].tdList) ss(t.value, q.INSERTED);
|
|
19703
19721
|
i.push(r[e]);
|
|
19704
19722
|
}
|
|
19705
19723
|
return i;
|
|
19706
19724
|
}
|
|
19707
|
-
function
|
|
19725
|
+
function ls(e, t) {
|
|
19708
19726
|
let n = e.elements[0], r = t.elements[0];
|
|
19709
19727
|
if (e.elements.length === 1 && t.elements.length === 1 && n.type === r.type) {
|
|
19710
19728
|
if (r.type === w.CONTROL && r.control) return r.control = {
|
|
19711
19729
|
...r.control,
|
|
19712
|
-
value:
|
|
19730
|
+
value: hs(n.control?.value || [], r.control.value || [])
|
|
19713
19731
|
}, [r];
|
|
19714
|
-
if (n.valueList || r.valueList) return r.valueList =
|
|
19715
|
-
if (n.trList || r.trList) return r.trList =
|
|
19732
|
+
if (n.valueList || r.valueList) return r.valueList = hs(n.valueList || [], r.valueList || []), [r];
|
|
19733
|
+
if (n.trList || r.trList) return r.trList = cs(n.trList, r.trList), [r];
|
|
19716
19734
|
}
|
|
19717
19735
|
return t.elements;
|
|
19718
19736
|
}
|
|
19719
|
-
function
|
|
19737
|
+
function us(e) {
|
|
19720
19738
|
let t = "", n = (e) => {
|
|
19721
19739
|
for (let r of e) {
|
|
19722
19740
|
t += r.value || "", r.control?.value && n(r.control.value), r.valueList && n(r.valueList);
|
|
@@ -19725,15 +19743,15 @@ function os(e) {
|
|
|
19725
19743
|
};
|
|
19726
19744
|
return n(e.elements), t;
|
|
19727
19745
|
}
|
|
19728
|
-
var
|
|
19729
|
-
function
|
|
19730
|
-
return e.key && t.key && e.key === t.key ? 2 : e.elements[0].type === t.elements[0].type ? !n && !r ? e.key && t.key ? 0 : 1 : +(
|
|
19746
|
+
var ds = .5;
|
|
19747
|
+
function fs(e, t, n, r) {
|
|
19748
|
+
return e.key && t.key && e.key === t.key ? 2 : e.elements[0].type === t.elements[0].type ? !n && !r ? e.key && t.key ? 0 : 1 : +(es(n, r) >= ds) : 0;
|
|
19731
19749
|
}
|
|
19732
|
-
function
|
|
19733
|
-
let n = e.length, r = t.length, i = e.map(
|
|
19750
|
+
function ps(e, t) {
|
|
19751
|
+
let n = e.length, r = t.length, i = e.map(us), a = t.map(us), o = [], s = [];
|
|
19734
19752
|
for (let e = 0; e <= n; e++) o.push(Array(r + 1).fill(0)), s.push(Array(r + 1).fill(0));
|
|
19735
19753
|
for (let c = 1; c <= n; c++) for (let n = 1; n <= r; n++) {
|
|
19736
|
-
let r =
|
|
19754
|
+
let r = fs(e[c - 1], t[n - 1], i[c - 1], a[n - 1]);
|
|
19737
19755
|
o[c][n] = r, s[c][n] = Math.max(s[c - 1][n], s[c][n - 1], r > 0 ? s[c - 1][n - 1] + r : 0);
|
|
19738
19756
|
}
|
|
19739
19757
|
let c = /* @__PURE__ */ new Map(), l = n, u = r;
|
|
@@ -19743,39 +19761,39 @@ function ls(e, t) {
|
|
|
19743
19761
|
}
|
|
19744
19762
|
return c;
|
|
19745
19763
|
}
|
|
19746
|
-
function
|
|
19747
|
-
let a =
|
|
19764
|
+
function ms(e, t, n, r, i) {
|
|
19765
|
+
let a = rs(r.map((e) => e.char).join(""), i.map((e) => e.char).join("")), o = 0, s = 0;
|
|
19748
19766
|
for (let c of a) {
|
|
19749
19767
|
let a = [...c.value].length;
|
|
19750
|
-
c.type === "equal" ? (
|
|
19768
|
+
c.type === "equal" ? (os(e, n, i.slice(s, s + a)), o += a, s += a) : c.type === "insert" ? (os(e, n, i.slice(s, s + a), q.INSERTED), s += a) : (os(e, t, r.slice(o, o + a), q.DELETED), o += a);
|
|
19751
19769
|
}
|
|
19752
19770
|
}
|
|
19753
|
-
function
|
|
19754
|
-
let n =
|
|
19755
|
-
|
|
19771
|
+
function hs(e, t) {
|
|
19772
|
+
let n = as(e), r = as(t), i = ps(n.anchors, r.anchors), a = new Set(i.values()), o = [], s = 0, c = (t) => {
|
|
19773
|
+
os(o, e, n.segments[t] || [], q.DELETED);
|
|
19756
19774
|
let r = n.anchors[t];
|
|
19757
|
-
|
|
19775
|
+
ss(r.elements, q.DELETED), o.push(...r.elements);
|
|
19758
19776
|
};
|
|
19759
19777
|
for (let l = 0; l < r.anchors.length; l++) {
|
|
19760
19778
|
let u = i.get(l);
|
|
19761
19779
|
if (u === void 0) {
|
|
19762
|
-
|
|
19780
|
+
os(o, t, r.segments[l] || [], q.INSERTED);
|
|
19763
19781
|
let e = r.anchors[l];
|
|
19764
|
-
|
|
19782
|
+
ss(e.elements, q.INSERTED), o.push(...e.elements);
|
|
19765
19783
|
continue;
|
|
19766
19784
|
}
|
|
19767
19785
|
for (; s < u;) a.has(s) || c(s), s++;
|
|
19768
|
-
s = u + 1,
|
|
19786
|
+
s = u + 1, ms(o, e, t, n.segments[u] || [], r.segments[l] || []), o.push(...ls(n.anchors[u], r.anchors[l]));
|
|
19769
19787
|
}
|
|
19770
19788
|
for (; s < n.anchors.length;) a.has(s) || c(s), s++;
|
|
19771
|
-
return
|
|
19789
|
+
return ms(o, e, t, n.segments[n.anchors.length] || [], r.segments[r.anchors.length] || []), o;
|
|
19772
19790
|
}
|
|
19773
|
-
function
|
|
19774
|
-
return
|
|
19791
|
+
function gs(e, t) {
|
|
19792
|
+
return hs(N(e), N(t));
|
|
19775
19793
|
}
|
|
19776
19794
|
//#endregion
|
|
19777
19795
|
//#region src/editor/core/command/CommandAdapt.ts
|
|
19778
|
-
var
|
|
19796
|
+
var _s = class {
|
|
19779
19797
|
draw;
|
|
19780
19798
|
range;
|
|
19781
19799
|
position;
|
|
@@ -19801,7 +19819,7 @@ var ps = class {
|
|
|
19801
19819
|
await this.canvasEvent.copy(e);
|
|
19802
19820
|
}
|
|
19803
19821
|
paste(e) {
|
|
19804
|
-
this.draw.isReadonly() || this.draw.isDisabled() ||
|
|
19822
|
+
this.draw.isReadonly() || this.draw.isDisabled() || br(this.canvasEvent, e);
|
|
19805
19823
|
}
|
|
19806
19824
|
selectAll() {
|
|
19807
19825
|
this.canvasEvent.selectAll();
|
|
@@ -20493,7 +20511,7 @@ var ps = class {
|
|
|
20493
20511
|
if (e?.offscreen) {
|
|
20494
20512
|
let t = e.data ?? this.draw.getValue().data, n = e.options ?? this.draw.getOptions(), r = document.createElement("div");
|
|
20495
20513
|
r.style.position = "absolute", r.style.left = "-9999px", r.style.top = "0", r.style.visibility = "hidden", document.body.append(r);
|
|
20496
|
-
let { default: i } = await Promise.resolve().then(() =>
|
|
20514
|
+
let { default: i } = await Promise.resolve().then(() => kl), a = null;
|
|
20497
20515
|
try {
|
|
20498
20516
|
a = new i(r, t, n), await a.command.executePrint();
|
|
20499
20517
|
} finally {
|
|
@@ -20507,7 +20525,7 @@ var ps = class {
|
|
|
20507
20525
|
pixelRatio: n,
|
|
20508
20526
|
mode: g.PRINT
|
|
20509
20527
|
});
|
|
20510
|
-
await
|
|
20528
|
+
await qo(o, {
|
|
20511
20529
|
width: i,
|
|
20512
20530
|
height: a,
|
|
20513
20531
|
textLayerList: s,
|
|
@@ -20581,9 +20599,9 @@ var ps = class {
|
|
|
20581
20599
|
getText() {
|
|
20582
20600
|
let e = this.draw.getHeaderElementList(), t = this.draw.getOriginalMainElementList(), n = this.draw.getFooterElementList();
|
|
20583
20601
|
return {
|
|
20584
|
-
header:
|
|
20585
|
-
main:
|
|
20586
|
-
footer:
|
|
20602
|
+
header: $n(On(e), { isClone: !1 }),
|
|
20603
|
+
main: $n(On(t), { isClone: !1 }),
|
|
20604
|
+
footer: $n(On(n), { isClone: !1 })
|
|
20587
20605
|
};
|
|
20588
20606
|
}
|
|
20589
20607
|
getWordCount() {
|
|
@@ -20606,7 +20624,7 @@ var ps = class {
|
|
|
20606
20624
|
isHandleFirstElement: !1,
|
|
20607
20625
|
editorOptions: this.options
|
|
20608
20626
|
});
|
|
20609
|
-
let r =
|
|
20627
|
+
let r = ir(n);
|
|
20610
20628
|
return this.draw.computeRowList({
|
|
20611
20629
|
innerWidth: t,
|
|
20612
20630
|
elementList: n,
|
|
@@ -20659,7 +20677,7 @@ var ps = class {
|
|
|
20659
20677
|
}
|
|
20660
20678
|
A--;
|
|
20661
20679
|
}
|
|
20662
|
-
let j =
|
|
20680
|
+
let j = Go(a, e), M = e === t ? j : Go(a, t);
|
|
20663
20681
|
return N({
|
|
20664
20682
|
isCollapsed: n,
|
|
20665
20683
|
startElement: o,
|
|
@@ -21032,7 +21050,7 @@ var ps = class {
|
|
|
21032
21050
|
}
|
|
21033
21051
|
}
|
|
21034
21052
|
setHTML(e) {
|
|
21035
|
-
let { header: t, main: n, footer: r } = e, i = this.draw.getOriginalInnerWidth(), a = (e) => e === void 0 ? void 0 :
|
|
21053
|
+
let { header: t, main: n, footer: r } = e, i = this.draw.getOriginalInnerWidth(), a = (e) => e === void 0 ? void 0 : Qn(e, { innerWidth: i });
|
|
21036
21054
|
this.setValue({
|
|
21037
21055
|
header: a(t),
|
|
21038
21056
|
main: a(n),
|
|
@@ -21246,7 +21264,7 @@ var ps = class {
|
|
|
21246
21264
|
let l = On(s);
|
|
21247
21265
|
n.push({
|
|
21248
21266
|
...o.title,
|
|
21249
|
-
value:
|
|
21267
|
+
value: $n(l),
|
|
21250
21268
|
elementList: X(l, { isClone: !1 }),
|
|
21251
21269
|
zone: i
|
|
21252
21270
|
}), a = c;
|
|
@@ -21372,14 +21390,14 @@ var ps = class {
|
|
|
21372
21390
|
this.draw.setTraceEnabled(t);
|
|
21373
21391
|
}
|
|
21374
21392
|
compare(e) {
|
|
21375
|
-
let t = e.newData ?? kn(this.getValue().data.main), n =
|
|
21393
|
+
let t = e.newData ?? kn(this.getValue().data.main), n = gs(e.oldData, t);
|
|
21376
21394
|
this.draw.setValue({ main: n }), this.draw.setMode(g.TRACE);
|
|
21377
21395
|
}
|
|
21378
21396
|
toggleRuler(e) {
|
|
21379
21397
|
let t = e === void 0 ? this.draw.getOptions().ruler.disabled : e;
|
|
21380
21398
|
this.draw.setRulerEnabled(t);
|
|
21381
21399
|
}
|
|
21382
|
-
},
|
|
21400
|
+
}, vs = class {
|
|
21383
21401
|
draw;
|
|
21384
21402
|
command;
|
|
21385
21403
|
eventBus;
|
|
@@ -21416,18 +21434,18 @@ var ps = class {
|
|
|
21416
21434
|
}
|
|
21417
21435
|
});
|
|
21418
21436
|
}
|
|
21419
|
-
},
|
|
21437
|
+
}, ys = /var\(\s*(--[\w-]+)\s*(?:,\s*((?:[^()]|\([^()]*\))*?))?\s*\)/g, bs = [
|
|
21420
21438
|
"class",
|
|
21421
21439
|
"style",
|
|
21422
21440
|
"data-theme"
|
|
21423
21441
|
];
|
|
21424
|
-
function
|
|
21442
|
+
function xs(e) {
|
|
21425
21443
|
return typeof e == "object" && !!e && !Array.isArray(e) && Object.getPrototypeOf(e) === Object.prototype;
|
|
21426
21444
|
}
|
|
21427
|
-
function
|
|
21445
|
+
function Ss(e) {
|
|
21428
21446
|
return typeof e == "string" && e.includes("var(");
|
|
21429
21447
|
}
|
|
21430
|
-
var
|
|
21448
|
+
var Cs = class {
|
|
21431
21449
|
options;
|
|
21432
21450
|
container;
|
|
21433
21451
|
onChange;
|
|
@@ -21444,7 +21462,7 @@ var ys = class {
|
|
|
21444
21462
|
track(e, t = "") {
|
|
21445
21463
|
Object.entries(e).forEach(([e, n]) => {
|
|
21446
21464
|
let r = t ? `${t}.${e}` : e;
|
|
21447
|
-
|
|
21465
|
+
xs(n) ? this.track(n, r) : Ss(n) ? this.rawValues.set(r, n) : this.rawValues.delete(r);
|
|
21448
21466
|
});
|
|
21449
21467
|
}
|
|
21450
21468
|
resolve() {
|
|
@@ -21454,7 +21472,7 @@ var ys = class {
|
|
|
21454
21472
|
let i = this.resolveValue(n, e), a = r.split("."), o = a.pop(), s = this.options;
|
|
21455
21473
|
for (let e of a) {
|
|
21456
21474
|
let t = s[e];
|
|
21457
|
-
if (!
|
|
21475
|
+
if (!xs(t)) return;
|
|
21458
21476
|
s = t;
|
|
21459
21477
|
}
|
|
21460
21478
|
s[o] !== i && (s[o] = i, t = !0);
|
|
@@ -21465,7 +21483,7 @@ var ys = class {
|
|
|
21465
21483
|
this.observer = new MutationObserver(this.schedule);
|
|
21466
21484
|
let e = {
|
|
21467
21485
|
attributes: !0,
|
|
21468
|
-
attributeFilter:
|
|
21486
|
+
attributeFilter: bs
|
|
21469
21487
|
};
|
|
21470
21488
|
this.observer.observe(document.documentElement, e), document.body && this.observer.observe(document.body, e), this.observer.observe(this.container, e), typeof window.matchMedia == "function" && (this.colorScheme = window.matchMedia("(prefers-color-scheme: dark)"), this.colorScheme.addEventListener?.("change", this.schedule));
|
|
21471
21489
|
}
|
|
@@ -21479,13 +21497,13 @@ var ys = class {
|
|
|
21479
21497
|
};
|
|
21480
21498
|
resolveValue(e, t) {
|
|
21481
21499
|
let n = e;
|
|
21482
|
-
for (let e = 0; e < 5 && n.includes("var("); e++) n = n.replace(
|
|
21500
|
+
for (let e = 0; e < 5 && n.includes("var("); e++) n = n.replace(ys, (e, n, r) => t.getPropertyValue(n).trim() || r?.trim() || "");
|
|
21483
21501
|
return n;
|
|
21484
21502
|
}
|
|
21485
21503
|
};
|
|
21486
21504
|
//#endregion
|
|
21487
21505
|
//#region src/editor/core/image/ImageUpload.ts
|
|
21488
|
-
function
|
|
21506
|
+
function ws(e) {
|
|
21489
21507
|
return new Promise((t, n) => {
|
|
21490
21508
|
let r = new Image();
|
|
21491
21509
|
r.onload = () => t({
|
|
@@ -21494,16 +21512,16 @@ function bs(e) {
|
|
|
21494
21512
|
}), r.onerror = n, r.src = e;
|
|
21495
21513
|
});
|
|
21496
21514
|
}
|
|
21497
|
-
function
|
|
21515
|
+
function Ts(e) {
|
|
21498
21516
|
return new Promise((t, n) => {
|
|
21499
21517
|
let r = new FileReader();
|
|
21500
21518
|
r.onload = () => t(r.result), r.onerror = n, r.readAsDataURL(e);
|
|
21501
21519
|
});
|
|
21502
21520
|
}
|
|
21503
|
-
function
|
|
21521
|
+
function Es(e) {
|
|
21504
21522
|
return e instanceof File ? e : new File([e], "image", { type: e.type });
|
|
21505
21523
|
}
|
|
21506
|
-
var
|
|
21524
|
+
var Ds = class {
|
|
21507
21525
|
draw;
|
|
21508
21526
|
command;
|
|
21509
21527
|
objectUrlSet;
|
|
@@ -21515,7 +21533,7 @@ var Cs = class {
|
|
|
21515
21533
|
if (this.draw.isReadonly() || this.draw.isDisabled()) return null;
|
|
21516
21534
|
let { upload: t } = this.draw.getOptions().image;
|
|
21517
21535
|
if (!t) {
|
|
21518
|
-
let t = await
|
|
21536
|
+
let t = await Ts(e), n = await ws(t);
|
|
21519
21537
|
return this.insert({
|
|
21520
21538
|
value: t,
|
|
21521
21539
|
...n
|
|
@@ -21525,9 +21543,9 @@ var Cs = class {
|
|
|
21525
21543
|
this.objectUrlSet.add(n);
|
|
21526
21544
|
let r;
|
|
21527
21545
|
try {
|
|
21528
|
-
r = await
|
|
21546
|
+
r = await ws(n);
|
|
21529
21547
|
} catch (t) {
|
|
21530
|
-
return this.emitError(
|
|
21548
|
+
return this.emitError(Es(e), t), null;
|
|
21531
21549
|
}
|
|
21532
21550
|
let i = Math.min(1, this.draw.getOriginalInnerWidth() / r.width), a = this.insert({
|
|
21533
21551
|
value: n,
|
|
@@ -21535,7 +21553,7 @@ var Cs = class {
|
|
|
21535
21553
|
height: Math.round(r.height * i)
|
|
21536
21554
|
});
|
|
21537
21555
|
if (!a) return null;
|
|
21538
|
-
let o =
|
|
21556
|
+
let o = Es(e);
|
|
21539
21557
|
return t(o).then((e) => {
|
|
21540
21558
|
this.isDestroyed || this.command.executeUpdateElementById({
|
|
21541
21559
|
id: a,
|
|
@@ -21566,13 +21584,13 @@ var Cs = class {
|
|
|
21566
21584
|
}, r = this.draw.getEventBus();
|
|
21567
21585
|
r.isSubscribe("imageUploadError") && r.emit("imageUploadError", n);
|
|
21568
21586
|
}
|
|
21569
|
-
},
|
|
21587
|
+
}, Os = 40, ks = .5, As = .25, js = 8, Ms = 44, Ns = [
|
|
21570
21588
|
"remove",
|
|
21571
21589
|
"replace",
|
|
21572
21590
|
"centerHorizontally",
|
|
21573
21591
|
"centerVertically",
|
|
21574
21592
|
"confirm"
|
|
21575
|
-
],
|
|
21593
|
+
], Ps = class {
|
|
21576
21594
|
draw;
|
|
21577
21595
|
options;
|
|
21578
21596
|
ui;
|
|
@@ -21618,7 +21636,7 @@ var Cs = class {
|
|
|
21618
21636
|
t.preventDefault(), t.stopPropagation();
|
|
21619
21637
|
let n = this.getPlacement(), { clientX: r } = t, { scale: i } = this.options;
|
|
21620
21638
|
this.track((t) => {
|
|
21621
|
-
let a = (e === "right" ? t.clientX - r : r - t.clientX) / i, o = Math.round(Math.max(
|
|
21639
|
+
let a = (e === "right" ? t.clientX - r : r - t.clientX) / i, o = Math.round(Math.max(Os, n.width + a)), s = e === "left" ? Math.round(n.x - (o - n.width)) : n.x;
|
|
21622
21640
|
return {
|
|
21623
21641
|
...n,
|
|
21624
21642
|
width: o,
|
|
@@ -21704,11 +21722,11 @@ var Cs = class {
|
|
|
21704
21722
|
};
|
|
21705
21723
|
}
|
|
21706
21724
|
getDefaultPlacement() {
|
|
21707
|
-
let e = this.getPageWidth(), t = Math.round(e *
|
|
21725
|
+
let e = this.getPageWidth(), t = Math.round(e * ks);
|
|
21708
21726
|
return {
|
|
21709
21727
|
width: t,
|
|
21710
21728
|
x: Math.round((e - t) / 2),
|
|
21711
|
-
y: Math.round(this.getPageHeight() *
|
|
21729
|
+
y: Math.round(this.getPageHeight() * As)
|
|
21712
21730
|
};
|
|
21713
21731
|
}
|
|
21714
21732
|
getPageWidth() {
|
|
@@ -21722,7 +21740,7 @@ var Cs = class {
|
|
|
21722
21740
|
return t?.width ? e * t.height / t.width : 0;
|
|
21723
21741
|
}
|
|
21724
21742
|
clamp(e) {
|
|
21725
|
-
let t = this.getPageWidth(), n = Math.min(Math.max(
|
|
21743
|
+
let t = this.getPageWidth(), n = Math.min(Math.max(Os, e.width), t), r = this.getHeight(n);
|
|
21726
21744
|
return {
|
|
21727
21745
|
width: n,
|
|
21728
21746
|
x: Math.min(Math.max(0, t - n), Math.max(0, e.x)),
|
|
@@ -21787,8 +21805,8 @@ var Cs = class {
|
|
|
21787
21805
|
let o = a.firstElementChild;
|
|
21788
21806
|
o.getAttribute("src") !== this.options.watermark.data && (o.src = this.options.watermark.data), a.style.setProperty("--ce-watermark-opacity", String(this.options.watermark.opacity)), this.ui.setState(a, "dragging", i);
|
|
21789
21807
|
});
|
|
21790
|
-
let a = this.getBoxRect(e[0]), o = a.top - e[0].top <
|
|
21791
|
-
n.style.left = `${a.left + a.width / 2}px`, n.style.top = o ? `${a.top + a.height +
|
|
21808
|
+
let a = this.getBoxRect(e[0]), o = a.top - e[0].top < Ms;
|
|
21809
|
+
n.style.left = `${a.left + a.width / 2}px`, n.style.top = o ? `${a.top + a.height + js}px` : `${a.top - js}px`, n.style.transform = o ? "translate(-50%, 0)" : "translate(-50%, -100%)";
|
|
21792
21810
|
}
|
|
21793
21811
|
createOverlay() {
|
|
21794
21812
|
let e = document.createElement("div");
|
|
@@ -21831,7 +21849,7 @@ var Cs = class {
|
|
|
21831
21849
|
position: "absolute",
|
|
21832
21850
|
display: "flex",
|
|
21833
21851
|
pointerEvents: "auto"
|
|
21834
|
-
}), this.ui.applyClass(e, "watermarkEditor", "toolbar", "ce-watermark-editor__toolbar"), e.onpointerdown = (e) => e.preventDefault(),
|
|
21852
|
+
}), this.ui.applyClass(e, "watermarkEditor", "toolbar", "ce-watermark-editor__toolbar"), e.onpointerdown = (e) => e.preventDefault(), Ns.forEach((t) => {
|
|
21835
21853
|
let n = document.createElement("button");
|
|
21836
21854
|
n.type = "button", n.dataset.action = t, n.textContent = this.i18n.t(`watermarkEditor.${t}`), this.ui.applyClass(n, "watermarkEditor", "button", "ce-watermark-editor__button"), n.onclick = () => this.runAction(t), e.append(n);
|
|
21837
21855
|
}), e;
|
|
@@ -21850,7 +21868,7 @@ var Cs = class {
|
|
|
21850
21868
|
if (!t) return;
|
|
21851
21869
|
let { upload: n } = this.options.image;
|
|
21852
21870
|
try {
|
|
21853
|
-
this.replaceImage(n ? await n(t) : await
|
|
21871
|
+
this.replaceImage(n ? await n(t) : await Ts(t));
|
|
21854
21872
|
} catch (e) {
|
|
21855
21873
|
let n = this.draw.getEventBus();
|
|
21856
21874
|
n.isSubscribe("imageUploadError") && n.emit("imageUploadError", {
|
|
@@ -21860,7 +21878,7 @@ var Cs = class {
|
|
|
21860
21878
|
}
|
|
21861
21879
|
}, e.click();
|
|
21862
21880
|
}
|
|
21863
|
-
},
|
|
21881
|
+
}, Fs = class {
|
|
21864
21882
|
rangeStyleChange;
|
|
21865
21883
|
visiblePageNoListChange;
|
|
21866
21884
|
intersectionPageNoChange;
|
|
@@ -21875,7 +21893,7 @@ var Cs = class {
|
|
|
21875
21893
|
constructor() {
|
|
21876
21894
|
this.rangeStyleChange = null, this.visiblePageNoListChange = null, this.intersectionPageNoChange = null, this.pageSizeChange = null, this.pageScaleChange = null, this.saved = null, this.contentChange = null, this.controlChange = null, this.controlContentChange = null, this.pageModeChange = null, this.zoneChange = null;
|
|
21877
21895
|
}
|
|
21878
|
-
},
|
|
21896
|
+
}, Is = class {
|
|
21879
21897
|
contextMenuList;
|
|
21880
21898
|
getContextMenuList;
|
|
21881
21899
|
slashMenuList;
|
|
@@ -21888,7 +21906,7 @@ var Cs = class {
|
|
|
21888
21906
|
let { contextMenu: t, slashMenu: n, bubbleMenu: r, shortcut: i, i18n: a } = e;
|
|
21889
21907
|
this.contextMenuList = t.registerContextMenuList.bind(t), this.getContextMenuList = t.getContextMenuList.bind(t), this.slashMenuList = n.registerSlashMenuList.bind(n), this.getSlashMenuList = n.getSlashMenuList.bind(n), this.bubbleMenuList = r.registerBubbleMenuList.bind(r), this.getBubbleMenuList = r.getBubbleMenuList.bind(r), this.shortcutList = i.registerShortcutList.bind(i), this.langMap = a.registerLangMap.bind(a);
|
|
21890
21908
|
}
|
|
21891
|
-
},
|
|
21909
|
+
}, Ls = { SELECTED_TEXT: "%s" }, Rs = {
|
|
21892
21910
|
GLOBAL: {
|
|
21893
21911
|
CUT: "globalCut",
|
|
21894
21912
|
COPY: "globalCopy",
|
|
@@ -21944,14 +21962,14 @@ var Cs = class {
|
|
|
21944
21962
|
AUTO_FIT_TO_CONTENT: "tableAutoFitToContent",
|
|
21945
21963
|
AUTO_FIT_TO_PAGE: "tableAutoFitToPage"
|
|
21946
21964
|
}
|
|
21947
|
-
}, { CONTROL: { DELETE:
|
|
21948
|
-
key:
|
|
21965
|
+
}, { CONTROL: { DELETE: zs } } = Rs, Bs = [{
|
|
21966
|
+
key: zs,
|
|
21949
21967
|
i18nPath: "contextmenu.control.delete",
|
|
21950
21968
|
when: (e) => !e.isReadonly && !e.editorHasSelection && !!e.startElement?.controlId && e.options.mode !== g.FORM,
|
|
21951
21969
|
callback: (e) => {
|
|
21952
21970
|
e.executeRemoveControl();
|
|
21953
21971
|
}
|
|
21954
|
-
}],
|
|
21972
|
+
}], Vs = {
|
|
21955
21973
|
mod: "⌘",
|
|
21956
21974
|
cmd: "⌘",
|
|
21957
21975
|
meta: "⌘",
|
|
@@ -21959,7 +21977,7 @@ var Cs = class {
|
|
|
21959
21977
|
alt: "⌥",
|
|
21960
21978
|
option: "⌥",
|
|
21961
21979
|
shift: "⇧"
|
|
21962
|
-
},
|
|
21980
|
+
}, Hs = {
|
|
21963
21981
|
mod: "Ctrl",
|
|
21964
21982
|
cmd: "Ctrl",
|
|
21965
21983
|
meta: "Meta",
|
|
@@ -21968,47 +21986,47 @@ var Cs = class {
|
|
|
21968
21986
|
option: "Alt",
|
|
21969
21987
|
shift: "Shift"
|
|
21970
21988
|
};
|
|
21971
|
-
function
|
|
21989
|
+
function Us(e) {
|
|
21972
21990
|
return e.length === 1 ? e.toUpperCase() : e[0].toUpperCase() + e.slice(1);
|
|
21973
21991
|
}
|
|
21974
|
-
function
|
|
21975
|
-
let n = t ?
|
|
21976
|
-
return e.split("+").map((e) => e.trim()).filter(Boolean).map((e) => n[e.toLowerCase()] ??
|
|
21992
|
+
function Ws(e, t = Ee) {
|
|
21993
|
+
let n = t ? Vs : Hs;
|
|
21994
|
+
return e.split("+").map((e) => e.trim()).filter(Boolean).map((e) => n[e.toLowerCase()] ?? Us(e)).join(" + ");
|
|
21977
21995
|
}
|
|
21978
21996
|
//#endregion
|
|
21979
21997
|
//#region src/editor/core/contextmenu/menus/globalMenus.ts
|
|
21980
|
-
var { GLOBAL: { CUT:
|
|
21998
|
+
var { GLOBAL: { CUT: Gs, COPY: Ks, PASTE: qs, SELECT_ALL: Js, PRINT: Ys } } = Rs, Xs = [
|
|
21981
21999
|
{
|
|
21982
|
-
key:
|
|
22000
|
+
key: Gs,
|
|
21983
22001
|
i18nPath: "contextmenu.global.cut",
|
|
21984
|
-
shortCut:
|
|
22002
|
+
shortCut: Ws("Mod+X"),
|
|
21985
22003
|
when: (e) => !e.isReadonly,
|
|
21986
22004
|
callback: (e) => {
|
|
21987
22005
|
e.executeCut();
|
|
21988
22006
|
}
|
|
21989
22007
|
},
|
|
21990
22008
|
{
|
|
21991
|
-
key:
|
|
22009
|
+
key: Ks,
|
|
21992
22010
|
i18nPath: "contextmenu.global.copy",
|
|
21993
|
-
shortCut:
|
|
22011
|
+
shortCut: Ws("Mod+C"),
|
|
21994
22012
|
when: (e) => e.editorHasSelection || e.isCrossRowCol,
|
|
21995
22013
|
callback: (e) => {
|
|
21996
22014
|
e.executeCopy();
|
|
21997
22015
|
}
|
|
21998
22016
|
},
|
|
21999
22017
|
{
|
|
22000
|
-
key:
|
|
22018
|
+
key: qs,
|
|
22001
22019
|
i18nPath: "contextmenu.global.paste",
|
|
22002
|
-
shortCut:
|
|
22020
|
+
shortCut: Ws("Mod+V"),
|
|
22003
22021
|
when: (e) => !e.isReadonly && e.editorTextFocus,
|
|
22004
22022
|
callback: (e) => {
|
|
22005
22023
|
e.executePaste();
|
|
22006
22024
|
}
|
|
22007
22025
|
},
|
|
22008
22026
|
{
|
|
22009
|
-
key:
|
|
22027
|
+
key: Js,
|
|
22010
22028
|
i18nPath: "contextmenu.global.selectAll",
|
|
22011
|
-
shortCut:
|
|
22029
|
+
shortCut: Ws("Mod+A"),
|
|
22012
22030
|
when: (e) => e.editorTextFocus,
|
|
22013
22031
|
callback: (e) => {
|
|
22014
22032
|
e.executeSelectAll();
|
|
@@ -22016,7 +22034,7 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22016
22034
|
},
|
|
22017
22035
|
{ isDivider: !0 },
|
|
22018
22036
|
{
|
|
22019
|
-
key:
|
|
22037
|
+
key: Ys,
|
|
22020
22038
|
i18nPath: "contextmenu.global.print",
|
|
22021
22039
|
icon: "print",
|
|
22022
22040
|
when: () => !0,
|
|
@@ -22024,9 +22042,9 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22024
22042
|
e.executePrint();
|
|
22025
22043
|
}
|
|
22026
22044
|
}
|
|
22027
|
-
], { HYPERLINK: { DELETE:
|
|
22045
|
+
], { HYPERLINK: { DELETE: Zs, CANCEL: Qs, EDIT: $s } } = Rs, ec = [
|
|
22028
22046
|
{
|
|
22029
|
-
key:
|
|
22047
|
+
key: Zs,
|
|
22030
22048
|
i18nPath: "contextmenu.hyperlink.delete",
|
|
22031
22049
|
when: (e) => !e.isReadonly && e.startElement?.type === w.HYPERLINK,
|
|
22032
22050
|
callback: (e) => {
|
|
@@ -22034,7 +22052,7 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22034
22052
|
}
|
|
22035
22053
|
},
|
|
22036
22054
|
{
|
|
22037
|
-
key:
|
|
22055
|
+
key: Qs,
|
|
22038
22056
|
i18nPath: "contextmenu.hyperlink.cancel",
|
|
22039
22057
|
when: (e) => !e.isReadonly && e.startElement?.type === w.HYPERLINK,
|
|
22040
22058
|
callback: (e) => {
|
|
@@ -22042,7 +22060,7 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22042
22060
|
}
|
|
22043
22061
|
},
|
|
22044
22062
|
{
|
|
22045
|
-
key:
|
|
22063
|
+
key: $s,
|
|
22046
22064
|
i18nPath: "contextmenu.hyperlink.edit",
|
|
22047
22065
|
when: (e) => !e.isReadonly && e.startElement?.type === w.HYPERLINK,
|
|
22048
22066
|
callback: (e, t) => {
|
|
@@ -22050,9 +22068,9 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22050
22068
|
n && e.executeEditHyperlink(n);
|
|
22051
22069
|
}
|
|
22052
22070
|
}
|
|
22053
|
-
], { IMAGE: { CHANGE:
|
|
22071
|
+
], { IMAGE: { CHANGE: tc, SAVE_AS: nc, TEXT_WRAP: rc, TEXT_WRAP_EMBED: ic, TEXT_WRAP_UP_DOWN: ac, TEXT_WRAP_SURROUND: oc, TEXT_WRAP_FLOAT_TOP: sc, TEXT_WRAP_FLOAT_BOTTOM: cc } } = Rs, lc = [
|
|
22054
22072
|
{
|
|
22055
|
-
key:
|
|
22073
|
+
key: tc,
|
|
22056
22074
|
i18nPath: "contextmenu.image.change",
|
|
22057
22075
|
icon: "image-change",
|
|
22058
22076
|
when: (e) => !e.isReadonly && !e.editorHasSelection && e.startElement?.type === w.IMAGE,
|
|
@@ -22068,7 +22086,7 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22068
22086
|
}
|
|
22069
22087
|
},
|
|
22070
22088
|
{
|
|
22071
|
-
key:
|
|
22089
|
+
key: nc,
|
|
22072
22090
|
i18nPath: "contextmenu.image.saveAs",
|
|
22073
22091
|
icon: "image",
|
|
22074
22092
|
when: (e) => !e.editorHasSelection && e.startElement?.type === w.IMAGE,
|
|
@@ -22077,12 +22095,12 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22077
22095
|
}
|
|
22078
22096
|
},
|
|
22079
22097
|
{
|
|
22080
|
-
key:
|
|
22098
|
+
key: rc,
|
|
22081
22099
|
i18nPath: "contextmenu.image.textWrap",
|
|
22082
22100
|
when: (e) => !e.isReadonly && !e.editorHasSelection && e.startElement?.type === w.IMAGE,
|
|
22083
22101
|
childMenus: [
|
|
22084
22102
|
{
|
|
22085
|
-
key:
|
|
22103
|
+
key: ic,
|
|
22086
22104
|
i18nPath: "contextmenu.image.textWrapType.embed",
|
|
22087
22105
|
when: () => !0,
|
|
22088
22106
|
callback: (e, t) => {
|
|
@@ -22090,7 +22108,7 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22090
22108
|
}
|
|
22091
22109
|
},
|
|
22092
22110
|
{
|
|
22093
|
-
key:
|
|
22111
|
+
key: ac,
|
|
22094
22112
|
i18nPath: "contextmenu.image.textWrapType.upDown",
|
|
22095
22113
|
when: () => !0,
|
|
22096
22114
|
callback: (e, t) => {
|
|
@@ -22098,7 +22116,7 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22098
22116
|
}
|
|
22099
22117
|
},
|
|
22100
22118
|
{
|
|
22101
|
-
key:
|
|
22119
|
+
key: oc,
|
|
22102
22120
|
i18nPath: "contextmenu.image.textWrapType.surround",
|
|
22103
22121
|
when: () => !0,
|
|
22104
22122
|
callback: (e, t) => {
|
|
@@ -22106,7 +22124,7 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22106
22124
|
}
|
|
22107
22125
|
},
|
|
22108
22126
|
{
|
|
22109
|
-
key:
|
|
22127
|
+
key: sc,
|
|
22110
22128
|
i18nPath: "contextmenu.image.textWrapType.floatTop",
|
|
22111
22129
|
when: () => !0,
|
|
22112
22130
|
callback: (e, t) => {
|
|
@@ -22114,7 +22132,7 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22114
22132
|
}
|
|
22115
22133
|
},
|
|
22116
22134
|
{
|
|
22117
|
-
key:
|
|
22135
|
+
key: cc,
|
|
22118
22136
|
i18nPath: "contextmenu.image.textWrapType.floatBottom",
|
|
22119
22137
|
when: () => !0,
|
|
22120
22138
|
callback: (e, t) => {
|
|
@@ -22123,16 +22141,16 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22123
22141
|
}
|
|
22124
22142
|
]
|
|
22125
22143
|
}
|
|
22126
|
-
], { TABLE: { BORDER:
|
|
22144
|
+
], { TABLE: { BORDER: uc, BORDER_ALL: dc, BORDER_EMPTY: fc, BORDER_DASH: pc, BORDER_EXTERNAL: mc, BORDER_INTERNAL: hc, BORDER_TD: gc, BORDER_TD_TOP: _c, BORDER_TD_LEFT: vc, BORDER_TD_BOTTOM: yc, BORDER_TD_RIGHT: bc, BORDER_TD_BACK: xc, BORDER_TD_FORWARD: Sc, VERTICAL_ALIGN: Cc, VERTICAL_ALIGN_TOP: wc, VERTICAL_ALIGN_MIDDLE: Tc, VERTICAL_ALIGN_BOTTOM: Ec, INSERT_ROW_COL: Dc, INSERT_TOP_ROW: Oc, INSERT_BOTTOM_ROW: kc, INSERT_LEFT_COL: Ac, INSERT_RIGHT_COL: jc, DELETE_ROW_COL: Mc, DELETE_ROW: Nc, DELETE_COL: Pc, DELETE_TABLE: Fc, MERGE_CELL: Ic, CANCEL_MERGE_CELL: Lc, AUTO_FIT_TO_CONTENT: Rc, AUTO_FIT_TO_PAGE: zc } } = Rs, Bc = [
|
|
22127
22145
|
{ isDivider: !0 },
|
|
22128
22146
|
{
|
|
22129
|
-
key:
|
|
22147
|
+
key: uc,
|
|
22130
22148
|
i18nPath: "contextmenu.table.border",
|
|
22131
22149
|
icon: "border-all",
|
|
22132
22150
|
when: (e) => !e.isReadonly && e.isInTable && e.options.mode !== g.FORM,
|
|
22133
22151
|
childMenus: [
|
|
22134
22152
|
{
|
|
22135
|
-
key:
|
|
22153
|
+
key: dc,
|
|
22136
22154
|
i18nPath: "contextmenu.table.borderAll",
|
|
22137
22155
|
icon: "border-all",
|
|
22138
22156
|
when: () => !0,
|
|
@@ -22141,7 +22159,7 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22141
22159
|
}
|
|
22142
22160
|
},
|
|
22143
22161
|
{
|
|
22144
|
-
key:
|
|
22162
|
+
key: fc,
|
|
22145
22163
|
i18nPath: "contextmenu.table.borderEmpty",
|
|
22146
22164
|
icon: "border-empty",
|
|
22147
22165
|
when: () => !0,
|
|
@@ -22150,7 +22168,7 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22150
22168
|
}
|
|
22151
22169
|
},
|
|
22152
22170
|
{
|
|
22153
|
-
key:
|
|
22171
|
+
key: pc,
|
|
22154
22172
|
i18nPath: "contextmenu.table.borderDash",
|
|
22155
22173
|
icon: "border-dash",
|
|
22156
22174
|
when: () => !0,
|
|
@@ -22159,7 +22177,7 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22159
22177
|
}
|
|
22160
22178
|
},
|
|
22161
22179
|
{
|
|
22162
|
-
key:
|
|
22180
|
+
key: mc,
|
|
22163
22181
|
i18nPath: "contextmenu.table.borderExternal",
|
|
22164
22182
|
icon: "border-external",
|
|
22165
22183
|
when: () => !0,
|
|
@@ -22168,7 +22186,7 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22168
22186
|
}
|
|
22169
22187
|
},
|
|
22170
22188
|
{
|
|
22171
|
-
key:
|
|
22189
|
+
key: hc,
|
|
22172
22190
|
i18nPath: "contextmenu.table.borderInternal",
|
|
22173
22191
|
icon: "border-internal",
|
|
22174
22192
|
when: () => !0,
|
|
@@ -22177,13 +22195,13 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22177
22195
|
}
|
|
22178
22196
|
},
|
|
22179
22197
|
{
|
|
22180
|
-
key:
|
|
22198
|
+
key: gc,
|
|
22181
22199
|
i18nPath: "contextmenu.table.borderTd",
|
|
22182
22200
|
icon: "border-td",
|
|
22183
22201
|
when: () => !0,
|
|
22184
22202
|
childMenus: [
|
|
22185
22203
|
{
|
|
22186
|
-
key:
|
|
22204
|
+
key: _c,
|
|
22187
22205
|
i18nPath: "contextmenu.table.borderTdTop",
|
|
22188
22206
|
icon: "border-td-top",
|
|
22189
22207
|
when: () => !0,
|
|
@@ -22192,7 +22210,7 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22192
22210
|
}
|
|
22193
22211
|
},
|
|
22194
22212
|
{
|
|
22195
|
-
key:
|
|
22213
|
+
key: bc,
|
|
22196
22214
|
i18nPath: "contextmenu.table.borderTdRight",
|
|
22197
22215
|
icon: "border-td-right",
|
|
22198
22216
|
when: () => !0,
|
|
@@ -22201,7 +22219,7 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22201
22219
|
}
|
|
22202
22220
|
},
|
|
22203
22221
|
{
|
|
22204
|
-
key:
|
|
22222
|
+
key: yc,
|
|
22205
22223
|
i18nPath: "contextmenu.table.borderTdBottom",
|
|
22206
22224
|
icon: "border-td-bottom",
|
|
22207
22225
|
when: () => !0,
|
|
@@ -22210,7 +22228,7 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22210
22228
|
}
|
|
22211
22229
|
},
|
|
22212
22230
|
{
|
|
22213
|
-
key:
|
|
22231
|
+
key: vc,
|
|
22214
22232
|
i18nPath: "contextmenu.table.borderTdLeft",
|
|
22215
22233
|
icon: "border-td-left",
|
|
22216
22234
|
when: () => !0,
|
|
@@ -22219,7 +22237,7 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22219
22237
|
}
|
|
22220
22238
|
},
|
|
22221
22239
|
{
|
|
22222
|
-
key:
|
|
22240
|
+
key: Sc,
|
|
22223
22241
|
i18nPath: "contextmenu.table.borderTdForward",
|
|
22224
22242
|
icon: "border-td-forward",
|
|
22225
22243
|
when: () => !0,
|
|
@@ -22228,7 +22246,7 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22228
22246
|
}
|
|
22229
22247
|
},
|
|
22230
22248
|
{
|
|
22231
|
-
key:
|
|
22249
|
+
key: xc,
|
|
22232
22250
|
i18nPath: "contextmenu.table.borderTdBack",
|
|
22233
22251
|
icon: "border-td-back",
|
|
22234
22252
|
when: () => !0,
|
|
@@ -22241,13 +22259,13 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22241
22259
|
]
|
|
22242
22260
|
},
|
|
22243
22261
|
{
|
|
22244
|
-
key:
|
|
22262
|
+
key: Cc,
|
|
22245
22263
|
i18nPath: "contextmenu.table.verticalAlign",
|
|
22246
22264
|
icon: "vertical-align",
|
|
22247
22265
|
when: (e) => !e.isReadonly && e.isInTable && e.options.mode !== g.FORM,
|
|
22248
22266
|
childMenus: [
|
|
22249
22267
|
{
|
|
22250
|
-
key:
|
|
22268
|
+
key: wc,
|
|
22251
22269
|
i18nPath: "contextmenu.table.verticalAlignTop",
|
|
22252
22270
|
icon: "vertical-align-top",
|
|
22253
22271
|
when: () => !0,
|
|
@@ -22256,7 +22274,7 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22256
22274
|
}
|
|
22257
22275
|
},
|
|
22258
22276
|
{
|
|
22259
|
-
key:
|
|
22277
|
+
key: Tc,
|
|
22260
22278
|
i18nPath: "contextmenu.table.verticalAlignMiddle",
|
|
22261
22279
|
icon: "vertical-align-middle",
|
|
22262
22280
|
when: () => !0,
|
|
@@ -22265,7 +22283,7 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22265
22283
|
}
|
|
22266
22284
|
},
|
|
22267
22285
|
{
|
|
22268
|
-
key:
|
|
22286
|
+
key: Ec,
|
|
22269
22287
|
i18nPath: "contextmenu.table.verticalAlignBottom",
|
|
22270
22288
|
icon: "vertical-align-bottom",
|
|
22271
22289
|
when: () => !0,
|
|
@@ -22276,13 +22294,13 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22276
22294
|
]
|
|
22277
22295
|
},
|
|
22278
22296
|
{
|
|
22279
|
-
key:
|
|
22297
|
+
key: Dc,
|
|
22280
22298
|
i18nPath: "contextmenu.table.insertRowCol",
|
|
22281
22299
|
icon: "insert-row-col",
|
|
22282
22300
|
when: (e) => !e.isReadonly && e.isInTable && e.options.mode !== g.FORM,
|
|
22283
22301
|
childMenus: [
|
|
22284
22302
|
{
|
|
22285
|
-
key:
|
|
22303
|
+
key: Oc,
|
|
22286
22304
|
i18nPath: "contextmenu.table.insertTopRow",
|
|
22287
22305
|
icon: "insert-top-row",
|
|
22288
22306
|
when: () => !0,
|
|
@@ -22291,7 +22309,7 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22291
22309
|
}
|
|
22292
22310
|
},
|
|
22293
22311
|
{
|
|
22294
|
-
key:
|
|
22312
|
+
key: kc,
|
|
22295
22313
|
i18nPath: "contextmenu.table.insertBottomRow",
|
|
22296
22314
|
icon: "insert-bottom-row",
|
|
22297
22315
|
when: () => !0,
|
|
@@ -22300,7 +22318,7 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22300
22318
|
}
|
|
22301
22319
|
},
|
|
22302
22320
|
{
|
|
22303
|
-
key:
|
|
22321
|
+
key: Ac,
|
|
22304
22322
|
i18nPath: "contextmenu.table.insertLeftCol",
|
|
22305
22323
|
icon: "insert-left-col",
|
|
22306
22324
|
when: () => !0,
|
|
@@ -22309,7 +22327,7 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22309
22327
|
}
|
|
22310
22328
|
},
|
|
22311
22329
|
{
|
|
22312
|
-
key:
|
|
22330
|
+
key: jc,
|
|
22313
22331
|
i18nPath: "contextmenu.table.insertRightCol",
|
|
22314
22332
|
icon: "insert-right-col",
|
|
22315
22333
|
when: () => !0,
|
|
@@ -22320,13 +22338,13 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22320
22338
|
]
|
|
22321
22339
|
},
|
|
22322
22340
|
{
|
|
22323
|
-
key:
|
|
22341
|
+
key: Mc,
|
|
22324
22342
|
i18nPath: "contextmenu.table.deleteRowCol",
|
|
22325
22343
|
icon: "delete-row-col",
|
|
22326
22344
|
when: (e) => !e.isReadonly && e.isInTable && e.options.mode !== g.FORM,
|
|
22327
22345
|
childMenus: [
|
|
22328
22346
|
{
|
|
22329
|
-
key:
|
|
22347
|
+
key: Nc,
|
|
22330
22348
|
i18nPath: "contextmenu.table.deleteRow",
|
|
22331
22349
|
icon: "delete-row",
|
|
22332
22350
|
when: () => !0,
|
|
@@ -22335,7 +22353,7 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22335
22353
|
}
|
|
22336
22354
|
},
|
|
22337
22355
|
{
|
|
22338
|
-
key:
|
|
22356
|
+
key: Pc,
|
|
22339
22357
|
i18nPath: "contextmenu.table.deleteCol",
|
|
22340
22358
|
icon: "delete-col",
|
|
22341
22359
|
when: () => !0,
|
|
@@ -22344,7 +22362,7 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22344
22362
|
}
|
|
22345
22363
|
},
|
|
22346
22364
|
{
|
|
22347
|
-
key:
|
|
22365
|
+
key: Fc,
|
|
22348
22366
|
i18nPath: "contextmenu.table.deleteTable",
|
|
22349
22367
|
icon: "delete-table",
|
|
22350
22368
|
when: () => !0,
|
|
@@ -22355,7 +22373,7 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22355
22373
|
]
|
|
22356
22374
|
},
|
|
22357
22375
|
{
|
|
22358
|
-
key:
|
|
22376
|
+
key: Ic,
|
|
22359
22377
|
i18nPath: "contextmenu.table.mergeCell",
|
|
22360
22378
|
icon: "merge-cell",
|
|
22361
22379
|
when: (e) => !e.isReadonly && e.isCrossRowCol && e.options.mode !== g.FORM,
|
|
@@ -22364,7 +22382,7 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22364
22382
|
}
|
|
22365
22383
|
},
|
|
22366
22384
|
{
|
|
22367
|
-
key:
|
|
22385
|
+
key: Lc,
|
|
22368
22386
|
i18nPath: "contextmenu.table.mergeCancelCell",
|
|
22369
22387
|
icon: "merge-cancel-cell",
|
|
22370
22388
|
when: (e) => !e.isReadonly && e.isInTable && e.options.mode !== g.FORM,
|
|
@@ -22373,7 +22391,7 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22373
22391
|
}
|
|
22374
22392
|
},
|
|
22375
22393
|
{
|
|
22376
|
-
key:
|
|
22394
|
+
key: Rc,
|
|
22377
22395
|
i18nPath: "contextmenu.table.autoFitToContent",
|
|
22378
22396
|
icon: "table-auto-fit-content",
|
|
22379
22397
|
when: (e) => !e.isReadonly && e.isInTable && e.options.mode !== g.FORM,
|
|
@@ -22382,7 +22400,7 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22382
22400
|
}
|
|
22383
22401
|
},
|
|
22384
22402
|
{
|
|
22385
|
-
key:
|
|
22403
|
+
key: zc,
|
|
22386
22404
|
i18nPath: "contextmenu.table.autoFitToPage",
|
|
22387
22405
|
icon: "table-auto-fit-page",
|
|
22388
22406
|
when: (e) => !e.isReadonly && e.isInTable && e.options.mode !== g.FORM,
|
|
@@ -22390,7 +22408,7 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22390
22408
|
e.executeTableAutoFitToPage();
|
|
22391
22409
|
}
|
|
22392
22410
|
}
|
|
22393
|
-
],
|
|
22411
|
+
], Vc = class {
|
|
22394
22412
|
options;
|
|
22395
22413
|
draw;
|
|
22396
22414
|
command;
|
|
@@ -22406,11 +22424,11 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22406
22424
|
isHeadlessOpen;
|
|
22407
22425
|
constructor(e, t) {
|
|
22408
22426
|
this.options = e.getOptions(), this.draw = e, this.command = t, this.range = e.getRange(), this.position = e.getPosition(), this.i18n = e.getI18n(), this.container = e.getContainer(), this.context = null, this.ui = e.getUi(), this.isHeadlessOpen = !1, this.contextMenuList = [
|
|
22409
|
-
...
|
|
22410
|
-
...
|
|
22411
|
-
...
|
|
22412
|
-
...
|
|
22413
|
-
...
|
|
22427
|
+
...Xs,
|
|
22428
|
+
...Bc,
|
|
22429
|
+
...lc,
|
|
22430
|
+
...Bs,
|
|
22431
|
+
...ec
|
|
22414
22432
|
], this.contextMenuContainerList = [], this.contextMenuRelationShip = /* @__PURE__ */ new Map(), this._addEvent();
|
|
22415
22433
|
}
|
|
22416
22434
|
getContextMenuList() {
|
|
@@ -22579,9 +22597,9 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22579
22597
|
}), e.classList.add("hover"), this.ui.setState(e, "active", !0)) : (e.classList.remove("hover"), this.ui.setState(e, "active", !1));
|
|
22580
22598
|
}
|
|
22581
22599
|
_formatName(e) {
|
|
22582
|
-
let t = Object.values(
|
|
22600
|
+
let t = Object.values(Ls), n = RegExp(`${t.join("|")}`), r = e;
|
|
22583
22601
|
if (n.test(r)) {
|
|
22584
|
-
let e = new RegExp(
|
|
22602
|
+
let e = new RegExp(Ls.SELECTED_TEXT, "g");
|
|
22585
22603
|
if (e.test(r)) {
|
|
22586
22604
|
let t = this.range.toString();
|
|
22587
22605
|
r = r.replace(e, t);
|
|
@@ -22597,7 +22615,7 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22597
22615
|
dispose() {
|
|
22598
22616
|
this.isHeadlessOpen && (this.isHeadlessOpen = !1, this.ui.emit("uiContextMenu", { visible: !1 })), this.contextMenuContainerList.forEach((e) => e.remove()), this.contextMenuContainerList = [], this.contextMenuRelationShip.clear();
|
|
22599
22617
|
}
|
|
22600
|
-
},
|
|
22618
|
+
}, Hc = [
|
|
22601
22619
|
{
|
|
22602
22620
|
key: Z.X,
|
|
22603
22621
|
ctrl: !0,
|
|
@@ -22693,7 +22711,7 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22693
22711
|
e.executeRowFlex(p.JUSTIFY);
|
|
22694
22712
|
}
|
|
22695
22713
|
}
|
|
22696
|
-
],
|
|
22714
|
+
], Uc = [
|
|
22697
22715
|
{
|
|
22698
22716
|
key: Z.ZERO,
|
|
22699
22717
|
alt: !0,
|
|
@@ -22750,7 +22768,7 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22750
22768
|
e.executeTitle(U.SIXTH);
|
|
22751
22769
|
}
|
|
22752
22770
|
}
|
|
22753
|
-
],
|
|
22771
|
+
], Wc = [{
|
|
22754
22772
|
key: Z.I,
|
|
22755
22773
|
shift: !0,
|
|
22756
22774
|
mod: !0,
|
|
@@ -22764,15 +22782,15 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22764
22782
|
callback: (e) => {
|
|
22765
22783
|
e.executeList(yt.OL);
|
|
22766
22784
|
}
|
|
22767
|
-
}],
|
|
22785
|
+
}], Gc = class {
|
|
22768
22786
|
command;
|
|
22769
22787
|
globalShortcutList;
|
|
22770
22788
|
agentShortcutList;
|
|
22771
22789
|
constructor(e, t) {
|
|
22772
22790
|
this.command = t, this.globalShortcutList = [], this.agentShortcutList = [], this._addShortcutList([
|
|
22773
|
-
...
|
|
22774
|
-
...
|
|
22775
|
-
...
|
|
22791
|
+
...Hc,
|
|
22792
|
+
...Uc,
|
|
22793
|
+
...Wc
|
|
22776
22794
|
]), this._addEvent(), e.getCursor().getAgentDom().addEventListener("keydown", this._agentKeydown.bind(this));
|
|
22777
22795
|
}
|
|
22778
22796
|
_addEvent() {
|
|
@@ -22799,19 +22817,19 @@ var { GLOBAL: { CUT: Vs, COPY: Hs, PASTE: Us, SELECT_ALL: Ws, PRINT: Gs } } = Ps
|
|
|
22799
22817
|
_execute(e, t) {
|
|
22800
22818
|
for (let n = 0; n < t.length; n++) {
|
|
22801
22819
|
let r = t[n];
|
|
22802
|
-
if ((r.mod ?
|
|
22820
|
+
if ((r.mod ? Dr(e) === !!r.mod : e.ctrlKey === !!r.ctrl && e.metaKey === !!r.meta) && e.shiftKey === !!r.shift && e.altKey === !!r.alt && e.key.toLowerCase() === r.key.toLowerCase()) {
|
|
22803
22821
|
r.disable || (r?.callback?.(this.command), e.preventDefault());
|
|
22804
22822
|
break;
|
|
22805
22823
|
}
|
|
22806
22824
|
}
|
|
22807
22825
|
}
|
|
22808
|
-
},
|
|
22826
|
+
}, Kc;
|
|
22809
22827
|
(function(e) {
|
|
22810
22828
|
e.RECORDED = "recorded", e.SCRIPT = "script";
|
|
22811
|
-
})(
|
|
22829
|
+
})(Kc ||= {});
|
|
22812
22830
|
//#endregion
|
|
22813
22831
|
//#region src/editor/core/plugin/Plugin.ts
|
|
22814
|
-
var
|
|
22832
|
+
var qc = class {
|
|
22815
22833
|
editor;
|
|
22816
22834
|
constructor(e) {
|
|
22817
22835
|
this.editor = e;
|
|
@@ -22819,7 +22837,7 @@ var Uc = class {
|
|
|
22819
22837
|
use(e, t) {
|
|
22820
22838
|
e(this.editor, t);
|
|
22821
22839
|
}
|
|
22822
|
-
},
|
|
22840
|
+
}, Jc = class {
|
|
22823
22841
|
macros = /* @__PURE__ */ new Map();
|
|
22824
22842
|
recording = null;
|
|
22825
22843
|
isPlaying = !1;
|
|
@@ -22839,7 +22857,7 @@ var Uc = class {
|
|
|
22839
22857
|
let t = {
|
|
22840
22858
|
id: I(),
|
|
22841
22859
|
name: e,
|
|
22842
|
-
type:
|
|
22860
|
+
type: Kc.RECORDED,
|
|
22843
22861
|
steps: this.recording
|
|
22844
22862
|
};
|
|
22845
22863
|
return this.recording = null, this.macros.set(t.id, t), t;
|
|
@@ -22853,7 +22871,7 @@ var Uc = class {
|
|
|
22853
22871
|
if (n) {
|
|
22854
22872
|
this.isPlaying = !0;
|
|
22855
22873
|
try {
|
|
22856
|
-
if (n.type ===
|
|
22874
|
+
if (n.type === Kc.RECORDED) for (let e of n.steps) {
|
|
22857
22875
|
let t = this.command[e.command];
|
|
22858
22876
|
if (typeof t != "function") return;
|
|
22859
22877
|
try {
|
|
@@ -22879,7 +22897,7 @@ var Uc = class {
|
|
|
22879
22897
|
return t ? this.macros.delete(t.id) : !1;
|
|
22880
22898
|
}
|
|
22881
22899
|
exportMacros() {
|
|
22882
|
-
let e = this.getMacros().filter((e) => e.type ===
|
|
22900
|
+
let e = this.getMacros().filter((e) => e.type === Kc.RECORDED);
|
|
22883
22901
|
return JSON.stringify(e);
|
|
22884
22902
|
}
|
|
22885
22903
|
importMacros(e, t) {
|
|
@@ -22892,7 +22910,7 @@ var Uc = class {
|
|
|
22892
22910
|
if (!Array.isArray(n)) return;
|
|
22893
22911
|
let r = t?.overwrite ?? !1;
|
|
22894
22912
|
for (let e of n) {
|
|
22895
|
-
if (!
|
|
22913
|
+
if (!Xc(e)) return;
|
|
22896
22914
|
(!this.macros.has(e.id) || r) && this.macros.set(e.id, { ...e });
|
|
22897
22915
|
}
|
|
22898
22916
|
}
|
|
@@ -22900,7 +22918,7 @@ var Uc = class {
|
|
|
22900
22918
|
let n = {
|
|
22901
22919
|
id: I(),
|
|
22902
22920
|
name: e,
|
|
22903
|
-
type:
|
|
22921
|
+
type: Kc.SCRIPT,
|
|
22904
22922
|
handler: t
|
|
22905
22923
|
};
|
|
22906
22924
|
return this.macros.set(n.id, n), n;
|
|
@@ -22927,19 +22945,19 @@ var Uc = class {
|
|
|
22927
22945
|
});
|
|
22928
22946
|
}
|
|
22929
22947
|
};
|
|
22930
|
-
function
|
|
22948
|
+
function Yc(e) {
|
|
22931
22949
|
if (typeof e != "object" || !e) return !1;
|
|
22932
22950
|
let t = e;
|
|
22933
22951
|
return typeof t.command == "string" && Array.isArray(t.args);
|
|
22934
22952
|
}
|
|
22935
|
-
function
|
|
22953
|
+
function Xc(e) {
|
|
22936
22954
|
if (typeof e != "object" || !e) return !1;
|
|
22937
22955
|
let t = e;
|
|
22938
|
-
return typeof t.id == "string" && typeof t.name == "string" && t.type ===
|
|
22956
|
+
return typeof t.id == "string" && typeof t.name == "string" && t.type === Kc.RECORDED && Array.isArray(t.steps) && t.steps.every(Yc);
|
|
22939
22957
|
}
|
|
22940
22958
|
//#endregion
|
|
22941
22959
|
//#region src/editor/core/event/eventbus/EventBus.ts
|
|
22942
|
-
var
|
|
22960
|
+
var Zc = class {
|
|
22943
22961
|
eventHub;
|
|
22944
22962
|
constructor() {
|
|
22945
22963
|
this.eventHub = /* @__PURE__ */ new Map();
|
|
@@ -22969,43 +22987,43 @@ var qc = class {
|
|
|
22969
22987
|
dangerouslyClearAll() {
|
|
22970
22988
|
this.eventHub.clear();
|
|
22971
22989
|
}
|
|
22972
|
-
},
|
|
22990
|
+
}, Qc = class {
|
|
22973
22991
|
paste;
|
|
22974
22992
|
pasteImage;
|
|
22975
22993
|
copy;
|
|
22976
22994
|
drop;
|
|
22977
|
-
},
|
|
22978
|
-
function
|
|
22979
|
-
return Math.round(e *
|
|
22995
|
+
}, $c = 96, el = 25.4;
|
|
22996
|
+
function tl(e) {
|
|
22997
|
+
return Math.round(e * $c);
|
|
22980
22998
|
}
|
|
22981
|
-
function
|
|
22982
|
-
return Math.round(e /
|
|
22999
|
+
function nl(e) {
|
|
23000
|
+
return Math.round(e / el * $c);
|
|
22983
23001
|
}
|
|
22984
|
-
function
|
|
22985
|
-
return
|
|
23002
|
+
function rl(e) {
|
|
23003
|
+
return nl(e * 10);
|
|
22986
23004
|
}
|
|
22987
23005
|
//#endregion
|
|
22988
23006
|
//#region src/editor/dataset/constant/Paper.ts
|
|
22989
|
-
var
|
|
23007
|
+
var il = {
|
|
22990
23008
|
A4: {
|
|
22991
|
-
width:
|
|
22992
|
-
height:
|
|
23009
|
+
width: nl(210),
|
|
23010
|
+
height: nl(297)
|
|
22993
23011
|
},
|
|
22994
23012
|
A5: {
|
|
22995
|
-
width:
|
|
22996
|
-
height:
|
|
23013
|
+
width: nl(148),
|
|
23014
|
+
height: nl(210)
|
|
22997
23015
|
},
|
|
22998
23016
|
LETTER: {
|
|
22999
|
-
width:
|
|
23000
|
-
height:
|
|
23017
|
+
width: tl(8.5),
|
|
23018
|
+
height: tl(11)
|
|
23001
23019
|
},
|
|
23002
23020
|
LEGAL: {
|
|
23003
|
-
width:
|
|
23004
|
-
height:
|
|
23021
|
+
width: tl(8.5),
|
|
23022
|
+
height: tl(14)
|
|
23005
23023
|
}
|
|
23006
|
-
}, { TEXT:
|
|
23024
|
+
}, { TEXT: al, HEADING_1: ol, HEADING_2: sl, HEADING_3: cl, BULLETED_LIST: ll, NUMBERED_LIST: ul, TODO_LIST: dl, TABLE: fl, DIVIDER: pl, PAGE_BREAK: ml } = pn, hl = [
|
|
23007
23025
|
{
|
|
23008
|
-
key:
|
|
23026
|
+
key: al,
|
|
23009
23027
|
i18nPath: "slashMenu.text",
|
|
23010
23028
|
icon: "text",
|
|
23011
23029
|
keywords: ["paragraph", "plain"],
|
|
@@ -23014,28 +23032,28 @@ var el = {
|
|
|
23014
23032
|
}
|
|
23015
23033
|
},
|
|
23016
23034
|
{
|
|
23017
|
-
key:
|
|
23035
|
+
key: ol,
|
|
23018
23036
|
i18nPath: "slashMenu.heading1",
|
|
23019
23037
|
icon: "heading1",
|
|
23020
23038
|
keywords: ["h1", "title"],
|
|
23021
23039
|
callback: (e) => e.executeTitle(U.FIRST)
|
|
23022
23040
|
},
|
|
23023
23041
|
{
|
|
23024
|
-
key:
|
|
23042
|
+
key: sl,
|
|
23025
23043
|
i18nPath: "slashMenu.heading2",
|
|
23026
23044
|
icon: "heading2",
|
|
23027
23045
|
keywords: ["h2", "subtitle"],
|
|
23028
23046
|
callback: (e) => e.executeTitle(U.SECOND)
|
|
23029
23047
|
},
|
|
23030
23048
|
{
|
|
23031
|
-
key:
|
|
23049
|
+
key: cl,
|
|
23032
23050
|
i18nPath: "slashMenu.heading3",
|
|
23033
23051
|
icon: "heading3",
|
|
23034
23052
|
keywords: ["h3"],
|
|
23035
23053
|
callback: (e) => e.executeTitle(U.THIRD)
|
|
23036
23054
|
},
|
|
23037
23055
|
{
|
|
23038
|
-
key:
|
|
23056
|
+
key: ll,
|
|
23039
23057
|
i18nPath: "slashMenu.bulletedList",
|
|
23040
23058
|
icon: "bulletedList",
|
|
23041
23059
|
keywords: [
|
|
@@ -23046,14 +23064,14 @@ var el = {
|
|
|
23046
23064
|
callback: (e) => e.executeList(yt.UL, St.DISC)
|
|
23047
23065
|
},
|
|
23048
23066
|
{
|
|
23049
|
-
key:
|
|
23067
|
+
key: ul,
|
|
23050
23068
|
i18nPath: "slashMenu.numberedList",
|
|
23051
23069
|
icon: "numberedList",
|
|
23052
23070
|
keywords: ["ol", "ordered"],
|
|
23053
23071
|
callback: (e) => e.executeList(yt.OL)
|
|
23054
23072
|
},
|
|
23055
23073
|
{
|
|
23056
|
-
key:
|
|
23074
|
+
key: dl,
|
|
23057
23075
|
i18nPath: "slashMenu.todoList",
|
|
23058
23076
|
icon: "todoList",
|
|
23059
23077
|
keywords: [
|
|
@@ -23065,7 +23083,7 @@ var el = {
|
|
|
23065
23083
|
callback: (e) => e.executeList(yt.UL, St.CHECKBOX)
|
|
23066
23084
|
},
|
|
23067
23085
|
{
|
|
23068
|
-
key:
|
|
23086
|
+
key: fl,
|
|
23069
23087
|
i18nPath: "slashMenu.table",
|
|
23070
23088
|
icon: "table",
|
|
23071
23089
|
keywords: ["grid"],
|
|
@@ -23073,7 +23091,7 @@ var el = {
|
|
|
23073
23091
|
callback: (e) => e.executeInsertTable(3, 3)
|
|
23074
23092
|
},
|
|
23075
23093
|
{
|
|
23076
|
-
key:
|
|
23094
|
+
key: pl,
|
|
23077
23095
|
i18nPath: "slashMenu.divider",
|
|
23078
23096
|
icon: "divider",
|
|
23079
23097
|
keywords: [
|
|
@@ -23085,7 +23103,7 @@ var el = {
|
|
|
23085
23103
|
callback: (e) => e.executeSeparator([0, 0])
|
|
23086
23104
|
},
|
|
23087
23105
|
{
|
|
23088
|
-
key:
|
|
23106
|
+
key: ml,
|
|
23089
23107
|
i18nPath: "slashMenu.pageBreak",
|
|
23090
23108
|
icon: "pageBreak",
|
|
23091
23109
|
keywords: ["break", "new page"],
|
|
@@ -23095,10 +23113,10 @@ var el = {
|
|
|
23095
23113
|
];
|
|
23096
23114
|
//#endregion
|
|
23097
23115
|
//#region src/editor/core/slashmenu/SlashMenu.ts
|
|
23098
|
-
function
|
|
23116
|
+
function gl(e) {
|
|
23099
23117
|
return e.normalize("NFD").replace(/\p{Diacritic}/gu, "").toLowerCase();
|
|
23100
23118
|
}
|
|
23101
|
-
var
|
|
23119
|
+
var _l = class {
|
|
23102
23120
|
draw;
|
|
23103
23121
|
command;
|
|
23104
23122
|
options;
|
|
@@ -23111,7 +23129,7 @@ var pl = class {
|
|
|
23111
23129
|
menuDom;
|
|
23112
23130
|
isHeadlessOpen;
|
|
23113
23131
|
constructor(e, t) {
|
|
23114
|
-
this.draw = e, this.command = t, this.options = e.getOptions(), this.ui = e.getUi(), this.i18n = e.getI18n(), this.menuList = [...
|
|
23132
|
+
this.draw = e, this.command = t, this.options = e.getOptions(), this.ui = e.getUi(), this.i18n = e.getI18n(), this.menuList = [...hl], this.session = null, this.itemList = [], this.activeIndex = 0, this.menuDom = null, this.isHeadlessOpen = !1, e.setSlashMenu(this);
|
|
23115
23133
|
}
|
|
23116
23134
|
registerSlashMenuList(e) {
|
|
23117
23135
|
return this.menuList.push(...e), () => {
|
|
@@ -23224,12 +23242,12 @@ var pl = class {
|
|
|
23224
23242
|
return e.i18nPath ? this.i18n.t(e.i18nPath) : e.name || e.key;
|
|
23225
23243
|
}
|
|
23226
23244
|
_filterMenuList(e, t) {
|
|
23227
|
-
let { disableKeys: n } = this.options.slashMenu, r = this.menuList.filter((e) => !e.disable && !n.includes(e.key) && (!e.when || e.when(t))), i =
|
|
23245
|
+
let { disableKeys: n } = this.options.slashMenu, r = this.menuList.filter((e) => !e.disable && !n.includes(e.key) && (!e.when || e.when(t))), i = gl(e.trim());
|
|
23228
23246
|
return i ? r.map((e) => {
|
|
23229
|
-
let t =
|
|
23247
|
+
let t = gl(this._getMenuName(e)), n = [
|
|
23230
23248
|
t,
|
|
23231
23249
|
...t.split(/\s+/),
|
|
23232
|
-
...(e.keywords || []).map(
|
|
23250
|
+
...(e.keywords || []).map(gl)
|
|
23233
23251
|
], r = -1;
|
|
23234
23252
|
return t.startsWith(i) ? r = 0 : n.some((e) => e.startsWith(i)) ? r = 1 : n.some((e) => e.includes(i)) && (r = 2), {
|
|
23235
23253
|
menu: e,
|
|
@@ -23306,38 +23324,38 @@ var pl = class {
|
|
|
23306
23324
|
let t = document.createElement("div");
|
|
23307
23325
|
return this.ui.applyClass(t, "slashMenu", "list", "ce-slash-menu__list"), t.style.overflowY = "auto", e.append(t), this.draw.getContainer().append(e), e;
|
|
23308
23326
|
}
|
|
23309
|
-
}, { BOLD:
|
|
23310
|
-
function
|
|
23327
|
+
}, { BOLD: vl, ITALIC: yl, UNDERLINE: bl, STRIKEOUT: xl, HIGHLIGHT: Sl, CLEAR_FORMAT: Cl } = gn;
|
|
23328
|
+
function wl(e, t) {
|
|
23311
23329
|
let { elementList: n } = e;
|
|
23312
23330
|
return !!n.length && n.every(t);
|
|
23313
23331
|
}
|
|
23314
|
-
var
|
|
23332
|
+
var Tl = [
|
|
23315
23333
|
{
|
|
23316
|
-
key:
|
|
23334
|
+
key: vl,
|
|
23317
23335
|
i18nPath: "bubbleMenu.bold",
|
|
23318
23336
|
icon: "bold",
|
|
23319
|
-
isActive: (e) =>
|
|
23337
|
+
isActive: (e) => wl(e, (e) => !!e.bold),
|
|
23320
23338
|
callback: (e) => e.executeBold()
|
|
23321
23339
|
},
|
|
23322
23340
|
{
|
|
23323
|
-
key:
|
|
23341
|
+
key: yl,
|
|
23324
23342
|
i18nPath: "bubbleMenu.italic",
|
|
23325
23343
|
icon: "italic",
|
|
23326
|
-
isActive: (e) =>
|
|
23344
|
+
isActive: (e) => wl(e, (e) => !!e.italic),
|
|
23327
23345
|
callback: (e) => e.executeItalic()
|
|
23328
23346
|
},
|
|
23329
23347
|
{
|
|
23330
|
-
key:
|
|
23348
|
+
key: bl,
|
|
23331
23349
|
i18nPath: "bubbleMenu.underline",
|
|
23332
23350
|
icon: "underline",
|
|
23333
|
-
isActive: (e) =>
|
|
23351
|
+
isActive: (e) => wl(e, (e) => !!e.underline),
|
|
23334
23352
|
callback: (e) => e.executeUnderline()
|
|
23335
23353
|
},
|
|
23336
23354
|
{
|
|
23337
|
-
key:
|
|
23355
|
+
key: xl,
|
|
23338
23356
|
i18nPath: "bubbleMenu.strikeout",
|
|
23339
23357
|
icon: "strikeout",
|
|
23340
|
-
isActive: (e) =>
|
|
23358
|
+
isActive: (e) => wl(e, (e) => !!e.strikeout),
|
|
23341
23359
|
callback: (e) => e.executeStrikeout()
|
|
23342
23360
|
},
|
|
23343
23361
|
{
|
|
@@ -23345,22 +23363,22 @@ var xl = [
|
|
|
23345
23363
|
isDivider: !0
|
|
23346
23364
|
},
|
|
23347
23365
|
{
|
|
23348
|
-
key:
|
|
23366
|
+
key: Sl,
|
|
23349
23367
|
i18nPath: "bubbleMenu.highlight",
|
|
23350
23368
|
icon: "highlight",
|
|
23351
|
-
isActive: (e) =>
|
|
23369
|
+
isActive: (e) => wl(e, (e) => !!e.highlight),
|
|
23352
23370
|
callback: (e, t) => {
|
|
23353
|
-
let n =
|
|
23371
|
+
let n = wl(t, (e) => !!e.highlight);
|
|
23354
23372
|
e.executeHighlight(n ? null : t.options.bubbleMenu.highlightColor);
|
|
23355
23373
|
}
|
|
23356
23374
|
},
|
|
23357
23375
|
{
|
|
23358
|
-
key:
|
|
23376
|
+
key: Cl,
|
|
23359
23377
|
i18nPath: "bubbleMenu.clearFormat",
|
|
23360
23378
|
icon: "clearFormat",
|
|
23361
23379
|
callback: (e) => e.executeFormat()
|
|
23362
23380
|
}
|
|
23363
|
-
],
|
|
23381
|
+
], El = {
|
|
23364
23382
|
bold: "B",
|
|
23365
23383
|
italic: "I",
|
|
23366
23384
|
underline: "U",
|
|
@@ -23368,10 +23386,10 @@ var xl = [
|
|
|
23368
23386
|
highlight: "H",
|
|
23369
23387
|
clearFormat: "⌫"
|
|
23370
23388
|
};
|
|
23371
|
-
function
|
|
23389
|
+
function Dl(e) {
|
|
23372
23390
|
return (!e.type || Ge.includes(e.type)) && e.value !== "";
|
|
23373
23391
|
}
|
|
23374
|
-
var
|
|
23392
|
+
var Ol = class {
|
|
23375
23393
|
draw;
|
|
23376
23394
|
command;
|
|
23377
23395
|
options;
|
|
@@ -23382,7 +23400,7 @@ var wl = class {
|
|
|
23382
23400
|
stateKey;
|
|
23383
23401
|
dismissedRangeKey;
|
|
23384
23402
|
constructor(e, t) {
|
|
23385
|
-
this.draw = e, this.command = t, this.options = e.getOptions(), this.ui = e.getUi(), this.i18n = e.getI18n(), this.menuList = [...
|
|
23403
|
+
this.draw = e, this.command = t, this.options = e.getOptions(), this.ui = e.getUi(), this.i18n = e.getI18n(), this.menuList = [...Tl], this.menuDom = null, this.stateKey = "", this.dismissedRangeKey = "", e.setBubbleMenu(this);
|
|
23386
23404
|
}
|
|
23387
23405
|
registerBubbleMenuList(e) {
|
|
23388
23406
|
return this.menuList.push(...e), () => {
|
|
@@ -23452,7 +23470,7 @@ var wl = class {
|
|
|
23452
23470
|
if (n === this.dismissedRangeKey) return null;
|
|
23453
23471
|
this.dismissedRangeKey = "";
|
|
23454
23472
|
}
|
|
23455
|
-
let r = (t.getSelectionElementList() || []).filter(
|
|
23473
|
+
let r = (t.getSelectionElementList() || []).filter(Dl);
|
|
23456
23474
|
if (!r.length) return null;
|
|
23457
23475
|
let { isTable: i } = e.getPosition().getPositionContext();
|
|
23458
23476
|
return {
|
|
@@ -23500,7 +23518,7 @@ var wl = class {
|
|
|
23500
23518
|
let t = document.createElement("button");
|
|
23501
23519
|
t.type = "button", this.ui.applyClass(t, "bubbleMenu", "item", "ce-bubble-menu__item"), t.title = e.name, t.setAttribute("aria-label", e.name), t.setAttribute("aria-pressed", String(e.active)), t.dataset.key = e.key, this.ui.setState(t, "active", e.active);
|
|
23502
23520
|
let r = document.createElement("span");
|
|
23503
|
-
this.ui.applyClass(r, "bubbleMenu", "icon", "ce-bubble-menu__icon"), e.icon && (r.dataset.icon = e.icon), r.append(document.createTextNode(
|
|
23521
|
+
this.ui.applyClass(r, "bubbleMenu", "icon", "ce-bubble-menu__icon"), e.icon && (r.dataset.icon = e.icon), r.append(document.createTextNode(El[e.icon || ""] || e.name.charAt(0))), t.append(r), t.onclick = () => this.run(e.key), n.append(t);
|
|
23504
23522
|
}
|
|
23505
23523
|
n.style.display = "flex", this._placeDom(n, e);
|
|
23506
23524
|
}
|
|
@@ -23520,19 +23538,19 @@ var wl = class {
|
|
|
23520
23538
|
whiteSpace: "nowrap"
|
|
23521
23539
|
}), e.onmousedown = (e) => e.preventDefault(), this.draw.getContainer().append(e), e;
|
|
23522
23540
|
}
|
|
23523
|
-
},
|
|
23524
|
-
AreaMode: () =>
|
|
23541
|
+
}, kl = /* @__PURE__ */ t({
|
|
23542
|
+
AreaMode: () => Lo,
|
|
23525
23543
|
BackgroundRepeat: () => Rt,
|
|
23526
23544
|
BackgroundSize: () => Lt,
|
|
23527
23545
|
BlockType: () => jt,
|
|
23528
|
-
Command: () =>
|
|
23546
|
+
Command: () => Wo,
|
|
23529
23547
|
ControlComponent: () => G,
|
|
23530
23548
|
ControlIndentation: () => Mt,
|
|
23531
23549
|
ControlState: () => Nt,
|
|
23532
23550
|
ControlType: () => W,
|
|
23533
23551
|
EDITOR_CLIPBOARD: () => Ce,
|
|
23534
23552
|
EDITOR_COMPONENT: () => Se,
|
|
23535
|
-
Editor: () =>
|
|
23553
|
+
Editor: () => Al,
|
|
23536
23554
|
EditorComponent: () => m,
|
|
23537
23555
|
EditorLayout: () => y,
|
|
23538
23556
|
EditorMode: () => g,
|
|
@@ -23540,8 +23558,8 @@ var wl = class {
|
|
|
23540
23558
|
ElementType: () => w,
|
|
23541
23559
|
FlexDirection: () => c,
|
|
23542
23560
|
INTERNAL_BUBBLE_MENU_KEY: () => gn,
|
|
23543
|
-
INTERNAL_CONTEXT_MENU_KEY: () =>
|
|
23544
|
-
INTERNAL_SHORTCUT_KEY: () =>
|
|
23561
|
+
INTERNAL_CONTEXT_MENU_KEY: () => Rs,
|
|
23562
|
+
INTERNAL_SHORTCUT_KEY: () => _i,
|
|
23545
23563
|
INTERNAL_SLASH_MENU_KEY: () => pn,
|
|
23546
23564
|
ImageDisplay: () => a,
|
|
23547
23565
|
KeyMap: () => Z,
|
|
@@ -23550,10 +23568,10 @@ var wl = class {
|
|
|
23550
23568
|
ListStyle: () => St,
|
|
23551
23569
|
ListType: () => yt,
|
|
23552
23570
|
LocationPosition: () => o,
|
|
23553
|
-
MacroType: () =>
|
|
23571
|
+
MacroType: () => Kc,
|
|
23554
23572
|
MaxHeightRatio: () => r,
|
|
23555
23573
|
NumberType: () => i,
|
|
23556
|
-
PAPER_SIZE: () =>
|
|
23574
|
+
PAPER_SIZE: () => il,
|
|
23557
23575
|
PageMode: () => v,
|
|
23558
23576
|
PaperDirection: () => b,
|
|
23559
23577
|
RenderMode: () => S,
|
|
@@ -23562,24 +23580,24 @@ var wl = class {
|
|
|
23562
23580
|
TableBorder: () => Pt,
|
|
23563
23581
|
TdBorder: () => Ft,
|
|
23564
23582
|
TdSlash: () => It,
|
|
23565
|
-
TextDecorationStyle: () =>
|
|
23583
|
+
TextDecorationStyle: () => Li,
|
|
23566
23584
|
TitleLevel: () => U,
|
|
23567
23585
|
VerticalAlign: () => J,
|
|
23568
23586
|
WatermarkLayer: () => nn,
|
|
23569
23587
|
WatermarkType: () => tn,
|
|
23570
23588
|
WordBreak: () => x,
|
|
23571
|
-
cmToPx: () =>
|
|
23589
|
+
cmToPx: () => rl,
|
|
23572
23590
|
createDomFromElementList: () => Wn,
|
|
23573
|
-
default: () =>
|
|
23574
|
-
formatShortcut: () =>
|
|
23575
|
-
getEditorDataByHTML: () =>
|
|
23576
|
-
getElementListByHTML: () =>
|
|
23577
|
-
getTextFromElementList: () =>
|
|
23578
|
-
inchToPx: () =>
|
|
23591
|
+
default: () => Al,
|
|
23592
|
+
formatShortcut: () => Ws,
|
|
23593
|
+
getEditorDataByHTML: () => Zn,
|
|
23594
|
+
getElementListByHTML: () => Qn,
|
|
23595
|
+
getTextFromElementList: () => $n,
|
|
23596
|
+
inchToPx: () => tl,
|
|
23579
23597
|
isApple: () => Ee,
|
|
23580
|
-
mmToPx: () =>
|
|
23598
|
+
mmToPx: () => nl,
|
|
23581
23599
|
splitText: () => L
|
|
23582
|
-
}),
|
|
23600
|
+
}), Al = class {
|
|
23583
23601
|
command;
|
|
23584
23602
|
version;
|
|
23585
23603
|
listener;
|
|
@@ -23602,22 +23620,22 @@ var wl = class {
|
|
|
23602
23620
|
editorOptions: i,
|
|
23603
23621
|
isForceCompensation: !0
|
|
23604
23622
|
});
|
|
23605
|
-
}), this.version = n, this.listener = new
|
|
23606
|
-
let u = new
|
|
23623
|
+
}), this.version = n, this.listener = new Fs(), this.eventBus = new Zc(), this.override = new Qc();
|
|
23624
|
+
let u = new Cs(i, e, () => {
|
|
23607
23625
|
d.render({
|
|
23608
23626
|
isCompute: !1,
|
|
23609
23627
|
isSetCursor: !1,
|
|
23610
23628
|
isSubmitHistory: !1
|
|
23611
23629
|
});
|
|
23612
|
-
}), d = new
|
|
23630
|
+
}), d = new Uo(e, i, {
|
|
23613
23631
|
header: a,
|
|
23614
23632
|
main: s,
|
|
23615
23633
|
footer: c,
|
|
23616
23634
|
graffiti: l
|
|
23617
23635
|
}, this.listener, this.eventBus, this.override);
|
|
23618
|
-
d.setThemeColors(u), i.observeTheme && u.hasVariables() && u.observe(), this.command = new
|
|
23619
|
-
let f = new
|
|
23620
|
-
this.register = new
|
|
23636
|
+
d.setThemeColors(u), i.observeTheme && u.hasVariables() && u.observe(), this.command = new Wo(new _s(d)), this.macro = new Jc(this.command);
|
|
23637
|
+
let f = new Vc(d, this.command), p = new _l(d, this.command), m = new Ol(d, this.command), h = new Ds(d, this.command), g = new Ps(d), _ = new Gc(d, this.command), v = new vs(d, this.command, this.eventBus);
|
|
23638
|
+
this.register = new Is({
|
|
23621
23639
|
contextMenu: f,
|
|
23622
23640
|
slashMenu: p,
|
|
23623
23641
|
bubbleMenu: m,
|
|
@@ -23626,13 +23644,13 @@ var wl = class {
|
|
|
23626
23644
|
}), this.destroy = () => {
|
|
23627
23645
|
v.destroy(), u.destroy(), g.destroy(), p.close(), m.hide(), h.destroy(), d.destroy(), _.removeEvent(), f.removeEvent(), this.eventBus.dangerouslyClearAll();
|
|
23628
23646
|
};
|
|
23629
|
-
let y = new
|
|
23647
|
+
let y = new qc(this);
|
|
23630
23648
|
this.use = y.use.bind(y);
|
|
23631
23649
|
let { autoFocus: b } = i;
|
|
23632
23650
|
b && !d.isReadonly() && !d.isDisabled() && this.command.executeFocus({ position: b === "end" ? o.AFTER : o.BEFORE });
|
|
23633
23651
|
}
|
|
23634
23652
|
};
|
|
23635
23653
|
//#endregion
|
|
23636
|
-
export {
|
|
23654
|
+
export { Lo as AreaMode, Rt as BackgroundRepeat, Lt as BackgroundSize, jt as BlockType, Wo as Command, G as ControlComponent, Mt as ControlIndentation, Nt as ControlState, W as ControlType, Ce as EDITOR_CLIPBOARD, Se as EDITOR_COMPONENT, Al as Editor, Al as default, m as EditorComponent, y as EditorLayout, g as EditorMode, _ as EditorZone, w as ElementType, c as FlexDirection, gn as INTERNAL_BUBBLE_MENU_KEY, Rs as INTERNAL_CONTEXT_MENU_KEY, _i as INTERNAL_SHORTCUT_KEY, pn as INTERNAL_SLASH_MENU_KEY, a as ImageDisplay, Z as KeyMap, f as LETTER_CLASS, on as LineNumberType, St as ListStyle, yt as ListType, o as LocationPosition, Kc as MacroType, r as MaxHeightRatio, i as NumberType, il as PAPER_SIZE, v as PageMode, b as PaperDirection, S as RenderMode, p as RowFlex, s as SurroundPosition, Pt as TableBorder, Ft as TdBorder, It as TdSlash, Li as TextDecorationStyle, U as TitleLevel, J as VerticalAlign, nn as WatermarkLayer, tn as WatermarkType, x as WordBreak, rl as cmToPx, Wn as createDomFromElementList, Ws as formatShortcut, Zn as getEditorDataByHTML, Qn as getElementListByHTML, $n as getTextFromElementList, tl as inchToPx, Ee as isApple, nl as mmToPx, L as splitText };
|
|
23637
23655
|
|
|
23638
23656
|
//# sourceMappingURL=cado-editor.js.map
|