builder-settings-types 0.0.378 → 0.0.380
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/builder-settings-types.cjs.js +16 -16
- package/dist/builder-settings-types.es.js +182 -182
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const Ot = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
2
|
-
let
|
|
2
|
+
let dt = (c = 21) => {
|
|
3
3
|
let t = "", e = crypto.getRandomValues(new Uint8Array(c |= 0));
|
|
4
4
|
for (; c--; )
|
|
5
5
|
t += Ot[e[c] & 63];
|
|
@@ -111,7 +111,7 @@ class Bt {
|
|
|
111
111
|
this.observer && (this.observer.disconnect(), this.observer = void 0), this.observedElements.clear();
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
const
|
|
114
|
+
const vt = new Bt();
|
|
115
115
|
function it(c) {
|
|
116
116
|
if (c === null || typeof c != "object") return c;
|
|
117
117
|
if (c instanceof Date) return new Date(c.getTime());
|
|
@@ -144,7 +144,7 @@ function At(c) {
|
|
|
144
144
|
}
|
|
145
145
|
const I = class I {
|
|
146
146
|
constructor(t = {}) {
|
|
147
|
-
this.props = t, this.dataPropsPath = "", this.id = t.id ||
|
|
147
|
+
this.props = t, this.dataPropsPath = "", this.id = t.id || dt(), this.value = this.props.default, this.desktop = this.props.default, this.title = t.title || "", this.includeGetJson = t.includeGetJson !== void 0 ? t.includeGetJson : !0;
|
|
148
148
|
}
|
|
149
149
|
static SetUploadUrl(t) {
|
|
150
150
|
globalThis.DefaultUploadUrl = t, I.DefaultUploadUrl = t;
|
|
@@ -268,10 +268,10 @@ function R(c) {
|
|
|
268
268
|
function M(c) {
|
|
269
269
|
return c instanceof $;
|
|
270
270
|
}
|
|
271
|
-
function
|
|
271
|
+
function ft(c) {
|
|
272
272
|
return R(c) || M(c);
|
|
273
273
|
}
|
|
274
|
-
const
|
|
274
|
+
const pt = (c, t, e) => {
|
|
275
275
|
let i = !1, s = 0, n = 0, o = 0, a = 0;
|
|
276
276
|
const l = (d) => {
|
|
277
277
|
if (d.target.closest("button")) return;
|
|
@@ -280,9 +280,9 @@ const dt = (c, t, e) => {
|
|
|
280
280
|
o = p.left, a = p.top, document.addEventListener("mousemove", r), document.addEventListener("mouseup", h), document.body.style.userSelect = "none";
|
|
281
281
|
}, r = (d) => {
|
|
282
282
|
if (!i) return;
|
|
283
|
-
const p = d.clientX - s, u = d.clientY - n,
|
|
283
|
+
const p = d.clientX - s, u = d.clientY - n, C = window.innerWidth, m = window.innerHeight, g = t.offsetWidth, f = t.offsetHeight;
|
|
284
284
|
let v = o + p, y = a + u;
|
|
285
|
-
v = Math.max(8, Math.min(
|
|
285
|
+
v = Math.max(8, Math.min(C - g - 8, v)), y = Math.max(8, Math.min(m - f - 8, y)), t.style.left = `${v}px`, t.style.top = `${y}px`, e == null || e(v, y);
|
|
286
286
|
}, h = () => {
|
|
287
287
|
i = !1, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", h), document.body.style.userSelect = "";
|
|
288
288
|
};
|
|
@@ -432,7 +432,7 @@ const dt = (c, t, e) => {
|
|
|
432
432
|
};
|
|
433
433
|
}
|
|
434
434
|
return { color: U(t) || t, position: 0, opacity: 100 };
|
|
435
|
-
},
|
|
435
|
+
}, Ct = (c) => {
|
|
436
436
|
const t = [];
|
|
437
437
|
let e = "", i = 0;
|
|
438
438
|
for (let s = 0; s < c.length; s++) {
|
|
@@ -446,7 +446,7 @@ const dt = (c, t, e) => {
|
|
|
446
446
|
e += n;
|
|
447
447
|
}
|
|
448
448
|
return e.trim() && t.push(e.trim()), t;
|
|
449
|
-
},
|
|
449
|
+
}, yt = (c, t) => {
|
|
450
450
|
const e = new RegExp(`${t}\\s*\\(`, "i"), i = c.match(e);
|
|
451
451
|
if (!i) return null;
|
|
452
452
|
const s = i.index + i[0].length;
|
|
@@ -467,7 +467,7 @@ const dt = (c, t, e) => {
|
|
|
467
467
|
"contain",
|
|
468
468
|
"cover"
|
|
469
469
|
].includes(t) ? !1 : /^#[0-9a-f]{3,8}$/i.test(t) || /^rgb/i.test(c) || /^hsl/i.test(c) || Dt(t);
|
|
470
|
-
},
|
|
470
|
+
}, Et = (c) => {
|
|
471
471
|
const t = [];
|
|
472
472
|
return c.forEach((e, i) => {
|
|
473
473
|
const s = e.trim();
|
|
@@ -495,9 +495,9 @@ const dt = (c, t, e) => {
|
|
|
495
495
|
const s = Nt(t);
|
|
496
496
|
return D({ type: "solid", angle: 0, stops: [s] });
|
|
497
497
|
}
|
|
498
|
-
const e =
|
|
498
|
+
const e = yt(t, "linear-gradient");
|
|
499
499
|
if (e) {
|
|
500
|
-
const s =
|
|
500
|
+
const s = Ct(e);
|
|
501
501
|
let n = 90, o = s;
|
|
502
502
|
const a = s[0];
|
|
503
503
|
if (a.includes("deg")) {
|
|
@@ -513,12 +513,12 @@ const dt = (c, t, e) => {
|
|
|
513
513
|
"to top right": 45,
|
|
514
514
|
"to top left": 315
|
|
515
515
|
}[a] ?? 90, o = s.slice(1));
|
|
516
|
-
const l =
|
|
516
|
+
const l = Et(o);
|
|
517
517
|
return l.length ? D({ type: "linear", angle: n, stops: l }) : null;
|
|
518
518
|
}
|
|
519
|
-
const i =
|
|
519
|
+
const i = yt(t, "radial-gradient");
|
|
520
520
|
if (i) {
|
|
521
|
-
const s =
|
|
521
|
+
const s = Ct(i), n = s[0] && !Gt(s[0]) ? s.slice(1) : s, o = Et(n);
|
|
522
522
|
return o.length ? D({ type: "radial", angle: 0, stops: o }) : null;
|
|
523
523
|
}
|
|
524
524
|
return null;
|
|
@@ -623,7 +623,7 @@ const dt = (c, t, e) => {
|
|
|
623
623
|
};
|
|
624
624
|
X.STORAGE_KEY = "settingsLib_recentColors", X.MAX_COLORS = 18, X.colors = null;
|
|
625
625
|
let z = X;
|
|
626
|
-
const
|
|
626
|
+
const ut = (c, t) => {
|
|
627
627
|
const e = document.createElement("div");
|
|
628
628
|
e.className = "color-picker-recent-section";
|
|
629
629
|
const i = document.createElement("div");
|
|
@@ -747,7 +747,7 @@ class Zt {
|
|
|
747
747
|
const i = document.createElement("span");
|
|
748
748
|
i.textContent = "Color";
|
|
749
749
|
const s = document.createElement("button");
|
|
750
|
-
s.className = "color-picker-close", s.innerHTML = Tt, s.addEventListener("click", () => this.close(!0)), e.appendChild(i), e.appendChild(s),
|
|
750
|
+
s.className = "color-picker-close", s.innerHTML = Tt, s.addEventListener("click", () => this.close(!0)), e.appendChild(i), e.appendChild(s), pt(e, t);
|
|
751
751
|
const n = document.createElement("div");
|
|
752
752
|
n.className = "color-picker-area", this.colorArea = n;
|
|
753
753
|
const o = document.createElement("div");
|
|
@@ -766,27 +766,27 @@ class Zt {
|
|
|
766
766
|
p.className = "color-picker-opacity", this.opacitySlider = p;
|
|
767
767
|
const u = document.createElement("div");
|
|
768
768
|
u.className = "color-picker-opacity-marker", this.opacityMarker = u, p.appendChild(u), r.appendChild(h), r.appendChild(p), a.appendChild(l), a.appendChild(r);
|
|
769
|
-
const
|
|
769
|
+
const C = ut((E) => {
|
|
770
770
|
var L;
|
|
771
771
|
this.setColor(E), (L = this.onChange) == null || L.call(this, E, this.currentOpacity);
|
|
772
772
|
}, this.recentScope);
|
|
773
|
-
this.recentSectionRefresh =
|
|
773
|
+
this.recentSectionRefresh = C.refresh;
|
|
774
774
|
const m = document.createElement("div");
|
|
775
775
|
m.className = "color-picker-format-section";
|
|
776
776
|
const g = document.createElement("select");
|
|
777
777
|
g.className = "color-picker-format-select", this.select = g;
|
|
778
|
-
const
|
|
779
|
-
|
|
778
|
+
const f = document.createElement("option");
|
|
779
|
+
f.value = "hex", f.textContent = "HEX";
|
|
780
780
|
const v = document.createElement("option");
|
|
781
781
|
v.value = "rgb", v.textContent = "RGB";
|
|
782
782
|
const y = document.createElement("option");
|
|
783
|
-
y.value = "hsl", y.textContent = "HSL", g.appendChild(
|
|
783
|
+
y.value = "hsl", y.textContent = "HSL", g.appendChild(f), g.appendChild(v), g.appendChild(y);
|
|
784
784
|
const b = document.createElement("input");
|
|
785
785
|
b.type = "text", b.className = "color-picker-color-input", b.value = this.currentColor, this.input = b;
|
|
786
786
|
const k = document.createElement("div");
|
|
787
787
|
k.className = "color-picker-input-container";
|
|
788
788
|
const x = document.createElement("button");
|
|
789
|
-
return x.className = "color-picker-copy-inside", x.textContent = "Copy", k.appendChild(b), k.appendChild(x), m.appendChild(g), m.appendChild(k), t.appendChild(e), t.appendChild(n), t.appendChild(a), t.appendChild(
|
|
789
|
+
return x.className = "color-picker-copy-inside", x.textContent = "Copy", k.appendChild(b), k.appendChild(x), m.appendChild(g), m.appendChild(k), t.appendChild(e), t.appendChild(n), t.appendChild(a), t.appendChild(C.container), t.appendChild(m), t.addEventListener("click", (E) => E.stopPropagation()), this.bind(n, h, p, b, g, x, l), t;
|
|
790
790
|
}
|
|
791
791
|
createBackdrop() {
|
|
792
792
|
const t = document.createElement("div");
|
|
@@ -795,37 +795,37 @@ class Zt {
|
|
|
795
795
|
bind(t, e, i, s, n, o, a) {
|
|
796
796
|
const l = (d) => {
|
|
797
797
|
var v;
|
|
798
|
-
const p = t.getBoundingClientRect(), u = Math.max(0, Math.min(1, (d.clientX - p.left) / p.width)),
|
|
799
|
-
this.colorMarker.style.left = `${u * 100}%`, this.colorMarker.style.top = `${
|
|
800
|
-
const g = this.parsePercentage(this.hueMarker.style.left || "0%") * 360,
|
|
801
|
-
this.currentColor =
|
|
798
|
+
const p = t.getBoundingClientRect(), u = Math.max(0, Math.min(1, (d.clientX - p.left) / p.width)), C = Math.max(0, Math.min(1, (d.clientY - p.top) / p.height));
|
|
799
|
+
this.colorMarker.style.left = `${u * 100}%`, this.colorMarker.style.top = `${C * 100}%`;
|
|
800
|
+
const g = this.parsePercentage(this.hueMarker.style.left || "0%") * 360, f = Z(g, u, 1 - C);
|
|
801
|
+
this.currentColor = f, this.syncInput(), this.updateOpacityBg(), (v = this.onChange) == null || v.call(this, f, this.currentOpacity);
|
|
802
802
|
}, r = (d) => {
|
|
803
803
|
var v;
|
|
804
804
|
const p = e.getBoundingClientRect();
|
|
805
805
|
let u = Math.max(0, Math.min(1, (d.clientX - p.left) / p.width));
|
|
806
806
|
this.hueMarker.style.left = `${u * 100}%`;
|
|
807
|
-
const
|
|
808
|
-
this.currentColor =
|
|
807
|
+
const C = u * 360, m = this.parsePercentage(this.colorMarker.style.left || "0%"), g = this.parsePercentage(this.colorMarker.style.top || "0%"), f = Z(C, m, 1 - g);
|
|
808
|
+
this.currentColor = f, this.colorArea.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${C}, 100%, 50%))`, this.syncInput(), this.updateOpacityBg(), (v = this.onChange) == null || v.call(this, f, this.currentOpacity);
|
|
809
809
|
}, h = (d) => {
|
|
810
|
-
var
|
|
810
|
+
var C;
|
|
811
811
|
const p = i.getBoundingClientRect(), u = Math.max(0, Math.min(1, (d.clientX - p.left) / p.width));
|
|
812
|
-
this.opacityMarker.style.left = `${u * 100}%`, this.currentOpacity = Math.round(u * 100), (
|
|
812
|
+
this.opacityMarker.style.left = `${u * 100}%`, this.currentOpacity = Math.round(u * 100), (C = this.onChange) == null || C.call(this, this.currentColor, this.currentOpacity);
|
|
813
813
|
};
|
|
814
814
|
t.addEventListener("mousedown", (d) => {
|
|
815
815
|
d.preventDefault(), l(d);
|
|
816
|
-
const p = (
|
|
816
|
+
const p = (C) => l(C), u = () => {
|
|
817
817
|
document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", u);
|
|
818
818
|
};
|
|
819
819
|
document.addEventListener("mousemove", p), document.addEventListener("mouseup", u);
|
|
820
820
|
}), e.addEventListener("mousedown", (d) => {
|
|
821
821
|
d.preventDefault(), r(d);
|
|
822
|
-
const p = (
|
|
822
|
+
const p = (C) => r(C), u = () => {
|
|
823
823
|
document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", u);
|
|
824
824
|
};
|
|
825
825
|
document.addEventListener("mousemove", p), document.addEventListener("mouseup", u);
|
|
826
826
|
}), i.addEventListener("mousedown", (d) => {
|
|
827
827
|
d.preventDefault(), h(d);
|
|
828
|
-
const p = (
|
|
828
|
+
const p = (C) => h(C), u = () => {
|
|
829
829
|
document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", u);
|
|
830
830
|
};
|
|
831
831
|
document.addEventListener("mousemove", p), document.addEventListener("mouseup", u);
|
|
@@ -907,11 +907,11 @@ class Zt {
|
|
|
907
907
|
const { h: s, s: n, v: o } = q(t);
|
|
908
908
|
this.hueMarker.style.left = `${s / 360 * 100}%`, this.colorMarker.style.left = `${n * 100}%`, this.colorMarker.style.top = `${(1 - o) * 100}%`, this.colorArea.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${s}, 100%, 50%))`, this.updateOpacityBg(), this.opacityMarker.style.left = `${this.currentOpacity}%`, (y = this.recentSectionRefresh) == null || y.call(this), this.isOpen = !0, this.backdrop.style.display = "block", this.backdrop.parentElement || document.body.appendChild(this.backdrop), this.element.style.display = "block", this.element.style.position = "fixed", this.element.style.zIndex = "10002", this.element.style.left = "-9999px", this.element.style.top = "0px", this.element.parentElement || document.body.appendChild(this.element);
|
|
909
909
|
const a = this.element.offsetWidth, l = this.element.offsetHeight, r = e.getBoundingClientRect(), h = window.innerWidth, d = window.innerHeight, p = 16;
|
|
910
|
-
let u = r.right + 8,
|
|
910
|
+
let u = r.right + 8, C = r.top;
|
|
911
911
|
const m = h - r.right, g = r.left;
|
|
912
912
|
m >= a + p ? u = r.right + 8 : g >= a + p ? u = r.left - a - 8 : u = Math.max(p, (h - a) / 2);
|
|
913
|
-
const
|
|
914
|
-
|
|
913
|
+
const f = d - r.bottom, v = r.top;
|
|
914
|
+
f >= l + p ? C = r.bottom + 8 : v >= l + p ? C = r.top - l - 8 : f > v ? (C = r.bottom + 8, C + l > d - p && (C = d - l - p)) : (C = r.top - l - 8, C < p && (C = p)), this.element.style.left = `${u}px`, this.element.style.top = `${C}px`;
|
|
915
915
|
}
|
|
916
916
|
close(t) {
|
|
917
917
|
var e;
|
|
@@ -963,7 +963,7 @@ class Jt {
|
|
|
963
963
|
r.className = "color-picker-opacity embedded", this.opacitySlider = r;
|
|
964
964
|
const h = document.createElement("div");
|
|
965
965
|
h.className = "color-picker-opacity-marker", this.opacityMarker = h, r.appendChild(h), o.appendChild(a), o.appendChild(r), s.appendChild(n), s.appendChild(o);
|
|
966
|
-
const d =
|
|
966
|
+
const d = ut((b) => {
|
|
967
967
|
const k = V(b);
|
|
968
968
|
k && k.type !== "solid" ? this.onColorChange(b, this.currentOpacity) : (this.setColor(b), this.onColorChange(this.currentColor, this.currentOpacity));
|
|
969
969
|
}, "all");
|
|
@@ -972,38 +972,38 @@ class Jt {
|
|
|
972
972
|
p.className = "color-picker-format-section embedded";
|
|
973
973
|
const u = document.createElement("select");
|
|
974
974
|
u.className = "color-picker-format-select", this.select = u;
|
|
975
|
-
const
|
|
976
|
-
|
|
975
|
+
const C = document.createElement("option");
|
|
976
|
+
C.value = "hex", C.textContent = "HEX";
|
|
977
977
|
const m = document.createElement("option");
|
|
978
978
|
m.value = "rgb", m.textContent = "RGB";
|
|
979
979
|
const g = document.createElement("option");
|
|
980
|
-
g.value = "hsl", g.textContent = "HSL", u.appendChild(
|
|
981
|
-
const
|
|
982
|
-
|
|
980
|
+
g.value = "hsl", g.textContent = "HSL", u.appendChild(C), u.appendChild(m), u.appendChild(g);
|
|
981
|
+
const f = document.createElement("input");
|
|
982
|
+
f.type = "text", f.className = "color-picker-color-input", this.input = f;
|
|
983
983
|
const v = document.createElement("div");
|
|
984
984
|
v.className = "color-picker-input-container";
|
|
985
985
|
const y = document.createElement("button");
|
|
986
|
-
return y.className = "color-picker-copy-inside", y.textContent = "Copy", v.appendChild(
|
|
986
|
+
return y.className = "color-picker-copy-inside", y.textContent = "Copy", v.appendChild(f), v.appendChild(y), p.appendChild(u), p.appendChild(v), t.appendChild(e), t.appendChild(s), t.appendChild(p), t.appendChild(d.container), this.bind(e, a, r, f, u, y, n), t;
|
|
987
987
|
}
|
|
988
988
|
bind(t, e, i, s, n, o, a) {
|
|
989
989
|
const l = (p, u) => {
|
|
990
|
-
const
|
|
990
|
+
const C = u || t.getBoundingClientRect(), m = Math.max(0, Math.min(1, (p.clientX - C.left) / C.width)), g = Math.max(0, Math.min(1, (p.clientY - C.top) / C.height));
|
|
991
991
|
this.colorMarker.style.left = `${m * 100}%`, this.colorMarker.style.top = `${g * 100}%`;
|
|
992
992
|
const v = this.parsePercentage(this.hueMarker.style.left || "0%") * 360, y = Z(v, m, 1 - g);
|
|
993
993
|
this.currentColor = y, this.syncInput(), this.updateOpacityBg(), this.queueChange();
|
|
994
994
|
}, r = (p, u) => {
|
|
995
|
-
const
|
|
995
|
+
const C = u || e.getBoundingClientRect(), m = Math.max(0, Math.min(1, (p.clientX - C.left) / C.width));
|
|
996
996
|
this.hueMarker.style.left = `${m * 100}%`;
|
|
997
|
-
const g = m * 360,
|
|
997
|
+
const g = m * 360, f = this.parsePercentage(this.colorMarker.style.left || "0%"), v = this.parsePercentage(this.colorMarker.style.top || "0%"), y = Z(g, f, 1 - v);
|
|
998
998
|
this.currentColor = y, this.colorArea.style.background = `linear-gradient(to top, #000, transparent),
|
|
999
999
|
linear-gradient(to right, #fff, hsl(${g}, 100%, 50%))`, this.syncInput(), this.updateOpacityBg(), this.queueChange();
|
|
1000
1000
|
}, h = (p, u) => {
|
|
1001
|
-
const
|
|
1001
|
+
const C = u || i.getBoundingClientRect(), m = Math.max(0, Math.min(1, (p.clientX - C.left) / C.width));
|
|
1002
1002
|
this.opacityMarker.style.left = `${m * 100}%`, this.currentOpacity = this.clampOpacity(m * 100), this.queueChange();
|
|
1003
|
-
}, d = (p, u,
|
|
1004
|
-
p.preventDefault(), this.isDragging = !0, this.cachedRect =
|
|
1003
|
+
}, d = (p, u, C) => {
|
|
1004
|
+
p.preventDefault(), this.isDragging = !0, this.cachedRect = C.getBoundingClientRect(), u(p, this.cachedRect);
|
|
1005
1005
|
let m = null, g;
|
|
1006
|
-
const
|
|
1006
|
+
const f = () => {
|
|
1007
1007
|
this.dragRafId === void 0 && (this.dragRafId = window.requestAnimationFrame(() => {
|
|
1008
1008
|
this.dragRafId = void 0, m && this.cachedRect && u(m, this.cachedRect);
|
|
1009
1009
|
}));
|
|
@@ -1015,7 +1015,7 @@ class Jt {
|
|
|
1015
1015
|
v();
|
|
1016
1016
|
return;
|
|
1017
1017
|
}
|
|
1018
|
-
m = y,
|
|
1018
|
+
m = y, f();
|
|
1019
1019
|
}, document.addEventListener("mousemove", g), document.addEventListener("mouseup", v), window.addEventListener("blur", v);
|
|
1020
1020
|
};
|
|
1021
1021
|
t.addEventListener("mousedown", (p) => {
|
|
@@ -1335,7 +1335,7 @@ const P = class P extends w {
|
|
|
1335
1335
|
t.appendChild(l);
|
|
1336
1336
|
}
|
|
1337
1337
|
const i = document.createElement("button");
|
|
1338
|
-
i.type = "button", i.className = "gradient-popover-close", i.innerHTML = Tt, i.addEventListener("click", () => this.closePopover()), t.appendChild(i),
|
|
1338
|
+
i.type = "button", i.className = "gradient-popover-close", i.innerHTML = Tt, i.addEventListener("click", () => this.closePopover()), t.appendChild(i), pt(t, this.popoverEl, (l, r) => {
|
|
1339
1339
|
this.popoverPosition = { left: l, top: r };
|
|
1340
1340
|
});
|
|
1341
1341
|
const s = document.createElement("div");
|
|
@@ -1443,11 +1443,11 @@ const P = class P extends w {
|
|
|
1443
1443
|
const u = w.GlobalVariableGroups || [
|
|
1444
1444
|
{ title: "Global Colors", keys: ["primary", "secondary", "tertiary", "accent"] },
|
|
1445
1445
|
{ title: "Text Color", keys: ["text-dark", "text-light"] }
|
|
1446
|
-
],
|
|
1446
|
+
], C = this.globalSearchQuery.toLowerCase();
|
|
1447
1447
|
let m;
|
|
1448
1448
|
this.globalLayoutMode === "list" ? (m = document.createElement("div"), m.className = "global-colors-list") : (m = document.createElement("div"), m.className = "global-colors-grid"), d.appendChild(m), u.forEach((g) => {
|
|
1449
|
-
const
|
|
1450
|
-
|
|
1449
|
+
const f = Object.entries(p).filter(([v]) => !g.keys.includes(v) && g.title !== "Global Colors" ? !1 : g.keys.includes(v) && v.toLowerCase().includes(C));
|
|
1450
|
+
f.length !== 0 && f.forEach(([v, y]) => {
|
|
1451
1451
|
if (this.globalLayoutMode === "list") {
|
|
1452
1452
|
const b = document.createElement("div");
|
|
1453
1453
|
b.className = "global-color-row";
|
|
@@ -1524,8 +1524,8 @@ const P = class P extends w {
|
|
|
1524
1524
|
p.value = "linear", p.textContent = "Linear";
|
|
1525
1525
|
const u = document.createElement("option");
|
|
1526
1526
|
u.value = "radial", u.textContent = "Radial", d.appendChild(p), d.appendChild(u), d.value = this.value.type === "radial" ? "radial" : "linear", e = document.createElement("input"), e.type = "text", e.inputMode = "numeric", e.className = "gradient-degree-input", e.value = `${this.value.angle ?? 90}°`, e.style.width = "75px", e.style.textAlign = "center", (!this.value.angle || this.value.stops.length < 2) && (this.value.angle = 90, e.value = "90°");
|
|
1527
|
-
const
|
|
1528
|
-
|
|
1527
|
+
const C = document.createElement("button");
|
|
1528
|
+
C.type = "button", C.className = "gradient-flip-btn", C.innerHTML = zt, d.addEventListener("change", () => {
|
|
1529
1529
|
this.clearGlobalBindingForCustomChange(), this.switchType(d.value === "radial" ? "radial" : "linear", !0), e && this.updateDegreeVisibility(e);
|
|
1530
1530
|
}), e.addEventListener("focus", (m) => {
|
|
1531
1531
|
const g = m.target;
|
|
@@ -1538,13 +1538,13 @@ const P = class P extends w {
|
|
|
1538
1538
|
var v;
|
|
1539
1539
|
this.previewUpdateTimeout && (clearTimeout(this.previewUpdateTimeout), this.previewUpdateTimeout = null);
|
|
1540
1540
|
const g = m.target;
|
|
1541
|
-
let
|
|
1542
|
-
Number.isNaN(
|
|
1543
|
-
}),
|
|
1541
|
+
let f = parseInt(g.value);
|
|
1542
|
+
Number.isNaN(f) && (f = ((v = this.value) == null ? void 0 : v.angle) ?? 0), f = Math.max(0, Math.min(360, f)), this.value && (this.value.angle = f), g.value = `${f}°`, this.updateGradientPreview(), this.updateUI(), this.triggerChange();
|
|
1543
|
+
}), C.addEventListener("click", () => {
|
|
1544
1544
|
this.clearGlobalBindingForCustomChange(), !(!this.value || !this.value.stops) && (this.value.stops.forEach((m) => {
|
|
1545
1545
|
m.position = 100 - m.position;
|
|
1546
1546
|
}), this.value.stops.sort((m, g) => m.position - g.position), this.updateGradientPreview(i), this.createHandles(s, i), this.updateStopsList(l), this.updateUI(), this.triggerChange());
|
|
1547
|
-
}), h.appendChild(d), h.appendChild(e), h.appendChild(
|
|
1547
|
+
}), h.appendChild(d), h.appendChild(e), h.appendChild(C), t.appendChild(h), this.updateDegreeVisibility(e);
|
|
1548
1548
|
}
|
|
1549
1549
|
const i = document.createElement("div");
|
|
1550
1550
|
i.className = "gradient-preview", this.updateGradientPreview(i);
|
|
@@ -1554,8 +1554,8 @@ const P = class P extends w {
|
|
|
1554
1554
|
const d = h.target;
|
|
1555
1555
|
if (d.classList.contains("gstop-handle") || d.classList.contains("gstop-chip"))
|
|
1556
1556
|
return;
|
|
1557
|
-
const p = i.getBoundingClientRect(),
|
|
1558
|
-
this.clearGlobalBindingForCustomChange(), this.addStopAtPosition(
|
|
1557
|
+
const p = i.getBoundingClientRect(), C = (h.clientX - p.left) / p.width * 100;
|
|
1558
|
+
this.clearGlobalBindingForCustomChange(), this.addStopAtPosition(C), this.updateStopsList(), this.updateGradientPreview(i), this.createHandles(s, i), this.updateUI(), ((m = document.activeElement) == null ? void 0 : m.tagName) !== "INPUT" && this.repositionPopover(), this.triggerChange();
|
|
1559
1559
|
});
|
|
1560
1560
|
const n = document.createElement("div");
|
|
1561
1561
|
n.className = "gradient-stops-header";
|
|
@@ -1565,7 +1565,7 @@ const P = class P extends w {
|
|
|
1565
1565
|
a.type = "button", a.className = "gradient-add-stop", a.textContent = "+", n.appendChild(o), n.appendChild(a);
|
|
1566
1566
|
const l = document.createElement("div");
|
|
1567
1567
|
l.className = "gradient-stops", t.appendChild(n), t.appendChild(l), this.updateStopsList(l);
|
|
1568
|
-
const r =
|
|
1568
|
+
const r = ut((h) => {
|
|
1569
1569
|
const d = V(h);
|
|
1570
1570
|
d && (this.clearGlobalBindingForCustomChange(), this.value = d, this.switchType(d.type, !0), this.updateUI(), this.triggerChange());
|
|
1571
1571
|
}, "all");
|
|
@@ -1604,31 +1604,31 @@ const P = class P extends w {
|
|
|
1604
1604
|
o.style.backgroundColor = a, n.appendChild(o);
|
|
1605
1605
|
let l = !1, r = !1, h = 0, d = 0;
|
|
1606
1606
|
const p = (m) => {
|
|
1607
|
-
l = !0, r = !1, h = m.clientX, d = this.value.stops[s].position, n.classList.add("selected"), document.addEventListener("mousemove", u), document.addEventListener("mouseup",
|
|
1607
|
+
l = !0, r = !1, h = m.clientX, d = this.value.stops[s].position, n.classList.add("selected"), document.addEventListener("mousemove", u), document.addEventListener("mouseup", C), m.preventDefault(), m.stopPropagation();
|
|
1608
1608
|
}, u = (m) => {
|
|
1609
1609
|
if (!l || !this.value) return;
|
|
1610
1610
|
const g = m.clientX - h;
|
|
1611
1611
|
if (Math.abs(g) > 3 && (r = !0), r) {
|
|
1612
1612
|
this.clearGlobalBindingForCustomChange();
|
|
1613
|
-
const
|
|
1614
|
-
let v = d + g /
|
|
1613
|
+
const f = e.getBoundingClientRect();
|
|
1614
|
+
let v = d + g / f.width * 100;
|
|
1615
1615
|
v = Math.max(0, Math.min(100, v)), this.value.stops[s].position = Math.round(v), n.style.left = `${v}%`, this.updateGradientPreview();
|
|
1616
1616
|
}
|
|
1617
|
-
},
|
|
1617
|
+
}, C = (m) => {
|
|
1618
1618
|
var g;
|
|
1619
1619
|
if (l)
|
|
1620
|
-
if (l = !1, n.classList.remove("selected"), document.removeEventListener("mousemove", u), document.removeEventListener("mouseup",
|
|
1621
|
-
this.value && (this.value.stops.sort((
|
|
1620
|
+
if (l = !1, n.classList.remove("selected"), document.removeEventListener("mousemove", u), document.removeEventListener("mouseup", C), r)
|
|
1621
|
+
this.value && (this.value.stops.sort((f, v) => f.position - v.position), this.createHandles(t, e), this.updateStopsList()), this.updateUI(), this.triggerChange();
|
|
1622
1622
|
else {
|
|
1623
1623
|
m.stopPropagation();
|
|
1624
|
-
const
|
|
1625
|
-
|
|
1624
|
+
const f = (g = this.value) == null ? void 0 : g.stops[s];
|
|
1625
|
+
f && setTimeout(() => {
|
|
1626
1626
|
const v = this.getSharedStopColorPicker();
|
|
1627
1627
|
v.getIsOpen() && v.close(!1), this.colorPickerStopIndex = s, v.setOnChange((b, k) => {
|
|
1628
1628
|
this.clearGlobalBindingForCustomChange(), this.value && this.value.stops[s] && (this.value.stops[s].color = b, k !== void 0 && (this.value.stops[s].opacity = k), o.style.backgroundColor = b, this.updateGradientPreview(), this.updateStopsList(), this.updateUI(), this.triggerChange());
|
|
1629
1629
|
});
|
|
1630
|
-
const y = this.resolveGlobalVarColor(
|
|
1631
|
-
v.open(y, o,
|
|
1630
|
+
const y = this.resolveGlobalVarColor(f.color);
|
|
1631
|
+
v.open(y, o, f.opacity ?? 100);
|
|
1632
1632
|
}, 0);
|
|
1633
1633
|
}
|
|
1634
1634
|
};
|
|
@@ -1654,24 +1654,24 @@ const P = class P extends w {
|
|
|
1654
1654
|
p.type = "text", p.className = "gstop-color-input", p.value = h.replace("#", "").toUpperCase();
|
|
1655
1655
|
const u = document.createElement("button");
|
|
1656
1656
|
u.type = "button", u.className = "gstop-color-copy", u.textContent = "Copy", r.appendChild(d), r.appendChild(p), r.appendChild(u);
|
|
1657
|
-
const
|
|
1658
|
-
|
|
1657
|
+
const C = document.createElement("button");
|
|
1658
|
+
C.type = "button", C.className = "gstop-del", C.innerHTML = Wt, C.disabled = (((k = (b = this.value) == null ? void 0 : b.stops) == null ? void 0 : k.length) || 0) <= 2, o.appendChild(a), o.appendChild(r), o.appendChild(C), e.appendChild(o);
|
|
1659
1659
|
const m = document.createElement("span");
|
|
1660
1660
|
m.className = "gstop-opacity-label", m.textContent = "Opacity";
|
|
1661
1661
|
const g = document.createElement("div");
|
|
1662
1662
|
g.className = "gstop-opacity-group";
|
|
1663
|
-
const
|
|
1664
|
-
|
|
1663
|
+
const f = document.createElement("input");
|
|
1664
|
+
f.type = "range", f.className = "gstop-opacity-slider", f.min = "0", f.max = "100", f.value = String(s.opacity ?? 100);
|
|
1665
1665
|
const v = N(h);
|
|
1666
|
-
|
|
1666
|
+
f.style.setProperty("--slider-color", `rgb(${v.r}, ${v.g}, ${v.b})`), f.style.setProperty("--slider-color-transparent", `rgba(${v.r}, ${v.g}, ${v.b}, 0)`);
|
|
1667
1667
|
const y = document.createElement("span");
|
|
1668
|
-
y.className = "gstop-opacity-value", y.textContent = `${s.opacity ?? 100}%`, g.appendChild(
|
|
1668
|
+
y.className = "gstop-opacity-value", y.textContent = `${s.opacity ?? 100}%`, g.appendChild(f), g.appendChild(y), p.addEventListener("click", (x) => {
|
|
1669
1669
|
x.preventDefault(), x.stopPropagation();
|
|
1670
1670
|
const E = this.getSharedStopColorPicker();
|
|
1671
1671
|
E.getIsOpen() && E.close(!1), this.colorPickerStopIndex = n, E.setOnChange((S, G) => {
|
|
1672
|
-
this.clearGlobalBindingForCustomChange(), p.value = S.replace("#", "").toUpperCase(), d.style.backgroundColor = S, this.value.stops[n].color = S, G !== void 0 && (this.value.stops[n].opacity = G,
|
|
1672
|
+
this.clearGlobalBindingForCustomChange(), p.value = S.replace("#", "").toUpperCase(), d.style.backgroundColor = S, this.value.stops[n].color = S, G !== void 0 && (this.value.stops[n].opacity = G, f.value = String(G), y.textContent = `${G}%`);
|
|
1673
1673
|
const W = N(S);
|
|
1674
|
-
|
|
1674
|
+
f.style.setProperty("--slider-color", `rgb(${W.r}, ${W.g}, ${W.b})`), f.style.setProperty("--slider-color-transparent", `rgba(${W.r}, ${W.g}, ${W.b}, 0)`), this.updateGradientPreview(), this.createHandles(
|
|
1675
1675
|
this.popoverEl.querySelector(".gradient-handles"),
|
|
1676
1676
|
this.popoverEl.querySelector(".gradient-preview")
|
|
1677
1677
|
), this.updateUI(), this.triggerChange();
|
|
@@ -1684,7 +1684,7 @@ const P = class P extends w {
|
|
|
1684
1684
|
if (/^#[0-9A-Fa-f]{6}$/.test(E)) {
|
|
1685
1685
|
this.value.stops[n].color = E, d.style.backgroundColor = E;
|
|
1686
1686
|
const L = N(E);
|
|
1687
|
-
|
|
1687
|
+
f.style.setProperty("--slider-color", `rgb(${L.r}, ${L.g}, ${L.b})`), f.style.setProperty("--slider-color-transparent", `rgba(${L.r}, ${L.g}, ${L.b}, 0)`), this.debouncedPreviewUpdate();
|
|
1688
1688
|
}
|
|
1689
1689
|
}), p.addEventListener("blur", () => {
|
|
1690
1690
|
this.previewUpdateTimeout && (clearTimeout(this.previewUpdateTimeout), this.previewUpdateTimeout = null), this.updateGradientPreview(), this.updateUI(), this.triggerChange();
|
|
@@ -1717,17 +1717,17 @@ const P = class P extends w {
|
|
|
1717
1717
|
this.popoverEl.querySelector(".gradient-handles"),
|
|
1718
1718
|
this.popoverEl.querySelector(".gradient-preview")
|
|
1719
1719
|
), this.updateStopsList(), this.updateUI(), this.triggerChange();
|
|
1720
|
-
}),
|
|
1720
|
+
}), C.addEventListener("click", () => {
|
|
1721
1721
|
var x, E;
|
|
1722
1722
|
(this.value.stops.length || 0) <= 2 || ((x = this.sharedStopColorPicker) != null && x.getIsOpen() && this.colorPickerStopIndex === n ? (this.sharedStopColorPicker.close(!1), this.colorPickerStopIndex = null) : this.colorPickerStopIndex !== null && this.colorPickerStopIndex > n && this.colorPickerStopIndex--, this.clearGlobalBindingForCustomChange(), this.value.stops.splice(n, 1), this.createHandles(
|
|
1723
1723
|
this.popoverEl.querySelector(".gradient-handles"),
|
|
1724
1724
|
this.popoverEl.querySelector(".gradient-preview")
|
|
1725
1725
|
), this.updateStopsList(), this.updateGradientPreview(), this.updateUI(), ((E = document.activeElement) == null ? void 0 : E.tagName) !== "INPUT" && this.repositionPopover(), this.triggerChange());
|
|
1726
|
-
}),
|
|
1726
|
+
}), f.addEventListener("input", () => {
|
|
1727
1727
|
this.clearGlobalBindingForCustomChange();
|
|
1728
|
-
const x = parseInt(
|
|
1728
|
+
const x = parseInt(f.value, 10);
|
|
1729
1729
|
this.value.stops[n].opacity = Math.max(0, Math.min(100, x)), y.textContent = `${this.value.stops[n].opacity}%`, this.debouncedPreviewUpdate();
|
|
1730
|
-
}),
|
|
1730
|
+
}), f.addEventListener("change", () => {
|
|
1731
1731
|
this.clearGlobalBindingForCustomChange(), this.previewUpdateTimeout && (clearTimeout(this.previewUpdateTimeout), this.previewUpdateTimeout = null), this.updateGradientPreview(), this.updateUI(), this.triggerChange();
|
|
1732
1732
|
});
|
|
1733
1733
|
}));
|
|
@@ -1755,8 +1755,8 @@ const P = class P extends w {
|
|
|
1755
1755
|
if (s === n || s.position === n.position)
|
|
1756
1756
|
o = s.color, a = s.opacity ?? 100;
|
|
1757
1757
|
else {
|
|
1758
|
-
const r = (e - s.position) / (n.position - s.position), h = N(s.color), d = N(n.color), p = Math.round(h.r + (d.r - h.r) * r), u = Math.round(h.g + (d.g - h.g) * r),
|
|
1759
|
-
o = `#${p.toString(16).padStart(2, "0")}${u.toString(16).padStart(2, "0")}${
|
|
1758
|
+
const r = (e - s.position) / (n.position - s.position), h = N(s.color), d = N(n.color), p = Math.round(h.r + (d.r - h.r) * r), u = Math.round(h.g + (d.g - h.g) * r), C = Math.round(h.b + (d.b - h.b) * r);
|
|
1759
|
+
o = `#${p.toString(16).padStart(2, "0")}${u.toString(16).padStart(2, "0")}${C.toString(16).padStart(2, "0")}`.toUpperCase(), a = Math.round((s.opacity ?? 100) + ((n.opacity ?? 100) - (s.opacity ?? 100)) * r);
|
|
1760
1760
|
}
|
|
1761
1761
|
const l = {
|
|
1762
1762
|
position: Math.round(e),
|
|
@@ -1795,8 +1795,8 @@ const P = class P extends w {
|
|
|
1795
1795
|
let l = e.right + 8, r = e.top;
|
|
1796
1796
|
const h = s - e.right, d = e.left, p = i + o;
|
|
1797
1797
|
h < p && d > h + 100 && (l = e.left - i - 8);
|
|
1798
|
-
const u = n - e.bottom,
|
|
1799
|
-
|
|
1798
|
+
const u = n - e.bottom, C = e.top;
|
|
1799
|
+
C >= a + o ? r = e.top - a - 8 : u >= a + o ? r = e.bottom + 8 : C > u ? (r = e.top - a - 8, r < o && (r = o)) : (r = e.bottom + 8, r + a > n - o && (r = n - a - o)), this.popoverEl.style.left = `${l}px`, this.popoverEl.style.top = `${r}px`;
|
|
1800
1800
|
});
|
|
1801
1801
|
}
|
|
1802
1802
|
}
|
|
@@ -1881,7 +1881,7 @@ function Y(c, t) {
|
|
|
1881
1881
|
const ot = class ot {
|
|
1882
1882
|
constructor(t) {
|
|
1883
1883
|
this.elementRef = null, this.isHidden = !1, this.custom = !1, this.initialValues = {}, this.changeTimeout = null, this.isHandlingChange = !1, this.changeHandlers = /* @__PURE__ */ new Set(), this.blurTimeout = null, this.lastChangeTime = 0, this.handleBlur = () => {
|
|
1884
|
-
}, this.pendingBlurHandler = null, this.originalDefaultValues = {}, this.nestingLevel = 0, this.dataPropsPath = "", this.hide = !1, this.id = t.id ||
|
|
1884
|
+
}, this.pendingBlurHandler = null, this.originalDefaultValues = {}, this.nestingLevel = 0, this.dataPropsPath = "", this.hide = !1, this.id = t.id || dt(), this.title = t.title, this.settings = t.settings, this.isCollapsed = t.collapsed ?? !1, this.isMain = t.main ?? !1, this.custom = t.custom ?? !1, this.nestingLevel = 0, this.includeGetJson = t.includeGetJson ?? !0, this.addItemCfg = t.addItem, this.deleteItemCfg = t.deleteItem, this.dataProps = t.dataProps, this.dataPropsPath = t.dataProps || "", this.hide = t.hide ?? !1, Object.assign(this, t.settings), this.initialValues = this.getValues(), this.originalDefaultValues = this.getDefaultValues(), this.propagateNestingLevel(), this.propagateDataPropsPath();
|
|
1885
1885
|
}
|
|
1886
1886
|
propagateNestingLevel() {
|
|
1887
1887
|
const t = this.nestingLevel + 1;
|
|
@@ -1988,8 +1988,8 @@ const ot = class ot {
|
|
|
1988
1988
|
M(h) ? h.setValue(
|
|
1989
1989
|
u
|
|
1990
1990
|
) : R(h) ? (p = h.setValue) == null || p.call(h, u) : h.setValue && h.setValue(u);
|
|
1991
|
-
} catch (
|
|
1992
|
-
console.warn(`Could not preserve value for setting ${r}:`,
|
|
1991
|
+
} catch (C) {
|
|
1992
|
+
console.warn(`Could not preserve value for setting ${r}:`, C);
|
|
1993
1993
|
}
|
|
1994
1994
|
}
|
|
1995
1995
|
}), this.settings = t, this.propagateNestingLevel(), this.propagateDataPropsPath();
|
|
@@ -2091,7 +2091,7 @@ const ot = class ot {
|
|
|
2091
2091
|
const o = i.slice(this.addItemCfg.keyPrefix.length), a = Number(o);
|
|
2092
2092
|
if (Number.isFinite(a)) {
|
|
2093
2093
|
const l = this.addItemCfg.createItem(a);
|
|
2094
|
-
|
|
2094
|
+
ft(l) && (this.addSetting(i, l), n = l);
|
|
2095
2095
|
}
|
|
2096
2096
|
}
|
|
2097
2097
|
n && (M(n) || R(n)) && typeof n.setValue == "function" && n.setValue(s);
|
|
@@ -2125,7 +2125,7 @@ const ot = class ot {
|
|
|
2125
2125
|
p && t.startsWith(p) && this.addDeleteButtonToElement(l, t);
|
|
2126
2126
|
}
|
|
2127
2127
|
const h = o.querySelector(".sg-add-button-bottom");
|
|
2128
|
-
h ? o.insertBefore(l, h) : o.appendChild(l),
|
|
2128
|
+
h ? o.insertBefore(l, h) : o.appendChild(l), vt.trackElement(l), Q(l, this.nestingLevel + 1), lt(l, this.nestingLevel + 1);
|
|
2129
2129
|
const d = l.style.display;
|
|
2130
2130
|
l.style.display = "none", l.offsetHeight, l.style.display = d, this.updateNestingStyles();
|
|
2131
2131
|
}
|
|
@@ -2446,14 +2446,14 @@ const ot = class ot {
|
|
|
2446
2446
|
</svg>`;
|
|
2447
2447
|
h.innerHTML = `${d}<span style="margin-left:4px;">${this.addItemCfg.buttonLabel ?? "Add"}</span>`, h.addEventListener("click", (p) => {
|
|
2448
2448
|
p.stopPropagation(), p.preventDefault();
|
|
2449
|
-
const u = this.getNextIndexFromPrefix(this.addItemCfg.keyPrefix),
|
|
2450
|
-
if (
|
|
2449
|
+
const u = this.getNextIndexFromPrefix(this.addItemCfg.keyPrefix), C = this.addItemCfg.createItem(u);
|
|
2450
|
+
if (ft(C)) {
|
|
2451
2451
|
const m = `${this.addItemCfg.keyPrefix}${u}`;
|
|
2452
|
-
this.addSetting(m,
|
|
2452
|
+
this.addSetting(m, C);
|
|
2453
2453
|
}
|
|
2454
2454
|
}), a.appendChild(h);
|
|
2455
2455
|
}
|
|
2456
|
-
return e.appendChild(i), e.appendChild(n), t.appendChild(e), t.appendChild(a), this.elementRef = t,
|
|
2456
|
+
return e.appendChild(i), e.appendChild(n), t.appendChild(e), t.appendChild(a), this.elementRef = t, vt.trackElement(t), setTimeout(() => {
|
|
2457
2457
|
this.updateNestingStyles();
|
|
2458
2458
|
}, 0), this.pendingBlurHandler && (this.pendingBlurHandler = null), t;
|
|
2459
2459
|
}
|
|
@@ -2669,15 +2669,15 @@ class H extends Kt {
|
|
|
2669
2669
|
g.textContent = "No global colors defined", g.style.gridColumn = "1 / -1", g.style.fontSize = "12px", g.style.color = "#666", a.appendChild(g);
|
|
2670
2670
|
return;
|
|
2671
2671
|
}
|
|
2672
|
-
Object.entries(m).forEach(([g,
|
|
2672
|
+
Object.entries(m).forEach(([g, f]) => {
|
|
2673
2673
|
const v = document.createElement("button");
|
|
2674
|
-
v.className = "global-color-btn", v.title = g, v.style.width = "30px", v.style.height = "30px", v.style.borderRadius = "50%", v.style.border = "1px solid #ddd", v.style.backgroundColor =
|
|
2674
|
+
v.className = "global-color-btn", v.title = g, v.style.width = "30px", v.style.height = "30px", v.style.borderRadius = "50%", v.style.border = "1px solid #ddd", v.style.backgroundColor = f, v.style.cursor = "pointer", this.value === `var(--${g})` && (v.style.border = "2px solid #2196f3"), v.addEventListener("click", (y) => {
|
|
2675
2675
|
var k, x;
|
|
2676
2676
|
y.preventDefault();
|
|
2677
2677
|
const b = `var(--${g})`;
|
|
2678
2678
|
this.value = b, (k = this.onChange) == null || k.call(this, b), (x = this.detectChange) == null || x.call(this, b), Array.from(a.children).forEach((E) => {
|
|
2679
2679
|
E.style.border = "1px solid #ddd";
|
|
2680
|
-
}), v.style.border = "2px solid #2196f3", d.style.backgroundColor =
|
|
2680
|
+
}), v.style.border = "2px solid #2196f3", d.style.backgroundColor = f;
|
|
2681
2681
|
}), a.appendChild(v);
|
|
2682
2682
|
});
|
|
2683
2683
|
} catch (m) {
|
|
@@ -2707,33 +2707,33 @@ class H extends Kt {
|
|
|
2707
2707
|
d.style.backgroundColor = p;
|
|
2708
2708
|
const u = document.createElement("input");
|
|
2709
2709
|
u.type = "text", u.className = "color-text-input", u.value = this.value || "", u.placeholder = "#000000", u.setAttribute("pattern", "#[0-9A-Fa-f]{6}"), u.setAttribute("title", "Enter a hex color value (e.g., #ff0000)"), u.setAttribute("aria-label", "Hex color value"), u.setAttribute("maxlength", "7"), this.getDataPropsPath() && u.setAttribute("data-test-id", `${this.getDataPropsPath()}_text`), this.textInputEl = u;
|
|
2710
|
-
const
|
|
2711
|
-
var
|
|
2710
|
+
const C = (m) => {
|
|
2711
|
+
var f, v;
|
|
2712
2712
|
let g = m.trim();
|
|
2713
2713
|
if (g && !g.startsWith("#") && !g.startsWith("var(") && /^[0-9A-Fa-f]{3}$|^[0-9A-Fa-f]{6}$/.test(g) && (g = "#" + g, this.textInputEl && (this.textInputEl.value = g)), this.textInputEl && r(this.textInputEl)) {
|
|
2714
2714
|
const y = H.normalizeColorValue(g);
|
|
2715
|
-
this.value = y, (
|
|
2715
|
+
this.value = y, (f = this.onChange) == null || f.call(this, y), (v = this.detectChange) == null || v.call(this, y), this.colorInputEl && (this.colorInputEl.value = y), d.style.backgroundColor = y;
|
|
2716
2716
|
}
|
|
2717
2717
|
};
|
|
2718
2718
|
return this.textInputEl.addEventListener("input", (m) => {
|
|
2719
2719
|
const g = m.target.value;
|
|
2720
|
-
|
|
2720
|
+
C(g);
|
|
2721
2721
|
}), this.textInputEl.addEventListener("paste", (m) => {
|
|
2722
|
-
var
|
|
2722
|
+
var f;
|
|
2723
2723
|
m.preventDefault();
|
|
2724
|
-
const g = ((
|
|
2725
|
-
this.textInputEl && (this.textInputEl.value = g.trim(),
|
|
2724
|
+
const g = ((f = m.clipboardData) == null ? void 0 : f.getData("text")) || "";
|
|
2725
|
+
this.textInputEl && (this.textInputEl.value = g.trim(), C(g));
|
|
2726
2726
|
}), this.textInputEl.addEventListener("keydown", (m) => {
|
|
2727
|
-
var g,
|
|
2728
|
-
m.key === "Enter" && (m.preventDefault(),
|
|
2727
|
+
var g, f, v;
|
|
2728
|
+
m.key === "Enter" && (m.preventDefault(), C(((g = this.textInputEl) == null ? void 0 : g.value) || ""), (f = this.textInputEl) == null || f.blur()), m.key === "Escape" && (this.textInputEl && this.value && (this.textInputEl.value = this.value), (v = this.textInputEl) == null || v.blur(), e.classList.remove("error"));
|
|
2729
2729
|
}), this.colorInputEl.addEventListener("input", (m) => {
|
|
2730
2730
|
var v, y;
|
|
2731
|
-
const g = m.target.value,
|
|
2732
|
-
this.value =
|
|
2731
|
+
const g = m.target.value, f = H.normalizeColorValue(g);
|
|
2732
|
+
this.value = f, (v = this.onChange) == null || v.call(this, f), (y = this.detectChange) == null || y.call(this, f), this.textInputEl && (this.textInputEl.value = f), d.style.backgroundColor = f, e.classList.remove("error");
|
|
2733
2733
|
}), this.colorInputEl.addEventListener("change", (m) => {
|
|
2734
2734
|
var v, y;
|
|
2735
|
-
const g = m.target.value,
|
|
2736
|
-
this.value =
|
|
2735
|
+
const g = m.target.value, f = H.normalizeColorValue(g);
|
|
2736
|
+
this.value = f, (v = this.onChange) == null || v.call(this, f), (y = this.detectChange) == null || y.call(this, f), this.textInputEl && (this.textInputEl.value = f), d.style.backgroundColor = f;
|
|
2737
2737
|
}), o.appendChild(h), o.appendChild(d), o.appendChild(u), e.appendChild(i), e.appendChild(o), e.appendChild(a), t.appendChild(e), this.element = t, t;
|
|
2738
2738
|
}
|
|
2739
2739
|
getElement() {
|
|
@@ -3360,7 +3360,7 @@ const oe = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewB
|
|
|
3360
3360
|
<circle cx="6.7" cy="6.7" r="1.5" fill="#02CC59" opacity="0.3"/>
|
|
3361
3361
|
</svg>
|
|
3362
3362
|
`;
|
|
3363
|
-
class
|
|
3363
|
+
class gt extends w {
|
|
3364
3364
|
constructor(t = {}) {
|
|
3365
3365
|
super(t), this.inputType = "button", this.previewWrapper = null, this.previewEl = null, this.emptyStateEl = null, this.errorContainer = null, this.messageListener = null, this.loadingSpinner = null, this.props.delete === void 0 && (this.props.delete = !0), this.props.maxFileSizeMB === void 0 && (this.props.maxFileSizeMB = 5), !this.value && t.defaultUrl && t.defaultUrl !== "" && (this.value = t.defaultUrl), this.setupMessageListener();
|
|
3366
3366
|
}
|
|
@@ -3484,7 +3484,7 @@ const st = `
|
|
|
3484
3484
|
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="16" viewBox="0 0 15 16" fill="none">
|
|
3485
3485
|
<path d="M5 10.5L7.5 8M7.5 8L10 10.5M7.5 8V13.625M12.5 10.9643C13.2634 10.3338 13.75 9.37996 13.75 8.3125C13.75 6.41402 12.211 4.875 10.3125 4.875C10.1759 4.875 10.0482 4.80375 9.97882 4.68609C9.16379 3.30302 7.65902 2.375 5.9375 2.375C3.34867 2.375 1.25 4.47367 1.25 7.0625C1.25 8.35381 1.77215 9.52317 2.61684 10.371" stroke="#475467" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3486
3486
|
</svg>
|
|
3487
|
-
`,
|
|
3487
|
+
`, bt = `
|
|
3488
3488
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
|
|
3489
3489
|
<path d="M1.5 7.5C1.5 7.5 3.00374 5.45116 4.22538 4.22868C5.44702 3.0062 7.1352 2.25 9 2.25C12.7279 2.25 15.75 5.27208 15.75 9C15.75 12.7279 12.7279 15.75 9 15.75C5.92268 15.75 3.32633 13.6907 2.51382 10.875M1.5 7.5V3M1.5 7.5H6" stroke="#637381" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3490
3490
|
</svg>
|
|
@@ -3535,7 +3535,7 @@ const st = `
|
|
|
3535
3535
|
<svg xmlns="http://www.w3.org/2000/svg" width="8" height="4" viewBox="0 0 8 4" fill="none">
|
|
3536
3536
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M0 0L2.58579 2.58579C3.36684 3.36684 4.63317 3.36683 5.41421 2.58579L8 0L0 0Z" fill="#1C252E"/>
|
|
3537
3537
|
</svg>
|
|
3538
|
-
`, F = 10,
|
|
3538
|
+
`, F = 10, wt = 5, Ee = 24, be = 50, we = 5e3, xe = 800, Le = 0.8, ke = 700, Me = [
|
|
3539
3539
|
"image/jpeg",
|
|
3540
3540
|
"image/jpg",
|
|
3541
3541
|
"image/png",
|
|
@@ -3554,7 +3554,7 @@ function Ie(c, t) {
|
|
|
3554
3554
|
error: `File size (${(c.size / 1048576).toFixed(1)}MB) exceeds ${t}MB limit.`
|
|
3555
3555
|
} : { valid: !0 };
|
|
3556
3556
|
}
|
|
3557
|
-
function
|
|
3557
|
+
function xt(c, t, e) {
|
|
3558
3558
|
if (!c.length) return [];
|
|
3559
3559
|
const i = t && t.width && t.height && t || e && e.width && e.height && e || null;
|
|
3560
3560
|
return c.map((s) => {
|
|
@@ -3565,7 +3565,7 @@ function wt(c, t, e) {
|
|
|
3565
3565
|
function nt(c) {
|
|
3566
3566
|
return Number.isFinite(c) ? Math.max(0, Math.min(100, c)) : 0;
|
|
3567
3567
|
}
|
|
3568
|
-
function
|
|
3568
|
+
function Lt(c, t, e) {
|
|
3569
3569
|
const i = (c - e.left) / e.width * 100, s = (t - e.top) / e.height * 100;
|
|
3570
3570
|
return {
|
|
3571
3571
|
x: nt(i),
|
|
@@ -3591,7 +3591,7 @@ function Se(c, t) {
|
|
|
3591
3591
|
}
|
|
3592
3592
|
return { index: e, name: i };
|
|
3593
3593
|
}
|
|
3594
|
-
const
|
|
3594
|
+
const mt = class mt {
|
|
3595
3595
|
static show(t, e = we) {
|
|
3596
3596
|
this.injectStyles();
|
|
3597
3597
|
const i = document.createElement("div");
|
|
@@ -3645,8 +3645,8 @@ const gt = class gt {
|
|
|
3645
3645
|
}
|
|
3646
3646
|
}
|
|
3647
3647
|
};
|
|
3648
|
-
|
|
3649
|
-
let _ =
|
|
3648
|
+
mt.styleInjected = !1;
|
|
3649
|
+
let _ = mt;
|
|
3650
3650
|
class Ne {
|
|
3651
3651
|
constructor() {
|
|
3652
3652
|
this.overlayElement = null, this.activePromise = null;
|
|
@@ -3781,7 +3781,7 @@ class Ve {
|
|
|
3781
3781
|
this.handlers.clear(), this.cleanupMessageListener();
|
|
3782
3782
|
}
|
|
3783
3783
|
}
|
|
3784
|
-
const
|
|
3784
|
+
const kt = new Ve();
|
|
3785
3785
|
function Oe(c, t) {
|
|
3786
3786
|
const e = document.createElement("div");
|
|
3787
3787
|
e.className = "marker-container", e.style.left = `${c.x}%`, e.style.top = `${c.y}%`, e.setAttribute("data-marker-id", String(c.id));
|
|
@@ -3902,7 +3902,7 @@ function Ge(c, t, e) {
|
|
|
3902
3902
|
const i = document.createElement("label");
|
|
3903
3903
|
i.className = "image-map-upload-label", i.innerHTML = `
|
|
3904
3904
|
<div class="upload-icon upload-icon-default">${st}</div>
|
|
3905
|
-
<div class="upload-icon upload-icon-replace">${
|
|
3905
|
+
<div class="upload-icon upload-icon-replace">${bt}</div>
|
|
3906
3906
|
<span class="upload-text">Upload Image</span>
|
|
3907
3907
|
`;
|
|
3908
3908
|
const s = document.createElement("input");
|
|
@@ -3915,7 +3915,7 @@ function Ge(c, t, e) {
|
|
|
3915
3915
|
const i = document.createElement("button");
|
|
3916
3916
|
return i.type = "button", i.className = "image-map-upload-label", i.innerHTML = `
|
|
3917
3917
|
<div class="upload-icon upload-icon-default">${st}</div>
|
|
3918
|
-
<div class="upload-icon upload-icon-replace">${
|
|
3918
|
+
<div class="upload-icon upload-icon-replace">${bt}</div>
|
|
3919
3919
|
<span class="upload-text">Upload Image</span>
|
|
3920
3920
|
`, i.addEventListener("click", () => {
|
|
3921
3921
|
window.postMessage(
|
|
@@ -3959,7 +3959,7 @@ function Ue(c, t) {
|
|
|
3959
3959
|
const n = document.createElement("h3");
|
|
3960
3960
|
n.className = "image-map-title", n.textContent = "Prize Map", s.appendChild(n);
|
|
3961
3961
|
const o = document.createElement("button");
|
|
3962
|
-
o.type = "button", o.className = "image-map-close-btn", o.innerHTML = he, o.addEventListener("click", () => void c()), s.appendChild(o),
|
|
3962
|
+
o.type = "button", o.className = "image-map-close-btn", o.innerHTML = he, o.addEventListener("click", () => void c()), s.appendChild(o), pt(s, i, (l, r) => {
|
|
3963
3963
|
t(l, r);
|
|
3964
3964
|
}), i.appendChild(s);
|
|
3965
3965
|
const a = document.createElement("div");
|
|
@@ -3999,7 +3999,7 @@ const je = `<svg xmlns="http://www.w3.org/2000/svg" width="8" height="4" viewBox
|
|
|
3999
3999
|
super(t), this.inputType = {
|
|
4000
4000
|
imageUrl: "text",
|
|
4001
4001
|
markers: "text"
|
|
4002
|
-
}, this.mainDisplayElements = null, this.popoverElements = null, this.imageElement = null, this.cursorTooltip = null, this.popoverPosition = null, this.isPopoverOpen = !1, this.confirmModal = new Ne(), this.previousImageDimensions = null, this.draggingMarkerId = null, this.historyManager = new Pe(), this.isUndoRedoOperation = !1, this.initialValue = null, this.lastMouseX = 0, this.lastMouseY = 0, this.errorTooltipEl = null, this.errorTooltipTimeoutId = null, this.props.maxMarkers = this.props.maxMarkers ?? ((e = this.props.prizeMap) == null ? void 0 : e.length) ?? F, this.props.maxFileSizeMB = this.props.maxFileSizeMB ??
|
|
4002
|
+
}, this.mainDisplayElements = null, this.popoverElements = null, this.imageElement = null, this.cursorTooltip = null, this.popoverPosition = null, this.isPopoverOpen = !1, this.confirmModal = new Ne(), this.previousImageDimensions = null, this.draggingMarkerId = null, this.historyManager = new Pe(), this.isUndoRedoOperation = !1, this.initialValue = null, this.lastMouseX = 0, this.lastMouseY = 0, this.errorTooltipEl = null, this.errorTooltipTimeoutId = null, this.props.maxMarkers = this.props.maxMarkers ?? ((e = this.props.prizeMap) == null ? void 0 : e.length) ?? F, this.props.maxFileSizeMB = this.props.maxFileSizeMB ?? wt, this.props.markerSize = this.props.markerSize ?? Ee, this.value || (this.value = { imageUrl: "", markers: [] }), kt.registerHandler(this.id, (i) => {
|
|
4003
4003
|
this.handleFileManagerImageSelected(i);
|
|
4004
4004
|
}), this.onBackgroundClick = (i) => {
|
|
4005
4005
|
if (this.isPopoverOpen && this.popoverElements && !this.popoverElements.popover.contains(i.target)) {
|
|
@@ -4143,12 +4143,12 @@ const je = `<svg xmlns="http://www.w3.org/2000/svg" width="8" height="4" viewBox
|
|
|
4143
4143
|
this.imageElement = p, h.appendChild(d);
|
|
4144
4144
|
const u = document.createElement("div");
|
|
4145
4145
|
u.className = "prize-list-section";
|
|
4146
|
-
const
|
|
4146
|
+
const C = He(
|
|
4147
4147
|
this.value.markers,
|
|
4148
4148
|
this.props.maxMarkers || F,
|
|
4149
4149
|
this.props.prizeMap
|
|
4150
4150
|
);
|
|
4151
|
-
u.appendChild(
|
|
4151
|
+
u.appendChild(C), r.appendChild(h), r.appendChild(u), t.appendChild(r);
|
|
4152
4152
|
const m = We(
|
|
4153
4153
|
this.hasAllMarkers(),
|
|
4154
4154
|
() => this.handleClearAllMarkers(),
|
|
@@ -4159,10 +4159,10 @@ const je = `<svg xmlns="http://www.w3.org/2000/svg" width="8" height="4" viewBox
|
|
|
4159
4159
|
t.appendChild(m);
|
|
4160
4160
|
const g = h.querySelector(
|
|
4161
4161
|
".image-map-container"
|
|
4162
|
-
),
|
|
4162
|
+
), f = u.querySelector(
|
|
4163
4163
|
".simple-prize-list"
|
|
4164
4164
|
);
|
|
4165
|
-
g && (g.scrollTop = s),
|
|
4165
|
+
g && (g.scrollTop = s), f && (f.scrollTop = n), this.updateCursorTooltipContent();
|
|
4166
4166
|
} else {
|
|
4167
4167
|
const l = Be({
|
|
4168
4168
|
uploadMethod: this.props.upload || "file-manager",
|
|
@@ -4195,7 +4195,7 @@ const je = `<svg xmlns="http://www.w3.org/2000/svg" width="8" height="4" viewBox
|
|
|
4195
4195
|
const s = {
|
|
4196
4196
|
width: i.naturalWidth || 0,
|
|
4197
4197
|
height: i.naturalHeight || 0
|
|
4198
|
-
}, n =
|
|
4198
|
+
}, n = xt(
|
|
4199
4199
|
((o = this.value) == null ? void 0 : o.markers) || [],
|
|
4200
4200
|
e,
|
|
4201
4201
|
s
|
|
@@ -4211,7 +4211,7 @@ const je = `<svg xmlns="http://www.w3.org/2000/svg" width="8" height="4" viewBox
|
|
|
4211
4211
|
handleImageUpload(t) {
|
|
4212
4212
|
const e = this.previousImageDimensions, i = Ie(
|
|
4213
4213
|
t,
|
|
4214
|
-
this.props.maxFileSizeMB ||
|
|
4214
|
+
this.props.maxFileSizeMB || wt
|
|
4215
4215
|
);
|
|
4216
4216
|
if (!i.valid) {
|
|
4217
4217
|
_.show(i.error);
|
|
@@ -4228,7 +4228,7 @@ const je = `<svg xmlns="http://www.w3.org/2000/svg" width="8" height="4" viewBox
|
|
|
4228
4228
|
const r = {
|
|
4229
4229
|
width: l.naturalWidth || 0,
|
|
4230
4230
|
height: l.naturalHeight || 0
|
|
4231
|
-
}, h =
|
|
4231
|
+
}, h = xt(
|
|
4232
4232
|
((d = this.value) == null ? void 0 : d.markers) || [],
|
|
4233
4233
|
e,
|
|
4234
4234
|
r
|
|
@@ -4252,7 +4252,7 @@ const je = `<svg xmlns="http://www.w3.org/2000/svg" width="8" height="4" viewBox
|
|
|
4252
4252
|
this.showErrorTooltip(r, t.clientX, t.clientY);
|
|
4253
4253
|
return;
|
|
4254
4254
|
}
|
|
4255
|
-
const e = this.imageElement.getBoundingClientRect(), { x: i, y: s } =
|
|
4255
|
+
const e = this.imageElement.getBoundingClientRect(), { x: i, y: s } = Lt(t.clientX, t.clientY, e), n = Vt(this.value.markers);
|
|
4256
4256
|
let o;
|
|
4257
4257
|
this.props.prizeMap && this.props.prizeMap.length > 0 && (o = this.props.prizeMap[n - 1]);
|
|
4258
4258
|
const a = {
|
|
@@ -4268,7 +4268,7 @@ const je = `<svg xmlns="http://www.w3.org/2000/svg" width="8" height="4" viewBox
|
|
|
4268
4268
|
var a;
|
|
4269
4269
|
if (this.draggingMarkerId === null || !this.imageElement || !this.value)
|
|
4270
4270
|
return;
|
|
4271
|
-
const e = this.imageElement.getBoundingClientRect(), { x: i, y: s } =
|
|
4271
|
+
const e = this.imageElement.getBoundingClientRect(), { x: i, y: s } = Lt(t.clientX, t.clientY, e), n = this.value.markers.map(
|
|
4272
4272
|
(l) => l.id === this.draggingMarkerId ? { ...l, x: i, y: s } : l
|
|
4273
4273
|
), o = (a = this.popoverElements) == null ? void 0 : a.popover.querySelector(
|
|
4274
4274
|
`[data-marker-id="${this.draggingMarkerId}"]`
|
|
@@ -4395,11 +4395,11 @@ const je = `<svg xmlns="http://www.w3.org/2000/svg" width="8" height="4" viewBox
|
|
|
4395
4395
|
this.popoverElements.backdrop
|
|
4396
4396
|
), this.popoverElements.popover.parentElement && this.popoverElements.popover.parentElement.removeChild(
|
|
4397
4397
|
this.popoverElements.popover
|
|
4398
|
-
)), document.removeEventListener("click", this.onBackgroundClick, !0), document.removeEventListener("keydown", this.handlePopoverKeydown, !0),
|
|
4398
|
+
)), document.removeEventListener("click", this.onBackgroundClick, !0), document.removeEventListener("keydown", this.handlePopoverKeydown, !0), kt.unregisterHandler(this.id), this.confirmModal.cleanup();
|
|
4399
4399
|
}
|
|
4400
4400
|
};
|
|
4401
4401
|
A.openInstance = null;
|
|
4402
|
-
let
|
|
4402
|
+
let Mt = A;
|
|
4403
4403
|
class _e extends B {
|
|
4404
4404
|
constructor(t = {}) {
|
|
4405
4405
|
super({
|
|
@@ -4743,7 +4743,7 @@ class Ci extends B {
|
|
|
4743
4743
|
}
|
|
4744
4744
|
class yi extends w {
|
|
4745
4745
|
constructor(t) {
|
|
4746
|
-
super(t), this.inputType = {}, this.container = null, this.defaultLanguage = "", this.uploadSettings = /* @__PURE__ */ new Map(), this.popup = null, t.default ? this.value = t.default : this.value || (this.value = {});
|
|
4746
|
+
super(t), this.inputType = {}, this.container = null, this.defaultLanguage = "", this.uploadSettings = /* @__PURE__ */ new Map(), this.popup = null, t.default ? this.value = t.default : this.value || (this.value = {}), this.value.$id = dt();
|
|
4747
4747
|
const e = w.HasExplicitCurrentLanguage(), i = e ? w.CurrentLanguage() : "", s = w.DefaultLanguage;
|
|
4748
4748
|
this.defaultLanguage = e && i && t.languages.includes(i) ? i : s && t.languages.includes(s) ? s : t.languages[0];
|
|
4749
4749
|
const n = t.defaultValue || `Enter text in ${this.capitalizeFirstLetter(this.defaultLanguage)}`;
|
|
@@ -4781,8 +4781,8 @@ class yi extends w {
|
|
|
4781
4781
|
const m = Math.floor((d + p) / 2), g = e.slice(0, m).trimEnd() + h;
|
|
4782
4782
|
this.measureTextWidth(g, i) <= l ? (u = m, d = m + 1) : p = m - 1;
|
|
4783
4783
|
}
|
|
4784
|
-
const
|
|
4785
|
-
t.placeholder =
|
|
4784
|
+
const C = e.slice(0, u).trimEnd() + h;
|
|
4785
|
+
t.placeholder = C;
|
|
4786
4786
|
}
|
|
4787
4787
|
autosizeTextarea(t, e = 3) {
|
|
4788
4788
|
t.style.height = "auto";
|
|
@@ -4794,7 +4794,7 @@ class yi extends w {
|
|
|
4794
4794
|
i.classList.add("simple-multi-language-row");
|
|
4795
4795
|
const s = document.createElement("label");
|
|
4796
4796
|
if (s.classList.add("simple-language-label"), s.textContent = t.toUpperCase(), s.setAttribute("for", `textarea-${t}`), i.appendChild(s), this.props.multiImg) {
|
|
4797
|
-
const n = new
|
|
4797
|
+
const n = new gt({
|
|
4798
4798
|
defaultUrl: e || "",
|
|
4799
4799
|
title: "",
|
|
4800
4800
|
id: `${this.id}_upload_${t}`
|
|
@@ -4943,7 +4943,6 @@ class yi extends w {
|
|
|
4943
4943
|
this.popup && (document.body.removeChild(this.popup), this.popup = null);
|
|
4944
4944
|
}
|
|
4945
4945
|
draw() {
|
|
4946
|
-
var h;
|
|
4947
4946
|
const t = document.createElement("div");
|
|
4948
4947
|
t.classList.add("simple-multi-language-wrapper");
|
|
4949
4948
|
const e = document.createElement("div");
|
|
@@ -4974,49 +4973,50 @@ class yi extends w {
|
|
|
4974
4973
|
s.style.color = "#000";
|
|
4975
4974
|
}), s.addEventListener("mouseleave", () => {
|
|
4976
4975
|
s.style.color = "#666";
|
|
4977
|
-
})
|
|
4978
|
-
|
|
4979
|
-
n.textElementListeners || (n.textElementListeners = /* @__PURE__ */ new Map());
|
|
4980
|
-
const o = (h = this.value) == null ? void 0 : h.$id, a = window.textElementListeners;
|
|
4981
|
-
if (o && !a.has(o)) {
|
|
4982
|
-
const d = (p) => {
|
|
4983
|
-
const { type: u, data: f } = p.data || {};
|
|
4984
|
-
u === "TEXT_ELEMENT_CLICKED" && (f == null ? void 0 : f.$id) === o && this.showPopup();
|
|
4985
|
-
};
|
|
4986
|
-
window.addEventListener("message", d), a.set(o, d);
|
|
4987
|
-
}
|
|
4988
|
-
s.addEventListener("click", (d) => {
|
|
4989
|
-
d.preventDefault(), this.showPopup();
|
|
4976
|
+
}), s.addEventListener("click", (a) => {
|
|
4977
|
+
a.preventDefault(), this.showPopup();
|
|
4990
4978
|
}), e.appendChild(i), e.appendChild(s), t.appendChild(e);
|
|
4991
|
-
const
|
|
4992
|
-
|
|
4993
|
-
|
|
4979
|
+
const n = document.createElement("div");
|
|
4980
|
+
n.classList.add("simple-multi-language-content"), t.appendChild(n), this.container = t, this.renderContent(t), this.languageChangeUnsubscribe = w.onLanguageChange((a) => {
|
|
4981
|
+
a && this.props.languages.includes(a) && (this.defaultLanguage = a), this.container && this.renderContent(this.container);
|
|
4994
4982
|
});
|
|
4995
|
-
const
|
|
4983
|
+
const o = () => {
|
|
4996
4984
|
if (!this.container) return;
|
|
4997
4985
|
this.container.querySelectorAll(
|
|
4998
4986
|
".simple-language-textarea"
|
|
4999
|
-
).forEach((
|
|
5000
|
-
const
|
|
5001
|
-
|
|
4987
|
+
).forEach((l) => {
|
|
4988
|
+
const r = l.getAttribute("data-full-placeholder") || "";
|
|
4989
|
+
r && this.adaptPlaceholderToSingleLine(l, r);
|
|
5002
4990
|
});
|
|
5003
4991
|
};
|
|
5004
|
-
return window.addEventListener("resize",
|
|
4992
|
+
return window.addEventListener("resize", o), t;
|
|
5005
4993
|
}
|
|
5006
4994
|
setValue(t) {
|
|
5007
|
-
|
|
5008
|
-
|
|
4995
|
+
var n;
|
|
4996
|
+
super.setValue(t), this.value.$id = t.$id;
|
|
4997
|
+
const e = window;
|
|
4998
|
+
e.textElementListeners || (e.textElementListeners = /* @__PURE__ */ new Map());
|
|
4999
|
+
const i = (n = this.value) == null ? void 0 : n.$id, s = window.textElementListeners;
|
|
5000
|
+
if (i && !s.has(i)) {
|
|
5001
|
+
const o = (a) => {
|
|
5002
|
+
const { type: l, data: r } = a.data || {};
|
|
5003
|
+
l === "TEXT_ELEMENT_CLICKED" && (r == null ? void 0 : r.$id) === i && this.showPopup();
|
|
5004
|
+
};
|
|
5005
|
+
window.addEventListener("message", o), s.set(i, o);
|
|
5006
|
+
}
|
|
5007
|
+
this.container && this.props.languages.forEach((o) => {
|
|
5008
|
+
var a;
|
|
5009
5009
|
if (this.props.multiImg) {
|
|
5010
|
-
const
|
|
5011
|
-
|
|
5010
|
+
const l = this.uploadSettings.get(o);
|
|
5011
|
+
l && l.setValue((t == null ? void 0 : t[o]) || "");
|
|
5012
5012
|
} else {
|
|
5013
|
-
const
|
|
5014
|
-
`#textarea-${
|
|
5013
|
+
const l = (a = this.container) == null ? void 0 : a.querySelector(
|
|
5014
|
+
`#textarea-${o}`
|
|
5015
5015
|
);
|
|
5016
|
-
if (
|
|
5017
|
-
|
|
5018
|
-
const
|
|
5019
|
-
|
|
5016
|
+
if (l) {
|
|
5017
|
+
l.value = (t == null ? void 0 : t[o]) || "", this.autosizeTextarea(l, 3);
|
|
5018
|
+
const r = l.getAttribute("data-full-placeholder") || "";
|
|
5019
|
+
r && this.adaptPlaceholderToSingleLine(l, r);
|
|
5020
5020
|
}
|
|
5021
5021
|
}
|
|
5022
5022
|
});
|
|
@@ -5296,7 +5296,7 @@ class Li extends $ {
|
|
|
5296
5296
|
title: "Background Image",
|
|
5297
5297
|
collapsed: t == null ? void 0 : t.collapsed,
|
|
5298
5298
|
settings: {
|
|
5299
|
-
backgroundImage: new
|
|
5299
|
+
backgroundImage: new gt({
|
|
5300
5300
|
...t == null ? void 0 : t.uploadProps,
|
|
5301
5301
|
default: (t == null ? void 0 : t.backgroundImage) ?? ""
|
|
5302
5302
|
}),
|
|
@@ -5335,7 +5335,7 @@ class ki extends $ {
|
|
|
5335
5335
|
title: (t == null ? void 0 : t.title) ?? "Image",
|
|
5336
5336
|
collapsed: t == null ? void 0 : t.collapsed,
|
|
5337
5337
|
settings: {
|
|
5338
|
-
image: new
|
|
5338
|
+
image: new gt({
|
|
5339
5339
|
...t == null ? void 0 : t.uploadProps,
|
|
5340
5340
|
default: (t == null ? void 0 : t.image) ?? ""
|
|
5341
5341
|
}),
|
|
@@ -5365,7 +5365,7 @@ export {
|
|
|
5365
5365
|
wi as HeaderTypographySettingSet,
|
|
5366
5366
|
_e as HeightSetting,
|
|
5367
5367
|
di as HtmlSetting,
|
|
5368
|
-
|
|
5368
|
+
Mt as ImageMapSetting,
|
|
5369
5369
|
ki as ImageSettingSet,
|
|
5370
5370
|
fi as MarginBottomSetting,
|
|
5371
5371
|
xi as MarginSettingGroup,
|
|
@@ -5381,13 +5381,13 @@ export {
|
|
|
5381
5381
|
Xt as TabSettingGroup,
|
|
5382
5382
|
Xt as TabsSettingGroup,
|
|
5383
5383
|
mi as Toggle,
|
|
5384
|
-
|
|
5384
|
+
gt as UploadSetting,
|
|
5385
5385
|
Ze as WidthSetting,
|
|
5386
5386
|
hi as asSettingGroupWithSettings,
|
|
5387
5387
|
Yt as createSettingGroup,
|
|
5388
5388
|
ci as createTabSettingGroup,
|
|
5389
5389
|
R as isSetting,
|
|
5390
|
-
|
|
5390
|
+
ft as isSettingChild,
|
|
5391
5391
|
M as isSettingGroup,
|
|
5392
5392
|
Y as iterateSettings
|
|
5393
5393
|
};
|