builder-settings-types 0.0.86 → 0.0.88
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 +43 -43
- package/dist/builder-settings-types.es.js +379 -334
- package/dist/index.d.ts +8 -0
- package/package.json +1 -1
|
@@ -1,45 +1,61 @@
|
|
|
1
|
-
const
|
|
2
|
-
let
|
|
1
|
+
const R = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
2
|
+
let I = (h = 21) => {
|
|
3
3
|
let t = "", e = crypto.getRandomValues(new Uint8Array(h |= 0));
|
|
4
4
|
for (; h--; )
|
|
5
|
-
t +=
|
|
5
|
+
t += R[e[h] & 63];
|
|
6
6
|
return t;
|
|
7
7
|
};
|
|
8
|
-
function
|
|
8
|
+
function B(h, t) {
|
|
9
9
|
for (const e in h)
|
|
10
10
|
if (h.hasOwnProperty(e)) {
|
|
11
11
|
const i = h[e];
|
|
12
12
|
t(e, i);
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
class
|
|
15
|
+
const x = class x {
|
|
16
16
|
constructor(t) {
|
|
17
|
-
this.elementRef = null, this.id = t.id ||
|
|
17
|
+
this.elementRef = null, this.isHidden = !1, 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.hideCondition = t.hideCondition, Object.assign(this, t.settings);
|
|
18
|
+
}
|
|
19
|
+
static hide() {
|
|
20
|
+
this.hiddenElements.forEach((t) => {
|
|
21
|
+
t && (t.style.display = "none");
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
static show() {
|
|
25
|
+
this.hiddenElements.forEach((t) => {
|
|
26
|
+
t && (t.style.display = "");
|
|
27
|
+
});
|
|
18
28
|
}
|
|
19
29
|
setOnChange(t) {
|
|
20
|
-
return this.onChange = t,
|
|
21
|
-
i.setOnChange((
|
|
22
|
-
t(
|
|
30
|
+
return this.onChange = t, B(this.settings, (e, i) => {
|
|
31
|
+
i.setOnChange((s) => {
|
|
32
|
+
t(s), this.updateVisibility();
|
|
23
33
|
});
|
|
24
34
|
}), this;
|
|
25
35
|
}
|
|
36
|
+
hide() {
|
|
37
|
+
this.elementRef && (this.elementRef.style.display = "none", this.isHidden = !0);
|
|
38
|
+
}
|
|
39
|
+
show() {
|
|
40
|
+
this.elementRef && (this.elementRef.style.display = "", this.isHidden = !1);
|
|
41
|
+
}
|
|
26
42
|
getValues(t) {
|
|
27
43
|
if (t === void 0) {
|
|
28
44
|
const e = {};
|
|
29
45
|
for (const i in this.settings)
|
|
30
46
|
if (this.settings.hasOwnProperty(i)) {
|
|
31
|
-
const
|
|
32
|
-
|
|
47
|
+
const s = this.settings[i];
|
|
48
|
+
s instanceof x ? e[i] = s.getValues() : e[i] = s.value;
|
|
33
49
|
}
|
|
34
50
|
return e;
|
|
35
51
|
} else {
|
|
36
52
|
const e = this.settings[t];
|
|
37
|
-
return e ? e instanceof
|
|
53
|
+
return e ? e instanceof x ? e.getValues() : e.value : void 0;
|
|
38
54
|
}
|
|
39
55
|
}
|
|
40
56
|
draw() {
|
|
41
57
|
const t = document.createElement("div");
|
|
42
|
-
t.className = "setting-group", t.id = `setting-group-${this.id}`, this.hideCondition && this.hideCondition() && (t.style.display = "none"), this.isMain && t.classList.add("main-group");
|
|
58
|
+
t.className = "setting-group", t.id = `setting-group-${this.id}`, x.hiddenElements.add(t), this.hideCondition && this.hideCondition() && (t.style.display = "none"), this.isMain && t.classList.add("main-group");
|
|
43
59
|
const e = document.createElement("div");
|
|
44
60
|
e.className = "setting-group-title", this.isCollapsed && e.classList.add("collapsed-view"), e.setAttribute("role", "button"), e.setAttribute(
|
|
45
61
|
"aria-expanded",
|
|
@@ -47,53 +63,53 @@ class v {
|
|
|
47
63
|
), e.setAttribute("tabindex", "0");
|
|
48
64
|
const i = document.createElement("div");
|
|
49
65
|
if (i.className = "title-section", this.icon) {
|
|
50
|
-
const
|
|
51
|
-
|
|
66
|
+
const r = document.createElement("span");
|
|
67
|
+
r.className = "group-icon", r.innerHTML = this.icon, i.appendChild(r);
|
|
52
68
|
}
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
if (
|
|
57
|
-
const
|
|
58
|
-
|
|
69
|
+
const s = document.createElement("h3");
|
|
70
|
+
s.textContent = this.title, i.appendChild(s);
|
|
71
|
+
const n = document.createElement("div");
|
|
72
|
+
if (n.className = "actions-section", this.description && this.isCollapsed) {
|
|
73
|
+
const r = document.createElement("span");
|
|
74
|
+
r.className = "info-marker", r.innerHTML = `
|
|
59
75
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
60
76
|
<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"
|
|
61
77
|
stroke="currentColor" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>
|
|
62
78
|
</svg>
|
|
63
|
-
`,
|
|
79
|
+
`, r.title = this.description, n.appendChild(r);
|
|
64
80
|
}
|
|
65
81
|
const o = document.createElement("span");
|
|
66
82
|
o.className = "setting-group-arrow", o.innerHTML = `
|
|
67
83
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
68
84
|
<path d="M4 6L8 10L12 6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
69
85
|
</svg>
|
|
70
|
-
`, this.isCollapsed && o.classList.add("rotated"),
|
|
86
|
+
`, this.isCollapsed && o.classList.add("rotated"), n.appendChild(o);
|
|
71
87
|
const a = document.createElement("div");
|
|
72
88
|
if (a.className = "setting-group-content", this.isCollapsed && (a.classList.add("collapsed"), e.classList.add("collapsed-view"), o.classList.add("rotated"), t.classList.add("collapsed")), this.isMain && a.classList.add("main-content"), this.description && !this.isCollapsed) {
|
|
73
|
-
const
|
|
74
|
-
|
|
89
|
+
const r = document.createElement("div");
|
|
90
|
+
r.className = "setting-group-description", r.textContent = this.description, a.appendChild(r);
|
|
75
91
|
}
|
|
76
|
-
const
|
|
92
|
+
const l = () => {
|
|
77
93
|
this.isCollapsed = !this.isCollapsed, a.classList.toggle("collapsed"), e.classList.toggle("collapsed-view"), o.classList.toggle("rotated"), t.classList.toggle("collapsed", this.isCollapsed), e.setAttribute(
|
|
78
94
|
"aria-expanded",
|
|
79
95
|
(!this.isCollapsed).toString()
|
|
80
96
|
);
|
|
81
|
-
const
|
|
97
|
+
const r = a.querySelector(
|
|
82
98
|
".setting-group-description"
|
|
83
|
-
), u =
|
|
99
|
+
), u = n.querySelector(".info-marker");
|
|
84
100
|
if (this.description)
|
|
85
101
|
if (this.isCollapsed) {
|
|
86
|
-
if (
|
|
102
|
+
if (r && r.remove(), !u) {
|
|
87
103
|
const d = document.createElement("span");
|
|
88
104
|
d.className = "info-marker", d.innerHTML = `
|
|
89
105
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
90
106
|
<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"
|
|
91
107
|
stroke="currentColor" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>
|
|
92
108
|
</svg>
|
|
93
|
-
`, d.title = this.description,
|
|
109
|
+
`, d.title = this.description, n.insertBefore(d, o);
|
|
94
110
|
}
|
|
95
111
|
} else {
|
|
96
|
-
if (!
|
|
112
|
+
if (!r) {
|
|
97
113
|
const d = document.createElement("div");
|
|
98
114
|
d.className = "setting-group-description", d.textContent = this.description, a.insertBefore(
|
|
99
115
|
d,
|
|
@@ -103,19 +119,19 @@ class v {
|
|
|
103
119
|
u && u.remove();
|
|
104
120
|
}
|
|
105
121
|
};
|
|
106
|
-
if (e.onclick =
|
|
107
|
-
(
|
|
122
|
+
if (e.onclick = l, e.onkeydown = (r) => {
|
|
123
|
+
(r.key === "Enter" || r.key === " ") && (r.preventDefault(), l());
|
|
108
124
|
}, Object.keys(this.settings).length > 0) {
|
|
109
|
-
for (const
|
|
110
|
-
if (this.settings.hasOwnProperty(
|
|
111
|
-
const u = this.settings[
|
|
125
|
+
for (const r in this.settings)
|
|
126
|
+
if (this.settings.hasOwnProperty(r)) {
|
|
127
|
+
const u = this.settings[r];
|
|
112
128
|
a.appendChild(u.draw());
|
|
113
129
|
}
|
|
114
130
|
} else {
|
|
115
|
-
const
|
|
116
|
-
|
|
131
|
+
const r = document.createElement("div");
|
|
132
|
+
r.className = "setting-group-empty", r.textContent = "No settings in this group", a.appendChild(r);
|
|
117
133
|
}
|
|
118
|
-
return e.appendChild(i), e.appendChild(
|
|
134
|
+
return e.appendChild(i), e.appendChild(n), t.appendChild(e), t.appendChild(a), this.elementRef = t, t;
|
|
119
135
|
}
|
|
120
136
|
collapse() {
|
|
121
137
|
if (!this.elementRef || this.isCollapsed) return;
|
|
@@ -139,10 +155,12 @@ class v {
|
|
|
139
155
|
this.elementRef && this.hideCondition && (this.elementRef.style.display = this.hideCondition() ? "none" : "");
|
|
140
156
|
}
|
|
141
157
|
toggle() {
|
|
142
|
-
this.
|
|
158
|
+
this.isHidden ? this.show() : this.hide();
|
|
143
159
|
}
|
|
144
|
-
}
|
|
145
|
-
|
|
160
|
+
};
|
|
161
|
+
x.hiddenElements = /* @__PURE__ */ new Set();
|
|
162
|
+
let f = x;
|
|
163
|
+
function W(h) {
|
|
146
164
|
switch (h) {
|
|
147
165
|
case "number":
|
|
148
166
|
return 0;
|
|
@@ -162,7 +180,7 @@ function B(h) {
|
|
|
162
180
|
}
|
|
163
181
|
class m {
|
|
164
182
|
constructor(t = {}) {
|
|
165
|
-
this.props = t, this.id = t.id ||
|
|
183
|
+
this.props = t, this.id = t.id || I(), this.value = this.props.default, this.title = t.title || "";
|
|
166
184
|
}
|
|
167
185
|
destroy() {
|
|
168
186
|
throw new Error("Method not implemented.");
|
|
@@ -177,25 +195,49 @@ class m {
|
|
|
177
195
|
t = { ...this.props.inputProps, ...t };
|
|
178
196
|
const e = document.createElement("div");
|
|
179
197
|
if (e.className = t.wrapperClassName || "", t.title || t.icon) {
|
|
180
|
-
const
|
|
181
|
-
if (
|
|
182
|
-
const
|
|
183
|
-
|
|
198
|
+
const o = document.createElement("div");
|
|
199
|
+
if (o.className = "icon-container", t.icon) {
|
|
200
|
+
const a = this.createIcon(t.icon, t.iconClassName);
|
|
201
|
+
o.appendChild(a);
|
|
184
202
|
}
|
|
185
203
|
if (t.title) {
|
|
186
|
-
const
|
|
187
|
-
|
|
204
|
+
const a = this.createLabel(t.title, t.labelClassName);
|
|
205
|
+
o.appendChild(a);
|
|
188
206
|
}
|
|
189
|
-
e.appendChild(
|
|
207
|
+
e.appendChild(o);
|
|
190
208
|
}
|
|
191
209
|
const i = document.createElement("div");
|
|
192
210
|
i.className = t.wrapperClassName || "";
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
211
|
+
const s = document.createElement("input");
|
|
212
|
+
this.inputEl = s, s.value = String(t.value || W(t.inputType)), s.type = t.inputType, s.placeholder = t.placeholder || "", s.className = t.inputClassName || "";
|
|
213
|
+
const n = (o) => {
|
|
214
|
+
const a = o.target;
|
|
215
|
+
let l = a.value;
|
|
216
|
+
switch (t.inputType) {
|
|
217
|
+
case "number":
|
|
218
|
+
l = Number(a.value);
|
|
219
|
+
break;
|
|
220
|
+
case "color":
|
|
221
|
+
l = a.value;
|
|
222
|
+
break;
|
|
223
|
+
case "date":
|
|
224
|
+
l = a.value;
|
|
225
|
+
break;
|
|
226
|
+
case "select":
|
|
227
|
+
l = a.value;
|
|
228
|
+
break;
|
|
229
|
+
case "text":
|
|
230
|
+
l = a.value;
|
|
231
|
+
break;
|
|
232
|
+
case "button":
|
|
233
|
+
l = a.value;
|
|
234
|
+
break;
|
|
235
|
+
default:
|
|
236
|
+
l = a.value;
|
|
237
|
+
}
|
|
238
|
+
this.value = l, this.onChange && this.onChange(this.value);
|
|
239
|
+
};
|
|
240
|
+
return s.addEventListener("input", n), s.addEventListener("change", n), t.inputCustomizer && t.inputCustomizer(s), i.appendChild(s), e.appendChild(i), e;
|
|
199
241
|
}
|
|
200
242
|
createLabel(t, e) {
|
|
201
243
|
const i = document.createElement("span");
|
|
@@ -206,9 +248,9 @@ class m {
|
|
|
206
248
|
return i.className = "input-icon " + (e || ""), i.innerHTML = t, i;
|
|
207
249
|
}
|
|
208
250
|
}
|
|
209
|
-
class
|
|
251
|
+
class H extends m {
|
|
210
252
|
constructor(t = {}) {
|
|
211
|
-
super(t), this.inputType = "text";
|
|
253
|
+
super(t), this.inputType = "text", t.onChange && this.setOnChange(t.onChange);
|
|
212
254
|
}
|
|
213
255
|
draw() {
|
|
214
256
|
const t = (e) => {
|
|
@@ -226,55 +268,55 @@ class y extends m {
|
|
|
226
268
|
});
|
|
227
269
|
}
|
|
228
270
|
}
|
|
229
|
-
const
|
|
230
|
-
class
|
|
271
|
+
const O = "<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>";
|
|
272
|
+
class S extends H {
|
|
231
273
|
constructor(t) {
|
|
232
274
|
super({
|
|
233
275
|
...t,
|
|
234
|
-
icon: t.icon ||
|
|
276
|
+
icon: t.icon || O,
|
|
235
277
|
title: t.title || "Color"
|
|
236
278
|
}), this.inputType = "color";
|
|
237
279
|
}
|
|
238
280
|
hexToRgb(t) {
|
|
239
281
|
t = t.replace("#", "");
|
|
240
|
-
const e = parseInt(t.substring(0, 2), 16), i = parseInt(t.substring(2, 4), 16),
|
|
241
|
-
return `${e}, ${i}, ${
|
|
282
|
+
const e = parseInt(t.substring(0, 2), 16), i = parseInt(t.substring(2, 4), 16), s = parseInt(t.substring(4, 6), 16);
|
|
283
|
+
return `${e}, ${i}, ${s}`;
|
|
242
284
|
}
|
|
243
285
|
rgbToHex(t) {
|
|
244
|
-
const [e, i,
|
|
245
|
-
if (isNaN(e) || isNaN(i) || isNaN(
|
|
246
|
-
const
|
|
286
|
+
const [e, i, s] = t.split(",").map((o) => parseInt(o.trim()));
|
|
287
|
+
if (isNaN(e) || isNaN(i) || isNaN(s)) return "#000000";
|
|
288
|
+
const n = (o) => {
|
|
247
289
|
const a = o.toString(16);
|
|
248
290
|
return a.length === 1 ? "0" + a : a;
|
|
249
291
|
};
|
|
250
|
-
return `#${
|
|
292
|
+
return `#${n(e)}${n(i)}${n(s)}`;
|
|
251
293
|
}
|
|
252
294
|
draw() {
|
|
253
295
|
const t = document.createElement("div");
|
|
254
296
|
t.className = "color-setting-wrapper";
|
|
255
297
|
const e = document.createElement("div");
|
|
256
298
|
e.className = "icon-container";
|
|
257
|
-
const i = this.createIcon(this.props.icon ||
|
|
258
|
-
e.appendChild(i), e.appendChild(
|
|
259
|
-
const
|
|
260
|
-
|
|
299
|
+
const i = this.createIcon(this.props.icon || O), s = this.createLabel(this.title || "Color");
|
|
300
|
+
e.appendChild(i), e.appendChild(s);
|
|
301
|
+
const n = document.createElement("div");
|
|
302
|
+
n.className = "color-input-wrapper";
|
|
261
303
|
const o = (d) => {
|
|
262
|
-
const g = d.value.split(",").map((
|
|
304
|
+
const g = d.value.split(",").map((N) => parseInt(N.trim()));
|
|
263
305
|
if (g.length !== 3 || g.some(isNaN))
|
|
264
306
|
return d.style.border = "1px solid red", !1;
|
|
265
|
-
const [p, C,
|
|
266
|
-
return d.style.border =
|
|
307
|
+
const [p, C, b] = g, L = p >= 0 && p <= 255 && C >= 0 && C <= 255 && b >= 0 && b <= 255;
|
|
308
|
+
return d.style.border = L ? "" : "1px solid red", L;
|
|
267
309
|
}, a = document.createElement("div");
|
|
268
310
|
a.className = "color-preview", a.style.backgroundColor = this.value ? `rgb(${this.value})` : "";
|
|
269
|
-
const
|
|
311
|
+
const l = this.createInput({
|
|
270
312
|
value: this.value,
|
|
271
313
|
inputType: "text",
|
|
272
314
|
inputClassName: "color-text-input"
|
|
273
|
-
}), c =
|
|
315
|
+
}), c = l.querySelector("input"), r = this.createInput({
|
|
274
316
|
value: this.value ? this.rgbToHex(this.value) : "",
|
|
275
317
|
inputType: this.inputType,
|
|
276
318
|
inputClassName: "color-picker"
|
|
277
|
-
}), u =
|
|
319
|
+
}), u = r.querySelector("input");
|
|
278
320
|
return c.oninput = (d) => {
|
|
279
321
|
var p;
|
|
280
322
|
let g = d.target.value.trim();
|
|
@@ -283,19 +325,19 @@ class H extends y {
|
|
|
283
325
|
var C;
|
|
284
326
|
const g = d.target.value, p = this.hexToRgb(g);
|
|
285
327
|
this.value = p, (C = this.onChange) == null || C.call(this, p), c.value = p, a.style.backgroundColor = `rgb(${p})`;
|
|
286
|
-
},
|
|
328
|
+
}, n.appendChild(a), n.appendChild(r), n.appendChild(l), t.appendChild(e), t.appendChild(n), this.value && (c.value = this.value, u.value = this.rgbToHex(this.value), a.style.backgroundColor = `rgb(${this.value})`), t;
|
|
287
329
|
}
|
|
288
330
|
}
|
|
289
|
-
class
|
|
331
|
+
class v extends m {
|
|
290
332
|
constructor(t = {}) {
|
|
291
333
|
super(t), this.inputType = "number";
|
|
292
334
|
}
|
|
293
335
|
draw() {
|
|
294
|
-
const t = (
|
|
295
|
-
this.props.minValue !== void 0 && (
|
|
336
|
+
const t = (n) => {
|
|
337
|
+
this.props.minValue !== void 0 && (n.min = String(this.props.minValue)), this.props.maxValue !== void 0 && (n.max = String(this.props.maxValue)), this.props.className && n.classList.add(this.props.className), n.addEventListener("input", () => {
|
|
296
338
|
const o = this.props.minValue ?? Number.MIN_SAFE_INTEGER, a = this.props.maxValue ?? Number.MAX_SAFE_INTEGER;
|
|
297
|
-
let
|
|
298
|
-
|
|
339
|
+
let l = Number(n.value);
|
|
340
|
+
l < o && (l = o), l > a && (l = a), n.value = String(l);
|
|
299
341
|
});
|
|
300
342
|
}, e = this.createInput({
|
|
301
343
|
value: this.value,
|
|
@@ -313,22 +355,22 @@ class f extends m {
|
|
|
313
355
|
"input.number-setting-input"
|
|
314
356
|
);
|
|
315
357
|
i && (i.style.paddingRight = "35px");
|
|
316
|
-
const
|
|
317
|
-
return
|
|
358
|
+
const s = document.createElement("span");
|
|
359
|
+
return s.className = "suffix-label", s.textContent = this.props.suffix, e.appendChild(s), e;
|
|
318
360
|
}
|
|
319
361
|
}
|
|
320
|
-
class
|
|
362
|
+
class M extends v {
|
|
321
363
|
constructor(t) {
|
|
322
364
|
super({
|
|
323
365
|
...t,
|
|
324
366
|
minValue: 0,
|
|
325
367
|
maxValue: 100,
|
|
326
|
-
icon: t.icon ||
|
|
368
|
+
icon: t.icon || A,
|
|
327
369
|
title: t.title || "Opacity"
|
|
328
370
|
}), this.inputType = "number";
|
|
329
371
|
}
|
|
330
372
|
}
|
|
331
|
-
const
|
|
373
|
+
const A = `
|
|
332
374
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
333
375
|
<path d="M3.69749 15.365C3.54749 15.365 3.40502 15.305 3.30002 15.2C1.77752 13.6775 0.9375 11.6525 0.9375 9.5C0.9375 5.0525 4.5525 1.4375 9 1.4375C11.1525 1.4375 13.1775 2.2775 14.7 3.8C14.805 3.905 14.865 4.0475 14.865 4.1975C14.865 4.3475 14.805 4.49 14.7 4.595L4.09502 15.2C3.99002 15.305 3.84749 15.365 3.69749 15.365ZM9 2.5625C5.175 2.5625 2.0625 5.675 2.0625 9.5C2.0625 11.165 2.64751 12.74 3.71251 13.9925L13.4925 4.2125C12.24 3.1475 10.665 2.5625 9 2.5625Z" fill="#667085"/>
|
|
334
376
|
<path d="M9.00014 17.5623C6.84764 17.5623 4.82266 16.7223 3.30016 15.1998C3.19516 15.0948 3.13513 14.9523 3.13513 14.8023C3.13513 14.6523 3.19516 14.5098 3.30016 14.4048L13.9051 3.79984C14.1226 3.58234 14.4826 3.58234 14.7001 3.79984C16.2226 5.32234 17.0626 7.34734 17.0626 9.49984C17.0626 13.9473 13.4476 17.5623 9.00014 17.5623ZM4.50764 14.7873C5.76014 15.8523 7.33514 16.4373 9.00014 16.4373C12.8251 16.4373 15.9376 13.3248 15.9376 9.49984C15.9376 7.83484 15.3526 6.25984 14.2876 5.00734L4.50764 14.7873Z" fill="#667085"/>
|
|
@@ -336,12 +378,12 @@ const W = `
|
|
|
336
378
|
<path d="M13.4025 15.5225C13.26 15.5225 13.1175 15.47 13.005 15.3575L8.06999 10.4225C7.85249 10.205 7.85249 9.84498 8.06999 9.62748C8.28749 9.40998 8.64748 9.40998 8.86498 9.62748L13.8 14.5625C14.0175 14.78 14.0175 15.14 13.8 15.3575C13.6875 15.47 13.545 15.5225 13.4025 15.5225Z" fill="#667085"/>
|
|
337
379
|
<path d="M15.84 12.6648C15.6975 12.6648 15.555 12.6123 15.4425 12.4998L10.725 7.78234C10.5075 7.56484 10.5075 7.20484 10.725 6.98734C10.9425 6.76984 11.3025 6.76984 11.52 6.98734L16.2375 11.7048C16.455 11.9223 16.455 12.2823 16.2375 12.4998C16.1325 12.6048 15.99 12.6648 15.84 12.6648Z" fill="#667085"/>
|
|
338
380
|
</svg>
|
|
339
|
-
`,
|
|
381
|
+
`, $ = `
|
|
340
382
|
<svg xmlns="http://www.w3.org/2000/svg" class="svg-select" 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">
|
|
341
383
|
<polyline points="6 9 12 15 18 9"></polyline>
|
|
342
384
|
</svg>
|
|
343
385
|
`;
|
|
344
|
-
class
|
|
386
|
+
class V extends m {
|
|
345
387
|
constructor(t = {}) {
|
|
346
388
|
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.clickOutsideListener = null, t.options && (this._options = [...t.options]), t.getOptions && this._options.push(...t.getOptions()), t.getOptionsAsync && (this.isLoading = !0), this.value !== void 0) {
|
|
347
389
|
const e = this._options.findIndex((i) => i.value === this.value);
|
|
@@ -355,45 +397,45 @@ class O extends m {
|
|
|
355
397
|
draw() {
|
|
356
398
|
const t = document.createElement("div");
|
|
357
399
|
if (t.classList.add("select-container"), this.container = t, this.props.icon || this.props.title) {
|
|
358
|
-
const
|
|
359
|
-
if (
|
|
400
|
+
const n = document.createElement("div");
|
|
401
|
+
if (n.className = "icon-container", this.props.icon) {
|
|
360
402
|
const o = this.createIcon(this.props.icon);
|
|
361
|
-
|
|
403
|
+
n.appendChild(o);
|
|
362
404
|
}
|
|
363
405
|
if (this.props.title) {
|
|
364
406
|
const o = this.createLabel(this.props.title);
|
|
365
|
-
|
|
407
|
+
n.appendChild(o);
|
|
366
408
|
}
|
|
367
|
-
t.appendChild(
|
|
409
|
+
t.appendChild(n);
|
|
368
410
|
} else {
|
|
369
|
-
const
|
|
370
|
-
t.appendChild(
|
|
411
|
+
const n = document.createElement("div");
|
|
412
|
+
t.appendChild(n);
|
|
371
413
|
}
|
|
372
414
|
const e = document.createElement("div");
|
|
373
415
|
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 = () => {
|
|
374
|
-
var
|
|
375
|
-
this.isLoading || (this.isOpen = !this.isOpen, (
|
|
416
|
+
var n, o;
|
|
417
|
+
this.isLoading || (this.isOpen = !this.isOpen, (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (o = this.svgContainer) == null || o.classList.toggle("open", this.isOpen));
|
|
376
418
|
}, t.appendChild(e), this.buttonEl = e;
|
|
377
419
|
const i = document.createElement("ul");
|
|
378
|
-
i.classList.add("select-options"), this._options.forEach((
|
|
379
|
-
const a = this.createOption(
|
|
380
|
-
a.onclick = (
|
|
420
|
+
i.classList.add("select-options"), this._options.forEach((n, o) => {
|
|
421
|
+
const a = this.createOption(n, o);
|
|
422
|
+
a.onclick = (l) => this.selectOption(l, o, e), i.appendChild(a);
|
|
381
423
|
}), t.appendChild(i);
|
|
382
|
-
const
|
|
383
|
-
return
|
|
384
|
-
this._options.push(...
|
|
385
|
-
}).catch((
|
|
386
|
-
console.error("Failed to fetch async options:",
|
|
387
|
-
})), this.clickOutsideListener && document.removeEventListener("click", this.clickOutsideListener), this.clickOutsideListener = (
|
|
424
|
+
const s = document.createElement("div");
|
|
425
|
+
return s.classList.add("svg-container"), s.innerHTML = $, t.appendChild(s), this.optionsListEl = i, this.svgContainer = s, this.props.getOptionsAsync && (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((n) => {
|
|
426
|
+
this._options.push(...n), this.isLoading = !1, this.updateOptionsList(), this.updateButtonText();
|
|
427
|
+
}).catch((n) => {
|
|
428
|
+
console.error("Failed to fetch async options:", n), this.isLoading = !1, this.updateButtonText("Failed to load options");
|
|
429
|
+
})), this.clickOutsideListener && document.removeEventListener("click", this.clickOutsideListener), this.clickOutsideListener = (n) => {
|
|
388
430
|
var o, a;
|
|
389
|
-
this.isOpen && !t.contains(
|
|
431
|
+
this.isOpen && !t.contains(n.target) && (this.isOpen = !1, (o = this.optionsListEl) == null || o.classList.remove("open"), (a = this.svgContainer) == null || a.classList.remove("open"));
|
|
390
432
|
}, document.addEventListener("click", this.clickOutsideListener), t;
|
|
391
433
|
}
|
|
392
434
|
selectOption(t, e, i) {
|
|
393
|
-
var
|
|
394
|
-
const
|
|
395
|
-
|
|
396
|
-
|
|
435
|
+
var n, o, a;
|
|
436
|
+
const s = this._options[e];
|
|
437
|
+
s && (this.value = s.value, (n = this.onChange) == null || n.call(this, this.value), this.selectedOptionIndex = e, this.isOpen = !1, i.textContent = s.name, (o = this.optionsListEl) == null || o.classList.remove("open"), (a = this.svgContainer) == null || a.classList.remove("open"), this.optionsListEl && this.optionsListEl.querySelectorAll(".select-option").forEach((c, r) => {
|
|
438
|
+
r === e ? c.classList.add("selected") : c.classList.remove("selected");
|
|
397
439
|
}));
|
|
398
440
|
}
|
|
399
441
|
updateOptionsList() {
|
|
@@ -405,8 +447,8 @@ class O extends m {
|
|
|
405
447
|
}
|
|
406
448
|
this._options.forEach((t, e) => {
|
|
407
449
|
const i = this.createOption(t, e);
|
|
408
|
-
i.onclick = (
|
|
409
|
-
this.buttonEl && this.selectOption(
|
|
450
|
+
i.onclick = (s) => {
|
|
451
|
+
this.buttonEl && this.selectOption(s, e, this.buttonEl);
|
|
410
452
|
}, this.optionsListEl.appendChild(i);
|
|
411
453
|
});
|
|
412
454
|
}
|
|
@@ -469,16 +511,16 @@ class _ extends m {
|
|
|
469
511
|
</svg>
|
|
470
512
|
`
|
|
471
513
|
}
|
|
472
|
-
].forEach((
|
|
514
|
+
].forEach((n) => {
|
|
473
515
|
const o = document.createElement("button");
|
|
474
|
-
o.className = "align-option-button", o.innerHTML =
|
|
516
|
+
o.className = "align-option-button", o.innerHTML = n.icon, this.value === n.name && o.classList.add("selected"), o.addEventListener("click", () => {
|
|
475
517
|
var a;
|
|
476
|
-
i.querySelectorAll(".align-option-button").forEach((
|
|
518
|
+
i.querySelectorAll(".align-option-button").forEach((l) => l.classList.remove("selected")), o.classList.add("selected"), this.value = n.name, (a = this.onChange) == null || a.call(this, this.value);
|
|
477
519
|
}), i.appendChild(o);
|
|
478
520
|
}), t.appendChild(i), t;
|
|
479
521
|
}
|
|
480
522
|
}
|
|
481
|
-
class
|
|
523
|
+
class nt extends m {
|
|
482
524
|
constructor(t) {
|
|
483
525
|
super(t), this.inputType = "button";
|
|
484
526
|
}
|
|
@@ -491,21 +533,21 @@ class st extends m {
|
|
|
491
533
|
return e.className = "button-setting-wrapper " + (this.props.wrapperClassName || ""), e.appendChild(t), e;
|
|
492
534
|
}
|
|
493
535
|
}
|
|
494
|
-
class
|
|
536
|
+
class ot extends m {
|
|
495
537
|
constructor(t = {}) {
|
|
496
538
|
super(t), this.inputType = { width: "number", height: "number" }, this.aspectRatio = 1, this.isUpdating = !1;
|
|
497
539
|
const e = t.width || 100, i = t.height || 100;
|
|
498
540
|
this.value || (this.value = {
|
|
499
541
|
width: e,
|
|
500
542
|
height: i
|
|
501
|
-
}), this.minWidth = Math.max(1, t.minWidth || 1), this.maxWidth = t.maxWidth, this.minHeight = Math.max(1, t.minHeight || 1), this.maxHeight = t.maxHeight, this.locked = t.locked ?? !1, (!this.value.width || this.value.width < 1) && (this.value.width = 1), (!this.value.height || this.value.height < 1) && (this.value.height = 1), this.value.height > 0 && (this.aspectRatio = this.value.width / this.value.height), this.widthSetting = new
|
|
543
|
+
}), this.minWidth = Math.max(1, t.minWidth || 1), this.maxWidth = t.maxWidth, this.minHeight = Math.max(1, t.minHeight || 1), this.maxHeight = t.maxHeight, this.locked = t.locked ?? !1, (!this.value.width || this.value.width < 1) && (this.value.width = 1), (!this.value.height || this.value.height < 1) && (this.value.height = 1), this.value.height > 0 && (this.aspectRatio = this.value.width / this.value.height), this.widthSetting = new v({
|
|
502
544
|
title: "Width",
|
|
503
545
|
default: this.value.width,
|
|
504
546
|
suffix: "px",
|
|
505
547
|
minValue: this.minWidth,
|
|
506
548
|
maxValue: this.maxWidth,
|
|
507
|
-
icon:
|
|
508
|
-
}), this.heightSetting = new
|
|
549
|
+
icon: j
|
|
550
|
+
}), this.heightSetting = new v({
|
|
509
551
|
title: "Height",
|
|
510
552
|
default: this.value.height,
|
|
511
553
|
suffix: "px",
|
|
@@ -538,8 +580,8 @@ class nt extends m {
|
|
|
538
580
|
}
|
|
539
581
|
toggleLock(t) {
|
|
540
582
|
if (this.locked = !this.locked, this.locked && this.value) {
|
|
541
|
-
const { width: i, height:
|
|
542
|
-
|
|
583
|
+
const { width: i, height: s } = this.value;
|
|
584
|
+
s > 0 && (this.aspectRatio = i / s);
|
|
543
585
|
}
|
|
544
586
|
t.innerHTML = this.getLockSVG(this.locked), t.setAttribute("aria-pressed", String(this.locked)), t.title = this.locked ? "Unlock aspect ratio" : "Lock aspect ratio";
|
|
545
587
|
const e = t.closest(".dimension-setting-container");
|
|
@@ -573,15 +615,15 @@ class nt extends m {
|
|
|
573
615
|
draw() {
|
|
574
616
|
const t = document.createElement("div");
|
|
575
617
|
t.className = "dimension-setting-container", this.locked && t.classList.add("aspect-locked");
|
|
576
|
-
const e = this.widthSetting.draw(), i = this.heightSetting.draw(),
|
|
577
|
-
|
|
578
|
-
const
|
|
579
|
-
return
|
|
618
|
+
const e = this.widthSetting.draw(), i = this.heightSetting.draw(), s = document.createElement("div");
|
|
619
|
+
s.className = "dimension-bracket";
|
|
620
|
+
const n = document.createElement("button");
|
|
621
|
+
return n.className = "dimension-lock-icon", n.setAttribute("type", "button"), n.setAttribute("aria-pressed", String(this.locked)), n.setAttribute(
|
|
580
622
|
"aria-label",
|
|
581
623
|
this.locked ? "Unlock aspect ratio" : "Lock aspect ratio"
|
|
582
|
-
),
|
|
583
|
-
o.preventDefault(), this.toggleLock(
|
|
584
|
-
},
|
|
624
|
+
), n.title = this.locked ? "Unlock aspect ratio" : "Lock aspect ratio", n.innerHTML = this.getLockSVG(this.locked), n.onclick = (o) => {
|
|
625
|
+
o.preventDefault(), this.toggleLock(n);
|
|
626
|
+
}, s.appendChild(n), t.appendChild(e), t.appendChild(s), t.appendChild(i), t;
|
|
585
627
|
}
|
|
586
628
|
isLocked() {
|
|
587
629
|
return this.locked;
|
|
@@ -589,8 +631,8 @@ class nt extends m {
|
|
|
589
631
|
setLocked(t) {
|
|
590
632
|
if (this.locked !== t) {
|
|
591
633
|
if (this.locked = t, this.locked && this.value) {
|
|
592
|
-
const { width: i, height:
|
|
593
|
-
|
|
634
|
+
const { width: i, height: s } = this.value;
|
|
635
|
+
s > 0 && (this.aspectRatio = i / s);
|
|
594
636
|
}
|
|
595
637
|
const e = document.querySelector(
|
|
596
638
|
".dimension-setting-container .dimension-lock-icon"
|
|
@@ -603,38 +645,38 @@ class nt extends m {
|
|
|
603
645
|
}
|
|
604
646
|
}
|
|
605
647
|
}
|
|
606
|
-
const
|
|
648
|
+
const j = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
607
649
|
<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"/>
|
|
608
650
|
</svg>`, G = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
609
651
|
<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"/>
|
|
610
|
-
</svg>`,
|
|
652
|
+
</svg>`, y = `
|
|
611
653
|
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="16" viewBox="0 0 15 16" fill="none">
|
|
612
654
|
<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"/>
|
|
613
655
|
</svg>
|
|
614
|
-
`,
|
|
656
|
+
`, T = `
|
|
615
657
|
<svg width="91" height="71" viewBox="0 0 91 71" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
616
658
|
<rect width="91" height="71" rx="4" fill="#F2F4F7"/>
|
|
617
659
|
<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"/>
|
|
618
660
|
</svg>
|
|
619
|
-
`,
|
|
661
|
+
`, q = `
|
|
620
662
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 12 12" fill="none">
|
|
621
663
|
<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"/>
|
|
622
664
|
</svg>
|
|
623
665
|
`;
|
|
624
|
-
class
|
|
666
|
+
class F extends m {
|
|
625
667
|
constructor(t = {}) {
|
|
626
668
|
super(t), this.inputType = "button", this.previewWrapper = null, this.previewEl = null, this.emptyStateEl = null, !this.value && t.defaultUrl && t.defaultUrl !== "" && (this.value = t.defaultUrl);
|
|
627
669
|
}
|
|
628
670
|
updatePreviewState(t = null) {
|
|
629
671
|
if (!this.previewWrapper || !this.previewEl || !this.emptyStateEl) return;
|
|
630
|
-
const e = this.previewWrapper.parentElement, i = e == null ? void 0 : e.querySelector(".upload-button"),
|
|
672
|
+
const e = this.previewWrapper.parentElement, i = e == null ? void 0 : e.querySelector(".upload-button"), s = e == null ? void 0 : e.querySelector(
|
|
631
673
|
".preview-placeholder"
|
|
632
674
|
);
|
|
633
|
-
t && t !== "" ? (this.previewWrapper.classList.add("has-image"), this.previewEl.src = t, this.previewWrapper.style.display = "block",
|
|
634
|
-
<span class="upload-icon">${
|
|
675
|
+
t && t !== "" ? (this.previewWrapper.classList.add("has-image"), this.previewEl.src = t, this.previewWrapper.style.display = "block", s && s instanceof HTMLElement && (s.style.display = "none"), e && e.classList.remove("no-image"), i && (i.innerHTML = `
|
|
676
|
+
<span class="upload-icon">${y}</span>
|
|
635
677
|
<span class="upload-label">Replace</span>
|
|
636
|
-
`)) : (this.previewWrapper.classList.remove("has-image"), this.previewEl.src = "", this.previewWrapper.style.display = "none",
|
|
637
|
-
<span class="upload-icon">${
|
|
678
|
+
`)) : (this.previewWrapper.classList.remove("has-image"), this.previewEl.src = "", this.previewWrapper.style.display = "none", s && s instanceof HTMLElement && (s.style.display = "none"), i && (i.innerHTML = `
|
|
679
|
+
<span class="upload-icon">${y}</span>
|
|
638
680
|
<span class="upload-label">Upload</span>
|
|
639
681
|
`));
|
|
640
682
|
}
|
|
@@ -645,37 +687,37 @@ class q extends m {
|
|
|
645
687
|
if (e || t.classList.add("no-label"), e) {
|
|
646
688
|
const c = document.createElement("div");
|
|
647
689
|
if (c.className = "icon-title-container", this.props.icon) {
|
|
648
|
-
const
|
|
649
|
-
c.appendChild(
|
|
690
|
+
const r = this.createIcon(this.props.icon);
|
|
691
|
+
c.appendChild(r);
|
|
650
692
|
}
|
|
651
693
|
if (this.props.title) {
|
|
652
|
-
const
|
|
653
|
-
c.appendChild(
|
|
694
|
+
const r = this.createLabel(this.props.title);
|
|
695
|
+
c.appendChild(r);
|
|
654
696
|
}
|
|
655
697
|
t.appendChild(c);
|
|
656
698
|
}
|
|
657
699
|
const i = document.createElement("div");
|
|
658
700
|
i.className = "preview-button-container";
|
|
659
|
-
const
|
|
660
|
-
|
|
661
|
-
const
|
|
662
|
-
|
|
701
|
+
const s = this.value && this.value !== "";
|
|
702
|
+
s || i.classList.add("no-image");
|
|
703
|
+
const n = document.createElement("div");
|
|
704
|
+
n.className = "preview-placeholder", n.innerHTML = T, this.previewWrapper = document.createElement("div"), this.previewWrapper.className = "preview-wrapper", this.emptyStateEl = document.createElement("div"), this.emptyStateEl.className = "empty-state", this.emptyStateEl.innerHTML = T, this.previewEl = document.createElement("img"), this.previewEl.className = "upload-preview";
|
|
663
705
|
const o = document.createElement("button");
|
|
664
|
-
o.className = "delete-button", o.type = "button", o.title = "Delete image", o.innerHTML =
|
|
706
|
+
o.className = "delete-button", o.type = "button", o.title = "Delete image", o.innerHTML = q, this.previewWrapper.appendChild(this.emptyStateEl), this.previewWrapper.appendChild(this.previewEl), this.previewWrapper.appendChild(o);
|
|
665
707
|
const a = document.createElement("button");
|
|
666
708
|
a.className = "upload-button", a.innerHTML = `
|
|
667
|
-
<span class="upload-icon">${
|
|
709
|
+
<span class="upload-icon">${y}</span>
|
|
668
710
|
<span class="upload-label">Upload</span>
|
|
669
711
|
`;
|
|
670
|
-
const
|
|
671
|
-
return
|
|
672
|
-
var
|
|
673
|
-
c.stopPropagation(), this.value = "", this.updatePreviewState(null), (
|
|
712
|
+
const l = document.createElement("input");
|
|
713
|
+
return l.type = "file", l.accept = "image/*", l.style.display = "none", i.appendChild(n), i.appendChild(this.previewWrapper), i.appendChild(a), t.appendChild(i), t.appendChild(l), s ? this.updatePreviewState(this.value) : this.updatePreviewState(null), o.onclick = (c) => {
|
|
714
|
+
var r;
|
|
715
|
+
c.stopPropagation(), this.value = "", this.updatePreviewState(null), (r = this.onChange) == null || r.call(this, "");
|
|
674
716
|
}, a.onclick = () => {
|
|
675
|
-
|
|
676
|
-
},
|
|
677
|
-
var
|
|
678
|
-
const c = (
|
|
717
|
+
l.click();
|
|
718
|
+
}, l.onchange = async () => {
|
|
719
|
+
var r, u, d;
|
|
720
|
+
const c = (r = l.files) == null ? void 0 : r[0];
|
|
679
721
|
if (c)
|
|
680
722
|
try {
|
|
681
723
|
a.classList.add("loading"), a.disabled = !0;
|
|
@@ -684,15 +726,15 @@ class q extends m {
|
|
|
684
726
|
const C = this.props.uploadUrl;
|
|
685
727
|
if (!C)
|
|
686
728
|
throw new Error("No uploadUrl provided to UploadSetting.");
|
|
687
|
-
const
|
|
688
|
-
method:
|
|
729
|
+
const b = this.props.requestMethod || "POST", L = { ...this.props.requestHeaders || {} }, E = await (await fetch(C, {
|
|
730
|
+
method: b,
|
|
689
731
|
body: g,
|
|
690
|
-
headers:
|
|
732
|
+
headers: L
|
|
691
733
|
})).json();
|
|
692
734
|
let w;
|
|
693
735
|
if (this.props.parseResponse)
|
|
694
|
-
w = this.props.parseResponse(
|
|
695
|
-
else if (w = (u =
|
|
736
|
+
w = this.props.parseResponse(E);
|
|
737
|
+
else if (w = (u = E == null ? void 0 : E.data) == null ? void 0 : u.url, !w)
|
|
696
738
|
throw new Error(
|
|
697
739
|
"No URL found in response. Provide a parseResponse if needed."
|
|
698
740
|
);
|
|
@@ -705,15 +747,15 @@ class q extends m {
|
|
|
705
747
|
}, t;
|
|
706
748
|
}
|
|
707
749
|
}
|
|
708
|
-
class
|
|
750
|
+
class at extends m {
|
|
709
751
|
constructor(t = {}) {
|
|
710
|
-
super(t), this.inputType = "number", this.value = this.value ?? 100, this.numberSetting = new
|
|
752
|
+
super(t), this.inputType = "number", this.value = this.value ?? 100, this.numberSetting = new v({
|
|
711
753
|
title: "Height",
|
|
712
754
|
default: this.value,
|
|
713
755
|
suffix: "px",
|
|
714
756
|
minValue: t.minHeight ?? 1,
|
|
715
757
|
maxValue: t.maxHeight,
|
|
716
|
-
icon:
|
|
758
|
+
icon: z
|
|
717
759
|
}), this.numberSetting.setOnChange((e) => {
|
|
718
760
|
var i;
|
|
719
761
|
isNaN(e) || e < 1 || (this.value = e, (i = this.onChange) == null || i.call(this, this.value));
|
|
@@ -723,18 +765,18 @@ class ot extends m {
|
|
|
723
765
|
return this.numberSetting.draw();
|
|
724
766
|
}
|
|
725
767
|
}
|
|
726
|
-
const
|
|
768
|
+
const z = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
727
769
|
<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"/>
|
|
728
770
|
</svg>`;
|
|
729
|
-
class
|
|
771
|
+
class lt extends m {
|
|
730
772
|
constructor(t = {}) {
|
|
731
|
-
super(t), this.inputType = "number", this.value = this.value ?? 100, this.numberSetting = new
|
|
773
|
+
super(t), this.inputType = "number", this.value = this.value ?? 100, this.numberSetting = new v({
|
|
732
774
|
title: "Width",
|
|
733
775
|
default: this.value,
|
|
734
776
|
suffix: "px",
|
|
735
777
|
minValue: t.minWidth ?? 0,
|
|
736
778
|
maxValue: t.maxWidth,
|
|
737
|
-
icon:
|
|
779
|
+
icon: U
|
|
738
780
|
}), this.numberSetting.setOnChange((e) => {
|
|
739
781
|
var i;
|
|
740
782
|
isNaN(e) || e < 1 || (this.value = e, (i = this.onChange) == null || i.call(this, this.value));
|
|
@@ -744,18 +786,18 @@ class at extends m {
|
|
|
744
786
|
return this.numberSetting.draw();
|
|
745
787
|
}
|
|
746
788
|
}
|
|
747
|
-
const
|
|
789
|
+
const U = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
748
790
|
<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"/>
|
|
749
|
-
</svg>`,
|
|
791
|
+
</svg>`, Z = `
|
|
750
792
|
<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">
|
|
751
793
|
<polyline points="6 9 12 15 18 9"></polyline>
|
|
752
794
|
</svg>
|
|
753
795
|
`;
|
|
754
|
-
class
|
|
796
|
+
class rt extends m {
|
|
755
797
|
constructor(t = {}) {
|
|
756
798
|
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.initializeOptions(t), t.default !== void 0 && (this.value = t.default, this.selectedOptionIndex = this._options.findIndex(
|
|
757
799
|
(e) => JSON.stringify(e.value) === JSON.stringify(t.default)
|
|
758
|
-
));
|
|
800
|
+
)), t.onChange && this.setOnChange(t.onChange);
|
|
759
801
|
}
|
|
760
802
|
initializeOptions(t) {
|
|
761
803
|
this.hasInitializedOptions || (this._options = [], t.options && (this._options = [...t.options]), t.getOptions && this._options.push(...t.getOptions()), t.getOptionsAsync ? (this.isLoading = !0, t.default !== void 0 && (this.value = t.default)) : t.default !== void 0 && (this.selectedOptionIndex = this._options.findIndex(
|
|
@@ -765,8 +807,8 @@ class lt extends m {
|
|
|
765
807
|
createOption(t, e) {
|
|
766
808
|
const i = document.createElement("li");
|
|
767
809
|
i.classList.add("select-api-option"), i.textContent = t.name, i.dataset.index = String(e);
|
|
768
|
-
const
|
|
769
|
-
return
|
|
810
|
+
const s = document.createElement("input");
|
|
811
|
+
return s.type = "radio", s.classList.add("select-api-radio"), s.name = "select-api-radio-group", i.appendChild(s), this.selectedOptionIndex === e && (s.checked = !0), i;
|
|
770
812
|
}
|
|
771
813
|
draw() {
|
|
772
814
|
const t = document.createElement("div");
|
|
@@ -774,48 +816,51 @@ class lt extends m {
|
|
|
774
816
|
const e = document.createElement("div");
|
|
775
817
|
if (e.classList.add("select-api-button"), this.props.title) {
|
|
776
818
|
e.classList.add("has-label");
|
|
777
|
-
const
|
|
778
|
-
|
|
819
|
+
const n = document.createElement("div");
|
|
820
|
+
n.className = "select-label", n.textContent = this.props.title, e.appendChild(n);
|
|
779
821
|
const o = document.createElement("span");
|
|
780
822
|
o.className = "select-value", this.isLoading ? o.textContent = this.props.loadingText || "Loading options..." : o.textContent = this.selectedOptionIndex !== null ? this._options[this.selectedOptionIndex].name : "Select an option", e.appendChild(o);
|
|
781
823
|
} else
|
|
782
824
|
this.isLoading ? e.textContent = this.props.loadingText || "Loading options..." : e.textContent = this.selectedOptionIndex !== null ? this._options[this.selectedOptionIndex].name : "Select an option";
|
|
783
825
|
e.onclick = () => {
|
|
784
|
-
var
|
|
785
|
-
this.isLoading || (this.isOpen = !this.isOpen, (
|
|
826
|
+
var n, o;
|
|
827
|
+
this.isLoading || (this.isOpen = !this.isOpen, (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (o = this.svgContainer) == null || o.classList.toggle("open", this.isOpen));
|
|
786
828
|
}, t.appendChild(e), this.buttonEl = e;
|
|
787
829
|
const i = document.createElement("ul");
|
|
788
|
-
i.classList.add("select-api-options"), this._options.forEach((
|
|
789
|
-
const a = this.createOption(
|
|
790
|
-
a.onclick = (
|
|
830
|
+
i.classList.add("select-api-options"), this._options.forEach((n, o) => {
|
|
831
|
+
const a = this.createOption(n, o);
|
|
832
|
+
a.onclick = (l) => this.selectApiOption(l, o, e), i.appendChild(a);
|
|
791
833
|
}), t.appendChild(i);
|
|
792
|
-
const
|
|
793
|
-
return
|
|
794
|
-
var
|
|
795
|
-
this.isLoading || (this.isOpen = !this.isOpen, (
|
|
796
|
-
}, this.optionsListEl = i, this.svgContainer =
|
|
797
|
-
this._options.push(...
|
|
834
|
+
const s = document.createElement("div");
|
|
835
|
+
return s.classList.add("svg-container"), s.innerHTML = Z, t.appendChild(s), s.onclick = () => {
|
|
836
|
+
var n, o;
|
|
837
|
+
this.isLoading || (this.isOpen = !this.isOpen, (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (o = this.svgContainer) == null || o.classList.toggle("open", this.isOpen));
|
|
838
|
+
}, this.optionsListEl = i, this.svgContainer = s, this.props.getOptionsAsync && !this.hasInitializedOptions ? (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((n) => {
|
|
839
|
+
this._options.push(...n), this.isLoading = !1, this.value !== void 0 && this.selectedOptionIndex === null && (this.selectedOptionIndex = this._options.findIndex(
|
|
798
840
|
(o) => JSON.stringify(o.value) === JSON.stringify(this.value)
|
|
799
841
|
)), this.updateOptionsList(), this.updateButtonText();
|
|
800
|
-
}).catch((
|
|
801
|
-
console.error("Failed to fetch async options:",
|
|
802
|
-
})) : this.props.getOptionsAsync && this._options.length <= 1 && (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((
|
|
803
|
-
const o = new Set(this._options.map((
|
|
842
|
+
}).catch((n) => {
|
|
843
|
+
console.error("Failed to fetch async options:", n), this.isLoading = !1, this.updateButtonText("Failed to load options");
|
|
844
|
+
})) : this.props.getOptionsAsync && this._options.length <= 1 && (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((n) => {
|
|
845
|
+
const o = new Set(this._options.map((l) => JSON.stringify(l.value))), a = n.filter((l) => !o.has(JSON.stringify(l.value)));
|
|
804
846
|
this._options.push(...a), this.isLoading = !1, this.value !== void 0 && this.selectedOptionIndex === null && (this.selectedOptionIndex = this._options.findIndex(
|
|
805
|
-
(
|
|
847
|
+
(l) => JSON.stringify(l.value) === JSON.stringify(this.value)
|
|
806
848
|
)), this.updateOptionsList(), this.updateButtonText();
|
|
807
|
-
}).catch((
|
|
808
|
-
console.error("Failed to fetch async options:",
|
|
849
|
+
}).catch((n) => {
|
|
850
|
+
console.error("Failed to fetch async options:", n), this.isLoading = !1, this.updateButtonText("Failed to load options");
|
|
809
851
|
})), t;
|
|
810
852
|
}
|
|
811
853
|
selectApiOption(t, e, i) {
|
|
812
|
-
var
|
|
813
|
-
const
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
854
|
+
var n, o;
|
|
855
|
+
const s = this._options[e];
|
|
856
|
+
if (s) {
|
|
857
|
+
const a = s.value;
|
|
858
|
+
this.value = a, this.onChange && this.onChange(a), this.selectedOptionIndex = e, this.isOpen = !1, this.updateButtonText(), (n = this.optionsListEl) == null || n.classList.remove("open"), (o = this.svgContainer) == null || o.classList.remove("open"), this.optionsListEl && this.optionsListEl.querySelectorAll(
|
|
859
|
+
".select-api-radio"
|
|
860
|
+
).forEach((c, r) => {
|
|
861
|
+
c.checked = r === e;
|
|
862
|
+
});
|
|
863
|
+
}
|
|
819
864
|
}
|
|
820
865
|
updateOptionsList() {
|
|
821
866
|
if (this.optionsListEl) {
|
|
@@ -826,47 +871,47 @@ class lt extends m {
|
|
|
826
871
|
}
|
|
827
872
|
this._options.forEach((t, e) => {
|
|
828
873
|
const i = this.createOption(t, e);
|
|
829
|
-
this.selectedOptionIndex === e && i.classList.add("selected"), i.onclick = (
|
|
830
|
-
this.buttonEl && this.selectApiOption(
|
|
831
|
-
}, i.tabIndex = 0, i.addEventListener("keydown", (
|
|
832
|
-
(
|
|
874
|
+
this.selectedOptionIndex === e && i.classList.add("selected"), i.onclick = (s) => {
|
|
875
|
+
this.buttonEl && this.selectApiOption(s, e, this.buttonEl);
|
|
876
|
+
}, i.tabIndex = 0, i.addEventListener("keydown", (s) => {
|
|
877
|
+
(s.key === "Enter" || s.key === " ") && (s.preventDefault(), this.buttonEl && this.selectApiOption(s, e, this.buttonEl));
|
|
833
878
|
}), this.optionsListEl.appendChild(i);
|
|
834
879
|
});
|
|
835
880
|
}
|
|
836
881
|
}
|
|
837
882
|
updateButtonText(t) {
|
|
838
883
|
if (!this.buttonEl) return;
|
|
839
|
-
const e = this.buttonEl.querySelector(".select-value"), i = this.buttonEl.classList.contains("has-label"),
|
|
884
|
+
const e = this.buttonEl.querySelector(".select-value"), i = this.buttonEl.classList.contains("has-label"), s = this.buttonEl.querySelector(".select-label");
|
|
840
885
|
if (this.isLoading) {
|
|
841
886
|
this.buttonEl.classList.add("loading");
|
|
842
887
|
const o = this.props.loadingText || "Loading options...";
|
|
843
888
|
if (e)
|
|
844
889
|
e.textContent = o;
|
|
845
|
-
else if (i && this.props.title && !
|
|
890
|
+
else if (i && this.props.title && !s) {
|
|
846
891
|
this.buttonEl.innerHTML = "";
|
|
847
892
|
const a = document.createElement("div");
|
|
848
893
|
a.className = "select-label", a.textContent = this.props.title, this.buttonEl.appendChild(a);
|
|
849
|
-
const
|
|
850
|
-
|
|
894
|
+
const l = document.createElement("span");
|
|
895
|
+
l.className = "select-value", l.textContent = o, this.buttonEl.appendChild(l);
|
|
851
896
|
} else
|
|
852
897
|
this.buttonEl.textContent = o;
|
|
853
898
|
return;
|
|
854
899
|
}
|
|
855
900
|
this.buttonEl.classList.remove("loading", "error");
|
|
856
|
-
let
|
|
857
|
-
if (t ? ((t.includes("Failed") || t.includes("Error")) && this.buttonEl.classList.add("error"),
|
|
858
|
-
e.textContent =
|
|
859
|
-
else if (i && this.props.title && !
|
|
901
|
+
let n;
|
|
902
|
+
if (t ? ((t.includes("Failed") || t.includes("Error")) && this.buttonEl.classList.add("error"), n = t) : this.selectedOptionIndex !== null && this._options[this.selectedOptionIndex] ? n = this._options[this.selectedOptionIndex].name : n = "Select an option", e)
|
|
903
|
+
e.textContent = n;
|
|
904
|
+
else if (i && this.props.title && !s) {
|
|
860
905
|
this.buttonEl.innerHTML = "";
|
|
861
906
|
const o = document.createElement("div");
|
|
862
907
|
o.className = "select-label", o.textContent = this.props.title, this.buttonEl.appendChild(o);
|
|
863
908
|
const a = document.createElement("span");
|
|
864
|
-
a.className = "select-value", a.textContent =
|
|
909
|
+
a.className = "select-value", a.textContent = n, this.buttonEl.appendChild(a);
|
|
865
910
|
} else
|
|
866
|
-
this.buttonEl.textContent =
|
|
911
|
+
this.buttonEl.textContent = n;
|
|
867
912
|
}
|
|
868
913
|
}
|
|
869
|
-
class
|
|
914
|
+
class ht extends m {
|
|
870
915
|
constructor(t) {
|
|
871
916
|
super(t), this.inputType = "text", this.value = t.default ?? !1;
|
|
872
917
|
}
|
|
@@ -885,18 +930,18 @@ class rt extends m {
|
|
|
885
930
|
t.appendChild(e);
|
|
886
931
|
const i = document.createElement("label");
|
|
887
932
|
i.className = "toggle-switch";
|
|
888
|
-
const
|
|
889
|
-
|
|
890
|
-
this.value =
|
|
933
|
+
const s = document.createElement("input");
|
|
934
|
+
s.type = "checkbox", s.checked = this.value ?? !1, s.addEventListener("change", () => {
|
|
935
|
+
this.value = s.checked, this.onChange && this.onChange(this.value);
|
|
891
936
|
});
|
|
892
|
-
const
|
|
893
|
-
return
|
|
937
|
+
const n = document.createElement("span");
|
|
938
|
+
return n.className = "toggle-slider", i.appendChild(s), i.appendChild(n), t.appendChild(i), t;
|
|
894
939
|
}
|
|
895
940
|
}
|
|
896
|
-
const
|
|
941
|
+
const D = `<svg width="16" height="15" viewBox="0 0 16 15" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
897
942
|
<path d="M1.25 7.5H1.2575M4.625 7.5H4.6325M11.375 7.5H11.3825M8 7.5H8.0075M14.75 7.5H14.7575M14.75 14.25V13.65C14.75 12.8099 14.75 12.3899 14.5865 12.069C14.4427 11.7868 14.2132 11.5573 13.931 11.4135C13.6101 11.25 13.1901 11.25 12.35 11.25H3.65C2.80992 11.25 2.38988 11.25 2.06901 11.4135C1.78677 11.5573 1.5573 11.7868 1.41349 12.069C1.25 12.3899 1.25 12.8099 1.25 13.65V14.25M14.75 0.75V1.35C14.75 2.19008 14.75 2.61012 14.5865 2.93099C14.4427 3.21323 14.2132 3.4427 13.931 3.58651C13.6101 3.75 13.1901 3.75 12.35 3.75H3.65C2.80992 3.75 2.38988 3.75 2.06901 3.58651C1.78677 3.4427 1.5573 3.21323 1.41349 2.93099C1.25 2.61012 1.25 2.19008 1.25 1.35V0.75" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
898
943
|
</svg>`;
|
|
899
|
-
class
|
|
944
|
+
class ct extends m {
|
|
900
945
|
constructor(t = {}) {
|
|
901
946
|
super(t), this.inputType = "number", this.inputValues = {};
|
|
902
947
|
}
|
|
@@ -930,12 +975,12 @@ class ht extends m {
|
|
|
930
975
|
createGapInput(t, e) {
|
|
931
976
|
const i = document.createElement("div");
|
|
932
977
|
i.classList.add("gap-input-wrapper");
|
|
933
|
-
const n = document.createElement("div");
|
|
934
|
-
n.classList.add("gap-label-container");
|
|
935
978
|
const s = document.createElement("div");
|
|
936
|
-
s.classList.add("gap-
|
|
979
|
+
s.classList.add("gap-label-container");
|
|
980
|
+
const n = document.createElement("div");
|
|
981
|
+
n.classList.add("gap-setting-icon"), n.innerHTML = this.props.icon || D, s.appendChild(n);
|
|
937
982
|
const o = document.createElement("label");
|
|
938
|
-
o.classList.add("gap-input-label"), o.textContent = t,
|
|
983
|
+
o.classList.add("gap-input-label"), o.textContent = t, s.appendChild(o), i.appendChild(s);
|
|
939
984
|
const a = (u) => {
|
|
940
985
|
this.props.minValue !== void 0 && (u.min = String(this.props.minValue)), this.props.maxValue !== void 0 && (u.max = String(this.props.maxValue)), this.props.className && u.classList.add(this.props.className), u.addEventListener("input", () => {
|
|
941
986
|
var C;
|
|
@@ -943,7 +988,7 @@ class ht extends m {
|
|
|
943
988
|
let p = Number(u.value);
|
|
944
989
|
p < d && (p = d), p > g && (p = g), u.value = String(p), this.value = p, this.inputValues[t] = p, console.log(`Gap Setting (${t}): ${p}${this.props.suffix || ""}`), (C = this.onChange) == null || C.call(this, p);
|
|
945
990
|
});
|
|
946
|
-
},
|
|
991
|
+
}, l = this.createInput({
|
|
947
992
|
value: e,
|
|
948
993
|
inputType: this.inputType,
|
|
949
994
|
inputClassName: "gap-setting-input " + (this.props.inputClassName || ""),
|
|
@@ -951,47 +996,47 @@ class ht extends m {
|
|
|
951
996
|
inputCustomizer: a
|
|
952
997
|
});
|
|
953
998
|
if (!this.props.suffix || this.props.suffix === "none")
|
|
954
|
-
return i.appendChild(
|
|
955
|
-
|
|
956
|
-
const c =
|
|
999
|
+
return i.appendChild(l), i;
|
|
1000
|
+
l.classList.add("suffix-wrapper");
|
|
1001
|
+
const c = l.querySelector("input.gap-setting-input");
|
|
957
1002
|
c && (c.style.paddingRight = "35px");
|
|
958
|
-
const
|
|
959
|
-
return
|
|
1003
|
+
const r = document.createElement("span");
|
|
1004
|
+
return r.className = "suffix-label", r.textContent = this.props.suffix, l.appendChild(r), i.appendChild(l), i;
|
|
960
1005
|
}
|
|
961
1006
|
}
|
|
962
|
-
const
|
|
1007
|
+
const J = `
|
|
963
1008
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
964
1009
|
<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"/>
|
|
965
1010
|
</svg>
|
|
966
|
-
`,
|
|
1011
|
+
`, P = `
|
|
967
1012
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
968
1013
|
<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"/>
|
|
969
1014
|
</svg>
|
|
970
1015
|
`;
|
|
971
|
-
class
|
|
1016
|
+
class dt extends f {
|
|
972
1017
|
constructor(t) {
|
|
973
1018
|
super({
|
|
974
1019
|
title: "Border",
|
|
975
1020
|
collapsed: t == null ? void 0 : t.collapsed,
|
|
976
1021
|
hideCondition: t == null ? void 0 : t.hideCondition,
|
|
977
1022
|
settings: {
|
|
978
|
-
size: new
|
|
1023
|
+
size: new v({
|
|
979
1024
|
title: "Size",
|
|
980
|
-
icon:
|
|
1025
|
+
icon: P,
|
|
981
1026
|
default: (t == null ? void 0 : t.size) ?? 0,
|
|
982
1027
|
suffix: "px"
|
|
983
1028
|
}),
|
|
984
|
-
color: new
|
|
1029
|
+
color: new S({
|
|
985
1030
|
default: (t == null ? void 0 : t.color) ?? "0, 0, 30"
|
|
986
1031
|
}),
|
|
987
|
-
opacity: new
|
|
1032
|
+
opacity: new M({
|
|
988
1033
|
default: (t == null ? void 0 : t.opacity) ?? 100,
|
|
989
1034
|
minValue: 0,
|
|
990
1035
|
maxValue: 100
|
|
991
1036
|
}),
|
|
992
|
-
radius: new
|
|
1037
|
+
radius: new v({
|
|
993
1038
|
title: "Radius",
|
|
994
|
-
icon:
|
|
1039
|
+
icon: J,
|
|
995
1040
|
default: (t == null ? void 0 : t.radius) ?? 12,
|
|
996
1041
|
suffix: "px"
|
|
997
1042
|
})
|
|
@@ -1002,44 +1047,44 @@ class ct extends v {
|
|
|
1002
1047
|
* Optional helper to generate CSS from the current settings.
|
|
1003
1048
|
*/
|
|
1004
1049
|
getCssCode() {
|
|
1005
|
-
const t = this.settings.color.value ?? "#000000", e = this.settings.opacity.value ?? 100, i = this.settings.radius.value ?? 0,
|
|
1050
|
+
const t = this.settings.color.value ?? "#000000", e = this.settings.opacity.value ?? 100, i = this.settings.radius.value ?? 0, s = this.settings.size.value ?? 0;
|
|
1006
1051
|
return `
|
|
1007
1052
|
border-color: ${t};
|
|
1008
|
-
border-width: ${
|
|
1053
|
+
border-width: ${s}px;
|
|
1009
1054
|
border-radius: ${i}px;
|
|
1010
1055
|
opacity: ${e / 100};
|
|
1011
1056
|
`;
|
|
1012
1057
|
}
|
|
1013
1058
|
}
|
|
1014
|
-
const
|
|
1059
|
+
const X = `
|
|
1015
1060
|
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="13" viewBox="0 0 14 13" fill="none">
|
|
1016
1061
|
<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"/>
|
|
1017
1062
|
</svg>
|
|
1018
|
-
`,
|
|
1063
|
+
`, Q = `
|
|
1019
1064
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1020
1065
|
<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"/>
|
|
1021
1066
|
</svg>
|
|
1022
|
-
`,
|
|
1067
|
+
`, Y = `
|
|
1023
1068
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1024
1069
|
<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"/>
|
|
1025
1070
|
</svg>
|
|
1026
1071
|
`;
|
|
1027
|
-
class
|
|
1072
|
+
class pt extends f {
|
|
1028
1073
|
constructor(t = {}) {
|
|
1029
1074
|
super({
|
|
1030
1075
|
title: t.title || "Typography",
|
|
1031
1076
|
collapsed: t.collapsed,
|
|
1032
1077
|
hideCondition: t.hideCondition,
|
|
1033
1078
|
settings: {
|
|
1034
|
-
color: new
|
|
1079
|
+
color: new S({
|
|
1035
1080
|
default: t.colorDefault ?? "0, 0, 30"
|
|
1036
1081
|
}),
|
|
1037
|
-
opacity: new
|
|
1082
|
+
opacity: new M({
|
|
1038
1083
|
default: t.colorOpacityDefault ?? 100
|
|
1039
1084
|
}),
|
|
1040
|
-
fontFamily: new
|
|
1085
|
+
fontFamily: new V({
|
|
1041
1086
|
title: "Font",
|
|
1042
|
-
icon:
|
|
1087
|
+
icon: X,
|
|
1043
1088
|
default: t.fontFamilyDefault ?? "Satoshi",
|
|
1044
1089
|
options: t.fontFamilyOptions ?? [
|
|
1045
1090
|
{ name: "Satoshi", value: "Satoshi" },
|
|
@@ -1049,9 +1094,9 @@ class dt extends v {
|
|
|
1049
1094
|
getOptions: t.fontFamilyGetOptions,
|
|
1050
1095
|
getOptionsAsync: t.fontFamilyGetOptionsAsync
|
|
1051
1096
|
}),
|
|
1052
|
-
fontWeight: new
|
|
1097
|
+
fontWeight: new V({
|
|
1053
1098
|
title: "Weight",
|
|
1054
|
-
icon:
|
|
1099
|
+
icon: Q,
|
|
1055
1100
|
default: t.fontWeightDefault ?? "400",
|
|
1056
1101
|
options: t.fontWeightOptions ?? [
|
|
1057
1102
|
{ name: "Regular", value: "400" },
|
|
@@ -1061,9 +1106,9 @@ class dt extends v {
|
|
|
1061
1106
|
getOptions: t.fontWeightGetOptions,
|
|
1062
1107
|
getOptionsAsync: t.fontWeightGetOptionsAsync
|
|
1063
1108
|
}),
|
|
1064
|
-
fontSize: new
|
|
1109
|
+
fontSize: new v({
|
|
1065
1110
|
title: "Size",
|
|
1066
|
-
icon:
|
|
1111
|
+
icon: Y,
|
|
1067
1112
|
default: t.fontSizeDefault ?? 12,
|
|
1068
1113
|
suffix: "px"
|
|
1069
1114
|
}),
|
|
@@ -1075,18 +1120,18 @@ class dt extends v {
|
|
|
1075
1120
|
});
|
|
1076
1121
|
}
|
|
1077
1122
|
getCssCode() {
|
|
1078
|
-
const t = this.settings.color.value ?? "#000000", e = this.settings.opacity.value ?? 100, i = this.settings.fontFamily.value ?? "Satoshi",
|
|
1123
|
+
const t = this.settings.color.value ?? "#000000", e = this.settings.opacity.value ?? 100, i = this.settings.fontFamily.value ?? "Satoshi", s = this.settings.fontWeight.value ?? "bold", n = this.settings.fontSize.value ?? 12, o = this.settings.align.value ?? "left";
|
|
1079
1124
|
return `
|
|
1080
1125
|
color: ${t};
|
|
1081
1126
|
opacity: ${e / 100};
|
|
1082
1127
|
font-family: ${i};
|
|
1083
|
-
font-weight: ${
|
|
1084
|
-
font-size: ${
|
|
1128
|
+
font-weight: ${s};
|
|
1129
|
+
font-size: ${n}px;
|
|
1085
1130
|
text-align: ${o};
|
|
1086
1131
|
`;
|
|
1087
1132
|
}
|
|
1088
1133
|
}
|
|
1089
|
-
class
|
|
1134
|
+
class k extends m {
|
|
1090
1135
|
constructor(t) {
|
|
1091
1136
|
super({
|
|
1092
1137
|
...t,
|
|
@@ -1096,9 +1141,9 @@ class E extends m {
|
|
|
1096
1141
|
draw() {
|
|
1097
1142
|
const t = this.value === "auto" ? "text" : "number", e = (a) => {
|
|
1098
1143
|
this.value !== "auto" && (this.props.minValue !== void 0 && (a.min = String(this.props.minValue)), this.props.maxValue !== void 0 && (a.max = String(this.props.maxValue)), this.props.className && a.classList.add(this.props.className), a.addEventListener("input", () => {
|
|
1099
|
-
const
|
|
1100
|
-
let
|
|
1101
|
-
|
|
1144
|
+
const l = this.props.minValue ?? Number.MIN_SAFE_INTEGER, c = this.props.maxValue ?? Number.MAX_SAFE_INTEGER;
|
|
1145
|
+
let r = Number(a.value);
|
|
1146
|
+
r < l && (r = l), r > c && (r = c), a.value = String(r);
|
|
1102
1147
|
}));
|
|
1103
1148
|
}, i = this.createInput({
|
|
1104
1149
|
value: this.value,
|
|
@@ -1113,53 +1158,53 @@ class E extends m {
|
|
|
1113
1158
|
if (!this.props.suffix || this.props.suffix === "none")
|
|
1114
1159
|
return i;
|
|
1115
1160
|
i.classList.add("suffix-wrapper");
|
|
1116
|
-
const
|
|
1161
|
+
const s = i.querySelector(
|
|
1117
1162
|
"input.number-setting-input"
|
|
1118
1163
|
);
|
|
1119
|
-
|
|
1120
|
-
const
|
|
1121
|
-
|
|
1164
|
+
s && (s.style.paddingRight = "35px");
|
|
1165
|
+
const n = document.createElement("span");
|
|
1166
|
+
n.className = "suffix-label", n.textContent = this.props.suffix, i.appendChild(n);
|
|
1122
1167
|
const o = i.querySelector("input");
|
|
1123
1168
|
return o && (o.oninput = (a) => {
|
|
1124
|
-
const
|
|
1125
|
-
if (
|
|
1169
|
+
const l = a.target.value.trim();
|
|
1170
|
+
if (l.toLowerCase() === "auto")
|
|
1126
1171
|
this.value = "auto";
|
|
1127
1172
|
else {
|
|
1128
|
-
const c = Number(
|
|
1173
|
+
const c = Number(l);
|
|
1129
1174
|
isNaN(c) || (this.value = c);
|
|
1130
1175
|
}
|
|
1131
1176
|
this.onChange && this.onChange(this.value);
|
|
1132
1177
|
}), i;
|
|
1133
1178
|
}
|
|
1134
1179
|
}
|
|
1135
|
-
class
|
|
1180
|
+
class ut extends f {
|
|
1136
1181
|
constructor(t) {
|
|
1137
1182
|
super({
|
|
1138
1183
|
title: "Margins",
|
|
1139
1184
|
collapsed: t == null ? void 0 : t.collapsed,
|
|
1140
1185
|
hideCondition: t == null ? void 0 : t.hideCondition,
|
|
1141
1186
|
settings: {
|
|
1142
|
-
marginTop: new
|
|
1187
|
+
marginTop: new k({
|
|
1143
1188
|
title: "Top",
|
|
1144
|
-
icon:
|
|
1189
|
+
icon: K,
|
|
1145
1190
|
suffix: "px",
|
|
1146
1191
|
default: (t == null ? void 0 : t.marginTop) ?? "auto"
|
|
1147
1192
|
}),
|
|
1148
|
-
marginRight: new
|
|
1193
|
+
marginRight: new k({
|
|
1149
1194
|
title: "Right",
|
|
1150
|
-
icon:
|
|
1195
|
+
icon: tt,
|
|
1151
1196
|
suffix: "px",
|
|
1152
1197
|
default: (t == null ? void 0 : t.marginRight) ?? 0
|
|
1153
1198
|
}),
|
|
1154
|
-
marginBottom: new
|
|
1199
|
+
marginBottom: new k({
|
|
1155
1200
|
title: "Bottom",
|
|
1156
|
-
icon:
|
|
1201
|
+
icon: et,
|
|
1157
1202
|
suffix: "px",
|
|
1158
1203
|
default: (t == null ? void 0 : t.marginBottom) ?? 0
|
|
1159
1204
|
}),
|
|
1160
|
-
marginLeft: new
|
|
1205
|
+
marginLeft: new k({
|
|
1161
1206
|
title: "Left",
|
|
1162
|
-
icon:
|
|
1207
|
+
icon: it,
|
|
1163
1208
|
suffix: "px",
|
|
1164
1209
|
default: (t == null ? void 0 : t.marginLeft) ?? 0
|
|
1165
1210
|
})
|
|
@@ -1167,36 +1212,36 @@ class pt extends v {
|
|
|
1167
1212
|
});
|
|
1168
1213
|
}
|
|
1169
1214
|
getCssCode() {
|
|
1170
|
-
const t = typeof this.settings.marginTop.value == "number" ? `${this.settings.marginTop.value}px` : this.settings.marginTop.value, e = typeof this.settings.marginRight.value == "number" ? `${this.settings.marginRight.value}px` : this.settings.marginRight.value, i = typeof this.settings.marginBottom.value == "number" ? `${this.settings.marginBottom.value}px` : this.settings.marginBottom.value,
|
|
1215
|
+
const t = typeof this.settings.marginTop.value == "number" ? `${this.settings.marginTop.value}px` : this.settings.marginTop.value, e = typeof this.settings.marginRight.value == "number" ? `${this.settings.marginRight.value}px` : this.settings.marginRight.value, i = typeof this.settings.marginBottom.value == "number" ? `${this.settings.marginBottom.value}px` : this.settings.marginBottom.value, s = typeof this.settings.marginLeft.value == "number" ? `${this.settings.marginLeft.value}px` : this.settings.marginLeft.value;
|
|
1171
1216
|
return `
|
|
1172
1217
|
margin-top: ${t};
|
|
1173
1218
|
margin-right: ${e};
|
|
1174
1219
|
margin-bottom: ${i};
|
|
1175
|
-
margin-left: ${
|
|
1220
|
+
margin-left: ${s};
|
|
1176
1221
|
`;
|
|
1177
1222
|
}
|
|
1178
1223
|
}
|
|
1179
|
-
const
|
|
1224
|
+
const K = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1180
1225
|
<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"/>
|
|
1181
|
-
</svg>`, K = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1182
|
-
<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"/>
|
|
1183
1226
|
</svg>`, tt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1184
|
-
<path d="
|
|
1227
|
+
<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"/>
|
|
1185
1228
|
</svg>`, et = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1229
|
+
<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"/>
|
|
1230
|
+
</svg>`, it = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1186
1231
|
<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"/>
|
|
1187
1232
|
</svg>`;
|
|
1188
|
-
class
|
|
1233
|
+
class st extends f {
|
|
1189
1234
|
constructor(t, e, i) {
|
|
1190
1235
|
super({
|
|
1191
1236
|
title: `Tab ${t + 1}`,
|
|
1192
1237
|
hideCondition: i == null ? void 0 : i.hideCondition,
|
|
1193
1238
|
collapsed: i == null ? void 0 : i.collapsed,
|
|
1194
1239
|
settings: {
|
|
1195
|
-
name: new
|
|
1240
|
+
name: new H({
|
|
1196
1241
|
title: "Tab Name",
|
|
1197
1242
|
default: `Tab ${t + 1}`
|
|
1198
1243
|
}),
|
|
1199
|
-
content: new
|
|
1244
|
+
content: new H({
|
|
1200
1245
|
title: "Content",
|
|
1201
1246
|
default: ""
|
|
1202
1247
|
})
|
|
@@ -1208,10 +1253,10 @@ class it extends v {
|
|
|
1208
1253
|
e && e.parentElement && e.parentElement.removeChild(e);
|
|
1209
1254
|
const i = t.querySelector(".setting-group-title");
|
|
1210
1255
|
if (i) {
|
|
1211
|
-
const
|
|
1212
|
-
|
|
1213
|
-
const
|
|
1214
|
-
|
|
1256
|
+
const s = document.createElement("div");
|
|
1257
|
+
s.className = "tab-delete-container";
|
|
1258
|
+
const n = document.createElement("button");
|
|
1259
|
+
n.className = "tab-delete-button", n.innerHTML = `
|
|
1215
1260
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#f87171" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="trash-icon">
|
|
1216
1261
|
<polyline points="3 6 5 6 21 6"></polyline>
|
|
1217
1262
|
<path d="M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6"></path>
|
|
@@ -1219,17 +1264,17 @@ class it extends v {
|
|
|
1219
1264
|
<path d="M14 11v6"></path>
|
|
1220
1265
|
<path d="M9 6V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2"></path>
|
|
1221
1266
|
</svg>
|
|
1222
|
-
`,
|
|
1267
|
+
`, n.onclick = () => {
|
|
1223
1268
|
var a;
|
|
1224
1269
|
return (a = this.onDeleteCallback) == null ? void 0 : a.call(this);
|
|
1225
|
-
},
|
|
1270
|
+
}, s.appendChild(n);
|
|
1226
1271
|
const o = i.querySelector("h3");
|
|
1227
|
-
o ? o.insertAdjacentElement("afterend",
|
|
1272
|
+
o ? o.insertAdjacentElement("afterend", s) : i.appendChild(s);
|
|
1228
1273
|
}
|
|
1229
1274
|
return t;
|
|
1230
1275
|
}
|
|
1231
1276
|
}
|
|
1232
|
-
class
|
|
1277
|
+
class gt extends f {
|
|
1233
1278
|
// Store the rendered element
|
|
1234
1279
|
constructor(t) {
|
|
1235
1280
|
super({
|
|
@@ -1241,7 +1286,7 @@ class ut extends v {
|
|
|
1241
1286
|
}
|
|
1242
1287
|
/** Adds a new tab. */
|
|
1243
1288
|
addTab(t) {
|
|
1244
|
-
const e = this.tabs.length, i = new
|
|
1289
|
+
const e = this.tabs.length, i = new st(
|
|
1245
1290
|
e,
|
|
1246
1291
|
() => this.removeTab(i),
|
|
1247
1292
|
t
|
|
@@ -1298,7 +1343,7 @@ class ut extends v {
|
|
|
1298
1343
|
}));
|
|
1299
1344
|
}
|
|
1300
1345
|
}
|
|
1301
|
-
class
|
|
1346
|
+
class mt extends f {
|
|
1302
1347
|
/**
|
|
1303
1348
|
* Constructs a new BackgroundSettingSet.
|
|
1304
1349
|
*
|
|
@@ -1329,17 +1374,17 @@ class gt extends v {
|
|
|
1329
1374
|
collapsed: t == null ? void 0 : t.collapsed,
|
|
1330
1375
|
hideCondition: t == null ? void 0 : t.hideCondition,
|
|
1331
1376
|
settings: {
|
|
1332
|
-
backgroundImage: new
|
|
1377
|
+
backgroundImage: new F({
|
|
1333
1378
|
...t == null ? void 0 : t.uploadProps,
|
|
1334
1379
|
default: (t == null ? void 0 : t.backgroundImage) ?? ""
|
|
1335
1380
|
}),
|
|
1336
|
-
opacity: new
|
|
1381
|
+
opacity: new M({
|
|
1337
1382
|
default: (t == null ? void 0 : t.opacity) ?? 100
|
|
1338
1383
|
}),
|
|
1339
|
-
backgroundColor: new
|
|
1384
|
+
backgroundColor: new S({
|
|
1340
1385
|
default: (t == null ? void 0 : t.backgroundColor) ?? "0, 0, 30"
|
|
1341
1386
|
}),
|
|
1342
|
-
opacityBG: new
|
|
1387
|
+
opacityBG: new M({
|
|
1343
1388
|
default: (t == null ? void 0 : t.opacityBG) ?? 100
|
|
1344
1389
|
})
|
|
1345
1390
|
}
|
|
@@ -1351,16 +1396,16 @@ class gt extends v {
|
|
|
1351
1396
|
draw() {
|
|
1352
1397
|
const t = super.draw(), e = t.querySelector(".setting-group-content");
|
|
1353
1398
|
if (!e) return t;
|
|
1354
|
-
const i = Array.from(e.children), [
|
|
1355
|
-
e.innerHTML = "", e.appendChild(
|
|
1356
|
-
const
|
|
1357
|
-
return
|
|
1399
|
+
const i = Array.from(e.children), [s, n, o, a] = i;
|
|
1400
|
+
e.innerHTML = "", e.appendChild(s), e.appendChild(n);
|
|
1401
|
+
const l = document.createElement("div");
|
|
1402
|
+
return l.className = "bgset-or-label", l.textContent = "OR", e.appendChild(l), e.appendChild(o), e.appendChild(a), t;
|
|
1358
1403
|
}
|
|
1359
1404
|
/**
|
|
1360
1405
|
* Helper method to generate CSS based on the current settings.
|
|
1361
1406
|
*/
|
|
1362
1407
|
getCssCode() {
|
|
1363
|
-
const t = this.settings.backgroundImage.value || "", e = this.settings.opacity.value ?? 100, i = this.settings.backgroundColor.value || "0, 0, 30",
|
|
1408
|
+
const t = this.settings.backgroundImage.value || "", e = this.settings.opacity.value ?? 100, i = this.settings.backgroundColor.value || "0, 0, 30", s = this.settings.opacityBG.value ?? 100;
|
|
1364
1409
|
return t ? `
|
|
1365
1410
|
background-image: url("${t}");
|
|
1366
1411
|
background-size: cover;
|
|
@@ -1368,31 +1413,31 @@ class gt extends v {
|
|
|
1368
1413
|
opacity: ${e / 100};
|
|
1369
1414
|
` : `
|
|
1370
1415
|
background-color: ${i};
|
|
1371
|
-
opacity: ${
|
|
1416
|
+
opacity: ${s / 100};
|
|
1372
1417
|
`;
|
|
1373
1418
|
}
|
|
1374
1419
|
}
|
|
1375
1420
|
export {
|
|
1376
1421
|
_ as AlignSetting,
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1422
|
+
mt as BackgroundSettingSet,
|
|
1423
|
+
dt as BorderSettingSet,
|
|
1424
|
+
nt as ButtonSetting,
|
|
1425
|
+
S as ColorSetting,
|
|
1426
|
+
ot as DimensionSetting,
|
|
1427
|
+
ct as GapSetting,
|
|
1428
|
+
pt as HeaderTypographySettingSet,
|
|
1429
|
+
at as HeightSetting,
|
|
1430
|
+
ut as MarginSettingGroup,
|
|
1431
|
+
v as NumberSetting,
|
|
1432
|
+
M as OpacitySetting,
|
|
1433
|
+
rt as SelectApiSettings,
|
|
1434
|
+
V as SelectSetting,
|
|
1390
1435
|
m as Setting,
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1436
|
+
f as SettingGroup,
|
|
1437
|
+
H as StringSetting,
|
|
1438
|
+
gt as TabsContainerGroup,
|
|
1439
|
+
ht as Toggle,
|
|
1440
|
+
F as UploadSetting,
|
|
1441
|
+
lt as WidthSetting,
|
|
1442
|
+
B as iterateSettings
|
|
1398
1443
|
};
|