gp-designer 1.0.22 → 1.0.23
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 +264 -256
- package/dist/gp-designer.umd.js +3 -3
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/gp-designer.es.js
CHANGED
@@ -191,7 +191,7 @@ function ci(e) {
|
|
191
191
|
function ct(e) {
|
192
192
|
return e.type === K.Root;
|
193
193
|
}
|
194
|
-
function
|
194
|
+
function be(e) {
|
195
195
|
return Object.prototype.hasOwnProperty.call(e, "children");
|
196
196
|
}
|
197
197
|
function sa(e, t = !1) {
|
@@ -350,42 +350,42 @@ function or(e) {
|
|
350
350
|
var t;
|
351
351
|
return e >= 55296 && e <= 57343 || e > 1114111 ? 65533 : (t = rr.get(e)) !== null && t !== void 0 ? t : e;
|
352
352
|
}
|
353
|
-
var
|
353
|
+
var pe;
|
354
354
|
(function(e) {
|
355
355
|
e[e.NUM = 35] = "NUM", e[e.SEMI = 59] = "SEMI", e[e.EQUALS = 61] = "EQUALS", e[e.ZERO = 48] = "ZERO", e[e.NINE = 57] = "NINE", e[e.LOWER_A = 97] = "LOWER_A", e[e.LOWER_F = 102] = "LOWER_F", e[e.LOWER_X = 120] = "LOWER_X", e[e.LOWER_Z = 122] = "LOWER_Z", e[e.UPPER_A = 65] = "UPPER_A", e[e.UPPER_F = 70] = "UPPER_F", e[e.UPPER_Z = 90] = "UPPER_Z";
|
356
|
-
})(
|
356
|
+
})(pe || (pe = {}));
|
357
357
|
const cr = 32;
|
358
358
|
var nt;
|
359
359
|
(function(e) {
|
360
360
|
e[e.VALUE_LENGTH = 49152] = "VALUE_LENGTH", e[e.BRANCH_LENGTH = 16256] = "BRANCH_LENGTH", e[e.JUMP_TABLE = 127] = "JUMP_TABLE";
|
361
361
|
})(nt || (nt = {}));
|
362
362
|
function di(e) {
|
363
|
-
return e >=
|
363
|
+
return e >= pe.ZERO && e <= pe.NINE;
|
364
364
|
}
|
365
365
|
function lr(e) {
|
366
|
-
return e >=
|
366
|
+
return e >= pe.UPPER_A && e <= pe.UPPER_F || e >= pe.LOWER_A && e <= pe.LOWER_F;
|
367
367
|
}
|
368
368
|
function dr(e) {
|
369
|
-
return e >=
|
369
|
+
return e >= pe.UPPER_A && e <= pe.UPPER_Z || e >= pe.LOWER_A && e <= pe.LOWER_Z || di(e);
|
370
370
|
}
|
371
371
|
function hr(e) {
|
372
|
-
return e ===
|
372
|
+
return e === pe.EQUALS || dr(e);
|
373
373
|
}
|
374
|
-
var
|
374
|
+
var Ee;
|
375
375
|
(function(e) {
|
376
376
|
e[e.EntityStart = 0] = "EntityStart", e[e.NumericStart = 1] = "NumericStart", e[e.NumericDecimal = 2] = "NumericDecimal", e[e.NumericHex = 3] = "NumericHex", e[e.NamedEntity = 4] = "NamedEntity";
|
377
|
-
})(
|
377
|
+
})(Ee || (Ee = {}));
|
378
378
|
var Ue;
|
379
379
|
(function(e) {
|
380
380
|
e[e.Legacy = 0] = "Legacy", e[e.Strict = 1] = "Strict", e[e.Attribute = 2] = "Attribute";
|
381
381
|
})(Ue || (Ue = {}));
|
382
382
|
class Fi {
|
383
383
|
constructor(t, a, i) {
|
384
|
-
this.decodeTree = t, this.emitCodePoint = a, this.errors = i, this.state =
|
384
|
+
this.decodeTree = t, this.emitCodePoint = a, this.errors = i, this.state = Ee.EntityStart, this.consumed = 1, this.result = 0, this.treeIndex = 0, this.excess = 1, this.decodeMode = Ue.Strict;
|
385
385
|
}
|
386
386
|
/** Resets the instance to make it reusable. */
|
387
387
|
startEntity(t) {
|
388
|
-
this.decodeMode = t, this.state =
|
388
|
+
this.decodeMode = t, this.state = Ee.EntityStart, this.result = 0, this.treeIndex = 0, this.excess = 1, this.consumed = 1;
|
389
389
|
}
|
390
390
|
/**
|
391
391
|
* Write an entity to the decoder. This can be called multiple times with partial entities.
|
@@ -400,15 +400,15 @@ class Fi {
|
|
400
400
|
*/
|
401
401
|
write(t, a) {
|
402
402
|
switch (this.state) {
|
403
|
-
case
|
404
|
-
return t.charCodeAt(a) ===
|
405
|
-
case
|
403
|
+
case Ee.EntityStart:
|
404
|
+
return t.charCodeAt(a) === pe.NUM ? (this.state = Ee.NumericStart, this.consumed += 1, this.stateNumericStart(t, a + 1)) : (this.state = Ee.NamedEntity, this.stateNamedEntity(t, a));
|
405
|
+
case Ee.NumericStart:
|
406
406
|
return this.stateNumericStart(t, a);
|
407
|
-
case
|
407
|
+
case Ee.NumericDecimal:
|
408
408
|
return this.stateNumericDecimal(t, a);
|
409
|
-
case
|
409
|
+
case Ee.NumericHex:
|
410
410
|
return this.stateNumericHex(t, a);
|
411
|
-
case
|
411
|
+
case Ee.NamedEntity:
|
412
412
|
return this.stateNamedEntity(t, a);
|
413
413
|
}
|
414
414
|
}
|
@@ -422,7 +422,7 @@ class Fi {
|
|
422
422
|
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
423
423
|
*/
|
424
424
|
stateNumericStart(t, a) {
|
425
|
-
return a >= t.length ? -1 : (t.charCodeAt(a) | cr) ===
|
425
|
+
return a >= t.length ? -1 : (t.charCodeAt(a) | cr) === pe.LOWER_X ? (this.state = Ee.NumericHex, this.consumed += 1, this.stateNumericHex(t, a + 1)) : (this.state = Ee.NumericDecimal, this.stateNumericDecimal(t, a));
|
426
426
|
}
|
427
427
|
addToNumericResult(t, a, i, s) {
|
428
428
|
if (a !== i) {
|
@@ -487,11 +487,11 @@ class Fi {
|
|
487
487
|
var i;
|
488
488
|
if (this.consumed <= a)
|
489
489
|
return (i = this.errors) === null || i === void 0 || i.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
|
490
|
-
if (t ===
|
490
|
+
if (t === pe.SEMI)
|
491
491
|
this.consumed += 1;
|
492
492
|
else if (this.decodeMode === Ue.Strict)
|
493
493
|
return 0;
|
494
|
-
return this.emitCodePoint(or(this.result), this.consumed), this.errors && (t !==
|
494
|
+
return this.emitCodePoint(or(this.result), this.consumed), this.errors && (t !== pe.SEMI && this.errors.missingSemicolonAfterCharacterReference(), this.errors.validateNumericCharacterReference(this.result)), this.consumed;
|
495
495
|
}
|
496
496
|
/**
|
497
497
|
* Parses a named entity.
|
@@ -513,7 +513,7 @@ class Fi {
|
|
513
513
|
(u === 0 || // And there should be no invalid characters.
|
514
514
|
hr(r)) ? 0 : this.emitNotTerminatedNamedEntity();
|
515
515
|
if (s = i[this.treeIndex], u = (s & nt.VALUE_LENGTH) >> 14, u !== 0) {
|
516
|
-
if (r ===
|
516
|
+
if (r === pe.SEMI)
|
517
517
|
return this.emitNamedEntityData(this.treeIndex, u, this.consumed + this.excess);
|
518
518
|
this.decodeMode !== Ue.Strict && (this.result = this.treeIndex, this.consumed += this.excess, this.excess = 0);
|
519
519
|
}
|
@@ -553,15 +553,15 @@ class Fi {
|
|
553
553
|
end() {
|
554
554
|
var t;
|
555
555
|
switch (this.state) {
|
556
|
-
case
|
556
|
+
case Ee.NamedEntity:
|
557
557
|
return this.result !== 0 && (this.decodeMode !== Ue.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0;
|
558
|
-
case
|
558
|
+
case Ee.NumericDecimal:
|
559
559
|
return this.emitNumericEntity(0, 2);
|
560
|
-
case
|
560
|
+
case Ee.NumericHex:
|
561
561
|
return this.emitNumericEntity(0, 3);
|
562
|
-
case
|
562
|
+
case Ee.NumericStart:
|
563
563
|
return (t = this.errors) === null || t === void 0 || t.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
|
564
|
-
case
|
564
|
+
case Ee.EntityStart:
|
565
565
|
return 0;
|
566
566
|
}
|
567
567
|
}
|
@@ -859,20 +859,20 @@ function En(e, t) {
|
|
859
859
|
return Ua(e, t);
|
860
860
|
}
|
861
861
|
function vr(e, t) {
|
862
|
-
return
|
862
|
+
return be(e) ? e.children.map((a) => En(a, t)).join("") : "";
|
863
863
|
}
|
864
864
|
function Aa(e) {
|
865
865
|
return Array.isArray(e) ? e.map(Aa).join("") : U(e) ? e.name === "br" ? `
|
866
866
|
` : Aa(e.children) : wa(e) ? Aa(e.children) : We(e) ? e.data : "";
|
867
867
|
}
|
868
868
|
function Pt(e) {
|
869
|
-
return Array.isArray(e) ? e.map(Pt).join("") :
|
869
|
+
return Array.isArray(e) ? e.map(Pt).join("") : be(e) && !Ba(e) ? Pt(e.children) : We(e) ? e.data : "";
|
870
870
|
}
|
871
871
|
function Ia(e) {
|
872
|
-
return Array.isArray(e) ? e.map(Ia).join("") :
|
872
|
+
return Array.isArray(e) ? e.map(Ia).join("") : be(e) && (e.type === K.Tag || wa(e)) ? Ia(e.children) : We(e) ? e.data : "";
|
873
873
|
}
|
874
874
|
function Fa(e) {
|
875
|
-
return
|
875
|
+
return be(e) ? e.children : [];
|
876
876
|
}
|
877
877
|
function Tn(e) {
|
878
878
|
return e.parent || null;
|
@@ -977,7 +977,7 @@ function qi(e, t, a, i) {
|
|
977
977
|
const o = u[0][r[0]++];
|
978
978
|
if (e(o) && (s.push(o), --i <= 0))
|
979
979
|
return s;
|
980
|
-
a &&
|
980
|
+
a && be(o) && o.children.length > 0 && (r.unshift(0), u.unshift(o.children));
|
981
981
|
}
|
982
982
|
}
|
983
983
|
function Ur(e, t) {
|
@@ -1074,10 +1074,10 @@ function An(e, t) {
|
|
1074
1074
|
const a = [], i = [];
|
1075
1075
|
if (e === t)
|
1076
1076
|
return 0;
|
1077
|
-
let s =
|
1077
|
+
let s = be(e) ? e : e.parent;
|
1078
1078
|
for (; s; )
|
1079
1079
|
a.unshift(s), s = s.parent;
|
1080
|
-
for (s =
|
1080
|
+
for (s = be(t) ? t : t.parent; s; )
|
1081
1081
|
i.unshift(s), s = s.parent;
|
1082
1082
|
const u = Math.min(a.length, i.length);
|
1083
1083
|
let r = 0;
|
@@ -1200,7 +1200,7 @@ const Ya = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1200
1200
|
getSiblings: pn,
|
1201
1201
|
getText: Aa,
|
1202
1202
|
hasAttrib: yr,
|
1203
|
-
hasChildren:
|
1203
|
+
hasChildren: be,
|
1204
1204
|
innerText: Ia,
|
1205
1205
|
isCDATA: wa,
|
1206
1206
|
isComment: Ba,
|
@@ -2821,7 +2821,7 @@ const cc = ji((e) => Hi(e)), lc = da((e) => {
|
|
2821
2821
|
return t;
|
2822
2822
|
}, Ut), mc = zi((e) => Yi(e), Ut), Ec = da((e) => pn(e).filter((t) => U(t) && t !== e), Bt), Tc = da((e) => Fa(e).filter(U), Ut);
|
2823
2823
|
function pc() {
|
2824
|
-
const e = this.toArray().reduce((t, a) =>
|
2824
|
+
const e = this.toArray().reduce((t, a) => be(a) ? t.concat(a.children) : t, []);
|
2825
2825
|
return this._make(e);
|
2826
2826
|
}
|
2827
2827
|
function bc(e) {
|
@@ -2990,7 +2990,7 @@ function Wn(e) {
|
|
2990
2990
|
return function(...t) {
|
2991
2991
|
const a = this.length - 1;
|
2992
2992
|
return oe(this, (i, s) => {
|
2993
|
-
if (!
|
2993
|
+
if (!be(i))
|
2994
2994
|
return;
|
2995
2995
|
const u = typeof t[0] == "function" ? t[0].call(i, s, this._render(i.children)) : t, r = this._makeDomArray(u, s < a);
|
2996
2996
|
e(r, i.children, i);
|
@@ -3030,7 +3030,7 @@ function Gn(e) {
|
|
3030
3030
|
const a = this.length - 1, i = this.parents().last();
|
3031
3031
|
for (let s = 0; s < this.length; s++) {
|
3032
3032
|
const u = this[s], r = typeof t == "function" ? t.call(u, s, u) : typeof t == "string" && !fi(t) ? i.find(t).clone() : t, [o] = this._makeDomArray(r, s < a);
|
3033
|
-
if (!o || !
|
3033
|
+
if (!o || !be(o))
|
3034
3034
|
continue;
|
3035
3035
|
let c = o, d = 0;
|
3036
3036
|
for (; d < c.children.length; ) {
|
@@ -3049,7 +3049,7 @@ const Yc = Gn((e, t, a) => {
|
|
3049
3049
|
const s = i.children, u = s.indexOf(e);
|
3050
3050
|
Nt([e], t), lt(s, u, 0, a, i);
|
3051
3051
|
}), qc = Gn((e, t, a) => {
|
3052
|
-
|
3052
|
+
be(e) && (Nt(e.children, t), Nt(a, e));
|
3053
3053
|
});
|
3054
3054
|
function Vc(e) {
|
3055
3055
|
return this.parent(e).not("body").each((t, a) => {
|
@@ -3075,7 +3075,7 @@ function $c(e) {
|
|
3075
3075
|
function Wc(...e) {
|
3076
3076
|
const t = this.length - 1;
|
3077
3077
|
return oe(this, (a, i) => {
|
3078
|
-
if (!
|
3078
|
+
if (!be(a) || !a.parent)
|
3079
3079
|
return;
|
3080
3080
|
const s = a.parent.children, u = s.indexOf(a);
|
3081
3081
|
if (u < 0)
|
@@ -3099,7 +3099,7 @@ function Gc(e) {
|
|
3099
3099
|
function Xc(...e) {
|
3100
3100
|
const t = this.length - 1;
|
3101
3101
|
return oe(this, (a, i) => {
|
3102
|
-
if (!
|
3102
|
+
if (!be(a) || !a.parent)
|
3103
3103
|
return;
|
3104
3104
|
const s = a.parent.children, u = s.indexOf(a);
|
3105
3105
|
if (u < 0)
|
@@ -3139,7 +3139,7 @@ function zc(e) {
|
|
3139
3139
|
}
|
3140
3140
|
function Kc() {
|
3141
3141
|
return oe(this, (e) => {
|
3142
|
-
if (
|
3142
|
+
if (be(e)) {
|
3143
3143
|
for (const t of e.children)
|
3144
3144
|
t.next = t.prev = t.parent = null;
|
3145
3145
|
e.children.length = 0;
|
@@ -3149,10 +3149,10 @@ function Kc() {
|
|
3149
3149
|
function Zc(e) {
|
3150
3150
|
if (e === void 0) {
|
3151
3151
|
const t = this[0];
|
3152
|
-
return !t || !
|
3152
|
+
return !t || !be(t) ? null : this._render(t.children);
|
3153
3153
|
}
|
3154
3154
|
return oe(this, (t) => {
|
3155
|
-
if (!
|
3155
|
+
if (!be(t))
|
3156
3156
|
return;
|
3157
3157
|
for (const i of t.children)
|
3158
3158
|
i.next = i.prev = i.parent = null;
|
@@ -3165,7 +3165,7 @@ function Jc() {
|
|
3165
3165
|
}
|
3166
3166
|
function el(e) {
|
3167
3167
|
return e === void 0 ? na(this) : typeof e == "function" ? oe(this, (t, a) => this._make(t).text(e.call(t, a, na([t])))) : oe(this, (t) => {
|
3168
|
-
if (!
|
3168
|
+
if (!be(t))
|
3169
3169
|
return;
|
3170
3170
|
for (const i of t.children)
|
3171
3171
|
i.next = i.prev = i.parent = null;
|
@@ -9376,19 +9376,19 @@ const xt = /* @__PURE__ */ new Set([
|
|
9376
9376
|
"button",
|
9377
9377
|
"datalist",
|
9378
9378
|
"textarea"
|
9379
|
-
]),
|
9379
|
+
]), J = /* @__PURE__ */ new Set(["p"]), ws = /* @__PURE__ */ new Set(["thead", "tbody"]), Bs = /* @__PURE__ */ new Set(["dd", "dt"]), Us = /* @__PURE__ */ new Set(["rt", "rp"]), th = /* @__PURE__ */ new Map([
|
9380
9380
|
["tr", /* @__PURE__ */ new Set(["tr", "th", "td"])],
|
9381
9381
|
["th", /* @__PURE__ */ new Set(["th"])],
|
9382
9382
|
["td", /* @__PURE__ */ new Set(["thead", "th", "td"])],
|
9383
9383
|
["body", /* @__PURE__ */ new Set(["head", "link", "script"])],
|
9384
9384
|
["li", /* @__PURE__ */ new Set(["li"])],
|
9385
|
-
["p",
|
9386
|
-
["h1",
|
9387
|
-
["h2",
|
9388
|
-
["h3",
|
9389
|
-
["h4",
|
9390
|
-
["h5",
|
9391
|
-
["h6",
|
9385
|
+
["p", J],
|
9386
|
+
["h1", J],
|
9387
|
+
["h2", J],
|
9388
|
+
["h3", J],
|
9389
|
+
["h4", J],
|
9390
|
+
["h5", J],
|
9391
|
+
["h6", J],
|
9392
9392
|
["select", xt],
|
9393
9393
|
["input", xt],
|
9394
9394
|
["output", xt],
|
@@ -9399,27 +9399,27 @@ const xt = /* @__PURE__ */ new Set([
|
|
9399
9399
|
["optgroup", /* @__PURE__ */ new Set(["optgroup", "option"])],
|
9400
9400
|
["dd", Bs],
|
9401
9401
|
["dt", Bs],
|
9402
|
-
["address",
|
9403
|
-
["article",
|
9404
|
-
["aside",
|
9405
|
-
["blockquote",
|
9406
|
-
["details",
|
9407
|
-
["div",
|
9408
|
-
["dl",
|
9409
|
-
["fieldset",
|
9410
|
-
["figcaption",
|
9411
|
-
["figure",
|
9412
|
-
["footer",
|
9413
|
-
["form",
|
9414
|
-
["header",
|
9415
|
-
["hr",
|
9416
|
-
["main",
|
9417
|
-
["nav",
|
9418
|
-
["ol",
|
9419
|
-
["pre",
|
9420
|
-
["section",
|
9421
|
-
["table",
|
9422
|
-
["ul",
|
9402
|
+
["address", J],
|
9403
|
+
["article", J],
|
9404
|
+
["aside", J],
|
9405
|
+
["blockquote", J],
|
9406
|
+
["details", J],
|
9407
|
+
["div", J],
|
9408
|
+
["dl", J],
|
9409
|
+
["fieldset", J],
|
9410
|
+
["figcaption", J],
|
9411
|
+
["figure", J],
|
9412
|
+
["footer", J],
|
9413
|
+
["form", J],
|
9414
|
+
["header", J],
|
9415
|
+
["hr", J],
|
9416
|
+
["main", J],
|
9417
|
+
["nav", J],
|
9418
|
+
["ol", J],
|
9419
|
+
["pre", J],
|
9420
|
+
["section", J],
|
9421
|
+
["table", J],
|
9422
|
+
["ul", J],
|
9423
9423
|
["rt", Us],
|
9424
9424
|
["rp", Us],
|
9425
9425
|
["tbody", ws],
|
@@ -9887,8 +9887,8 @@ const Eh = /* @__PURE__ */ dt(rh, [["render", mh], ["__scopeId", "data-v-dcbfe0e
|
|
9887
9887
|
}
|
9888
9888
|
function B() {
|
9889
9889
|
function O(L) {
|
9890
|
-
const ue = Object.entries(L.attrs || {}).map(([w, q]) => `${w}="${q}"`).join(" "),
|
9891
|
-
return `${
|
9890
|
+
const ue = Object.entries(L.attrs || {}).map(([w, q]) => `${w}="${q}"`).join(" "), _e = `<${L.tag}${ue ? " " + ue : ""}>`, A = `</${L.tag}>`, D = (L.children || []).map((w) => O(w)).join("");
|
9891
|
+
return `${_e}${L.editText || L.text || ""}${D}${A}`;
|
9892
9892
|
}
|
9893
9893
|
return O(a.element);
|
9894
9894
|
}
|
@@ -9906,8 +9906,8 @@ const Eh = /* @__PURE__ */ dt(rh, [["render", mh], ["__scopeId", "data-v-dcbfe0e
|
|
9906
9906
|
} else
|
9907
9907
|
o.value = !1, c.value = "";
|
9908
9908
|
i("updateText", { element: a.element, newText: ue }), i("contentUpdated", B());
|
9909
|
-
const
|
9910
|
-
|
9909
|
+
const _e = nn(a.element);
|
9910
|
+
_e.editText = ue;
|
9911
9911
|
}
|
9912
9912
|
function X(O) {
|
9913
9913
|
i("updateText", O), i("contentUpdated", B());
|
@@ -9934,18 +9934,18 @@ const Eh = /* @__PURE__ */ dt(rh, [["render", mh], ["__scopeId", "data-v-dcbfe0e
|
|
9934
9934
|
i("blockAction", O), i("contentUpdated", B());
|
9935
9935
|
}
|
9936
9936
|
function Ne(O) {
|
9937
|
-
|
9937
|
+
ge.value.openModal(O);
|
9938
9938
|
}
|
9939
9939
|
function Fe(O, L) {
|
9940
9940
|
i("addIcon", O, L), i("contentUpdated", B());
|
9941
9941
|
}
|
9942
9942
|
let Me;
|
9943
|
-
const Pe = G(a.cropper),
|
9943
|
+
const Pe = G(a.cropper), ge = G(a.icon), te = G({});
|
9944
9944
|
function ye(O, L) {
|
9945
9945
|
console.log("files", O, L);
|
9946
9946
|
const ue = O[0];
|
9947
|
-
L.rule.minImageWidth && L.rule.maxImageHeight ? (
|
9948
|
-
|
9947
|
+
L.rule.minImageWidth && L.rule.maxImageHeight ? (te.value.width = L.rule.minImageWidth, te.value.height = L.rule.maxImageHeight, te.value.aspectRatio = L.rule.minImageWidth / L.rule.maxImageHeight) : te.value = {}, ue && (ue.name, Me = ue.thumbUrl, Pe.value.handleOpenCropper(
|
9948
|
+
te.value,
|
9949
9949
|
Me,
|
9950
9950
|
ue.name,
|
9951
9951
|
L
|
@@ -9956,9 +9956,9 @@ const Eh = /* @__PURE__ */ dt(rh, [["render", mh], ["__scopeId", "data-v-dcbfe0e
|
|
9956
9956
|
if (typeof O == "object") {
|
9957
9957
|
L.attrs.alt = O.name;
|
9958
9958
|
const ue = new FileReader();
|
9959
|
-
ue.onload = (
|
9959
|
+
ue.onload = (_e) => {
|
9960
9960
|
var D;
|
9961
|
-
let A = (D =
|
9961
|
+
let A = (D = _e == null ? void 0 : _e.target) == null ? void 0 : D.result;
|
9962
9962
|
L.attrs.src = A, i("upload", A, L), i("contentUpdated", B());
|
9963
9963
|
}, ue.readAsDataURL(O);
|
9964
9964
|
} else
|
@@ -9994,12 +9994,12 @@ const Eh = /* @__PURE__ */ dt(rh, [["render", mh], ["__scopeId", "data-v-dcbfe0e
|
|
9994
9994
|
default: Ca(() => [
|
9995
9995
|
oi(Se(a.element.text), 1),
|
9996
9996
|
a.element.children && a.element.children.length ? (v(), M(jt, { key: 0 }, [
|
9997
|
-
(v(!0), M(jt, null, Ri(a.element.children, (
|
9997
|
+
(v(!0), M(jt, null, Ri(a.element.children, (_e, A) => (v(), _t(ue, {
|
9998
9998
|
mode: e.mode,
|
9999
9999
|
icons: e.icons,
|
10000
10000
|
r: e.r,
|
10001
10001
|
key: A,
|
10002
|
-
element:
|
10002
|
+
element: _e,
|
10003
10003
|
selectedElement: a.selectedElement,
|
10004
10004
|
hoveredElement: a.hoveredElement,
|
10005
10005
|
onSelectElement: T,
|
@@ -10057,7 +10057,7 @@ const Eh = /* @__PURE__ */ dt(rh, [["render", mh], ["__scopeId", "data-v-dcbfe0e
|
|
10057
10057
|
st(Eh, {
|
10058
10058
|
multiple: !1,
|
10059
10059
|
beforeUpload: Ze,
|
10060
|
-
onChange: L[4] || (L[4] = (
|
10060
|
+
onChange: L[4] || (L[4] = (_e) => ye(_e, a.element))
|
10061
10061
|
}, {
|
10062
10062
|
"upload-icon": Ca(() => L[6] || (L[6] = [
|
10063
10063
|
x("div", { class: "p-2" }, "上传", -1)
|
@@ -10241,7 +10241,7 @@ const Ph = () => {
|
|
10241
10241
|
t !== -1 && yt.splice(t, 1);
|
10242
10242
|
};
|
10243
10243
|
let wh = 0;
|
10244
|
-
const
|
10244
|
+
const ee = (e) => {
|
10245
10245
|
kh();
|
10246
10246
|
const t = wh++;
|
10247
10247
|
yt.push({
|
@@ -10251,32 +10251,32 @@ const J = (e) => {
|
|
10251
10251
|
Iu(t);
|
10252
10252
|
}, e.duration || 3e3);
|
10253
10253
|
};
|
10254
|
-
|
10255
|
-
|
10254
|
+
ee.success = (e, t = 3e3, a = !0) => {
|
10255
|
+
ee(typeof e == "string" ? {
|
10256
10256
|
message: e,
|
10257
10257
|
type: "success",
|
10258
10258
|
duration: t,
|
10259
10259
|
icon: a
|
10260
10260
|
} : { ...e, type: "success" });
|
10261
10261
|
};
|
10262
|
-
|
10263
|
-
|
10262
|
+
ee.error = (e, t = 3e3, a = !0) => {
|
10263
|
+
ee(typeof e == "string" ? {
|
10264
10264
|
message: e,
|
10265
10265
|
type: "error",
|
10266
10266
|
duration: t,
|
10267
10267
|
icon: a
|
10268
10268
|
} : { ...e, type: "error" });
|
10269
10269
|
};
|
10270
|
-
|
10271
|
-
|
10270
|
+
ee.info = (e, t = 3e3, a = !0) => {
|
10271
|
+
ee(typeof e == "string" ? {
|
10272
10272
|
message: e,
|
10273
10273
|
type: "info",
|
10274
10274
|
duration: t,
|
10275
10275
|
icon: a
|
10276
10276
|
} : { ...e, type: "info" });
|
10277
10277
|
};
|
10278
|
-
|
10279
|
-
|
10278
|
+
ee.warning = (e, t = 3e3, a = !0) => {
|
10279
|
+
ee(typeof e == "string" ? {
|
10280
10280
|
message: e,
|
10281
10281
|
type: "warning",
|
10282
10282
|
duration: t,
|
@@ -10300,42 +10300,42 @@ const Bh = { key: 0 }, Uh = { key: 0 }, Fh = { class: "text-gray-500 my-2" }, Hh
|
|
10300
10300
|
);
|
10301
10301
|
function u() {
|
10302
10302
|
if (s.value.type === z.Icon && !s.value.attrs.class.includes("iconfont")) {
|
10303
|
-
|
10303
|
+
ee.error("图标仅支持 iconfont 图标");
|
10304
10304
|
return;
|
10305
10305
|
}
|
10306
10306
|
if (s.value.type === z.Image && s.value.tag !== "img") {
|
10307
|
-
|
10307
|
+
ee.error("节点类型错误");
|
10308
10308
|
return;
|
10309
10309
|
}
|
10310
10310
|
if (s.value.type === z.Video && s.value.tag !== "video") {
|
10311
|
-
|
10311
|
+
ee.error("节点类型错误");
|
10312
10312
|
return;
|
10313
10313
|
}
|
10314
10314
|
if (s.value.type === z.Link && s.value.tag !== "a") {
|
10315
|
-
|
10315
|
+
ee.error("节点类型错误");
|
10316
10316
|
return;
|
10317
10317
|
}
|
10318
10318
|
if (s.value.type === z.Text) {
|
10319
10319
|
if (s.value.rule.minText > s.value.rule.maxText) {
|
10320
|
-
|
10320
|
+
ee.error("最小文本长度不能大于最大文本长度");
|
10321
10321
|
return;
|
10322
10322
|
}
|
10323
10323
|
if (s.value.tag !== "p" && s.value.tag !== "div" && s.value.tag !== "span" && s.value.tag !== "h1" && s.value.tag !== "h2" && s.value.tag !== "h3" && s.value.tag !== "h4" && s.value.tag !== "h5" && s.value.tag !== "h6") {
|
10324
|
-
|
10324
|
+
ee.error("节点类型错误");
|
10325
10325
|
return;
|
10326
10326
|
}
|
10327
10327
|
}
|
10328
10328
|
if (s.value.type === z.Block) {
|
10329
10329
|
if (s.value.rule.minBlock > s.value.rule.maxBlock) {
|
10330
|
-
|
10330
|
+
ee.error("最小块数量不能大于最大块数量");
|
10331
10331
|
return;
|
10332
10332
|
}
|
10333
10333
|
if (s.value.tag !== "div" && s.value.tag !== "section" && s.value.tag !== "article" && s.value.tag !== "nav" && s.value.tag !== "header" && s.value.tag !== "footer" && s.value.tag !== "span" && s.value.tag !== "p" && s.value.tag !== "img") {
|
10334
|
-
|
10334
|
+
ee.error("节点类型错误");
|
10335
10335
|
return;
|
10336
10336
|
}
|
10337
10337
|
if (!s.value.children || s.value.children.length < 1) {
|
10338
|
-
|
10338
|
+
ee.error("节点错误,必须包含子元素");
|
10339
10339
|
return;
|
10340
10340
|
}
|
10341
10341
|
}
|
@@ -10688,7 +10688,7 @@ var gf = Array.prototype.slice;
|
|
10688
10688
|
function ku(e) {
|
10689
10689
|
return Array.from ? Array.from(e) : gf.call(e);
|
10690
10690
|
}
|
10691
|
-
function
|
10691
|
+
function de(e, t) {
|
10692
10692
|
return e && Oe(t) && (Array.isArray(e) || W(e.length) ? ku(e).forEach(function(a, i) {
|
10693
10693
|
t.call(e, a, i, e);
|
10694
10694
|
}) : Ct(e) && Object.keys(e).forEach(function(a) {
|
@@ -10711,18 +10711,18 @@ function Rt(e) {
|
|
10711
10711
|
var Af = /^width|height|left|top|marginLeft|marginTop$/;
|
10712
10712
|
function rt(e, t) {
|
10713
10713
|
var a = e.style;
|
10714
|
-
|
10714
|
+
de(t, function(i, s) {
|
10715
10715
|
Af.test(s) && W(i) && (i = "".concat(i, "px")), a[s] = i;
|
10716
10716
|
});
|
10717
10717
|
}
|
10718
10718
|
function Nf(e, t) {
|
10719
10719
|
return e.classList ? e.classList.contains(t) : e.className.indexOf(t) > -1;
|
10720
10720
|
}
|
10721
|
-
function
|
10721
|
+
function Te(e, t) {
|
10722
10722
|
if (t) {
|
10723
10723
|
if (W(e.length)) {
|
10724
|
-
|
10725
|
-
|
10724
|
+
de(e, function(i) {
|
10725
|
+
Te(i, t);
|
10726
10726
|
});
|
10727
10727
|
return;
|
10728
10728
|
}
|
@@ -10737,7 +10737,7 @@ function Ee(e, t) {
|
|
10737
10737
|
function Ge(e, t) {
|
10738
10738
|
if (t) {
|
10739
10739
|
if (W(e.length)) {
|
10740
|
-
|
10740
|
+
de(e, function(a) {
|
10741
10741
|
Ge(a, t);
|
10742
10742
|
});
|
10743
10743
|
return;
|
@@ -10752,12 +10752,12 @@ function Ge(e, t) {
|
|
10752
10752
|
function vt(e, t, a) {
|
10753
10753
|
if (t) {
|
10754
10754
|
if (W(e.length)) {
|
10755
|
-
|
10755
|
+
de(e, function(i) {
|
10756
10756
|
vt(i, t, a);
|
10757
10757
|
});
|
10758
10758
|
return;
|
10759
10759
|
}
|
10760
|
-
a ?
|
10760
|
+
a ? Te(e, t) : Ge(e, t);
|
10761
10761
|
}
|
10762
10762
|
}
|
10763
10763
|
var Cf = /([a-z\d])([A-Z])/g;
|
@@ -10868,8 +10868,8 @@ function aa(e) {
|
|
10868
10868
|
}
|
10869
10869
|
function xf(e) {
|
10870
10870
|
var t = Su({}, e), a = 0;
|
10871
|
-
return
|
10872
|
-
delete t[s],
|
10871
|
+
return de(e, function(i, s) {
|
10872
|
+
delete t[s], de(t, function(u) {
|
10873
10873
|
var r = Math.abs(i.startX - u.startX), o = Math.abs(i.startY - u.startY), c = Math.abs(i.endX - u.endX), d = Math.abs(i.endY - u.endY), f = Math.sqrt(r * r + o * o), E = Math.sqrt(c * c + d * d), T = (E - f) / f;
|
10874
10874
|
Math.abs(T) > Math.abs(a) && (a = T);
|
10875
10875
|
});
|
@@ -10887,7 +10887,7 @@ function _a(e, t) {
|
|
10887
10887
|
}
|
10888
10888
|
function Of(e) {
|
10889
10889
|
var t = 0, a = 0, i = 0;
|
10890
|
-
return
|
10890
|
+
return de(e, function(s) {
|
10891
10891
|
var u = s.startX, r = s.startY;
|
10892
10892
|
t += u, a += r, i += 1;
|
10893
10893
|
}), t /= i, a /= i, {
|
@@ -10923,7 +10923,7 @@ function Df(e) {
|
|
10923
10923
|
};
|
10924
10924
|
}
|
10925
10925
|
function vf(e, t, a, i) {
|
10926
|
-
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, _ = a.aspectRatio, C = a.naturalWidth, y = a.naturalHeight, P = i.fillColor, B = P === void 0 ? "transparent" : P, Q = i.imageSmoothingEnabled, X = Q === void 0 ? !0 : Q, ne = i.imageSmoothingQuality, Y = ne === void 0 ? "low" : ne, g = i.maxWidth, F = g === void 0 ? 1 / 0 : g, $ = i.maxHeight, ce = $ === void 0 ? 1 / 0 : $, Ne = i.minWidth, Fe = Ne === void 0 ? 0 : Ne, Me = i.minHeight, Pe = Me === void 0 ? 0 : Me,
|
10926
|
+
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, _ = a.aspectRatio, C = a.naturalWidth, y = a.naturalHeight, P = i.fillColor, B = P === void 0 ? "transparent" : P, Q = i.imageSmoothingEnabled, X = Q === void 0 ? !0 : Q, ne = i.imageSmoothingQuality, Y = ne === void 0 ? "low" : ne, g = i.maxWidth, F = g === void 0 ? 1 / 0 : g, $ = i.maxHeight, ce = $ === void 0 ? 1 / 0 : $, Ne = i.minWidth, Fe = Ne === void 0 ? 0 : Ne, Me = i.minHeight, Pe = Me === void 0 ? 0 : Me, ge = document.createElement("canvas"), te = ge.getContext("2d"), ye = ot({
|
10927
10927
|
aspectRatio: _,
|
10928
10928
|
width: F,
|
10929
10929
|
height: ce
|
@@ -10939,10 +10939,10 @@ function vf(e, t, a, i) {
|
|
10939
10939
|
aspectRatio: s,
|
10940
10940
|
width: Fe,
|
10941
10941
|
height: Pe
|
10942
|
-
}, "cover"),
|
10943
|
-
return
|
10942
|
+
}, "cover"), _e = Math.min(L.width, Math.max(ue.width, u)), A = Math.min(L.height, Math.max(ue.height, r)), D = [-_e / 2, -A / 2, _e, A];
|
10943
|
+
return ge.width = Rt(Ze), ge.height = Rt(O), te.fillStyle = B, te.fillRect(0, 0, Ze, O), te.save(), te.translate(Ze / 2, O / 2), te.rotate(c * Math.PI / 180), te.scale(f, T), te.imageSmoothingEnabled = X, te.imageSmoothingQuality = Y, te.drawImage.apply(te, [e].concat(Ou(D.map(function(w) {
|
10944
10944
|
return Math.floor(Rt(w));
|
10945
|
-
})))),
|
10945
|
+
})))), te.restore(), ge;
|
10946
10946
|
}
|
10947
10947
|
var Fu = String.fromCharCode;
|
10948
10948
|
function Lf(e, t, a) {
|
@@ -10955,7 +10955,7 @@ function Lf(e, t, a) {
|
|
10955
10955
|
var yf = /^data:.*,/;
|
10956
10956
|
function Rf(e) {
|
10957
10957
|
var t = e.replace(yf, ""), a = atob(t), i = new ArrayBuffer(a.length), s = new Uint8Array(i);
|
10958
|
-
return
|
10958
|
+
return de(s, function(u, r) {
|
10959
10959
|
s[r] = a.charCodeAt(r);
|
10960
10960
|
}), i;
|
10961
10961
|
}
|
@@ -11036,7 +11036,7 @@ var wf = {
|
|
11036
11036
|
},
|
11037
11037
|
initContainer: function() {
|
11038
11038
|
var t = this.element, a = this.options, i = this.container, s = this.cropper, u = Number(a.minContainerWidth), r = Number(a.minContainerHeight);
|
11039
|
-
|
11039
|
+
Te(s, ve), Ge(t, ve);
|
11040
11040
|
var o = {
|
11041
11041
|
width: Math.max(i.offsetWidth, u >= 0 ? u : Mu),
|
11042
11042
|
height: Math.max(i.offsetHeight, r >= 0 ? r : Pu)
|
@@ -11044,7 +11044,7 @@ var wf = {
|
|
11044
11044
|
this.containerData = o, rt(s, {
|
11045
11045
|
width: o.width,
|
11046
11046
|
height: o.height
|
11047
|
-
}),
|
11047
|
+
}), Te(t, ve), Ge(s, ve);
|
11048
11048
|
},
|
11049
11049
|
// Canvas (image wrapper)
|
11050
11050
|
initCanvas: function() {
|
@@ -11144,7 +11144,7 @@ var wf = {
|
|
11144
11144
|
var t = this.element, a = this.crossOrigin, i = this.options.preview, s = a ? this.crossOriginUrl : this.url, u = t.alt || "The image to preview", r = document.createElement("img");
|
11145
11145
|
if (a && (r.crossOrigin = a), r.src = s, r.alt = u, this.viewBox.appendChild(r), this.viewBoxImage = r, !!i) {
|
11146
11146
|
var o = i;
|
11147
|
-
typeof i == "string" ? o = t.ownerDocument.querySelectorAll(i) : i.querySelector && (o = [i]), this.previews = o,
|
11147
|
+
typeof i == "string" ? o = t.ownerDocument.querySelectorAll(i) : i.querySelector && (o = [i]), this.previews = o, de(o, function(c) {
|
11148
11148
|
var d = document.createElement("img");
|
11149
11149
|
la(c, ga, {
|
11150
11150
|
width: c.offsetWidth,
|
@@ -11155,7 +11155,7 @@ var wf = {
|
|
11155
11155
|
}
|
11156
11156
|
},
|
11157
11157
|
resetPreview: function() {
|
11158
|
-
|
11158
|
+
de(this.previews, function(t) {
|
11159
11159
|
var a = yi(t, ga);
|
11160
11160
|
rt(t, {
|
11161
11161
|
width: a.width,
|
@@ -11171,7 +11171,7 @@ var wf = {
|
|
11171
11171
|
}, aa(se({
|
11172
11172
|
translateX: -c,
|
11173
11173
|
translateY: -d
|
11174
|
-
}, t)))),
|
11174
|
+
}, t)))), de(this.previews, function(f) {
|
11175
11175
|
var E = yi(f, ga), T = E.width, _ = E.height, C = T, y = _, P = 1;
|
11176
11176
|
s && (P = T / s, y = u * P), u && y > _ && (P = _ / u, C = s * P, y = _), rt(f, {
|
11177
11177
|
width: C,
|
@@ -11206,9 +11206,9 @@ var wf = {
|
|
11206
11206
|
var t = this.options, a = this.container, i = this.containerData, s = a.offsetWidth / i.width, u = a.offsetHeight / i.height, r = Math.abs(s - 1) > Math.abs(u - 1) ? s : u;
|
11207
11207
|
if (r !== 1) {
|
11208
11208
|
var o, c;
|
11209
|
-
t.restore && (o = this.getCanvasData(), c = this.getCropBoxData()), this.render(), t.restore && (this.setCanvasData(
|
11209
|
+
t.restore && (o = this.getCanvasData(), c = this.getCropBoxData()), this.render(), t.restore && (this.setCanvasData(de(o, function(d, f) {
|
11210
11210
|
o[f] = d * r;
|
11211
|
-
})), this.setCropBoxData(
|
11211
|
+
})), this.setCropBoxData(de(c, function(d, f) {
|
11212
11212
|
c[f] = d * r;
|
11213
11213
|
})));
|
11214
11214
|
}
|
@@ -11228,12 +11228,12 @@ var wf = {
|
|
11228
11228
|
if (!(this.disabled || (t.type === "mousedown" || t.type === "pointerdown" && t.pointerType === "mouse") && // No primary button (Usually the left button)
|
11229
11229
|
(W(a) && a !== 1 || W(i) && i !== 0 || t.ctrlKey))) {
|
11230
11230
|
var s = this.options, u = this.pointers, r;
|
11231
|
-
t.changedTouches ?
|
11231
|
+
t.changedTouches ? de(t.changedTouches, function(o) {
|
11232
11232
|
u[o.identifier] = _a(o);
|
11233
11233
|
}) : u[t.pointerId || 0] = _a(t), Object.keys(u).length > 1 && s.zoomable && s.zoomOnTouch ? r = Lu : r = yi(t.target, ca), hf.test(r) && Mt(this.element, vi, {
|
11234
11234
|
originalEvent: t,
|
11235
11235
|
action: r
|
11236
|
-
}) !== !1 && (t.preventDefault(), this.action = r, this.cropping = !1, r === Du && (this.cropping = !0,
|
11236
|
+
}) !== !1 && (t.preventDefault(), this.action = r, this.cropping = !1, r === Du && (this.cropping = !0, Te(this.dragBox, ka)));
|
11237
11237
|
}
|
11238
11238
|
},
|
11239
11239
|
cropMove: function(t) {
|
@@ -11243,7 +11243,7 @@ var wf = {
|
|
11243
11243
|
t.preventDefault(), Mt(this.element, Di, {
|
11244
11244
|
originalEvent: t,
|
11245
11245
|
action: a
|
11246
|
-
}) !== !1 && (t.changedTouches ?
|
11246
|
+
}) !== !1 && (t.changedTouches ? de(t.changedTouches, function(s) {
|
11247
11247
|
se(i[s.identifier] || {}, _a(s, !0));
|
11248
11248
|
}) : se(i[t.pointerId || 0] || {}, _a(t, !0)), this.change(t));
|
11249
11249
|
}
|
@@ -11251,7 +11251,7 @@ var wf = {
|
|
11251
11251
|
cropEnd: function(t) {
|
11252
11252
|
if (!this.disabled) {
|
11253
11253
|
var a = this.action, i = this.pointers;
|
11254
|
-
t.changedTouches ?
|
11254
|
+
t.changedTouches ? de(t.changedTouches, function(s) {
|
11255
11255
|
delete i[s.identifier];
|
11256
11256
|
}) : delete i[t.pointerId || 0], a && (t.preventDefault(), Object.keys(i).length || (this.action = ""), this.cropping && (this.cropping = !1, vt(this.dragBox, ka, this.cropped && this.options.modal)), Mt(this.element, Oi, {
|
11257
11257
|
originalEvent: t,
|
@@ -11372,14 +11372,14 @@ var wf = {
|
|
11372
11372
|
ne = Uu(this.cropper), d = Y.startX - ne.left, f = Y.startY - ne.top, E = u.minWidth, T = u.minHeight, g.x > 0 ? o = g.y > 0 ? Wt : Vt : g.x < 0 && (d -= E, o = g.y > 0 ? Gt : $t), g.y < 0 && (f -= T), this.cropped || (Ge(this.cropBox, ve), this.cropped = !0, this.limited && this.limitCropBox(!0, !0));
|
11373
11373
|
break;
|
11374
11374
|
}
|
11375
|
-
X && (u.width = E, u.height = T, u.left = d, u.top = f, this.action = o, this.renderCropBox()),
|
11375
|
+
X && (u.width = E, u.height = T, u.left = d, u.top = f, this.action = o, this.renderCropBox()), de(r, function($) {
|
11376
11376
|
$.startX = $.endX, $.startY = $.endY;
|
11377
11377
|
});
|
11378
11378
|
}
|
11379
11379
|
}, Yf = {
|
11380
11380
|
// Show the crop box manually
|
11381
11381
|
crop: function() {
|
11382
|
-
return this.ready && !this.cropped && !this.disabled && (this.cropped = !0, this.limitCropBox(!0, !0), this.options.modal &&
|
11382
|
+
return this.ready && !this.cropped && !this.disabled && (this.cropped = !0, this.limitCropBox(!0, !0), this.options.modal && Te(this.dragBox, ka), Ge(this.cropBox, ve), this.setCropBoxData(this.initialCropBoxData)), this;
|
11383
11383
|
},
|
11384
11384
|
// Reset the image and crop box to their initial states
|
11385
11385
|
reset: function() {
|
@@ -11392,7 +11392,7 @@ var wf = {
|
|
11392
11392
|
top: 0,
|
11393
11393
|
width: 0,
|
11394
11394
|
height: 0
|
11395
|
-
}), this.cropped = !1, this.renderCropBox(), this.limitCanvas(!0, !0), this.renderCanvas(), Ge(this.dragBox, ka),
|
11395
|
+
}), this.cropped = !1, this.renderCropBox(), this.limitCanvas(!0, !0), this.renderCanvas(), Ge(this.dragBox, ka), Te(this.cropBox, ve)), this;
|
11396
11396
|
},
|
11397
11397
|
/**
|
11398
11398
|
* Replace the image's src and rebuild the cropper
|
@@ -11402,7 +11402,7 @@ var wf = {
|
|
11402
11402
|
*/
|
11403
11403
|
replace: function(t) {
|
11404
11404
|
var a = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
|
11405
|
-
return !this.disabled && t && (this.isImg && (this.element.src = t), a ? (this.url = t, this.image.src = t, this.ready && (this.viewBoxImage.src = t,
|
11405
|
+
return !this.disabled && t && (this.isImg && (this.element.src = t), a ? (this.url = t, this.image.src = t, this.ready && (this.viewBoxImage.src = t, de(this.previews, function(i) {
|
11406
11406
|
i.getElementsByTagName("img")[0].src = t;
|
11407
11407
|
}))) : (this.isImg && (this.replaced = !0), this.options.data = null, this.uncreate(), this.load(t))), this;
|
11408
11408
|
},
|
@@ -11412,7 +11412,7 @@ var wf = {
|
|
11412
11412
|
},
|
11413
11413
|
// Disable (freeze) the cropper
|
11414
11414
|
disable: function() {
|
11415
|
-
return this.ready && !this.disabled && (this.disabled = !0,
|
11415
|
+
return this.ready && !this.disabled && (this.disabled = !0, Te(this.cropper, $s)), this;
|
11416
11416
|
},
|
11417
11417
|
/**
|
11418
11418
|
* Destroy the cropper and remove the instance from the image
|
@@ -11539,7 +11539,7 @@ var wf = {
|
|
11539
11539
|
height: u.height
|
11540
11540
|
};
|
11541
11541
|
var o = i.width / i.naturalWidth;
|
11542
|
-
if (
|
11542
|
+
if (de(r, function(f, E) {
|
11543
11543
|
r[E] = f / o;
|
11544
11544
|
}), t) {
|
11545
11545
|
var c = Math.round(r.y + r.height), d = Math.round(r.x + r.width);
|
@@ -11589,7 +11589,7 @@ var wf = {
|
|
11589
11589
|
*/
|
11590
11590
|
getCanvasData: function() {
|
11591
11591
|
var t = this.canvasData, a = {};
|
11592
|
-
return this.ready &&
|
11592
|
+
return this.ready && de(["left", "top", "width", "height", "naturalWidth", "naturalHeight"], function(i) {
|
11593
11593
|
a[i] = t[i];
|
11594
11594
|
}), a;
|
11595
11595
|
},
|
@@ -11656,14 +11656,14 @@ var wf = {
|
|
11656
11656
|
P.width = Rt(C), P.height = Rt(y), B.fillStyle = t.fillColor || "transparent", B.fillRect(0, 0, C, y);
|
11657
11657
|
var Q = t.imageSmoothingEnabled, X = Q === void 0 ? !0 : Q, ne = t.imageSmoothingQuality;
|
11658
11658
|
B.imageSmoothingEnabled = X, ne && (B.imageSmoothingQuality = ne);
|
11659
|
-
var Y = i.width, g = i.height, F = u, $ = r, ce, Ne, Fe, Me, Pe,
|
11660
|
-
F <= -o || F > Y ? (F = 0, ce = 0, Fe = 0, Pe = 0) : F <= 0 ? (Fe = -F, F = 0, ce = Math.min(Y, o + F), Pe = ce) : F <= Y && (Fe = 0, ce = Math.min(o, Y - F), Pe = ce), ce <= 0 || $ <= -c || $ > g ? ($ = 0, Ne = 0, Me = 0,
|
11661
|
-
var
|
11662
|
-
if (Pe > 0 &&
|
11659
|
+
var Y = i.width, g = i.height, F = u, $ = r, ce, Ne, Fe, Me, Pe, ge;
|
11660
|
+
F <= -o || F > Y ? (F = 0, ce = 0, Fe = 0, Pe = 0) : F <= 0 ? (Fe = -F, F = 0, ce = Math.min(Y, o + F), Pe = ce) : F <= Y && (Fe = 0, ce = Math.min(o, Y - F), Pe = ce), ce <= 0 || $ <= -c || $ > g ? ($ = 0, Ne = 0, Me = 0, ge = 0) : $ <= 0 ? (Me = -$, $ = 0, Ne = Math.min(g, c + $), ge = Ne) : $ <= g && (Me = 0, Ne = Math.min(c, g - $), ge = Ne);
|
11661
|
+
var te = [F, $, ce, Ne];
|
11662
|
+
if (Pe > 0 && ge > 0) {
|
11663
11663
|
var ye = C / o;
|
11664
|
-
|
11664
|
+
te.push(Fe * ye, Me * ye, Pe * ye, ge * ye);
|
11665
11665
|
}
|
11666
|
-
return B.drawImage.apply(B, [i].concat(Ou(
|
11666
|
+
return B.drawImage.apply(B, [i].concat(Ou(te.map(function(He) {
|
11667
11667
|
return Math.floor(Rt(He));
|
11668
11668
|
})))), P;
|
11669
11669
|
},
|
@@ -11751,7 +11751,7 @@ var wf = {
|
|
11751
11751
|
var a = this.element, i = this.url, s = a.crossOrigin, u = i;
|
11752
11752
|
this.options.checkCrossOrigin && an(i) && (s || (s = "anonymous"), u = sn(i)), this.crossOrigin = s, this.crossOriginUrl = u;
|
11753
11753
|
var r = document.createElement("img");
|
11754
|
-
s && (r.crossOrigin = s), r.src = u || i, r.alt = a.alt || "The image to crop", this.image = r, r.onload = this.start.bind(this), r.onerror = this.stop.bind(this),
|
11754
|
+
s && (r.crossOrigin = s), r.src = u || i, r.alt = a.alt || "The image to crop", this.image = r, r.onload = this.start.bind(this), r.onerror = this.stop.bind(this), Te(r, Ws), a.parentNode.insertBefore(r, a.nextSibling);
|
11755
11755
|
}
|
11756
11756
|
}, {
|
11757
11757
|
key: "start",
|
@@ -11787,7 +11787,7 @@ var wf = {
|
|
11787
11787
|
var a = this.element, i = this.options, s = this.image, u = a.parentNode, r = document.createElement("div");
|
11788
11788
|
r.innerHTML = Tf;
|
11789
11789
|
var o = r.querySelector(".".concat(ie, "-container")), c = o.querySelector(".".concat(ie, "-canvas")), d = o.querySelector(".".concat(ie, "-drag-box")), f = o.querySelector(".".concat(ie, "-crop-box")), E = f.querySelector(".".concat(ie, "-face"));
|
11790
|
-
this.container = u, this.cropper = o, this.canvas = c, this.dragBox = d, this.cropBox = f, this.viewBox = o.querySelector(".".concat(ie, "-view-box")), this.face = E, c.appendChild(s),
|
11790
|
+
this.container = u, this.cropper = o, this.canvas = c, this.dragBox = d, this.cropBox = f, this.viewBox = o.querySelector(".".concat(ie, "-view-box")), this.face = E, c.appendChild(s), Te(a, ve), u.insertBefore(o, a.nextSibling), Ge(s, Ws), this.initPreview(), this.bind(), i.initialAspectRatio = Math.max(0, i.initialAspectRatio) || NaN, i.aspectRatio = Math.max(0, i.aspectRatio) || NaN, i.viewMode = Math.max(0, Math.min(3, Math.round(i.viewMode))) || 0, Te(f, ve), i.guides || Te(f.getElementsByClassName("".concat(ie, "-dashed")), ve), i.center || Te(f.getElementsByClassName("".concat(ie, "-center")), ve), i.background && Te(o, "".concat(ie, "-bg")), i.highlight || Te(E, of), i.cropBoxMovable && (Te(E, Si), la(E, ca, ss)), i.cropBoxResizable || (Te(f.getElementsByClassName("".concat(ie, "-line")), ve), Te(f.getElementsByClassName("".concat(ie, "-point")), ve)), this.render(), this.ready = !0, this.setDragMode(i.dragMode), i.autoCrop && this.crop(), this.setData(i.data), Oe(i.ready) && ke(a, zs, i.ready, {
|
11791
11791
|
once: !0
|
11792
11792
|
}), Mt(a, zs);
|
11793
11793
|
}
|
@@ -11827,7 +11827,15 @@ var wf = {
|
|
11827
11827
|
}]);
|
11828
11828
|
}();
|
11829
11829
|
se(Hu.prototype, wf, Bf, Uf, Ff, Hf, Yf);
|
11830
|
-
function Vf(e
|
11830
|
+
function Vf(e) {
|
11831
|
+
const t = e.split(","), a = t[0], i = a && a.match && a.match(/:(.*?);/) && a.match(/:(.*?);/)[1], s = t[1] && atob(t[1]);
|
11832
|
+
let u = s == null ? void 0 : s.length;
|
11833
|
+
const r = new Uint8Array(u);
|
11834
|
+
for (; u--; )
|
11835
|
+
r[u] = s == null ? void 0 : s.charCodeAt(u);
|
11836
|
+
return new Blob([r], { type: i });
|
11837
|
+
}
|
11838
|
+
function $f(e, t) {
|
11831
11839
|
const a = e.split(",") || [], i = a[0].match(/:(.*?);/)[1], s = a[1] && atob(a[1]);
|
11832
11840
|
let u = s && s.length;
|
11833
11841
|
const r = new Uint8Array(u);
|
@@ -11835,17 +11843,17 @@ function Vf(e, t) {
|
|
11835
11843
|
r[u] = s == null ? void 0 : s.charCodeAt(u);
|
11836
11844
|
return new File([r], t, { type: i });
|
11837
11845
|
}
|
11838
|
-
const
|
11846
|
+
const Wf = {
|
11839
11847
|
key: 0,
|
11840
11848
|
contenteditable: "false",
|
11841
11849
|
class: "z-10 w-[100vw] h-[100vh] bg-[rgba(0,0,0,0.7)] flex flex-col justify-center items-center fixed top-0 left-0 cursor-auto"
|
11842
|
-
},
|
11850
|
+
}, Gf = { class: "w-[700px] flex flex-col bg-white rounded pb-8" }, Xf = { class: "flex flex-row items-center justify-between px-6 py-4 bg-[#f4f8ff]" }, Qf = { class: "flex flex-col h-full" }, jf = { class: "flex flex-row justify-center items-start flex-1" }, zf = { class: "flex flex-col items-start flex-1" }, Kf = { class: "flex flex-col w-full px-6 py-4" }, Zf = { class: "flex flex-col w-full" }, Jf = { class: "flex flex-row items-center" }, e1 = { class: "relative bg-[#474AFF] text-white rounded p-3" }, t1 = { class: "flex flex-row items-start justify-between mt-3" }, a1 = { class: "flex flex-col" }, i1 = { class: "flex flex-col justify-center items-center border w-[300px] h-[300px]" }, s1 = {
|
11843
11851
|
key: 0,
|
11844
11852
|
class: "w-full text-center"
|
11845
|
-
},
|
11853
|
+
}, n1 = ["src"], u1 = {
|
11846
11854
|
class: "flex flex-col items-center",
|
11847
11855
|
style: { width: "300px", height: "300px" }
|
11848
|
-
},
|
11856
|
+
}, r1 = { class: "text-[#999] mt-05 flex justify-center mt-4" }, o1 = { class: "w-full flex justify-end space-x-5 mt-5 px-6" }, c1 = ["loading"], l1 = /* @__PURE__ */ Qe({
|
11849
11857
|
__name: "index",
|
11850
11858
|
emits: ["cancel", "ok"],
|
11851
11859
|
setup(e, { expose: t, emit: a }) {
|
@@ -11949,7 +11957,7 @@ const $f = {
|
|
11949
11957
|
width: (F = u.value) == null ? void 0 : F.width
|
11950
11958
|
// 输出图片的宽
|
11951
11959
|
}).toDataURL(d.value);
|
11952
|
-
const Y =
|
11960
|
+
const Y = $f(
|
11953
11961
|
c.value.afterImg,
|
11954
11962
|
s.value.inputValue
|
11955
11963
|
);
|
@@ -11966,22 +11974,22 @@ const $f = {
|
|
11966
11974
|
}
|
11967
11975
|
return t({ handleCloseCropper: P, handleOpenCropper: y }), (Y, g) => {
|
11968
11976
|
var F, $, ce;
|
11969
|
-
return _.value ? (v(), M("div",
|
11970
|
-
x("div",
|
11971
|
-
x("div",
|
11977
|
+
return _.value ? (v(), M("div", Wf, [
|
11978
|
+
x("div", Gf, [
|
11979
|
+
x("div", Xf, [
|
11972
11980
|
g[1] || (g[1] = x("span", { class: "text-base font-semibold text-[#333]" }, "图片裁剪", -1)),
|
11973
11981
|
x("span", {
|
11974
11982
|
class: "text-lg cursor-pointer text-[#999] iconfont icon-shanchu2",
|
11975
11983
|
onClick: we(Q, ["stop"])
|
11976
11984
|
})
|
11977
11985
|
]),
|
11978
|
-
x("div",
|
11979
|
-
x("div",
|
11980
|
-
x("div",
|
11981
|
-
x("div",
|
11982
|
-
x("div",
|
11983
|
-
x("div",
|
11984
|
-
x("div",
|
11986
|
+
x("div", Qf, [
|
11987
|
+
x("div", jf, [
|
11988
|
+
x("div", zf, [
|
11989
|
+
x("div", Kf, [
|
11990
|
+
x("div", Zf, [
|
11991
|
+
x("div", Jf, [
|
11992
|
+
x("div", e1, [
|
11985
11993
|
x("input", {
|
11986
11994
|
type: "file",
|
11987
11995
|
accept: "image/*",
|
@@ -11999,33 +12007,33 @@ const $f = {
|
|
11999
12007
|
]),
|
12000
12008
|
g[3] || (g[3] = x("span", { class: "text-sm text-[#999] ml-3" }, "滚动鼠标放大或缩小图片", -1))
|
12001
12009
|
]),
|
12002
|
-
x("div",
|
12003
|
-
x("div",
|
12004
|
-
x("div",
|
12005
|
-
c.value.image ? H("", !0) : (v(), M("div",
|
12010
|
+
x("div", t1, [
|
12011
|
+
x("div", a1, [
|
12012
|
+
x("div", i1, [
|
12013
|
+
c.value.image ? H("", !0) : (v(), M("div", s1, " 请上传图片 ")),
|
12006
12014
|
x("img", {
|
12007
12015
|
id: "imgId",
|
12008
12016
|
src: c.value.image,
|
12009
12017
|
style: { width: "300px" }
|
12010
|
-
}, null, 8,
|
12018
|
+
}, null, 8, n1)
|
12011
12019
|
])
|
12012
12020
|
]),
|
12013
|
-
x("div",
|
12021
|
+
x("div", u1, [
|
12014
12022
|
g[4] || (g[4] = x("div", { class: "before w-[270px] h-[200px] pr-[70px] border" }, null, -1)),
|
12015
|
-
x("div",
|
12023
|
+
x("div", r1, " 预览画像 " + Se(((F = u.value) == null ? void 0 : F.width) || "") + " " + Se(($ = u.value) != null && $.width ? "x" : "") + " " + Se(((ce = u.value) == null ? void 0 : ce.height) || ""), 1)
|
12016
12024
|
])
|
12017
12025
|
])
|
12018
12026
|
])
|
12019
12027
|
])
|
12020
12028
|
])
|
12021
12029
|
]),
|
12022
|
-
x("div",
|
12030
|
+
x("div", o1, [
|
12023
12031
|
x("span", {
|
12024
12032
|
loading: o.value,
|
12025
12033
|
class: "!w-22 bg-[#474AFF] text-white rounded py-2 px-6 cursor-pointer",
|
12026
12034
|
type: "primary",
|
12027
12035
|
onClick: B
|
12028
|
-
}, " 确认 ", 8,
|
12036
|
+
}, " 确认 ", 8, c1),
|
12029
12037
|
x("span", {
|
12030
12038
|
class: "!w-22 border border-[#DEDEDE] text-[#666] rounded py-2 px-6 cursor-pointer",
|
12031
12039
|
onClick: Q
|
@@ -12036,7 +12044,7 @@ const $f = {
|
|
12036
12044
|
])) : H("", !0);
|
12037
12045
|
};
|
12038
12046
|
}
|
12039
|
-
}),
|
12047
|
+
}), d1 = Qe({
|
12040
12048
|
name: "CustomIcon",
|
12041
12049
|
props: {
|
12042
12050
|
iconName: {
|
@@ -12050,13 +12058,13 @@ const $f = {
|
|
12050
12058
|
};
|
12051
12059
|
}
|
12052
12060
|
});
|
12053
|
-
function
|
12061
|
+
function h1(e, t, a, i, s, u) {
|
12054
12062
|
return v(), M("span", {
|
12055
12063
|
style: { position: "unset", color: "unset", top: "unset", left: "unset", right: "unset", transform: "unset", "font-size": "unset" },
|
12056
12064
|
class: un(`iconfont icon-${e.iconClass} text-4xl overflow-hidden flex justify-center items-center`)
|
12057
12065
|
}, null, 2);
|
12058
12066
|
}
|
12059
|
-
const
|
12067
|
+
const f1 = /* @__PURE__ */ dt(d1, [["render", h1]]), m1 = Qe({
|
12060
12068
|
name: "GpModal",
|
12061
12069
|
props: {
|
12062
12070
|
visible: {
|
@@ -12107,22 +12115,22 @@ const h1 = /* @__PURE__ */ dt(l1, [["render", d1]]), f1 = Qe({
|
|
12107
12115
|
}
|
12108
12116
|
};
|
12109
12117
|
}
|
12110
|
-
}),
|
12118
|
+
}), E1 = { class: "bg-white rounded-lg shadow-xl w-ful" }, T1 = { class: "p-4 border-b border-gray-200 relative flex items-center justify-between" }, p1 = {
|
12111
12119
|
key: 0,
|
12112
12120
|
class: "text-lg font-semibold"
|
12113
|
-
},
|
12121
|
+
}, b1 = { class: "p-4" }, g1 = {
|
12114
12122
|
key: 0,
|
12115
12123
|
class: "p-4 border-t border-gray-200 flex justify-end space-x-2"
|
12116
12124
|
};
|
12117
|
-
function
|
12125
|
+
function _1(e, t, a, i, s, u) {
|
12118
12126
|
return e.visible ? (v(), M("div", {
|
12119
12127
|
key: 0,
|
12120
12128
|
class: "fixed inset-0 z-[99999] flex items-center justify-center bg-gray-900 bg-opacity-50",
|
12121
12129
|
onClick: t[3] || (t[3] = we((...r) => e.onClose && e.onClose(...r), ["self"]))
|
12122
12130
|
}, [
|
12123
|
-
x("div",
|
12124
|
-
x("div",
|
12125
|
-
e.title ? (v(), M("h3",
|
12131
|
+
x("div", E1, [
|
12132
|
+
x("div", T1, [
|
12133
|
+
e.title ? (v(), M("h3", p1, Se(e.title), 1)) : H("", !0),
|
12126
12134
|
Qt(e.$slots, "header"),
|
12127
12135
|
e.showCloseButton ? (v(), M("button", {
|
12128
12136
|
key: 1,
|
@@ -12144,10 +12152,10 @@ function g1(e, t, a, i, s, u) {
|
|
12144
12152
|
], -1)
|
12145
12153
|
]))) : H("", !0)
|
12146
12154
|
]),
|
12147
|
-
x("div",
|
12155
|
+
x("div", b1, [
|
12148
12156
|
Qt(e.$slots, "default")
|
12149
12157
|
]),
|
12150
|
-
e.showCancelButton || e.showOkButton ? (v(), M("div",
|
12158
|
+
e.showCancelButton || e.showOkButton ? (v(), M("div", g1, [
|
12151
12159
|
Qt(e.$slots, "footer", {}, () => [
|
12152
12160
|
e.showCancelButton ? (v(), M("button", {
|
12153
12161
|
key: 0,
|
@@ -12164,7 +12172,7 @@ function g1(e, t, a, i, s, u) {
|
|
12164
12172
|
])
|
12165
12173
|
])) : H("", !0);
|
12166
12174
|
}
|
12167
|
-
const
|
12175
|
+
const A1 = /* @__PURE__ */ dt(m1, [["render", _1]]), N1 = { class: "p-4 flex flex-wrap max-h-[500px] overflow-y-auto w-[640px]" }, C1 = /* @__PURE__ */ Qe({
|
12168
12176
|
__name: "IconModal",
|
12169
12177
|
props: {
|
12170
12178
|
// 图标库
|
@@ -12193,7 +12201,7 @@ const _1 = /* @__PURE__ */ dt(f1, [["render", g1]]), A1 = { class: "p-4 flex fle
|
|
12193
12201
|
function f() {
|
12194
12202
|
r.value = !1;
|
12195
12203
|
}
|
12196
|
-
return t({ openModal: c, closeModal: f }), (E, T) => (v(), _t(
|
12204
|
+
return t({ openModal: c, closeModal: f }), (E, T) => (v(), _t(A1, {
|
12197
12205
|
visible: r.value,
|
12198
12206
|
"onUpdate:visible": T[0] || (T[0] = (_) => r.value = _),
|
12199
12207
|
title: "选择图标",
|
@@ -12203,8 +12211,8 @@ const _1 = /* @__PURE__ */ dt(f1, [["render", g1]]), A1 = { class: "p-4 flex fle
|
|
12203
12211
|
showOkButton: !1
|
12204
12212
|
}, {
|
12205
12213
|
default: Ca(() => [
|
12206
|
-
x("div",
|
12207
|
-
(v(!0), M(jt, null, Ri(s.value, (_) => (v(), _t(
|
12214
|
+
x("div", N1, [
|
12215
|
+
(v(!0), M(jt, null, Ri(s.value, (_) => (v(), _t(f1, {
|
12208
12216
|
key: _,
|
12209
12217
|
class: "w-12 h-12 mx-1 mb-2 border cursor-pointer hover:border-gray-400 hover:bg-gray-200",
|
12210
12218
|
iconName: _,
|
@@ -12216,16 +12224,16 @@ const _1 = /* @__PURE__ */ dt(f1, [["render", g1]]), A1 = { class: "p-4 flex fle
|
|
12216
12224
|
_: 1
|
12217
12225
|
}, 8, ["visible"]));
|
12218
12226
|
}
|
12219
|
-
}),
|
12227
|
+
}), I1 = { class: "flex" }, S1 = {
|
12220
12228
|
key: 0,
|
12221
12229
|
class: "text-lg font-bold border-b p-2"
|
12222
|
-
},
|
12230
|
+
}, x1 = { class: "text-sm font-thin text-gray-500" }, O1 = ["innerHTML"], D1 = ["innerHTML"], v1 = { class: "flex-1" }, L1 = {
|
12223
12231
|
key: 0,
|
12224
12232
|
class: "text-lg font-bold border-b p-2"
|
12225
|
-
},
|
12233
|
+
}, y1 = { class: "p-2" }, R1 = {
|
12226
12234
|
key: 0,
|
12227
12235
|
class: "text-lg font-bold border-b p-2"
|
12228
|
-
},
|
12236
|
+
}, M1 = { class: "text-sm font-thin text-gray-500" }, P1 = { class: "p-2" }, k1 = /* @__PURE__ */ Qe({
|
12229
12237
|
__name: "Designer",
|
12230
12238
|
props: {
|
12231
12239
|
mode: { default: "design" },
|
@@ -12314,40 +12322,40 @@ const _1 = /* @__PURE__ */ dt(f1, [["render", g1]]), A1 = { class: "p-4 flex fle
|
|
12314
12322
|
if (T.value) {
|
12315
12323
|
if (A.type === z.Block) {
|
12316
12324
|
var D = !0;
|
12317
|
-
const
|
12325
|
+
const me = B(
|
12318
12326
|
u.value,
|
12319
12327
|
T.value.parentxpath || ""
|
12320
12328
|
);
|
12321
|
-
if (
|
12322
|
-
if (
|
12323
|
-
!Q(
|
12329
|
+
if (me && me.children && me.children.forEach((Z) => {
|
12330
|
+
if (Z.tag != T.value.tag || // 检查标签一致
|
12331
|
+
!Q(Z, T.value)) {
|
12324
12332
|
D = !1;
|
12325
12333
|
return;
|
12326
12334
|
}
|
12327
12335
|
}), !D) {
|
12328
|
-
|
12336
|
+
ee.error("同级结构不一致,错误配置!");
|
12329
12337
|
return;
|
12330
12338
|
}
|
12331
12339
|
}
|
12332
12340
|
if (T.value.rule = A.rule, T.value.type = A.type, (w = A.rule) != null && w.isThemeColor ? (A.attrs.class += "theme_color", A.attrs.style && (A.attrs.style = void 0)) : (console.log("e111", (q = A.attrs.class) == null ? void 0 : q.includes("theme_color")), (re = A.attrs.class) != null && re.includes("theme_color") && (A.attrs.class = A.attrs.class.replace("theme_color", " "))), T.value.type === z.Block) {
|
12333
|
-
const
|
12341
|
+
const me = B(
|
12334
12342
|
u.value,
|
12335
12343
|
T.value.parentxpath || ""
|
12336
12344
|
);
|
12337
|
-
|
12338
|
-
if (
|
12339
|
-
!Q(
|
12340
|
-
|
12345
|
+
me && me.children && (me.children.forEach((Z) => {
|
12346
|
+
if (Z.tag != T.value.tag || // 检查标签一致
|
12347
|
+
!Q(Z, T.value)) {
|
12348
|
+
ee.error("同级结构不一致,无法配置为块类型");
|
12341
12349
|
return;
|
12342
12350
|
}
|
12343
|
-
}),
|
12344
|
-
var
|
12345
|
-
|
12351
|
+
}), me.children.forEach((Z) => {
|
12352
|
+
var le;
|
12353
|
+
Z.tag === T.value.tag && (Z.rule = A.rule, Z.type = A.type, (le = Z.attrs.class) != null && le.includes(" mb40 relative") || (Z.attrs.class += " mb40 relative"));
|
12346
12354
|
}));
|
12347
12355
|
} else
|
12348
12356
|
(Ie = T.value.attrs.class) != null && Ie.includes(" mb40 relative") && (T.value.attrs.class = T.value.attrs.class.replace(" mb40 relative", " "));
|
12349
12357
|
}
|
12350
|
-
|
12358
|
+
ee.success("保存成功");
|
12351
12359
|
}
|
12352
12360
|
}
|
12353
12361
|
function ne(A) {
|
@@ -12359,18 +12367,18 @@ const _1 = /* @__PURE__ */ dt(f1, [["render", g1]]), A1 = { class: "p-4 flex fle
|
|
12359
12367
|
return o.value = r("body").html() || "", D[0];
|
12360
12368
|
}
|
12361
12369
|
function g(A, D = "") {
|
12362
|
-
var
|
12363
|
-
function w(
|
12364
|
-
if (!
|
12365
|
-
const
|
12366
|
-
let ht =
|
12370
|
+
var me;
|
12371
|
+
function w(Z) {
|
12372
|
+
if (!Z || !Z[0]) return "";
|
12373
|
+
const le = [];
|
12374
|
+
let ht = Z;
|
12367
12375
|
for (; ht.length && ht[0].tagName !== "html"; ) {
|
12368
12376
|
const rs = ht[0].tagName, Yu = ht.parent().children(rs).index(ht) + 1;
|
12369
|
-
|
12377
|
+
le.unshift(`${rs}[${Yu}]`), ht = ht.parent();
|
12370
12378
|
}
|
12371
|
-
return "/html/" +
|
12379
|
+
return "/html/" + le.join("/");
|
12372
12380
|
}
|
12373
|
-
const q = w(A).replace("/html/body[1]", ""), re = A.children().toArray().map((
|
12381
|
+
const q = w(A).replace("/html/body[1]", ""), re = A.children().toArray().map((Z) => g(r(Z), q)), Ie = (me = a.rules) == null ? void 0 : me.find((Z) => Z.xpath === q);
|
12374
12382
|
return {
|
12375
12383
|
tag: A[0].tagName,
|
12376
12384
|
text: A.contents().not(A.children()).text().trim(),
|
@@ -12392,9 +12400,9 @@ const _1 = /* @__PURE__ */ dt(f1, [["render", g1]]), A1 = { class: "p-4 flex fle
|
|
12392
12400
|
}
|
12393
12401
|
function $(A, D = "") {
|
12394
12402
|
function w(q, re) {
|
12395
|
-
var
|
12396
|
-
const
|
12397
|
-
return `${re}/${q.tag}[${
|
12403
|
+
var Z;
|
12404
|
+
const me = (re ? ((Z = B(u.value, re)) == null ? void 0 : Z.children) || [] : [u.value]).filter((le) => le.tag === q.tag).indexOf(q) + 1;
|
12405
|
+
return `${re}/${q.tag}[${me}]`;
|
12398
12406
|
}
|
12399
12407
|
A.xpath = w(A, D), A.parentxpath = D, (A.children || []).forEach(
|
12400
12408
|
(q) => $(q, A.xpath)
|
@@ -12412,50 +12420,50 @@ const _1 = /* @__PURE__ */ dt(f1, [["render", g1]]), A1 = { class: "p-4 flex fle
|
|
12412
12420
|
);
|
12413
12421
|
if (!q || !q.children) return;
|
12414
12422
|
const re = q.children.findIndex(
|
12415
|
-
(
|
12423
|
+
(le) => le === D
|
12416
12424
|
);
|
12417
12425
|
if (re === -1) return;
|
12418
|
-
const Ie = q.children.length, { minBlock:
|
12419
|
-
if ((A === "add" || A === "copy") && Ie >= (
|
12420
|
-
C.value = `无法添加更多块。最大块数量为 ${
|
12426
|
+
const Ie = q.children.length, { minBlock: me, maxBlock: Z } = D.rule;
|
12427
|
+
if ((A === "add" || A === "copy") && Ie >= (Z || 1 / 0)) {
|
12428
|
+
C.value = `无法添加更多块。最大块数量为 ${Z}`, ee.error(C.value);
|
12421
12429
|
return;
|
12422
12430
|
}
|
12423
12431
|
switch (A) {
|
12424
12432
|
case "add":
|
12425
12433
|
if (w) {
|
12426
|
-
const
|
12434
|
+
const le = {
|
12427
12435
|
...w,
|
12428
12436
|
xpath: "",
|
12429
12437
|
children: JSON.parse(JSON.stringify(w.children))
|
12430
12438
|
};
|
12431
|
-
q.children.splice(re + 1, 0,
|
12439
|
+
q.children.splice(re + 1, 0, le);
|
12432
12440
|
}
|
12433
12441
|
break;
|
12434
12442
|
case "copy":
|
12435
12443
|
if (w) {
|
12436
|
-
const
|
12444
|
+
const le = {
|
12437
12445
|
...w,
|
12438
12446
|
xpath: "",
|
12439
12447
|
children: JSON.parse(JSON.stringify(w.children))
|
12440
12448
|
};
|
12441
|
-
q.children.splice(re + 1, 0,
|
12449
|
+
q.children.splice(re + 1, 0, le);
|
12442
12450
|
}
|
12443
12451
|
break;
|
12444
12452
|
case "moveUp":
|
12445
12453
|
if (re > 0) {
|
12446
|
-
const [
|
12447
|
-
q.children.splice(re - 1, 0,
|
12454
|
+
const [le] = q.children.splice(re, 1);
|
12455
|
+
q.children.splice(re - 1, 0, le);
|
12448
12456
|
}
|
12449
12457
|
break;
|
12450
12458
|
case "moveDown":
|
12451
12459
|
if (re < q.children.length - 1) {
|
12452
|
-
const [
|
12453
|
-
q.children.splice(re + 1, 0,
|
12460
|
+
const [le] = q.children.splice(re, 1);
|
12461
|
+
q.children.splice(re + 1, 0, le);
|
12454
12462
|
}
|
12455
12463
|
break;
|
12456
12464
|
case "delete":
|
12457
|
-
if (Ie <= (
|
12458
|
-
C.value = `无法删除更多块。最小块数量为 ${
|
12465
|
+
if (Ie <= (me || 0)) {
|
12466
|
+
C.value = `无法删除更多块。最小块数量为 ${me}`, ee.error(C.value);
|
12459
12467
|
return;
|
12460
12468
|
}
|
12461
12469
|
q.children.splice(re, 1);
|
@@ -12476,9 +12484,9 @@ const _1 = /* @__PURE__ */ dt(f1, [["render", g1]]), A1 = { class: "p-4 flex fle
|
|
12476
12484
|
console.log("e1", A), D.attrs.alt = w.name;
|
12477
12485
|
const q = new FileReader();
|
12478
12486
|
q.onload = (re) => {
|
12479
|
-
var
|
12480
|
-
let Ie = (
|
12481
|
-
D.attrs.src =
|
12487
|
+
var le;
|
12488
|
+
let Ie = (le = re == null ? void 0 : re.target) == null ? void 0 : le.result, me = Vf(Ie), Z = URL.createObjectURL(me);
|
12489
|
+
console.log("url", Z), D.attrs.src = Z, console.log(" element.attrs", D.attrs), d.value = (/* @__PURE__ */ new Date()).getTime().toString();
|
12482
12490
|
}, q.readAsDataURL(w);
|
12483
12491
|
} else
|
12484
12492
|
console.log("e2", A), D.attrs.src = w;
|
@@ -12488,37 +12496,37 @@ const _1 = /* @__PURE__ */ dt(f1, [["render", g1]]), A1 = { class: "p-4 flex fle
|
|
12488
12496
|
let q = w.attrs.class.replace(/icon-\S+/g, `icon-${D}`);
|
12489
12497
|
w.attrs.class = q, d.value = (/* @__PURE__ */ new Date()).getTime().toString();
|
12490
12498
|
}
|
12491
|
-
const
|
12499
|
+
const ge = G(a.previewWidth), te = G(375);
|
12492
12500
|
let ye = G(!1), He = G(""), Ze = 0, O = 0;
|
12493
12501
|
function L(A) {
|
12494
|
-
He.value = A, ye.value = !0, Ze = event.clientX, A === "preview" ? O =
|
12502
|
+
He.value = A, ye.value = !0, Ze = event.clientX, A === "preview" ? O = ge.value : A === "structure" && (O = te.value), window.addEventListener("mousemove", ue), window.addEventListener("mouseup", _e);
|
12495
12503
|
}
|
12496
12504
|
function ue(A) {
|
12497
12505
|
if (!ye.value) return;
|
12498
12506
|
const D = A.clientX - Ze;
|
12499
|
-
He.value === "preview" ?
|
12507
|
+
He.value === "preview" ? ge.value = Math.max(200, O + D) : He.value === "structure" && (te.value = Math.max(200, O - D));
|
12500
12508
|
}
|
12501
|
-
function
|
12502
|
-
ye.value = !1, He.value = "", window.removeEventListener("mousemove", ue), window.removeEventListener("mouseup",
|
12509
|
+
function _e() {
|
12510
|
+
ye.value = !1, He.value = "", window.removeEventListener("mousemove", ue), window.removeEventListener("mouseup", _e);
|
12503
12511
|
}
|
12504
|
-
return (A, D) => (v(), M("div",
|
12512
|
+
return (A, D) => (v(), M("div", I1, [
|
12505
12513
|
A.preview ? (v(), M("div", {
|
12506
12514
|
key: 0,
|
12507
12515
|
class: "border-l overflow-auto resize-area",
|
12508
|
-
style: cs({ width:
|
12516
|
+
style: cs({ width: ge.value + "px" })
|
12509
12517
|
}, [
|
12510
|
-
A.showTitle ? (v(), M("h2",
|
12518
|
+
A.showTitle ? (v(), M("h2", S1, [
|
12511
12519
|
D[2] || (D[2] = oi(" 实时预览 ")),
|
12512
|
-
x("span",
|
12520
|
+
x("span", x1, Se(ge.value) + "px", 1)
|
12513
12521
|
])) : H("", !0),
|
12514
12522
|
x("div", null, [
|
12515
12523
|
o.value ? (v(), M("div", {
|
12516
12524
|
key: 0,
|
12517
12525
|
innerHTML: o.value
|
12518
|
-
}, null, 8,
|
12526
|
+
}, null, 8, O1)) : (v(), M("div", {
|
12519
12527
|
key: 1,
|
12520
12528
|
innerHTML: he(r)("body").html()
|
12521
|
-
}, null, 8,
|
12529
|
+
}, null, 8, D1))
|
12522
12530
|
])
|
12523
12531
|
], 4)) : H("", !0),
|
12524
12532
|
A.preview ? (v(), M("div", {
|
@@ -12526,9 +12534,9 @@ const _1 = /* @__PURE__ */ dt(f1, [["render", g1]]), A1 = { class: "p-4 flex fle
|
|
12526
12534
|
class: "resizer",
|
12527
12535
|
onMousedown: D[0] || (D[0] = (w) => L("preview"))
|
12528
12536
|
}, null, 32)) : H("", !0),
|
12529
|
-
x("div",
|
12530
|
-
A.showTitle ? (v(), M("h2",
|
12531
|
-
x("div",
|
12537
|
+
x("div", v1, [
|
12538
|
+
A.showTitle ? (v(), M("h2", L1, "结构渲染")) : H("", !0),
|
12539
|
+
x("div", y1, [
|
12532
12540
|
u.value ? (v(), _t(bh, {
|
12533
12541
|
key: 0,
|
12534
12542
|
cropper: f.value,
|
@@ -12557,13 +12565,13 @@ const _1 = /* @__PURE__ */ dt(f1, [["render", g1]]), A1 = { class: "p-4 flex fle
|
|
12557
12565
|
c.value == "design" ? (v(), M("div", {
|
12558
12566
|
key: 3,
|
12559
12567
|
class: "resize-area overflow-auto",
|
12560
|
-
style: cs({ width:
|
12568
|
+
style: cs({ width: te.value + "px" })
|
12561
12569
|
}, [
|
12562
|
-
A.showTitle ? (v(), M("h2",
|
12570
|
+
A.showTitle ? (v(), M("h2", R1, [
|
12563
12571
|
D[3] || (D[3] = oi(" 节点属性 ")),
|
12564
|
-
x("span",
|
12572
|
+
x("span", M1, Se(te.value) + "px", 1)
|
12565
12573
|
])) : H("", !0),
|
12566
|
-
x("div",
|
12574
|
+
x("div", P1, [
|
12567
12575
|
T.value ? (v(), _t(Zh, {
|
12568
12576
|
key: 0,
|
12569
12577
|
element: T.value,
|
@@ -12571,12 +12579,12 @@ const _1 = /* @__PURE__ */ dt(f1, [["render", g1]]), A1 = { class: "p-4 flex fle
|
|
12571
12579
|
}, null, 8, ["element"])) : H("", !0)
|
12572
12580
|
])
|
12573
12581
|
], 4)) : H("", !0),
|
12574
|
-
st(
|
12582
|
+
st(l1, {
|
12575
12583
|
ref_key: "cropperRef",
|
12576
12584
|
ref: f,
|
12577
12585
|
onOk: Me
|
12578
12586
|
}, null, 512),
|
12579
|
-
st(
|
12587
|
+
st(C1, {
|
12580
12588
|
icons: A.icons,
|
12581
12589
|
ref_key: "iconRef",
|
12582
12590
|
ref: E,
|
@@ -12584,12 +12592,12 @@ const _1 = /* @__PURE__ */ dt(f1, [["render", g1]]), A1 = { class: "p-4 flex fle
|
|
12584
12592
|
}, null, 8, ["icons"])
|
12585
12593
|
]));
|
12586
12594
|
}
|
12587
|
-
}),
|
12595
|
+
}), w1 = /* @__PURE__ */ dt(k1, [["__scopeId", "data-v-9ef4dcc2"]]), q1 = {
|
12588
12596
|
install(e) {
|
12589
|
-
e.component("Designer",
|
12597
|
+
e.component("Designer", w1);
|
12590
12598
|
}
|
12591
12599
|
};
|
12592
12600
|
export {
|
12593
|
-
|
12594
|
-
|
12601
|
+
w1 as Designer,
|
12602
|
+
q1 as default
|
12595
12603
|
};
|