builder-settings-types 0.0.366 → 0.0.368
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const Ot = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
2
|
-
let
|
|
2
|
+
let Mt = (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 mt = 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 || Mt(), 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 vt(c) {
|
|
272
272
|
return R(c) || M(c);
|
|
273
273
|
}
|
|
274
|
-
const
|
|
274
|
+
const dt = (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;
|
|
@@ -432,7 +432,7 @@ const pt = (c, t, e) => {
|
|
|
432
432
|
};
|
|
433
433
|
}
|
|
434
434
|
return { color: U(t) || t, position: 0, opacity: 100 };
|
|
435
|
-
},
|
|
435
|
+
}, ft = (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 pt = (c, t, e) => {
|
|
|
446
446
|
e += n;
|
|
447
447
|
}
|
|
448
448
|
return e.trim() && t.push(e.trim()), t;
|
|
449
|
-
},
|
|
449
|
+
}, Ct = (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 pt = (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
|
+
}, yt = (c) => {
|
|
471
471
|
const t = [];
|
|
472
472
|
return c.forEach((e, i) => {
|
|
473
473
|
const s = e.trim();
|
|
@@ -495,9 +495,9 @@ const pt = (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 = Ct(t, "linear-gradient");
|
|
499
499
|
if (e) {
|
|
500
|
-
const s =
|
|
500
|
+
const s = ft(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 pt = (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 = yt(o);
|
|
517
517
|
return l.length ? D({ type: "linear", angle: n, stops: l }) : null;
|
|
518
518
|
}
|
|
519
|
-
const i =
|
|
519
|
+
const i = Ct(t, "radial-gradient");
|
|
520
520
|
if (i) {
|
|
521
|
-
const s =
|
|
521
|
+
const s = ft(i), n = s[0] && !Gt(s[0]) ? s.slice(1) : s, o = yt(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 pt = (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 pt = (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), dt(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,7 +766,7 @@ 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 C =
|
|
769
|
+
const C = pt((E) => {
|
|
770
770
|
var L;
|
|
771
771
|
this.setColor(E), (L = this.onChange) == null || L.call(this, E, this.currentOpacity);
|
|
772
772
|
}, this.recentScope);
|
|
@@ -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 = pt((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");
|
|
@@ -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), dt(t, this.popoverEl, (l, r) => {
|
|
1339
1339
|
this.popoverPosition = { left: l, top: r };
|
|
1340
1340
|
});
|
|
1341
1341
|
const s = document.createElement("div");
|
|
@@ -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 = pt((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");
|
|
@@ -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 || Mt(), 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;
|
|
@@ -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
|
+
vt(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), mt.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
|
}
|
|
@@ -2447,13 +2447,13 @@ const ot = class ot {
|
|
|
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
2449
|
const u = this.getNextIndexFromPrefix(this.addItemCfg.keyPrefix), C = this.addItemCfg.createItem(u);
|
|
2450
|
-
if (
|
|
2450
|
+
if (vt(C)) {
|
|
2451
2451
|
const m = `${this.addItemCfg.keyPrefix}${u}`;
|
|
2452
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, mt.trackElement(t), setTimeout(() => {
|
|
2457
2457
|
this.updateNestingStyles();
|
|
2458
2458
|
}, 0), this.pendingBlurHandler && (this.pendingBlurHandler = null), t;
|
|
2459
2459
|
}
|
|
@@ -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 ut 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
|
+
`, Et = `
|
|
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, bt = 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 wt(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 xt(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 xt(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 gt = class gt {
|
|
3595
3595
|
static show(t, e = we) {
|
|
3596
3596
|
this.injectStyles();
|
|
3597
3597
|
const i = document.createElement("div");
|
|
@@ -3645,8 +3645,8 @@ const mt = class mt {
|
|
|
3645
3645
|
}
|
|
3646
3646
|
}
|
|
3647
3647
|
};
|
|
3648
|
-
|
|
3649
|
-
let _ =
|
|
3648
|
+
gt.styleInjected = !1;
|
|
3649
|
+
let _ = gt;
|
|
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 Lt = 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">${Et}</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">${Et}</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), dt(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 ?? bt, this.props.markerSize = this.props.markerSize ?? Ee, this.value || (this.value = { imageUrl: "", markers: [] }), Lt.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)) {
|
|
@@ -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 = wt(
|
|
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 || bt
|
|
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 = wt(
|
|
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 } = xt(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 } = xt(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), Lt.unregisterHandler(this.id), this.confirmModal.cleanup();
|
|
4399
4399
|
}
|
|
4400
4400
|
};
|
|
4401
4401
|
A.openInstance = null;
|
|
4402
|
-
let
|
|
4402
|
+
let kt = A;
|
|
4403
4403
|
class _e extends B {
|
|
4404
4404
|
constructor(t = {}) {
|
|
4405
4405
|
super({
|
|
@@ -4743,20 +4743,13 @@ 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;
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
const
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
window.addEventListener("message", i);
|
|
4754
|
-
const s = w.HasExplicitCurrentLanguage(), n = s ? w.CurrentLanguage() : "", o = w.DefaultLanguage;
|
|
4755
|
-
this.defaultLanguage = s && n && t.languages.includes(n) ? n : o && t.languages.includes(o) ? o : t.languages[0];
|
|
4756
|
-
const a = t.defaultValue || `Enter text in ${this.capitalizeFirstLetter(this.defaultLanguage)}`;
|
|
4757
|
-
t.languages.forEach((l) => {
|
|
4758
|
-
var r, h;
|
|
4759
|
-
l in (this.value || {}) || (this.value || (this.value = {}), l === this.defaultLanguage && a ? this.value[l] = ((r = t.default) == null ? void 0 : r[l]) || a : this.value[l] = ((h = t.default) == null ? void 0 : h[l]) || "");
|
|
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 = this.id;
|
|
4747
|
+
const e = w.HasExplicitCurrentLanguage(), i = e ? w.CurrentLanguage() : "", s = w.DefaultLanguage;
|
|
4748
|
+
this.defaultLanguage = e && i && t.languages.includes(i) ? i : s && t.languages.includes(s) ? s : t.languages[0];
|
|
4749
|
+
const n = t.defaultValue || `Enter text in ${this.capitalizeFirstLetter(this.defaultLanguage)}`;
|
|
4750
|
+
t.languages.forEach((o) => {
|
|
4751
|
+
var a, l;
|
|
4752
|
+
o in (this.value || {}) || (this.value || (this.value = {}), o === this.defaultLanguage && n ? this.value[o] = ((a = t.default) == null ? void 0 : a[o]) || n : this.value[o] = ((l = t.default) == null ? void 0 : l[o]) || "");
|
|
4760
4753
|
});
|
|
4761
4754
|
}
|
|
4762
4755
|
capitalizeFirstLetter(t) {
|
|
@@ -4801,7 +4794,7 @@ class yi extends w {
|
|
|
4801
4794
|
i.classList.add("simple-multi-language-row");
|
|
4802
4795
|
const s = document.createElement("label");
|
|
4803
4796
|
if (s.classList.add("simple-language-label"), s.textContent = t.toUpperCase(), s.setAttribute("for", `textarea-${t}`), i.appendChild(s), this.props.multiImg) {
|
|
4804
|
-
const n = new
|
|
4797
|
+
const n = new ut({
|
|
4805
4798
|
defaultUrl: e || "",
|
|
4806
4799
|
title: "",
|
|
4807
4800
|
id: `${this.id}_upload_${t}`
|
|
@@ -4980,23 +4973,29 @@ class yi extends w {
|
|
|
4980
4973
|
s.style.color = "#000";
|
|
4981
4974
|
}), s.addEventListener("mouseleave", () => {
|
|
4982
4975
|
s.style.color = "#666";
|
|
4983
|
-
}), s.addEventListener("click", (
|
|
4984
|
-
|
|
4985
|
-
}), e.appendChild(i), e.appendChild(s), t.appendChild(e);
|
|
4986
|
-
const n = document.createElement("div");
|
|
4987
|
-
n.classList.add("simple-multi-language-content"), t.appendChild(n), this.container = t, this.renderContent(t), this.languageChangeUnsubscribe = w.onLanguageChange((a) => {
|
|
4988
|
-
a && this.props.languages.includes(a) && (this.defaultLanguage = a), this.container && this.renderContent(this.container);
|
|
4976
|
+
}), s.addEventListener("click", (l) => {
|
|
4977
|
+
l.preventDefault(), this.showPopup();
|
|
4989
4978
|
});
|
|
4990
|
-
const
|
|
4979
|
+
const n = (l) => {
|
|
4980
|
+
var d;
|
|
4981
|
+
const { type: r, data: h } = l.data || {};
|
|
4982
|
+
r === "TEXT_ELEMENT_CLICKED" && h.$id == ((d = this.value) == null ? void 0 : d.$id) && this.showPopup();
|
|
4983
|
+
};
|
|
4984
|
+
window.addEventListener("message", n), e.appendChild(i), e.appendChild(s), t.appendChild(e);
|
|
4985
|
+
const o = document.createElement("div");
|
|
4986
|
+
o.classList.add("simple-multi-language-content"), t.appendChild(o), this.container = t, this.renderContent(t), this.languageChangeUnsubscribe = w.onLanguageChange((l) => {
|
|
4987
|
+
l && this.props.languages.includes(l) && (this.defaultLanguage = l), this.container && this.renderContent(this.container);
|
|
4988
|
+
});
|
|
4989
|
+
const a = () => {
|
|
4991
4990
|
if (!this.container) return;
|
|
4992
4991
|
this.container.querySelectorAll(
|
|
4993
4992
|
".simple-language-textarea"
|
|
4994
|
-
).forEach((
|
|
4995
|
-
const
|
|
4996
|
-
|
|
4993
|
+
).forEach((r) => {
|
|
4994
|
+
const h = r.getAttribute("data-full-placeholder") || "";
|
|
4995
|
+
h && this.adaptPlaceholderToSingleLine(r, h);
|
|
4997
4996
|
});
|
|
4998
4997
|
};
|
|
4999
|
-
return window.addEventListener("resize",
|
|
4998
|
+
return window.addEventListener("resize", a), t;
|
|
5000
4999
|
}
|
|
5001
5000
|
setValue(t) {
|
|
5002
5001
|
super.setValue(t), this.container && this.props.languages.forEach((e) => {
|
|
@@ -5291,7 +5290,7 @@ class Li extends $ {
|
|
|
5291
5290
|
title: "Background Image",
|
|
5292
5291
|
collapsed: t == null ? void 0 : t.collapsed,
|
|
5293
5292
|
settings: {
|
|
5294
|
-
backgroundImage: new
|
|
5293
|
+
backgroundImage: new ut({
|
|
5295
5294
|
...t == null ? void 0 : t.uploadProps,
|
|
5296
5295
|
default: (t == null ? void 0 : t.backgroundImage) ?? ""
|
|
5297
5296
|
}),
|
|
@@ -5330,7 +5329,7 @@ class ki extends $ {
|
|
|
5330
5329
|
title: (t == null ? void 0 : t.title) ?? "Image",
|
|
5331
5330
|
collapsed: t == null ? void 0 : t.collapsed,
|
|
5332
5331
|
settings: {
|
|
5333
|
-
image: new
|
|
5332
|
+
image: new ut({
|
|
5334
5333
|
...t == null ? void 0 : t.uploadProps,
|
|
5335
5334
|
default: (t == null ? void 0 : t.image) ?? ""
|
|
5336
5335
|
}),
|
|
@@ -5360,7 +5359,7 @@ export {
|
|
|
5360
5359
|
wi as HeaderTypographySettingSet,
|
|
5361
5360
|
_e as HeightSetting,
|
|
5362
5361
|
di as HtmlSetting,
|
|
5363
|
-
|
|
5362
|
+
kt as ImageMapSetting,
|
|
5364
5363
|
ki as ImageSettingSet,
|
|
5365
5364
|
fi as MarginBottomSetting,
|
|
5366
5365
|
xi as MarginSettingGroup,
|
|
@@ -5376,13 +5375,13 @@ export {
|
|
|
5376
5375
|
Xt as TabSettingGroup,
|
|
5377
5376
|
Xt as TabsSettingGroup,
|
|
5378
5377
|
mi as Toggle,
|
|
5379
|
-
|
|
5378
|
+
ut as UploadSetting,
|
|
5380
5379
|
Ze as WidthSetting,
|
|
5381
5380
|
hi as asSettingGroupWithSettings,
|
|
5382
5381
|
Yt as createSettingGroup,
|
|
5383
5382
|
ci as createTabSettingGroup,
|
|
5384
5383
|
R as isSetting,
|
|
5385
|
-
|
|
5384
|
+
vt as isSettingChild,
|
|
5386
5385
|
M as isSettingGroup,
|
|
5387
5386
|
Y as iterateSettings
|
|
5388
5387
|
};
|
package/package.json
CHANGED