builder-settings-types 0.0.210 → 0.0.212
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 +53 -34
- package/dist/builder-settings-types.es.js +341 -302
- package/dist/index.css +1 -1
- package/dist/index.d.ts +4 -0
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ let M = (c = 21) => {
|
|
|
5
5
|
t += V[e[c] & 63];
|
|
6
6
|
return t;
|
|
7
7
|
};
|
|
8
|
-
function
|
|
8
|
+
function L(c) {
|
|
9
9
|
if (c === null || typeof c != "object")
|
|
10
10
|
return c;
|
|
11
11
|
if (c instanceof Date)
|
|
@@ -13,12 +13,12 @@ function b(c) {
|
|
|
13
13
|
if (Array.isArray(c)) {
|
|
14
14
|
const i = [];
|
|
15
15
|
for (let s = 0; s < c.length; s++)
|
|
16
|
-
i[s] =
|
|
16
|
+
i[s] = L(c[s]);
|
|
17
17
|
return i;
|
|
18
18
|
}
|
|
19
19
|
const t = {};
|
|
20
20
|
for (const i in c)
|
|
21
|
-
Object.prototype.hasOwnProperty.call(c, i) && (t[i] =
|
|
21
|
+
Object.prototype.hasOwnProperty.call(c, i) && (t[i] = L(c[i]));
|
|
22
22
|
const e = Object.getPrototypeOf(c);
|
|
23
23
|
return e !== Object.prototype && Object.setPrototypeOf(t, e), t;
|
|
24
24
|
}
|
|
@@ -60,30 +60,30 @@ class p {
|
|
|
60
60
|
this.value = t, this.inputEl && (this.inputEl.value = String(t)), this.onChange && this.onChange(t), this.props.detectChange && this.props.detectChange(t);
|
|
61
61
|
}
|
|
62
62
|
clone() {
|
|
63
|
-
const t = this.constructor, e =
|
|
64
|
-
return i.value =
|
|
63
|
+
const t = this.constructor, e = L(this.props), i = new t(e);
|
|
64
|
+
return i.value = L(this.value), i;
|
|
65
65
|
}
|
|
66
66
|
createInput(t) {
|
|
67
67
|
t = { ...this.props.inputProps, ...t };
|
|
68
68
|
const e = document.createElement("div");
|
|
69
69
|
if (e.className = t.wrapperClassName || "", t.title || t.icon) {
|
|
70
|
-
const
|
|
71
|
-
if (
|
|
70
|
+
const o = document.createElement("div");
|
|
71
|
+
if (o.className = "icon-container", t.icon) {
|
|
72
72
|
const l = this.createIcon(t.icon, t.iconClassName);
|
|
73
|
-
|
|
73
|
+
o.appendChild(l);
|
|
74
74
|
}
|
|
75
75
|
if (t.title) {
|
|
76
76
|
const l = this.createLabel(t.title, t.labelClassName);
|
|
77
|
-
|
|
77
|
+
o.appendChild(l);
|
|
78
78
|
}
|
|
79
|
-
e.appendChild(
|
|
79
|
+
e.appendChild(o);
|
|
80
80
|
}
|
|
81
81
|
const i = document.createElement("div");
|
|
82
82
|
i.className = t.wrapperClassName || "";
|
|
83
83
|
const s = document.createElement("input");
|
|
84
84
|
this.inputEl = s, s.value = String(t.value || N(t.inputType)), s.type = t.inputType, s.placeholder = t.placeholder || "", s.className = t.inputClassName || "";
|
|
85
|
-
const n = (
|
|
86
|
-
const l =
|
|
85
|
+
const n = (o) => {
|
|
86
|
+
const l = o.target;
|
|
87
87
|
let h = l.value;
|
|
88
88
|
switch (t.inputType) {
|
|
89
89
|
case "number":
|
|
@@ -108,10 +108,10 @@ class p {
|
|
|
108
108
|
h = l.value;
|
|
109
109
|
}
|
|
110
110
|
this.value = h, this.onChange && this.onChange(this.value), this.props.detectChange && this.props.detectChange(this.value);
|
|
111
|
-
},
|
|
112
|
-
|
|
111
|
+
}, a = (o) => {
|
|
112
|
+
o.target, this.onBlur && this.onBlur(this.value);
|
|
113
113
|
};
|
|
114
|
-
return s.addEventListener("input", n), s.addEventListener("change", n), s.addEventListener("blur",
|
|
114
|
+
return s.addEventListener("input", n), s.addEventListener("change", n), s.addEventListener("blur", a), t.inputCustomizer && t.inputCustomizer(s), i.appendChild(s), e.appendChild(i), e;
|
|
115
115
|
}
|
|
116
116
|
createLabel(t, e) {
|
|
117
117
|
const i = document.createElement("span");
|
|
@@ -280,20 +280,20 @@ const g = class g {
|
|
|
280
280
|
return this.changeHandlers.clear(), w(this.settings, (i, s) => {
|
|
281
281
|
var n;
|
|
282
282
|
if (s instanceof g)
|
|
283
|
-
s.setOnChange((
|
|
284
|
-
const
|
|
285
|
-
this.initialValues =
|
|
283
|
+
s.setOnChange((a) => {
|
|
284
|
+
const o = this.getValues();
|
|
285
|
+
this.initialValues = o, t(o);
|
|
286
286
|
}), this.changeHandlers.add(() => t(this.getValues()));
|
|
287
287
|
else if (s instanceof p) {
|
|
288
|
-
const
|
|
288
|
+
const a = () => {
|
|
289
289
|
e();
|
|
290
290
|
};
|
|
291
|
-
this.changeHandlers.add(
|
|
291
|
+
this.changeHandlers.add(a), s.setOnChange(a);
|
|
292
292
|
} else {
|
|
293
|
-
const
|
|
293
|
+
const a = () => {
|
|
294
294
|
e();
|
|
295
295
|
};
|
|
296
|
-
this.changeHandlers.add(
|
|
296
|
+
this.changeHandlers.add(a), (n = s.setOnChange) == null || n.call(s, a);
|
|
297
297
|
}
|
|
298
298
|
}), this;
|
|
299
299
|
}
|
|
@@ -379,10 +379,10 @@ const g = class g {
|
|
|
379
379
|
...Object.keys(t),
|
|
380
380
|
...Object.keys(e)
|
|
381
381
|
])).forEach((n) => {
|
|
382
|
-
const
|
|
383
|
-
JSON.stringify(
|
|
384
|
-
from:
|
|
385
|
-
to:
|
|
382
|
+
const a = t[n], o = e[n];
|
|
383
|
+
JSON.stringify(a) !== JSON.stringify(o) && (i[n] = {
|
|
384
|
+
from: a,
|
|
385
|
+
to: o
|
|
386
386
|
});
|
|
387
387
|
}), i;
|
|
388
388
|
}
|
|
@@ -488,45 +488,45 @@ const g = class g {
|
|
|
488
488
|
</svg>
|
|
489
489
|
`, r.title = this.description, n.appendChild(r);
|
|
490
490
|
}
|
|
491
|
-
const
|
|
492
|
-
|
|
491
|
+
const a = document.createElement("span");
|
|
492
|
+
a.className = "setting-group-arrow", a.innerHTML = `
|
|
493
493
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
494
494
|
<path d="M4 6L8 10L12 6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
495
495
|
</svg>
|
|
496
|
-
`, this.isCollapsed &&
|
|
497
|
-
const
|
|
498
|
-
if (
|
|
496
|
+
`, this.isCollapsed && a.classList.add("rotated"), n.appendChild(a);
|
|
497
|
+
const o = document.createElement("div");
|
|
498
|
+
if (o.className = "setting-group-content", this.isCollapsed && (o.classList.add("collapsed"), e.classList.add("collapsed-view"), a.classList.add("rotated"), t.classList.add("collapsed")), this.isMain && o.classList.add("main-content"), this.description && !this.isCollapsed) {
|
|
499
499
|
const r = document.createElement("div");
|
|
500
|
-
r.className = "setting-group-description", r.textContent = this.description,
|
|
500
|
+
r.className = "setting-group-description", r.textContent = this.description, o.appendChild(r);
|
|
501
501
|
}
|
|
502
502
|
const l = () => {
|
|
503
|
-
this.isCollapsed = !this.isCollapsed,
|
|
503
|
+
this.isCollapsed = !this.isCollapsed, o.classList.toggle("collapsed"), e.classList.toggle("collapsed-view"), a.classList.toggle("rotated"), t.classList.toggle("collapsed", this.isCollapsed), e.setAttribute(
|
|
504
504
|
"aria-expanded",
|
|
505
505
|
(!this.isCollapsed).toString()
|
|
506
506
|
);
|
|
507
|
-
const r =
|
|
507
|
+
const r = o.querySelector(
|
|
508
508
|
".setting-group-description"
|
|
509
|
-
),
|
|
509
|
+
), d = n.querySelector(".info-marker");
|
|
510
510
|
if (this.description)
|
|
511
511
|
if (this.isCollapsed) {
|
|
512
|
-
if (r && r.remove(), !
|
|
513
|
-
const
|
|
514
|
-
|
|
512
|
+
if (r && r.remove(), !d) {
|
|
513
|
+
const u = document.createElement("span");
|
|
514
|
+
u.className = "info-marker", u.innerHTML = `
|
|
515
515
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
516
516
|
<path d="M8 5.33333V8M8 10.6667H8.00667M14 8C14 11.3137 11.3137 14 8 14C4.68629 14 2 11.3137 2 8C2 4.68629 4.68629 2 8 2C11.3137 2 14 4.68629 14 8Z"
|
|
517
517
|
stroke="currentColor" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>
|
|
518
518
|
</svg>
|
|
519
|
-
`,
|
|
519
|
+
`, u.title = this.description, n.insertBefore(u, a);
|
|
520
520
|
}
|
|
521
521
|
} else {
|
|
522
522
|
if (!r) {
|
|
523
|
-
const
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
523
|
+
const u = document.createElement("div");
|
|
524
|
+
u.className = "setting-group-description", u.textContent = this.description, o.insertBefore(
|
|
525
|
+
u,
|
|
526
|
+
o.firstChild
|
|
527
527
|
);
|
|
528
528
|
}
|
|
529
|
-
|
|
529
|
+
d && d.remove();
|
|
530
530
|
}
|
|
531
531
|
};
|
|
532
532
|
if (e.onclick = l, e.onkeydown = (r) => {
|
|
@@ -534,14 +534,14 @@ const g = class g {
|
|
|
534
534
|
}, Object.keys(this.settings).length > 0) {
|
|
535
535
|
for (const r in this.settings)
|
|
536
536
|
if (this.settings.hasOwnProperty(r)) {
|
|
537
|
-
const
|
|
538
|
-
|
|
537
|
+
const d = this.settings[r];
|
|
538
|
+
d instanceof g && d.setNestingLevel(this.nestingLevel + 1), o.appendChild(d.draw());
|
|
539
539
|
}
|
|
540
540
|
} else {
|
|
541
541
|
const r = document.createElement("div");
|
|
542
|
-
r.className = "setting-group-empty", r.textContent = "No settings in this group",
|
|
542
|
+
r.className = "setting-group-empty", r.textContent = "No settings in this group", o.appendChild(r);
|
|
543
543
|
}
|
|
544
|
-
return e.appendChild(i), e.appendChild(n), t.appendChild(e), t.appendChild(
|
|
544
|
+
return e.appendChild(i), e.appendChild(n), t.appendChild(e), t.appendChild(o), this.elementRef = t, H.trackElement(t), setTimeout(() => {
|
|
545
545
|
this.updateNestingStyles();
|
|
546
546
|
}, 0), this.pendingBlurHandler && (this.setupBlurHandlers(), this.pendingBlurHandler = null), t;
|
|
547
547
|
}
|
|
@@ -578,10 +578,10 @@ const g = class g {
|
|
|
578
578
|
let i = e;
|
|
579
579
|
const s = Object.keys(this.settings), n = Object.keys(e);
|
|
580
580
|
if (!s.some(
|
|
581
|
-
(
|
|
581
|
+
(o) => n.includes(o)
|
|
582
582
|
) && n.length === 1) {
|
|
583
|
-
const
|
|
584
|
-
i = e[
|
|
583
|
+
const o = n[0];
|
|
584
|
+
i = e[o];
|
|
585
585
|
}
|
|
586
586
|
this.setValue(i);
|
|
587
587
|
} catch (e) {
|
|
@@ -591,7 +591,7 @@ const g = class g {
|
|
|
591
591
|
};
|
|
592
592
|
g.hiddenElements = /* @__PURE__ */ new Set();
|
|
593
593
|
let f = g;
|
|
594
|
-
class
|
|
594
|
+
class ct extends f {
|
|
595
595
|
constructor(t) {
|
|
596
596
|
super(t);
|
|
597
597
|
const e = Object.keys(this.settings)[0];
|
|
@@ -625,17 +625,17 @@ class ht extends f {
|
|
|
625
625
|
s.textContent = this.title, i.appendChild(s);
|
|
626
626
|
const n = document.createElement("div");
|
|
627
627
|
n.className = "tabs-header", this.tabsContainer = n;
|
|
628
|
-
const
|
|
629
|
-
if (
|
|
628
|
+
const a = document.createElement("div");
|
|
629
|
+
if (a.className = "tab-content", this.contentContainers = {}, Object.keys(this.settings).forEach((o, l) => {
|
|
630
630
|
const h = document.createElement("button");
|
|
631
|
-
h.className = "tab-button", h.type = "button", h.setAttribute("data-tab-id",
|
|
631
|
+
h.className = "tab-button", h.type = "button", h.setAttribute("data-tab-id", o), h.textContent = o, h.addEventListener("click", () => this.switchToTab(o)), n.appendChild(h);
|
|
632
632
|
const r = document.createElement("div");
|
|
633
|
-
r.className = "tab-panel", this.contentContainers[
|
|
634
|
-
const
|
|
635
|
-
|
|
636
|
-
}), e.appendChild(i), e.appendChild(n), e.appendChild(
|
|
637
|
-
const
|
|
638
|
-
this.activeTabId =
|
|
633
|
+
r.className = "tab-panel", this.contentContainers[o] = r;
|
|
634
|
+
const d = this.settings[o];
|
|
635
|
+
d && (d instanceof f && d.setNestingLevel(this.getNestingLevel() + 1), r.appendChild(d.draw())), a.appendChild(r), l === 0 && !this.activeTabId && (this.activeTabId = o);
|
|
636
|
+
}), e.appendChild(i), e.appendChild(n), e.appendChild(a), !this.activeTabId) {
|
|
637
|
+
const o = Object.keys(this.settings)[0];
|
|
638
|
+
this.activeTabId = o || "";
|
|
639
639
|
}
|
|
640
640
|
return this.updateTabUI(), t;
|
|
641
641
|
}
|
|
@@ -643,7 +643,7 @@ class ht extends f {
|
|
|
643
643
|
function T(c) {
|
|
644
644
|
return new f(c);
|
|
645
645
|
}
|
|
646
|
-
function
|
|
646
|
+
function dt(c) {
|
|
647
647
|
return c;
|
|
648
648
|
}
|
|
649
649
|
class A extends p {
|
|
@@ -686,11 +686,11 @@ class m extends A {
|
|
|
686
686
|
const e = t.split(",").map((r) => parseInt(r.trim()));
|
|
687
687
|
if (e.length !== 3 || e.some(isNaN))
|
|
688
688
|
return console.warn(`Invalid RGB value "${t}", using default "#000000"`), "#000000";
|
|
689
|
-
const [i, s, n] = e,
|
|
690
|
-
const
|
|
691
|
-
return
|
|
689
|
+
const [i, s, n] = e, a = Math.max(0, Math.min(255, i)), o = Math.max(0, Math.min(255, s)), l = Math.max(0, Math.min(255, n)), h = (r) => {
|
|
690
|
+
const d = r.toString(16);
|
|
691
|
+
return d.length === 1 ? "0" + d : d;
|
|
692
692
|
};
|
|
693
|
-
return `#${h(
|
|
693
|
+
return `#${h(a)}${h(o)}${h(l)}`;
|
|
694
694
|
}
|
|
695
695
|
setValue(t) {
|
|
696
696
|
if (t === void 0) {
|
|
@@ -728,31 +728,31 @@ class m extends A {
|
|
|
728
728
|
const h = l.value.trim();
|
|
729
729
|
if (!h)
|
|
730
730
|
return e.classList.remove("error"), !0;
|
|
731
|
-
const
|
|
732
|
-
return
|
|
731
|
+
const d = /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/.test(h);
|
|
732
|
+
return d ? e.classList.remove("error") : e.classList.add("error"), d;
|
|
733
733
|
}, s = document.createElement("input");
|
|
734
734
|
s.type = "color", s.className = "color-picker", s.value = this.value || "#000000", s.setAttribute("aria-label", "Choose color"), s.setAttribute("title", "Click to open color picker"), this.colorInputEl = s;
|
|
735
735
|
const n = document.createElement("div");
|
|
736
736
|
n.className = "color-preview";
|
|
737
|
-
const
|
|
738
|
-
n.style.backgroundColor =
|
|
739
|
-
const
|
|
740
|
-
return
|
|
741
|
-
var r,
|
|
737
|
+
const a = this.value || "#000000";
|
|
738
|
+
n.style.backgroundColor = a;
|
|
739
|
+
const o = document.createElement("input");
|
|
740
|
+
return o.type = "text", o.className = "color-text-input", o.value = this.value || "", o.placeholder = "#000000", o.setAttribute("pattern", "#[0-9A-Fa-f]{6}"), o.setAttribute("title", "Enter a hex color value (e.g., #ff0000)"), o.setAttribute("aria-label", "Hex color value"), o.setAttribute("maxlength", "7"), this.textInputEl = o, this.textInputEl.addEventListener("input", (l) => {
|
|
741
|
+
var r, d;
|
|
742
742
|
let h = l.target.value.trim();
|
|
743
743
|
if (this.textInputEl && i(this.textInputEl)) {
|
|
744
|
-
const
|
|
745
|
-
this.value =
|
|
744
|
+
const u = m.normalizeColorValue(h);
|
|
745
|
+
this.value = u, (r = this.onChange) == null || r.call(this, u), (d = this.detectChange) == null || d.call(this, u), this.colorInputEl && (this.colorInputEl.value = u), n.style.backgroundColor = u;
|
|
746
746
|
}
|
|
747
747
|
}), this.colorInputEl.addEventListener("input", (l) => {
|
|
748
|
-
var
|
|
748
|
+
var d, u;
|
|
749
749
|
const h = l.target.value, r = m.normalizeColorValue(h);
|
|
750
|
-
this.value = r, (
|
|
750
|
+
this.value = r, (d = this.onChange) == null || d.call(this, r), (u = this.detectChange) == null || u.call(this, r), this.textInputEl && (this.textInputEl.value = r), n.style.backgroundColor = r, e.classList.remove("error");
|
|
751
751
|
}), this.colorInputEl.addEventListener("change", (l) => {
|
|
752
|
-
var
|
|
752
|
+
var d, u;
|
|
753
753
|
const h = l.target.value, r = m.normalizeColorValue(h);
|
|
754
|
-
this.value = r, (
|
|
755
|
-
}), e.appendChild(s), e.appendChild(n), e.appendChild(
|
|
754
|
+
this.value = r, (d = this.onChange) == null || d.call(this, r), (u = this.detectChange) == null || u.call(this, r), this.textInputEl && (this.textInputEl.value = r), n.style.backgroundColor = r;
|
|
755
|
+
}), e.appendChild(s), e.appendChild(n), e.appendChild(o), t.appendChild(e), this.element = t, t;
|
|
756
756
|
}
|
|
757
757
|
getElement() {
|
|
758
758
|
return this.element;
|
|
@@ -808,8 +808,8 @@ class C extends p {
|
|
|
808
808
|
}
|
|
809
809
|
updateColorPreview() {
|
|
810
810
|
if (!this.colorPreviewEl || !this.value) return;
|
|
811
|
-
const t = this.getRgbColor(), e = this.getOpacityPercent() / 100, i = t.replace("#", ""), s = parseInt(i.substring(0, 2), 16), n = parseInt(i.substring(2, 4), 16),
|
|
812
|
-
this.colorPreviewEl.style.backgroundColor = `rgba(${s}, ${n}, ${
|
|
811
|
+
const t = this.getRgbColor(), e = this.getOpacityPercent() / 100, i = t.replace("#", ""), s = parseInt(i.substring(0, 2), 16), n = parseInt(i.substring(2, 4), 16), a = parseInt(i.substring(4, 6), 16);
|
|
812
|
+
this.colorPreviewEl.style.backgroundColor = `rgba(${s}, ${n}, ${a}, ${e})`;
|
|
813
813
|
}
|
|
814
814
|
handleColorChange(t) {
|
|
815
815
|
const e = this.getOpacityPercent(), i = C.combineColorOpacity(t, e);
|
|
@@ -826,41 +826,41 @@ class C extends p {
|
|
|
826
826
|
draw() {
|
|
827
827
|
const t = document.createElement("div");
|
|
828
828
|
if (t.className = "color-with-opacity-setting-wrapper " + (this.props.wrapperClassName || ""), this.props.title || this.props.icon) {
|
|
829
|
-
const
|
|
830
|
-
if (
|
|
831
|
-
const
|
|
832
|
-
|
|
829
|
+
const a = document.createElement("div");
|
|
830
|
+
if (a.className = "icon-container", this.props.icon) {
|
|
831
|
+
const o = document.createElement("span");
|
|
832
|
+
o.className = "input-icon", o.innerHTML = this.props.icon, a.appendChild(o);
|
|
833
833
|
}
|
|
834
834
|
if (this.props.title) {
|
|
835
|
-
const
|
|
836
|
-
|
|
835
|
+
const o = document.createElement("span");
|
|
836
|
+
o.className = "input-label", o.textContent = this.props.title, a.appendChild(o);
|
|
837
837
|
}
|
|
838
|
-
t.appendChild(
|
|
838
|
+
t.appendChild(a);
|
|
839
839
|
}
|
|
840
840
|
const e = document.createElement("div");
|
|
841
|
-
e.className = "color-with-opacity-input-wrapper", this.colorInputEl = document.createElement("input"), this.colorInputEl.type = "color", this.colorInputEl.className = "color-with-opacity-picker", this.colorPreviewEl = document.createElement("div"), this.colorPreviewEl.className = "color-with-opacity-preview", this.textInputEl = document.createElement("input"), this.textInputEl.type = "text", this.textInputEl.className = "color-with-opacity-text-input", this.textInputEl.placeholder = "#000000FF", this.updateInputElements(), this.updateColorPreview(), this.colorInputEl.addEventListener("input", (
|
|
842
|
-
const
|
|
843
|
-
this.handleColorChange(
|
|
844
|
-
}), this.textInputEl.addEventListener("input", (
|
|
845
|
-
const
|
|
846
|
-
this.handleTextInput(
|
|
847
|
-
}), this.textInputEl.addEventListener("blur", (
|
|
848
|
-
const
|
|
849
|
-
|
|
841
|
+
e.className = "color-with-opacity-input-wrapper", this.colorInputEl = document.createElement("input"), this.colorInputEl.type = "color", this.colorInputEl.className = "color-with-opacity-picker", this.colorPreviewEl = document.createElement("div"), this.colorPreviewEl.className = "color-with-opacity-preview", this.textInputEl = document.createElement("input"), this.textInputEl.type = "text", this.textInputEl.className = "color-with-opacity-text-input", this.textInputEl.placeholder = "#000000FF", this.updateInputElements(), this.updateColorPreview(), this.colorInputEl.addEventListener("input", (a) => {
|
|
842
|
+
const o = a.target;
|
|
843
|
+
this.handleColorChange(o.value), this.textInputEl && (this.textInputEl.value = this.value || "#000000FF"), this.updateColorPreview();
|
|
844
|
+
}), this.textInputEl.addEventListener("input", (a) => {
|
|
845
|
+
const o = a.target;
|
|
846
|
+
this.handleTextInput(o.value) ? (this.colorInputEl && (this.colorInputEl.value = this.getRgbColor()), this.updateColorPreview(), e.classList.remove("error")) : o.value.trim() === "" ? e.classList.remove("error") : e.classList.add("error");
|
|
847
|
+
}), this.textInputEl.addEventListener("blur", (a) => {
|
|
848
|
+
const o = a.target;
|
|
849
|
+
o.value.trim() === "" && (o.value = this.value || "#000000FF", e.classList.remove("error"));
|
|
850
850
|
}), this.colorPreviewEl.addEventListener("click", () => {
|
|
851
|
-
var
|
|
852
|
-
(
|
|
851
|
+
var a;
|
|
852
|
+
(a = this.colorInputEl) == null || a.click();
|
|
853
853
|
}), e.appendChild(this.colorInputEl), e.appendChild(this.colorPreviewEl), e.appendChild(this.textInputEl);
|
|
854
854
|
const i = document.createElement("div");
|
|
855
855
|
i.className = "color-with-opacity-opacity-wrapper", this.opacityInputEl = document.createElement("input"), this.opacityInputEl.type = "number", this.opacityInputEl.className = "color-with-opacity-opacity-input", this.opacityInputEl.value = this.getOpacityPercent().toString(), this.opacityInputEl.min = "0", this.opacityInputEl.max = "100", this.opacityInputEl.step = "1", this.opacityInputEl.placeholder = "100";
|
|
856
856
|
const s = document.createElement("span");
|
|
857
|
-
s.className = "color-with-opacity-opacity-suffix", s.textContent = "%", this.opacityInputEl.addEventListener("input", (
|
|
858
|
-
const
|
|
857
|
+
s.className = "color-with-opacity-opacity-suffix", s.textContent = "%", this.opacityInputEl.addEventListener("input", (a) => {
|
|
858
|
+
const o = a.target, l = parseFloat(o.value);
|
|
859
859
|
isNaN(l) || (this.handleOpacityChange(l), this.textInputEl && (this.textInputEl.value = this.value || "#000000FF"), this.updateColorPreview());
|
|
860
|
-
}), this.opacityInputEl.addEventListener("blur", (
|
|
861
|
-
const
|
|
862
|
-
let l = parseFloat(
|
|
863
|
-
isNaN(l) && (l = this.getOpacityPercent()), l = Math.max(0, Math.min(100, l)),
|
|
860
|
+
}), this.opacityInputEl.addEventListener("blur", (a) => {
|
|
861
|
+
const o = a.target;
|
|
862
|
+
let l = parseFloat(o.value);
|
|
863
|
+
isNaN(l) && (l = this.getOpacityPercent()), l = Math.max(0, Math.min(100, l)), o.value = l.toString(), this.handleOpacityChange(l), this.textInputEl && (this.textInputEl.value = this.value || "#000000FF"), this.updateColorPreview();
|
|
864
864
|
}), i.appendChild(this.opacityInputEl), i.appendChild(s);
|
|
865
865
|
const n = document.createElement("div");
|
|
866
866
|
return n.className = "color-with-opacity-controls-wrapper", n.appendChild(e), n.appendChild(i), t.appendChild(n), this.element = t, this.updateInputElements(), this.updateColorPreview(), t;
|
|
@@ -873,8 +873,8 @@ class C extends p {
|
|
|
873
873
|
}
|
|
874
874
|
getRgbaValue() {
|
|
875
875
|
if (!this.value) return "rgba(0, 0, 0, 1)";
|
|
876
|
-
const t = this.getRgbColor(), e = this.getOpacityPercent() / 100, i = t.replace("#", ""), s = parseInt(i.substring(0, 2), 16), n = parseInt(i.substring(2, 4), 16),
|
|
877
|
-
return `rgba(${s}, ${n}, ${
|
|
876
|
+
const t = this.getRgbColor(), e = this.getOpacityPercent() / 100, i = t.replace("#", ""), s = parseInt(i.substring(0, 2), 16), n = parseInt(i.substring(2, 4), 16), a = parseInt(i.substring(4, 6), 16);
|
|
877
|
+
return `rgba(${s}, ${n}, ${a}, ${e})`;
|
|
878
878
|
}
|
|
879
879
|
getColorAndOpacity() {
|
|
880
880
|
return {
|
|
@@ -895,20 +895,20 @@ class ut extends p {
|
|
|
895
895
|
if (t.className = "html-setting-wrapper " + (this.props.wrapperClassName || ""), this.props.title || this.props.icon) {
|
|
896
896
|
const n = document.createElement("div");
|
|
897
897
|
if (n.className = "icon-container", this.props.icon) {
|
|
898
|
-
const
|
|
899
|
-
n.appendChild(
|
|
898
|
+
const a = this.createIcon(this.props.icon);
|
|
899
|
+
n.appendChild(a);
|
|
900
900
|
}
|
|
901
901
|
if (this.props.title) {
|
|
902
|
-
const
|
|
903
|
-
n.appendChild(
|
|
902
|
+
const a = this.createLabel(this.props.title);
|
|
903
|
+
n.appendChild(a);
|
|
904
904
|
}
|
|
905
905
|
t.appendChild(n);
|
|
906
906
|
}
|
|
907
907
|
const e = document.createElement("textarea");
|
|
908
908
|
this.textareaEl = e, e.value = this.value || "", e.placeholder = this.props.placeholder || "Paste your HTML here...", e.className = "html-setting-textarea " + (this.props.textareaClassName || ""), e.rows = this.props.rows || 6, this.props.maxLength !== void 0 && (e.maxLength = this.props.maxLength), this.props.className && e.classList.add(this.props.className);
|
|
909
909
|
const i = (n) => {
|
|
910
|
-
const
|
|
911
|
-
this.value =
|
|
910
|
+
const o = n.target.value;
|
|
911
|
+
this.value = o, this.onChange && this.onChange(this.value), this.props.detectChange && this.props.detectChange(this.value);
|
|
912
912
|
}, s = (n) => {
|
|
913
913
|
this.onBlur && this.value !== void 0 && this.onBlur(this.value);
|
|
914
914
|
};
|
|
@@ -938,12 +938,12 @@ class v extends p {
|
|
|
938
938
|
const i = document.createElement("input");
|
|
939
939
|
if (i.type = "number", i.className = "number-setting-input " + (this.props.inputClassName || ""), i.value = String(this.value ?? ""), i.placeholder = this.props.placeholder || "", this.props.minValue !== void 0 && (i.min = String(this.props.minValue)), this.props.maxValue !== void 0 && (i.max = String(this.props.maxValue)), this.props.step !== void 0 && (i.step = String(this.props.step)), i.addEventListener("input", () => {
|
|
940
940
|
const s = this.props.minValue ?? Number.MIN_SAFE_INTEGER, n = this.props.maxValue ?? Number.MAX_SAFE_INTEGER;
|
|
941
|
-
let
|
|
942
|
-
|
|
941
|
+
let a = Number(i.value);
|
|
942
|
+
a < s && (a = s), a > n && (a = n), String(a) !== i.value && (i.value = String(a)), this.setValue(a);
|
|
943
943
|
}), i.addEventListener("blur", () => {
|
|
944
|
-
var n,
|
|
944
|
+
var n, a;
|
|
945
945
|
const s = this.validateValue(Number(i.value));
|
|
946
|
-
s !== Number(i.value) && (i.value = String(s), this.setValue(s)), (
|
|
946
|
+
s !== Number(i.value) && (i.value = String(s), this.setValue(s)), (a = (n = this.props).onBlur) == null || a.call(n);
|
|
947
947
|
}), e.appendChild(i), this.props.suffix && this.props.suffix !== "none") {
|
|
948
948
|
const s = document.createElement("span");
|
|
949
949
|
s.className = "suffix-label", s.textContent = this.props.suffix, e.appendChild(s);
|
|
@@ -1012,6 +1012,11 @@ class y extends p {
|
|
|
1012
1012
|
e >= 0 && (this.selectedOptionIndex = e);
|
|
1013
1013
|
}
|
|
1014
1014
|
}
|
|
1015
|
+
setValue(t) {
|
|
1016
|
+
super.setValue(t);
|
|
1017
|
+
const e = this._options.findIndex((i) => i.value === t);
|
|
1018
|
+
e >= 0 ? this.selectedOptionIndex = e : this.selectedOptionIndex = null, this.updateButtonText();
|
|
1019
|
+
}
|
|
1015
1020
|
createOption(t, e) {
|
|
1016
1021
|
const i = document.createElement("li");
|
|
1017
1022
|
return i.classList.add("select-option"), i.textContent = t.name, i.dataset.index = String(e), this.selectedOptionIndex === e && i.classList.add("selected"), i;
|
|
@@ -1021,12 +1026,12 @@ class y extends p {
|
|
|
1021
1026
|
if (t.classList.add("select-container"), this.container = t, this.props.icon || this.props.title) {
|
|
1022
1027
|
const n = document.createElement("div");
|
|
1023
1028
|
if (n.className = "icon-container", this.props.icon) {
|
|
1024
|
-
const
|
|
1025
|
-
n.appendChild(
|
|
1029
|
+
const a = this.createIcon(this.props.icon);
|
|
1030
|
+
n.appendChild(a);
|
|
1026
1031
|
}
|
|
1027
1032
|
if (this.props.title) {
|
|
1028
|
-
const
|
|
1029
|
-
n.appendChild(
|
|
1033
|
+
const a = this.createLabel(this.props.title);
|
|
1034
|
+
n.appendChild(a);
|
|
1030
1035
|
}
|
|
1031
1036
|
t.appendChild(n);
|
|
1032
1037
|
} else {
|
|
@@ -1035,13 +1040,13 @@ class y extends p {
|
|
|
1035
1040
|
}
|
|
1036
1041
|
const e = document.createElement("div");
|
|
1037
1042
|
e.classList.add("select-button"), this.isLoading ? e.classList.add("loading") : e.textContent = this.selectedOptionIndex !== null ? this._options[this.selectedOptionIndex].name : this.props.placeholder || "Select an option", e.onclick = () => {
|
|
1038
|
-
var n,
|
|
1039
|
-
this.isLoading || (this.isOpen = !this.isOpen, this.isOpen ? this.checkDropdownPosition() : this.cleanupDropdownPosition(), (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (
|
|
1043
|
+
var n, a;
|
|
1044
|
+
this.isLoading || (this.isOpen = !this.isOpen, this.isOpen ? this.checkDropdownPosition() : this.cleanupDropdownPosition(), (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (a = this.svgContainer) == null || a.classList.toggle("open", this.isOpen));
|
|
1040
1045
|
}, t.appendChild(e), this.buttonEl = e;
|
|
1041
1046
|
const i = document.createElement("ul");
|
|
1042
|
-
i.classList.add("select-options"), this._options.forEach((n,
|
|
1043
|
-
const
|
|
1044
|
-
|
|
1047
|
+
i.classList.add("select-options"), this._options.forEach((n, a) => {
|
|
1048
|
+
const o = this.createOption(n, a);
|
|
1049
|
+
o.onclick = (l) => this.selectOption(l, a, e), i.appendChild(o);
|
|
1045
1050
|
}), document.body.appendChild(i);
|
|
1046
1051
|
const s = document.createElement("div");
|
|
1047
1052
|
return s.classList.add("svg-container"), s.innerHTML = z, t.appendChild(s), this.optionsListEl = i, this.svgContainer = s, this.props.getOptionsAsync && (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((n) => {
|
|
@@ -1049,8 +1054,8 @@ class y extends p {
|
|
|
1049
1054
|
}).catch((n) => {
|
|
1050
1055
|
console.error("Failed to fetch async options:", n), this.isLoading = !1, this.updateButtonText("Failed to load options");
|
|
1051
1056
|
})), this.clickOutsideListener && document.removeEventListener("click", this.clickOutsideListener), this.clickOutsideListener = (n) => {
|
|
1052
|
-
var
|
|
1053
|
-
this.isOpen && !t.contains(n.target) && (this.isOpen = !1, (
|
|
1057
|
+
var a, o;
|
|
1058
|
+
this.isOpen && !t.contains(n.target) && (this.isOpen = !1, (a = this.optionsListEl) == null || a.classList.remove("open"), (o = this.svgContainer) == null || o.classList.remove("open"), this.cleanupDropdownPosition());
|
|
1054
1059
|
}, document.addEventListener("click", this.clickOutsideListener), this.resizeListener && window.removeEventListener("resize", this.resizeListener), this.resizeListener = () => {
|
|
1055
1060
|
this.isOpen && this.checkDropdownPosition();
|
|
1056
1061
|
}, window.addEventListener("resize", this.resizeListener), t;
|
|
@@ -1072,9 +1077,9 @@ class y extends p {
|
|
|
1072
1077
|
}
|
|
1073
1078
|
}
|
|
1074
1079
|
selectOption(t, e, i) {
|
|
1075
|
-
var n,
|
|
1080
|
+
var n, a, o;
|
|
1076
1081
|
const s = this._options[e];
|
|
1077
|
-
s && (this.value = s.value, (n = this.onChange) == null || n.call(this, this.value), this.selectedOptionIndex = e, this.isOpen = !1, i.textContent = s.name, (
|
|
1082
|
+
s && (this.value = s.value, (n = this.onChange) == null || n.call(this, this.value), this.selectedOptionIndex = e, this.isOpen = !1, i.textContent = s.name, (a = this.optionsListEl) == null || a.classList.remove("open"), (o = this.svgContainer) == null || o.classList.remove("open"), this.cleanupDropdownPosition(), this.optionsListEl && this.optionsListEl.querySelectorAll(".select-option").forEach((h, r) => {
|
|
1078
1083
|
r === e ? h.classList.add("selected") : h.classList.remove("selected");
|
|
1079
1084
|
}));
|
|
1080
1085
|
}
|
|
@@ -1158,15 +1163,15 @@ class j extends p {
|
|
|
1158
1163
|
`
|
|
1159
1164
|
}
|
|
1160
1165
|
].forEach((n) => {
|
|
1161
|
-
const
|
|
1162
|
-
|
|
1163
|
-
var
|
|
1164
|
-
i.querySelectorAll(".align-option-button").forEach((l) => l.classList.remove("selected")),
|
|
1165
|
-
}), i.appendChild(
|
|
1166
|
+
const a = document.createElement("button");
|
|
1167
|
+
a.className = "align-option-button", a.innerHTML = n.icon, this.value === n.name && a.classList.add("selected"), a.addEventListener("click", () => {
|
|
1168
|
+
var o;
|
|
1169
|
+
i.querySelectorAll(".align-option-button").forEach((l) => l.classList.remove("selected")), a.classList.add("selected"), this.value = n.name, (o = this.onChange) == null || o.call(this, this.value);
|
|
1170
|
+
}), i.appendChild(a);
|
|
1166
1171
|
}), t.appendChild(i), t;
|
|
1167
1172
|
}
|
|
1168
1173
|
}
|
|
1169
|
-
class
|
|
1174
|
+
class pt extends p {
|
|
1170
1175
|
constructor(t) {
|
|
1171
1176
|
super(t), this.inputType = "button";
|
|
1172
1177
|
}
|
|
@@ -1179,7 +1184,7 @@ class dt extends p {
|
|
|
1179
1184
|
return e.className = "button-setting-wrapper " + (this.props.wrapperClassName || ""), e.appendChild(t), e;
|
|
1180
1185
|
}
|
|
1181
1186
|
}
|
|
1182
|
-
class
|
|
1187
|
+
class gt extends p {
|
|
1183
1188
|
constructor(t = {}) {
|
|
1184
1189
|
super(t), this.inputType = { width: "number", height: "number" }, this.aspectRatio = 1, this.isUpdating = !1;
|
|
1185
1190
|
const e = t.width || 0, i = t.height || 0;
|
|
@@ -1192,14 +1197,14 @@ class pt extends p {
|
|
|
1192
1197
|
suffix: "px",
|
|
1193
1198
|
minValue: this.minWidth,
|
|
1194
1199
|
maxValue: this.maxWidth,
|
|
1195
|
-
icon:
|
|
1200
|
+
icon: W
|
|
1196
1201
|
}), this.heightSetting = new v({
|
|
1197
1202
|
title: "Height",
|
|
1198
1203
|
default: this.value.height,
|
|
1199
1204
|
suffix: "px",
|
|
1200
1205
|
minValue: this.minHeight,
|
|
1201
1206
|
maxValue: this.maxHeight,
|
|
1202
|
-
icon:
|
|
1207
|
+
icon: G
|
|
1203
1208
|
}), this.widthSetting.setOnChange(this.handleWidthChange.bind(this)), this.heightSetting.setOnChange(this.handleHeightChange.bind(this));
|
|
1204
1209
|
}
|
|
1205
1210
|
handleWidthChange(t) {
|
|
@@ -1269,8 +1274,8 @@ class pt extends p {
|
|
|
1269
1274
|
return n.className = "dimension-lock-icon", n.setAttribute("type", "button"), n.setAttribute("aria-pressed", String(this.locked)), n.setAttribute(
|
|
1270
1275
|
"aria-label",
|
|
1271
1276
|
this.locked ? "Unlock aspect ratio" : "Lock aspect ratio"
|
|
1272
|
-
), n.title = this.locked ? "Unlock aspect ratio" : "Lock aspect ratio", n.innerHTML = this.getLockSVG(this.locked), n.onclick = (
|
|
1273
|
-
|
|
1277
|
+
), n.title = this.locked ? "Unlock aspect ratio" : "Lock aspect ratio", n.innerHTML = this.getLockSVG(this.locked), n.onclick = (a) => {
|
|
1278
|
+
a.preventDefault(), this.toggleLock(n);
|
|
1274
1279
|
}, s.appendChild(n), t.appendChild(e), t.appendChild(s), t.appendChild(i), t;
|
|
1275
1280
|
}
|
|
1276
1281
|
isLocked() {
|
|
@@ -1293,15 +1298,15 @@ class pt extends p {
|
|
|
1293
1298
|
}
|
|
1294
1299
|
}
|
|
1295
1300
|
}
|
|
1296
|
-
const
|
|
1301
|
+
const W = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1297
1302
|
<path d="M4.5 9.5H13.5M4.5 9.5L6 7.25M4.5 9.5L6 11.75M13.5 9.5L12 7.25M13.5 9.5L12 11.75M15.75 16.25V2.75M2.25 16.25V2.75" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
|
1298
|
-
</svg>`,
|
|
1303
|
+
</svg>`, G = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1299
1304
|
<path d="M9 14L9 5M9 14L6.75 12.5M9 14L11.25 12.5M9 5L6.75 6.5M9 5L11.25 6.5M15.75 2.75H2.25M15.75 16.25H2.25" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
|
1300
|
-
</svg>`,
|
|
1305
|
+
</svg>`, b = `
|
|
1301
1306
|
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="16" viewBox="0 0 15 16" fill="none">
|
|
1302
1307
|
<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"/>
|
|
1303
1308
|
</svg>
|
|
1304
|
-
`,
|
|
1309
|
+
`, P = `
|
|
1305
1310
|
<svg width="91" height="71" viewBox="0 0 91 71" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1306
1311
|
<rect width="91" height="71" rx="4" fill="#F2F4F7"/>
|
|
1307
1312
|
<path d="M37 31.5L39.5 29M39.5 29L42 31.5M39.5 29V34.625M44.5 31.9643C45.2634 31.3338 45.75 30.38 45.75 29.3125C45.75 27.414 44.211 25.875 42.3125 25.875C42.1759 25.875 42.0482 25.8037 41.9788 25.6861C41.1638 24.303 39.659 23.375 37.9375 23.375C35.3487 23.375 33.25 25.4737 33.25 28.0625C33.25 29.3538 33.7721 30.5232 34.6168 31.371" stroke="#475467" stroke-linecap="round" stroke-linejoin="round"/>
|
|
@@ -1310,10 +1315,29 @@ const G = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBo
|
|
|
1310
1315
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 12 12" fill="none">
|
|
1311
1316
|
<path d="M8 3V2.6C8 2.03995 8 1.75992 7.89101 1.54601C7.79513 1.35785 7.64215 1.20487 7.45399 1.10899C7.24008 1 6.96005 1 6.4 1H5.6C5.03995 1 4.75992 1 4.54601 1.10899C4.35785 1.20487 4.20487 1.35785 4.10899 1.54601C4 1.75992 4 2.03995 4 2.6V3M5 5.75V8.25M7 5.75V8.25M1.5 3H10.5M9.5 3V8.6C9.5 9.44008 9.5 9.86012 9.33651 10.181C9.1927 10.4632 8.96323 10.6927 8.68099 10.8365C8.36012 11 7.94008 11 7.1 11H4.9C4.05992 11 3.63988 11 3.31901 10.8365C3.03677 10.6927 2.8073 10.4632 2.66349 10.181C2.5 9.86012 2.5 9.44008 2.5 8.6V3" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
1312
1317
|
</svg>
|
|
1318
|
+
`, _ = `
|
|
1319
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="29" height="29" viewBox="0 0 29 29" fill="none">
|
|
1320
|
+
<!-- Top dot -->
|
|
1321
|
+
<circle cx="14.5" cy="3" r="1.5" fill="#02CC59" opacity="1"/>
|
|
1322
|
+
<!-- Top-right dot -->
|
|
1323
|
+
<circle cx="22.3" cy="6.7" r="1.5" fill="#02CC59" opacity="0.9"/>
|
|
1324
|
+
<!-- Right dot -->
|
|
1325
|
+
<circle cx="26" cy="14.5" r="1.5" fill="#02CC59" opacity="0.8"/>
|
|
1326
|
+
<!-- Bottom-right dot -->
|
|
1327
|
+
<circle cx="22.3" cy="22.3" r="1.5" fill="#02CC59" opacity="0.7"/>
|
|
1328
|
+
<!-- Bottom dot -->
|
|
1329
|
+
<circle cx="14.5" cy="26" r="1.5" fill="#02CC59" opacity="0.6"/>
|
|
1330
|
+
<!-- Bottom-left dot -->
|
|
1331
|
+
<circle cx="6.7" cy="22.3" r="1.5" fill="#02CC59" opacity="0.5"/>
|
|
1332
|
+
<!-- Left dot -->
|
|
1333
|
+
<circle cx="3" cy="14.5" r="1.5" fill="#02CC59" opacity="0.4"/>
|
|
1334
|
+
<!-- Top-left dot -->
|
|
1335
|
+
<circle cx="6.7" cy="6.7" r="1.5" fill="#02CC59" opacity="0.3"/>
|
|
1336
|
+
</svg>
|
|
1313
1337
|
`;
|
|
1314
|
-
class
|
|
1338
|
+
class U extends p {
|
|
1315
1339
|
constructor(t = {}) {
|
|
1316
|
-
super(t), this.inputType = "button", this.previewWrapper = null, this.previewEl = null, this.emptyStateEl = null, this.errorContainer = null, this.messageListener = 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();
|
|
1340
|
+
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();
|
|
1317
1341
|
}
|
|
1318
1342
|
setupMessageListener() {
|
|
1319
1343
|
this.messageListener = (t) => {
|
|
@@ -1338,6 +1362,12 @@ class _ extends p {
|
|
|
1338
1362
|
hideError() {
|
|
1339
1363
|
this.errorContainer && (this.errorContainer.style.display = "none");
|
|
1340
1364
|
}
|
|
1365
|
+
showLoading() {
|
|
1366
|
+
!this.previewWrapper || !this.loadingSpinner || (this.previewWrapper.classList.add("loading"), this.previewWrapper.style.display = "flex", this.loadingSpinner.style.display = "block", this.previewEl && (this.previewEl.style.display = "none"));
|
|
1367
|
+
}
|
|
1368
|
+
hideLoading() {
|
|
1369
|
+
!this.previewWrapper || !this.loadingSpinner || (this.previewWrapper.classList.remove("loading"), this.loadingSpinner.style.display = "none");
|
|
1370
|
+
}
|
|
1341
1371
|
validateFileSize(t) {
|
|
1342
1372
|
const e = (this.props.maxFileSizeMB || 5) * 1024 * 1024;
|
|
1343
1373
|
if (t.size > e) {
|
|
@@ -1353,36 +1383,45 @@ class _ extends p {
|
|
|
1353
1383
|
const e = this.previewWrapper.parentElement, i = e == null ? void 0 : e.querySelector(".upload-button"), s = e == null ? void 0 : e.querySelector(
|
|
1354
1384
|
".preview-placeholder"
|
|
1355
1385
|
);
|
|
1356
|
-
t && t !== ""
|
|
1357
|
-
|
|
1386
|
+
if (t && t !== "") {
|
|
1387
|
+
this.showLoading(), s && s instanceof HTMLElement && (s.style.display = "none"), e && e.classList.remove("no-image"), i && (i.innerHTML = `
|
|
1388
|
+
<span class="upload-icon">${b}</span>
|
|
1358
1389
|
<span class="upload-label">Replace</span>
|
|
1359
|
-
`)
|
|
1360
|
-
|
|
1390
|
+
`);
|
|
1391
|
+
const n = () => {
|
|
1392
|
+
this.hideLoading(), this.previewWrapper.classList.add("has-image"), this.previewEl.style.display = "block", this.previewEl.removeEventListener("load", n), this.previewEl.removeEventListener("error", a);
|
|
1393
|
+
}, a = () => {
|
|
1394
|
+
this.hideLoading(), this.showError("Failed to load image. Please try again."), this.previewWrapper.classList.remove("has-image"), this.previewEl.style.display = "none", this.previewWrapper.style.display = "none", s && s instanceof HTMLElement && (s.style.display = "block"), e && e.classList.add("no-image"), this.previewEl.removeEventListener("load", n), this.previewEl.removeEventListener("error", a);
|
|
1395
|
+
};
|
|
1396
|
+
this.previewEl.addEventListener("load", n), this.previewEl.addEventListener("error", a), this.previewEl.src = t;
|
|
1397
|
+
} else
|
|
1398
|
+
this.hideLoading(), this.previewWrapper.classList.remove("has-image"), this.previewEl.src = "", this.previewEl.style.display = "none", this.previewWrapper.style.display = "none", s && s instanceof HTMLElement && (s.style.display = "block"), e && e.classList.add("no-image"), i && (i.innerHTML = `
|
|
1399
|
+
<span class="upload-icon">${b}</span>
|
|
1361
1400
|
<span class="upload-label">Upload</span>
|
|
1362
|
-
`)
|
|
1401
|
+
`);
|
|
1363
1402
|
}
|
|
1364
1403
|
draw() {
|
|
1365
1404
|
const t = document.createElement("div");
|
|
1366
1405
|
t.className = "upload-setting-wrapper", t.setAttribute("data-setting-id", this.id), t.addEventListener(
|
|
1367
1406
|
"focusout",
|
|
1368
|
-
(
|
|
1407
|
+
(o) => {
|
|
1369
1408
|
var l;
|
|
1370
|
-
|
|
1409
|
+
o.relatedTarget && t.contains(o.relatedTarget) || (l = this.onBlur) == null || l.call(this, this.value ?? "");
|
|
1371
1410
|
},
|
|
1372
1411
|
!0
|
|
1373
1412
|
);
|
|
1374
1413
|
const e = !!(this.props.title || this.props.icon);
|
|
1375
1414
|
if (e || t.classList.add("no-label"), e) {
|
|
1376
|
-
const
|
|
1377
|
-
if (
|
|
1415
|
+
const o = document.createElement("div");
|
|
1416
|
+
if (o.className = "icon-title-container", this.props.icon) {
|
|
1378
1417
|
const l = this.createIcon(this.props.icon);
|
|
1379
|
-
|
|
1418
|
+
o.appendChild(l);
|
|
1380
1419
|
}
|
|
1381
1420
|
if (this.props.title) {
|
|
1382
1421
|
const l = this.createLabel(this.props.title);
|
|
1383
|
-
|
|
1422
|
+
o.appendChild(l);
|
|
1384
1423
|
}
|
|
1385
|
-
t.appendChild(
|
|
1424
|
+
t.appendChild(o);
|
|
1386
1425
|
}
|
|
1387
1426
|
this.errorContainer = document.createElement("div"), this.errorContainer.className = "error-message", this.errorContainer.style.display = "none", t.appendChild(this.errorContainer);
|
|
1388
1427
|
const i = document.createElement("div");
|
|
@@ -1390,19 +1429,19 @@ class _ extends p {
|
|
|
1390
1429
|
const s = this.value && this.value !== "";
|
|
1391
1430
|
s || i.classList.add("no-image");
|
|
1392
1431
|
const n = document.createElement("div");
|
|
1393
|
-
if (n.className = "preview-placeholder", n.innerHTML =
|
|
1394
|
-
const
|
|
1395
|
-
|
|
1432
|
+
if (n.className = "preview-placeholder", n.innerHTML = P, this.previewWrapper = document.createElement("div"), this.previewWrapper.className = "preview-wrapper", this.loadingSpinner = document.createElement("div"), this.loadingSpinner.className = "loading-spinner", this.loadingSpinner.innerHTML = _, this.loadingSpinner.style.display = "none", this.previewWrapper.appendChild(this.loadingSpinner), this.previewEl = document.createElement("img"), this.previewEl.className = "upload-preview", this.props.delete) {
|
|
1433
|
+
const o = document.createElement("button");
|
|
1434
|
+
o.className = "delete-button", o.type = "button", o.title = "Delete image", o.innerHTML = D, this.previewWrapper.appendChild(o), o.onclick = (l) => {
|
|
1396
1435
|
var h;
|
|
1397
1436
|
l.stopPropagation(), this.value = "", this.updatePreviewState(null), (h = this.onChange) == null || h.call(this, ""), this.hideError();
|
|
1398
1437
|
};
|
|
1399
1438
|
}
|
|
1400
1439
|
this.previewWrapper.appendChild(this.previewEl);
|
|
1401
|
-
const
|
|
1402
|
-
return
|
|
1403
|
-
<span class="upload-icon">${
|
|
1440
|
+
const a = document.createElement("button");
|
|
1441
|
+
return a.className = "upload-button", a.innerHTML = `
|
|
1442
|
+
<span class="upload-icon">${b}</span>
|
|
1404
1443
|
<span class="upload-label">Upload</span>
|
|
1405
|
-
`, i.appendChild(n), i.appendChild(this.previewWrapper), i.appendChild(
|
|
1444
|
+
`, i.appendChild(n), i.appendChild(this.previewWrapper), i.appendChild(a), t.appendChild(i), s ? this.updatePreviewState(this.value) : this.updatePreviewState(null), a.onclick = () => {
|
|
1406
1445
|
window.postMessage(
|
|
1407
1446
|
{
|
|
1408
1447
|
type: "OPEN_FILE_MANAGER_MODAL",
|
|
@@ -1413,14 +1452,14 @@ class _ extends p {
|
|
|
1413
1452
|
}, t;
|
|
1414
1453
|
}
|
|
1415
1454
|
}
|
|
1416
|
-
class
|
|
1455
|
+
class mt extends v {
|
|
1417
1456
|
constructor(t = {}) {
|
|
1418
1457
|
super({
|
|
1419
1458
|
...t,
|
|
1420
1459
|
title: t.title || "Height",
|
|
1421
1460
|
suffix: t.suffix || "px",
|
|
1422
1461
|
minValue: t.minValue ?? 0,
|
|
1423
|
-
icon: t.icon ||
|
|
1462
|
+
icon: t.icon || q,
|
|
1424
1463
|
default: t.default ?? 100
|
|
1425
1464
|
}), this.inputType = "number", this.mobileValue = t.mobile;
|
|
1426
1465
|
}
|
|
@@ -1431,17 +1470,17 @@ class gt extends v {
|
|
|
1431
1470
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
1432
1471
|
}
|
|
1433
1472
|
}
|
|
1434
|
-
const
|
|
1473
|
+
const q = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1435
1474
|
<path d="M9 14L9 5M9 14L6.75 12.5M9 14L11.25 12.5M9 5L6.75 6.5M9 5L11.25 6.5M15.75 2.75H2.25M15.75 16.25H2.25" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
1436
1475
|
</svg>`;
|
|
1437
|
-
class
|
|
1476
|
+
class ft extends v {
|
|
1438
1477
|
constructor(t = {}) {
|
|
1439
1478
|
super({
|
|
1440
1479
|
...t,
|
|
1441
1480
|
title: t.title || "Width",
|
|
1442
1481
|
suffix: t.suffix || "px",
|
|
1443
1482
|
minValue: t.minValue ?? 0,
|
|
1444
|
-
icon: t.icon ||
|
|
1483
|
+
icon: t.icon || J,
|
|
1445
1484
|
default: t.default ?? 100
|
|
1446
1485
|
}), this.inputType = "number", this.mobileValue = t.mobile;
|
|
1447
1486
|
}
|
|
@@ -1452,14 +1491,14 @@ class mt extends v {
|
|
|
1452
1491
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
1453
1492
|
}
|
|
1454
1493
|
}
|
|
1455
|
-
const
|
|
1494
|
+
const J = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1456
1495
|
<path d="M4.5 9.5H13.5M4.5 9.5L6 7.25M4.5 9.5L6 11.75M13.5 9.5L12 7.25M13.5 9.5L12 11.75M15.75 16.25V2.75M2.25 16.25V2.75" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
1457
|
-
</svg>`,
|
|
1496
|
+
</svg>`, Z = `
|
|
1458
1497
|
<svg xmlns="http://www.w3.org/2000/svg" class="svg-select-api" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down">
|
|
1459
1498
|
<polyline points="6 9 12 15 18 9"></polyline>
|
|
1460
1499
|
</svg>
|
|
1461
1500
|
`;
|
|
1462
|
-
class
|
|
1501
|
+
class vt extends p {
|
|
1463
1502
|
constructor(t = {}) {
|
|
1464
1503
|
if (super(t), this.inputType = "select", this._options = [], this.isOpen = !1, this.selectedOptionIndex = null, this.optionsListEl = null, this.svgContainer = null, this.buttonEl = null, this.isLoading = !1, this.container = null, this.hasInitializedOptions = !1, this.selectedOptionIndex = null, t.default !== void 0 && (this.value = t.default), this.initializeOptions(t), !t.getOptionsAsync && this.value !== void 0) {
|
|
1465
1504
|
const e = this._options.findIndex(
|
|
@@ -1486,44 +1525,44 @@ class ft extends p {
|
|
|
1486
1525
|
e.classList.add("has-label");
|
|
1487
1526
|
const n = document.createElement("div");
|
|
1488
1527
|
n.className = "select-label", n.textContent = this.props.title, e.appendChild(n);
|
|
1489
|
-
const
|
|
1490
|
-
if (
|
|
1491
|
-
|
|
1528
|
+
const a = document.createElement("span");
|
|
1529
|
+
if (a.className = "select-value", this.isLoading)
|
|
1530
|
+
a.textContent = this.props.loadingText || "Loading options...";
|
|
1492
1531
|
else {
|
|
1493
|
-
const
|
|
1494
|
-
|
|
1532
|
+
const o = this.selectedOptionIndex !== null && this._options && this.selectedOptionIndex >= 0 && this.selectedOptionIndex < this._options.length ? this._options[this.selectedOptionIndex] : null, l = o && typeof o.name == "string" ? o.name : "Select an option";
|
|
1533
|
+
a.textContent = l;
|
|
1495
1534
|
}
|
|
1496
|
-
e.appendChild(
|
|
1535
|
+
e.appendChild(a);
|
|
1497
1536
|
} else {
|
|
1498
1537
|
const n = document.createElement("span");
|
|
1499
1538
|
if (this.isLoading)
|
|
1500
1539
|
n.textContent = this.props.loadingText || "Loading options...";
|
|
1501
1540
|
else {
|
|
1502
|
-
const
|
|
1503
|
-
n.textContent =
|
|
1541
|
+
const a = this.selectedOptionIndex !== null && this._options && this.selectedOptionIndex >= 0 && this.selectedOptionIndex < this._options.length ? this._options[this.selectedOptionIndex] : null, o = a && typeof a.name == "string" ? a.name : "Select an option";
|
|
1542
|
+
n.textContent = o;
|
|
1504
1543
|
}
|
|
1505
1544
|
e.appendChild(n);
|
|
1506
1545
|
}
|
|
1507
1546
|
e.onclick = () => {
|
|
1508
|
-
var n,
|
|
1509
|
-
this.isLoading || (this.isOpen = !this.isOpen, (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (
|
|
1547
|
+
var n, a;
|
|
1548
|
+
this.isLoading || (this.isOpen = !this.isOpen, (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (a = this.svgContainer) == null || a.classList.toggle("open", this.isOpen));
|
|
1510
1549
|
}, t.appendChild(e), this.buttonEl = e;
|
|
1511
1550
|
const i = document.createElement("ul");
|
|
1512
|
-
i.classList.add("select-api-options"), this._options.forEach((n,
|
|
1513
|
-
const
|
|
1514
|
-
|
|
1551
|
+
i.classList.add("select-api-options"), this._options.forEach((n, a) => {
|
|
1552
|
+
const o = this.createOption(n, a);
|
|
1553
|
+
o.onclick = (l) => this.selectApiOption(l, a, e), i.appendChild(o);
|
|
1515
1554
|
}), t.appendChild(i);
|
|
1516
1555
|
const s = document.createElement("div");
|
|
1517
|
-
return s.classList.add("svg-container"), s.innerHTML =
|
|
1518
|
-
var n,
|
|
1519
|
-
this.isLoading || (this.isOpen = !this.isOpen, (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (
|
|
1556
|
+
return s.classList.add("svg-container"), s.innerHTML = Z, t.appendChild(s), s.onclick = () => {
|
|
1557
|
+
var n, a;
|
|
1558
|
+
this.isLoading || (this.isOpen = !this.isOpen, (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (a = this.svgContainer) == null || a.classList.toggle("open", this.isOpen));
|
|
1520
1559
|
}, this.optionsListEl = i, this.svgContainer = s, this.props.getOptionsAsync && !this.hasInitializedOptions ? (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((n) => {
|
|
1521
|
-
const
|
|
1560
|
+
const a = new Set(
|
|
1522
1561
|
this._options.map((l) => JSON.stringify(l.value))
|
|
1523
|
-
),
|
|
1524
|
-
(l) => !
|
|
1562
|
+
), o = n.filter(
|
|
1563
|
+
(l) => !a.has(JSON.stringify(l.value))
|
|
1525
1564
|
);
|
|
1526
|
-
if (this._options.push(...
|
|
1565
|
+
if (this._options.push(...o), this.isLoading = !1, this.hasInitializedOptions = !0, this.value !== void 0) {
|
|
1527
1566
|
const l = this._options.findIndex(
|
|
1528
1567
|
(h) => JSON.stringify(h.value) === JSON.stringify(this.value)
|
|
1529
1568
|
);
|
|
@@ -1537,12 +1576,12 @@ class ft extends p {
|
|
|
1537
1576
|
!0
|
|
1538
1577
|
);
|
|
1539
1578
|
})) : this.props.getOptionsAsync && this._options.length <= 1 && (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((n) => {
|
|
1540
|
-
const
|
|
1579
|
+
const a = new Set(
|
|
1541
1580
|
this._options.map((l) => JSON.stringify(l.value))
|
|
1542
|
-
),
|
|
1543
|
-
(l) => !
|
|
1581
|
+
), o = n.filter(
|
|
1582
|
+
(l) => !a.has(JSON.stringify(l.value))
|
|
1544
1583
|
);
|
|
1545
|
-
if (this._options.push(...
|
|
1584
|
+
if (this._options.push(...o), this.isLoading = !1, this.value !== void 0) {
|
|
1546
1585
|
const l = this._options.findIndex(
|
|
1547
1586
|
(h) => JSON.stringify(h.value) === JSON.stringify(this.value)
|
|
1548
1587
|
);
|
|
@@ -1558,19 +1597,19 @@ class ft extends p {
|
|
|
1558
1597
|
})), t;
|
|
1559
1598
|
}
|
|
1560
1599
|
selectApiOption(t, e, i) {
|
|
1561
|
-
var l, h, r,
|
|
1600
|
+
var l, h, r, d;
|
|
1562
1601
|
const s = t.target, n = s.querySelector(".select-api-radio") || ((l = s.closest(".select-api-option")) == null ? void 0 : l.querySelector(".select-api-radio"));
|
|
1563
1602
|
n && (n.checked = !0), this.selectedOptionIndex = e;
|
|
1564
|
-
const
|
|
1565
|
-
this.value =
|
|
1566
|
-
const
|
|
1567
|
-
if (
|
|
1568
|
-
|
|
1603
|
+
const a = this._options[e].value;
|
|
1604
|
+
this.value = a;
|
|
1605
|
+
const o = i.querySelector(".select-value");
|
|
1606
|
+
if (o)
|
|
1607
|
+
o.textContent = this._options[e].name;
|
|
1569
1608
|
else {
|
|
1570
|
-
const
|
|
1571
|
-
|
|
1609
|
+
const u = i.firstChild;
|
|
1610
|
+
u && u.tagName === "SPAN" && (u.textContent = this._options[e].name);
|
|
1572
1611
|
}
|
|
1573
|
-
this.isOpen = !1, (h = this.optionsListEl) == null || h.classList.remove("open"), (r = this.svgContainer) == null || r.classList.remove("open"), (
|
|
1612
|
+
this.isOpen = !1, (h = this.optionsListEl) == null || h.classList.remove("open"), (r = this.svgContainer) == null || r.classList.remove("open"), (d = this.onChange) == null || d.call(this, a), this.detectChangeCallback && this.detectChangeCallback(a);
|
|
1574
1613
|
}
|
|
1575
1614
|
updateOptionsList() {
|
|
1576
1615
|
!this.optionsListEl || !this.buttonEl || (this.optionsListEl.innerHTML = "", this._options.forEach((t, e) => {
|
|
@@ -1603,13 +1642,13 @@ class ft extends p {
|
|
|
1603
1642
|
), this.updateButtonText();
|
|
1604
1643
|
}
|
|
1605
1644
|
}
|
|
1606
|
-
class
|
|
1645
|
+
class Ct extends p {
|
|
1607
1646
|
constructor(t) {
|
|
1608
1647
|
var e, i;
|
|
1609
1648
|
super(t), this.inputType = "text", this.value = t.default ?? ((i = (e = t.options) == null ? void 0 : e[0]) == null ? void 0 : i.value) ?? "", this.detectChangeCallback = t.detectChange;
|
|
1610
1649
|
}
|
|
1611
1650
|
draw() {
|
|
1612
|
-
var
|
|
1651
|
+
var a, o;
|
|
1613
1652
|
const t = document.createElement("div");
|
|
1614
1653
|
t.className = "toggle-setting-container", this.props.icon && t.classList.add("toggle-with-icon");
|
|
1615
1654
|
const e = document.createElement("div");
|
|
@@ -1625,9 +1664,9 @@ class vt extends p {
|
|
|
1625
1664
|
const i = document.createElement("label");
|
|
1626
1665
|
i.className = "toggle-switch";
|
|
1627
1666
|
const s = document.createElement("input");
|
|
1628
|
-
s.type = "checkbox", s.checked = ((
|
|
1667
|
+
s.type = "checkbox", s.checked = ((o = (a = this.props.options) == null ? void 0 : a.find((l) => l.value === this.value)) == null ? void 0 : o.status) ?? !1, s.addEventListener("change", () => {
|
|
1629
1668
|
var h, r;
|
|
1630
|
-
const l = ((r = (h = this.props.options) == null ? void 0 : h.find((
|
|
1669
|
+
const l = ((r = (h = this.props.options) == null ? void 0 : h.find((d) => d.status === s.checked)) == null ? void 0 : r.value) ?? "";
|
|
1631
1670
|
this.value = l, this.onChange && this.onChange(this.value), this.detectChangeCallback && this.detectChangeCallback(this.value);
|
|
1632
1671
|
});
|
|
1633
1672
|
const n = document.createElement("span");
|
|
@@ -1648,13 +1687,13 @@ class vt extends p {
|
|
|
1648
1687
|
this.detectChangeCallback = t;
|
|
1649
1688
|
}
|
|
1650
1689
|
}
|
|
1651
|
-
const
|
|
1690
|
+
const K = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1652
1691
|
<path d="M13.3334 5.99996H2.66675M13.3334 9.99996H2.66675M5.33341 12.6666V3.33329M10.6667 12.6666V3.33329" stroke="#667085" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>
|
|
1653
1692
|
</svg>`;
|
|
1654
|
-
class
|
|
1693
|
+
class wt extends p {
|
|
1655
1694
|
// Store mobile value
|
|
1656
1695
|
constructor(t = {}) {
|
|
1657
|
-
t.rowGap = t.rowGap ?? !0, t.columnGap = t.columnGap ?? !0, t.title = t.title ?? "Gap", t.icon = t.icon ??
|
|
1696
|
+
t.rowGap = t.rowGap ?? !0, t.columnGap = t.columnGap ?? !0, t.title = t.title ?? "Gap", t.icon = t.icon ?? K, t.suffix = t.suffix ?? "px", t.minValue = t.minValue ?? 0, super(t), this.inputType = "number", this.inputValues = {}, this.mobileValue = t.mobile, this.value = this.validateValue(t.default ?? 0), t.rowGap && (this.inputValues.row = this.value), t.columnGap && (this.inputValues.column = this.value);
|
|
1658
1697
|
}
|
|
1659
1698
|
draw() {
|
|
1660
1699
|
const t = document.createElement("div");
|
|
@@ -1665,27 +1704,27 @@ class Ct extends p {
|
|
|
1665
1704
|
i.className = "setting-label", i.setAttribute("for", this.id + "-input");
|
|
1666
1705
|
const s = document.createElement("span");
|
|
1667
1706
|
if (s.textContent = this.props.title ?? "Gap", i.appendChild(s), this.props.icon) {
|
|
1668
|
-
const
|
|
1669
|
-
|
|
1707
|
+
const o = document.createElement("span");
|
|
1708
|
+
o.className = "setting-icon", o.innerHTML = this.props.icon, i.insertBefore(o, s);
|
|
1670
1709
|
}
|
|
1671
1710
|
const n = document.createElement("div");
|
|
1672
1711
|
n.className = `setting-input-wrapper ${this.props.wrapperClassName || ""}`, n.classList.add("gap-setting-wrapper");
|
|
1673
|
-
const
|
|
1674
|
-
return
|
|
1712
|
+
const a = document.createElement("div");
|
|
1713
|
+
return a.className = "gap-inputs-container", this.props.rowGap && a.appendChild(this.createGapInput("row", "Row")), this.props.columnGap && a.appendChild(this.createGapInput("column", "Col")), n.appendChild(a), e.appendChild(i), e.appendChild(n), t.appendChild(e), t;
|
|
1675
1714
|
}
|
|
1676
1715
|
createGapInput(t, e) {
|
|
1677
1716
|
const i = document.createElement("div");
|
|
1678
1717
|
i.className = "gap-input-wrapper";
|
|
1679
1718
|
const s = document.createElement("input");
|
|
1680
1719
|
if (s.type = "number", s.className = `gap-input gap-${t}-input ${this.props.inputClassName || ""}`, s.id = `${this.id}-${t}-input`, s.min = String(this.props.minValue ?? 0), this.props.maxValue !== void 0 && (s.max = String(this.props.maxValue)), s.step = String(this.props.step ?? 1), s.value = String(this.inputValues[t] ?? this.value), s.title = e, s.addEventListener("input", (n) => {
|
|
1681
|
-
const
|
|
1682
|
-
let
|
|
1683
|
-
|
|
1720
|
+
const a = n.target;
|
|
1721
|
+
let o = parseFloat(a.value);
|
|
1722
|
+
o = this.validateValue(o), String(o) !== a.value && (a.value = String(o)), this.inputValues[t] = o, this.setValue(o);
|
|
1684
1723
|
}), s.addEventListener("blur", (n) => {
|
|
1685
1724
|
var l, h;
|
|
1686
|
-
const
|
|
1687
|
-
let
|
|
1688
|
-
|
|
1725
|
+
const a = n.target;
|
|
1726
|
+
let o = parseFloat(a.value);
|
|
1727
|
+
o = this.validateValue(o), String(o) !== a.value && (a.value = String(o), this.inputValues[t] = o, this.setValue(o)), (h = (l = this.props).onBlur) == null || h.call(l);
|
|
1689
1728
|
}), i.appendChild(s), this.props.suffix && this.props.suffix !== "none") {
|
|
1690
1729
|
const n = document.createElement("span");
|
|
1691
1730
|
n.className = "gap-suffix", n.textContent = this.props.suffix, i.appendChild(n), s.style.paddingRight = "30px";
|
|
@@ -1705,47 +1744,47 @@ class Ct extends p {
|
|
|
1705
1744
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
1706
1745
|
}
|
|
1707
1746
|
}
|
|
1708
|
-
const
|
|
1747
|
+
const X = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1709
1748
|
<path d="M2.25 11.75H15.75M5.85 2.75H12.15C13.4101 2.75 14.0402 2.75 14.5215 2.99524C14.9448 3.21095 15.289 3.55516 15.5048 3.97852C15.75 4.45982 15.75 5.08988 15.75 6.35V12.65C15.75 13.9101 15.75 14.5402 15.5048 15.0215C15.289 15.4448 14.9448 15.789 14.5215 16.0048C14.0402 16.25 13.4101 16.25 12.15 16.25H5.85C4.58988 16.25 3.95982 16.25 3.47852 16.0048C3.05516 15.789 2.71095 15.4448 2.49524 15.0215C2.25 14.5402 2.25 13.9101 2.25 12.65V6.35C2.25 5.08988 2.25 4.45982 2.49524 3.97852C2.71095 3.55516 3.05516 3.21095 3.47852 2.99524C3.95982 2.75 4.58988 2.75 5.85 2.75Z" stroke="#667085" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
1710
1749
|
</svg>`;
|
|
1711
|
-
class
|
|
1750
|
+
class Et extends v {
|
|
1712
1751
|
constructor(t = {}) {
|
|
1713
1752
|
super({
|
|
1714
1753
|
...t,
|
|
1715
1754
|
minValue: t.minValue ?? 0,
|
|
1716
1755
|
maxValue: t.maxValue ?? 1e3,
|
|
1717
|
-
icon: t.icon ||
|
|
1756
|
+
icon: t.icon || X,
|
|
1718
1757
|
title: t.title || "Margin Bottom",
|
|
1719
1758
|
default: t.default ?? 20,
|
|
1720
1759
|
wrapperClassName: "margin-bottom-wrapper " + (t.wrapperClassName || "")
|
|
1721
1760
|
}), this.inputType = "number";
|
|
1722
1761
|
}
|
|
1723
1762
|
}
|
|
1724
|
-
const
|
|
1763
|
+
const Q = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1725
1764
|
<path d="M15.75 7.25H2.25m9.9 9h-6.3c-1.26 0-1.89 0-2.371-.245a2.25 2.25 0 0 1-.984-.983c-.245-.482-.245-1.112-.245-2.372v-6.3c0-1.26 0-1.89.245-2.371a2.25 2.25 0 0 1 .984-.984c.48-.245 1.11-.245 2.371-.245h6.3c1.26 0 1.89 0 2.371.245.424.216.768.56.984.984.245.48.245 1.11.245 2.371v6.3c0 1.26 0 1.89-.245 2.371-.216.424-.56.768-.984.984-.48.245-1.11.245-2.371.245"
|
|
1726
1765
|
stroke="#667085" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
1727
1766
|
</svg>`;
|
|
1728
|
-
class
|
|
1767
|
+
class Lt extends v {
|
|
1729
1768
|
constructor(t = {}) {
|
|
1730
1769
|
super({
|
|
1731
1770
|
...t,
|
|
1732
1771
|
minValue: t.minValue ?? 0,
|
|
1733
1772
|
maxValue: t.maxValue ?? 1e3,
|
|
1734
|
-
icon: t.icon ||
|
|
1773
|
+
icon: t.icon || Q,
|
|
1735
1774
|
title: t.title || "Margin Top",
|
|
1736
1775
|
default: t.default ?? 20,
|
|
1737
1776
|
wrapperClassName: "margin-top-wrapper " + (t.wrapperClassName || "")
|
|
1738
1777
|
}), this.inputType = "number";
|
|
1739
1778
|
}
|
|
1740
1779
|
}
|
|
1741
|
-
const
|
|
1780
|
+
const Y = `
|
|
1742
1781
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
1743
1782
|
<polyline points="3,6 5,6 21,6"></polyline>
|
|
1744
1783
|
<path d="m19,6v14a2,2 0 0,1-2,2H7a2,2 0 0,1-2-2V6m3,0V4a2,2 0 0,1,2-2h4a2,2 0 0,1,2,2v2"></path>
|
|
1745
1784
|
<line x1="10" y1="11" x2="10" y2="17"></line>
|
|
1746
1785
|
<line x1="14" y1="11" x2="14" y2="17"></line>
|
|
1747
1786
|
</svg>
|
|
1748
|
-
`,
|
|
1787
|
+
`, tt = `
|
|
1749
1788
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
1750
1789
|
<line x1="12" y1="5" x2="12" y2="19"></line>
|
|
1751
1790
|
<line x1="5" y1="12" x2="19" y2="12"></line>
|
|
@@ -1793,15 +1832,15 @@ class bt extends p {
|
|
|
1793
1832
|
s.classList.add("language-label"), s.textContent = t.toUpperCase();
|
|
1794
1833
|
const n = document.createElement("div");
|
|
1795
1834
|
n.classList.add("language-input-group");
|
|
1796
|
-
const
|
|
1797
|
-
|
|
1835
|
+
const a = document.createElement("input");
|
|
1836
|
+
a.type = "text", a.classList.add("language-input"), a.value = e || "", a.placeholder = this.props.placeholder || "Enter text...", a.addEventListener("input", (l) => {
|
|
1798
1837
|
const h = l.target;
|
|
1799
1838
|
this.updateLanguageValue(t, h.value);
|
|
1800
1839
|
});
|
|
1801
|
-
const
|
|
1802
|
-
return
|
|
1840
|
+
const o = document.createElement("button");
|
|
1841
|
+
return o.type = "button", o.classList.add("delete-language-btn"), o.innerHTML = Y, o.title = `Delete ${t.toUpperCase()}`, o.addEventListener("click", () => {
|
|
1803
1842
|
this.removeLanguage(t);
|
|
1804
|
-
}), n.appendChild(
|
|
1843
|
+
}), n.appendChild(a), n.appendChild(o), i.appendChild(s), i.appendChild(n), i;
|
|
1805
1844
|
}
|
|
1806
1845
|
updateLanguageValue(t, e) {
|
|
1807
1846
|
this.value || (this.value = {}), this.value[t] = e, this.onChange && this.onChange(this.value), this.props.detectChange && this.props.detectChange(this.value);
|
|
@@ -1832,9 +1871,9 @@ class bt extends p {
|
|
|
1832
1871
|
const s = document.createElement("select");
|
|
1833
1872
|
s.classList.add("add-language-select"), this.addLanguageSelect = s;
|
|
1834
1873
|
const n = document.createElement("button");
|
|
1835
|
-
return n.type = "button", n.classList.add("add-language-btn"), n.innerHTML = `${
|
|
1836
|
-
const
|
|
1837
|
-
|
|
1874
|
+
return n.type = "button", n.classList.add("add-language-btn"), n.innerHTML = `${tt} Add`, this.addButton = n, n.addEventListener("click", () => {
|
|
1875
|
+
const a = s.value;
|
|
1876
|
+
a && this.addLanguage(a);
|
|
1838
1877
|
}), i.appendChild(s), i.appendChild(n), t.appendChild(e), t.appendChild(i), t;
|
|
1839
1878
|
}
|
|
1840
1879
|
draw() {
|
|
@@ -1846,9 +1885,9 @@ class bt extends p {
|
|
|
1846
1885
|
const e = document.createElement("div");
|
|
1847
1886
|
e.classList.add("multi-language-content");
|
|
1848
1887
|
const i = document.createElement("div");
|
|
1849
|
-
i.classList.add("languages-container"), this.languagesContainer = i, this.value && Object.entries(this.value).forEach(([n,
|
|
1850
|
-
const
|
|
1851
|
-
i.appendChild(
|
|
1888
|
+
i.classList.add("languages-container"), this.languagesContainer = i, this.value && Object.entries(this.value).forEach(([n, a]) => {
|
|
1889
|
+
const o = this.createLanguageRow(n, a);
|
|
1890
|
+
i.appendChild(o);
|
|
1852
1891
|
}), e.appendChild(i);
|
|
1853
1892
|
const s = this.createAddLanguageSection();
|
|
1854
1893
|
return e.appendChild(s), t.appendChild(e), this.updateAddLanguageSelect(), this.container = t, t;
|
|
@@ -1860,7 +1899,7 @@ class bt extends p {
|
|
|
1860
1899
|
}), this.updateAddLanguageSelect());
|
|
1861
1900
|
}
|
|
1862
1901
|
}
|
|
1863
|
-
class
|
|
1902
|
+
class xt extends p {
|
|
1864
1903
|
constructor(t = {}) {
|
|
1865
1904
|
super(t), this.inputType = "select";
|
|
1866
1905
|
const e = [
|
|
@@ -1887,16 +1926,16 @@ class Lt extends p {
|
|
|
1887
1926
|
this.selectSetting.destroy(), super.destroy();
|
|
1888
1927
|
}
|
|
1889
1928
|
}
|
|
1890
|
-
const
|
|
1929
|
+
const et = `
|
|
1891
1930
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1892
1931
|
<path d="M5.625 9.5H5.6325M12.375 9.5H12.3825M9 9.5H9.0075M9 12.875H9.0075M9 6.125H9.0075M2.25 6.35L2.25 12.65C2.25 13.9101 2.25 14.5402 2.49524 15.0215C2.71095 15.4448 3.05516 15.789 3.47852 16.0048C3.95982 16.25 4.58988 16.25 5.85 16.25H12.15C13.4101 16.25 14.0402 16.25 14.5215 16.0048C14.9448 15.789 15.289 15.4448 15.5048 15.0215C15.75 14.5402 15.75 13.9101 15.75 12.65V6.35C15.75 5.08988 15.75 4.45982 15.5048 3.97852C15.289 3.55516 14.9448 3.21095 14.5215 2.99524C14.0402 2.75 13.4101 2.75 12.15 2.75L5.85 2.75C4.58988 2.75 3.95982 2.75 3.47852 2.99524C3.05516 3.21095 2.71095 3.55516 2.49524 3.97852C2.25 4.45982 2.25 5.08988 2.25 6.35Z" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
1893
1932
|
</svg>
|
|
1894
|
-
`,
|
|
1933
|
+
`, it = `
|
|
1895
1934
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1896
1935
|
<path d="M6 2.75H5.85C4.58988 2.75 3.95982 2.75 3.47852 2.99524C3.05516 3.21095 2.71095 3.55516 2.49524 3.97852C2.25 4.45982 2.25 5.08988 2.25 6.35V6.5M6 16.25H5.85C4.58988 16.25 3.95982 16.25 3.47852 16.0048C3.05516 15.789 2.71095 15.4448 2.49524 15.0215C2.25 14.5402 2.25 13.9101 2.25 12.65V12.5M15.75 6.5V6.35C15.75 5.08988 15.75 4.45982 15.5048 3.97852C15.289 3.55516 14.9448 3.21095 14.5215 2.99524C14.0402 2.75 13.4101 2.75 12.15 2.75H12M15.75 12.5V12.65C15.75 13.9101 15.75 14.5402 15.5048 15.0215C15.289 15.4448 14.9448 15.789 14.5215 16.0048C14.0402 16.25 13.4101 16.25 12.15 16.25H12" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
1897
1936
|
</svg>
|
|
1898
1937
|
`;
|
|
1899
|
-
class
|
|
1938
|
+
class yt extends f {
|
|
1900
1939
|
constructor(t) {
|
|
1901
1940
|
super({
|
|
1902
1941
|
title: "Border",
|
|
@@ -1905,7 +1944,7 @@ class xt extends f {
|
|
|
1905
1944
|
settings: {
|
|
1906
1945
|
size: new v({
|
|
1907
1946
|
title: "Size",
|
|
1908
|
-
icon:
|
|
1947
|
+
icon: it,
|
|
1909
1948
|
default: (t == null ? void 0 : t.size) ?? 0,
|
|
1910
1949
|
suffix: "px"
|
|
1911
1950
|
}),
|
|
@@ -1914,7 +1953,7 @@ class xt extends f {
|
|
|
1914
1953
|
}),
|
|
1915
1954
|
radius: new v({
|
|
1916
1955
|
title: "Radius",
|
|
1917
|
-
icon:
|
|
1956
|
+
icon: et,
|
|
1918
1957
|
default: (t == null ? void 0 : t.radius) ?? 12,
|
|
1919
1958
|
suffix: "px"
|
|
1920
1959
|
})
|
|
@@ -1933,20 +1972,20 @@ class xt extends f {
|
|
|
1933
1972
|
`;
|
|
1934
1973
|
}
|
|
1935
1974
|
}
|
|
1936
|
-
const
|
|
1975
|
+
const st = `
|
|
1937
1976
|
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="13" viewBox="0 0 14 13" fill="none">
|
|
1938
1977
|
<path d="M1 2.75C1 2.05109 1 1.70163 1.11418 1.42597C1.26642 1.05843 1.55843 0.766422 1.92597 0.614181C2.20163 0.5 2.55109 0.5 3.25 0.5H10.75C11.4489 0.5 11.7984 0.5 12.074 0.614181C12.4416 0.766422 12.7336 1.05843 12.8858 1.42597C13 1.70163 13 2.05109 13 2.75M4.75 12.5H9.25M7 0.5V12.5" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
1939
1978
|
</svg>
|
|
1940
|
-
`,
|
|
1979
|
+
`, nt = `
|
|
1941
1980
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1942
1981
|
<path d="M3 5.75C3 5.05109 3 4.70163 3.11418 4.42597C3.26642 4.05843 3.55843 3.76642 3.92597 3.61418C4.20163 3.5 4.55109 3.5 5.25 3.5H12.75C13.4489 3.5 13.7984 3.5 14.074 3.61418C14.4416 3.76642 14.7336 4.05843 14.8858 4.42597C15 4.70163 15 5.05109 15 5.75M6 15.5H12M7.6875 3.5V15.5M10.3125 3.5V15.5" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
1943
1982
|
</svg>
|
|
1944
|
-
`,
|
|
1983
|
+
`, at = `
|
|
1945
1984
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1946
1985
|
<path d="M6 5.75H12M9 5.75V13.25M5.85 16.25H12.15C13.4101 16.25 14.0402 16.25 14.5215 16.0048C14.9448 15.789 15.289 15.4448 15.5048 15.0215C15.75 14.5402 15.75 13.9101 15.75 12.65V6.35C15.75 5.08988 15.75 4.45982 15.5048 3.97852C15.289 3.55516 14.9448 3.21095 14.5215 2.99524C14.0402 2.75 13.4101 2.75 12.15 2.75H5.85C4.58988 2.75 3.95982 2.75 3.47852 2.99524C3.05516 3.21095 2.71095 3.55516 2.49524 3.97852C2.25 4.45982 2.25 5.08988 2.25 6.35V12.65C2.25 13.9101 2.25 14.5402 2.49524 15.0215C2.71095 15.4448 3.05516 15.789 3.47852 16.0048C3.95982 16.25 4.58988 16.25 5.85 16.25Z" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
1947
1986
|
</svg>
|
|
1948
1987
|
`;
|
|
1949
|
-
class
|
|
1988
|
+
class Mt extends f {
|
|
1950
1989
|
constructor(t = {}) {
|
|
1951
1990
|
const { showAlign: e = t.showAlign ?? !0, ...i } = t;
|
|
1952
1991
|
super({
|
|
@@ -1960,7 +1999,7 @@ class yt extends f {
|
|
|
1960
1999
|
}),
|
|
1961
2000
|
fontFamily: new y({
|
|
1962
2001
|
title: "Font",
|
|
1963
|
-
icon:
|
|
2002
|
+
icon: st,
|
|
1964
2003
|
default: i.fontFamilyDefault ?? "Satoshi",
|
|
1965
2004
|
options: i.fontFamilyOptions ?? [
|
|
1966
2005
|
{ name: "Alt", value: "Croco Sans Black Caps Alt" },
|
|
@@ -1973,7 +2012,7 @@ class yt extends f {
|
|
|
1973
2012
|
}),
|
|
1974
2013
|
fontWeight: new y({
|
|
1975
2014
|
title: "Weight",
|
|
1976
|
-
icon:
|
|
2015
|
+
icon: nt,
|
|
1977
2016
|
default: i.fontWeightDefault ?? "400",
|
|
1978
2017
|
options: i.fontWeightOptions ?? [
|
|
1979
2018
|
{ name: "Regular", value: "400" },
|
|
@@ -1985,7 +2024,7 @@ class yt extends f {
|
|
|
1985
2024
|
}),
|
|
1986
2025
|
fontSize: new v({
|
|
1987
2026
|
title: "Size",
|
|
1988
|
-
icon:
|
|
2027
|
+
icon: at,
|
|
1989
2028
|
default: i.fontSizeDefault ?? 12,
|
|
1990
2029
|
suffix: "px",
|
|
1991
2030
|
mobile: i.fontSizeMobileDefault
|
|
@@ -2002,8 +2041,8 @@ class yt extends f {
|
|
|
2002
2041
|
});
|
|
2003
2042
|
}
|
|
2004
2043
|
getCssCode() {
|
|
2005
|
-
var
|
|
2006
|
-
const t = this.settings.color.value ?? "#000000", e = this.settings.fontFamily.value ?? "Satoshi", i = this.settings.fontWeight.value ?? "bold", s = this.settings.fontSize.value ?? 12, n = ((
|
|
2044
|
+
var a;
|
|
2045
|
+
const t = this.settings.color.value ?? "#000000", e = this.settings.fontFamily.value ?? "Satoshi", i = this.settings.fontWeight.value ?? "bold", s = this.settings.fontSize.value ?? 12, n = ((a = this.settings.align) == null ? void 0 : a.value) ?? "left";
|
|
2007
2046
|
return `
|
|
2008
2047
|
color: ${t};
|
|
2009
2048
|
font-family: ${e};
|
|
@@ -2021,11 +2060,11 @@ class E extends p {
|
|
|
2021
2060
|
}), this.inputType = "number", this.value = t.default !== void 0 ? t.default : "auto";
|
|
2022
2061
|
}
|
|
2023
2062
|
draw() {
|
|
2024
|
-
const t = this.value === "auto" ? "text" : "number", e = (
|
|
2025
|
-
this.value !== "auto" && (this.props.minValue !== void 0 && (
|
|
2063
|
+
const t = this.value === "auto" ? "text" : "number", e = (o) => {
|
|
2064
|
+
this.value !== "auto" && (this.props.minValue !== void 0 && (o.min = String(this.props.minValue)), this.props.maxValue !== void 0 && (o.max = String(this.props.maxValue)), this.props.className && o.classList.add(this.props.className), o.addEventListener("input", () => {
|
|
2026
2065
|
const l = this.props.minValue ?? Number.MIN_SAFE_INTEGER, h = this.props.maxValue ?? Number.MAX_SAFE_INTEGER;
|
|
2027
|
-
let r = Number(
|
|
2028
|
-
r < l && (r = l), r > h && (r = h),
|
|
2066
|
+
let r = Number(o.value);
|
|
2067
|
+
r < l && (r = l), r > h && (r = h), o.value = String(r);
|
|
2029
2068
|
}));
|
|
2030
2069
|
}, i = this.createInput({
|
|
2031
2070
|
value: this.value,
|
|
@@ -2046,9 +2085,9 @@ class E extends p {
|
|
|
2046
2085
|
s && (s.style.paddingRight = "35px");
|
|
2047
2086
|
const n = document.createElement("span");
|
|
2048
2087
|
n.className = "suffix-label", n.textContent = this.props.suffix, i.appendChild(n);
|
|
2049
|
-
const
|
|
2050
|
-
return
|
|
2051
|
-
const l =
|
|
2088
|
+
const a = i.querySelector("input");
|
|
2089
|
+
return a && (a.oninput = (o) => {
|
|
2090
|
+
const l = o.target.value.trim();
|
|
2052
2091
|
if (l.toLowerCase() === "auto")
|
|
2053
2092
|
this.value = "auto";
|
|
2054
2093
|
else {
|
|
@@ -2059,7 +2098,7 @@ class E extends p {
|
|
|
2059
2098
|
}), i;
|
|
2060
2099
|
}
|
|
2061
2100
|
}
|
|
2062
|
-
class
|
|
2101
|
+
class kt extends f {
|
|
2063
2102
|
constructor(t) {
|
|
2064
2103
|
super({
|
|
2065
2104
|
title: "Margins",
|
|
@@ -2068,25 +2107,25 @@ class Mt extends f {
|
|
|
2068
2107
|
settings: {
|
|
2069
2108
|
marginTop: new E({
|
|
2070
2109
|
title: "Top",
|
|
2071
|
-
icon:
|
|
2110
|
+
icon: ot,
|
|
2072
2111
|
suffix: "px",
|
|
2073
2112
|
default: (t == null ? void 0 : t.marginTop) ?? "auto"
|
|
2074
2113
|
}),
|
|
2075
2114
|
marginRight: new E({
|
|
2076
2115
|
title: "Right",
|
|
2077
|
-
icon:
|
|
2116
|
+
icon: lt,
|
|
2078
2117
|
suffix: "px",
|
|
2079
2118
|
default: (t == null ? void 0 : t.marginRight) ?? 0
|
|
2080
2119
|
}),
|
|
2081
2120
|
marginBottom: new E({
|
|
2082
2121
|
title: "Bottom",
|
|
2083
|
-
icon:
|
|
2122
|
+
icon: rt,
|
|
2084
2123
|
suffix: "px",
|
|
2085
2124
|
default: (t == null ? void 0 : t.marginBottom) ?? 0
|
|
2086
2125
|
}),
|
|
2087
2126
|
marginLeft: new E({
|
|
2088
2127
|
title: "Left",
|
|
2089
|
-
icon:
|
|
2128
|
+
icon: ht,
|
|
2090
2129
|
suffix: "px",
|
|
2091
2130
|
default: (t == null ? void 0 : t.marginLeft) ?? 0
|
|
2092
2131
|
})
|
|
@@ -2103,16 +2142,16 @@ class Mt extends f {
|
|
|
2103
2142
|
`;
|
|
2104
2143
|
}
|
|
2105
2144
|
}
|
|
2106
|
-
const
|
|
2145
|
+
const ot = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2107
2146
|
<path d="M2.25 16.25H2.2575M2.25 9.5H2.2575M2.25 12.875H2.2575M2.25 6.125H2.2575M5.625 16.25H5.6325M5.625 9.5H5.6325M12.375 16.25H12.3825M12.375 9.5H12.3825M9 16.25H9.0075M9 9.5H9.0075M9 12.875H9.0075M9 6.125H9.0075M15.75 16.25H15.7575M15.75 9.5H15.7575M15.75 12.875H15.7575M15.75 6.125H15.7575M15.75 2.75H2.25" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2108
|
-
</svg>`, ot = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2109
|
-
<path d="M5.625 2.75H5.6325M5.625 9.5H5.6325M5.625 16.25H5.6325M12.375 2.75H12.3825M12.375 9.5H12.3825M12.375 16.25H12.3825M9 2.75H9.0075M9 9.5H9.0075M9 16.25H9.0075M9 12.875H9.0075M9 6.125H9.0075M2.25 2.75H2.2575M2.25 9.5H2.2575M2.25 16.25H2.2575M2.25 12.875H2.2575M2.25 6.125H2.2575M15.75 16.25V2.75" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2110
2147
|
</svg>`, lt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2111
|
-
<path d="
|
|
2148
|
+
<path d="M5.625 2.75H5.6325M5.625 9.5H5.6325M5.625 16.25H5.6325M12.375 2.75H12.3825M12.375 9.5H12.3825M12.375 16.25H12.3825M9 2.75H9.0075M9 9.5H9.0075M9 16.25H9.0075M9 12.875H9.0075M9 6.125H9.0075M2.25 2.75H2.2575M2.25 9.5H2.2575M2.25 16.25H2.2575M2.25 12.875H2.2575M2.25 6.125H2.2575M15.75 16.25V2.75" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2112
2149
|
</svg>`, rt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2150
|
+
<path d="M2.25 2.75H2.2575M2.25 9.5H2.2575M2.25 12.875H2.2575M2.25 6.125H2.2575M5.625 2.75H5.6325M5.625 9.5H5.6325M12.375 2.75H12.3825M12.375 9.5H12.3825M9 2.75H9.0075M9 9.5H9.0075M9 12.875H9.0075M9 6.125H9.0075M15.75 2.75H15.7575M15.75 9.5H15.7575M15.75 12.875H15.7575M15.75 6.125H15.7575M15.75 16.25H2.25" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2151
|
+
</svg>`, ht = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2113
2152
|
<path d="M5.625 2.75H5.6325M5.625 9.5H5.6325M5.625 16.25H5.6325M12.375 2.75H12.3825M12.375 9.5H12.3825M12.375 16.25H12.3825M9 2.75H9.0075M9 9.5H9.0075M9 16.25H9.0075M9 12.875H9.0075M9 6.125H9.0075M15.75 2.75H15.7575M15.75 9.5H15.7575M15.75 16.25H15.7575M15.75 12.875H15.7575M15.75 6.125H15.7575M2.25 16.25V2.75" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2114
2153
|
</svg>`;
|
|
2115
|
-
class
|
|
2154
|
+
class Vt extends f {
|
|
2116
2155
|
/**
|
|
2117
2156
|
* Constructs a new BackgroundSettingSet.
|
|
2118
2157
|
*
|
|
@@ -2142,7 +2181,7 @@ class kt extends f {
|
|
|
2142
2181
|
collapsed: t == null ? void 0 : t.collapsed,
|
|
2143
2182
|
hideCondition: t == null ? void 0 : t.hideCondition,
|
|
2144
2183
|
settings: {
|
|
2145
|
-
backgroundImage: new
|
|
2184
|
+
backgroundImage: new U({
|
|
2146
2185
|
...t == null ? void 0 : t.uploadProps,
|
|
2147
2186
|
default: (t == null ? void 0 : t.backgroundImage) ?? ""
|
|
2148
2187
|
}),
|
|
@@ -2161,10 +2200,10 @@ class kt extends f {
|
|
|
2161
2200
|
draw() {
|
|
2162
2201
|
const t = super.draw(), e = t.querySelector(".setting-group-content");
|
|
2163
2202
|
if (!e) return t;
|
|
2164
|
-
const i = Array.from(e.children), [s, n,
|
|
2203
|
+
const i = Array.from(e.children), [s, n, a] = i;
|
|
2165
2204
|
e.innerHTML = "", e.appendChild(s), e.appendChild(n);
|
|
2166
|
-
const
|
|
2167
|
-
return
|
|
2205
|
+
const o = document.createElement("div");
|
|
2206
|
+
return o.className = "bgset-or-label", o.textContent = "OR", e.appendChild(o), e.appendChild(a), t;
|
|
2168
2207
|
}
|
|
2169
2208
|
/**
|
|
2170
2209
|
* Helper method to generate CSS based on the current settings.
|
|
@@ -2181,44 +2220,44 @@ class kt extends f {
|
|
|
2181
2220
|
`;
|
|
2182
2221
|
}
|
|
2183
2222
|
}
|
|
2184
|
-
function
|
|
2223
|
+
function Nt(c) {
|
|
2185
2224
|
return c instanceof f;
|
|
2186
2225
|
}
|
|
2187
|
-
function
|
|
2226
|
+
function St(c) {
|
|
2188
2227
|
return c instanceof p;
|
|
2189
2228
|
}
|
|
2190
2229
|
export {
|
|
2191
2230
|
j as AlignSetting,
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2231
|
+
xt as AnimationSetting,
|
|
2232
|
+
Vt as BackgroundSettingSet,
|
|
2233
|
+
yt as BorderSettingSet,
|
|
2234
|
+
pt as ButtonSetting,
|
|
2196
2235
|
m as ColorSetting,
|
|
2197
2236
|
C as ColorWithOpacitySetting,
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2237
|
+
gt as DimensionSetting,
|
|
2238
|
+
wt as GapSetting,
|
|
2239
|
+
Mt as HeaderTypographySettingSet,
|
|
2240
|
+
mt as HeightSetting,
|
|
2202
2241
|
ut as HtmlSetting,
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2242
|
+
Et as MarginBottomSetting,
|
|
2243
|
+
kt as MarginSettingGroup,
|
|
2244
|
+
Lt as MarginTopSetting,
|
|
2206
2245
|
bt as MultiLanguageSetting,
|
|
2207
2246
|
v as NumberSetting,
|
|
2208
2247
|
F as OpacitySetting,
|
|
2209
|
-
|
|
2248
|
+
vt as SelectApiSettings,
|
|
2210
2249
|
y as SelectSetting,
|
|
2211
2250
|
p as Setting,
|
|
2212
2251
|
f as SettingGroup,
|
|
2213
2252
|
A as StringSetting,
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2253
|
+
ct as TabSettingGroup,
|
|
2254
|
+
ct as TabsSettingGroup,
|
|
2255
|
+
Ct as Toggle,
|
|
2256
|
+
U as UploadSetting,
|
|
2257
|
+
ft as WidthSetting,
|
|
2258
|
+
dt as asSettingGroupWithSettings,
|
|
2220
2259
|
T as createSettingGroup,
|
|
2221
|
-
|
|
2222
|
-
|
|
2260
|
+
St as isSetting,
|
|
2261
|
+
Nt as isSettingGroup,
|
|
2223
2262
|
w as iterateSettings
|
|
2224
2263
|
};
|