gp-designer 1.0.31 → 1.0.32
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/gp-designer.es.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { defineComponent as ze, computed as At, ref as
|
1
|
+
import { defineComponent as ze, computed as At, ref as $, watch as et, resolveComponent as Qu, openBlock as D, createElementBlock as R, Fragment as Zt, createBlock as Ct, resolveDynamicComponent as ju, mergeProps as zu, withModifiers as Le, withCtx as Ya, createTextVNode as Ei, toDisplayString as Ne, renderList as Fi, unref as de, createElementVNode as x, createCommentVNode as H, toRaw as hn, Transition as Ku, normalizeClass as fn, renderSlot as Jt, reactive as Zu, createApp as Ju, h as Es, withDirectives as at, vModelSelect as er, vModelText as Tt, createVNode as ut, toRefs as tr, normalizeStyle as Ts } from "vue";
|
2
2
|
var K;
|
3
3
|
(function(e) {
|
4
4
|
e.Root = "root", e.Text = "text", e.Directive = "directive", e.Comment = "comment", e.Script = "script", e.Style = "style", e.Tag = "tag", e.CDATA = "cdata", e.Doctype = "doctype";
|
@@ -173,7 +173,7 @@ class $i extends Vi {
|
|
173
173
|
});
|
174
174
|
}
|
175
175
|
}
|
176
|
-
function
|
176
|
+
function B(e) {
|
177
177
|
return ar(e);
|
178
178
|
}
|
179
179
|
function qa(e) {
|
@@ -200,7 +200,7 @@ function oa(e, t = !1) {
|
|
200
200
|
a = new ra(e.data);
|
201
201
|
else if (Va(e))
|
202
202
|
a = new Yi(e.data);
|
203
|
-
else if (
|
203
|
+
else if (B(e)) {
|
204
204
|
const i = t ? ai(e.children) : [], s = new $i(e.name, { ...e.attribs }, i);
|
205
205
|
i.forEach((u) => u.parent = s), e.namespace != null && (s.namespace = e.namespace), e["x-attribsNamespace"] && (s["x-attribsNamespace"] = { ...e["x-attribsNamespace"] }), e["x-attribsPrefix"] && (s["x-attribsPrefix"] = { ...e["x-attribsPrefix"] }), a = s;
|
206
206
|
} else if (qa(e)) {
|
@@ -862,7 +862,7 @@ function kr(e, t) {
|
|
862
862
|
return Te(e) ? e.children.map((a) => Nn(a, t)).join("") : "";
|
863
863
|
}
|
864
864
|
function Oa(e) {
|
865
|
-
return Array.isArray(e) ? e.map(Oa).join("") :
|
865
|
+
return Array.isArray(e) ? e.map(Oa).join("") : B(e) ? e.name === "br" ? `
|
866
866
|
` : Oa(e.children) : qa(e) ? Oa(e.children) : Xe(e) ? e.data : "";
|
867
867
|
}
|
868
868
|
function Bt(e) {
|
@@ -901,13 +901,13 @@ function Ur(e) {
|
|
901
901
|
}
|
902
902
|
function Xi(e) {
|
903
903
|
let { next: t } = e;
|
904
|
-
for (; t !== null && !
|
904
|
+
for (; t !== null && !B(t); )
|
905
905
|
({ next: t } = t);
|
906
906
|
return t;
|
907
907
|
}
|
908
908
|
function Qi(e) {
|
909
909
|
let { prev: t } = e;
|
910
|
-
for (; t !== null && !
|
910
|
+
for (; t !== null && !B(t); )
|
911
911
|
({ prev: t } = t);
|
912
912
|
return t;
|
913
913
|
}
|
@@ -987,14 +987,14 @@ function zi(e, t, a = !0) {
|
|
987
987
|
let i = null;
|
988
988
|
for (let s = 0; s < t.length && !i; s++) {
|
989
989
|
const u = t[s];
|
990
|
-
if (
|
990
|
+
if (B(u))
|
991
991
|
e(u) ? i = u : a && u.children.length > 0 && (i = zi(e, u.children, !0));
|
992
992
|
else continue;
|
993
993
|
}
|
994
994
|
return i;
|
995
995
|
}
|
996
996
|
function Sn(e, t) {
|
997
|
-
return t.some((a) =>
|
997
|
+
return t.some((a) => B(a) && (e(a) || Sn(e, a.children)));
|
998
998
|
}
|
999
999
|
function Wr(e, t) {
|
1000
1000
|
const a = [], i = [t], s = [0];
|
@@ -1006,12 +1006,12 @@ function Wr(e, t) {
|
|
1006
1006
|
continue;
|
1007
1007
|
}
|
1008
1008
|
const u = i[0][s[0]++];
|
1009
|
-
|
1009
|
+
B(u) && (e(u) && a.push(u), u.children.length > 0 && (s.unshift(0), i.unshift(u.children)));
|
1010
1010
|
}
|
1011
1011
|
}
|
1012
1012
|
const La = {
|
1013
1013
|
tag_name(e) {
|
1014
|
-
return typeof e == "function" ? (t) =>
|
1014
|
+
return typeof e == "function" ? (t) => B(t) && e(t.name) : e === "*" ? B : (t) => B(t) && t.name === e;
|
1015
1015
|
},
|
1016
1016
|
tag_type(e) {
|
1017
1017
|
return typeof e == "function" ? (t) => e(t.type) : (t) => t.type === e;
|
@@ -1021,7 +1021,7 @@ const La = {
|
|
1021
1021
|
}
|
1022
1022
|
};
|
1023
1023
|
function xn(e, t) {
|
1024
|
-
return typeof t == "function" ? (a) =>
|
1024
|
+
return typeof t == "function" ? (a) => B(a) && t(a.attribs[e]) : (a) => B(a) && a.attribs[e] === t;
|
1025
1025
|
}
|
1026
1026
|
function Gr(e, t) {
|
1027
1027
|
return (a) => e(a) || t(a);
|
@@ -1205,7 +1205,7 @@ const Xa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1205
1205
|
isCDATA: qa,
|
1206
1206
|
isComment: Va,
|
1207
1207
|
isDocument: dt,
|
1208
|
-
isTag:
|
1208
|
+
isTag: B,
|
1209
1209
|
isText: Xe,
|
1210
1210
|
nextElementSibling: Xi,
|
1211
1211
|
prepend: Vr,
|
@@ -1306,7 +1306,7 @@ const fo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1306
1306
|
text: ca,
|
1307
1307
|
xml: ro
|
1308
1308
|
}, Symbol.toStringTag, { value: "Module" }));
|
1309
|
-
function
|
1309
|
+
function tt(e) {
|
1310
1310
|
return e.cheerio != null;
|
1311
1311
|
}
|
1312
1312
|
function mo(e) {
|
@@ -1335,7 +1335,7 @@ function _i(e) {
|
|
1335
1335
|
const la = Object.prototype.hasOwnProperty, da = /\s+/, Ai = "data-", Ki = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, To = /^{[^]*}$|^\[[^]*]$/;
|
1336
1336
|
function Ra(e, t, a) {
|
1337
1337
|
var i;
|
1338
|
-
if (!(!e || !
|
1338
|
+
if (!(!e || !B(e))) {
|
1339
1339
|
if ((i = e.attribs) !== null && i !== void 0 || (e.attribs = {}), !t)
|
1340
1340
|
return e.attribs;
|
1341
1341
|
if (la.call(e.attribs, t))
|
@@ -1355,11 +1355,11 @@ function po(e, t) {
|
|
1355
1355
|
if (typeof e != "string")
|
1356
1356
|
throw new Error("Bad combination of arguments.");
|
1357
1357
|
return re(this, (a, i) => {
|
1358
|
-
|
1358
|
+
B(a) && Mt(a, e, t.call(a, i, a.attribs[e]));
|
1359
1359
|
});
|
1360
1360
|
}
|
1361
1361
|
return re(this, (a) => {
|
1362
|
-
if (
|
1362
|
+
if (B(a))
|
1363
1363
|
if (typeof e == "object")
|
1364
1364
|
for (const i of Object.keys(e)) {
|
1365
1365
|
const s = e[i];
|
@@ -1384,7 +1384,7 @@ function bo(e, t) {
|
|
1384
1384
|
var a;
|
1385
1385
|
if (typeof e == "string" && t === void 0) {
|
1386
1386
|
const i = this[0];
|
1387
|
-
if (!i || !
|
1387
|
+
if (!i || !B(i))
|
1388
1388
|
return;
|
1389
1389
|
switch (e) {
|
1390
1390
|
case "style": {
|
@@ -1418,11 +1418,11 @@ function bo(e, t) {
|
|
1418
1418
|
if (typeof e == "object")
|
1419
1419
|
throw new TypeError("Bad combination of arguments.");
|
1420
1420
|
return re(this, (i, s) => {
|
1421
|
-
|
1421
|
+
B(i) && si(i, e, t.call(i, s, As(i, e, this.options.xmlMode)), this.options.xmlMode);
|
1422
1422
|
});
|
1423
1423
|
}
|
1424
1424
|
return re(this, (i) => {
|
1425
|
-
if (
|
1425
|
+
if (B(i))
|
1426
1426
|
if (typeof e == "object")
|
1427
1427
|
for (const s of Object.keys(e)) {
|
1428
1428
|
const u = e[s];
|
@@ -1473,16 +1473,16 @@ function Rn(e) {
|
|
1473
1473
|
function Ao(e, t) {
|
1474
1474
|
var a;
|
1475
1475
|
const i = this[0];
|
1476
|
-
if (!i || !
|
1476
|
+
if (!i || !B(i))
|
1477
1477
|
return;
|
1478
1478
|
const s = i;
|
1479
1479
|
return (a = s.data) !== null && a !== void 0 || (s.data = {}), e == null ? go(s) : typeof e == "object" || t !== void 0 ? (re(this, (u) => {
|
1480
|
-
|
1480
|
+
B(u) && (typeof e == "object" ? Ns(u, e) : Ns(u, e, t));
|
1481
1481
|
}), this) : _o(s, e);
|
1482
1482
|
}
|
1483
1483
|
function No(e) {
|
1484
1484
|
const t = arguments.length === 0, a = this[0];
|
1485
|
-
if (!a || !
|
1485
|
+
if (!a || !B(a))
|
1486
1486
|
return t ? void 0 : this;
|
1487
1487
|
switch (a.name) {
|
1488
1488
|
case "textarea":
|
@@ -1515,13 +1515,13 @@ function Co(e) {
|
|
1515
1515
|
const t = Ma(e);
|
1516
1516
|
for (const a of t)
|
1517
1517
|
re(this, (i) => {
|
1518
|
-
|
1518
|
+
B(i) && Mn(i, a);
|
1519
1519
|
});
|
1520
1520
|
return this;
|
1521
1521
|
}
|
1522
1522
|
function Io(e) {
|
1523
1523
|
return this.toArray().some((t) => {
|
1524
|
-
const a =
|
1524
|
+
const a = B(t) && t.attribs.class;
|
1525
1525
|
let i = -1;
|
1526
1526
|
if (a && e.length > 0)
|
1527
1527
|
for (; (i = a.indexOf(e, i + 1)) > -1; ) {
|
@@ -1535,7 +1535,7 @@ function Io(e) {
|
|
1535
1535
|
function Pn(e) {
|
1536
1536
|
if (typeof e == "function")
|
1537
1537
|
return re(this, (i, s) => {
|
1538
|
-
if (
|
1538
|
+
if (B(i)) {
|
1539
1539
|
const u = i.attribs.class || "";
|
1540
1540
|
Pn.call([i], e.call(i, s, u));
|
1541
1541
|
}
|
@@ -1545,7 +1545,7 @@ function Pn(e) {
|
|
1545
1545
|
const t = e.split(da), a = this.length;
|
1546
1546
|
for (let i = 0; i < a; i++) {
|
1547
1547
|
const s = this[i];
|
1548
|
-
if (!
|
1548
|
+
if (!B(s))
|
1549
1549
|
continue;
|
1550
1550
|
const u = Ra(s, "class", !1);
|
1551
1551
|
if (u) {
|
@@ -1563,11 +1563,11 @@ function Pn(e) {
|
|
1563
1563
|
function kn(e) {
|
1564
1564
|
if (typeof e == "function")
|
1565
1565
|
return re(this, (s, u) => {
|
1566
|
-
|
1566
|
+
B(s) && kn.call([s], e.call(s, u, s.attribs.class || ""));
|
1567
1567
|
});
|
1568
1568
|
const t = Ma(e), a = t.length, i = arguments.length === 0;
|
1569
1569
|
return re(this, (s) => {
|
1570
|
-
if (
|
1570
|
+
if (B(s))
|
1571
1571
|
if (i)
|
1572
1572
|
s.attribs.class = "";
|
1573
1573
|
else {
|
@@ -1584,14 +1584,14 @@ function kn(e) {
|
|
1584
1584
|
function wn(e, t) {
|
1585
1585
|
if (typeof e == "function")
|
1586
1586
|
return re(this, (r, o) => {
|
1587
|
-
|
1587
|
+
B(r) && wn.call([r], e.call(r, o, r.attribs.class || "", t), t);
|
1588
1588
|
});
|
1589
1589
|
if (!e || typeof e != "string")
|
1590
1590
|
return this;
|
1591
1591
|
const a = e.split(da), i = a.length, s = typeof t == "boolean" ? t ? 1 : -1 : 0, u = this.length;
|
1592
1592
|
for (let r = 0; r < u; r++) {
|
1593
1593
|
const o = this[r];
|
1594
|
-
if (!
|
1594
|
+
if (!B(o))
|
1595
1595
|
continue;
|
1596
1596
|
const c = Ma(o.attribs.class);
|
1597
1597
|
for (let d = 0; d < i; d++) {
|
@@ -1614,10 +1614,10 @@ const So = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1614
1614
|
toggleClass: wn,
|
1615
1615
|
val: No
|
1616
1616
|
}, Symbol.toStringTag, { value: "Module" }));
|
1617
|
-
var
|
1617
|
+
var M;
|
1618
1618
|
(function(e) {
|
1619
1619
|
e.Attribute = "attribute", e.Pseudo = "pseudo", e.PseudoElement = "pseudo-element", e.Tag = "tag", e.Universal = "universal", e.Adjacent = "adjacent", e.Child = "child", e.Descendant = "descendant", e.Parent = "parent", e.Sibling = "sibling", e.ColumnCombinator = "column-combinator";
|
1620
|
-
})(
|
1620
|
+
})(M || (M = {}));
|
1621
1621
|
var he;
|
1622
1622
|
(function(e) {
|
1623
1623
|
e.Any = "any", e.Element = "element", e.End = "end", e.Equals = "equals", e.Exists = "exists", e.Hyphen = "hyphen", e.Not = "not", e.Start = "start";
|
@@ -1640,12 +1640,12 @@ const Cs = /^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/, xo = /\\(
|
|
1640
1640
|
]);
|
1641
1641
|
function ea(e) {
|
1642
1642
|
switch (e.type) {
|
1643
|
-
case
|
1644
|
-
case
|
1645
|
-
case
|
1646
|
-
case
|
1647
|
-
case
|
1648
|
-
case
|
1643
|
+
case M.Adjacent:
|
1644
|
+
case M.Child:
|
1645
|
+
case M.Descendant:
|
1646
|
+
case M.Parent:
|
1647
|
+
case M.Sibling:
|
1648
|
+
case M.ColumnCombinator:
|
1649
1649
|
return !0;
|
1650
1650
|
default:
|
1651
1651
|
return !1;
|
@@ -1711,7 +1711,7 @@ function Bn(e, t, a) {
|
|
1711
1711
|
throw new Error("Did not expect successive traversals.");
|
1712
1712
|
}
|
1713
1713
|
function d(T) {
|
1714
|
-
if (i.length > 0 && i[i.length - 1].type ===
|
1714
|
+
if (i.length > 0 && i[i.length - 1].type === M.Descendant) {
|
1715
1715
|
i[i.length - 1].type = T;
|
1716
1716
|
return;
|
1717
1717
|
}
|
@@ -1719,7 +1719,7 @@ function Bn(e, t, a) {
|
|
1719
1719
|
}
|
1720
1720
|
function f(T, g) {
|
1721
1721
|
i.push({
|
1722
|
-
type:
|
1722
|
+
type: M.Attribute,
|
1723
1723
|
name: T,
|
1724
1724
|
action: g,
|
1725
1725
|
value: s(1),
|
@@ -1728,7 +1728,7 @@ function Bn(e, t, a) {
|
|
1728
1728
|
});
|
1729
1729
|
}
|
1730
1730
|
function E() {
|
1731
|
-
if (i.length && i[i.length - 1].type ===
|
1731
|
+
if (i.length && i[i.length - 1].type === M.Descendant && i.pop(), i.length === 0)
|
1732
1732
|
throw new Error("Empty sub-selector");
|
1733
1733
|
e.push(i);
|
1734
1734
|
}
|
@@ -1742,23 +1742,23 @@ function Bn(e, t, a) {
|
|
1742
1742
|
case 10:
|
1743
1743
|
case 12:
|
1744
1744
|
case 13: {
|
1745
|
-
(i.length === 0 || i[0].type !==
|
1745
|
+
(i.length === 0 || i[0].type !== M.Descendant) && (c(), i.push({ type: M.Descendant })), u(1);
|
1746
1746
|
break;
|
1747
1747
|
}
|
1748
1748
|
case 62: {
|
1749
|
-
d(
|
1749
|
+
d(M.Child), u(1);
|
1750
1750
|
break;
|
1751
1751
|
}
|
1752
1752
|
case 60: {
|
1753
|
-
d(
|
1753
|
+
d(M.Parent), u(1);
|
1754
1754
|
break;
|
1755
1755
|
}
|
1756
1756
|
case 126: {
|
1757
|
-
d(
|
1757
|
+
d(M.Sibling), u(1);
|
1758
1758
|
break;
|
1759
1759
|
}
|
1760
1760
|
case 43: {
|
1761
|
-
d(
|
1761
|
+
d(M.Adjacent), u(1);
|
1762
1762
|
break;
|
1763
1763
|
}
|
1764
1764
|
case 46: {
|
@@ -1773,51 +1773,51 @@ function Bn(e, t, a) {
|
|
1773
1773
|
u(1);
|
1774
1774
|
let g, C = null;
|
1775
1775
|
t.charCodeAt(a) === 124 ? g = s(1) : t.startsWith("*|", a) ? (C = "*", g = s(2)) : (g = s(0), t.charCodeAt(a) === 124 && t.charCodeAt(a + 1) !== 61 && (C = g, g = s(1))), u(0);
|
1776
|
-
let
|
1776
|
+
let L = he.Exists;
|
1777
1777
|
const y = Oo.get(t.charCodeAt(a));
|
1778
1778
|
if (y) {
|
1779
|
-
if (
|
1779
|
+
if (L = y, t.charCodeAt(a + 1) !== 61)
|
1780
1780
|
throw new Error("Expected `=`");
|
1781
1781
|
u(2);
|
1782
|
-
} else t.charCodeAt(a) === 61 && (
|
1783
|
-
let
|
1784
|
-
if (
|
1782
|
+
} else t.charCodeAt(a) === 61 && (L = he.Equals, u(1));
|
1783
|
+
let V = "", F = null;
|
1784
|
+
if (L !== "exists") {
|
1785
1785
|
if (ni(t.charCodeAt(a))) {
|
1786
|
-
const
|
1786
|
+
const q = t.charCodeAt(a);
|
1787
1787
|
let _ = a + 1;
|
1788
|
-
for (; _ < t.length && (t.charCodeAt(_) !==
|
1788
|
+
for (; _ < t.length && (t.charCodeAt(_) !== q || o(_)); )
|
1789
1789
|
_ += 1;
|
1790
|
-
if (t.charCodeAt(_) !==
|
1790
|
+
if (t.charCodeAt(_) !== q)
|
1791
1791
|
throw new Error("Attribute value didn't end");
|
1792
|
-
|
1792
|
+
V = Vt(t.slice(a + 1, _)), a = _ + 1;
|
1793
1793
|
} else {
|
1794
|
-
const
|
1794
|
+
const q = a;
|
1795
1795
|
for (; a < t.length && (!Is(t.charCodeAt(a)) && t.charCodeAt(a) !== 93 || o(a)); )
|
1796
1796
|
a += 1;
|
1797
|
-
|
1797
|
+
V = Vt(t.slice(q, a));
|
1798
1798
|
}
|
1799
1799
|
u(0);
|
1800
1800
|
const ee = t.charCodeAt(a) | 32;
|
1801
|
-
ee === 115 ? (
|
1801
|
+
ee === 115 ? (F = !1, u(1)) : ee === 105 && (F = !0, u(1));
|
1802
1802
|
}
|
1803
1803
|
if (t.charCodeAt(a) !== 93)
|
1804
1804
|
throw new Error("Attribute selector didn't terminate");
|
1805
1805
|
a += 1;
|
1806
|
-
const
|
1807
|
-
type:
|
1806
|
+
const Y = {
|
1807
|
+
type: M.Attribute,
|
1808
1808
|
name: g,
|
1809
|
-
action:
|
1810
|
-
value:
|
1809
|
+
action: L,
|
1810
|
+
value: V,
|
1811
1811
|
namespace: C,
|
1812
|
-
ignoreCase:
|
1812
|
+
ignoreCase: F
|
1813
1813
|
};
|
1814
|
-
i.push(
|
1814
|
+
i.push(Y);
|
1815
1815
|
break;
|
1816
1816
|
}
|
1817
1817
|
case 58: {
|
1818
1818
|
if (t.charCodeAt(a + 1) === 58) {
|
1819
1819
|
i.push({
|
1820
|
-
type:
|
1820
|
+
type: M.PseudoElement,
|
1821
1821
|
name: s(2).toLowerCase(),
|
1822
1822
|
data: t.charCodeAt(a) === 40 ? r() : null
|
1823
1823
|
});
|
@@ -1834,12 +1834,12 @@ function Bn(e, t, a) {
|
|
1834
1834
|
a += 1;
|
1835
1835
|
} else {
|
1836
1836
|
if (C = r(), vo.has(g)) {
|
1837
|
-
const
|
1838
|
-
|
1837
|
+
const L = C.charCodeAt(0);
|
1838
|
+
L === C.charCodeAt(C.length - 1) && ni(L) && (C = C.slice(1, -1));
|
1839
1839
|
}
|
1840
1840
|
C = Vt(C);
|
1841
1841
|
}
|
1842
|
-
i.push({ type:
|
1842
|
+
i.push({ type: M.Pseudo, name: g, data: C });
|
1843
1843
|
break;
|
1844
1844
|
}
|
1845
1845
|
case 44: {
|
@@ -1848,10 +1848,10 @@ function Bn(e, t, a) {
|
|
1848
1848
|
}
|
1849
1849
|
default: {
|
1850
1850
|
if (t.startsWith("/*", a)) {
|
1851
|
-
const
|
1852
|
-
if (
|
1851
|
+
const L = t.indexOf("*/", a + 2);
|
1852
|
+
if (L < 0)
|
1853
1853
|
throw new Error("Comment was not terminated");
|
1854
|
-
a =
|
1854
|
+
a = L + 2, i.length === 0 && u(0);
|
1855
1855
|
break;
|
1856
1856
|
}
|
1857
1857
|
let g = null, C;
|
@@ -1859,14 +1859,14 @@ function Bn(e, t, a) {
|
|
1859
1859
|
a += 1, C = "*";
|
1860
1860
|
else if (T === 124) {
|
1861
1861
|
if (C = "", t.charCodeAt(a + 1) === 124) {
|
1862
|
-
d(
|
1862
|
+
d(M.ColumnCombinator), u(2);
|
1863
1863
|
break;
|
1864
1864
|
}
|
1865
1865
|
} else if (Cs.test(t.slice(a)))
|
1866
1866
|
C = s(0);
|
1867
1867
|
else
|
1868
1868
|
break e;
|
1869
|
-
t.charCodeAt(a) === 124 && t.charCodeAt(a + 1) !== 124 && (g = C, t.charCodeAt(a + 1) === 42 ? (C = "*", a += 2) : C = s(1)), i.push(C === "*" ? { type:
|
1869
|
+
t.charCodeAt(a) === 124 && t.charCodeAt(a + 1) !== 124 && (g = C, t.charCodeAt(a + 1) === 42 ? (C = "*", a += 2) : C = s(1)), i.push(C === "*" ? { type: M.Universal, namespace: g } : { type: M.Tag, name: C, namespace: g });
|
1870
1870
|
}
|
1871
1871
|
}
|
1872
1872
|
}
|
@@ -1883,11 +1883,11 @@ var Pa = {
|
|
1883
1883
|
return !1;
|
1884
1884
|
}
|
1885
1885
|
};
|
1886
|
-
const
|
1887
|
-
[
|
1888
|
-
[
|
1889
|
-
[
|
1890
|
-
[
|
1886
|
+
const W = /* @__PURE__ */ yo(Pa), Un = /* @__PURE__ */ new Map([
|
1887
|
+
[M.Universal, 50],
|
1888
|
+
[M.Tag, 30],
|
1889
|
+
[M.Attribute, 1],
|
1890
|
+
[M.Pseudo, 0]
|
1891
1891
|
]);
|
1892
1892
|
function Zi(e) {
|
1893
1893
|
return !Un.has(e.type);
|
@@ -1914,7 +1914,7 @@ function Mo(e) {
|
|
1914
1914
|
function Fn(e) {
|
1915
1915
|
var t, a;
|
1916
1916
|
let i = (t = Un.get(e.type)) !== null && t !== void 0 ? t : -1;
|
1917
|
-
return e.type ===
|
1917
|
+
return e.type === M.Attribute ? (i = (a = Ro.get(e.action)) !== null && a !== void 0 ? a : 4, e.action === he.Equals && e.name === "id" && (i = 9), e.ignoreCase && (i >>= 1)) : e.type === M.Pseudo && (e.data ? e.name === "has" || e.name === "contains" ? i = 0 : Array.isArray(e.data) ? (i = Math.min(...e.data.map((s) => Math.min(...s.map(Fn)))), i < 0 && (i = 0)) : i = 2 : i = 3), i;
|
1918
1918
|
}
|
1919
1919
|
const Po = /[-[\]{}()*+?.,\\^$|#\s]/g;
|
1920
1920
|
function Ss(e) {
|
@@ -1995,7 +1995,7 @@ const wo = {
|
|
1995
1995
|
element(e, t, a) {
|
1996
1996
|
const { adapter: i } = a, { name: s, value: u } = t;
|
1997
1997
|
if (/\s/.test(u))
|
1998
|
-
return
|
1998
|
+
return W.falseFunc;
|
1999
1999
|
const r = new RegExp(`(?:^|\\s)${Ss(u)}(?:$|\\s)`, pt(t, a) ? "i" : "");
|
2000
2000
|
return function(c) {
|
2001
2001
|
const d = i.getAttributeValue(c, s);
|
@@ -2009,7 +2009,7 @@ const wo = {
|
|
2009
2009
|
const { adapter: i } = a, { name: s } = t;
|
2010
2010
|
let { value: u } = t;
|
2011
2011
|
const r = u.length;
|
2012
|
-
return r === 0 ?
|
2012
|
+
return r === 0 ? W.falseFunc : pt(t, a) ? (u = u.toLowerCase(), (o) => {
|
2013
2013
|
const c = i.getAttributeValue(o, s);
|
2014
2014
|
return c != null && c.length >= r && c.substr(0, r).toLowerCase() === u && e(o);
|
2015
2015
|
}) : (o) => {
|
@@ -2021,7 +2021,7 @@ const wo = {
|
|
2021
2021
|
const { adapter: i } = a, { name: s } = t;
|
2022
2022
|
let { value: u } = t;
|
2023
2023
|
const r = -u.length;
|
2024
|
-
return r === 0 ?
|
2024
|
+
return r === 0 ? W.falseFunc : pt(t, a) ? (u = u.toLowerCase(), (o) => {
|
2025
2025
|
var c;
|
2026
2026
|
return ((c = i.getAttributeValue(o, s)) === null || c === void 0 ? void 0 : c.substr(r).toLowerCase()) === u && e(o);
|
2027
2027
|
}) : (o) => {
|
@@ -2032,7 +2032,7 @@ const wo = {
|
|
2032
2032
|
any(e, t, a) {
|
2033
2033
|
const { adapter: i } = a, { name: s, value: u } = t;
|
2034
2034
|
if (u === "")
|
2035
|
-
return
|
2035
|
+
return W.falseFunc;
|
2036
2036
|
if (pt(t, a)) {
|
2037
2037
|
const r = new RegExp(Ss(u), "i");
|
2038
2038
|
return function(c) {
|
@@ -2081,13 +2081,13 @@ function Fo(e) {
|
|
2081
2081
|
function Ho(e) {
|
2082
2082
|
const t = e[0], a = e[1] - 1;
|
2083
2083
|
if (a < 0 && t <= 0)
|
2084
|
-
return
|
2084
|
+
return W.falseFunc;
|
2085
2085
|
if (t === -1)
|
2086
2086
|
return (u) => u <= a;
|
2087
2087
|
if (t === 0)
|
2088
2088
|
return (u) => u === a;
|
2089
2089
|
if (t === 1)
|
2090
|
-
return a < 0 ?
|
2090
|
+
return a < 0 ? W.trueFunc : (u) => u >= a;
|
2091
2091
|
const i = Math.abs(t), s = (a % i + i) % i;
|
2092
2092
|
return t > 1 ? (u) => u >= a && u % i === s : (u) => u <= a && u % i === s;
|
2093
2093
|
}
|
@@ -2115,7 +2115,7 @@ const Ni = {
|
|
2115
2115
|
// Location specific methods
|
2116
2116
|
"nth-child"(e, t, { adapter: a, equals: i }) {
|
2117
2117
|
const s = Aa(t);
|
2118
|
-
return s ===
|
2118
|
+
return s === W.falseFunc ? W.falseFunc : s === W.trueFunc ? Na(e, a) : function(r) {
|
2119
2119
|
const o = a.getSiblings(r);
|
2120
2120
|
let c = 0;
|
2121
2121
|
for (let d = 0; d < o.length && !i(r, o[d]); d++)
|
@@ -2125,7 +2125,7 @@ const Ni = {
|
|
2125
2125
|
},
|
2126
2126
|
"nth-last-child"(e, t, { adapter: a, equals: i }) {
|
2127
2127
|
const s = Aa(t);
|
2128
|
-
return s ===
|
2128
|
+
return s === W.falseFunc ? W.falseFunc : s === W.trueFunc ? Na(e, a) : function(r) {
|
2129
2129
|
const o = a.getSiblings(r);
|
2130
2130
|
let c = 0;
|
2131
2131
|
for (let d = o.length - 1; d >= 0 && !i(r, o[d]); d--)
|
@@ -2135,7 +2135,7 @@ const Ni = {
|
|
2135
2135
|
},
|
2136
2136
|
"nth-of-type"(e, t, { adapter: a, equals: i }) {
|
2137
2137
|
const s = Aa(t);
|
2138
|
-
return s ===
|
2138
|
+
return s === W.falseFunc ? W.falseFunc : s === W.trueFunc ? Na(e, a) : function(r) {
|
2139
2139
|
const o = a.getSiblings(r);
|
2140
2140
|
let c = 0;
|
2141
2141
|
for (let d = 0; d < o.length; d++) {
|
@@ -2149,7 +2149,7 @@ const Ni = {
|
|
2149
2149
|
},
|
2150
2150
|
"nth-last-of-type"(e, t, { adapter: a, equals: i }) {
|
2151
2151
|
const s = Aa(t);
|
2152
|
-
return s ===
|
2152
|
+
return s === W.falseFunc ? W.falseFunc : s === W.trueFunc ? Na(e, a) : function(r) {
|
2153
2153
|
const o = a.getSiblings(r);
|
2154
2154
|
let c = 0;
|
2155
2155
|
for (let d = o.length - 1; d >= 0; d--) {
|
@@ -2179,7 +2179,7 @@ const Ni = {
|
|
2179
2179
|
function ui(e) {
|
2180
2180
|
return function(a, i, { adapter: s }) {
|
2181
2181
|
const u = s[e];
|
2182
|
-
return typeof u != "function" ?
|
2182
|
+
return typeof u != "function" ? W.falseFunc : function(o) {
|
2183
2183
|
return u(o) && a(o);
|
2184
2184
|
};
|
2185
2185
|
};
|
@@ -2276,7 +2276,7 @@ const Yo = {
|
|
2276
2276
|
text: "input:is(:not([type!='']), [type=text])"
|
2277
2277
|
}, Hn = {};
|
2278
2278
|
function qo(e, t) {
|
2279
|
-
return e ===
|
2279
|
+
return e === W.falseFunc ? W.falseFunc : (a) => t.isTag(a) && e(a);
|
2280
2280
|
}
|
2281
2281
|
function Yn(e, t) {
|
2282
2282
|
const a = t.getSiblings(e);
|
@@ -2299,7 +2299,7 @@ function Ci(e) {
|
|
2299
2299
|
}
|
2300
2300
|
const ri = (e, t, a, i, s) => {
|
2301
2301
|
const u = s(t, Ci(a), i);
|
2302
|
-
return u ===
|
2302
|
+
return u === W.trueFunc ? e : u === W.falseFunc ? W.falseFunc : (r) => u(r) && e(r);
|
2303
2303
|
}, oi = {
|
2304
2304
|
is: ri,
|
2305
2305
|
/**
|
@@ -2309,7 +2309,7 @@ const ri = (e, t, a, i, s) => {
|
|
2309
2309
|
where: ri,
|
2310
2310
|
not(e, t, a, i, s) {
|
2311
2311
|
const u = s(t, Ci(a), i);
|
2312
|
-
return u ===
|
2312
|
+
return u === W.falseFunc ? e : u === W.trueFunc ? W.falseFunc : (r) => !u(r) && e(r);
|
2313
2313
|
},
|
2314
2314
|
has(e, t, a, i, s) {
|
2315
2315
|
const { adapter: u } = a, r = Ci(a);
|
@@ -2318,10 +2318,10 @@ const ri = (e, t, a, i, s) => {
|
|
2318
2318
|
// Used as a placeholder. Will be replaced with the actual element.
|
2319
2319
|
[Hn]
|
2320
2320
|
) : void 0, c = s(t, r, o);
|
2321
|
-
if (c ===
|
2322
|
-
return
|
2321
|
+
if (c === W.falseFunc)
|
2322
|
+
return W.falseFunc;
|
2323
2323
|
const d = qo(c, u);
|
2324
|
-
if (o && c !==
|
2324
|
+
if (o && c !== W.trueFunc) {
|
2325
2325
|
const { shouldTestNextSiblings: f = !1 } = c;
|
2326
2326
|
return (E) => {
|
2327
2327
|
if (!e(E))
|
@@ -2366,18 +2366,18 @@ function ci(e, t) {
|
|
2366
2366
|
function $o(e, t, a, i, s) {
|
2367
2367
|
const { adapter: u, equals: r } = a;
|
2368
2368
|
switch (t.type) {
|
2369
|
-
case
|
2369
|
+
case M.PseudoElement:
|
2370
2370
|
throw new Error("Pseudo-elements are not supported by css-select");
|
2371
|
-
case
|
2371
|
+
case M.ColumnCombinator:
|
2372
2372
|
throw new Error("Column combinators are not yet supported by css-select");
|
2373
|
-
case
|
2373
|
+
case M.Attribute: {
|
2374
2374
|
if (t.namespace != null)
|
2375
2375
|
throw new Error("Namespaced attributes are not yet supported by css-select");
|
2376
2376
|
return (!a.xmlMode || a.lowerCaseAttributeNames) && (t.name = t.name.toLowerCase()), wo[t.action](e, t, a);
|
2377
2377
|
}
|
2378
|
-
case
|
2378
|
+
case M.Pseudo:
|
2379
2379
|
return Vo(e, t, a, i, s);
|
2380
|
-
case
|
2380
|
+
case M.Tag: {
|
2381
2381
|
if (t.namespace != null)
|
2382
2382
|
throw new Error("Namespaced tag names are not yet supported by css-select");
|
2383
2383
|
let { name: o } = t;
|
@@ -2385,7 +2385,7 @@ function $o(e, t, a, i, s) {
|
|
2385
2385
|
return u.getName(d) === o && e(d);
|
2386
2386
|
};
|
2387
2387
|
}
|
2388
|
-
case
|
2388
|
+
case M.Descendant: {
|
2389
2389
|
if (a.cacheResults === !1 || typeof WeakSet > "u")
|
2390
2390
|
return function(d) {
|
2391
2391
|
let f = d;
|
@@ -2415,16 +2415,16 @@ function $o(e, t, a, i, s) {
|
|
2415
2415
|
while (d = ci(d, u));
|
2416
2416
|
return !1;
|
2417
2417
|
};
|
2418
|
-
case
|
2418
|
+
case M.Parent:
|
2419
2419
|
return function(c) {
|
2420
2420
|
return u.getChildren(c).some((d) => u.isTag(d) && e(d));
|
2421
2421
|
};
|
2422
|
-
case
|
2422
|
+
case M.Child:
|
2423
2423
|
return function(c) {
|
2424
2424
|
const d = u.getParent(c);
|
2425
2425
|
return d != null && u.isTag(d) && e(d);
|
2426
2426
|
};
|
2427
|
-
case
|
2427
|
+
case M.Sibling:
|
2428
2428
|
return function(c) {
|
2429
2429
|
const d = u.getSiblings(c);
|
2430
2430
|
for (let f = 0; f < d.length; f++) {
|
@@ -2436,7 +2436,7 @@ function $o(e, t, a, i, s) {
|
|
2436
2436
|
}
|
2437
2437
|
return !1;
|
2438
2438
|
};
|
2439
|
-
case
|
2439
|
+
case M.Adjacent:
|
2440
2440
|
return u.prevElementSibling ? function(c) {
|
2441
2441
|
const d = u.prevElementSibling(c);
|
2442
2442
|
return d != null && e(d);
|
@@ -2451,7 +2451,7 @@ function $o(e, t, a, i, s) {
|
|
2451
2451
|
}
|
2452
2452
|
return !!f && e(f);
|
2453
2453
|
};
|
2454
|
-
case
|
2454
|
+
case M.Universal: {
|
2455
2455
|
if (t.namespace != null && t.namespace !== "*")
|
2456
2456
|
throw new Error("Namespaced universal selectors are not yet supported by css-select");
|
2457
2457
|
return e;
|
@@ -2459,12 +2459,12 @@ function $o(e, t, a, i, s) {
|
|
2459
2459
|
}
|
2460
2460
|
}
|
2461
2461
|
function qn(e) {
|
2462
|
-
return e.type ===
|
2462
|
+
return e.type === M.Pseudo && (e.name === "scope" || Array.isArray(e.data) && e.data.some((t) => t.some(qn)));
|
2463
2463
|
}
|
2464
|
-
const Wo = { type:
|
2464
|
+
const Wo = { type: M.Descendant }, Go = {
|
2465
2465
|
type: "_flexibleDescendant"
|
2466
2466
|
}, Xo = {
|
2467
|
-
type:
|
2467
|
+
type: M.Pseudo,
|
2468
2468
|
name: "scope",
|
2469
2469
|
data: null
|
2470
2470
|
};
|
@@ -2474,7 +2474,7 @@ function Qo(e, { adapter: t }, a) {
|
|
2474
2474
|
return s === Hn || u && t.isTag(u);
|
2475
2475
|
}));
|
2476
2476
|
for (const s of e) {
|
2477
|
-
if (!(s.length > 0 && Zi(s[0]) && s[0].type !==
|
2477
|
+
if (!(s.length > 0 && Zi(s[0]) && s[0].type !== M.Descendant)) if (i && !s.some(qn))
|
2478
2478
|
s.unshift(Wo);
|
2479
2479
|
else
|
2480
2480
|
continue;
|
@@ -2493,18 +2493,18 @@ function Vn(e, t, a) {
|
|
2493
2493
|
const o = e.map((c) => {
|
2494
2494
|
if (c.length >= 2) {
|
2495
2495
|
const [d, f] = c;
|
2496
|
-
d.type !==
|
2496
|
+
d.type !== M.Pseudo || d.name !== "scope" || (s && f.type === M.Descendant ? c[1] = Go : (f.type === M.Adjacent || f.type === M.Sibling) && (r = !0));
|
2497
2497
|
}
|
2498
2498
|
return jo(c, t, u);
|
2499
|
-
}).reduce(zo,
|
2499
|
+
}).reduce(zo, W.falseFunc);
|
2500
2500
|
return o.shouldTestNextSiblings = r, o;
|
2501
2501
|
}
|
2502
2502
|
function jo(e, t, a) {
|
2503
2503
|
var i;
|
2504
|
-
return e.reduce((s, u) => s ===
|
2504
|
+
return e.reduce((s, u) => s === W.falseFunc ? W.falseFunc : $o(s, u, t, a, Vn), (i = t.rootFunc) !== null && i !== void 0 ? i : W.trueFunc);
|
2505
2505
|
}
|
2506
2506
|
function zo(e, t) {
|
2507
|
-
return t ===
|
2507
|
+
return t === W.falseFunc || e === W.trueFunc ? e : e === W.falseFunc || t === W.trueFunc ? t : function(i) {
|
2508
2508
|
return e(i) || t(i);
|
2509
2509
|
};
|
2510
2510
|
}
|
@@ -2581,10 +2581,10 @@ function es(e) {
|
|
2581
2581
|
return [a, t];
|
2582
2582
|
}
|
2583
2583
|
const sc = {
|
2584
|
-
type:
|
2584
|
+
type: M.Universal,
|
2585
2585
|
namespace: null
|
2586
2586
|
}, nc = {
|
2587
|
-
type:
|
2587
|
+
type: M.Pseudo,
|
2588
2588
|
name: "scope",
|
2589
2589
|
data: null
|
2590
2590
|
};
|
@@ -2636,7 +2636,7 @@ function jn(e, t, a) {
|
|
2636
2636
|
}
|
2637
2637
|
for (let r = 0; r < s.length && (u == null ? void 0 : u.size) !== t.length; r++) {
|
2638
2638
|
const o = s[r];
|
2639
|
-
if ((u ? t.filter((f) =>
|
2639
|
+
if ((u ? t.filter((f) => B(f) && !u.has(f)) : t).length === 0)
|
2640
2640
|
break;
|
2641
2641
|
const d = zn(o, t, a);
|
2642
2642
|
if (d.length)
|
@@ -2671,15 +2671,15 @@ function wa(e, t, a, i, s) {
|
|
2671
2671
|
const u = t.findIndex(ka), r = t.slice(0, u), o = t[u], c = t.length - 1 === u ? s : 1 / 0, d = ac(o.name, o.data, c);
|
2672
2672
|
if (d === 0)
|
2673
2673
|
return [];
|
2674
|
-
const E = (r.length === 0 && !Array.isArray(e) ? Wa(e).filter(
|
2674
|
+
const E = (r.length === 0 && !Array.isArray(e) ? Wa(e).filter(B) : r.length === 0 ? (Array.isArray(e) ? e : [e]).filter(B) : i || r.some(ea) ? Ii(e, [r], a, d) : Si(e, [r], a)).slice(0, d);
|
2675
2675
|
let T = uc(o.name, E, o.data, a);
|
2676
2676
|
if (T.length === 0 || t.length === u + 1)
|
2677
2677
|
return T;
|
2678
2678
|
const g = t.slice(u + 1), C = g.some(ea);
|
2679
2679
|
if (C) {
|
2680
2680
|
if (ea(g[0])) {
|
2681
|
-
const { type:
|
2682
|
-
(
|
2681
|
+
const { type: L } = g[0];
|
2682
|
+
(L === M.Sibling || L === M.Adjacent) && (T = Wn(T, Xa, !0)), g.unshift(sc);
|
2683
2683
|
}
|
2684
2684
|
a = {
|
2685
2685
|
...a,
|
@@ -2689,7 +2689,7 @@ function wa(e, t, a, i, s) {
|
|
2689
2689
|
* Add a custom root func, to make sure traversals don't match elements
|
2690
2690
|
* that aren't a part of the considered tree.
|
2691
2691
|
*/
|
2692
|
-
rootFunc: (
|
2692
|
+
rootFunc: (L) => T.includes(L)
|
2693
2693
|
};
|
2694
2694
|
} else a.rootFunc && a.rootFunc !== Pa.trueFunc && (a = { ...a, rootFunc: Pa.trueFunc });
|
2695
2695
|
return g.some(ka) ? wa(T, g, a, !1, s) : C ? (
|
@@ -2706,10 +2706,10 @@ function Ii(e, t, a, i) {
|
|
2706
2706
|
}
|
2707
2707
|
function Kn(e, t, a = 1 / 0) {
|
2708
2708
|
const i = Wn(e, Xa, t.shouldTestNextSiblings);
|
2709
|
-
return ji((s) =>
|
2709
|
+
return ji((s) => B(s) && t(s), i, !0, a);
|
2710
2710
|
}
|
2711
2711
|
function Si(e, t, a) {
|
2712
|
-
const i = (Array.isArray(e) ? e : [e]).filter(
|
2712
|
+
const i = (Array.isArray(e) ? e : [e]).filter(B);
|
2713
2713
|
if (i.length === 0)
|
2714
2714
|
return i;
|
2715
2715
|
const s = Ji(t, a);
|
@@ -2720,7 +2720,7 @@ function cc(e) {
|
|
2720
2720
|
if (!e)
|
2721
2721
|
return this._make([]);
|
2722
2722
|
if (typeof e != "string") {
|
2723
|
-
const t =
|
2723
|
+
const t = tt(e) ? e.toArray() : [e], a = this.toArray();
|
2724
2724
|
return this._make(t.filter((i) => a.some((s) => yn(s, i))));
|
2725
2725
|
}
|
2726
2726
|
return this._findBySelector(e, Number.POSITIVE_INFINITY);
|
@@ -2800,7 +2800,7 @@ function mc(e) {
|
|
2800
2800
|
root: (t = this._root) === null || t === void 0 ? void 0 : t[0]
|
2801
2801
|
}, s = typeof e == "string" ? (u) => Gn(u, e, i) : Ta(e);
|
2802
2802
|
return re(this, (u) => {
|
2803
|
-
for (u && !dt(u) && !
|
2803
|
+
for (u && !dt(u) && !B(u) && (u = u.parent); u && B(u); ) {
|
2804
2804
|
if (s(u, 0)) {
|
2805
2805
|
a.includes(u) || a.push(u);
|
2806
2806
|
break;
|
@@ -2812,14 +2812,14 @@ function mc(e) {
|
|
2812
2812
|
const Ec = as((e) => Xi(e)), Tc = Ea((e) => {
|
2813
2813
|
const t = [];
|
2814
2814
|
for (; e.next; )
|
2815
|
-
e = e.next,
|
2815
|
+
e = e.next, B(e) && t.push(e);
|
2816
2816
|
return t;
|
2817
2817
|
}, Yt), pc = is((e) => Xi(e), Yt), bc = as((e) => Qi(e)), gc = Ea((e) => {
|
2818
2818
|
const t = [];
|
2819
2819
|
for (; e.prev; )
|
2820
|
-
e = e.prev,
|
2820
|
+
e = e.prev, B(e) && t.push(e);
|
2821
2821
|
return t;
|
2822
|
-
}, Yt), _c = is((e) => Qi(e), Yt), Ac = Ea((e) => In(e).filter((t) =>
|
2822
|
+
}, Yt), _c = is((e) => Qi(e), Yt), Ac = Ea((e) => In(e).filter((t) => B(t) && t !== e), Ht), Nc = Ea((e) => Wa(e).filter(B), Yt);
|
2823
2823
|
function Cc() {
|
2824
2824
|
const e = this.toArray().reduce((t, a) => Te(a) ? t.concat(a.children) : t, []);
|
2825
2825
|
return this._make(e);
|
@@ -2840,7 +2840,7 @@ function Sc(e) {
|
|
2840
2840
|
return this._make(t);
|
2841
2841
|
}
|
2842
2842
|
function Ta(e) {
|
2843
|
-
return typeof e == "function" ? (t, a) => e.call(t, a, t) :
|
2843
|
+
return typeof e == "function" ? (t, a) => e.call(t, a, t) : tt(e) ? (t) => Array.prototype.includes.call(e, t) : function(t) {
|
2844
2844
|
return e === t;
|
2845
2845
|
};
|
2846
2846
|
}
|
@@ -2853,7 +2853,7 @@ function ss(e, t, a, i) {
|
|
2853
2853
|
}
|
2854
2854
|
function Oc(e) {
|
2855
2855
|
const t = this.toArray();
|
2856
|
-
return typeof e == "string" ? Xn(t.filter(
|
2856
|
+
return typeof e == "string" ? Xn(t.filter(B), e, this.options) : e ? t.some(Ta(e)) : !1;
|
2857
2857
|
}
|
2858
2858
|
function Dc(e) {
|
2859
2859
|
let t = this.toArray();
|
@@ -2890,7 +2890,7 @@ function Pc() {
|
|
2890
2890
|
}
|
2891
2891
|
function kc(e) {
|
2892
2892
|
let t, a;
|
2893
|
-
return e == null ? (t = this.parent().children(), a = this[0]) : typeof e == "string" ? (t = this._make(e), a = this[0]) : (t = this, a =
|
2893
|
+
return e == null ? (t = this.parent().children(), a = this[0]) : typeof e == "string" ? (t = this._make(e), a = this[0]) : (t = this, a = tt(e) ? e[0] : e), Array.prototype.indexOf.call(t, a);
|
2894
2894
|
}
|
2895
2895
|
function wc(e, t) {
|
2896
2896
|
return this._make(Array.prototype.slice.call(this, e, t));
|
@@ -3015,10 +3015,10 @@ function ht(e, t, a, i, s) {
|
|
3015
3015
|
return c && (c.next = i[0]), d && (d.prev = i[i.length - 1]), e.splice(...o);
|
3016
3016
|
}
|
3017
3017
|
function Vc(e) {
|
3018
|
-
return (
|
3018
|
+
return (tt(e) ? e : this._make(e)).append(this), this;
|
3019
3019
|
}
|
3020
3020
|
function $c(e) {
|
3021
|
-
return (
|
3021
|
+
return (tt(e) ? e : this._make(e)).prepend(this), this;
|
3022
3022
|
}
|
3023
3023
|
const Wc = Zn((e, t, a) => {
|
3024
3024
|
ht(t, t.length, 0, e, a);
|
@@ -3035,7 +3035,7 @@ function Jn(e) {
|
|
3035
3035
|
let c = o, d = 0;
|
3036
3036
|
for (; d < c.children.length; ) {
|
3037
3037
|
const f = c.children[d];
|
3038
|
-
|
3038
|
+
B(f) ? (c = f, d = 0) : d++;
|
3039
3039
|
}
|
3040
3040
|
e(u, c, [o]);
|
3041
3041
|
}
|
@@ -3156,7 +3156,7 @@ function sl(e) {
|
|
3156
3156
|
return;
|
3157
3157
|
for (const i of t.children)
|
3158
3158
|
i.next = i.prev = i.parent = null;
|
3159
|
-
const a =
|
3159
|
+
const a = tt(e) ? e.toArray() : this._parse(`${e}`, this.options, !1, t).children;
|
3160
3160
|
St(a, t);
|
3161
3161
|
});
|
3162
3162
|
}
|
@@ -3206,7 +3206,7 @@ function cl(e, t) {
|
|
3206
3206
|
if (e != null && t != null || // When `prop` is a "plain" object
|
3207
3207
|
typeof e == "object" && !Array.isArray(e))
|
3208
3208
|
return re(this, (a, i) => {
|
3209
|
-
|
3209
|
+
B(a) && eu(a, e, t, i);
|
3210
3210
|
});
|
3211
3211
|
if (this.length !== 0)
|
3212
3212
|
return tu(this[0], e);
|
@@ -3224,7 +3224,7 @@ function eu(e, t, a, i) {
|
|
3224
3224
|
}
|
3225
3225
|
}
|
3226
3226
|
function tu(e, t) {
|
3227
|
-
if (!e || !
|
3227
|
+
if (!e || !B(e))
|
3228
3228
|
return;
|
3229
3229
|
const a = dl(e.attribs.style);
|
3230
3230
|
if (typeof t == "string")
|
@@ -3265,7 +3265,7 @@ function ml() {
|
|
3265
3265
|
function El() {
|
3266
3266
|
return this.map((e, t) => {
|
3267
3267
|
const a = this._make(t);
|
3268
|
-
return
|
3268
|
+
return B(t) && t.name === "form" ? a.find(vs).toArray() : a.filter(vs).toArray();
|
3269
3269
|
}).filter(
|
3270
3270
|
// Verify elements have a name (`attr.name`) and are not disabled (`:enabled`)
|
3271
3271
|
'[name!=""]:enabled:not(:submit, :button, :image, :reset, :file):matches([checked], :not(:checkbox, :radio))'
|
@@ -3352,12 +3352,12 @@ function _l(e, t) {
|
|
3352
3352
|
}
|
3353
3353
|
}
|
3354
3354
|
function d(f, E, T = o, g) {
|
3355
|
-
if (f &&
|
3355
|
+
if (f && tt(f))
|
3356
3356
|
return f;
|
3357
|
-
const C = gi(g, r),
|
3357
|
+
const C = gi(g, r), L = typeof T == "string" ? [e(T, C, !1, null)] : "length" in T ? T : [T], y = tt(L) ? L : new c(L, null, C);
|
3358
3358
|
if (y._root = y, !f)
|
3359
3359
|
return new c(void 0, y, C);
|
3360
|
-
const
|
3360
|
+
const V = typeof f == "string" && _i(f) ? (
|
3361
3361
|
// $(<html>)
|
3362
3362
|
e(f, C, !1, null).children
|
3363
3363
|
) : Al(f) ? (
|
@@ -3366,12 +3366,12 @@ function _l(e, t) {
|
|
3366
3366
|
) : Array.isArray(f) ? (
|
3367
3367
|
// $([dom])
|
3368
3368
|
f
|
3369
|
-
) : void 0,
|
3370
|
-
if (
|
3371
|
-
return
|
3369
|
+
) : void 0, F = new c(V, y, C);
|
3370
|
+
if (V)
|
3371
|
+
return F;
|
3372
3372
|
if (typeof f != "string")
|
3373
3373
|
throw new TypeError("Unexpected type of selector");
|
3374
|
-
let
|
3374
|
+
let Y = f;
|
3375
3375
|
const ee = E ? (
|
3376
3376
|
// If we don't have a context, maybe we have a root, from loading
|
3377
3377
|
typeof E == "string" ? _i(E) ? (
|
@@ -3379,8 +3379,8 @@ function _l(e, t) {
|
|
3379
3379
|
new c([e(E, C, !1, null)], y, C)
|
3380
3380
|
) : (
|
3381
3381
|
// $('li', 'ul')
|
3382
|
-
(
|
3383
|
-
) :
|
3382
|
+
(Y = `${E} ${Y}`, y)
|
3383
|
+
) : tt(E) ? (
|
3384
3384
|
// $('li', $)
|
3385
3385
|
E
|
3386
3386
|
) : (
|
@@ -3388,7 +3388,7 @@ function _l(e, t) {
|
|
3388
3388
|
new c(Array.isArray(E) ? E : [E], y, C)
|
3389
3389
|
)
|
3390
3390
|
) : y;
|
3391
|
-
return ee ? ee.find(
|
3391
|
+
return ee ? ee.find(Y) : F;
|
3392
3392
|
}
|
3393
3393
|
return Object.assign(d, fo, {
|
3394
3394
|
load: a,
|
@@ -3836,11 +3836,11 @@ function Kt(e) {
|
|
3836
3836
|
function Rl(e) {
|
3837
3837
|
return e >= l.LATIN_SMALL_A && e <= l.LATIN_SMALL_Z;
|
3838
3838
|
}
|
3839
|
-
function
|
3839
|
+
function st(e) {
|
3840
3840
|
return Rl(e) || Kt(e);
|
3841
3841
|
}
|
3842
3842
|
function ys(e) {
|
3843
|
-
return
|
3843
|
+
return st(e) || yl(e);
|
3844
3844
|
}
|
3845
3845
|
function Ca(e) {
|
3846
3846
|
return e + 32;
|
@@ -4477,7 +4477,7 @@ let Pl = class {
|
|
4477
4477
|
// Tag open state
|
4478
4478
|
//------------------------------------------------------------------
|
4479
4479
|
_stateTagOpen(t) {
|
4480
|
-
if (
|
4480
|
+
if (st(t))
|
4481
4481
|
this._createStartTagToken(), this.state = h.TAG_NAME, this._stateTagName(t);
|
4482
4482
|
else
|
4483
4483
|
switch (t) {
|
@@ -4504,7 +4504,7 @@ let Pl = class {
|
|
4504
4504
|
// End tag open state
|
4505
4505
|
//------------------------------------------------------------------
|
4506
4506
|
_stateEndTagOpen(t) {
|
4507
|
-
if (
|
4507
|
+
if (st(t))
|
4508
4508
|
this._createEndTagToken(), this.state = h.TAG_NAME, this._stateTagName(t);
|
4509
4509
|
else
|
4510
4510
|
switch (t) {
|
@@ -4560,7 +4560,7 @@ let Pl = class {
|
|
4560
4560
|
// RCDATA end tag open state
|
4561
4561
|
//------------------------------------------------------------------
|
4562
4562
|
_stateRcdataEndTagOpen(t) {
|
4563
|
-
|
4563
|
+
st(t) ? (this.state = h.RCDATA_END_TAG_NAME, this._stateRcdataEndTagName(t)) : (this._emitChars("</"), this.state = h.RCDATA, this._stateRcdata(t));
|
4564
4564
|
}
|
4565
4565
|
handleSpecialEndTag(t) {
|
4566
4566
|
if (!this.preprocessor.startsWith(this.lastStartTagName, !1))
|
@@ -4594,7 +4594,7 @@ let Pl = class {
|
|
4594
4594
|
// RAWTEXT end tag open state
|
4595
4595
|
//------------------------------------------------------------------
|
4596
4596
|
_stateRawtextEndTagOpen(t) {
|
4597
|
-
|
4597
|
+
st(t) ? (this.state = h.RAWTEXT_END_TAG_NAME, this._stateRawtextEndTagName(t)) : (this._emitChars("</"), this.state = h.RAWTEXT, this._stateRawtext(t));
|
4598
4598
|
}
|
4599
4599
|
// RAWTEXT end tag name state
|
4600
4600
|
//------------------------------------------------------------------
|
@@ -4620,7 +4620,7 @@ let Pl = class {
|
|
4620
4620
|
// Script data end tag open state
|
4621
4621
|
//------------------------------------------------------------------
|
4622
4622
|
_stateScriptDataEndTagOpen(t) {
|
4623
|
-
|
4623
|
+
st(t) ? (this.state = h.SCRIPT_DATA_END_TAG_NAME, this._stateScriptDataEndTagName(t)) : (this._emitChars("</"), this.state = h.SCRIPT_DATA, this._stateScriptData(t));
|
4624
4624
|
}
|
4625
4625
|
// Script data end tag name state
|
4626
4626
|
//------------------------------------------------------------------
|
@@ -4716,12 +4716,12 @@ let Pl = class {
|
|
4716
4716
|
// Script data escaped less-than sign state
|
4717
4717
|
//------------------------------------------------------------------
|
4718
4718
|
_stateScriptDataEscapedLessThanSign(t) {
|
4719
|
-
t === l.SOLIDUS ? this.state = h.SCRIPT_DATA_ESCAPED_END_TAG_OPEN :
|
4719
|
+
t === l.SOLIDUS ? this.state = h.SCRIPT_DATA_ESCAPED_END_TAG_OPEN : st(t) ? (this._emitChars("<"), this.state = h.SCRIPT_DATA_DOUBLE_ESCAPE_START, this._stateScriptDataDoubleEscapeStart(t)) : (this._emitChars("<"), this.state = h.SCRIPT_DATA_ESCAPED, this._stateScriptDataEscaped(t));
|
4720
4720
|
}
|
4721
4721
|
// Script data escaped end tag open state
|
4722
4722
|
//------------------------------------------------------------------
|
4723
4723
|
_stateScriptDataEscapedEndTagOpen(t) {
|
4724
|
-
|
4724
|
+
st(t) ? (this.state = h.SCRIPT_DATA_ESCAPED_END_TAG_NAME, this._stateScriptDataEscapedEndTagName(t)) : (this._emitChars("</"), this.state = h.SCRIPT_DATA_ESCAPED, this._stateScriptDataEscaped(t));
|
4725
4725
|
}
|
4726
4726
|
// Script data escaped end tag name state
|
4727
4727
|
//------------------------------------------------------------------
|
@@ -8862,10 +8862,10 @@ function th(e, t, a) {
|
|
8862
8862
|
let i = "!DOCTYPE ";
|
8863
8863
|
return e && (i += e), t ? i += ` PUBLIC ${qs(t)}` : a && (i += " SYSTEM"), a && (i += ` ${qs(a)}`), i;
|
8864
8864
|
}
|
8865
|
-
const
|
8865
|
+
const nt = {
|
8866
8866
|
// Re-exports from domhandler
|
8867
8867
|
isCommentNode: Va,
|
8868
|
-
isElementNode:
|
8868
|
+
isElementNode: B,
|
8869
8869
|
isTextNode: Xe,
|
8870
8870
|
//Node construction
|
8871
8871
|
createDocument() {
|
@@ -8900,7 +8900,7 @@ const st = {
|
|
8900
8900
|
s && (s.next = t, t.prev = s), a.prev = t, t.next = a, e.children.splice(i, 0, t), t.parent = e;
|
8901
8901
|
},
|
8902
8902
|
setTemplateContent(e, t) {
|
8903
|
-
|
8903
|
+
nt.appendChild(e, t);
|
8904
8904
|
},
|
8905
8905
|
getTemplateContent(e) {
|
8906
8906
|
return e.children[0];
|
@@ -8908,7 +8908,7 @@ const st = {
|
|
8908
8908
|
setDocumentType(e, t, a, i) {
|
8909
8909
|
const s = th(t, a, i);
|
8910
8910
|
let u = e.children.find((r) => Ti(r) && r.name === "!doctype");
|
8911
|
-
u ? u.data = s ?? null : (u = new qi("!doctype", s),
|
8911
|
+
u ? u.data = s ?? null : (u = new qi("!doctype", s), nt.appendChild(e, u)), u["x-name"] = t, u["x-publicId"] = a, u["x-systemId"] = i;
|
8912
8912
|
},
|
8913
8913
|
setDocumentMode(e, t) {
|
8914
8914
|
e["x-mode"] = t;
|
@@ -8924,11 +8924,11 @@ const st = {
|
|
8924
8924
|
},
|
8925
8925
|
insertText(e, t) {
|
8926
8926
|
const a = e.children[e.children.length - 1];
|
8927
|
-
a && Xe(a) ? a.data += t :
|
8927
|
+
a && Xe(a) ? a.data += t : nt.appendChild(e, nt.createTextNode(t));
|
8928
8928
|
},
|
8929
8929
|
insertTextBefore(e, t, a) {
|
8930
8930
|
const i = e.children[e.children.indexOf(a) - 1];
|
8931
|
-
i && Xe(i) ? i.data += t :
|
8931
|
+
i && Xe(i) ? i.data += t : nt.insertBefore(e, nt.createTextNode(t), a);
|
8932
8932
|
},
|
8933
8933
|
adoptAttributes(e, t) {
|
8934
8934
|
for (let a = 0; a < t.length; a++) {
|
@@ -8994,9 +8994,9 @@ const st = {
|
|
8994
8994
|
};
|
8995
8995
|
function ah(e, t, a, i) {
|
8996
8996
|
var s;
|
8997
|
-
return (s = t.treeAdapter) !== null && s !== void 0 || (t.treeAdapter =
|
8997
|
+
return (s = t.treeAdapter) !== null && s !== void 0 || (t.treeAdapter = nt), t.scriptingEnabled !== !1 && (t.scriptingEnabled = !0), a ? Jd(e, t) : eh(i, e, t);
|
8998
8998
|
}
|
8999
|
-
const ih = { treeAdapter:
|
8999
|
+
const ih = { treeAdapter: nt };
|
9000
9000
|
function sh(e) {
|
9001
9001
|
const t = "length" in e ? e : [e];
|
9002
9002
|
for (let i = 0; i < t.length; i += 1) {
|
@@ -9769,11 +9769,11 @@ const fh = {
|
|
9769
9769
|
"addIcon"
|
9770
9770
|
],
|
9771
9771
|
setup(e, { emit: t }) {
|
9772
|
-
const a = e, i = t, s = At(() => a.selectedElement === a.element), u = At(() => a.hoveredElement === a.element), r =
|
9773
|
-
|
9772
|
+
const a = e, i = t, s = At(() => a.selectedElement === a.element), u = At(() => a.hoveredElement === a.element), r = $(!1), o = $(!1), c = $(""), d = At(() => a.element.rule.minText || 0), f = At(() => a.element.rule.maxText || 1 / 0);
|
9773
|
+
et(
|
9774
9774
|
() => a.r,
|
9775
9775
|
() => {
|
9776
|
-
i("contentUpdated",
|
9776
|
+
i("contentUpdated", V());
|
9777
9777
|
},
|
9778
9778
|
{ immediate: !0 }
|
9779
9779
|
);
|
@@ -9783,29 +9783,29 @@ const fh = {
|
|
9783
9783
|
function T(v) {
|
9784
9784
|
i("selectElement", v);
|
9785
9785
|
}
|
9786
|
-
function g(v,
|
9787
|
-
i("hoverElement", v,
|
9786
|
+
function g(v, G) {
|
9787
|
+
i("hoverElement", v, G);
|
9788
9788
|
}
|
9789
9789
|
function C(v) {
|
9790
9790
|
i("hoverElement", v);
|
9791
9791
|
}
|
9792
|
-
function
|
9792
|
+
function L(v) {
|
9793
9793
|
v.currentTarget.contains(v.relatedTarget) ? i("hoverElement", null) : a.hoveredElement ? i("hoverElement", null, a.hoveredElement.parentxpath) : i("hoverElement", null);
|
9794
9794
|
}
|
9795
9795
|
function y() {
|
9796
|
-
r.value = !1, i("contentUpdated",
|
9796
|
+
r.value = !1, i("contentUpdated", V());
|
9797
9797
|
}
|
9798
|
-
function
|
9798
|
+
function V() {
|
9799
9799
|
function v(ne) {
|
9800
9800
|
const _e = Object.entries(ne.attrs || {}).map(([Fe, Et]) => `${Fe}="${Et}"`).join(" "), Ie = `<${ne.tag}${_e ? " " + _e : ""}>`, Ke = `</${ne.tag}>`, mt = (ne.children || []).map((Fe) => v(Fe)).join("");
|
9801
9801
|
return `${Ie}${ne.editText || ne.text || ""}${mt}${Ke}`;
|
9802
9802
|
}
|
9803
9803
|
return v(a.element);
|
9804
9804
|
}
|
9805
|
-
function
|
9805
|
+
function F(v) {
|
9806
9806
|
var Ie;
|
9807
9807
|
v.stopPropagation();
|
9808
|
-
const
|
9808
|
+
const G = v.target, ne = ((Ie = G.firstChild) == null ? void 0 : Ie.nodeType) === Node.TEXT_NODE && G.firstChild.nodeValue || "";
|
9809
9809
|
if (ne.length < d.value) {
|
9810
9810
|
o.value = !0, c.value = `最少输入 ${d.value} 个字符`;
|
9811
9811
|
return;
|
@@ -9814,33 +9814,33 @@ const fh = {
|
|
9814
9814
|
return;
|
9815
9815
|
} else
|
9816
9816
|
o.value = !1, c.value = "";
|
9817
|
-
i("updateText", { element: a.element, newText: ne }), i("contentUpdated",
|
9817
|
+
i("updateText", { element: a.element, newText: ne }), i("contentUpdated", V());
|
9818
9818
|
const _e = hn(a.element);
|
9819
9819
|
_e.editText = ne;
|
9820
9820
|
}
|
9821
|
-
function
|
9822
|
-
i("updateText", v), i("contentUpdated",
|
9821
|
+
function Y(v) {
|
9822
|
+
i("updateText", v), i("contentUpdated", V());
|
9823
9823
|
}
|
9824
9824
|
function ee() {
|
9825
9825
|
const v = { ...a.element };
|
9826
9826
|
i("blockAction", { action: "add", element: a.element, newBlock: v });
|
9827
9827
|
}
|
9828
|
-
function
|
9828
|
+
function q() {
|
9829
9829
|
_(a.element), i("blockAction", { action: "moveUp", element: a.element });
|
9830
9830
|
}
|
9831
9831
|
function _(v) {
|
9832
|
-
v.children && v.children.length > 0 && v.children.forEach((
|
9833
|
-
|
9832
|
+
v.children && v.children.length > 0 && v.children.forEach((G) => {
|
9833
|
+
G.type == z.Text && (G.text !== G.editText && (G.text = G.editText), _(G));
|
9834
9834
|
});
|
9835
9835
|
}
|
9836
|
-
function
|
9836
|
+
function w() {
|
9837
9837
|
_(a.element), i("blockAction", { action: "moveDown", element: a.element });
|
9838
9838
|
}
|
9839
9839
|
function Q() {
|
9840
9840
|
i("blockAction", { action: "delete", element: a.element });
|
9841
9841
|
}
|
9842
9842
|
function se(v) {
|
9843
|
-
i("blockAction", v), i("contentUpdated",
|
9843
|
+
i("blockAction", v), i("contentUpdated", V());
|
9844
9844
|
}
|
9845
9845
|
function be(v) {
|
9846
9846
|
Re.value.openModal(v);
|
@@ -9848,14 +9848,14 @@ const fh = {
|
|
9848
9848
|
function Be(v) {
|
9849
9849
|
Ce.value.openModal(v);
|
9850
9850
|
}
|
9851
|
-
function Ue(v,
|
9852
|
-
i("addIcon", v,
|
9851
|
+
function Ue(v, G) {
|
9852
|
+
i("addIcon", v, G), i("contentUpdated", V());
|
9853
9853
|
}
|
9854
|
-
const Re =
|
9855
|
-
return (v,
|
9854
|
+
const Re = $(a.icon), Ce = $(a.upload);
|
9855
|
+
return (v, G) => {
|
9856
9856
|
const ne = Qu("ElementRenderer", !0);
|
9857
|
-
return
|
9858
|
-
(
|
9857
|
+
return D(), R(Zt, null, [
|
9858
|
+
(D(), Ct(ju(a.element.tag), zu({
|
9859
9859
|
class: [
|
9860
9860
|
"relative",
|
9861
9861
|
// 注意:这里使用了 relative 布局,可能会影响到样式
|
@@ -9872,16 +9872,16 @@ const fh = {
|
|
9872
9872
|
]
|
9873
9873
|
}, a.element.attrs, {
|
9874
9874
|
contenteditable: r.value,
|
9875
|
-
onClick:
|
9876
|
-
onMouseenter:
|
9877
|
-
onMouseleave:
|
9875
|
+
onClick: G[2] || (G[2] = Le(() => E(a.element), ["stop"])),
|
9876
|
+
onMouseenter: G[3] || (G[3] = () => C(a.element)),
|
9877
|
+
onMouseleave: L,
|
9878
9878
|
onBlur: y,
|
9879
|
-
onInput:
|
9879
|
+
onInput: F
|
9880
9880
|
}), {
|
9881
9881
|
default: Ya(() => [
|
9882
9882
|
Ei(Ne(a.element.text), 1),
|
9883
|
-
a.element.children && a.element.children.length ? (
|
9884
|
-
(
|
9883
|
+
a.element.children && a.element.children.length ? (D(), R(Zt, { key: 0 }, [
|
9884
|
+
(D(!0), R(Zt, null, Fi(a.element.children, (_e, Ie) => (D(), Ct(ne, {
|
9885
9885
|
key: Ie,
|
9886
9886
|
r: e.r,
|
9887
9887
|
mode: e.mode,
|
@@ -9895,15 +9895,15 @@ const fh = {
|
|
9895
9895
|
"upload-by-file": e.uploadByFile,
|
9896
9896
|
onSelectElement: T,
|
9897
9897
|
onHoverElement: g,
|
9898
|
-
onUpdateText:
|
9898
|
+
onUpdateText: Y,
|
9899
9899
|
onBlockAction: se,
|
9900
9900
|
onAddIcon: Ue
|
9901
9901
|
}, null, 8, ["r", "mode", "icons", "element", "selectedElement", "hoveredElement", "cropper", "icon", "upload", "upload-by-file"]))), 128)),
|
9902
|
-
a.element.type === de(z).Block ? (
|
9902
|
+
a.element.type === de(z).Block ? (D(), R("div", {
|
9903
9903
|
key: 0,
|
9904
9904
|
"date-action": "1",
|
9905
9905
|
contenteditable: "false",
|
9906
|
-
onClick:
|
9906
|
+
onClick: G[0] || (G[0] = Le(() => {
|
9907
9907
|
}, ["stop"])),
|
9908
9908
|
class: "z-10 flex space-x-1 flex-none flex-nowrap overflow-visible absolute top-2"
|
9909
9909
|
}, [
|
@@ -9913,40 +9913,40 @@ const fh = {
|
|
9913
9913
|
}, " + "),
|
9914
9914
|
x("button", {
|
9915
9915
|
class: "flex-none px-2 py-1 bg-gray-300 text-white rounded",
|
9916
|
-
onClick: Le(
|
9916
|
+
onClick: Le(q, ["stop"])
|
9917
9917
|
}, " ⬅️ "),
|
9918
9918
|
x("button", {
|
9919
9919
|
class: "flex-none px-2 py-1 bg-gray-300 text-white rounded",
|
9920
|
-
onClick: Le(
|
9920
|
+
onClick: Le(w, ["stop"])
|
9921
9921
|
}, " ➡️ "),
|
9922
9922
|
x("button", {
|
9923
9923
|
class: "flex-none px-2 py-1 bg-red-500 text-white rounded",
|
9924
9924
|
onClick: Le(Q, ["stop"])
|
9925
9925
|
}, " ✖ ")
|
9926
|
-
])) :
|
9927
|
-
], 64)) :
|
9928
|
-
a.element.type === de(z).Icon ? (
|
9926
|
+
])) : H("", !0)
|
9927
|
+
], 64)) : H("", !0),
|
9928
|
+
a.element.type === de(z).Icon ? (D(), R("div", {
|
9929
9929
|
key: 1,
|
9930
9930
|
class: "cursor-pointer rounded-sm w-5 h-5 flex justify-center items-center absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 text-sm text-gray-50 z-10 bg-black/80",
|
9931
9931
|
contenteditable: "false",
|
9932
|
-
onClick:
|
9933
|
-
}, " ↑ ")) :
|
9932
|
+
onClick: G[1] || (G[1] = Le(() => be(a.element), ["stop"]))
|
9933
|
+
}, " ↑ ")) : H("", !0)
|
9934
9934
|
]),
|
9935
9935
|
_: 1
|
9936
9936
|
}, 16, ["class", "contenteditable"])),
|
9937
|
-
a.element.type == de(z).Text && o.value ? (
|
9938
|
-
a.element.type === de(z).Image ? (
|
9937
|
+
a.element.type == de(z).Text && o.value ? (D(), R("div", fh, Ne(c.value), 1)) : H("", !0),
|
9938
|
+
a.element.type === de(z).Image ? (D(), R("div", {
|
9939
9939
|
key: 1,
|
9940
9940
|
class: "cursor-pointer rounded-sm flex justify-center items-center absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 text-sm text-gray-50 z-10 bg-black/80",
|
9941
|
-
onClick:
|
9941
|
+
onClick: G[5] || (G[5] = Le(() => {
|
9942
9942
|
}, ["stop"])),
|
9943
9943
|
contenteditable: "false"
|
9944
9944
|
}, [
|
9945
9945
|
x("div", {
|
9946
9946
|
class: "p-2",
|
9947
|
-
onClick:
|
9947
|
+
onClick: G[4] || (G[4] = Le(() => Be(a.element), ["stop"]))
|
9948
9948
|
}, "上传")
|
9949
|
-
])) :
|
9949
|
+
])) : H("", !0)
|
9950
9950
|
], 64);
|
9951
9951
|
};
|
9952
9952
|
}
|
@@ -9977,7 +9977,7 @@ const fh = {
|
|
9977
9977
|
}
|
9978
9978
|
}), ph = { class: "form-group" }, bh = { class: "flex items-center space-x-2 cursor-pointer" }, gh = ["checked", "aria-checked"], _h = { class: "checkbox-label text-sm text-gray-700" };
|
9979
9979
|
function Ah(e, t, a, i, s, u) {
|
9980
|
-
return
|
9980
|
+
return D(), R("div", ph, [
|
9981
9981
|
x("label", bh, [
|
9982
9982
|
x("input", {
|
9983
9983
|
type: "checkbox",
|
@@ -10019,7 +10019,7 @@ const Gt = /* @__PURE__ */ ft(Th, [["render", Ah], ["__scopeId", "data-v-68b8f27
|
|
10019
10019
|
}
|
10020
10020
|
},
|
10021
10021
|
setup(e) {
|
10022
|
-
const t =
|
10022
|
+
const t = $(!1), a = At(
|
10023
10023
|
() => ({
|
10024
10024
|
success: "bg-green-100 text-green-800",
|
10025
10025
|
error: "bg-red-100 text-red-800",
|
@@ -10057,27 +10057,27 @@ const Gt = /* @__PURE__ */ ft(Th, [["render", Ah], ["__scopeId", "data-v-68b8f27
|
|
10057
10057
|
class: "text-yellow-500"
|
10058
10058
|
};
|
10059
10059
|
function vh(e, t, a, i, s, u) {
|
10060
|
-
return
|
10060
|
+
return D(), Ct(Ku, { name: "fade" }, {
|
10061
10061
|
default: Ya(() => [
|
10062
|
-
e.visible ? (
|
10062
|
+
e.visible ? (D(), R("div", Ch, [
|
10063
10063
|
x("div", {
|
10064
10064
|
class: fn([e.typeClass, "message-content"])
|
10065
10065
|
}, [
|
10066
|
-
e.icon ? (
|
10066
|
+
e.icon ? (D(), R("span", Ih, [
|
10067
10067
|
Jt(e.$slots, "icon", {}, () => [
|
10068
|
-
e.type === "success" ? (
|
10069
|
-
e.type === "error" ? (
|
10070
|
-
e.type === "info" ? (
|
10071
|
-
e.type === "warning" ? (
|
10068
|
+
e.type === "success" ? (D(), R("span", Sh, "✔")) : H("", !0),
|
10069
|
+
e.type === "error" ? (D(), R("span", xh, "✖")) : H("", !0),
|
10070
|
+
e.type === "info" ? (D(), R("span", Oh, "ℹ")) : H("", !0),
|
10071
|
+
e.type === "warning" ? (D(), R("span", Dh, "⚠")) : H("", !0)
|
10072
10072
|
], !0)
|
10073
|
-
])) :
|
10073
|
+
])) : H("", !0),
|
10074
10074
|
x("span", null, Ne(e.message), 1),
|
10075
10075
|
x("button", {
|
10076
10076
|
class: "close-btn hover:text-gray-800 font-bold",
|
10077
10077
|
onClick: t[0] || (t[0] = (...r) => e.closeMessage && e.closeMessage(...r))
|
10078
10078
|
}, " × ")
|
10079
10079
|
], 2)
|
10080
|
-
])) :
|
10080
|
+
])) : H("", !0)
|
10081
10081
|
]),
|
10082
10082
|
_: 3
|
10083
10083
|
});
|
@@ -10177,8 +10177,8 @@ const Ph = { key: 0 }, kh = { key: 0 }, wh = { class: "text-gray-500 my-2" }, Bh
|
|
10177
10177
|
},
|
10178
10178
|
emits: ["updateElement"],
|
10179
10179
|
setup(e, { emit: t }) {
|
10180
|
-
const a = e, i = t, s =
|
10181
|
-
|
10180
|
+
const a = e, i = t, s = $({ rule: {}, ...a.element });
|
10181
|
+
et(
|
10182
10182
|
() => a.element,
|
10183
10183
|
(r) => {
|
10184
10184
|
s.value = { rule: {}, ...r };
|
@@ -10228,19 +10228,19 @@ const Ph = { key: 0 }, kh = { key: 0 }, wh = { class: "text-gray-500 my-2" }, Bh
|
|
10228
10228
|
}
|
10229
10229
|
i("updateElement", s.value);
|
10230
10230
|
}
|
10231
|
-
return (r, o) => (
|
10232
|
-
s.value ? (
|
10233
|
-
s.value.text !== void 0 ? (
|
10231
|
+
return (r, o) => (D(), R("div", null, [
|
10232
|
+
s.value ? (D(), R("div", Ph, [
|
10233
|
+
s.value.text !== void 0 ? (D(), R("div", kh, [
|
10234
10234
|
o[13] || (o[13] = x("label", { class: "block" }, "内容", -1)),
|
10235
10235
|
x("div", wh, Ne(s.value.text || "-"), 1)
|
10236
|
-
])) :
|
10236
|
+
])) : H("", !0),
|
10237
10237
|
x("div", null, [
|
10238
10238
|
o[14] || (o[14] = x("label", { class: "block mt-4" }, "节点", -1)),
|
10239
10239
|
x("div", Bh, Ne(s.value.xpath), 1)
|
10240
10240
|
]),
|
10241
10241
|
x("div", null, [
|
10242
10242
|
o[16] || (o[16] = x("label", { class: "block mt-4" }, "类型", -1)),
|
10243
|
-
|
10243
|
+
at(x("select", {
|
10244
10244
|
"onUpdate:modelValue": o[0] || (o[0] = (c) => s.value.type = c),
|
10245
10245
|
class: "border rounded p-1 w-full"
|
10246
10246
|
}, o[15] || (o[15] = [
|
@@ -10256,25 +10256,25 @@ const Ph = { key: 0 }, kh = { key: 0 }, wh = { class: "text-gray-500 my-2" }, Bh
|
|
10256
10256
|
[er, s.value.type]
|
10257
10257
|
])
|
10258
10258
|
]),
|
10259
|
-
s.value.type == de(z).Text ? (
|
10259
|
+
s.value.type == de(z).Text ? (D(), R("div", Uh, [
|
10260
10260
|
o[17] || (o[17] = x("label", { class: "block mt-4" }, "最小文本长度", -1)),
|
10261
|
-
|
10261
|
+
at(x("input", {
|
10262
10262
|
"onUpdate:modelValue": o[1] || (o[1] = (c) => s.value.rule.minText = c),
|
10263
10263
|
class: "border rounded p-1 w-full"
|
10264
10264
|
}, null, 512), [
|
10265
10265
|
[Tt, s.value.rule.minText]
|
10266
10266
|
])
|
10267
|
-
])) :
|
10268
|
-
s.value.type == de(z).Text ? (
|
10267
|
+
])) : H("", !0),
|
10268
|
+
s.value.type == de(z).Text ? (D(), R("div", Fh, [
|
10269
10269
|
o[18] || (o[18] = x("label", { class: "block mt-4" }, "最大文本长度", -1)),
|
10270
|
-
|
10270
|
+
at(x("input", {
|
10271
10271
|
"onUpdate:modelValue": o[2] || (o[2] = (c) => s.value.rule.maxText = c),
|
10272
10272
|
class: "border rounded p-1 w-full"
|
10273
10273
|
}, null, 512), [
|
10274
10274
|
[Tt, s.value.rule.maxText]
|
10275
10275
|
])
|
10276
|
-
])) :
|
10277
|
-
s.value.type == de(z).Image ? (
|
10276
|
+
])) : H("", !0),
|
10277
|
+
s.value.type == de(z).Image ? (D(), R("div", Hh, [
|
10278
10278
|
o[19] || (o[19] = x("label", { class: "block mt-4" }, "是否裁剪", -1)),
|
10279
10279
|
ut(Gt, {
|
10280
10280
|
class: "py-2",
|
@@ -10282,44 +10282,44 @@ const Ph = { key: 0 }, kh = { key: 0 }, wh = { class: "text-gray-500 my-2" }, Bh
|
|
10282
10282
|
"onUpdate:modelValue": o[3] || (o[3] = (c) => s.value.rule.crop = c),
|
10283
10283
|
label: "是"
|
10284
10284
|
}, null, 8, ["modelValue"])
|
10285
|
-
])) :
|
10286
|
-
s.value.type == de(z).Image ? (
|
10285
|
+
])) : H("", !0),
|
10286
|
+
s.value.type == de(z).Image ? (D(), R("div", Yh, [
|
10287
10287
|
o[20] || (o[20] = x("label", { class: "block mt-4" }, "图片宽度", -1)),
|
10288
|
-
|
10288
|
+
at(x("input", {
|
10289
10289
|
"onUpdate:modelValue": o[4] || (o[4] = (c) => s.value.rule.minImageWidth = c),
|
10290
10290
|
class: "border rounded p-1 w-full"
|
10291
10291
|
}, null, 512), [
|
10292
10292
|
[Tt, s.value.rule.minImageWidth]
|
10293
10293
|
])
|
10294
|
-
])) :
|
10295
|
-
s.value.type == de(z).Image ? (
|
10294
|
+
])) : H("", !0),
|
10295
|
+
s.value.type == de(z).Image ? (D(), R("div", qh, [
|
10296
10296
|
o[21] || (o[21] = x("label", { class: "block mt-4" }, "图片高度", -1)),
|
10297
|
-
|
10297
|
+
at(x("input", {
|
10298
10298
|
"onUpdate:modelValue": o[5] || (o[5] = (c) => s.value.rule.maxImageHeight = c),
|
10299
10299
|
class: "border rounded p-1 w-full"
|
10300
10300
|
}, null, 512), [
|
10301
10301
|
[Tt, s.value.rule.maxImageHeight]
|
10302
10302
|
])
|
10303
|
-
])) :
|
10304
|
-
s.value.type == de(z).Block ? (
|
10303
|
+
])) : H("", !0),
|
10304
|
+
s.value.type == de(z).Block ? (D(), R("div", Vh, [
|
10305
10305
|
o[22] || (o[22] = x("label", { class: "block mt-4" }, "块最小数量", -1)),
|
10306
|
-
|
10306
|
+
at(x("input", {
|
10307
10307
|
"onUpdate:modelValue": o[6] || (o[6] = (c) => s.value.rule.minBlock = c),
|
10308
10308
|
class: "border rounded p-1 w-full"
|
10309
10309
|
}, null, 512), [
|
10310
10310
|
[Tt, s.value.rule.minBlock]
|
10311
10311
|
])
|
10312
|
-
])) :
|
10313
|
-
s.value.type == de(z).Block ? (
|
10312
|
+
])) : H("", !0),
|
10313
|
+
s.value.type == de(z).Block ? (D(), R("div", $h, [
|
10314
10314
|
o[23] || (o[23] = x("label", { class: "block mt-4" }, "块最大数量", -1)),
|
10315
|
-
|
10315
|
+
at(x("input", {
|
10316
10316
|
"onUpdate:modelValue": o[7] || (o[7] = (c) => s.value.rule.maxBlock = c),
|
10317
10317
|
class: "border rounded p-1 w-full"
|
10318
10318
|
}, null, 512), [
|
10319
10319
|
[Tt, s.value.rule.maxBlock]
|
10320
10320
|
])
|
10321
|
-
])) :
|
10322
|
-
s.value.type == de(z).Text || s.value.type == de(z).Icon || s.value.type == de(z).Button ? (
|
10321
|
+
])) : H("", !0),
|
10322
|
+
s.value.type == de(z).Text || s.value.type == de(z).Icon || s.value.type == de(z).Button ? (D(), R("div", Wh, [
|
10323
10323
|
o[24] || (o[24] = x("label", { class: "block mt-4" }, "主题色", -1)),
|
10324
10324
|
ut(Gt, {
|
10325
10325
|
class: "py-2",
|
@@ -10327,7 +10327,7 @@ const Ph = { key: 0 }, kh = { key: 0 }, wh = { class: "text-gray-500 my-2" }, Bh
|
|
10327
10327
|
"onUpdate:modelValue": o[8] || (o[8] = (c) => s.value.rule.isThemeColor = c),
|
10328
10328
|
label: "是"
|
10329
10329
|
}, null, 8, ["modelValue"])
|
10330
|
-
])) :
|
10330
|
+
])) : H("", !0),
|
10331
10331
|
x("div", null, [
|
10332
10332
|
o[25] || (o[25] = x("label", { class: "block mt-4" }, "是否必填", -1)),
|
10333
10333
|
ut(Gt, {
|
@@ -10346,7 +10346,7 @@ const Ph = { key: 0 }, kh = { key: 0 }, wh = { class: "text-gray-500 my-2" }, Bh
|
|
10346
10346
|
label: "是"
|
10347
10347
|
}, null, 8, ["modelValue"])
|
10348
10348
|
]),
|
10349
|
-
s.value.type == de(z).Link || s.value.type == de(z).Button ? (
|
10349
|
+
s.value.type == de(z).Link || s.value.type == de(z).Button ? (D(), R("div", Gh, [
|
10350
10350
|
o[27] || (o[27] = x("label", { class: "block mt-4" }, "打开美洽", -1)),
|
10351
10351
|
ut(Gt, {
|
10352
10352
|
class: "py-2",
|
@@ -10354,17 +10354,17 @@ const Ph = { key: 0 }, kh = { key: 0 }, wh = { class: "text-gray-500 my-2" }, Bh
|
|
10354
10354
|
"onUpdate:modelValue": o[11] || (o[11] = (c) => s.value.rule.openMeiqia = c),
|
10355
10355
|
label: "是"
|
10356
10356
|
}, null, 8, ["modelValue"])
|
10357
|
-
])) :
|
10358
|
-
s.value.type == de(z).Link || s.value.type == de(z).Button ? (
|
10357
|
+
])) : H("", !0),
|
10358
|
+
s.value.type == de(z).Link || s.value.type == de(z).Button ? (D(), R("div", Xh, [
|
10359
10359
|
o[28] || (o[28] = x("label", { class: "block mt-4" }, "链接", -1)),
|
10360
|
-
|
10360
|
+
at(x("input", {
|
10361
10361
|
"onUpdate:modelValue": o[12] || (o[12] = (c) => s.value.rule.linkUrl = c),
|
10362
10362
|
class: "border rounded p-1 w-full"
|
10363
10363
|
}, null, 512), [
|
10364
10364
|
[Tt, s.value.rule.linkUrl]
|
10365
10365
|
])
|
10366
|
-
])) :
|
10367
|
-
])) :
|
10366
|
+
])) : H("", !0)
|
10367
|
+
])) : H("", !0),
|
10368
10368
|
x("button", {
|
10369
10369
|
onClick: u,
|
10370
10370
|
class: "mt-4 p-2 bg-green-500 text-white rounded"
|
@@ -10473,7 +10473,7 @@ function sf() {
|
|
10473
10473
|
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
10474
10474
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
10475
10475
|
}
|
10476
|
-
var ei = typeof window < "u" && typeof window.document < "u", je = ei ? window : {}, cs = ei && je.document.documentElement ? "ontouchstart" in je.document.documentElement : !1, ls = ei ? "PointerEvent" in je : !1, ae = "cropper", ds = "all", ku = "crop", wu = "move", Bu = "zoom", bt = "e", gt = "w", Lt = "s",
|
10476
|
+
var ei = typeof window < "u" && typeof window.document < "u", je = ei ? window : {}, cs = ei && je.document.documentElement ? "ontouchstart" in je.document.documentElement : !1, ls = ei ? "PointerEvent" in je : !1, ae = "cropper", ds = "all", ku = "crop", wu = "move", Bu = "zoom", bt = "e", gt = "w", Lt = "s", it = "n", Xt = "ne", Qt = "nw", jt = "se", zt = "sw", yi = "".concat(ae, "-crop"), Ks = "".concat(ae, "-disabled"), De = "".concat(ae, "-hidden"), Zs = "".concat(ae, "-hide"), nf = "".concat(ae, "-invisible"), Ha = "".concat(ae, "-modal"), Ri = "".concat(ae, "-move"), fa = "".concat(ae, "Action"), Sa = "".concat(ae, "Preview"), hs = "crop", Uu = "move", Fu = "none", Mi = "crop", Pi = "cropend", ki = "cropmove", wi = "cropstart", Js = "dblclick", uf = cs ? "touchstart" : "mousedown", rf = cs ? "touchmove" : "mousemove", of = cs ? "touchend touchcancel" : "mouseup", en = ls ? "pointerdown" : uf, tn = ls ? "pointermove" : rf, an = ls ? "pointerup pointercancel" : of, sn = "ready", nn = "resize", un = "wheel", Bi = "zoom", rn = "image/jpeg", cf = /^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/, lf = /^data:/, df = /^data:image\/jpeg;base64,/, hf = /^img|canvas$/i, Hu = 200, Yu = 100, on = {
|
10477
10477
|
// Define the view mode of the cropper
|
10478
10478
|
viewMode: 0,
|
10479
10479
|
// 0, 1, 2, 3
|
@@ -10810,24 +10810,24 @@ function Sf(e) {
|
|
10810
10810
|
};
|
10811
10811
|
}
|
10812
10812
|
function xf(e, t, a, i) {
|
10813
|
-
var s = t.aspectRatio, u = t.naturalWidth, r = t.naturalHeight, o = t.rotate, c = o === void 0 ? 0 : o, d = t.scaleX, f = d === void 0 ? 1 : d, E = t.scaleY, T = E === void 0 ? 1 : E, g = a.aspectRatio, C = a.naturalWidth,
|
10813
|
+
var s = t.aspectRatio, u = t.naturalWidth, r = t.naturalHeight, o = t.rotate, c = o === void 0 ? 0 : o, d = t.scaleX, f = d === void 0 ? 1 : d, E = t.scaleY, T = E === void 0 ? 1 : E, g = a.aspectRatio, C = a.naturalWidth, L = a.naturalHeight, y = i.fillColor, V = y === void 0 ? "transparent" : y, F = i.imageSmoothingEnabled, Y = F === void 0 ? !0 : F, ee = i.imageSmoothingQuality, q = ee === void 0 ? "low" : ee, _ = i.maxWidth, w = _ === void 0 ? 1 / 0 : _, Q = i.maxHeight, se = Q === void 0 ? 1 / 0 : Q, be = i.minWidth, Be = be === void 0 ? 0 : be, Ue = i.minHeight, Re = Ue === void 0 ? 0 : Ue, Ce = document.createElement("canvas"), v = Ce.getContext("2d"), G = lt({
|
10814
10814
|
aspectRatio: g,
|
10815
|
-
width:
|
10815
|
+
width: w,
|
10816
10816
|
height: se
|
10817
10817
|
}), ne = lt({
|
10818
10818
|
aspectRatio: g,
|
10819
10819
|
width: Be,
|
10820
10820
|
height: Re
|
10821
|
-
}, "cover"), _e = Math.min(
|
10821
|
+
}, "cover"), _e = Math.min(G.width, Math.max(ne.width, C)), Ie = Math.min(G.height, Math.max(ne.height, L)), Ke = lt({
|
10822
10822
|
aspectRatio: s,
|
10823
|
-
width:
|
10823
|
+
width: w,
|
10824
10824
|
height: se
|
10825
10825
|
}), mt = lt({
|
10826
10826
|
aspectRatio: s,
|
10827
10827
|
width: Be,
|
10828
10828
|
height: Re
|
10829
10829
|
}, "cover"), Fe = Math.min(Ke.width, Math.max(mt.width, u)), Et = Math.min(Ke.height, Math.max(mt.height, r)), ga = [-Fe / 2, -Et / 2, Fe, Et];
|
10830
|
-
return Ce.width = kt(_e), Ce.height = kt(Ie), v.fillStyle =
|
10830
|
+
return Ce.width = kt(_e), Ce.height = kt(Ie), v.fillStyle = V, v.fillRect(0, 0, _e, Ie), v.save(), v.translate(_e / 2, Ie / 2), v.rotate(c * Math.PI / 180), v.scale(f, T), v.imageSmoothingEnabled = Y, v.imageSmoothingQuality = q, v.drawImage.apply(v, [e].concat(Pu(ga.map(function(_a) {
|
10831
10831
|
return Math.floor(kt(_a));
|
10832
10832
|
})))), v.restore(), Ce;
|
10833
10833
|
}
|
@@ -11059,10 +11059,10 @@ var Mf = {
|
|
11059
11059
|
translateX: -c,
|
11060
11060
|
translateY: -d
|
11061
11061
|
}, t)))), ce(this.previews, function(f) {
|
11062
|
-
var E = Ui(f, Sa), T = E.width, g = E.height, C = T,
|
11063
|
-
s && (y = T / s,
|
11062
|
+
var E = Ui(f, Sa), T = E.width, g = E.height, C = T, L = g, y = 1;
|
11063
|
+
s && (y = T / s, L = u * y), u && L > g && (y = g / u, C = s * y, L = g), ct(f, {
|
11064
11064
|
width: C,
|
11065
|
-
height:
|
11065
|
+
height: L
|
11066
11066
|
}), ct(f.getElementsByTagName("img")[0], ie({
|
11067
11067
|
width: r * y,
|
11068
11068
|
height: o * y
|
@@ -11148,24 +11148,24 @@ var Mf = {
|
|
11148
11148
|
}
|
11149
11149
|
}, Bf = {
|
11150
11150
|
change: function(t) {
|
11151
|
-
var a = this.options, i = this.canvasData, s = this.containerData, u = this.cropBoxData, r = this.pointers, o = this.action, c = a.aspectRatio, d = u.left, f = u.top, E = u.width, T = u.height, g = d + E, C = f + T,
|
11152
|
-
!c && t.shiftKey && (c = E && T ? E / T : 1), this.limited && (
|
11153
|
-
var
|
11154
|
-
x:
|
11155
|
-
y:
|
11156
|
-
},
|
11151
|
+
var a = this.options, i = this.canvasData, s = this.containerData, u = this.cropBoxData, r = this.pointers, o = this.action, c = a.aspectRatio, d = u.left, f = u.top, E = u.width, T = u.height, g = d + E, C = f + T, L = 0, y = 0, V = s.width, F = s.height, Y = !0, ee;
|
11152
|
+
!c && t.shiftKey && (c = E && T ? E / T : 1), this.limited && (L = u.minLeft, y = u.minTop, V = L + Math.min(s.width, i.width, i.left + i.width), F = y + Math.min(s.height, i.height, i.top + i.height));
|
11153
|
+
var q = r[Object.keys(r)[0]], _ = {
|
11154
|
+
x: q.endX - q.startX,
|
11155
|
+
y: q.endY - q.startY
|
11156
|
+
}, w = function(se) {
|
11157
11157
|
switch (se) {
|
11158
11158
|
case bt:
|
11159
|
-
g + _.x >
|
11159
|
+
g + _.x > V && (_.x = V - g);
|
11160
11160
|
break;
|
11161
11161
|
case gt:
|
11162
|
-
d + _.x <
|
11162
|
+
d + _.x < L && (_.x = L - d);
|
11163
11163
|
break;
|
11164
|
-
case
|
11164
|
+
case it:
|
11165
11165
|
f + _.y < y && (_.y = y - f);
|
11166
11166
|
break;
|
11167
11167
|
case Lt:
|
11168
|
-
C + _.y >
|
11168
|
+
C + _.y > F && (_.y = F - C);
|
11169
11169
|
break;
|
11170
11170
|
}
|
11171
11171
|
};
|
@@ -11174,92 +11174,92 @@ var Mf = {
|
|
11174
11174
|
d += _.x, f += _.y;
|
11175
11175
|
break;
|
11176
11176
|
case bt:
|
11177
|
-
if (_.x >= 0 && (g >=
|
11178
|
-
|
11177
|
+
if (_.x >= 0 && (g >= V || c && (f <= y || C >= F))) {
|
11178
|
+
Y = !1;
|
11179
11179
|
break;
|
11180
11180
|
}
|
11181
|
-
|
11181
|
+
w(bt), E += _.x, E < 0 && (o = gt, E = -E, d -= E), c && (T = E / c, f += (u.height - T) / 2);
|
11182
11182
|
break;
|
11183
|
-
case
|
11184
|
-
if (_.y <= 0 && (f <= y || c && (d <=
|
11185
|
-
|
11183
|
+
case it:
|
11184
|
+
if (_.y <= 0 && (f <= y || c && (d <= L || g >= V))) {
|
11185
|
+
Y = !1;
|
11186
11186
|
break;
|
11187
11187
|
}
|
11188
|
-
|
11188
|
+
w(it), T -= _.y, f += _.y, T < 0 && (o = Lt, T = -T, f -= T), c && (E = T * c, d += (u.width - E) / 2);
|
11189
11189
|
break;
|
11190
11190
|
case gt:
|
11191
|
-
if (_.x <= 0 && (d <=
|
11192
|
-
|
11191
|
+
if (_.x <= 0 && (d <= L || c && (f <= y || C >= F))) {
|
11192
|
+
Y = !1;
|
11193
11193
|
break;
|
11194
11194
|
}
|
11195
|
-
|
11195
|
+
w(gt), E -= _.x, d += _.x, E < 0 && (o = bt, E = -E, d -= E), c && (T = E / c, f += (u.height - T) / 2);
|
11196
11196
|
break;
|
11197
11197
|
case Lt:
|
11198
|
-
if (_.y >= 0 && (C >=
|
11199
|
-
|
11198
|
+
if (_.y >= 0 && (C >= F || c && (d <= L || g >= V))) {
|
11199
|
+
Y = !1;
|
11200
11200
|
break;
|
11201
11201
|
}
|
11202
|
-
|
11202
|
+
w(Lt), T += _.y, T < 0 && (o = it, T = -T, f -= T), c && (E = T * c, d += (u.width - E) / 2);
|
11203
11203
|
break;
|
11204
11204
|
case Xt:
|
11205
11205
|
if (c) {
|
11206
|
-
if (_.y <= 0 && (f <= y || g >=
|
11207
|
-
|
11206
|
+
if (_.y <= 0 && (f <= y || g >= V)) {
|
11207
|
+
Y = !1;
|
11208
11208
|
break;
|
11209
11209
|
}
|
11210
|
-
|
11210
|
+
w(it), T -= _.y, f += _.y, E = T * c;
|
11211
11211
|
} else
|
11212
|
-
|
11212
|
+
w(it), w(bt), _.x >= 0 ? g < V ? E += _.x : _.y <= 0 && f <= y && (Y = !1) : E += _.x, _.y <= 0 ? f > y && (T -= _.y, f += _.y) : (T -= _.y, f += _.y);
|
11213
11213
|
E < 0 && T < 0 ? (o = zt, T = -T, E = -E, f -= T, d -= E) : E < 0 ? (o = Qt, E = -E, d -= E) : T < 0 && (o = jt, T = -T, f -= T);
|
11214
11214
|
break;
|
11215
11215
|
case Qt:
|
11216
11216
|
if (c) {
|
11217
|
-
if (_.y <= 0 && (f <= y || d <=
|
11218
|
-
|
11217
|
+
if (_.y <= 0 && (f <= y || d <= L)) {
|
11218
|
+
Y = !1;
|
11219
11219
|
break;
|
11220
11220
|
}
|
11221
|
-
|
11221
|
+
w(it), T -= _.y, f += _.y, E = T * c, d += u.width - E;
|
11222
11222
|
} else
|
11223
|
-
|
11223
|
+
w(it), w(gt), _.x <= 0 ? d > L ? (E -= _.x, d += _.x) : _.y <= 0 && f <= y && (Y = !1) : (E -= _.x, d += _.x), _.y <= 0 ? f > y && (T -= _.y, f += _.y) : (T -= _.y, f += _.y);
|
11224
11224
|
E < 0 && T < 0 ? (o = jt, T = -T, E = -E, f -= T, d -= E) : E < 0 ? (o = Xt, E = -E, d -= E) : T < 0 && (o = zt, T = -T, f -= T);
|
11225
11225
|
break;
|
11226
11226
|
case zt:
|
11227
11227
|
if (c) {
|
11228
|
-
if (_.x <= 0 && (d <=
|
11229
|
-
|
11228
|
+
if (_.x <= 0 && (d <= L || C >= F)) {
|
11229
|
+
Y = !1;
|
11230
11230
|
break;
|
11231
11231
|
}
|
11232
|
-
|
11232
|
+
w(gt), E -= _.x, d += _.x, T = E / c;
|
11233
11233
|
} else
|
11234
|
-
|
11234
|
+
w(Lt), w(gt), _.x <= 0 ? d > L ? (E -= _.x, d += _.x) : _.y >= 0 && C >= F && (Y = !1) : (E -= _.x, d += _.x), _.y >= 0 ? C < F && (T += _.y) : T += _.y;
|
11235
11235
|
E < 0 && T < 0 ? (o = Xt, T = -T, E = -E, f -= T, d -= E) : E < 0 ? (o = jt, E = -E, d -= E) : T < 0 && (o = Qt, T = -T, f -= T);
|
11236
11236
|
break;
|
11237
11237
|
case jt:
|
11238
11238
|
if (c) {
|
11239
|
-
if (_.x >= 0 && (g >=
|
11240
|
-
|
11239
|
+
if (_.x >= 0 && (g >= V || C >= F)) {
|
11240
|
+
Y = !1;
|
11241
11241
|
break;
|
11242
11242
|
}
|
11243
|
-
|
11243
|
+
w(bt), E += _.x, T = E / c;
|
11244
11244
|
} else
|
11245
|
-
|
11245
|
+
w(Lt), w(bt), _.x >= 0 ? g < V ? E += _.x : _.y >= 0 && C >= F && (Y = !1) : E += _.x, _.y >= 0 ? C < F && (T += _.y) : T += _.y;
|
11246
11246
|
E < 0 && T < 0 ? (o = Qt, T = -T, E = -E, f -= T, d -= E) : E < 0 ? (o = zt, E = -E, d -= E) : T < 0 && (o = Xt, T = -T, f -= T);
|
11247
11247
|
break;
|
11248
11248
|
case wu:
|
11249
|
-
this.move(_.x, _.y),
|
11249
|
+
this.move(_.x, _.y), Y = !1;
|
11250
11250
|
break;
|
11251
11251
|
case Bu:
|
11252
|
-
this.zoom(Cf(r), t),
|
11252
|
+
this.zoom(Cf(r), t), Y = !1;
|
11253
11253
|
break;
|
11254
11254
|
case ku:
|
11255
11255
|
if (!_.x || !_.y) {
|
11256
|
-
|
11256
|
+
Y = !1;
|
11257
11257
|
break;
|
11258
11258
|
}
|
11259
|
-
ee = Wu(this.cropper), d =
|
11259
|
+
ee = Wu(this.cropper), d = q.startX - ee.left, f = q.startY - ee.top, E = u.minWidth, T = u.minHeight, _.x > 0 ? o = _.y > 0 ? jt : Xt : _.x < 0 && (d -= E, o = _.y > 0 ? zt : Qt), _.y < 0 && (f -= T), this.cropped || (Qe(this.cropBox, De), this.cropped = !0, this.limited && this.limitCropBox(!0, !0));
|
11260
11260
|
break;
|
11261
11261
|
}
|
11262
|
-
|
11262
|
+
Y && (u.width = E, u.height = T, u.left = d, u.top = f, this.action = o, this.renderCropBox()), ce(r, function(Q) {
|
11263
11263
|
Q.startX = Q.endX, Q.startY = Q.endY;
|
11264
11264
|
});
|
11265
11265
|
}
|
@@ -11537,20 +11537,20 @@ var Mf = {
|
|
11537
11537
|
aspectRatio: f,
|
11538
11538
|
width: t.width || (d !== 1 ? i.width : o),
|
11539
11539
|
height: t.height || (d !== 1 ? i.height : c)
|
11540
|
-
}), C = g.width,
|
11541
|
-
C = Math.min(E.width, Math.max(T.width, C)),
|
11542
|
-
var y = document.createElement("canvas"),
|
11543
|
-
y.width = kt(C), y.height = kt(
|
11544
|
-
var
|
11545
|
-
|
11546
|
-
var
|
11547
|
-
|
11548
|
-
var v = [
|
11540
|
+
}), C = g.width, L = g.height;
|
11541
|
+
C = Math.min(E.width, Math.max(T.width, C)), L = Math.min(E.height, Math.max(T.height, L));
|
11542
|
+
var y = document.createElement("canvas"), V = y.getContext("2d");
|
11543
|
+
y.width = kt(C), y.height = kt(L), V.fillStyle = t.fillColor || "transparent", V.fillRect(0, 0, C, L);
|
11544
|
+
var F = t.imageSmoothingEnabled, Y = F === void 0 ? !0 : F, ee = t.imageSmoothingQuality;
|
11545
|
+
V.imageSmoothingEnabled = Y, ee && (V.imageSmoothingQuality = ee);
|
11546
|
+
var q = i.width, _ = i.height, w = u, Q = r, se, be, Be, Ue, Re, Ce;
|
11547
|
+
w <= -o || w > q ? (w = 0, se = 0, Be = 0, Re = 0) : w <= 0 ? (Be = -w, w = 0, se = Math.min(q, o + w), Re = se) : w <= q && (Be = 0, se = Math.min(o, q - w), Re = se), se <= 0 || Q <= -c || Q > _ ? (Q = 0, be = 0, Ue = 0, Ce = 0) : Q <= 0 ? (Ue = -Q, Q = 0, be = Math.min(_, c + Q), Ce = be) : Q <= _ && (Ue = 0, be = Math.min(c, _ - Q), Ce = be);
|
11548
|
+
var v = [w, Q, se, be];
|
11549
11549
|
if (Re > 0 && Ce > 0) {
|
11550
|
-
var
|
11551
|
-
v.push(Be *
|
11550
|
+
var G = C / o;
|
11551
|
+
v.push(Be * G, Ue * G, Re * G, Ce * G);
|
11552
11552
|
}
|
11553
|
-
return
|
11553
|
+
return V.drawImage.apply(V, [i].concat(Pu(v.map(function(ne) {
|
11554
11554
|
return Math.floor(kt(ne));
|
11555
11555
|
})))), y;
|
11556
11556
|
},
|
@@ -11744,7 +11744,7 @@ const qf = {
|
|
11744
11744
|
__name: "index",
|
11745
11745
|
emits: ["cancel", "ok"],
|
11746
11746
|
setup(e, { expose: t, emit: a }) {
|
11747
|
-
const i = a, s =
|
11747
|
+
const i = a, s = $({
|
11748
11748
|
coverUrl: "",
|
11749
11749
|
// 封面url
|
11750
11750
|
inputValue: "",
|
@@ -11755,7 +11755,7 @@ const qf = {
|
|
11755
11755
|
// 视频前缀
|
11756
11756
|
videoUrl: ""
|
11757
11757
|
// 视频url
|
11758
|
-
}), u =
|
11758
|
+
}), u = $(), r = $({
|
11759
11759
|
// 允许自裁
|
11760
11760
|
autoCrop: !0,
|
11761
11761
|
// 设置图片是否可以拖拽功能
|
@@ -11791,49 +11791,49 @@ const qf = {
|
|
11791
11791
|
// crop: (e) => {
|
11792
11792
|
// console.log(e.detail);
|
11793
11793
|
// }
|
11794
|
-
}), o =
|
11794
|
+
}), o = $(!1), c = $({
|
11795
11795
|
// 裁剪后的图片
|
11796
11796
|
afterImg: "",
|
11797
11797
|
// 裁剪前的图片
|
11798
11798
|
image: null,
|
11799
11799
|
myCropper: null
|
11800
|
-
}), d =
|
11801
|
-
console.log(
|
11802
|
-
const _ =
|
11800
|
+
}), d = $("image/jpeg"), f = (q) => {
|
11801
|
+
console.log(q);
|
11802
|
+
const _ = q.target.files[0];
|
11803
11803
|
if (_) {
|
11804
11804
|
_.name && (s.value.inputValue = _.name);
|
11805
|
-
const
|
11806
|
-
|
11805
|
+
const w = new FileReader();
|
11806
|
+
w.onload = (Q) => {
|
11807
11807
|
var se, be;
|
11808
11808
|
console.log("e?.target?.result", (se = Q == null ? void 0 : Q.target) == null ? void 0 : se.result), E((be = Q == null ? void 0 : Q.target) == null ? void 0 : be.result);
|
11809
|
-
},
|
11809
|
+
}, w.readAsDataURL(_);
|
11810
11810
|
}
|
11811
11811
|
};
|
11812
|
-
async function E(
|
11813
|
-
if (!
|
11812
|
+
async function E(q) {
|
11813
|
+
if (!q)
|
11814
11814
|
return;
|
11815
11815
|
await ee();
|
11816
|
-
const _ =
|
11816
|
+
const _ = q;
|
11817
11817
|
c.value.image = _, c.value.image && T();
|
11818
11818
|
}
|
11819
11819
|
function T() {
|
11820
|
-
const
|
11821
|
-
|
11822
|
-
|
11823
|
-
|
11820
|
+
const q = document.querySelector("#imgId");
|
11821
|
+
q && q.addEventListener("load", () => {
|
11822
|
+
Y(), c.value.myCropper = new Xu(
|
11823
|
+
q,
|
11824
11824
|
r.value
|
11825
11825
|
);
|
11826
11826
|
});
|
11827
11827
|
}
|
11828
|
-
const g =
|
11829
|
-
function
|
11830
|
-
C.value = Q, u.value =
|
11828
|
+
const g = $(!1), C = $();
|
11829
|
+
function L(q, _, w, Q) {
|
11830
|
+
C.value = Q, u.value = q, q && q.aspectRatio && (r.value.aspectRatio = q.aspectRatio), w && (s.value.inputValue = w), g.value = !0, _ && E(_);
|
11831
11831
|
}
|
11832
11832
|
function y() {
|
11833
11833
|
g.value = !1;
|
11834
11834
|
}
|
11835
|
-
const
|
11836
|
-
var _,
|
11835
|
+
const V = () => {
|
11836
|
+
var _, w;
|
11837
11837
|
if (!c.value.myCropper)
|
11838
11838
|
return;
|
11839
11839
|
o.value = !0, c.value.afterImg = c.value.myCropper.getCroppedCanvas({
|
@@ -11841,33 +11841,33 @@ const qf = {
|
|
11841
11841
|
// 高
|
11842
11842
|
imageSmoothingQuality: "high",
|
11843
11843
|
// 图片质量
|
11844
|
-
width: (
|
11844
|
+
width: (w = u.value) == null ? void 0 : w.width
|
11845
11845
|
// 输出图片的宽
|
11846
11846
|
}).toDataURL(d.value);
|
11847
|
-
const
|
11847
|
+
const q = Yf(
|
11848
11848
|
c.value.afterImg,
|
11849
11849
|
s.value.inputValue
|
11850
11850
|
);
|
11851
|
-
i("ok", { options:
|
11851
|
+
i("ok", { options: q, element: C.value }), o.value = !1, ee(), Y(), y();
|
11852
11852
|
};
|
11853
|
-
function
|
11854
|
-
ee(),
|
11853
|
+
function F() {
|
11854
|
+
ee(), Y(), y(), i("cancel");
|
11855
11855
|
}
|
11856
|
-
function
|
11856
|
+
function Y() {
|
11857
11857
|
c.value.myCropper && c.value.myCropper.destroy();
|
11858
11858
|
}
|
11859
11859
|
function ee() {
|
11860
11860
|
c.value.image = "";
|
11861
11861
|
}
|
11862
|
-
return t({ handleCloseCropper: y, handleOpenCropper:
|
11863
|
-
var
|
11864
|
-
return g.value ? (
|
11862
|
+
return t({ handleCloseCropper: y, handleOpenCropper: L }), (q, _) => {
|
11863
|
+
var w, Q, se;
|
11864
|
+
return g.value ? (D(), R("div", qf, [
|
11865
11865
|
x("div", Vf, [
|
11866
11866
|
x("div", $f, [
|
11867
11867
|
_[1] || (_[1] = x("span", { class: "text-base font-semibold text-[#333]" }, "图片裁剪", -1)),
|
11868
11868
|
x("span", {
|
11869
11869
|
class: "text-lg cursor-pointer text-[#999] iconfont icon-shanchu2",
|
11870
|
-
onClick: Le(
|
11870
|
+
onClick: Le(F, ["stop"])
|
11871
11871
|
})
|
11872
11872
|
]),
|
11873
11873
|
x("div", Wf, [
|
@@ -11897,7 +11897,7 @@ const qf = {
|
|
11897
11897
|
x("div", Zf, [
|
11898
11898
|
x("div", Jf, [
|
11899
11899
|
x("div", e1, [
|
11900
|
-
c.value.image ?
|
11900
|
+
c.value.image ? H("", !0) : (D(), R("div", t1, " 请上传图片 ")),
|
11901
11901
|
x("img", {
|
11902
11902
|
id: "imgId",
|
11903
11903
|
src: c.value.image,
|
@@ -11907,7 +11907,7 @@ const qf = {
|
|
11907
11907
|
]),
|
11908
11908
|
x("div", i1, [
|
11909
11909
|
_[4] || (_[4] = x("div", { class: "before w-[270px] h-[200px] pr-[70px] border" }, null, -1)),
|
11910
|
-
x("div", s1, " 预览画像 " + Ne(((
|
11910
|
+
x("div", s1, " 预览画像 " + Ne(((w = u.value) == null ? void 0 : w.width) || "") + " " + Ne((Q = u.value) != null && Q.width ? "x" : "") + " " + Ne(((se = u.value) == null ? void 0 : se.height) || ""), 1)
|
11911
11911
|
])
|
11912
11912
|
])
|
11913
11913
|
])
|
@@ -11919,16 +11919,16 @@ const qf = {
|
|
11919
11919
|
loading: o.value,
|
11920
11920
|
class: "!w-22 bg-[#474AFF] text-white rounded py-2 px-6 cursor-pointer",
|
11921
11921
|
type: "primary",
|
11922
|
-
onClick:
|
11922
|
+
onClick: V
|
11923
11923
|
}, " 确认 ", 8, u1),
|
11924
11924
|
x("span", {
|
11925
11925
|
class: "!w-22 border border-[#DEDEDE] text-[#666] rounded py-2 px-6 cursor-pointer",
|
11926
|
-
onClick:
|
11926
|
+
onClick: F
|
11927
11927
|
}, "取消")
|
11928
11928
|
])
|
11929
11929
|
])
|
11930
11930
|
])
|
11931
|
-
])) :
|
11931
|
+
])) : H("", !0);
|
11932
11932
|
};
|
11933
11933
|
}
|
11934
11934
|
}), o1 = ze({
|
@@ -11946,7 +11946,7 @@ const qf = {
|
|
11946
11946
|
}
|
11947
11947
|
});
|
11948
11948
|
function c1(e, t, a, i, s, u) {
|
11949
|
-
return
|
11949
|
+
return D(), R("span", {
|
11950
11950
|
style: { position: "unset", color: "unset", top: "unset", left: "unset", right: "unset", transform: "unset", "font-size": "unset" },
|
11951
11951
|
class: fn(`iconfont icon-${e.iconClass} text-4xl overflow-hidden flex justify-center items-center`)
|
11952
11952
|
}, null, 2);
|
@@ -12010,16 +12010,16 @@ const l1 = /* @__PURE__ */ ft(o1, [["render", c1]]), d1 = ze({
|
|
12010
12010
|
class: "p-4 border-t border-gray-200 flex justify-end space-x-2"
|
12011
12011
|
};
|
12012
12012
|
function p1(e, t, a, i, s, u) {
|
12013
|
-
return e.visible ? (
|
12013
|
+
return e.visible ? (D(), R("div", {
|
12014
12014
|
key: 0,
|
12015
12015
|
class: "fixed inset-0 z-[99999] flex items-center justify-center bg-gray-900 bg-opacity-50",
|
12016
12016
|
onClick: t[3] || (t[3] = Le((...r) => e.onClose && e.onClose(...r), ["self"]))
|
12017
12017
|
}, [
|
12018
12018
|
x("div", h1, [
|
12019
12019
|
x("div", f1, [
|
12020
|
-
e.title ? (
|
12020
|
+
e.title ? (D(), R("h3", m1, Ne(e.title), 1)) : H("", !0),
|
12021
12021
|
Jt(e.$slots, "header"),
|
12022
|
-
e.showCloseButton ? (
|
12022
|
+
e.showCloseButton ? (D(), R("button", {
|
12023
12023
|
key: 1,
|
12024
12024
|
class: "text-gray-400 hover:text-gray-600",
|
12025
12025
|
onClick: t[0] || (t[0] = (...r) => e.onClose && e.onClose(...r)),
|
@@ -12037,27 +12037,27 @@ function p1(e, t, a, i, s, u) {
|
|
12037
12037
|
"clip-rule": "evenodd"
|
12038
12038
|
})
|
12039
12039
|
], -1)
|
12040
|
-
]))) :
|
12040
|
+
]))) : H("", !0)
|
12041
12041
|
]),
|
12042
12042
|
x("div", E1, [
|
12043
12043
|
Jt(e.$slots, "default")
|
12044
12044
|
]),
|
12045
|
-
e.showCancelButton || e.showOkButton ? (
|
12045
|
+
e.showCancelButton || e.showOkButton ? (D(), R("div", T1, [
|
12046
12046
|
Jt(e.$slots, "footer", {}, () => [
|
12047
|
-
e.showCancelButton ? (
|
12047
|
+
e.showCancelButton ? (D(), R("button", {
|
12048
12048
|
key: 0,
|
12049
12049
|
class: "px-4 py-2 text-sm font-medium text-gray-700 bg-gray-100 rounded hover:bg-gray-200",
|
12050
12050
|
onClick: t[1] || (t[1] = (...r) => e.onCancel && e.onCancel(...r))
|
12051
|
-
}, Ne(e.cancelText), 1)) :
|
12052
|
-
e.showOkButton ? (
|
12051
|
+
}, Ne(e.cancelText), 1)) : H("", !0),
|
12052
|
+
e.showOkButton ? (D(), R("button", {
|
12053
12053
|
key: 1,
|
12054
12054
|
class: "px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded hover:bg-blue-700",
|
12055
12055
|
onClick: t[2] || (t[2] = (...r) => e.onOk && e.onOk(...r))
|
12056
|
-
}, Ne(e.okText), 1)) :
|
12056
|
+
}, Ne(e.okText), 1)) : H("", !0)
|
12057
12057
|
])
|
12058
|
-
])) :
|
12058
|
+
])) : H("", !0)
|
12059
12059
|
])
|
12060
|
-
])) :
|
12060
|
+
])) : H("", !0);
|
12061
12061
|
}
|
12062
12062
|
const b1 = /* @__PURE__ */ ft(d1, [["render", p1]]), g1 = { class: "p-4 flex flex-wrap max-h-[500px] overflow-y-auto w-[640px]" }, _1 = /* @__PURE__ */ ze({
|
12063
12063
|
__name: "IconModal",
|
@@ -12070,15 +12070,15 @@ const b1 = /* @__PURE__ */ ft(d1, [["render", p1]]), g1 = { class: "p-4 flex fle
|
|
12070
12070
|
},
|
12071
12071
|
emits: ["ok"],
|
12072
12072
|
setup(e, { expose: t, emit: a }) {
|
12073
|
-
const i = e, s =
|
12074
|
-
|
12073
|
+
const i = e, s = $(i.icons || []);
|
12074
|
+
et(
|
12075
12075
|
() => i.icons,
|
12076
12076
|
(E) => {
|
12077
12077
|
s.value = E || [];
|
12078
12078
|
},
|
12079
12079
|
{ immediate: !0 }
|
12080
12080
|
);
|
12081
|
-
const u = a, r =
|
12081
|
+
const u = a, r = $(!1), o = $();
|
12082
12082
|
function c(E) {
|
12083
12083
|
r.value = !0, o.value = E;
|
12084
12084
|
}
|
@@ -12088,7 +12088,7 @@ const b1 = /* @__PURE__ */ ft(d1, [["render", p1]]), g1 = { class: "p-4 flex fle
|
|
12088
12088
|
function f() {
|
12089
12089
|
r.value = !1;
|
12090
12090
|
}
|
12091
|
-
return t({ openModal: c, closeModal: f }), (E, T) => (
|
12091
|
+
return t({ openModal: c, closeModal: f }), (E, T) => (D(), Ct(b1, {
|
12092
12092
|
visible: r.value,
|
12093
12093
|
"onUpdate:visible": T[0] || (T[0] = (g) => r.value = g),
|
12094
12094
|
title: "选择图标",
|
@@ -12099,7 +12099,7 @@ const b1 = /* @__PURE__ */ ft(d1, [["render", p1]]), g1 = { class: "p-4 flex fle
|
|
12099
12099
|
}, {
|
12100
12100
|
default: Ya(() => [
|
12101
12101
|
x("div", g1, [
|
12102
|
-
(
|
12102
|
+
(D(!0), R(Zt, null, Fi(s.value, (g) => (D(), Ct(l1, {
|
12103
12103
|
key: g,
|
12104
12104
|
class: "w-12 h-12 mx-1 mb-2 border cursor-pointer hover:border-gray-400 hover:bg-gray-200",
|
12105
12105
|
iconName: g,
|
@@ -12134,60 +12134,74 @@ const b1 = /* @__PURE__ */ ft(d1, [["render", p1]]), g1 = { class: "p-4 flex fle
|
|
12134
12134
|
showList: {
|
12135
12135
|
type: Boolean,
|
12136
12136
|
default: !1
|
12137
|
+
},
|
12138
|
+
show: {
|
12139
|
+
type: Boolean,
|
12140
|
+
default: !0
|
12137
12141
|
}
|
12138
12142
|
},
|
12139
12143
|
setup(e, { emit: t }) {
|
12140
|
-
const a =
|
12141
|
-
|
12142
|
-
(
|
12143
|
-
|
12144
|
-
|
12145
|
-
|
12146
|
-
|
12147
|
-
|
12148
|
-
|
12149
|
-
|
12150
|
-
|
12144
|
+
const a = $(null), i = $([]), s = $(), u = $(e.show);
|
12145
|
+
et(
|
12146
|
+
() => e.show,
|
12147
|
+
(f) => {
|
12148
|
+
u.value = f;
|
12149
|
+
},
|
12150
|
+
{ immediate: !0 }
|
12151
|
+
);
|
12152
|
+
const r = () => {
|
12153
|
+
var f;
|
12154
|
+
(f = a.value) == null || f.click();
|
12155
|
+
}, o = async (f) => {
|
12156
|
+
var C;
|
12157
|
+
const T = f.target.files;
|
12158
|
+
if (!T) return;
|
12159
|
+
const g = [];
|
12160
|
+
for (let L = 0; L < T.length; L++) {
|
12161
|
+
const y = T[L];
|
12162
|
+
if (e.beforeUpload && await e.beforeUpload(y) === !1)
|
12151
12163
|
continue;
|
12152
|
-
const
|
12153
|
-
|
12154
|
-
|
12164
|
+
const V = `${Date.now()}-${y.name}`, F = URL.createObjectURL(y), Y = document.createElement("img");
|
12165
|
+
Y.src = F, document.body.appendChild(Y), await new Promise((_) => {
|
12166
|
+
Y.onload = _;
|
12155
12167
|
});
|
12156
|
-
const
|
12157
|
-
document.body.removeChild(
|
12158
|
-
uid:
|
12159
|
-
name:
|
12168
|
+
const ee = Y.width, q = Y.height;
|
12169
|
+
document.body.removeChild(Y), g.push({
|
12170
|
+
uid: V,
|
12171
|
+
name: y.name,
|
12160
12172
|
status: "uploading",
|
12161
|
-
thumbUrl:
|
12162
|
-
file:
|
12163
|
-
width:
|
12164
|
-
height:
|
12173
|
+
thumbUrl: F,
|
12174
|
+
file: y,
|
12175
|
+
width: ee,
|
12176
|
+
height: q
|
12165
12177
|
});
|
12166
12178
|
}
|
12167
|
-
e.maxCount && i.value.length +
|
12168
|
-
},
|
12169
|
-
var
|
12170
|
-
i.value = i.value.filter((
|
12179
|
+
e.maxCount && i.value.length + g.length > e.maxCount && g.splice(e.maxCount - i.value.length), e.multiple ? i.value = [...i.value, ...g] : i.value = g.slice(0, 1), (C = e.onChange) == null || C.call(e, i.value, s.value), t("update:fileList", i.value), a.value && (a.value.value = "");
|
12180
|
+
}, c = (f) => {
|
12181
|
+
var E;
|
12182
|
+
i.value = i.value.filter((T) => T.uid !== f), (E = e.onChange) == null || E.call(e, i.value, s.value);
|
12171
12183
|
};
|
12172
|
-
function
|
12173
|
-
s.value =
|
12184
|
+
function d(f) {
|
12185
|
+
s.value = f, r();
|
12174
12186
|
}
|
12175
12187
|
return {
|
12176
|
-
|
12188
|
+
isShow: u,
|
12189
|
+
openModal: d,
|
12177
12190
|
inputRef: a,
|
12178
12191
|
fileList: i,
|
12179
|
-
triggerInput:
|
12180
|
-
handleChange:
|
12181
|
-
removeFile:
|
12192
|
+
triggerInput: r,
|
12193
|
+
handleChange: o,
|
12194
|
+
removeFile: c
|
12182
12195
|
};
|
12183
12196
|
}
|
12184
12197
|
}), N1 = { class: "upload-wrapper" }, C1 = ["accept", "multiple"], I1 = {
|
12185
|
-
key:
|
12198
|
+
key: 1,
|
12186
12199
|
class: "file-list mt-4"
|
12187
12200
|
}, S1 = { class: "flex items-center space-x-4" }, x1 = ["src"], O1 = ["onClick"];
|
12188
12201
|
function D1(e, t, a, i, s, u) {
|
12189
|
-
return
|
12190
|
-
|
12202
|
+
return D(), R("div", N1, [
|
12203
|
+
e.isShow ? (D(), R("div", {
|
12204
|
+
key: 0,
|
12191
12205
|
class: "",
|
12192
12206
|
onClick: t[0] || (t[0] = (...r) => e.triggerInput && e.triggerInput(...r))
|
12193
12207
|
}, [
|
@@ -12196,7 +12210,7 @@ function D1(e, t, a, i, s, u) {
|
|
12196
12210
|
x("div", { class: "text-gray-400 text-lg text-center" }, " 点击或拖拽上传图片 ")
|
12197
12211
|
], -1))
|
12198
12212
|
], !0)
|
12199
|
-
]),
|
12213
|
+
])) : H("", !0),
|
12200
12214
|
x("input", {
|
12201
12215
|
type: "file",
|
12202
12216
|
ref: "inputRef",
|
@@ -12205,18 +12219,18 @@ function D1(e, t, a, i, s, u) {
|
|
12205
12219
|
multiple: e.multiple,
|
12206
12220
|
onChange: t[1] || (t[1] = (...r) => e.handleChange && e.handleChange(...r))
|
12207
12221
|
}, null, 40, C1),
|
12208
|
-
e.showList ? (
|
12209
|
-
(
|
12222
|
+
e.showList ? (D(), R("div", I1, [
|
12223
|
+
(D(!0), R(Zt, null, Fi(e.fileList, (r) => (D(), R("div", {
|
12210
12224
|
key: r.uid,
|
12211
12225
|
class: "file-item flex items-center justify-between p-2 border rounded mb-2"
|
12212
12226
|
}, [
|
12213
12227
|
x("div", S1, [
|
12214
|
-
r.thumbUrl ? (
|
12228
|
+
r.thumbUrl ? (D(), R("img", {
|
12215
12229
|
key: 0,
|
12216
12230
|
src: r.thumbUrl,
|
12217
12231
|
alt: "preview",
|
12218
12232
|
class: "w-12 h-12 object-cover rounded"
|
12219
|
-
}, null, 8, x1)) :
|
12233
|
+
}, null, 8, x1)) : H("", !0),
|
12220
12234
|
x("span", null, Ne(r.name), 1)
|
12221
12235
|
]),
|
12222
12236
|
x("div", null, [
|
@@ -12226,10 +12240,10 @@ function D1(e, t, a, i, s, u) {
|
|
12226
12240
|
}, " 删除 ", 8, O1)
|
12227
12241
|
])
|
12228
12242
|
]))), 128))
|
12229
|
-
])) :
|
12243
|
+
])) : H("", !0)
|
12230
12244
|
]);
|
12231
12245
|
}
|
12232
|
-
const v1 = /* @__PURE__ */ ft(A1, [["render", D1], ["__scopeId", "data-v-
|
12246
|
+
const v1 = /* @__PURE__ */ ft(A1, [["render", D1], ["__scopeId", "data-v-e0428cf8"]]), L1 = { class: "flex" }, y1 = {
|
12233
12247
|
key: 0,
|
12234
12248
|
class: "text-lg font-bold border-b p-2"
|
12235
12249
|
}, R1 = { class: "text-sm font-thin text-gray-500" }, M1 = ["innerHTML"], P1 = ["innerHTML"], k1 = { class: "flex-1" }, w1 = {
|
@@ -12253,22 +12267,22 @@ const v1 = /* @__PURE__ */ ft(A1, [["render", D1], ["__scopeId", "data-v-41db179
|
|
12253
12267
|
},
|
12254
12268
|
emits: ["update:modelValue", "update:element"],
|
12255
12269
|
setup(e, { emit: t }) {
|
12256
|
-
const a = e, i = t, s =
|
12270
|
+
const a = e, i = t, s = $(a.template), u = $();
|
12257
12271
|
let r = Qs("", {}, !1);
|
12258
|
-
const o =
|
12259
|
-
|
12272
|
+
const o = $("");
|
12273
|
+
et(
|
12260
12274
|
() => a.template,
|
12261
12275
|
(A) => {
|
12262
12276
|
s.value = A;
|
12263
12277
|
},
|
12264
12278
|
{ immediate: !0 }
|
12265
|
-
),
|
12279
|
+
), et(
|
12266
12280
|
() => s.value,
|
12267
12281
|
(A) => {
|
12268
12282
|
A && (u.value = _(A));
|
12269
12283
|
},
|
12270
12284
|
{ immediate: !0 }
|
12271
|
-
),
|
12285
|
+
), et(
|
12272
12286
|
() => a.css,
|
12273
12287
|
(A) => {
|
12274
12288
|
A.forEach((O) => {
|
@@ -12279,61 +12293,61 @@ const v1 = /* @__PURE__ */ ft(A1, [["render", D1], ["__scopeId", "data-v-41db179
|
|
12279
12293
|
},
|
12280
12294
|
{ immediate: !0 }
|
12281
12295
|
);
|
12282
|
-
const c =
|
12283
|
-
|
12296
|
+
const c = $(a.mode);
|
12297
|
+
et(
|
12284
12298
|
() => u.value,
|
12285
12299
|
(A) => {
|
12286
12300
|
A && i("update:element", A);
|
12287
12301
|
},
|
12288
12302
|
{ immediate: !0 }
|
12289
12303
|
);
|
12290
|
-
const d =
|
12291
|
-
|
12304
|
+
const d = $("");
|
12305
|
+
et(
|
12292
12306
|
() => o.value,
|
12293
12307
|
(A) => {
|
12294
12308
|
i("update:modelValue", A);
|
12295
12309
|
},
|
12296
12310
|
{ immediate: !0 }
|
12297
12311
|
);
|
12298
|
-
const f =
|
12312
|
+
const f = $(), E = $(), T = $(), g = $(), C = $(), L = $("");
|
12299
12313
|
function y(A) {
|
12300
12314
|
g.value = A;
|
12301
12315
|
}
|
12302
|
-
function
|
12316
|
+
function V(A, O = "") {
|
12303
12317
|
if (O) {
|
12304
|
-
const P =
|
12318
|
+
const P = F(u.value, O);
|
12305
12319
|
P ? C.value = P : C.value = A;
|
12306
12320
|
} else
|
12307
12321
|
C.value = A;
|
12308
12322
|
}
|
12309
|
-
function
|
12323
|
+
function F(A, O) {
|
12310
12324
|
if (A.xpath === O)
|
12311
12325
|
return A;
|
12312
12326
|
if (A.children && A.children.length)
|
12313
12327
|
for (const P of A.children) {
|
12314
|
-
const
|
12315
|
-
if (
|
12316
|
-
return
|
12328
|
+
const U = F(P, O);
|
12329
|
+
if (U)
|
12330
|
+
return U;
|
12317
12331
|
}
|
12318
12332
|
}
|
12319
|
-
function
|
12320
|
-
var P,
|
12333
|
+
function Y(A, O) {
|
12334
|
+
var P, U;
|
12321
12335
|
return A.tag === O.tag && // 标签一致
|
12322
|
-
((P = A.children) == null ? void 0 : P.length) === ((
|
12336
|
+
((P = A.children) == null ? void 0 : P.length) === ((U = O.children) == null ? void 0 : U.length);
|
12323
12337
|
}
|
12324
12338
|
function ee(A) {
|
12325
|
-
var P,
|
12339
|
+
var P, U, ue, Ae, Me, le, oe, Ve, qt, ti;
|
12326
12340
|
if (g.value.xpath == A.xpath) {
|
12327
12341
|
if (g.value) {
|
12328
12342
|
if (A.type === z.Block) {
|
12329
12343
|
var O = !0;
|
12330
|
-
const $e =
|
12344
|
+
const $e = F(
|
12331
12345
|
u.value,
|
12332
12346
|
g.value.parentxpath || ""
|
12333
12347
|
);
|
12334
12348
|
if ($e && $e.children && $e.children.forEach((He) => {
|
12335
12349
|
if (He.tag != g.value.tag || // 检查标签一致
|
12336
|
-
|
12350
|
+
!Y(He, g.value)) {
|
12337
12351
|
O = !1;
|
12338
12352
|
return;
|
12339
12353
|
}
|
@@ -12342,14 +12356,14 @@ const v1 = /* @__PURE__ */ ft(A1, [["render", D1], ["__scopeId", "data-v-41db179
|
|
12342
12356
|
return;
|
12343
12357
|
}
|
12344
12358
|
}
|
12345
|
-
if (g.value.rule = A.rule, g.value.type = A.type, (P = A.rule) != null && P.isThemeColor ? (A.type === 1 && ((!A.attrs.class || A.attrs.class && (!((
|
12346
|
-
const $e =
|
12359
|
+
if (g.value.rule = A.rule, g.value.type = A.type, (P = A.rule) != null && P.isThemeColor ? (A.type === 1 && ((!A.attrs.class || A.attrs.class && (!((U = A.attrs.class) != null && U.includes("theme_text")) || !((ue = A.attrs.class) != null && ue.includes(" theme_text")))) && (A.attrs.class += " theme_text"), (Ae = A.attrs.class) != null && Ae.includes("theme_bg") && (A.attrs.class = A.attrs.class.replace("theme_bg", ""))), A.type === 6 && (!((Me = A.attrs.class) != null && Me.includes("theme_bg")) && !((le = A.attrs.class) != null && le.includes(" theme_bg")) && (A.attrs.class += " theme_bg"), (oe = A.attrs.class) != null && oe.includes("theme_text") && (A.attrs.class = A.attrs.class.replace("theme_text", "")))) : (A.type === 1 && (Ve = A.attrs.class) != null && Ve.includes("theme_text") && (A.attrs.class = A.attrs.class.replace("theme_text", "")), A.type === 6 && (qt = A.attrs.class) != null && qt.includes("theme_bg") && (A.attrs.class = A.attrs.class.replace("theme_bg", ""))), g.value.type === z.Block) {
|
12360
|
+
const $e = F(
|
12347
12361
|
u.value,
|
12348
12362
|
g.value.parentxpath || ""
|
12349
12363
|
);
|
12350
12364
|
$e && $e.children && ($e.children.forEach((He) => {
|
12351
12365
|
if (He.tag != g.value.tag || // 检查标签一致
|
12352
|
-
|
12366
|
+
!Y(He, g.value)) {
|
12353
12367
|
Z.error("同级结构不一致,无法配置为块类型");
|
12354
12368
|
return;
|
12355
12369
|
}
|
@@ -12363,15 +12377,15 @@ const v1 = /* @__PURE__ */ ft(A1, [["render", D1], ["__scopeId", "data-v-41db179
|
|
12363
12377
|
d.value = (/* @__PURE__ */ new Date()).getTime().toString(), Z.success("保存成功");
|
12364
12378
|
}
|
12365
12379
|
}
|
12366
|
-
function
|
12380
|
+
function q(A) {
|
12367
12381
|
o.value = A;
|
12368
12382
|
}
|
12369
12383
|
function _(A) {
|
12370
12384
|
r = Qs(A);
|
12371
|
-
const O = r("body").children().toArray().map((P) =>
|
12385
|
+
const O = r("body").children().toArray().map((P) => w(r(P)));
|
12372
12386
|
return o.value = r("body").html() || "", O[0];
|
12373
12387
|
}
|
12374
|
-
function
|
12388
|
+
function w(A, O = "") {
|
12375
12389
|
var Me;
|
12376
12390
|
function P(le) {
|
12377
12391
|
if (!le || !le[0]) return "";
|
@@ -12383,13 +12397,13 @@ const v1 = /* @__PURE__ */ ft(A1, [["render", D1], ["__scopeId", "data-v-41db179
|
|
12383
12397
|
}
|
12384
12398
|
return "/html/" + oe.join("/");
|
12385
12399
|
}
|
12386
|
-
const
|
12400
|
+
const U = P(A).replace("/html/body[1]", ""), ue = A.children().toArray().map((le) => w(r(le), U)), Ae = (Me = a.rules) == null ? void 0 : Me.find((le) => le.xpath === U);
|
12387
12401
|
return {
|
12388
12402
|
tag: A[0].tagName,
|
12389
12403
|
text: A.contents().not(A.children()).text().trim(),
|
12390
12404
|
attrs: A[0].attribs,
|
12391
12405
|
children: ue,
|
12392
|
-
xpath:
|
12406
|
+
xpath: U,
|
12393
12407
|
parentxpath: O,
|
12394
12408
|
type: (Ae == null ? void 0 : Ae.type) || z.None,
|
12395
12409
|
rule: (Ae == null ? void 0 : Ae.rule) || {}
|
@@ -12397,20 +12411,20 @@ const v1 = /* @__PURE__ */ ft(A1, [["render", D1], ["__scopeId", "data-v-41db179
|
|
12397
12411
|
}
|
12398
12412
|
function Q(A) {
|
12399
12413
|
console.log("更新子节点的文本", A);
|
12400
|
-
const O =
|
12414
|
+
const O = F(u.value, A.element.xpath);
|
12401
12415
|
if (O) {
|
12402
12416
|
const P = hn(O);
|
12403
12417
|
P.editText = A.newText;
|
12404
12418
|
}
|
12405
12419
|
}
|
12406
12420
|
function se(A, O = "") {
|
12407
|
-
function P(
|
12421
|
+
function P(U, ue) {
|
12408
12422
|
var le;
|
12409
|
-
const Me = (ue ? ((le =
|
12410
|
-
return `${ue}/${
|
12423
|
+
const Me = (ue ? ((le = F(u.value, ue)) == null ? void 0 : le.children) || [] : [u.value]).filter((oe) => oe.tag === U.tag).indexOf(U) + 1;
|
12424
|
+
return `${ue}/${U.tag}[${Me}]`;
|
12411
12425
|
}
|
12412
12426
|
A.xpath = P(A, O), A.parentxpath = O, (A.children || []).forEach(
|
12413
|
-
(
|
12427
|
+
(U) => se(U, A.xpath)
|
12414
12428
|
);
|
12415
12429
|
}
|
12416
12430
|
function be({
|
@@ -12419,18 +12433,18 @@ const v1 = /* @__PURE__ */ ft(A1, [["render", D1], ["__scopeId", "data-v-41db179
|
|
12419
12433
|
newBlock: P
|
12420
12434
|
}) {
|
12421
12435
|
console.log("块操作", A, O, P);
|
12422
|
-
const
|
12436
|
+
const U = F(
|
12423
12437
|
u.value,
|
12424
12438
|
O.parentxpath || ""
|
12425
12439
|
);
|
12426
|
-
if (!
|
12427
|
-
const ue =
|
12440
|
+
if (!U || !U.children) return;
|
12441
|
+
const ue = U.children.findIndex(
|
12428
12442
|
(oe) => oe === O
|
12429
12443
|
);
|
12430
12444
|
if (ue === -1) return;
|
12431
|
-
const Ae =
|
12445
|
+
const Ae = U.children.length, { minBlock: Me, maxBlock: le } = O.rule;
|
12432
12446
|
if ((A === "add" || A === "copy") && Ae >= (le || 1 / 0)) {
|
12433
|
-
|
12447
|
+
L.value = `无法添加更多块。最大块数量为 ${le}`, Z.error(L.value);
|
12434
12448
|
return;
|
12435
12449
|
}
|
12436
12450
|
switch (A) {
|
@@ -12441,7 +12455,7 @@ const v1 = /* @__PURE__ */ ft(A1, [["render", D1], ["__scopeId", "data-v-41db179
|
|
12441
12455
|
xpath: "",
|
12442
12456
|
children: JSON.parse(JSON.stringify(P.children))
|
12443
12457
|
};
|
12444
|
-
|
12458
|
+
U.children.splice(ue + 1, 0, oe);
|
12445
12459
|
}
|
12446
12460
|
break;
|
12447
12461
|
case "copy":
|
@@ -12451,61 +12465,61 @@ const v1 = /* @__PURE__ */ ft(A1, [["render", D1], ["__scopeId", "data-v-41db179
|
|
12451
12465
|
xpath: "",
|
12452
12466
|
children: JSON.parse(JSON.stringify(P.children))
|
12453
12467
|
};
|
12454
|
-
|
12468
|
+
U.children.splice(ue + 1, 0, oe);
|
12455
12469
|
}
|
12456
12470
|
break;
|
12457
12471
|
case "moveUp":
|
12458
12472
|
if (ue > 0) {
|
12459
|
-
const [oe] =
|
12460
|
-
|
12473
|
+
const [oe] = U.children.splice(ue, 1);
|
12474
|
+
U.children.splice(ue - 1, 0, oe);
|
12461
12475
|
}
|
12462
12476
|
break;
|
12463
12477
|
case "moveDown":
|
12464
|
-
if (ue <
|
12465
|
-
const [oe] =
|
12466
|
-
|
12478
|
+
if (ue < U.children.length - 1) {
|
12479
|
+
const [oe] = U.children.splice(ue, 1);
|
12480
|
+
U.children.splice(ue + 1, 0, oe);
|
12467
12481
|
}
|
12468
12482
|
break;
|
12469
12483
|
case "delete":
|
12470
12484
|
if (Ae <= (Me || 0)) {
|
12471
|
-
|
12485
|
+
L.value = `无法删除更多块。最小块数量为 ${Me}`, Z.error(L.value);
|
12472
12486
|
return;
|
12473
12487
|
}
|
12474
|
-
|
12488
|
+
U.children.splice(ue, 1);
|
12475
12489
|
break;
|
12476
12490
|
}
|
12477
|
-
|
12491
|
+
L.value = "", se(u.value);
|
12478
12492
|
}
|
12479
12493
|
function Be(A, O) {
|
12480
12494
|
let P = O.attrs.class.replace(/icon-\S+/g, `icon-${A}`);
|
12481
12495
|
O.attrs.class = P;
|
12482
12496
|
}
|
12483
12497
|
function Ue(A) {
|
12484
|
-
const O =
|
12498
|
+
const O = F(u.value, A.element.xpath), P = A.options;
|
12485
12499
|
if (typeof P == "object")
|
12486
12500
|
if (a.uploadByFile)
|
12487
|
-
a.uploadByFile(P).then((
|
12488
|
-
|
12501
|
+
a.uploadByFile(P).then((U) => {
|
12502
|
+
U.success && (O.attrs.src = U.file.url, d.value = (/* @__PURE__ */ new Date()).getTime().toString());
|
12489
12503
|
});
|
12490
12504
|
else {
|
12491
12505
|
O.attrs.alt = P.name;
|
12492
|
-
const
|
12493
|
-
|
12506
|
+
const U = new FileReader();
|
12507
|
+
U.onload = (ue) => {
|
12494
12508
|
var oe;
|
12495
12509
|
let Ae = (oe = ue == null ? void 0 : ue.target) == null ? void 0 : oe.result, Me = Hf(Ae), le = URL.createObjectURL(Me);
|
12496
12510
|
console.log("url", le), O.attrs.src = le, d.value = (/* @__PURE__ */ new Date()).getTime().toString();
|
12497
|
-
},
|
12511
|
+
}, U.readAsDataURL(P);
|
12498
12512
|
}
|
12499
12513
|
else
|
12500
12514
|
O.attrs.src = P, d.value = (/* @__PURE__ */ new Date()).getTime().toString();
|
12501
12515
|
}
|
12502
12516
|
function Re(A) {
|
12503
|
-
const { icon: O } = A, P =
|
12504
|
-
let
|
12505
|
-
P.attrs.class =
|
12517
|
+
const { icon: O } = A, P = F(u.value, A.element.xpath);
|
12518
|
+
let U = P.attrs.class.replace(/icon-\S+/g, `icon-${O}`);
|
12519
|
+
P.attrs.class = U, d.value = (/* @__PURE__ */ new Date()).getTime().toString();
|
12506
12520
|
}
|
12507
|
-
const Ce = (A) => A.type.startsWith("image/") ? !0 : (Z.error("只能上传图片文件"), !1), v =
|
12508
|
-
function
|
12521
|
+
const Ce = (A) => A.type.startsWith("image/") ? !0 : (Z.error("只能上传图片文件"), !1), v = $({});
|
12522
|
+
function G(A, O) {
|
12509
12523
|
if (!A || A.length === 0)
|
12510
12524
|
return;
|
12511
12525
|
const P = A[0];
|
@@ -12521,20 +12535,20 @@ const v1 = /* @__PURE__ */ ft(A1, [["render", D1], ["__scopeId", "data-v-41db179
|
|
12521
12535
|
}
|
12522
12536
|
if (O.rule.minImageWidth && O.rule.maxImageHeight ? (v.value.width = O.rule.minImageWidth, v.value.height = O.rule.maxImageHeight, v.value.aspectRatio = O.rule.minImageWidth / O.rule.maxImageHeight) : v.value = {}, P)
|
12523
12537
|
if (O.rule.crop) {
|
12524
|
-
const
|
12538
|
+
const U = P.thumbUrl;
|
12525
12539
|
f.value.handleOpenCropper(
|
12526
12540
|
v.value,
|
12527
|
-
|
12541
|
+
U,
|
12528
12542
|
P.name,
|
12529
12543
|
O
|
12530
12544
|
);
|
12531
12545
|
} else
|
12532
|
-
a.uploadByFile ? a.uploadByFile(P.file).then((
|
12533
|
-
|
12546
|
+
a.uploadByFile ? a.uploadByFile(P.file).then((U) => {
|
12547
|
+
U.success && (O.attrs.src = U.file.url, d.value = (/* @__PURE__ */ new Date()).getTime().toString());
|
12534
12548
|
}) : (O.attrs.src = P.thumbUrl, d.value = (/* @__PURE__ */ new Date()).getTime().toString());
|
12535
12549
|
}
|
12536
|
-
const ne =
|
12537
|
-
let Ie =
|
12550
|
+
const ne = $(a.previewWidth), _e = $(375);
|
12551
|
+
let Ie = $(!1), Ke = $(""), mt = 0, Fe = 0;
|
12538
12552
|
function Et(A) {
|
12539
12553
|
Ke.value = A, Ie.value = !0, mt = event.clientX, A === "preview" ? Fe = ne.value : A === "structure" && (Fe = _e.value), window.addEventListener("mousemove", ga), window.addEventListener("mouseup", _a);
|
12540
12554
|
}
|
@@ -12546,35 +12560,35 @@ const v1 = /* @__PURE__ */ ft(A1, [["render", D1], ["__scopeId", "data-v-41db179
|
|
12546
12560
|
function _a() {
|
12547
12561
|
Ie.value = !1, Ke.value = "", window.removeEventListener("mousemove", ga), window.removeEventListener("mouseup", _a);
|
12548
12562
|
}
|
12549
|
-
return (A, O) => (
|
12550
|
-
A.preview ? (
|
12563
|
+
return (A, O) => (D(), R("div", L1, [
|
12564
|
+
A.preview ? (D(), R("div", {
|
12551
12565
|
key: 0,
|
12552
12566
|
class: "border-l overflow-auto resize-area",
|
12553
12567
|
style: Ts({ width: ne.value + "px" })
|
12554
12568
|
}, [
|
12555
|
-
A.showTitle ? (
|
12569
|
+
A.showTitle ? (D(), R("h2", y1, [
|
12556
12570
|
O[2] || (O[2] = Ei(" 实时预览 ")),
|
12557
12571
|
x("span", R1, Ne(ne.value) + "px", 1)
|
12558
|
-
])) :
|
12572
|
+
])) : H("", !0),
|
12559
12573
|
x("div", null, [
|
12560
|
-
o.value ? (
|
12574
|
+
o.value ? (D(), R("div", {
|
12561
12575
|
key: 0,
|
12562
12576
|
innerHTML: o.value
|
12563
|
-
}, null, 8, M1)) : (
|
12577
|
+
}, null, 8, M1)) : (D(), R("div", {
|
12564
12578
|
key: 1,
|
12565
12579
|
innerHTML: de(r)("body").html()
|
12566
12580
|
}, null, 8, P1))
|
12567
12581
|
])
|
12568
|
-
], 4)) :
|
12569
|
-
A.preview ? (
|
12582
|
+
], 4)) : H("", !0),
|
12583
|
+
A.preview ? (D(), R("div", {
|
12570
12584
|
key: 1,
|
12571
12585
|
class: "resizer",
|
12572
12586
|
onMousedown: O[0] || (O[0] = (P) => Et("preview"))
|
12573
|
-
}, null, 32)) :
|
12587
|
+
}, null, 32)) : H("", !0),
|
12574
12588
|
x("div", k1, [
|
12575
|
-
A.showTitle ? (
|
12589
|
+
A.showTitle ? (D(), R("h2", w1, "结构渲染")) : H("", !0),
|
12576
12590
|
x("div", B1, [
|
12577
|
-
u.value ? (
|
12591
|
+
u.value ? (D(), Ct(Eh, {
|
12578
12592
|
key: 0,
|
12579
12593
|
"upload-by-file": A.uploadByFile,
|
12580
12594
|
cropper: f.value,
|
@@ -12587,36 +12601,36 @@ const v1 = /* @__PURE__ */ ft(A1, [["render", D1], ["__scopeId", "data-v-41db179
|
|
12587
12601
|
selectedElement: g.value,
|
12588
12602
|
hoveredElement: C.value,
|
12589
12603
|
onSelectElement: y,
|
12590
|
-
onHoverElement:
|
12591
|
-
onContentUpdated:
|
12604
|
+
onHoverElement: V,
|
12605
|
+
onContentUpdated: q,
|
12592
12606
|
onUpdateText: Q,
|
12593
12607
|
onBlockAction: be,
|
12594
12608
|
onAddIcon: Be
|
12595
|
-
}, null, 8, ["upload-by-file", "cropper", "icon", "upload", "mode", "icons", "r", "element", "selectedElement", "hoveredElement"])) :
|
12609
|
+
}, null, 8, ["upload-by-file", "cropper", "icon", "upload", "mode", "icons", "r", "element", "selectedElement", "hoveredElement"])) : H("", !0)
|
12596
12610
|
])
|
12597
12611
|
]),
|
12598
|
-
c.value == "design" ? (
|
12612
|
+
c.value == "design" ? (D(), R("div", {
|
12599
12613
|
key: 2,
|
12600
12614
|
class: "resizer",
|
12601
12615
|
onMousedown: O[1] || (O[1] = (P) => Et("structure"))
|
12602
|
-
}, null, 32)) :
|
12603
|
-
c.value == "design" ? (
|
12616
|
+
}, null, 32)) : H("", !0),
|
12617
|
+
c.value == "design" ? (D(), R("div", {
|
12604
12618
|
key: 3,
|
12605
12619
|
class: "resize-area overflow-auto",
|
12606
12620
|
style: Ts({ width: _e.value + "px" })
|
12607
12621
|
}, [
|
12608
|
-
A.showTitle ? (
|
12622
|
+
A.showTitle ? (D(), R("h2", U1, [
|
12609
12623
|
O[3] || (O[3] = Ei(" 节点属性 ")),
|
12610
12624
|
x("span", F1, Ne(_e.value) + "px", 1)
|
12611
|
-
])) :
|
12625
|
+
])) : H("", !0),
|
12612
12626
|
x("div", H1, [
|
12613
|
-
g.value ? (
|
12627
|
+
g.value ? (D(), Ct(jh, {
|
12614
12628
|
key: 0,
|
12615
12629
|
element: g.value,
|
12616
12630
|
onUpdateElement: ee
|
12617
|
-
}, null, 8, ["element"])) :
|
12631
|
+
}, null, 8, ["element"])) : H("", !0)
|
12618
12632
|
])
|
12619
|
-
], 4)) :
|
12633
|
+
], 4)) : H("", !0),
|
12620
12634
|
ut(r1, {
|
12621
12635
|
ref_key: "cropperRef",
|
12622
12636
|
ref: f,
|
@@ -12632,8 +12646,9 @@ const v1 = /* @__PURE__ */ ft(A1, [["render", D1], ["__scopeId", "data-v-41db179
|
|
12632
12646
|
ref_key: "uploadRef",
|
12633
12647
|
ref: T,
|
12634
12648
|
multiple: !1,
|
12649
|
+
show: !1,
|
12635
12650
|
beforeUpload: Ce,
|
12636
|
-
onChange:
|
12651
|
+
onChange: G
|
12637
12652
|
}, {
|
12638
12653
|
"upload-icon": Ya(() => O[4] || (O[4] = [
|
12639
12654
|
x("div", { class: "p-2" }, "上传", -1)
|
@@ -12642,7 +12657,7 @@ const v1 = /* @__PURE__ */ ft(A1, [["render", D1], ["__scopeId", "data-v-41db179
|
|
12642
12657
|
}, 512)
|
12643
12658
|
]));
|
12644
12659
|
}
|
12645
|
-
}), q1 = /* @__PURE__ */ ft(Y1, [["__scopeId", "data-v-
|
12660
|
+
}), q1 = /* @__PURE__ */ ft(Y1, [["__scopeId", "data-v-59e33596"]]), X1 = {
|
12646
12661
|
install(e) {
|
12647
12662
|
e.component("Designer", q1);
|
12648
12663
|
}
|