builder-settings-types 0.0.386 → 0.0.387
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.
|
@@ -280,9 +280,9 @@ const pt = (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, C = window.innerWidth,
|
|
283
|
+
const p = d.clientX - s, u = d.clientY - n, C = window.innerWidth, g = window.innerHeight, m = t.offsetWidth, f = t.offsetHeight;
|
|
284
284
|
let v = o + p, y = a + u;
|
|
285
|
-
v = Math.max(8, Math.min(C -
|
|
285
|
+
v = Math.max(8, Math.min(C - m - 8, v)), y = Math.max(8, Math.min(g - 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
|
};
|
|
@@ -652,8 +652,8 @@ const ut = (c, t) => {
|
|
|
652
652
|
const u = Ut(d);
|
|
653
653
|
if (p.title = u, p.setAttribute("aria-label", `Use color: ${u}`), d.includes("gradient(")) {
|
|
654
654
|
p.style.backgroundImage = d, p.style.backgroundColor = "transparent";
|
|
655
|
-
const
|
|
656
|
-
|
|
655
|
+
const g = V(d);
|
|
656
|
+
g && g.stops && g.stops.length > 0 && (p.style.borderColor = g.stops[0].color);
|
|
657
657
|
} else
|
|
658
658
|
p.style.backgroundColor = d, p.style.borderColor = d;
|
|
659
659
|
p.addEventListener("mouseenter", () => o(p, u)), p.addEventListener("mouseleave", () => {
|
|
@@ -771,22 +771,22 @@ class Zt {
|
|
|
771
771
|
this.setColor(E), (L = this.onChange) == null || L.call(this, E, this.currentOpacity);
|
|
772
772
|
}, this.recentScope);
|
|
773
773
|
this.recentSectionRefresh = C.refresh;
|
|
774
|
-
const
|
|
775
|
-
|
|
776
|
-
const
|
|
777
|
-
|
|
774
|
+
const g = document.createElement("div");
|
|
775
|
+
g.className = "color-picker-format-section";
|
|
776
|
+
const m = document.createElement("select");
|
|
777
|
+
m.className = "color-picker-format-select", this.select = m;
|
|
778
778
|
const f = document.createElement("option");
|
|
779
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",
|
|
783
|
+
y.value = "hsl", y.textContent = "HSL", m.appendChild(f), m.appendChild(v), m.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),
|
|
789
|
+
return x.className = "color-picker-copy-inside", x.textContent = "Copy", k.appendChild(b), k.appendChild(x), g.appendChild(m), g.appendChild(k), t.appendChild(e), t.appendChild(n), t.appendChild(a), t.appendChild(C.container), t.appendChild(g), t.addEventListener("click", (E) => E.stopPropagation()), this.bind(n, h, p, b, m, x, l), t;
|
|
790
790
|
}
|
|
791
791
|
createBackdrop() {
|
|
792
792
|
const t = document.createElement("div");
|
|
@@ -797,14 +797,14 @@ class Zt {
|
|
|
797
797
|
var v;
|
|
798
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
799
|
this.colorMarker.style.left = `${u * 100}%`, this.colorMarker.style.top = `${C * 100}%`;
|
|
800
|
-
const
|
|
800
|
+
const m = this.parsePercentage(this.hueMarker.style.left || "0%") * 360, f = Z(m, u, 1 - C);
|
|
801
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 C = u * 360,
|
|
807
|
+
const C = u * 360, g = this.parsePercentage(this.colorMarker.style.left || "0%"), m = this.parsePercentage(this.colorMarker.style.top || "0%"), f = Z(C, g, 1 - m);
|
|
808
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
810
|
var C;
|
|
@@ -908,8 +908,8 @@ class Zt {
|
|
|
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
910
|
let u = r.right + 8, C = r.top;
|
|
911
|
-
const
|
|
912
|
-
|
|
911
|
+
const g = h - r.right, m = r.left;
|
|
912
|
+
g >= a + p ? u = r.right + 8 : m >= a + p ? u = r.left - a - 8 : u = Math.max(p, (h - a) / 2);
|
|
913
913
|
const f = d - r.bottom, v = r.top;
|
|
914
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
|
}
|
|
@@ -974,10 +974,10 @@ class Jt {
|
|
|
974
974
|
u.className = "color-picker-format-select", this.select = u;
|
|
975
975
|
const C = document.createElement("option");
|
|
976
976
|
C.value = "hex", C.textContent = "HEX";
|
|
977
|
-
const m = document.createElement("option");
|
|
978
|
-
m.value = "rgb", m.textContent = "RGB";
|
|
979
977
|
const g = document.createElement("option");
|
|
980
|
-
g.value = "
|
|
978
|
+
g.value = "rgb", g.textContent = "RGB";
|
|
979
|
+
const m = document.createElement("option");
|
|
980
|
+
m.value = "hsl", m.textContent = "HSL", u.appendChild(C), u.appendChild(g), u.appendChild(m);
|
|
981
981
|
const f = document.createElement("input");
|
|
982
982
|
f.type = "text", f.className = "color-picker-color-input", this.input = f;
|
|
983
983
|
const v = document.createElement("div");
|
|
@@ -987,36 +987,36 @@ class Jt {
|
|
|
987
987
|
}
|
|
988
988
|
bind(t, e, i, s, n, o, a) {
|
|
989
989
|
const l = (p, u) => {
|
|
990
|
-
const C = u || t.getBoundingClientRect(),
|
|
991
|
-
this.colorMarker.style.left = `${
|
|
992
|
-
const v = this.parsePercentage(this.hueMarker.style.left || "0%") * 360, y = Z(v,
|
|
990
|
+
const C = u || t.getBoundingClientRect(), g = Math.max(0, Math.min(1, (p.clientX - C.left) / C.width)), m = Math.max(0, Math.min(1, (p.clientY - C.top) / C.height));
|
|
991
|
+
this.colorMarker.style.left = `${g * 100}%`, this.colorMarker.style.top = `${m * 100}%`;
|
|
992
|
+
const v = this.parsePercentage(this.hueMarker.style.left || "0%") * 360, y = Z(v, g, 1 - m);
|
|
993
993
|
this.currentColor = y, this.syncInput(), this.updateOpacityBg(), this.queueChange();
|
|
994
994
|
}, r = (p, u) => {
|
|
995
|
-
const C = u || e.getBoundingClientRect(),
|
|
996
|
-
this.hueMarker.style.left = `${
|
|
997
|
-
const
|
|
995
|
+
const C = u || e.getBoundingClientRect(), g = Math.max(0, Math.min(1, (p.clientX - C.left) / C.width));
|
|
996
|
+
this.hueMarker.style.left = `${g * 100}%`;
|
|
997
|
+
const m = g * 360, f = this.parsePercentage(this.colorMarker.style.left || "0%"), v = this.parsePercentage(this.colorMarker.style.top || "0%"), y = Z(m, f, 1 - v);
|
|
998
998
|
this.currentColor = y, this.colorArea.style.background = `linear-gradient(to top, #000, transparent),
|
|
999
|
-
linear-gradient(to right, #fff, hsl(${
|
|
999
|
+
linear-gradient(to right, #fff, hsl(${m}, 100%, 50%))`, this.syncInput(), this.updateOpacityBg(), this.queueChange();
|
|
1000
1000
|
}, h = (p, u) => {
|
|
1001
|
-
const C = u || i.getBoundingClientRect(),
|
|
1002
|
-
this.opacityMarker.style.left = `${
|
|
1001
|
+
const C = u || i.getBoundingClientRect(), g = Math.max(0, Math.min(1, (p.clientX - C.left) / C.width));
|
|
1002
|
+
this.opacityMarker.style.left = `${g * 100}%`, this.currentOpacity = this.clampOpacity(g * 100), this.queueChange();
|
|
1003
1003
|
}, d = (p, u, C) => {
|
|
1004
1004
|
p.preventDefault(), this.isDragging = !0, this.cachedRect = C.getBoundingClientRect(), u(p, this.cachedRect);
|
|
1005
|
-
let
|
|
1005
|
+
let g = null, m;
|
|
1006
1006
|
const f = () => {
|
|
1007
1007
|
this.dragRafId === void 0 && (this.dragRafId = window.requestAnimationFrame(() => {
|
|
1008
|
-
this.dragRafId = void 0,
|
|
1008
|
+
this.dragRafId = void 0, g && this.cachedRect && u(g, this.cachedRect);
|
|
1009
1009
|
}));
|
|
1010
1010
|
}, v = () => {
|
|
1011
|
-
this.isDragging && (this.isDragging = !1, this.dragRafId !== void 0 && (cancelAnimationFrame(this.dragRafId), this.dragRafId = void 0), this.cachedRect = void 0,
|
|
1011
|
+
this.isDragging && (this.isDragging = !1, this.dragRafId !== void 0 && (cancelAnimationFrame(this.dragRafId), this.dragRafId = void 0), this.cachedRect = void 0, g = null, this.flushChange(), document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", v), window.removeEventListener("blur", v), this.applyPendingExternal());
|
|
1012
1012
|
};
|
|
1013
|
-
|
|
1013
|
+
m = (y) => {
|
|
1014
1014
|
if (!y.buttons) {
|
|
1015
1015
|
v();
|
|
1016
1016
|
return;
|
|
1017
1017
|
}
|
|
1018
|
-
|
|
1019
|
-
}, document.addEventListener("mousemove",
|
|
1018
|
+
g = y, f();
|
|
1019
|
+
}, document.addEventListener("mousemove", m), document.addEventListener("mouseup", v), window.addEventListener("blur", v);
|
|
1020
1020
|
};
|
|
1021
1021
|
t.addEventListener("mousedown", (p) => {
|
|
1022
1022
|
d(p, l, t);
|
|
@@ -1432,21 +1432,21 @@ const P = class P extends w {
|
|
|
1432
1432
|
let p = {};
|
|
1433
1433
|
try {
|
|
1434
1434
|
p = w.GlobalVariables || {};
|
|
1435
|
-
} catch (
|
|
1436
|
-
console.warn("Could not access Setting.GlobalVariables",
|
|
1435
|
+
} catch (m) {
|
|
1436
|
+
console.warn("Could not access Setting.GlobalVariables", m);
|
|
1437
1437
|
}
|
|
1438
1438
|
if (!p || Object.keys(p).length === 0) {
|
|
1439
|
-
const
|
|
1440
|
-
|
|
1439
|
+
const m = document.createElement("div");
|
|
1440
|
+
m.textContent = "No global colors defined", m.style.fontSize = "12px", m.style.color = "#666", m.style.padding = "8px", d.appendChild(m);
|
|
1441
1441
|
return;
|
|
1442
1442
|
}
|
|
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
|
-
let
|
|
1448
|
-
this.globalLayoutMode === "list" ? (
|
|
1449
|
-
const f = Object.entries(p).filter(([v]) => !
|
|
1447
|
+
let g;
|
|
1448
|
+
this.globalLayoutMode === "list" ? (g = document.createElement("div"), g.className = "global-colors-list") : (g = document.createElement("div"), g.className = "global-colors-grid"), d.appendChild(g), u.forEach((m) => {
|
|
1449
|
+
const f = Object.entries(p).filter(([v]) => !m.keys.includes(v) && m.title !== "Global Colors" ? !1 : m.keys.includes(v) && v.toLowerCase().includes(C));
|
|
1450
1450
|
f.length !== 0 && f.forEach(([v, y]) => {
|
|
1451
1451
|
if (this.globalLayoutMode === "list") {
|
|
1452
1452
|
const b = document.createElement("div");
|
|
@@ -1460,7 +1460,7 @@ const P = class P extends w {
|
|
|
1460
1460
|
S.preventDefault();
|
|
1461
1461
|
const G = `var(--${v})`;
|
|
1462
1462
|
this.setValue(G), this.pendingSolidColor = G, i(d);
|
|
1463
|
-
}),
|
|
1463
|
+
}), g.appendChild(b);
|
|
1464
1464
|
} else {
|
|
1465
1465
|
const b = document.createElement("div");
|
|
1466
1466
|
b.className = "global-color-circle";
|
|
@@ -1469,7 +1469,7 @@ const P = class P extends w {
|
|
|
1469
1469
|
E.preventDefault();
|
|
1470
1470
|
const L = `var(--${v})`;
|
|
1471
1471
|
this.setValue(L), this.pendingSolidColor = L, i(d);
|
|
1472
|
-
}),
|
|
1472
|
+
}), g.appendChild(b);
|
|
1473
1473
|
}
|
|
1474
1474
|
});
|
|
1475
1475
|
});
|
|
@@ -1527,35 +1527,35 @@ const P = class P extends w {
|
|
|
1527
1527
|
const C = document.createElement("button");
|
|
1528
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
|
-
}), e.addEventListener("focus", (
|
|
1531
|
-
const
|
|
1532
|
-
|
|
1533
|
-
}), e.addEventListener("input", (
|
|
1530
|
+
}), e.addEventListener("focus", (g) => {
|
|
1531
|
+
const m = g.target;
|
|
1532
|
+
m.value = m.value.replace(/[^0-9-]/g, ""), setTimeout(() => m.select(), 0);
|
|
1533
|
+
}), e.addEventListener("input", (g) => {
|
|
1534
1534
|
this.clearGlobalBindingForCustomChange();
|
|
1535
|
-
const
|
|
1536
|
-
!Number.isNaN(
|
|
1537
|
-
}), e.addEventListener("blur", (
|
|
1535
|
+
const m = parseInt(g.target.value);
|
|
1536
|
+
!Number.isNaN(m) && this.value && (this.value.angle = Math.max(0, Math.min(360, m)), this.debouncedPreviewUpdate());
|
|
1537
|
+
}), e.addEventListener("blur", (g) => {
|
|
1538
1538
|
var v;
|
|
1539
1539
|
this.previewUpdateTimeout && (clearTimeout(this.previewUpdateTimeout), this.previewUpdateTimeout = null);
|
|
1540
|
-
const
|
|
1541
|
-
let f = parseInt(
|
|
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),
|
|
1540
|
+
const m = g.target;
|
|
1541
|
+
let f = parseInt(m.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), m.value = `${f}°`, this.updateGradientPreview(), this.updateUI(), this.triggerChange();
|
|
1543
1543
|
}), C.addEventListener("click", () => {
|
|
1544
|
-
this.clearGlobalBindingForCustomChange(), !(!this.value || !this.value.stops) && (this.value.stops.forEach((
|
|
1545
|
-
|
|
1546
|
-
}), this.value.stops.sort((
|
|
1544
|
+
this.clearGlobalBindingForCustomChange(), !(!this.value || !this.value.stops) && (this.value.stops.forEach((g) => {
|
|
1545
|
+
g.position = 100 - g.position;
|
|
1546
|
+
}), this.value.stops.sort((g, m) => g.position - m.position), this.updateGradientPreview(i), this.createHandles(s, i), this.updateStopsList(l), this.updateUI(), this.triggerChange());
|
|
1547
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);
|
|
1551
1551
|
const s = document.createElement("div");
|
|
1552
1552
|
s.className = "gradient-handles", i.appendChild(s), t.appendChild(i), this.createHandles(s, i), i.addEventListener("click", (h) => {
|
|
1553
|
-
var
|
|
1553
|
+
var g;
|
|
1554
1554
|
const d = h.target;
|
|
1555
1555
|
if (d.classList.contains("gstop-handle") || d.classList.contains("gstop-chip"))
|
|
1556
1556
|
return;
|
|
1557
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(), ((
|
|
1558
|
+
this.clearGlobalBindingForCustomChange(), this.addStopAtPosition(C), this.updateStopsList(), this.updateGradientPreview(i), this.createHandles(s, i), this.updateUI(), ((g = document.activeElement) == null ? void 0 : g.tagName) !== "INPUT" && this.repositionPopover(), this.triggerChange();
|
|
1559
1559
|
});
|
|
1560
1560
|
const n = document.createElement("div");
|
|
1561
1561
|
n.className = "gradient-stops-header";
|
|
@@ -1603,25 +1603,25 @@ const P = class P extends w {
|
|
|
1603
1603
|
const a = this.resolveGlobalVarColor(i.color);
|
|
1604
1604
|
o.style.backgroundColor = a, n.appendChild(o);
|
|
1605
1605
|
let l = !1, r = !1, h = 0, d = 0;
|
|
1606
|
-
const p = (
|
|
1607
|
-
l = !0, r = !1, h =
|
|
1608
|
-
}, u = (
|
|
1606
|
+
const p = (g) => {
|
|
1607
|
+
l = !0, r = !1, h = g.clientX, d = this.value.stops[s].position, n.classList.add("selected"), document.addEventListener("mousemove", u), document.addEventListener("mouseup", C), g.preventDefault(), g.stopPropagation();
|
|
1608
|
+
}, u = (g) => {
|
|
1609
1609
|
if (!l || !this.value) return;
|
|
1610
|
-
const
|
|
1611
|
-
if (Math.abs(
|
|
1610
|
+
const m = g.clientX - h;
|
|
1611
|
+
if (Math.abs(m) > 3 && (r = !0), r) {
|
|
1612
1612
|
this.clearGlobalBindingForCustomChange();
|
|
1613
1613
|
const f = e.getBoundingClientRect();
|
|
1614
|
-
let v = d +
|
|
1614
|
+
let v = d + m / 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
|
-
}, C = (
|
|
1618
|
-
var
|
|
1617
|
+
}, C = (g) => {
|
|
1618
|
+
var m;
|
|
1619
1619
|
if (l)
|
|
1620
1620
|
if (l = !1, n.classList.remove("selected"), document.removeEventListener("mousemove", u), document.removeEventListener("mouseup", C), r)
|
|
1621
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
|
-
|
|
1624
|
-
const f = (
|
|
1623
|
+
g.stopPropagation();
|
|
1624
|
+
const f = (m = this.value) == null ? void 0 : m.stops[s];
|
|
1625
1625
|
f && setTimeout(() => {
|
|
1626
1626
|
const v = this.getSharedStopColorPicker();
|
|
1627
1627
|
v.getIsOpen() && v.close(!1), this.colorPickerStopIndex = s, v.setOnChange((b, k) => {
|
|
@@ -1656,16 +1656,16 @@ const P = class P extends w {
|
|
|
1656
1656
|
u.type = "button", u.className = "gstop-color-copy", u.textContent = "Copy", r.appendChild(d), r.appendChild(p), r.appendChild(u);
|
|
1657
1657
|
const C = document.createElement("button");
|
|
1658
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
|
-
const
|
|
1660
|
-
|
|
1661
|
-
const
|
|
1662
|
-
|
|
1659
|
+
const g = document.createElement("span");
|
|
1660
|
+
g.className = "gstop-opacity-label", g.textContent = "Opacity";
|
|
1661
|
+
const m = document.createElement("div");
|
|
1662
|
+
m.className = "gstop-opacity-group";
|
|
1663
1663
|
const f = document.createElement("input");
|
|
1664
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}%`,
|
|
1668
|
+
y.className = "gstop-opacity-value", y.textContent = `${s.opacity ?? 100}%`, m.appendChild(f), m.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) => {
|
|
@@ -2448,8 +2448,8 @@ const ot = class ot {
|
|
|
2448
2448
|
p.stopPropagation(), p.preventDefault();
|
|
2449
2449
|
const u = this.getNextIndexFromPrefix(this.addItemCfg.keyPrefix), C = this.addItemCfg.createItem(u);
|
|
2450
2450
|
if (ft(C)) {
|
|
2451
|
-
const
|
|
2452
|
-
this.addSetting(
|
|
2451
|
+
const g = `${this.addItemCfg.keyPrefix}${u}`;
|
|
2452
|
+
this.addSetting(g, C);
|
|
2453
2453
|
}
|
|
2454
2454
|
}), a.appendChild(h);
|
|
2455
2455
|
}
|
|
@@ -2632,16 +2632,16 @@ class H extends Kt {
|
|
|
2632
2632
|
draw() {
|
|
2633
2633
|
const t = document.createElement("div");
|
|
2634
2634
|
if (t.className = "color-setting-wrapper " + (this.props.wrapperClassName || ""), this.props.title || this.props.icon) {
|
|
2635
|
-
const
|
|
2636
|
-
if (
|
|
2637
|
-
const
|
|
2638
|
-
|
|
2635
|
+
const g = document.createElement("div");
|
|
2636
|
+
if (g.className = "icon-container", this.props.icon) {
|
|
2637
|
+
const m = document.createElement("span");
|
|
2638
|
+
m.className = "input-icon", m.innerHTML = this.props.icon, g.appendChild(m);
|
|
2639
2639
|
}
|
|
2640
2640
|
if (this.props.title) {
|
|
2641
|
-
const
|
|
2642
|
-
|
|
2641
|
+
const m = document.createElement("span");
|
|
2642
|
+
m.className = "input-label", m.textContent = this.props.title, g.appendChild(m);
|
|
2643
2643
|
}
|
|
2644
|
-
t.appendChild(
|
|
2644
|
+
t.appendChild(g);
|
|
2645
2645
|
}
|
|
2646
2646
|
const e = document.createElement("div");
|
|
2647
2647
|
e.className = "color-input-wrapper";
|
|
@@ -2659,41 +2659,41 @@ class H extends Kt {
|
|
|
2659
2659
|
try {
|
|
2660
2660
|
if (console.log("ColorSetting: renderGlobalOptions called"), a.innerHTML = "", !w) {
|
|
2661
2661
|
console.error("ColorSetting: Setting class is undefined");
|
|
2662
|
-
const
|
|
2663
|
-
|
|
2662
|
+
const m = document.createElement("div");
|
|
2663
|
+
m.textContent = "Error: System error (Setting undefined)", a.appendChild(m);
|
|
2664
2664
|
return;
|
|
2665
2665
|
}
|
|
2666
|
-
const
|
|
2667
|
-
if (console.log("ColorSetting: GlobalVariables:",
|
|
2668
|
-
const
|
|
2669
|
-
|
|
2666
|
+
const g = w.GlobalVariables || {};
|
|
2667
|
+
if (console.log("ColorSetting: GlobalVariables:", g), !g || Object.keys(g).length === 0) {
|
|
2668
|
+
const m = document.createElement("div");
|
|
2669
|
+
m.textContent = "No global colors defined", m.style.gridColumn = "1 / -1", m.style.fontSize = "12px", m.style.color = "#666", a.appendChild(m);
|
|
2670
2670
|
return;
|
|
2671
2671
|
}
|
|
2672
|
-
Object.entries(
|
|
2672
|
+
Object.entries(g).forEach(([m, f]) => {
|
|
2673
2673
|
const v = document.createElement("button");
|
|
2674
|
-
v.className = "global-color-btn", v.title =
|
|
2674
|
+
v.className = "global-color-btn", v.title = m, 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(--${m})` && (v.style.border = "2px solid #2196f3"), v.addEventListener("click", (y) => {
|
|
2675
2675
|
var k, x;
|
|
2676
2676
|
y.preventDefault();
|
|
2677
|
-
const b = `var(--${
|
|
2677
|
+
const b = `var(--${m})`;
|
|
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
2680
|
}), v.style.border = "2px solid #2196f3", d.style.backgroundColor = f;
|
|
2681
2681
|
}), a.appendChild(v);
|
|
2682
2682
|
});
|
|
2683
|
-
} catch (
|
|
2684
|
-
console.error("ColorSetting: Error in renderGlobalOptions",
|
|
2683
|
+
} catch (g) {
|
|
2684
|
+
console.error("ColorSetting: Error in renderGlobalOptions", g), a.innerHTML = "Error loading global options";
|
|
2685
2685
|
}
|
|
2686
2686
|
};
|
|
2687
|
-
l(), s.addEventListener("click", (
|
|
2688
|
-
|
|
2689
|
-
}), n.addEventListener("click", (
|
|
2690
|
-
|
|
2687
|
+
l(), s.addEventListener("click", (g) => {
|
|
2688
|
+
g.preventDefault(), s.classList.add("active"), n.classList.remove("active"), o.style.display = "flex", a.style.display = "none", this.value && this.value.startsWith("var(--");
|
|
2689
|
+
}), n.addEventListener("click", (g) => {
|
|
2690
|
+
g.preventDefault(), n.classList.add("active"), s.classList.remove("active"), o.style.display = "none", a.style.display = "grid", l();
|
|
2691
2691
|
}), this.value && this.value.startsWith("var(--") ? n.click() : s.click();
|
|
2692
|
-
const r = (
|
|
2693
|
-
const
|
|
2694
|
-
if (!
|
|
2692
|
+
const r = (g) => {
|
|
2693
|
+
const m = g.value.trim();
|
|
2694
|
+
if (!m)
|
|
2695
2695
|
return e.classList.remove("error"), !0;
|
|
2696
|
-
const v = /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/.test(
|
|
2696
|
+
const v = /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/.test(m);
|
|
2697
2697
|
return v ? e.classList.remove("error") : e.classList.add("error"), v;
|
|
2698
2698
|
}, h = document.createElement("input");
|
|
2699
2699
|
h.type = "color", h.className = "color-picker", h.value = this.value && !this.value.startsWith("var(--") ? this.value : "#000000", h.setAttribute("aria-label", "Choose color"), h.setAttribute("title", "Click to open color picker"), this.getDataPropsPath() && h.setAttribute("data-test-id", this.getDataPropsPath()), this.colorInputEl = h;
|
|
@@ -2701,38 +2701,38 @@ class H extends Kt {
|
|
|
2701
2701
|
d.className = "color-preview";
|
|
2702
2702
|
let p = this.value || "#000000";
|
|
2703
2703
|
if (p.startsWith("var(--")) {
|
|
2704
|
-
const
|
|
2705
|
-
p = (w.GlobalVariables || {})[
|
|
2704
|
+
const g = p.replace("var(--", "").replace(")", "");
|
|
2705
|
+
p = (w.GlobalVariables || {})[g] || "#000000";
|
|
2706
2706
|
}
|
|
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 C = (
|
|
2710
|
+
const C = (g) => {
|
|
2711
2711
|
var f, v;
|
|
2712
|
-
let
|
|
2713
|
-
if (
|
|
2714
|
-
const y = H.normalizeColorValue(
|
|
2712
|
+
let m = g.trim();
|
|
2713
|
+
if (m && !m.startsWith("#") && !m.startsWith("var(") && /^[0-9A-Fa-f]{3}$|^[0-9A-Fa-f]{6}$/.test(m) && (m = "#" + m, this.textInputEl && (this.textInputEl.value = m)), this.textInputEl && r(this.textInputEl)) {
|
|
2714
|
+
const y = H.normalizeColorValue(m);
|
|
2715
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
|
-
return this.textInputEl.addEventListener("input", (
|
|
2719
|
-
const
|
|
2720
|
-
C(
|
|
2721
|
-
}), this.textInputEl.addEventListener("paste", (
|
|
2718
|
+
return this.textInputEl.addEventListener("input", (g) => {
|
|
2719
|
+
const m = g.target.value;
|
|
2720
|
+
C(m);
|
|
2721
|
+
}), this.textInputEl.addEventListener("paste", (g) => {
|
|
2722
2722
|
var f;
|
|
2723
|
-
|
|
2724
|
-
const
|
|
2725
|
-
this.textInputEl && (this.textInputEl.value =
|
|
2726
|
-
}), this.textInputEl.addEventListener("keydown", (
|
|
2727
|
-
var
|
|
2728
|
-
|
|
2729
|
-
}), this.colorInputEl.addEventListener("input", (
|
|
2723
|
+
g.preventDefault();
|
|
2724
|
+
const m = ((f = g.clipboardData) == null ? void 0 : f.getData("text")) || "";
|
|
2725
|
+
this.textInputEl && (this.textInputEl.value = m.trim(), C(m));
|
|
2726
|
+
}), this.textInputEl.addEventListener("keydown", (g) => {
|
|
2727
|
+
var m, f, v;
|
|
2728
|
+
g.key === "Enter" && (g.preventDefault(), C(((m = this.textInputEl) == null ? void 0 : m.value) || ""), (f = this.textInputEl) == null || f.blur()), g.key === "Escape" && (this.textInputEl && this.value && (this.textInputEl.value = this.value), (v = this.textInputEl) == null || v.blur(), e.classList.remove("error"));
|
|
2729
|
+
}), this.colorInputEl.addEventListener("input", (g) => {
|
|
2730
2730
|
var v, y;
|
|
2731
|
-
const
|
|
2731
|
+
const m = g.target.value, f = H.normalizeColorValue(m);
|
|
2732
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
|
-
}), this.colorInputEl.addEventListener("change", (
|
|
2733
|
+
}), this.colorInputEl.addEventListener("change", (g) => {
|
|
2734
2734
|
var v, y;
|
|
2735
|
-
const
|
|
2735
|
+
const m = g.target.value, f = H.normalizeColorValue(m);
|
|
2736
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
|
}
|
|
@@ -4149,20 +4149,20 @@ const je = `<svg xmlns="http://www.w3.org/2000/svg" width="8" height="4" viewBox
|
|
|
4149
4149
|
this.props.prizeMap
|
|
4150
4150
|
);
|
|
4151
4151
|
u.appendChild(C), r.appendChild(h), r.appendChild(u), t.appendChild(r);
|
|
4152
|
-
const
|
|
4152
|
+
const g = We(
|
|
4153
4153
|
this.hasAllMarkers(),
|
|
4154
4154
|
() => this.handleClearAllMarkers(),
|
|
4155
4155
|
() => {
|
|
4156
4156
|
this.triggerChange(), this.closePopover(!0);
|
|
4157
4157
|
}
|
|
4158
4158
|
);
|
|
4159
|
-
t.appendChild(
|
|
4160
|
-
const
|
|
4159
|
+
t.appendChild(g);
|
|
4160
|
+
const m = h.querySelector(
|
|
4161
4161
|
".image-map-container"
|
|
4162
4162
|
), f = u.querySelector(
|
|
4163
4163
|
".simple-prize-list"
|
|
4164
4164
|
);
|
|
4165
|
-
|
|
4165
|
+
m && (m.scrollTop = s), f && (f.scrollTop = n), this.updateCursorTooltipContent();
|
|
4166
4166
|
} else {
|
|
4167
4167
|
const l = Be({
|
|
4168
4168
|
uploadMethod: this.props.upload || "file-manager",
|
|
@@ -4745,7 +4745,7 @@ class yi extends w {
|
|
|
4745
4745
|
constructor(t) {
|
|
4746
4746
|
super(t), this.inputType = {}, this.container = null, this.defaultLanguage = "", this.uploadSettings = /* @__PURE__ */ new Map(), this.popup = null;
|
|
4747
4747
|
const e = window;
|
|
4748
|
-
e.textElementListeners || (e.textElementListeners = /* @__PURE__ */ new Map()), t.default ? this.value = t.default : this.value || (this.value = {});
|
|
4748
|
+
e.textElementListeners || (e.textElementListeners = /* @__PURE__ */ new Map()), window.test = window.test || [], test.push(this), t.default ? this.value = t.default : this.value || (this.value = {});
|
|
4749
4749
|
const i = w.HasExplicitCurrentLanguage(), s = i ? w.CurrentLanguage() : "", n = w.DefaultLanguage;
|
|
4750
4750
|
this.defaultLanguage = i && s && t.languages.includes(s) ? s : n && t.languages.includes(n) ? n : t.languages[0];
|
|
4751
4751
|
const o = t.defaultValue || `Enter text in ${this.capitalizeFirstLetter(this.defaultLanguage)}`;
|
|
@@ -4780,8 +4780,8 @@ class yi extends w {
|
|
|
4780
4780
|
const h = "...";
|
|
4781
4781
|
let d = 0, p = e.length, u = 0;
|
|
4782
4782
|
for (; d <= p; ) {
|
|
4783
|
-
const
|
|
4784
|
-
this.measureTextWidth(
|
|
4783
|
+
const g = Math.floor((d + p) / 2), m = e.slice(0, g).trimEnd() + h;
|
|
4784
|
+
this.measureTextWidth(m, i) <= l ? (u = g, d = g + 1) : p = g - 1;
|
|
4785
4785
|
}
|
|
4786
4786
|
const C = e.slice(0, u).trimEnd() + h;
|
|
4787
4787
|
t.placeholder = C;
|
|
@@ -4945,6 +4945,7 @@ class yi extends w {
|
|
|
4945
4945
|
this.popup && (document.body.removeChild(this.popup), this.popup = null);
|
|
4946
4946
|
}
|
|
4947
4947
|
draw() {
|
|
4948
|
+
var l, r;
|
|
4948
4949
|
const t = document.createElement("div");
|
|
4949
4950
|
t.classList.add("simple-multi-language-wrapper");
|
|
4950
4951
|
const e = document.createElement("div");
|
|
@@ -4975,30 +4976,30 @@ class yi extends w {
|
|
|
4975
4976
|
s.style.color = "#000";
|
|
4976
4977
|
}), s.addEventListener("mouseleave", () => {
|
|
4977
4978
|
s.style.color = "#666";
|
|
4978
|
-
}), s.addEventListener("click", (
|
|
4979
|
-
|
|
4979
|
+
}), s.addEventListener("click", (h) => {
|
|
4980
|
+
h.preventDefault(), this.showPopup();
|
|
4980
4981
|
});
|
|
4981
4982
|
const n = window.textElementListeners;
|
|
4982
|
-
if (this.id && !n.has(this.id)) {
|
|
4983
|
-
const
|
|
4984
|
-
var
|
|
4985
|
-
const { type:
|
|
4986
|
-
|
|
4983
|
+
if ((l = this.value) != null && l.$id && !n.has((r = this.value) == null ? void 0 : r.$id)) {
|
|
4984
|
+
const h = (d) => {
|
|
4985
|
+
var C, g;
|
|
4986
|
+
const { type: p, data: u } = d.data || {};
|
|
4987
|
+
p === "TEXT_ELEMENT_CLICKED" && u.$id && (console.log((C = this.value) == null ? void 0 : C.$id), (u == null ? void 0 : u.$id) === ((g = this.value) == null ? void 0 : g.$id) && this.showPopup());
|
|
4987
4988
|
};
|
|
4988
|
-
window.addEventListener("message",
|
|
4989
|
+
window.addEventListener("message", h), n.set(this.id, h);
|
|
4989
4990
|
}
|
|
4990
4991
|
e.appendChild(i), e.appendChild(s), t.appendChild(e);
|
|
4991
4992
|
const o = document.createElement("div");
|
|
4992
|
-
o.classList.add("simple-multi-language-content"), t.appendChild(o), this.container = t, this.renderContent(t), this.languageChangeUnsubscribe = w.onLanguageChange((
|
|
4993
|
-
|
|
4993
|
+
o.classList.add("simple-multi-language-content"), t.appendChild(o), this.container = t, this.renderContent(t), this.languageChangeUnsubscribe = w.onLanguageChange((h) => {
|
|
4994
|
+
h && this.props.languages.includes(h) && (this.defaultLanguage = h), this.container && this.renderContent(this.container);
|
|
4994
4995
|
});
|
|
4995
4996
|
const a = () => {
|
|
4996
4997
|
if (!this.container) return;
|
|
4997
4998
|
this.container.querySelectorAll(
|
|
4998
4999
|
".simple-language-textarea"
|
|
4999
|
-
).forEach((
|
|
5000
|
-
const
|
|
5001
|
-
|
|
5000
|
+
).forEach((d) => {
|
|
5001
|
+
const p = d.getAttribute("data-full-placeholder") || "";
|
|
5002
|
+
p && this.adaptPlaceholderToSingleLine(d, p);
|
|
5002
5003
|
});
|
|
5003
5004
|
};
|
|
5004
5005
|
return window.addEventListener("resize", a), t;
|
package/package.json
CHANGED