builder-settings-types 0.0.176 → 0.0.178
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 +37 -37
- package/dist/builder-settings-types.es.js +166 -161
- package/dist/index.css +1 -1
- package/dist/index.d.ts +11 -9
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const
|
|
2
|
-
let
|
|
1
|
+
const R = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
2
|
+
let I = (c = 21) => {
|
|
3
3
|
let t = "", e = crypto.getRandomValues(new Uint8Array(c |= 0));
|
|
4
4
|
for (; c--; )
|
|
5
|
-
t +=
|
|
5
|
+
t += R[e[c] & 63];
|
|
6
6
|
return t;
|
|
7
7
|
};
|
|
8
|
-
function
|
|
8
|
+
function y(c) {
|
|
9
9
|
if (c === null || typeof c != "object")
|
|
10
10
|
return c;
|
|
11
11
|
if (c instanceof Date)
|
|
@@ -13,16 +13,16 @@ function L(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] = y(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] = y(c[i]));
|
|
22
22
|
const e = Object.getPrototypeOf(c);
|
|
23
23
|
return e !== Object.prototype && Object.setPrototypeOf(t, e), t;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function $(c) {
|
|
26
26
|
switch (c) {
|
|
27
27
|
case "number":
|
|
28
28
|
return 0;
|
|
@@ -42,7 +42,7 @@ function F(c) {
|
|
|
42
42
|
}
|
|
43
43
|
class p {
|
|
44
44
|
constructor(t = {}) {
|
|
45
|
-
this.props = t, this.id = t.id ||
|
|
45
|
+
this.props = t, this.id = t.id || I(), this.value = this.props.default, this.desktop = this.props.default, this.title = t.title || "";
|
|
46
46
|
}
|
|
47
47
|
destroy() {
|
|
48
48
|
throw new Error("Method not implemented.");
|
|
@@ -58,8 +58,8 @@ class p {
|
|
|
58
58
|
}
|
|
59
59
|
// Basic clone method
|
|
60
60
|
clone() {
|
|
61
|
-
const t = this.constructor, e =
|
|
62
|
-
return i.value =
|
|
61
|
+
const t = this.constructor, e = y(this.props), i = new t(e);
|
|
62
|
+
return i.value = y(this.value), i;
|
|
63
63
|
}
|
|
64
64
|
createInput(t) {
|
|
65
65
|
t = { ...this.props.inputProps, ...t };
|
|
@@ -79,7 +79,7 @@ class p {
|
|
|
79
79
|
const i = document.createElement("div");
|
|
80
80
|
i.className = t.wrapperClassName || "";
|
|
81
81
|
const s = document.createElement("input");
|
|
82
|
-
this.inputEl = s, s.value = String(t.value ||
|
|
82
|
+
this.inputEl = s, s.value = String(t.value || $(t.inputType)), s.type = t.inputType, s.placeholder = t.placeholder || "", s.className = t.inputClassName || "";
|
|
83
83
|
const n = (o) => {
|
|
84
84
|
const l = o.target;
|
|
85
85
|
let h = l.value;
|
|
@@ -120,20 +120,20 @@ class p {
|
|
|
120
120
|
return i.className = "input-icon " + (e || ""), i.innerHTML = t, i;
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function S(c) {
|
|
124
124
|
let t = 0, e = c.parentElement;
|
|
125
125
|
for (; e; )
|
|
126
126
|
e.classList.contains("setting-group") && e !== c && t++, e = e.parentElement;
|
|
127
127
|
return t;
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function k(c, t) {
|
|
130
130
|
const e = Math.min(Math.max(t, 0), 5);
|
|
131
131
|
c.setAttribute("data-nesting-level", e.toString()), e > 0 ? c.style.setProperty("--visual-indent", `${e * 2}px`) : (c.style.removeProperty("--visual-indent"), c.style.marginLeft = "");
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function H(c, t = 0) {
|
|
134
134
|
c.querySelectorAll(":scope > .setting-group-content > .setting-group").forEach((i) => {
|
|
135
135
|
const s = i, n = t + 1;
|
|
136
|
-
|
|
136
|
+
k(s, n), H(s, n);
|
|
137
137
|
});
|
|
138
138
|
}
|
|
139
139
|
const j = {
|
|
@@ -142,7 +142,7 @@ const j = {
|
|
|
142
142
|
visualIndentMultiplier: 2,
|
|
143
143
|
enableAutoDetection: !0
|
|
144
144
|
};
|
|
145
|
-
class
|
|
145
|
+
class F {
|
|
146
146
|
constructor(t = {}) {
|
|
147
147
|
this.observedElements = /* @__PURE__ */ new Set(), this.config = { ...j, ...t }, this.config.enableAutoDetection && this.setupAutoDetection();
|
|
148
148
|
}
|
|
@@ -178,7 +178,7 @@ class G {
|
|
|
178
178
|
* Update nesting for a specific element
|
|
179
179
|
*/
|
|
180
180
|
updateElementNesting(t) {
|
|
181
|
-
const e =
|
|
181
|
+
const e = S(t);
|
|
182
182
|
this.applyNestingWithConfig(t, e);
|
|
183
183
|
}
|
|
184
184
|
/**
|
|
@@ -226,8 +226,8 @@ class G {
|
|
|
226
226
|
this.observer && (this.observer.disconnect(), this.observer = void 0), this.observedElements.clear();
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
|
-
const P = new
|
|
230
|
-
function
|
|
229
|
+
const P = new F();
|
|
230
|
+
function x(c, t) {
|
|
231
231
|
for (const e in c)
|
|
232
232
|
if (c.hasOwnProperty(e)) {
|
|
233
233
|
const i = c[e];
|
|
@@ -237,14 +237,14 @@ function E(c, t) {
|
|
|
237
237
|
const g = class g {
|
|
238
238
|
constructor(t) {
|
|
239
239
|
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.lastValues = {}, this.lastChangeTime = 0, this.CHANGE_DEBOUNCE = 100, this.handleBlur = () => {
|
|
240
|
-
}, this.pendingBlurHandler = null, this.originalDefaultValues = {}, this.nestingLevel = 0, this.parentNestingLevel = 0, this.id = t.id ||
|
|
240
|
+
}, this.pendingBlurHandler = null, this.originalDefaultValues = {}, this.nestingLevel = 0, this.parentNestingLevel = 0, this.id = t.id || I(), this.title = t.title, this.settings = t.settings, this.description = t.description, this.icon = t.icon, this.isCollapsed = t.collapsed ?? !1, this.isMain = t.main ?? !1, this.custom = t.custom ?? !1, this.hideCondition = t.hideCondition, this.onBlur = t.onBlur, this.parentNestingLevel = t.parentNestingLevel ?? 0, this.nestingLevel = this.parentNestingLevel, Object.assign(this, t.settings), this.initialValues = this.getValues(), this.originalDefaultValues = this.getDefaultValues(), this.propagateNestingLevel();
|
|
241
241
|
}
|
|
242
242
|
/**
|
|
243
243
|
* Propagate nesting level to child setting groups
|
|
244
244
|
*/
|
|
245
245
|
propagateNestingLevel() {
|
|
246
246
|
const t = this.nestingLevel + 1;
|
|
247
|
-
|
|
247
|
+
x(this.settings, (e, i) => {
|
|
248
248
|
i instanceof g && (i.parentNestingLevel = this.nestingLevel, i.nestingLevel = t, i.propagateNestingLevel());
|
|
249
249
|
});
|
|
250
250
|
}
|
|
@@ -264,14 +264,14 @@ const g = class g {
|
|
|
264
264
|
* Update nesting styles on the rendered element
|
|
265
265
|
*/
|
|
266
266
|
updateNestingStyles() {
|
|
267
|
-
this.elementRef && (
|
|
267
|
+
this.elementRef && (k(this.elementRef, this.nestingLevel), H(this.elementRef, this.nestingLevel));
|
|
268
268
|
}
|
|
269
269
|
/**
|
|
270
270
|
* Auto-detect nesting level from DOM position
|
|
271
271
|
*/
|
|
272
272
|
autoDetectNestingLevel() {
|
|
273
273
|
if (!this.elementRef) return;
|
|
274
|
-
const t =
|
|
274
|
+
const t = S(this.elementRef);
|
|
275
275
|
t !== this.nestingLevel && this.setNestingLevel(t);
|
|
276
276
|
}
|
|
277
277
|
static hide() {
|
|
@@ -295,7 +295,7 @@ const g = class g {
|
|
|
295
295
|
Object.keys(s).length > 0 && (this.lastChangeTime = Date.now(), this.initialValues = i, t(i), this.updateVisibility()), this.isHandlingChange = !1;
|
|
296
296
|
}, 50));
|
|
297
297
|
};
|
|
298
|
-
return this.changeHandlers.clear(),
|
|
298
|
+
return this.changeHandlers.clear(), x(this.settings, (i, s) => {
|
|
299
299
|
var n;
|
|
300
300
|
if (s instanceof g)
|
|
301
301
|
s.setOnChange((a) => {
|
|
@@ -330,7 +330,7 @@ const g = class g {
|
|
|
330
330
|
"focusout",
|
|
331
331
|
this.handleBlur,
|
|
332
332
|
!0
|
|
333
|
-
),
|
|
333
|
+
), x(this.settings, (t, e) => {
|
|
334
334
|
e instanceof g && e.setOnBlur(() => {
|
|
335
335
|
this.onBlur && this.onBlur();
|
|
336
336
|
});
|
|
@@ -344,7 +344,7 @@ const g = class g {
|
|
|
344
344
|
}
|
|
345
345
|
clone() {
|
|
346
346
|
const t = {};
|
|
347
|
-
|
|
347
|
+
x(this.settings, (s, n) => {
|
|
348
348
|
typeof n.clone == "function" ? t[s] = n.clone() : (console.warn(
|
|
349
349
|
`Setting with key '${s}' does not have a clone method. Copying reference.`
|
|
350
350
|
), t[s] = n);
|
|
@@ -359,7 +359,7 @@ const g = class g {
|
|
|
359
359
|
custom: this.custom,
|
|
360
360
|
hideCondition: this.hideCondition,
|
|
361
361
|
parentNestingLevel: this.parentNestingLevel
|
|
362
|
-
}, i =
|
|
362
|
+
}, i = G(e);
|
|
363
363
|
return i.initialValues = this.getValues(), i;
|
|
364
364
|
}
|
|
365
365
|
setValue(t) {
|
|
@@ -463,7 +463,7 @@ const g = class g {
|
|
|
463
463
|
}
|
|
464
464
|
draw() {
|
|
465
465
|
const t = document.createElement("div");
|
|
466
|
-
t.className = "setting-group", t.id = `setting-group-${this.id}`, g.hiddenElements.add(t), this.hideCondition && this.hideCondition() && (t.style.display = "none"), this.isMain && t.classList.add("main-group"), this.custom && t.classList.add("custom_class"),
|
|
466
|
+
t.className = "setting-group", t.id = `setting-group-${this.id}`, g.hiddenElements.add(t), this.hideCondition && this.hideCondition() && (t.style.display = "none"), this.isMain && t.classList.add("main-group"), this.custom && t.classList.add("custom_class"), k(t, this.nestingLevel);
|
|
467
467
|
const e = document.createElement("div");
|
|
468
468
|
e.className = "setting-group-title", this.isCollapsed && e.classList.add("collapsed-view"), e.setAttribute("role", "button"), e.setAttribute(
|
|
469
469
|
"aria-expanded",
|
|
@@ -589,13 +589,13 @@ const g = class g {
|
|
|
589
589
|
};
|
|
590
590
|
g.hiddenElements = /* @__PURE__ */ new Set();
|
|
591
591
|
let m = g;
|
|
592
|
-
function
|
|
592
|
+
function G(c) {
|
|
593
593
|
return new m(c);
|
|
594
594
|
}
|
|
595
|
-
function
|
|
595
|
+
function ft(c) {
|
|
596
596
|
return c;
|
|
597
597
|
}
|
|
598
|
-
class
|
|
598
|
+
class M extends p {
|
|
599
599
|
constructor(t = {}) {
|
|
600
600
|
super(t), this.inputType = "text", t.onChange && this.setOnChange(t.onChange);
|
|
601
601
|
}
|
|
@@ -615,12 +615,12 @@ class I extends p {
|
|
|
615
615
|
});
|
|
616
616
|
}
|
|
617
617
|
}
|
|
618
|
-
const
|
|
619
|
-
class f extends
|
|
618
|
+
const W = "<svg xmlns='http://www.w3.org/2000/svg' width='18' height='19' viewBox='0 0 18 19' fill='none'><path d='M8.99999 15.8542C9.79613 16.5667 10.8475 17 12 17C14.4853 17 16.5 14.9853 16.5 12.5C16.5 10.4248 15.0953 8.67769 13.1849 8.15763M4.81513 8.15762C2.9047 8.67768 1.5 10.4248 1.5 12.5C1.5 14.9853 3.51472 17 6 17C8.48528 17 10.5 14.9853 10.5 12.5C10.5 11.9146 10.3882 11.3554 10.1849 10.8424M13.5 6.5C13.5 8.98528 11.4853 11 9 11C6.51472 11 4.5 8.98528 4.5 6.5C4.5 4.01472 6.51472 2 9 2C11.4853 2 13.5 4.01472 13.5 6.5Z' stroke='#667085' stroke-linecap='round' stroke-linejoin='round'/></svg>";
|
|
619
|
+
class f extends M {
|
|
620
620
|
constructor(t) {
|
|
621
621
|
super({
|
|
622
622
|
...t,
|
|
623
|
-
icon: t.icon ||
|
|
623
|
+
icon: t.icon || W,
|
|
624
624
|
title: t.title || "Color",
|
|
625
625
|
default: t.default ? f.normalizeColorValue(t.default) : "#000000"
|
|
626
626
|
}), this.inputType = "color", this.element = null, this.colorInputEl = null, this.textInputEl = null, this.detectChange = t.detectChange;
|
|
@@ -719,20 +719,20 @@ class f extends I {
|
|
|
719
719
|
return this.isValidHex() ? this.hexToRgb(this.value) : "0, 0, 0";
|
|
720
720
|
}
|
|
721
721
|
}
|
|
722
|
-
const
|
|
722
|
+
const D = `
|
|
723
723
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
724
724
|
<path d="M8.99999 15.8542C9.79613 16.5667 10.8475 17 12 17C14.4853 17 16.5 14.9853 16.5 12.5C16.5 10.4248 15.0953 8.67769 13.1849 8.15763M4.81513 8.15762C2.9047 8.67768 1.5 10.4248 1.5 12.5C1.5 14.9853 3.51472 17 6 17C8.48528 17 10.5 14.9853 10.5 12.5C10.5 11.9146 10.3882 11.3554 10.1849 10.8424M13.5 6.5C13.5 8.98528 11.4853 11 9 11C6.51472 11 4.5 8.98528 4.5 6.5C4.5 4.01472 6.51472 2 9 2C11.4853 2 13.5 4.01472 13.5 6.5Z" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
725
725
|
<path d="M9 17C13.4183 17 17 13.4183 17 9C17 4.58172 13.4183 1 9 1C4.58172 1 1 4.58172 1 9C1 13.4183 4.58172 17 9 17Z" stroke="#667085" stroke-width="0.5" stroke-linecap="round" stroke-linejoin="round" opacity="0.5"/>
|
|
726
726
|
<path d="M9 1V17C4.58172 17 1 13.4183 1 9C1 4.58172 4.58172 1 9 1Z" fill="#667085" stroke="#667085" stroke-width="0.5" stroke-linecap="round" stroke-linejoin="round" opacity="0.5"/>
|
|
727
727
|
</svg>`;
|
|
728
|
-
class
|
|
728
|
+
class v extends p {
|
|
729
729
|
constructor(t = {}) {
|
|
730
730
|
super({
|
|
731
731
|
...t,
|
|
732
|
-
icon: t.icon ||
|
|
732
|
+
icon: t.icon || D,
|
|
733
733
|
title: t.title || "Color & Opacity",
|
|
734
734
|
default: t.default || "#000000FF"
|
|
735
|
-
}), this.inputType = "color", this.element = null, this.colorInputEl = null, this.textInputEl = null, this.opacityInputEl = null, this.colorPreviewEl = null, this.detectChange = t.detectChange;
|
|
735
|
+
}), this.inputType = "color", this.element = null, this.colorInputEl = null, this.textInputEl = null, this.opacityInputEl = null, this.colorPreviewEl = null, this.detectChange = t.detectChange, this.value && (this.value = v.normalizeHexWithOpacity(this.value));
|
|
736
736
|
}
|
|
737
737
|
static normalizeHexWithOpacity(t) {
|
|
738
738
|
return t = t.replace("#", ""), t.length === 3 && (t = t.split("").map((e) => e + e).join("")), t.length === 6 && (t = t + "FF"), t.length === 8 && /^[0-9A-Fa-f]{8}$/.test(t) ? `#${t.toUpperCase()}` : (console.warn(`Invalid hex value "${t}", using default "#000000FF"`), "#000000FF");
|
|
@@ -750,7 +750,7 @@ class y extends p {
|
|
|
750
750
|
return `#${i}${n}`;
|
|
751
751
|
}
|
|
752
752
|
setValue(t) {
|
|
753
|
-
t === void 0 || t === "" ? this.value = "#000000FF" : this.value =
|
|
753
|
+
t === void 0 || t === "" ? this.value = "#000000FF" : this.value = v.normalizeHexWithOpacity(t), this.updateInputElements(), this.updateColorPreview(), this.onChange && this.onChange(this.value), this.detectChange && this.detectChange(this.value);
|
|
754
754
|
}
|
|
755
755
|
updateInputElements() {
|
|
756
756
|
this.value && (this.colorInputEl && (this.colorInputEl.value = this.getRgbColor()), this.textInputEl && (this.textInputEl.value = this.value), this.opacityInputEl && (this.opacityInputEl.value = this.getOpacityPercent().toString()));
|
|
@@ -761,7 +761,7 @@ class y extends p {
|
|
|
761
761
|
this.colorPreviewEl.style.backgroundColor = `rgba(${s}, ${n}, ${a}, ${e})`;
|
|
762
762
|
}
|
|
763
763
|
handleColorChange(t) {
|
|
764
|
-
const e = this.getOpacityPercent(), i =
|
|
764
|
+
const e = this.getOpacityPercent(), i = v.combineColorOpacity(t, e);
|
|
765
765
|
this.setValue(i);
|
|
766
766
|
}
|
|
767
767
|
handleTextInput(t) {
|
|
@@ -769,7 +769,7 @@ class y extends p {
|
|
|
769
769
|
return e || i ? (this.setValue(t), !0) : !1;
|
|
770
770
|
}
|
|
771
771
|
handleOpacityChange(t) {
|
|
772
|
-
const e = this.getRgbColor(), i = Math.max(0, Math.min(100, t)), s =
|
|
772
|
+
const e = this.getRgbColor(), i = Math.max(0, Math.min(100, t)), s = v.combineColorOpacity(e, i);
|
|
773
773
|
this.setValue(s);
|
|
774
774
|
}
|
|
775
775
|
draw() {
|
|
@@ -787,7 +787,7 @@ class y extends p {
|
|
|
787
787
|
t.appendChild(a);
|
|
788
788
|
}
|
|
789
789
|
const e = document.createElement("div");
|
|
790
|
-
e.className = "color-with-opacity-input-wrapper", this.colorInputEl = document.createElement("input"), this.colorInputEl.type = "color", this.colorInputEl.className = "color-with-opacity-picker", this.
|
|
790
|
+
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) => {
|
|
791
791
|
const o = a.target;
|
|
792
792
|
this.handleColorChange(o.value), this.textInputEl && (this.textInputEl.value = this.value || "#000000FF"), this.updateColorPreview();
|
|
793
793
|
}), this.textInputEl.addEventListener("input", (a) => {
|
|
@@ -812,7 +812,7 @@ class y extends p {
|
|
|
812
812
|
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();
|
|
813
813
|
}), i.appendChild(this.opacityInputEl), i.appendChild(s);
|
|
814
814
|
const n = document.createElement("div");
|
|
815
|
-
return n.className = "color-with-opacity-controls-wrapper", n.appendChild(e), n.appendChild(i), t.appendChild(n), this.element = t, this.updateInputElements(), t;
|
|
815
|
+
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;
|
|
816
816
|
}
|
|
817
817
|
getElement() {
|
|
818
818
|
return this.element;
|
|
@@ -891,12 +891,12 @@ class C extends p {
|
|
|
891
891
|
);
|
|
892
892
|
}
|
|
893
893
|
}
|
|
894
|
-
const
|
|
894
|
+
const _ = `
|
|
895
895
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
896
896
|
<path d="M9 17C13.4183 17 17 13.4183 17 9C17 4.58172 13.4183 1 9 1C4.58172 1 1 4.58172 1 9C1 13.4183 4.58172 17 9 17Z" stroke="#667085" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
897
897
|
<path d="M9 1V17C4.58172 17 1 13.4183 1 9C1 4.58172 4.58172 1 9 1Z" fill="#667085" stroke="#667085" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
898
898
|
</svg>`;
|
|
899
|
-
class
|
|
899
|
+
class z extends C {
|
|
900
900
|
constructor(t = {}) {
|
|
901
901
|
const e = {
|
|
902
902
|
title: "Opacity",
|
|
@@ -905,7 +905,7 @@ class V extends C {
|
|
|
905
905
|
maxValue: 100,
|
|
906
906
|
step: 1,
|
|
907
907
|
default: t.default ?? 100,
|
|
908
|
-
icon:
|
|
908
|
+
icon: _,
|
|
909
909
|
...t
|
|
910
910
|
};
|
|
911
911
|
super(e), this.inputType = "number", this.mobileValue = t.mobile;
|
|
@@ -1059,7 +1059,7 @@ class U extends p {
|
|
|
1059
1059
|
}), t.appendChild(i), t;
|
|
1060
1060
|
}
|
|
1061
1061
|
}
|
|
1062
|
-
class
|
|
1062
|
+
class Ct extends p {
|
|
1063
1063
|
constructor(t) {
|
|
1064
1064
|
super(t), this.inputType = "button";
|
|
1065
1065
|
}
|
|
@@ -1072,7 +1072,7 @@ class ft extends p {
|
|
|
1072
1072
|
return e.className = "button-setting-wrapper " + (this.props.wrapperClassName || ""), e.appendChild(t), e;
|
|
1073
1073
|
}
|
|
1074
1074
|
}
|
|
1075
|
-
class
|
|
1075
|
+
class vt extends p {
|
|
1076
1076
|
constructor(t = {}) {
|
|
1077
1077
|
super(t), this.inputType = { width: "number", height: "number" }, this.aspectRatio = 1, this.isUpdating = !1;
|
|
1078
1078
|
const e = t.width || 0, i = t.height || 0;
|
|
@@ -1096,8 +1096,8 @@ class Ct extends p {
|
|
|
1096
1096
|
}), this.widthSetting.setOnChange(this.handleWidthChange.bind(this)), this.heightSetting.setOnChange(this.handleHeightChange.bind(this));
|
|
1097
1097
|
}
|
|
1098
1098
|
handleWidthChange(t) {
|
|
1099
|
-
if (!this.isUpdating && !isNaN(t)) {
|
|
1100
|
-
this.maxWidth && t > this.maxWidth && (t = this.maxWidth), this.isUpdating = !0;
|
|
1099
|
+
if (!this.isUpdating && !(isNaN(t) || t < 0)) {
|
|
1100
|
+
t = Math.max(this.minWidth, t), this.maxWidth && t > this.maxWidth && (t = this.maxWidth), this.isUpdating = !0;
|
|
1101
1101
|
try {
|
|
1102
1102
|
let e = t, i = this.value.height;
|
|
1103
1103
|
this.locked && this.aspectRatio > 0 && (i = Math.round(e / this.aspectRatio), this.maxHeight && i > this.maxHeight && (i = this.maxHeight, e = Math.round(i * this.aspectRatio), this.maxWidth && e > this.maxWidth && (e = this.maxWidth, i > 0 && (this.aspectRatio = e / i)))), this.value = { width: e, height: i }, this.widthSetting.setValue(e), this.locked && this.heightSetting.setValue(i), this.onChange && this.onChange(this.value);
|
|
@@ -1107,8 +1107,8 @@ class Ct extends p {
|
|
|
1107
1107
|
}
|
|
1108
1108
|
}
|
|
1109
1109
|
handleHeightChange(t) {
|
|
1110
|
-
if (!this.isUpdating && !isNaN(t)) {
|
|
1111
|
-
this.maxHeight && t > this.maxHeight && (t = this.maxHeight), this.isUpdating = !0;
|
|
1110
|
+
if (!this.isUpdating && !(isNaN(t) || t < 0)) {
|
|
1111
|
+
t = Math.max(this.minHeight, t), this.maxHeight && t > this.maxHeight && (t = this.maxHeight), this.isUpdating = !0;
|
|
1112
1112
|
try {
|
|
1113
1113
|
let e = t, i = this.value.width;
|
|
1114
1114
|
this.locked && this.aspectRatio > 0 && (i = Math.round(e * this.aspectRatio), this.maxWidth && i > this.maxWidth && (i = this.maxWidth, e = Math.round(i / this.aspectRatio), this.maxHeight && e > this.maxHeight && (e = this.maxHeight, e > 0 && (this.aspectRatio = i / e)))), this.value = { width: i, height: e }, this.locked && this.widthSetting.setValue(i), this.heightSetting.setValue(e), this.onChange && this.onChange(this.value);
|
|
@@ -1124,7 +1124,9 @@ class Ct extends p {
|
|
|
1124
1124
|
}
|
|
1125
1125
|
t.innerHTML = this.getLockSVG(this.locked), t.setAttribute("aria-pressed", String(this.locked)), t.title = this.locked ? "Unlock aspect ratio" : "Lock aspect ratio";
|
|
1126
1126
|
const e = t.closest(".dimension-setting-container");
|
|
1127
|
-
e && (this.locked ? e.classList.add("aspect-locked") : e.classList.remove("aspect-locked"))
|
|
1127
|
+
e && (this.locked ? e.classList.add("aspect-locked") : e.classList.remove("aspect-locked")), t.style.transform = "scale(0.9)", setTimeout(() => {
|
|
1128
|
+
t.style.transform = "scale(1)";
|
|
1129
|
+
}, 100);
|
|
1128
1130
|
}
|
|
1129
1131
|
getLockSVG(t) {
|
|
1130
1132
|
return t ? `
|
|
@@ -1188,7 +1190,7 @@ const J = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBo
|
|
|
1188
1190
|
<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"/>
|
|
1189
1191
|
</svg>`, Z = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1190
1192
|
<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"/>
|
|
1191
|
-
</svg>`,
|
|
1193
|
+
</svg>`, V = `
|
|
1192
1194
|
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="16" viewBox="0 0 15 16" fill="none">
|
|
1193
1195
|
<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"/>
|
|
1194
1196
|
</svg>
|
|
@@ -1212,10 +1214,10 @@ class Q extends p {
|
|
|
1212
1214
|
".preview-placeholder"
|
|
1213
1215
|
);
|
|
1214
1216
|
t && t !== "" ? (this.previewWrapper.classList.add("has-image"), this.previewEl.src = t, this.previewWrapper.style.display = "block", this.previewEl.style.display = "block", s && s instanceof HTMLElement && (s.style.display = "none"), e && e.classList.remove("no-image"), i && (i.innerHTML = `
|
|
1215
|
-
<span class="upload-icon">${
|
|
1217
|
+
<span class="upload-icon">${V}</span>
|
|
1216
1218
|
<span class="upload-label">Replace</span>
|
|
1217
1219
|
`)) : (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 = `
|
|
1218
|
-
<span class="upload-icon">${
|
|
1220
|
+
<span class="upload-icon">${V}</span>
|
|
1219
1221
|
<span class="upload-label">Upload</span>
|
|
1220
1222
|
`));
|
|
1221
1223
|
}
|
|
@@ -1257,7 +1259,7 @@ class Q extends p {
|
|
|
1257
1259
|
this.previewWrapper.appendChild(this.previewEl);
|
|
1258
1260
|
const a = document.createElement("button");
|
|
1259
1261
|
a.className = "upload-button", a.innerHTML = `
|
|
1260
|
-
<span class="upload-icon">${
|
|
1262
|
+
<span class="upload-icon">${V}</span>
|
|
1261
1263
|
<span class="upload-label">Upload</span>
|
|
1262
1264
|
`;
|
|
1263
1265
|
const o = document.createElement("input");
|
|
@@ -1269,25 +1271,25 @@ class Q extends p {
|
|
|
1269
1271
|
if (l)
|
|
1270
1272
|
try {
|
|
1271
1273
|
a.classList.add("loading"), a.disabled = !0;
|
|
1272
|
-
const d = new FormData(),
|
|
1273
|
-
d.append(
|
|
1274
|
+
const d = new FormData(), O = this.props.formFieldName || "file";
|
|
1275
|
+
d.append(O, l, l.name);
|
|
1274
1276
|
const N = this.props.uploadUrl;
|
|
1275
1277
|
if (!N)
|
|
1276
1278
|
throw new Error("No uploadUrl provided to UploadSetting.");
|
|
1277
|
-
const A = this.props.requestMethod || "POST",
|
|
1279
|
+
const A = this.props.requestMethod || "POST", B = { ...this.props.requestHeaders || {} }, E = await (await fetch(N, {
|
|
1278
1280
|
method: A,
|
|
1279
1281
|
body: d,
|
|
1280
|
-
headers:
|
|
1282
|
+
headers: B
|
|
1281
1283
|
})).json();
|
|
1282
|
-
console.log("Upload response:",
|
|
1283
|
-
let
|
|
1284
|
+
console.log("Upload response:", E);
|
|
1285
|
+
let b;
|
|
1284
1286
|
if (this.props.parseResponse)
|
|
1285
|
-
|
|
1286
|
-
else if (
|
|
1287
|
+
b = this.props.parseResponse(E);
|
|
1288
|
+
else if (b = (r = E == null ? void 0 : E.data) == null ? void 0 : r.url, !b)
|
|
1287
1289
|
throw new Error(
|
|
1288
1290
|
"No URL found in response. Provide a parseResponse if needed."
|
|
1289
1291
|
);
|
|
1290
|
-
console.log("Final URL:",
|
|
1292
|
+
console.log("Final URL:", b), this.value = b, this.updatePreviewState(b), (u = this.onChange) == null || u.call(this, b);
|
|
1291
1293
|
} catch (d) {
|
|
1292
1294
|
console.error("Error uploading file:", d);
|
|
1293
1295
|
} finally {
|
|
@@ -1298,7 +1300,7 @@ class Q extends p {
|
|
|
1298
1300
|
}, t;
|
|
1299
1301
|
}
|
|
1300
1302
|
}
|
|
1301
|
-
class
|
|
1303
|
+
class bt extends C {
|
|
1302
1304
|
// Store mobile value
|
|
1303
1305
|
constructor(t = {}) {
|
|
1304
1306
|
const e = {
|
|
@@ -1321,7 +1323,7 @@ class vt extends C {
|
|
|
1321
1323
|
const Y = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1322
1324
|
<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"/>
|
|
1323
1325
|
</svg>`;
|
|
1324
|
-
class
|
|
1326
|
+
class wt extends C {
|
|
1325
1327
|
constructor(t = {}) {
|
|
1326
1328
|
super({
|
|
1327
1329
|
title: t.title || "Width",
|
|
@@ -1343,7 +1345,7 @@ const tt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewB
|
|
|
1343
1345
|
<polyline points="6 9 12 15 18 9"></polyline>
|
|
1344
1346
|
</svg>
|
|
1345
1347
|
`;
|
|
1346
|
-
class
|
|
1348
|
+
class Et extends p {
|
|
1347
1349
|
constructor(t = {}) {
|
|
1348
1350
|
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) {
|
|
1349
1351
|
const e = this._options.findIndex(
|
|
@@ -1487,7 +1489,7 @@ class wt extends p {
|
|
|
1487
1489
|
), this.updateButtonText();
|
|
1488
1490
|
}
|
|
1489
1491
|
}
|
|
1490
|
-
class
|
|
1492
|
+
class xt extends p {
|
|
1491
1493
|
constructor(t) {
|
|
1492
1494
|
var e, i;
|
|
1493
1495
|
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;
|
|
@@ -1535,7 +1537,7 @@ class Et extends p {
|
|
|
1535
1537
|
const it = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1536
1538
|
<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"/>
|
|
1537
1539
|
</svg>`;
|
|
1538
|
-
class
|
|
1540
|
+
class Lt extends p {
|
|
1539
1541
|
// Store mobile value
|
|
1540
1542
|
constructor(t = {}) {
|
|
1541
1543
|
t.rowGap = t.rowGap ?? !0, t.columnGap = t.columnGap ?? !0, t.title = t.title ?? "Gap", t.icon = t.icon ?? it, 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);
|
|
@@ -1589,7 +1591,7 @@ class xt extends p {
|
|
|
1589
1591
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
1590
1592
|
}
|
|
1591
1593
|
}
|
|
1592
|
-
class
|
|
1594
|
+
class w extends m {
|
|
1593
1595
|
constructor(t) {
|
|
1594
1596
|
var o;
|
|
1595
1597
|
if (!t.tabs)
|
|
@@ -1613,7 +1615,7 @@ class b extends m {
|
|
|
1613
1615
|
tabs: this.tabValues,
|
|
1614
1616
|
activeTabId: this.activeTabId
|
|
1615
1617
|
}, Object.values(e.settings).forEach((i) => {
|
|
1616
|
-
i instanceof
|
|
1618
|
+
i instanceof w && (i._parentTabsSettings = this);
|
|
1617
1619
|
}), this.connectChildChangeHandlers());
|
|
1618
1620
|
}
|
|
1619
1621
|
connectChildChangeHandlers() {
|
|
@@ -1638,7 +1640,7 @@ class b extends m {
|
|
|
1638
1640
|
});
|
|
1639
1641
|
}), this.tabs.forEach((e) => {
|
|
1640
1642
|
Object.entries(e.settings).forEach(([i, s]) => {
|
|
1641
|
-
(s instanceof m || s instanceof p) && (s instanceof
|
|
1643
|
+
(s instanceof m || s instanceof p) && (s instanceof w ? (s._parentTabsSettings = this, s.setOnChange((n) => {
|
|
1642
1644
|
Promise.resolve().then(() => {
|
|
1643
1645
|
this.tabValues[e.id] = this.getTabValues(e), this.triggerDebouncedChange();
|
|
1644
1646
|
});
|
|
@@ -1733,7 +1735,7 @@ class b extends m {
|
|
|
1733
1735
|
activeTabId: this.activeTabId
|
|
1734
1736
|
}, this.tabs.forEach((t) => {
|
|
1735
1737
|
Object.values(t.settings).forEach((e) => {
|
|
1736
|
-
e instanceof
|
|
1738
|
+
e instanceof w && e.updateInitialValues();
|
|
1737
1739
|
});
|
|
1738
1740
|
}));
|
|
1739
1741
|
}
|
|
@@ -1751,7 +1753,7 @@ class b extends m {
|
|
|
1751
1753
|
getTabValues(t) {
|
|
1752
1754
|
const e = {};
|
|
1753
1755
|
return Object.entries(t.settings).forEach(([i, s]) => {
|
|
1754
|
-
s instanceof
|
|
1756
|
+
s instanceof w || s instanceof m ? e[i] = s.getValues() : (s instanceof p, e[i] = s.value);
|
|
1755
1757
|
}), e;
|
|
1756
1758
|
}
|
|
1757
1759
|
clone() {
|
|
@@ -1777,7 +1779,7 @@ class b extends m {
|
|
|
1777
1779
|
hideCondition: this.hideCondition,
|
|
1778
1780
|
settings: {}
|
|
1779
1781
|
};
|
|
1780
|
-
return new
|
|
1782
|
+
return new w(
|
|
1781
1783
|
e
|
|
1782
1784
|
);
|
|
1783
1785
|
}
|
|
@@ -1846,16 +1848,33 @@ class yt extends C {
|
|
|
1846
1848
|
}), this.inputType = "number";
|
|
1847
1849
|
}
|
|
1848
1850
|
}
|
|
1849
|
-
const nt =
|
|
1851
|
+
const nt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1852
|
+
<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"
|
|
1853
|
+
stroke="#667085" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
1854
|
+
</svg>`;
|
|
1855
|
+
class Vt extends C {
|
|
1856
|
+
constructor(t = {}) {
|
|
1857
|
+
super({
|
|
1858
|
+
...t,
|
|
1859
|
+
minValue: t.minValue ?? 0,
|
|
1860
|
+
maxValue: t.maxValue ?? 1e3,
|
|
1861
|
+
icon: t.icon || nt,
|
|
1862
|
+
title: t.title || "Margin Top",
|
|
1863
|
+
default: t.default ?? 20,
|
|
1864
|
+
wrapperClassName: "margin-top-wrapper " + (t.wrapperClassName || "")
|
|
1865
|
+
}), this.inputType = "number";
|
|
1866
|
+
}
|
|
1867
|
+
}
|
|
1868
|
+
const at = `
|
|
1850
1869
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1851
1870
|
<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"/>
|
|
1852
1871
|
</svg>
|
|
1853
|
-
`,
|
|
1872
|
+
`, ot = `
|
|
1854
1873
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1855
1874
|
<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"/>
|
|
1856
1875
|
</svg>
|
|
1857
1876
|
`;
|
|
1858
|
-
class
|
|
1877
|
+
class kt extends m {
|
|
1859
1878
|
constructor(t) {
|
|
1860
1879
|
super({
|
|
1861
1880
|
title: "Border",
|
|
@@ -1864,21 +1883,16 @@ class Lt extends m {
|
|
|
1864
1883
|
settings: {
|
|
1865
1884
|
size: new C({
|
|
1866
1885
|
title: "Size",
|
|
1867
|
-
icon:
|
|
1886
|
+
icon: ot,
|
|
1868
1887
|
default: (t == null ? void 0 : t.size) ?? 0,
|
|
1869
1888
|
suffix: "px"
|
|
1870
1889
|
}),
|
|
1871
|
-
color: new
|
|
1890
|
+
color: new v({
|
|
1872
1891
|
default: (t == null ? void 0 : t.color) ?? "0, 0, 30"
|
|
1873
1892
|
}),
|
|
1874
|
-
opacity: new V({
|
|
1875
|
-
default: (t == null ? void 0 : t.opacity) ?? 100,
|
|
1876
|
-
minValue: 0,
|
|
1877
|
-
maxValue: 100
|
|
1878
|
-
}),
|
|
1879
1893
|
radius: new C({
|
|
1880
1894
|
title: "Radius",
|
|
1881
|
-
icon:
|
|
1895
|
+
icon: at,
|
|
1882
1896
|
default: (t == null ? void 0 : t.radius) ?? 12,
|
|
1883
1897
|
suffix: "px"
|
|
1884
1898
|
})
|
|
@@ -1889,44 +1903,40 @@ class Lt extends m {
|
|
|
1889
1903
|
* Optional helper to generate CSS from the current settings.
|
|
1890
1904
|
*/
|
|
1891
1905
|
getCssCode() {
|
|
1892
|
-
const t = this.settings.color.value ?? "#000000", e = this.settings.
|
|
1906
|
+
const t = this.settings.color.value ?? "#000000", e = this.settings.radius.value ?? 0, i = this.settings.size.value ?? 0;
|
|
1893
1907
|
return `
|
|
1894
1908
|
border-color: ${t};
|
|
1895
|
-
border-width: ${
|
|
1896
|
-
border-radius: ${
|
|
1897
|
-
opacity: ${e / 100};
|
|
1909
|
+
border-width: ${i}px;
|
|
1910
|
+
border-radius: ${e}px;
|
|
1898
1911
|
`;
|
|
1899
1912
|
}
|
|
1900
1913
|
}
|
|
1901
|
-
const
|
|
1914
|
+
const lt = `
|
|
1902
1915
|
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="13" viewBox="0 0 14 13" fill="none">
|
|
1903
1916
|
<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"/>
|
|
1904
1917
|
</svg>
|
|
1905
|
-
`,
|
|
1918
|
+
`, rt = `
|
|
1906
1919
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1907
1920
|
<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"/>
|
|
1908
1921
|
</svg>
|
|
1909
|
-
`,
|
|
1922
|
+
`, ht = `
|
|
1910
1923
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1911
1924
|
<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"/>
|
|
1912
1925
|
</svg>
|
|
1913
1926
|
`;
|
|
1914
|
-
class
|
|
1927
|
+
class Mt extends m {
|
|
1915
1928
|
constructor(t = {}) {
|
|
1916
1929
|
super({
|
|
1917
1930
|
title: t.title || "Typography",
|
|
1918
1931
|
collapsed: t.collapsed,
|
|
1919
1932
|
hideCondition: t.hideCondition,
|
|
1920
1933
|
settings: {
|
|
1921
|
-
color: new
|
|
1934
|
+
color: new v({
|
|
1922
1935
|
default: t.colorDefault ?? "0, 0, 30"
|
|
1923
1936
|
}),
|
|
1924
|
-
opacity: new V({
|
|
1925
|
-
default: t.colorOpacityDefault ?? 100
|
|
1926
|
-
}),
|
|
1927
1937
|
fontFamily: new T({
|
|
1928
1938
|
title: "Font",
|
|
1929
|
-
icon:
|
|
1939
|
+
icon: lt,
|
|
1930
1940
|
default: t.fontFamilyDefault ?? "Satoshi",
|
|
1931
1941
|
options: t.fontFamilyOptions ?? [
|
|
1932
1942
|
{ name: "Alt", value: "Croco Sans Black Caps Alt" },
|
|
@@ -1938,7 +1948,7 @@ class Vt extends m {
|
|
|
1938
1948
|
}),
|
|
1939
1949
|
fontWeight: new T({
|
|
1940
1950
|
title: "Weight",
|
|
1941
|
-
icon:
|
|
1951
|
+
icon: rt,
|
|
1942
1952
|
default: t.fontWeightDefault ?? "400",
|
|
1943
1953
|
options: t.fontWeightOptions ?? [
|
|
1944
1954
|
{ name: "Regular", value: "400" },
|
|
@@ -1950,7 +1960,7 @@ class Vt extends m {
|
|
|
1950
1960
|
}),
|
|
1951
1961
|
fontSize: new C({
|
|
1952
1962
|
title: "Size",
|
|
1953
|
-
icon:
|
|
1963
|
+
icon: ht,
|
|
1954
1964
|
default: t.fontSizeDefault ?? 12,
|
|
1955
1965
|
suffix: "px",
|
|
1956
1966
|
mobile: t.fontSizeMobileDefault
|
|
@@ -1963,18 +1973,17 @@ class Vt extends m {
|
|
|
1963
1973
|
});
|
|
1964
1974
|
}
|
|
1965
1975
|
getCssCode() {
|
|
1966
|
-
const t = this.settings.color.value ?? "#000000", e = this.settings.
|
|
1976
|
+
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 = this.settings.align.value ?? "left";
|
|
1967
1977
|
return `
|
|
1968
1978
|
color: ${t};
|
|
1969
|
-
|
|
1970
|
-
font-
|
|
1971
|
-
font-
|
|
1972
|
-
|
|
1973
|
-
text-align: ${a};
|
|
1979
|
+
font-family: ${e};
|
|
1980
|
+
font-weight: ${i};
|
|
1981
|
+
font-size: ${s}px;
|
|
1982
|
+
text-align: ${n};
|
|
1974
1983
|
`;
|
|
1975
1984
|
}
|
|
1976
1985
|
}
|
|
1977
|
-
class
|
|
1986
|
+
class L extends p {
|
|
1978
1987
|
constructor(t) {
|
|
1979
1988
|
super({
|
|
1980
1989
|
...t,
|
|
@@ -2020,34 +2029,34 @@ class x extends p {
|
|
|
2020
2029
|
}), i;
|
|
2021
2030
|
}
|
|
2022
2031
|
}
|
|
2023
|
-
class
|
|
2032
|
+
class Nt extends m {
|
|
2024
2033
|
constructor(t) {
|
|
2025
2034
|
super({
|
|
2026
2035
|
title: "Margins",
|
|
2027
2036
|
collapsed: t == null ? void 0 : t.collapsed,
|
|
2028
2037
|
hideCondition: t == null ? void 0 : t.hideCondition,
|
|
2029
2038
|
settings: {
|
|
2030
|
-
marginTop: new
|
|
2039
|
+
marginTop: new L({
|
|
2031
2040
|
title: "Top",
|
|
2032
|
-
icon:
|
|
2041
|
+
icon: ct,
|
|
2033
2042
|
suffix: "px",
|
|
2034
2043
|
default: (t == null ? void 0 : t.marginTop) ?? "auto"
|
|
2035
2044
|
}),
|
|
2036
|
-
marginRight: new
|
|
2045
|
+
marginRight: new L({
|
|
2037
2046
|
title: "Right",
|
|
2038
|
-
icon:
|
|
2047
|
+
icon: ut,
|
|
2039
2048
|
suffix: "px",
|
|
2040
2049
|
default: (t == null ? void 0 : t.marginRight) ?? 0
|
|
2041
2050
|
}),
|
|
2042
|
-
marginBottom: new
|
|
2051
|
+
marginBottom: new L({
|
|
2043
2052
|
title: "Bottom",
|
|
2044
|
-
icon:
|
|
2053
|
+
icon: dt,
|
|
2045
2054
|
suffix: "px",
|
|
2046
2055
|
default: (t == null ? void 0 : t.marginBottom) ?? 0
|
|
2047
2056
|
}),
|
|
2048
|
-
marginLeft: new
|
|
2057
|
+
marginLeft: new L({
|
|
2049
2058
|
title: "Left",
|
|
2050
|
-
icon:
|
|
2059
|
+
icon: pt,
|
|
2051
2060
|
suffix: "px",
|
|
2052
2061
|
default: (t == null ? void 0 : t.marginLeft) ?? 0
|
|
2053
2062
|
})
|
|
@@ -2064,16 +2073,16 @@ class kt extends m {
|
|
|
2064
2073
|
`;
|
|
2065
2074
|
}
|
|
2066
2075
|
}
|
|
2067
|
-
const
|
|
2076
|
+
const ct = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2068
2077
|
<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"/>
|
|
2069
|
-
</svg>`, ct = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2070
|
-
<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"/>
|
|
2071
2078
|
</svg>`, ut = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2072
|
-
<path d="
|
|
2079
|
+
<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"/>
|
|
2073
2080
|
</svg>`, dt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2081
|
+
<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"/>
|
|
2082
|
+
</svg>`, pt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2074
2083
|
<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"/>
|
|
2075
2084
|
</svg>`;
|
|
2076
|
-
class
|
|
2085
|
+
class Tt extends m {
|
|
2077
2086
|
/**
|
|
2078
2087
|
* Constructs a new BackgroundSettingSet.
|
|
2079
2088
|
*
|
|
@@ -2085,7 +2094,6 @@ class Mt extends m {
|
|
|
2085
2094
|
* backgroundImage: 'https://example.com/myimage.png',
|
|
2086
2095
|
* opacity: 80,
|
|
2087
2096
|
* backgroundColor: "0, 0, 30",
|
|
2088
|
-
* opacityBG: 90,
|
|
2089
2097
|
* uploadProps: {
|
|
2090
2098
|
* uploadUrl: 'https://st-admapi.onaim.io/api/File/UploadImage',
|
|
2091
2099
|
* requestMethod: 'POST',
|
|
@@ -2108,14 +2116,11 @@ class Mt extends m {
|
|
|
2108
2116
|
...t == null ? void 0 : t.uploadProps,
|
|
2109
2117
|
default: (t == null ? void 0 : t.backgroundImage) ?? ""
|
|
2110
2118
|
}),
|
|
2111
|
-
opacity: new
|
|
2119
|
+
opacity: new z({
|
|
2112
2120
|
default: (t == null ? void 0 : t.opacity) ?? 100
|
|
2113
2121
|
}),
|
|
2114
|
-
backgroundColor: new
|
|
2122
|
+
backgroundColor: new v({
|
|
2115
2123
|
default: (t == null ? void 0 : t.backgroundColor) ?? "0, 0, 30"
|
|
2116
|
-
}),
|
|
2117
|
-
opacityBG: new V({
|
|
2118
|
-
default: (t == null ? void 0 : t.opacityBG) ?? 100
|
|
2119
2124
|
})
|
|
2120
2125
|
}
|
|
2121
2126
|
});
|
|
@@ -2126,16 +2131,16 @@ class Mt extends m {
|
|
|
2126
2131
|
draw() {
|
|
2127
2132
|
const t = super.draw(), e = t.querySelector(".setting-group-content");
|
|
2128
2133
|
if (!e) return t;
|
|
2129
|
-
const i = Array.from(e.children), [s, n, a
|
|
2134
|
+
const i = Array.from(e.children), [s, n, a] = i;
|
|
2130
2135
|
e.innerHTML = "", e.appendChild(s), e.appendChild(n);
|
|
2131
|
-
const
|
|
2132
|
-
return
|
|
2136
|
+
const o = document.createElement("div");
|
|
2137
|
+
return o.className = "bgset-or-label", o.textContent = "OR", e.appendChild(o), e.appendChild(a), t;
|
|
2133
2138
|
}
|
|
2134
2139
|
/**
|
|
2135
2140
|
* Helper method to generate CSS based on the current settings.
|
|
2136
2141
|
*/
|
|
2137
2142
|
getCssCode() {
|
|
2138
|
-
const t = this.settings.backgroundImage.value || "", e = this.settings.opacity.value ?? 100, i = this.settings.backgroundColor.value || "
|
|
2143
|
+
const t = this.settings.backgroundImage.value || "", e = this.settings.opacity.value ?? 100, i = this.settings.backgroundColor.value || "#000000";
|
|
2139
2144
|
return t ? `
|
|
2140
2145
|
background-image: url("${t}");
|
|
2141
2146
|
background-size: cover;
|
|
@@ -2143,22 +2148,21 @@ class Mt extends m {
|
|
|
2143
2148
|
opacity: ${e / 100};
|
|
2144
2149
|
` : `
|
|
2145
2150
|
background-color: ${i};
|
|
2146
|
-
opacity: ${s / 100};
|
|
2147
2151
|
`;
|
|
2148
2152
|
}
|
|
2149
2153
|
}
|
|
2150
|
-
class
|
|
2154
|
+
class gt extends m {
|
|
2151
2155
|
constructor(t, e, i) {
|
|
2152
2156
|
super({
|
|
2153
2157
|
title: `Tab ${t + 1}`,
|
|
2154
2158
|
hideCondition: i == null ? void 0 : i.hideCondition,
|
|
2155
2159
|
collapsed: i == null ? void 0 : i.collapsed,
|
|
2156
2160
|
settings: {
|
|
2157
|
-
name: new
|
|
2161
|
+
name: new M({
|
|
2158
2162
|
title: "Tab Name",
|
|
2159
2163
|
default: `Tab ${t + 1}`
|
|
2160
2164
|
}),
|
|
2161
|
-
content: new
|
|
2165
|
+
content: new M({
|
|
2162
2166
|
title: "Content",
|
|
2163
2167
|
default: ""
|
|
2164
2168
|
})
|
|
@@ -2203,7 +2207,7 @@ class It extends m {
|
|
|
2203
2207
|
}
|
|
2204
2208
|
/** Adds a new tab. */
|
|
2205
2209
|
addTab(t) {
|
|
2206
|
-
const e = this.tabs.length, i = new
|
|
2210
|
+
const e = this.tabs.length, i = new gt(
|
|
2207
2211
|
e,
|
|
2208
2212
|
() => this.removeTab(i),
|
|
2209
2213
|
t
|
|
@@ -2260,40 +2264,41 @@ class It extends m {
|
|
|
2260
2264
|
}));
|
|
2261
2265
|
}
|
|
2262
2266
|
}
|
|
2263
|
-
function
|
|
2267
|
+
function St(c) {
|
|
2264
2268
|
return c instanceof m;
|
|
2265
2269
|
}
|
|
2266
|
-
function
|
|
2270
|
+
function Ht(c) {
|
|
2267
2271
|
return c instanceof p;
|
|
2268
2272
|
}
|
|
2269
2273
|
export {
|
|
2270
2274
|
U as AlignSetting,
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2275
|
+
Tt as BackgroundSettingSet,
|
|
2276
|
+
kt as BorderSettingSet,
|
|
2277
|
+
Ct as ButtonSetting,
|
|
2274
2278
|
f as ColorSetting,
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2279
|
+
v as ColorWithOpacitySetting,
|
|
2280
|
+
vt as DimensionSetting,
|
|
2281
|
+
Lt as GapSetting,
|
|
2282
|
+
Mt as HeaderTypographySettingSet,
|
|
2283
|
+
bt as HeightSetting,
|
|
2280
2284
|
yt as MarginBottomSetting,
|
|
2281
|
-
|
|
2285
|
+
Nt as MarginSettingGroup,
|
|
2286
|
+
Vt as MarginTopSetting,
|
|
2282
2287
|
C as NumberSetting,
|
|
2283
|
-
|
|
2284
|
-
|
|
2288
|
+
z as OpacitySetting,
|
|
2289
|
+
Et as SelectApiSettings,
|
|
2285
2290
|
T as SelectSetting,
|
|
2286
2291
|
p as Setting,
|
|
2287
2292
|
m as SettingGroup,
|
|
2288
|
-
|
|
2293
|
+
M as StringSetting,
|
|
2289
2294
|
It as TabsContainerGroup,
|
|
2290
|
-
|
|
2291
|
-
|
|
2295
|
+
w as TabsSettings,
|
|
2296
|
+
xt as Toggle,
|
|
2292
2297
|
Q as UploadSetting,
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2298
|
+
wt as WidthSetting,
|
|
2299
|
+
ft as asSettingGroupWithSettings,
|
|
2300
|
+
G as createSettingGroup,
|
|
2301
|
+
Ht as isSetting,
|
|
2302
|
+
St as isSettingGroup,
|
|
2303
|
+
x as iterateSettings
|
|
2299
2304
|
};
|