builder-settings-types 0.0.201 → 0.0.202
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 +39 -60
- package/dist/builder-settings-types.es.js +251 -821
- package/dist/index.css +1 -1
- package/dist/index.d.ts +13 -207
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const
|
|
2
|
-
let
|
|
1
|
+
const T = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
2
|
+
let N = (c = 21) => {
|
|
3
3
|
let t = "", e = crypto.getRandomValues(new Uint8Array(c |= 0));
|
|
4
4
|
for (; c--; )
|
|
5
|
-
t +=
|
|
5
|
+
t += T[e[c] & 63];
|
|
6
6
|
return t;
|
|
7
7
|
};
|
|
8
|
-
function
|
|
8
|
+
function x(c) {
|
|
9
9
|
if (c === null || typeof c != "object")
|
|
10
10
|
return c;
|
|
11
11
|
if (c instanceof Date)
|
|
@@ -13,16 +13,16 @@ function y(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] = x(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] = x(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 B(c) {
|
|
26
26
|
switch (c) {
|
|
27
27
|
case "number":
|
|
28
28
|
return 0;
|
|
@@ -42,7 +42,7 @@ function j(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 || N(), this.value = this.props.default, this.desktop = this.props.default, this.title = t.title || "";
|
|
46
46
|
}
|
|
47
47
|
static SetUploadUrl(t) {
|
|
48
48
|
window.DefaultUploadUrl = t, p.DefaultUploadUrl = t;
|
|
@@ -60,8 +60,8 @@ class p {
|
|
|
60
60
|
this.value = t, this.inputEl && (this.inputEl.value = String(t)), this.onChange && this.onChange(t), this.props.detectChange && this.props.detectChange(t);
|
|
61
61
|
}
|
|
62
62
|
clone() {
|
|
63
|
-
const t = this.constructor, e =
|
|
64
|
-
return i.value =
|
|
63
|
+
const t = this.constructor, e = x(this.props), i = new t(e);
|
|
64
|
+
return i.value = x(this.value), i;
|
|
65
65
|
}
|
|
66
66
|
createInput(t) {
|
|
67
67
|
t = { ...this.props.inputProps, ...t };
|
|
@@ -81,7 +81,7 @@ class p {
|
|
|
81
81
|
const i = document.createElement("div");
|
|
82
82
|
i.className = t.wrapperClassName || "";
|
|
83
83
|
const s = document.createElement("input");
|
|
84
|
-
this.inputEl = s, s.value = String(t.value ||
|
|
84
|
+
this.inputEl = s, s.value = String(t.value || B(t.inputType)), s.type = t.inputType, s.placeholder = t.placeholder || "", s.className = t.inputClassName || "";
|
|
85
85
|
const n = (o) => {
|
|
86
86
|
const l = o.target;
|
|
87
87
|
let r = l.value;
|
|
@@ -122,31 +122,31 @@ class p {
|
|
|
122
122
|
return i.className = "input-icon " + (e || ""), i.innerHTML = t, i;
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function A(c) {
|
|
126
126
|
let t = 0, e = c.parentElement;
|
|
127
127
|
for (; e; )
|
|
128
128
|
e.classList.contains("setting-group") && e !== c && t++, e = e.parentElement;
|
|
129
129
|
return t;
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function k(c, t) {
|
|
132
132
|
const e = Math.min(Math.max(t, 0), 5);
|
|
133
133
|
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 = "");
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function S(c, t = 0) {
|
|
136
136
|
c.querySelectorAll(":scope > .setting-group-content > .setting-group").forEach((i) => {
|
|
137
137
|
const s = i, n = t + 1;
|
|
138
|
-
|
|
138
|
+
k(s, n), S(s, n);
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
|
-
const
|
|
141
|
+
const R = {
|
|
142
142
|
maxLevel: 5,
|
|
143
143
|
spacingMultiplier: 1,
|
|
144
144
|
visualIndentMultiplier: 2,
|
|
145
145
|
enableAutoDetection: !0
|
|
146
146
|
};
|
|
147
|
-
class
|
|
147
|
+
class $ {
|
|
148
148
|
constructor(t = {}) {
|
|
149
|
-
this.observedElements = /* @__PURE__ */ new Set(), this.config = { ...
|
|
149
|
+
this.observedElements = /* @__PURE__ */ new Set(), this.config = { ...R, ...t }, this.config.enableAutoDetection && this.setupAutoDetection();
|
|
150
150
|
}
|
|
151
151
|
/**
|
|
152
152
|
* Setup automatic detection using MutationObserver
|
|
@@ -180,7 +180,7 @@ class z {
|
|
|
180
180
|
* Update nesting for a specific element
|
|
181
181
|
*/
|
|
182
182
|
updateElementNesting(t) {
|
|
183
|
-
const e =
|
|
183
|
+
const e = A(t);
|
|
184
184
|
this.applyNestingWithConfig(t, e);
|
|
185
185
|
}
|
|
186
186
|
/**
|
|
@@ -228,53 +228,33 @@ class z {
|
|
|
228
228
|
this.observer && (this.observer.disconnect(), this.observer = void 0), this.observedElements.clear();
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
|
-
const
|
|
232
|
-
function
|
|
231
|
+
const F = new $();
|
|
232
|
+
function b(c, t) {
|
|
233
233
|
for (const e in c)
|
|
234
234
|
if (c.hasOwnProperty(e)) {
|
|
235
235
|
const i = c[e];
|
|
236
236
|
t(e, i);
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
|
-
const
|
|
239
|
+
const g = class g {
|
|
240
240
|
constructor(t) {
|
|
241
|
-
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.
|
|
242
|
-
}, this.pendingBlurHandler = null, this.originalDefaultValues = {}, this.nestingLevel = 0, this.parentNestingLevel = 0, this.id = t.id ||
|
|
241
|
+
this.elementRef = null, this.isHidden = !1, this.custom = !1, this.initialValues = {}, this.changeTimeout = null, this.isHandlingChange = !1, this.changeHandlers = /* @__PURE__ */ new Set(), this.blurTimeout = null, this.lastChangeTime = 0, this.handleBlur = () => {
|
|
242
|
+
}, this.pendingBlurHandler = null, this.originalDefaultValues = {}, this.nestingLevel = 0, this.parentNestingLevel = 0, this.id = t.id || N(), 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();
|
|
243
243
|
}
|
|
244
|
-
/**
|
|
245
|
-
* Propagate nesting level to child setting groups
|
|
246
|
-
*/
|
|
247
244
|
propagateNestingLevel() {
|
|
248
245
|
const t = this.nestingLevel + 1;
|
|
249
|
-
|
|
250
|
-
i instanceof
|
|
246
|
+
b(this.settings, (e, i) => {
|
|
247
|
+
i instanceof g && (i.parentNestingLevel = this.nestingLevel, i.nestingLevel = t, i.propagateNestingLevel());
|
|
251
248
|
});
|
|
252
249
|
}
|
|
253
|
-
/**
|
|
254
|
-
* Get the current nesting level
|
|
255
|
-
*/
|
|
256
250
|
getNestingLevel() {
|
|
257
251
|
return this.nestingLevel;
|
|
258
252
|
}
|
|
259
|
-
/**
|
|
260
|
-
* Set nesting level and update styling
|
|
261
|
-
*/
|
|
262
253
|
setNestingLevel(t) {
|
|
263
254
|
this.nestingLevel = t, this.propagateNestingLevel(), this.elementRef && this.updateNestingStyles();
|
|
264
255
|
}
|
|
265
|
-
/**
|
|
266
|
-
* Update nesting styles on the rendered element
|
|
267
|
-
*/
|
|
268
256
|
updateNestingStyles() {
|
|
269
|
-
this.elementRef && (
|
|
270
|
-
}
|
|
271
|
-
/**
|
|
272
|
-
* Auto-detect nesting level from DOM position
|
|
273
|
-
*/
|
|
274
|
-
autoDetectNestingLevel() {
|
|
275
|
-
if (!this.elementRef) return;
|
|
276
|
-
const t = O(this.elementRef);
|
|
277
|
-
t !== this.nestingLevel && this.setNestingLevel(t);
|
|
257
|
+
this.elementRef && (k(this.elementRef, this.nestingLevel), S(this.elementRef, this.nestingLevel));
|
|
278
258
|
}
|
|
279
259
|
static hide() {
|
|
280
260
|
this.hiddenElements.forEach((t) => {
|
|
@@ -297,9 +277,9 @@ const m = class m {
|
|
|
297
277
|
Object.keys(s).length > 0 && (this.lastChangeTime = Date.now(), this.initialValues = i, t(i), this.updateVisibility()), this.isHandlingChange = !1;
|
|
298
278
|
}, 50));
|
|
299
279
|
};
|
|
300
|
-
return this.changeHandlers.clear(),
|
|
280
|
+
return this.changeHandlers.clear(), b(this.settings, (i, s) => {
|
|
301
281
|
var n;
|
|
302
|
-
if (s instanceof
|
|
282
|
+
if (s instanceof g)
|
|
303
283
|
s.setOnChange((a) => {
|
|
304
284
|
const o = this.getValues();
|
|
305
285
|
this.initialValues = o, t(o);
|
|
@@ -332,8 +312,8 @@ const m = class m {
|
|
|
332
312
|
"focusout",
|
|
333
313
|
this.handleBlur,
|
|
334
314
|
!0
|
|
335
|
-
),
|
|
336
|
-
e instanceof
|
|
315
|
+
), b(this.settings, (t, e) => {
|
|
316
|
+
e instanceof g && e.setOnBlur(() => {
|
|
337
317
|
this.onBlur && this.onBlur();
|
|
338
318
|
});
|
|
339
319
|
});
|
|
@@ -346,7 +326,7 @@ const m = class m {
|
|
|
346
326
|
}
|
|
347
327
|
clone() {
|
|
348
328
|
const t = {};
|
|
349
|
-
|
|
329
|
+
b(this.settings, (s, n) => {
|
|
350
330
|
typeof n.clone == "function" ? t[s] = n.clone() : (console.warn(
|
|
351
331
|
`Setting with key '${s}' does not have a clone method. Copying reference.`
|
|
352
332
|
), t[s] = n);
|
|
@@ -361,14 +341,14 @@ const m = class m {
|
|
|
361
341
|
custom: this.custom,
|
|
362
342
|
hideCondition: this.hideCondition,
|
|
363
343
|
parentNestingLevel: this.parentNestingLevel
|
|
364
|
-
}, i =
|
|
344
|
+
}, i = z(e);
|
|
365
345
|
return i.initialValues = this.getValues(), i;
|
|
366
346
|
}
|
|
367
347
|
setValue(t) {
|
|
368
348
|
if (!t || typeof t != "object") return;
|
|
369
349
|
Object.entries(t).forEach(([i, s]) => {
|
|
370
350
|
const n = this.settings[i];
|
|
371
|
-
n && (n instanceof
|
|
351
|
+
n && (n instanceof g || n instanceof p) && typeof n.setValue == "function" && n.setValue(s);
|
|
372
352
|
}), setTimeout(() => {
|
|
373
353
|
this.forceChildUIRefresh();
|
|
374
354
|
}, 0);
|
|
@@ -381,7 +361,7 @@ const m = class m {
|
|
|
381
361
|
forceChildUIRefresh() {
|
|
382
362
|
Object.entries(this.settings).forEach(([t, e]) => {
|
|
383
363
|
try {
|
|
384
|
-
if (e instanceof
|
|
364
|
+
if (e instanceof g) {
|
|
385
365
|
const i = e.getValues();
|
|
386
366
|
e.setValue(i);
|
|
387
367
|
} else if (typeof e.setValue == "function") {
|
|
@@ -418,12 +398,12 @@ const m = class m {
|
|
|
418
398
|
for (const i in this.settings)
|
|
419
399
|
if (this.settings.hasOwnProperty(i)) {
|
|
420
400
|
const s = this.settings[i];
|
|
421
|
-
s instanceof
|
|
401
|
+
s instanceof g ? e[i] = s.getValues() : e[i] = s.value;
|
|
422
402
|
}
|
|
423
403
|
return e;
|
|
424
404
|
} else {
|
|
425
405
|
const e = this.settings[t];
|
|
426
|
-
return e ? e instanceof
|
|
406
|
+
return e ? e instanceof g ? e.getValues() : e.value : void 0;
|
|
427
407
|
}
|
|
428
408
|
}
|
|
429
409
|
getDefaultValues(t) {
|
|
@@ -432,12 +412,12 @@ const m = class m {
|
|
|
432
412
|
for (const i in this.settings)
|
|
433
413
|
if (this.settings.hasOwnProperty(i)) {
|
|
434
414
|
const s = this.settings[i];
|
|
435
|
-
s instanceof
|
|
415
|
+
s instanceof g ? e[i] = s.getDefaultValues() : e[i] = s.default !== void 0 ? s.default : s.value;
|
|
436
416
|
}
|
|
437
417
|
return e;
|
|
438
418
|
} else {
|
|
439
419
|
const e = this.settings[t];
|
|
440
|
-
return e ? e instanceof
|
|
420
|
+
return e ? e instanceof g ? e.getDefaultValues() : e.default !== void 0 ? e.default : e.value : void 0;
|
|
441
421
|
}
|
|
442
422
|
}
|
|
443
423
|
getMobileValues(t) {
|
|
@@ -446,7 +426,7 @@ const m = class m {
|
|
|
446
426
|
for (const i in this.settings)
|
|
447
427
|
if (this.settings.hasOwnProperty(i)) {
|
|
448
428
|
const s = this.settings[i];
|
|
449
|
-
if (s instanceof
|
|
429
|
+
if (s instanceof g)
|
|
450
430
|
e[i] = s.getMobileValues();
|
|
451
431
|
else if (typeof s.getMobileValue == "function") {
|
|
452
432
|
const n = s.getMobileValue();
|
|
@@ -458,7 +438,7 @@ const m = class m {
|
|
|
458
438
|
} else {
|
|
459
439
|
const e = this.settings[t];
|
|
460
440
|
if (!e) return;
|
|
461
|
-
if (e instanceof
|
|
441
|
+
if (e instanceof g)
|
|
462
442
|
return e.getMobileValues();
|
|
463
443
|
if (typeof e.getMobileValue == "function") {
|
|
464
444
|
const i = e.getMobileValue();
|
|
@@ -470,7 +450,7 @@ const m = class m {
|
|
|
470
450
|
setMobileValues(t) {
|
|
471
451
|
if (!(!t || typeof t != "object") && (Object.entries(t).forEach(([e, i]) => {
|
|
472
452
|
const s = this.settings[e];
|
|
473
|
-
s && (s instanceof
|
|
453
|
+
s && (s instanceof g ? typeof i == "object" && i !== null && s.setMobileValues(i) : typeof s.setMobileValue == "function" && s.setMobileValue(i));
|
|
474
454
|
}), this.setValue(t), this.onChange)) {
|
|
475
455
|
const e = this.getValues();
|
|
476
456
|
this.onChange(e);
|
|
@@ -485,7 +465,7 @@ const m = class m {
|
|
|
485
465
|
}
|
|
486
466
|
draw() {
|
|
487
467
|
const t = document.createElement("div");
|
|
488
|
-
t.className = "setting-group", t.id = `setting-group-${this.id}`,
|
|
468
|
+
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);
|
|
489
469
|
const e = document.createElement("div");
|
|
490
470
|
e.className = "setting-group-title", this.isCollapsed && e.classList.add("collapsed-view"), e.setAttribute("role", "button"), e.setAttribute(
|
|
491
471
|
"aria-expanded",
|
|
@@ -526,27 +506,27 @@ const m = class m {
|
|
|
526
506
|
);
|
|
527
507
|
const h = o.querySelector(
|
|
528
508
|
".setting-group-description"
|
|
529
|
-
),
|
|
509
|
+
), u = n.querySelector(".info-marker");
|
|
530
510
|
if (this.description)
|
|
531
511
|
if (this.isCollapsed) {
|
|
532
|
-
if (h && h.remove(), !
|
|
533
|
-
const
|
|
534
|
-
|
|
512
|
+
if (h && h.remove(), !u) {
|
|
513
|
+
const d = document.createElement("span");
|
|
514
|
+
d.className = "info-marker", d.innerHTML = `
|
|
535
515
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
536
516
|
<path d="M8 5.33333V8M8 10.6667H8.00667M14 8C14 11.3137 11.3137 14 8 14C4.68629 14 2 11.3137 2 8C2 4.68629 4.68629 2 8 2C11.3137 2 14 4.68629 14 8Z"
|
|
537
517
|
stroke="currentColor" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>
|
|
538
518
|
</svg>
|
|
539
|
-
`,
|
|
519
|
+
`, d.title = this.description, n.insertBefore(d, a);
|
|
540
520
|
}
|
|
541
521
|
} else {
|
|
542
522
|
if (!h) {
|
|
543
|
-
const
|
|
544
|
-
|
|
545
|
-
|
|
523
|
+
const d = document.createElement("div");
|
|
524
|
+
d.className = "setting-group-description", d.textContent = this.description, o.insertBefore(
|
|
525
|
+
d,
|
|
546
526
|
o.firstChild
|
|
547
527
|
);
|
|
548
528
|
}
|
|
549
|
-
|
|
529
|
+
u && u.remove();
|
|
550
530
|
}
|
|
551
531
|
};
|
|
552
532
|
if (e.onclick = l, e.onkeydown = (h) => {
|
|
@@ -554,14 +534,14 @@ const m = class m {
|
|
|
554
534
|
}, Object.keys(this.settings).length > 0) {
|
|
555
535
|
for (const h in this.settings)
|
|
556
536
|
if (this.settings.hasOwnProperty(h)) {
|
|
557
|
-
const
|
|
558
|
-
|
|
537
|
+
const u = this.settings[h];
|
|
538
|
+
u instanceof g && u.setNestingLevel(this.nestingLevel + 1), o.appendChild(u.draw());
|
|
559
539
|
}
|
|
560
540
|
} else {
|
|
561
541
|
const h = document.createElement("div");
|
|
562
542
|
h.className = "setting-group-empty", h.textContent = "No settings in this group", o.appendChild(h);
|
|
563
543
|
}
|
|
564
|
-
return e.appendChild(i), e.appendChild(n), t.appendChild(e), t.appendChild(o), this.elementRef = t,
|
|
544
|
+
return e.appendChild(i), e.appendChild(n), t.appendChild(e), t.appendChild(o), this.elementRef = t, F.trackElement(t), setTimeout(() => {
|
|
565
545
|
this.updateNestingStyles();
|
|
566
546
|
}, 0), this.pendingBlurHandler && (this.setupBlurHandlers(), this.pendingBlurHandler = null), t;
|
|
567
547
|
}
|
|
@@ -609,258 +589,64 @@ const m = class m {
|
|
|
609
589
|
}
|
|
610
590
|
}
|
|
611
591
|
};
|
|
612
|
-
|
|
613
|
-
let
|
|
614
|
-
|
|
615
|
-
return new g(c);
|
|
616
|
-
}
|
|
617
|
-
function bt(c) {
|
|
618
|
-
return c;
|
|
619
|
-
}
|
|
620
|
-
class I extends g {
|
|
592
|
+
g.hiddenElements = /* @__PURE__ */ new Set();
|
|
593
|
+
let f = g;
|
|
594
|
+
class ft extends f {
|
|
621
595
|
constructor(t) {
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
title: t.title,
|
|
626
|
-
settings: s,
|
|
627
|
-
id: t.id || M(),
|
|
628
|
-
collapsed: t.collapsed,
|
|
629
|
-
main: t.main,
|
|
630
|
-
description: t.description,
|
|
631
|
-
icon: t.icon,
|
|
632
|
-
hideCondition: t.hideCondition,
|
|
633
|
-
onBlur: t.onBlur,
|
|
634
|
-
custom: t.custom,
|
|
635
|
-
parentNestingLevel: t.parentNestingLevel
|
|
636
|
-
};
|
|
637
|
-
super(n), this.tabs = [], this.activeTabId = "", this.tabsContainer = null, this.contentContainers = /* @__PURE__ */ new Map(), this.drawnElement = null, this.tabs = t.tabs, this.activeTabId = i.id;
|
|
638
|
-
}
|
|
639
|
-
static createCombinedSettings(t) {
|
|
640
|
-
const e = {};
|
|
641
|
-
return t.forEach((i) => {
|
|
642
|
-
Object.entries(i.settings).forEach(([s, n]) => {
|
|
643
|
-
const a = `${i.id}_${s}`;
|
|
644
|
-
e[a] = n;
|
|
645
|
-
});
|
|
646
|
-
}), e;
|
|
647
|
-
}
|
|
648
|
-
getValues() {
|
|
649
|
-
const t = {};
|
|
650
|
-
if (!this.tabs || this.tabs.length === 0)
|
|
651
|
-
return t.tabs = {}, t.activeTabId = this.activeTabId || "", t;
|
|
652
|
-
const e = {};
|
|
653
|
-
return this.tabs.forEach((i) => {
|
|
654
|
-
e[i.id] = {}, Object.entries(i.settings).forEach(([s, n]) => {
|
|
655
|
-
const a = `${i.id}_${s}`, o = this.settings[a];
|
|
656
|
-
o && (o instanceof g ? e[i.id][s] = o.getValues() : e[i.id][s] = o.value);
|
|
657
|
-
});
|
|
658
|
-
}), t.tabs = e, t.activeTabId = this.activeTabId, t;
|
|
659
|
-
}
|
|
660
|
-
setValue(t) {
|
|
661
|
-
t && (t.tabs && Object.entries(t.tabs).forEach(([e, i]) => {
|
|
662
|
-
typeof i == "object" && i !== null && this.setTabValues(e, i);
|
|
663
|
-
}), t.activeTabId && this.tabs && this.tabs.find((e) => e.id === t.activeTabId) && this.switchToTab(t.activeTabId), Object.entries(t).forEach(([e, i]) => {
|
|
664
|
-
if (e !== "tabs" && e !== "activeTabId") {
|
|
665
|
-
const s = this.settings[e];
|
|
666
|
-
s && typeof s.setValue == "function" && s.setValue(i);
|
|
667
|
-
}
|
|
668
|
-
}), this.initialValues = this.getValues(), this.forceUIUpdate(), this.onChange && this.onChange(this.getValues()));
|
|
669
|
-
}
|
|
670
|
-
setTabValues(t, e) {
|
|
671
|
-
!this.tabs || !this.tabs.find((s) => s.id === t) || (Object.entries(e).forEach(([s, n]) => {
|
|
672
|
-
const a = `${t}_${s}`, o = this.settings[a];
|
|
673
|
-
o && (o instanceof g ? typeof n == "object" && n !== null && o.setValue(n) : typeof o.setValue == "function" && o.setValue(n));
|
|
674
|
-
}), t === this.activeTabId && setTimeout(() => {
|
|
675
|
-
this.updateTabUI();
|
|
676
|
-
}, 0));
|
|
677
|
-
}
|
|
678
|
-
getTabValues(t) {
|
|
679
|
-
if (!this.tabs) return {};
|
|
680
|
-
const e = this.tabs.find((s) => s.id === t);
|
|
681
|
-
if (!e) return {};
|
|
682
|
-
const i = {};
|
|
683
|
-
return Object.entries(e.settings).forEach(([s, n]) => {
|
|
684
|
-
const a = `${t}_${s}`, o = this.settings[a];
|
|
685
|
-
o && (o instanceof g ? i[s] = o.getValues() : i[s] = o.value);
|
|
686
|
-
}), i;
|
|
687
|
-
}
|
|
688
|
-
/**
|
|
689
|
-
* Switch to a specific tab
|
|
690
|
-
*/
|
|
691
|
-
switchToTab(t) {
|
|
692
|
-
!this.tabs || !this.tabs.find((e) => e.id === t) || t === this.activeTabId || (this.activeTabId = t, this.updateTabUI(), this.onChange && this.onChange(this.getValues()));
|
|
596
|
+
super(t);
|
|
597
|
+
const e = Object.keys(this.settings)[0];
|
|
598
|
+
this.activeTabId = e || "";
|
|
693
599
|
}
|
|
694
|
-
/**
|
|
695
|
-
* Get current active tab ID
|
|
696
|
-
*/
|
|
697
600
|
getActiveTabId() {
|
|
698
601
|
return this.activeTabId;
|
|
699
602
|
}
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
*/
|
|
703
|
-
draw() {
|
|
704
|
-
const t = super.draw();
|
|
705
|
-
t.classList.add("tabs-settings-container"), this.drawnElement = t;
|
|
706
|
-
const e = document.createElement("div");
|
|
707
|
-
e.classList.add("tabs-header"), t.classList.contains("main-group") && e.classList.add("main-header"), this.tabsContainer = e, this.tabs.forEach((s) => {
|
|
708
|
-
const n = document.createElement("button");
|
|
709
|
-
if (n.classList.add("tab-button"), n.setAttribute("data-tab-id", s.id), s.id === this.activeTabId && n.classList.add("active"), s.icon) {
|
|
710
|
-
const o = document.createElement("span");
|
|
711
|
-
o.className = "tab-icon", o.innerHTML = s.icon, n.appendChild(o);
|
|
712
|
-
}
|
|
713
|
-
const a = document.createElement("span");
|
|
714
|
-
a.textContent = s.label, n.appendChild(a), n.onclick = () => this.switchToTab(s.id), e.appendChild(n);
|
|
715
|
-
});
|
|
716
|
-
const i = t.querySelector(".setting-group-content");
|
|
717
|
-
return i && (t.insertBefore(e, i), this.setupTabContent(i)), t;
|
|
718
|
-
}
|
|
719
|
-
/**
|
|
720
|
-
* Setup tab content containers
|
|
721
|
-
*/
|
|
722
|
-
setupTabContent(t) {
|
|
723
|
-
t.innerHTML = "", this.tabs.forEach((e) => {
|
|
724
|
-
const i = document.createElement("div");
|
|
725
|
-
i.classList.add("tab-content"), i.setAttribute("data-tab-id", e.id), e.id !== this.activeTabId && (i.style.display = "none"), Object.entries(e.settings).forEach(([s, n]) => {
|
|
726
|
-
const a = `${e.id}_${s}`, o = this.settings[a];
|
|
727
|
-
if (o && typeof o.draw == "function") {
|
|
728
|
-
const l = o.draw();
|
|
729
|
-
i.appendChild(l);
|
|
730
|
-
}
|
|
731
|
-
}), t.appendChild(i), this.contentContainers.set(e.id, i);
|
|
732
|
-
});
|
|
603
|
+
switchToTab(t) {
|
|
604
|
+
this.settings[t] && (this.activeTabId = t, this.updateTabUI());
|
|
733
605
|
}
|
|
734
|
-
/**
|
|
735
|
-
* Update tab UI when active tab changes
|
|
736
|
-
*/
|
|
737
606
|
updateTabUI() {
|
|
738
|
-
this.tabsContainer
|
|
607
|
+
if (!this.tabsContainer || !this.contentContainers) return;
|
|
608
|
+
this.tabsContainer.querySelectorAll(".tab-button").forEach((e) => {
|
|
739
609
|
e.getAttribute("data-tab-id") === this.activeTabId ? e.classList.add("active") : e.classList.remove("active");
|
|
740
|
-
}), this.contentContainers.forEach((
|
|
741
|
-
e === this.activeTabId ?
|
|
610
|
+
}), Object.entries(this.contentContainers).forEach(([e, i]) => {
|
|
611
|
+
e === this.activeTabId ? i.classList.add("active") : i.classList.remove("active");
|
|
742
612
|
});
|
|
743
613
|
}
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
if (this.drawnElement && this.drawnElement.parentNode) {
|
|
770
|
-
const t = this.draw();
|
|
771
|
-
this.drawnElement.parentNode.replaceChild(t, this.drawnElement), this.drawnElement = t;
|
|
772
|
-
}
|
|
773
|
-
}
|
|
774
|
-
/**
|
|
775
|
-
* Override getJson to provide tab-specific JSON options
|
|
776
|
-
*/
|
|
777
|
-
getJson(t) {
|
|
778
|
-
const e = { format: "full", ...t };
|
|
779
|
-
if (e.tabId) {
|
|
780
|
-
const i = this.getTabValues(e.tabId);
|
|
781
|
-
return JSON.stringify(i, null, 2);
|
|
782
|
-
} else if (e.activeTabOnly) {
|
|
783
|
-
const i = this.getTabValues(this.activeTabId);
|
|
784
|
-
return JSON.stringify(i, null, 2);
|
|
785
|
-
} else if (e.format === "flat") {
|
|
786
|
-
const i = this.getTabValues(this.activeTabId);
|
|
787
|
-
return JSON.stringify(i, null, 2);
|
|
788
|
-
} else
|
|
789
|
-
return JSON.stringify(this.getValues(), null, 2);
|
|
790
|
-
}
|
|
791
|
-
/**
|
|
792
|
-
* Override setJson to handle both tab structure and flat structure
|
|
793
|
-
*/
|
|
794
|
-
setJson(t, e) {
|
|
795
|
-
try {
|
|
796
|
-
const i = JSON.parse(t), s = { autoDetect: !0, ...e };
|
|
797
|
-
if (s.toTabId) {
|
|
798
|
-
this.setTabValues(s.toTabId, i);
|
|
799
|
-
return;
|
|
800
|
-
}
|
|
801
|
-
if (s.toActiveTab) {
|
|
802
|
-
this.setTabValues(this.activeTabId, i);
|
|
803
|
-
return;
|
|
804
|
-
}
|
|
805
|
-
s.autoDetect ? i.tabs && i.activeTabId !== void 0 ? this.setValue(i) : (this.setTabValues(this.activeTabId, i), this.onChange && this.onChange(this.getValues())) : super.setJson(t);
|
|
806
|
-
} catch (i) {
|
|
807
|
-
throw console.error("Invalid JSON provided to TabsSettingGroup.setJson:", i), new Error("Invalid JSON format");
|
|
614
|
+
draw() {
|
|
615
|
+
const t = super.draw();
|
|
616
|
+
t.classList.add("tabs-settings-container");
|
|
617
|
+
const e = t.querySelector(
|
|
618
|
+
".setting-group-content"
|
|
619
|
+
);
|
|
620
|
+
if (!e) return t;
|
|
621
|
+
e.innerHTML = "";
|
|
622
|
+
const i = document.createElement("div");
|
|
623
|
+
i.className = "tabs-title";
|
|
624
|
+
const s = document.createElement("h3");
|
|
625
|
+
s.textContent = this.title, i.appendChild(s);
|
|
626
|
+
const n = document.createElement("div");
|
|
627
|
+
n.className = "tabs-header", this.tabsContainer = n;
|
|
628
|
+
const a = document.createElement("div");
|
|
629
|
+
if (a.className = "tab-content", this.contentContainers = {}, Object.keys(this.settings).forEach((o, l) => {
|
|
630
|
+
const r = document.createElement("button");
|
|
631
|
+
r.className = "tab-button", r.type = "button", r.setAttribute("data-tab-id", o), r.textContent = o, r.addEventListener("click", () => this.switchToTab(o)), n.appendChild(r);
|
|
632
|
+
const h = document.createElement("div");
|
|
633
|
+
h.className = "tab-panel", this.contentContainers[o] = h;
|
|
634
|
+
const u = this.settings[o];
|
|
635
|
+
u && (u instanceof f && u.setNestingLevel(this.getNestingLevel() + 1), h.appendChild(u.draw())), a.appendChild(h), l === 0 && !this.activeTabId && (this.activeTabId = o);
|
|
636
|
+
}), e.appendChild(i), e.appendChild(n), e.appendChild(a), !this.activeTabId) {
|
|
637
|
+
const o = Object.keys(this.settings)[0];
|
|
638
|
+
this.activeTabId = o || "";
|
|
808
639
|
}
|
|
809
|
-
|
|
810
|
-
/**
|
|
811
|
-
* Helper method to get JSON for a specific tab
|
|
812
|
-
*/
|
|
813
|
-
getTabJson(t) {
|
|
814
|
-
return this.getJson({ tabId: t });
|
|
815
|
-
}
|
|
816
|
-
/**
|
|
817
|
-
* Helper method to set JSON to a specific tab
|
|
818
|
-
*/
|
|
819
|
-
setTabJson(t, e) {
|
|
820
|
-
this.setJson(e, { toTabId: t });
|
|
821
|
-
}
|
|
822
|
-
/**
|
|
823
|
-
* Helper method to get JSON for the active tab only
|
|
824
|
-
*/
|
|
825
|
-
getActiveTabJson() {
|
|
826
|
-
return this.getJson({ activeTabOnly: !0 });
|
|
827
|
-
}
|
|
828
|
-
/**
|
|
829
|
-
* Helper method to set JSON to the active tab
|
|
830
|
-
*/
|
|
831
|
-
setActiveTabJson(t) {
|
|
832
|
-
this.setJson(t, { toActiveTab: !0 });
|
|
833
|
-
}
|
|
834
|
-
/**
|
|
835
|
-
* Force UI update for all tab elements
|
|
836
|
-
*/
|
|
837
|
-
forceUIUpdate() {
|
|
838
|
-
setTimeout(() => {
|
|
839
|
-
this.updateTabUI(), this.tabs.forEach((t) => {
|
|
840
|
-
Object.entries(t.settings).forEach(([e, i]) => {
|
|
841
|
-
const s = `${t.id}_${e}`, n = this.settings[s];
|
|
842
|
-
if (n && typeof n.setValue == "function")
|
|
843
|
-
try {
|
|
844
|
-
if (n instanceof g) {
|
|
845
|
-
const a = n.getValues();
|
|
846
|
-
n.setValue(a);
|
|
847
|
-
} else {
|
|
848
|
-
const a = n.value;
|
|
849
|
-
a !== void 0 && n.setValue(a);
|
|
850
|
-
}
|
|
851
|
-
} catch (a) {
|
|
852
|
-
console.warn(`Error updating UI for tab setting ${s}:`, a);
|
|
853
|
-
}
|
|
854
|
-
});
|
|
855
|
-
});
|
|
856
|
-
}, 20);
|
|
640
|
+
return this.updateTabUI(), t;
|
|
857
641
|
}
|
|
858
642
|
}
|
|
859
|
-
function
|
|
860
|
-
|
|
861
|
-
return Object.assign(t, t.settings);
|
|
643
|
+
function z(c) {
|
|
644
|
+
return new f(c);
|
|
862
645
|
}
|
|
863
|
-
|
|
646
|
+
function vt(c) {
|
|
647
|
+
return c;
|
|
648
|
+
}
|
|
649
|
+
class j extends p {
|
|
864
650
|
constructor(t = {}) {
|
|
865
651
|
super(t), this.inputType = "text", t.onChange && this.setOnChange(t.onChange);
|
|
866
652
|
}
|
|
@@ -880,18 +666,18 @@ class k extends p {
|
|
|
880
666
|
});
|
|
881
667
|
}
|
|
882
668
|
}
|
|
883
|
-
const
|
|
884
|
-
class
|
|
669
|
+
const P = "<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>";
|
|
670
|
+
class m extends j {
|
|
885
671
|
constructor(t) {
|
|
886
672
|
super({
|
|
887
673
|
...t,
|
|
888
|
-
icon: t.icon ||
|
|
674
|
+
icon: t.icon || P,
|
|
889
675
|
title: t.title || "Color",
|
|
890
|
-
default: t.default ?
|
|
676
|
+
default: t.default ? m.normalizeColorValue(t.default) : "#000000"
|
|
891
677
|
}), this.inputType = "color", this.element = null, this.colorInputEl = null, this.textInputEl = null, this.detectChange = t.detectChange;
|
|
892
678
|
}
|
|
893
679
|
static normalizeColorValue(t) {
|
|
894
|
-
return t.startsWith("#") ?
|
|
680
|
+
return t.startsWith("#") ? m.normalizeHexValue(t) : t.includes(",") ? m.rgbToHexStatic(t) : m.normalizeHexValue(t);
|
|
895
681
|
}
|
|
896
682
|
static normalizeHexValue(t) {
|
|
897
683
|
return t = t.replace("#", ""), t.length === 3 && (t = t.split("").map((e) => e + e).join("")), t.length !== 6 ? (console.warn(`Invalid hex value "${t}", using default "#000000"`), "#000000") : /^[0-9A-Fa-f]{6}$/.test(t) ? `#${t.toLowerCase()}` : (console.warn(`Invalid hex value "${t}", using default "#000000"`), "#000000");
|
|
@@ -901,8 +687,8 @@ class f extends k {
|
|
|
901
687
|
if (e.length !== 3 || e.some(isNaN))
|
|
902
688
|
return console.warn(`Invalid RGB value "${t}", using default "#000000"`), "#000000";
|
|
903
689
|
const [i, s, n] = e, a = Math.max(0, Math.min(255, i)), o = Math.max(0, Math.min(255, s)), l = Math.max(0, Math.min(255, n)), r = (h) => {
|
|
904
|
-
const
|
|
905
|
-
return
|
|
690
|
+
const u = h.toString(16);
|
|
691
|
+
return u.length === 1 ? "0" + u : u;
|
|
906
692
|
};
|
|
907
693
|
return `#${r(a)}${r(o)}${r(l)}`;
|
|
908
694
|
}
|
|
@@ -912,7 +698,7 @@ class f extends k {
|
|
|
912
698
|
return;
|
|
913
699
|
}
|
|
914
700
|
if (typeof t == "string") {
|
|
915
|
-
const e =
|
|
701
|
+
const e = m.normalizeColorValue(t);
|
|
916
702
|
this.value = e, this.colorInputEl && (this.colorInputEl.value = e), this.textInputEl && (this.textInputEl.value = e), this.onChange && this.onChange(e), this.props.detectChange && this.props.detectChange(e);
|
|
917
703
|
} else
|
|
918
704
|
this.value = "#000000", this.colorInputEl && (this.colorInputEl.value = "#000000"), this.textInputEl && (this.textInputEl.value = "#000000"), this.onChange && this.onChange("#000000"), this.props.detectChange && this.props.detectChange("#000000");
|
|
@@ -942,8 +728,8 @@ class f extends k {
|
|
|
942
728
|
const r = l.value.trim();
|
|
943
729
|
if (!r)
|
|
944
730
|
return e.classList.remove("error"), !0;
|
|
945
|
-
const
|
|
946
|
-
return
|
|
731
|
+
const u = /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/.test(r);
|
|
732
|
+
return u ? e.classList.remove("error") : e.classList.add("error"), u;
|
|
947
733
|
}, s = document.createElement("input");
|
|
948
734
|
s.type = "color", s.className = "color-picker", s.value = this.value || "#000000", s.setAttribute("aria-label", "Choose color"), s.setAttribute("title", "Click to open color picker"), this.colorInputEl = s;
|
|
949
735
|
const n = document.createElement("div");
|
|
@@ -952,20 +738,20 @@ class f extends k {
|
|
|
952
738
|
n.style.backgroundColor = a;
|
|
953
739
|
const o = document.createElement("input");
|
|
954
740
|
return o.type = "text", o.className = "color-text-input", o.value = this.value || "", o.placeholder = "#000000", o.setAttribute("pattern", "#[0-9A-Fa-f]{6}"), o.setAttribute("title", "Enter a hex color value (e.g., #ff0000)"), o.setAttribute("aria-label", "Hex color value"), o.setAttribute("maxlength", "7"), this.textInputEl = o, this.textInputEl.addEventListener("input", (l) => {
|
|
955
|
-
var h,
|
|
741
|
+
var h, u;
|
|
956
742
|
let r = l.target.value.trim();
|
|
957
743
|
if (this.textInputEl && i(this.textInputEl)) {
|
|
958
|
-
const
|
|
959
|
-
this.value =
|
|
744
|
+
const d = m.normalizeColorValue(r);
|
|
745
|
+
this.value = d, (h = this.onChange) == null || h.call(this, d), (u = this.detectChange) == null || u.call(this, d), this.colorInputEl && (this.colorInputEl.value = d), n.style.backgroundColor = d;
|
|
960
746
|
}
|
|
961
747
|
}), this.colorInputEl.addEventListener("input", (l) => {
|
|
962
|
-
var
|
|
963
|
-
const r = l.target.value, h =
|
|
964
|
-
this.value = h, (
|
|
748
|
+
var u, d;
|
|
749
|
+
const r = l.target.value, h = m.normalizeColorValue(r);
|
|
750
|
+
this.value = h, (u = this.onChange) == null || u.call(this, h), (d = this.detectChange) == null || d.call(this, h), this.textInputEl && (this.textInputEl.value = h), n.style.backgroundColor = h, e.classList.remove("error");
|
|
965
751
|
}), this.colorInputEl.addEventListener("change", (l) => {
|
|
966
|
-
var
|
|
967
|
-
const r = l.target.value, h =
|
|
968
|
-
this.value = h, (
|
|
752
|
+
var u, d;
|
|
753
|
+
const r = l.target.value, h = m.normalizeColorValue(r);
|
|
754
|
+
this.value = h, (u = this.onChange) == null || u.call(this, h), (d = this.detectChange) == null || d.call(this, h), this.textInputEl && (this.textInputEl.value = h), n.style.backgroundColor = h;
|
|
969
755
|
}), e.appendChild(s), e.appendChild(n), e.appendChild(o), t.appendChild(e), this.element = t, t;
|
|
970
756
|
}
|
|
971
757
|
getElement() {
|
|
@@ -973,7 +759,7 @@ class f extends k {
|
|
|
973
759
|
}
|
|
974
760
|
// Helper method to get normalized hex value
|
|
975
761
|
getNormalizedValue() {
|
|
976
|
-
return this.value ?
|
|
762
|
+
return this.value ? m.normalizeColorValue(this.value) : "#000000";
|
|
977
763
|
}
|
|
978
764
|
// Helper method to check if current value is valid hex
|
|
979
765
|
isValidHex() {
|
|
@@ -984,7 +770,7 @@ class f extends k {
|
|
|
984
770
|
return this.isValidHex() ? this.hexToRgb(this.value) : "0, 0, 0";
|
|
985
771
|
}
|
|
986
772
|
}
|
|
987
|
-
const
|
|
773
|
+
const G = `
|
|
988
774
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
989
775
|
<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"/>
|
|
990
776
|
<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"/>
|
|
@@ -994,7 +780,7 @@ class C extends p {
|
|
|
994
780
|
constructor(t = {}) {
|
|
995
781
|
super({
|
|
996
782
|
...t,
|
|
997
|
-
icon: t.icon ||
|
|
783
|
+
icon: t.icon || G,
|
|
998
784
|
title: t.title || "Color & Opacity",
|
|
999
785
|
default: t.default || "#000000FF"
|
|
1000
786
|
}), 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 = C.normalizeHexWithOpacity(this.value));
|
|
@@ -1097,7 +883,7 @@ class C extends p {
|
|
|
1097
883
|
};
|
|
1098
884
|
}
|
|
1099
885
|
}
|
|
1100
|
-
class
|
|
886
|
+
class Ct extends p {
|
|
1101
887
|
constructor(t = {}) {
|
|
1102
888
|
super(t), this.inputType = "text", t.onChange && this.setOnChange(t.onChange);
|
|
1103
889
|
}
|
|
@@ -1188,12 +974,12 @@ class v extends p {
|
|
|
1188
974
|
);
|
|
1189
975
|
}
|
|
1190
976
|
}
|
|
1191
|
-
const
|
|
977
|
+
const W = `
|
|
1192
978
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1193
979
|
<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"/>
|
|
1194
980
|
<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"/>
|
|
1195
981
|
</svg>`;
|
|
1196
|
-
class
|
|
982
|
+
class D extends v {
|
|
1197
983
|
constructor(t = {}) {
|
|
1198
984
|
const e = {
|
|
1199
985
|
title: "Opacity",
|
|
@@ -1202,7 +988,7 @@ class W extends v {
|
|
|
1202
988
|
maxValue: 100,
|
|
1203
989
|
step: 1,
|
|
1204
990
|
default: t.default ?? 100,
|
|
1205
|
-
icon:
|
|
991
|
+
icon: W,
|
|
1206
992
|
...t
|
|
1207
993
|
};
|
|
1208
994
|
super(e), this.inputType = "number", this.mobileValue = t.mobile;
|
|
@@ -1214,12 +1000,12 @@ class W extends v {
|
|
|
1214
1000
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
1215
1001
|
}
|
|
1216
1002
|
}
|
|
1217
|
-
const
|
|
1003
|
+
const U = `
|
|
1218
1004
|
<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">
|
|
1219
1005
|
<polyline points="6 9 12 15 18 9"></polyline>
|
|
1220
1006
|
</svg>
|
|
1221
1007
|
`;
|
|
1222
|
-
class
|
|
1008
|
+
class V extends p {
|
|
1223
1009
|
constructor(t = {}) {
|
|
1224
1010
|
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, this.resizeListener = null, t.options && (this._options = [...t.options]), t.getOptions && this._options.push(...t.getOptions()), t.getOptionsAsync && (this.isLoading = !0), this.value !== void 0) {
|
|
1225
1011
|
const e = this._options.findIndex((i) => i.value === this.value);
|
|
@@ -1258,7 +1044,7 @@ class N extends p {
|
|
|
1258
1044
|
o.onclick = (l) => this.selectOption(l, a, e), i.appendChild(o);
|
|
1259
1045
|
}), document.body.appendChild(i);
|
|
1260
1046
|
const s = document.createElement("div");
|
|
1261
|
-
return s.classList.add("svg-container"), s.innerHTML =
|
|
1047
|
+
return s.classList.add("svg-container"), s.innerHTML = U, t.appendChild(s), this.optionsListEl = i, this.svgContainer = s, this.props.getOptionsAsync && (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((n) => {
|
|
1262
1048
|
this._options.push(...n), this.isLoading = !1, this.updateOptionsList(), this.updateButtonText();
|
|
1263
1049
|
}).catch((n) => {
|
|
1264
1050
|
console.error("Failed to fetch async options:", n), this.isLoading = !1, this.updateButtonText("Failed to load options");
|
|
@@ -1327,7 +1113,7 @@ class N extends p {
|
|
|
1327
1113
|
this.clickOutsideListener && (document.removeEventListener("click", this.clickOutsideListener), this.clickOutsideListener = null), this.resizeListener && (window.removeEventListener("resize", this.resizeListener), this.resizeListener = null), this.cleanupDropdownPosition(), this.optionsListEl && this.optionsListEl.parentNode && this.optionsListEl.parentNode.removeChild(this.optionsListEl), super.destroy();
|
|
1328
1114
|
}
|
|
1329
1115
|
}
|
|
1330
|
-
class
|
|
1116
|
+
class _ extends p {
|
|
1331
1117
|
constructor(t = {}) {
|
|
1332
1118
|
super(t), this.inputType = "button", this.value || (this.value = "center");
|
|
1333
1119
|
}
|
|
@@ -1380,7 +1166,7 @@ class J extends p {
|
|
|
1380
1166
|
}), t.appendChild(i), t;
|
|
1381
1167
|
}
|
|
1382
1168
|
}
|
|
1383
|
-
class
|
|
1169
|
+
class wt extends p {
|
|
1384
1170
|
constructor(t) {
|
|
1385
1171
|
super(t), this.inputType = "button";
|
|
1386
1172
|
}
|
|
@@ -1393,7 +1179,7 @@ class Lt extends p {
|
|
|
1393
1179
|
return e.className = "button-setting-wrapper " + (this.props.wrapperClassName || ""), e.appendChild(t), e;
|
|
1394
1180
|
}
|
|
1395
1181
|
}
|
|
1396
|
-
class
|
|
1182
|
+
class Et extends p {
|
|
1397
1183
|
constructor(t = {}) {
|
|
1398
1184
|
super(t), this.inputType = { width: "number", height: "number" }, this.aspectRatio = 1, this.isUpdating = !1;
|
|
1399
1185
|
const e = t.width || 0, i = t.height || 0;
|
|
@@ -1406,14 +1192,14 @@ class xt extends p {
|
|
|
1406
1192
|
suffix: "px",
|
|
1407
1193
|
minValue: this.minWidth,
|
|
1408
1194
|
maxValue: this.maxWidth,
|
|
1409
|
-
icon:
|
|
1195
|
+
icon: q
|
|
1410
1196
|
}), this.heightSetting = new v({
|
|
1411
1197
|
title: "Height",
|
|
1412
1198
|
default: this.value.height,
|
|
1413
1199
|
suffix: "px",
|
|
1414
1200
|
minValue: this.minHeight,
|
|
1415
1201
|
maxValue: this.maxHeight,
|
|
1416
|
-
icon:
|
|
1202
|
+
icon: J
|
|
1417
1203
|
}), this.widthSetting.setOnChange(this.handleWidthChange.bind(this)), this.heightSetting.setOnChange(this.handleHeightChange.bind(this));
|
|
1418
1204
|
}
|
|
1419
1205
|
handleWidthChange(t) {
|
|
@@ -1507,25 +1293,25 @@ class xt extends p {
|
|
|
1507
1293
|
}
|
|
1508
1294
|
}
|
|
1509
1295
|
}
|
|
1510
|
-
const
|
|
1296
|
+
const q = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1511
1297
|
<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"/>
|
|
1512
|
-
</svg>`,
|
|
1298
|
+
</svg>`, J = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1513
1299
|
<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"/>
|
|
1514
|
-
</svg>`,
|
|
1300
|
+
</svg>`, y = `
|
|
1515
1301
|
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="16" viewBox="0 0 15 16" fill="none">
|
|
1516
1302
|
<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"/>
|
|
1517
1303
|
</svg>
|
|
1518
|
-
`,
|
|
1304
|
+
`, Z = `
|
|
1519
1305
|
<svg width="91" height="71" viewBox="0 0 91 71" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1520
1306
|
<rect width="91" height="71" rx="4" fill="#F2F4F7"/>
|
|
1521
1307
|
<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"/>
|
|
1522
1308
|
</svg>
|
|
1523
|
-
`,
|
|
1309
|
+
`, K = `
|
|
1524
1310
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 12 12" fill="none">
|
|
1525
1311
|
<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"/>
|
|
1526
1312
|
</svg>
|
|
1527
1313
|
`;
|
|
1528
|
-
class
|
|
1314
|
+
class X extends p {
|
|
1529
1315
|
constructor(t = {}) {
|
|
1530
1316
|
super(t), this.inputType = "button", this.previewWrapper = null, this.previewEl = null, this.emptyStateEl = null, this.errorContainer = null, this.props.delete === void 0 && (this.props.delete = !0), this.props.maxFileSizeMB === void 0 && (this.props.maxFileSizeMB = 5), !this.value && t.defaultUrl && t.defaultUrl !== "" && (this.value = t.defaultUrl);
|
|
1531
1317
|
}
|
|
@@ -1553,10 +1339,10 @@ class Y extends p {
|
|
|
1553
1339
|
".preview-placeholder"
|
|
1554
1340
|
);
|
|
1555
1341
|
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 = `
|
|
1556
|
-
<span class="upload-icon">${
|
|
1342
|
+
<span class="upload-icon">${y}</span>
|
|
1557
1343
|
<span class="upload-label">Replace</span>
|
|
1558
1344
|
`)) : (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 = `
|
|
1559
|
-
<span class="upload-icon">${
|
|
1345
|
+
<span class="upload-icon">${y}</span>
|
|
1560
1346
|
<span class="upload-label">Upload</span>
|
|
1561
1347
|
`));
|
|
1562
1348
|
}
|
|
@@ -1589,9 +1375,9 @@ class Y extends p {
|
|
|
1589
1375
|
const s = this.value && this.value !== "";
|
|
1590
1376
|
s || i.classList.add("no-image");
|
|
1591
1377
|
const n = document.createElement("div");
|
|
1592
|
-
if (n.className = "preview-placeholder", n.innerHTML =
|
|
1378
|
+
if (n.className = "preview-placeholder", n.innerHTML = Z, this.previewWrapper = document.createElement("div"), this.previewWrapper.className = "preview-wrapper", this.previewEl = document.createElement("img"), this.previewEl.className = "upload-preview", this.props.delete) {
|
|
1593
1379
|
const l = document.createElement("button");
|
|
1594
|
-
l.className = "delete-button", l.type = "button", l.title = "Delete image", l.innerHTML =
|
|
1380
|
+
l.className = "delete-button", l.type = "button", l.title = "Delete image", l.innerHTML = K, this.previewWrapper.appendChild(l), l.onclick = (r) => {
|
|
1595
1381
|
var h;
|
|
1596
1382
|
r.stopPropagation(), this.value = "", o.value = "", this.updatePreviewState(null), (h = this.onChange) == null || h.call(this, ""), this.hideError();
|
|
1597
1383
|
};
|
|
@@ -1599,14 +1385,14 @@ class Y extends p {
|
|
|
1599
1385
|
this.previewWrapper.appendChild(this.previewEl);
|
|
1600
1386
|
const a = document.createElement("button");
|
|
1601
1387
|
a.className = "upload-button", a.innerHTML = `
|
|
1602
|
-
<span class="upload-icon">${
|
|
1388
|
+
<span class="upload-icon">${y}</span>
|
|
1603
1389
|
<span class="upload-label">Upload</span>
|
|
1604
1390
|
`;
|
|
1605
1391
|
const o = document.createElement("input");
|
|
1606
1392
|
return o.type = "file", o.accept = "image/*", o.style.display = "none", i.appendChild(n), i.appendChild(this.previewWrapper), i.appendChild(a), t.appendChild(i), t.appendChild(o), s ? this.updatePreviewState(this.value) : this.updatePreviewState(null), a.onclick = () => {
|
|
1607
1393
|
o.click();
|
|
1608
1394
|
}, o.onchange = async () => {
|
|
1609
|
-
var r, h,
|
|
1395
|
+
var r, h, u;
|
|
1610
1396
|
const l = (r = o.files) == null ? void 0 : r[0];
|
|
1611
1397
|
if (l) {
|
|
1612
1398
|
if (!this.validateFileSize(l)) {
|
|
@@ -1616,28 +1402,28 @@ class Y extends p {
|
|
|
1616
1402
|
this.hideError();
|
|
1617
1403
|
try {
|
|
1618
1404
|
a.classList.add("loading"), a.disabled = !0;
|
|
1619
|
-
const
|
|
1620
|
-
|
|
1621
|
-
const
|
|
1622
|
-
if (!
|
|
1405
|
+
const d = new FormData(), I = this.props.formFieldName || "file";
|
|
1406
|
+
d.append(I, l, l.name);
|
|
1407
|
+
const M = this.props.uploadUrl || p.DefaultUploadUrl;
|
|
1408
|
+
if (!M)
|
|
1623
1409
|
throw new Error("No uploadUrl provided to UploadSetting.");
|
|
1624
|
-
const
|
|
1625
|
-
method:
|
|
1626
|
-
body:
|
|
1627
|
-
headers:
|
|
1410
|
+
const O = this.props.requestMethod || "POST", H = { ...this.props.requestHeaders || {} }, E = await (await fetch(M, {
|
|
1411
|
+
method: O,
|
|
1412
|
+
body: d,
|
|
1413
|
+
headers: H
|
|
1628
1414
|
})).json();
|
|
1629
1415
|
console.log("Upload response:", E);
|
|
1630
|
-
let
|
|
1416
|
+
let w;
|
|
1631
1417
|
if (this.props.parseResponse)
|
|
1632
|
-
|
|
1633
|
-
else if (
|
|
1418
|
+
w = this.props.parseResponse(E);
|
|
1419
|
+
else if (w = (h = E == null ? void 0 : E.data) == null ? void 0 : h.url, !w)
|
|
1634
1420
|
throw new Error(
|
|
1635
1421
|
"No URL found in response. Provide a parseResponse if needed."
|
|
1636
1422
|
);
|
|
1637
|
-
console.log("Final URL:",
|
|
1638
|
-
} catch (
|
|
1639
|
-
console.error("Error uploading file:",
|
|
1640
|
-
`Upload failed: ${
|
|
1423
|
+
console.log("Final URL:", w), this.value = w, this.updatePreviewState(w), (u = this.onChange) == null || u.call(this, w);
|
|
1424
|
+
} catch (d) {
|
|
1425
|
+
console.error("Error uploading file:", d), this.showError(
|
|
1426
|
+
`Upload failed: ${d instanceof Error ? d.message : "Unknown error"}`
|
|
1641
1427
|
), o.value = "";
|
|
1642
1428
|
} finally {
|
|
1643
1429
|
a.classList.remove("loading"), a.disabled = !1;
|
|
@@ -1646,14 +1432,14 @@ class Y extends p {
|
|
|
1646
1432
|
}, t;
|
|
1647
1433
|
}
|
|
1648
1434
|
}
|
|
1649
|
-
class
|
|
1435
|
+
class bt extends v {
|
|
1650
1436
|
constructor(t = {}) {
|
|
1651
1437
|
super({
|
|
1652
1438
|
...t,
|
|
1653
1439
|
title: t.title || "Height",
|
|
1654
1440
|
suffix: t.suffix || "px",
|
|
1655
1441
|
minValue: t.minValue ?? 0,
|
|
1656
|
-
icon: t.icon ||
|
|
1442
|
+
icon: t.icon || Q,
|
|
1657
1443
|
default: t.default ?? 100
|
|
1658
1444
|
}), this.inputType = "number", this.mobileValue = t.mobile;
|
|
1659
1445
|
}
|
|
@@ -1664,17 +1450,17 @@ class yt extends v {
|
|
|
1664
1450
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
1665
1451
|
}
|
|
1666
1452
|
}
|
|
1667
|
-
const
|
|
1453
|
+
const Q = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1668
1454
|
<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"/>
|
|
1669
1455
|
</svg>`;
|
|
1670
|
-
class
|
|
1456
|
+
class Lt extends v {
|
|
1671
1457
|
constructor(t = {}) {
|
|
1672
1458
|
super({
|
|
1673
1459
|
...t,
|
|
1674
1460
|
title: t.title || "Width",
|
|
1675
1461
|
suffix: t.suffix || "px",
|
|
1676
1462
|
minValue: t.minValue ?? 0,
|
|
1677
|
-
icon: t.icon ||
|
|
1463
|
+
icon: t.icon || Y,
|
|
1678
1464
|
default: t.default ?? 100
|
|
1679
1465
|
}), this.inputType = "number", this.mobileValue = t.mobile;
|
|
1680
1466
|
}
|
|
@@ -1685,14 +1471,14 @@ class Vt extends v {
|
|
|
1685
1471
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
1686
1472
|
}
|
|
1687
1473
|
}
|
|
1688
|
-
const
|
|
1474
|
+
const Y = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1689
1475
|
<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"/>
|
|
1690
|
-
</svg>`,
|
|
1476
|
+
</svg>`, tt = `
|
|
1691
1477
|
<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">
|
|
1692
1478
|
<polyline points="6 9 12 15 18 9"></polyline>
|
|
1693
1479
|
</svg>
|
|
1694
1480
|
`;
|
|
1695
|
-
class
|
|
1481
|
+
class xt extends p {
|
|
1696
1482
|
constructor(t = {}) {
|
|
1697
1483
|
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) {
|
|
1698
1484
|
const e = this._options.findIndex(
|
|
@@ -1747,7 +1533,7 @@ class Tt extends p {
|
|
|
1747
1533
|
o.onclick = (l) => this.selectApiOption(l, a, e), i.appendChild(o);
|
|
1748
1534
|
}), t.appendChild(i);
|
|
1749
1535
|
const s = document.createElement("div");
|
|
1750
|
-
return s.classList.add("svg-container"), s.innerHTML =
|
|
1536
|
+
return s.classList.add("svg-container"), s.innerHTML = tt, t.appendChild(s), s.onclick = () => {
|
|
1751
1537
|
var n, a;
|
|
1752
1538
|
this.isLoading || (this.isOpen = !this.isOpen, (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (a = this.svgContainer) == null || a.classList.toggle("open", this.isOpen));
|
|
1753
1539
|
}, this.optionsListEl = i, this.svgContainer = s, this.props.getOptionsAsync && !this.hasInitializedOptions ? (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((n) => {
|
|
@@ -1791,7 +1577,7 @@ class Tt extends p {
|
|
|
1791
1577
|
})), t;
|
|
1792
1578
|
}
|
|
1793
1579
|
selectApiOption(t, e, i) {
|
|
1794
|
-
var l, r, h,
|
|
1580
|
+
var l, r, h, u;
|
|
1795
1581
|
const s = t.target, n = s.querySelector(".select-api-radio") || ((l = s.closest(".select-api-option")) == null ? void 0 : l.querySelector(".select-api-radio"));
|
|
1796
1582
|
n && (n.checked = !0), this.selectedOptionIndex = e;
|
|
1797
1583
|
const a = this._options[e].value;
|
|
@@ -1800,10 +1586,10 @@ class Tt extends p {
|
|
|
1800
1586
|
if (o)
|
|
1801
1587
|
o.textContent = this._options[e].name;
|
|
1802
1588
|
else {
|
|
1803
|
-
const
|
|
1804
|
-
|
|
1589
|
+
const d = i.firstChild;
|
|
1590
|
+
d && d.tagName === "SPAN" && (d.textContent = this._options[e].name);
|
|
1805
1591
|
}
|
|
1806
|
-
this.isOpen = !1, (r = this.optionsListEl) == null || r.classList.remove("open"), (h = this.svgContainer) == null || h.classList.remove("open"), (
|
|
1592
|
+
this.isOpen = !1, (r = this.optionsListEl) == null || r.classList.remove("open"), (h = this.svgContainer) == null || h.classList.remove("open"), (u = this.onChange) == null || u.call(this, a), this.detectChangeCallback && this.detectChangeCallback(a);
|
|
1807
1593
|
}
|
|
1808
1594
|
updateOptionsList() {
|
|
1809
1595
|
!this.optionsListEl || !this.buttonEl || (this.optionsListEl.innerHTML = "", this._options.forEach((t, e) => {
|
|
@@ -1836,7 +1622,7 @@ class Tt extends p {
|
|
|
1836
1622
|
), this.updateButtonText();
|
|
1837
1623
|
}
|
|
1838
1624
|
}
|
|
1839
|
-
class
|
|
1625
|
+
class yt extends p {
|
|
1840
1626
|
constructor(t) {
|
|
1841
1627
|
var e, i;
|
|
1842
1628
|
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;
|
|
@@ -1860,7 +1646,7 @@ class kt extends p {
|
|
|
1860
1646
|
const s = document.createElement("input");
|
|
1861
1647
|
s.type = "checkbox", s.checked = ((o = (a = this.props.options) == null ? void 0 : a.find((l) => l.value === this.value)) == null ? void 0 : o.status) ?? !1, s.addEventListener("change", () => {
|
|
1862
1648
|
var r, h;
|
|
1863
|
-
const l = ((h = (r = this.props.options) == null ? void 0 : r.find((
|
|
1649
|
+
const l = ((h = (r = this.props.options) == null ? void 0 : r.find((u) => u.status === s.checked)) == null ? void 0 : h.value) ?? "";
|
|
1864
1650
|
this.value = l, this.onChange && this.onChange(this.value), this.detectChangeCallback && this.detectChangeCallback(this.value);
|
|
1865
1651
|
});
|
|
1866
1652
|
const n = document.createElement("span");
|
|
@@ -1881,13 +1667,13 @@ class kt extends p {
|
|
|
1881
1667
|
this.detectChangeCallback = t;
|
|
1882
1668
|
}
|
|
1883
1669
|
}
|
|
1884
|
-
const
|
|
1670
|
+
const et = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1885
1671
|
<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"/>
|
|
1886
1672
|
</svg>`;
|
|
1887
|
-
class
|
|
1673
|
+
class kt extends p {
|
|
1888
1674
|
// Store mobile value
|
|
1889
1675
|
constructor(t = {}) {
|
|
1890
|
-
t.rowGap = t.rowGap ?? !0, t.columnGap = t.columnGap ?? !0, t.title = t.title ?? "Gap", t.icon = t.icon ??
|
|
1676
|
+
t.rowGap = t.rowGap ?? !0, t.columnGap = t.columnGap ?? !0, t.title = t.title ?? "Gap", t.icon = t.icon ?? et, 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);
|
|
1891
1677
|
}
|
|
1892
1678
|
draw() {
|
|
1893
1679
|
const t = document.createElement("div");
|
|
@@ -1938,288 +1724,47 @@ class Mt extends p {
|
|
|
1938
1724
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
1939
1725
|
}
|
|
1940
1726
|
}
|
|
1941
|
-
|
|
1942
|
-
constructor(t) {
|
|
1943
|
-
var o;
|
|
1944
|
-
if (!t.tabs)
|
|
1945
|
-
throw new Error("Tabs array is required for TabsSettings");
|
|
1946
|
-
const e = t.tabs, i = t.activeTabId || ((o = e[0]) == null ? void 0 : o.id) || "", s = e.find((l) => l.id === i), n = s ? s.settings : {}, a = {
|
|
1947
|
-
title: t.title || "",
|
|
1948
|
-
settings: n,
|
|
1949
|
-
collapsed: t.collapsed,
|
|
1950
|
-
main: t.main,
|
|
1951
|
-
description: t.description,
|
|
1952
|
-
icon: t.icon,
|
|
1953
|
-
custom: t.custom,
|
|
1954
|
-
hideCondition: t.hideCondition,
|
|
1955
|
-
onBlur: t.onBlur
|
|
1956
|
-
};
|
|
1957
|
-
super(a), this.tabs = [], this.activeTabId = "", this.tabsContainer = null, this.previousTabId = "", this.container = null, this.tabValues = {}, this.internalChangeTimeout = null, this.isHandlingInternalChange = !1, this.INTERNAL_CHANGE_DEBOUNCE = 50, this.tabs = e, this.activeTabId = i, this.previousTabId = i, this.onStateChangeCallback = t.onStateChange, this.detectChangeCallback = t.detectChange, this.initializeTabValues(), this.connectChildChangeHandlers();
|
|
1958
|
-
}
|
|
1959
|
-
updateSettingsFromTab(t) {
|
|
1960
|
-
const e = this.tabs.find((i) => i.id === t);
|
|
1961
|
-
e && (this.settings = e.settings, this.tabValues[t] = this.getTabValues(e), this.initialValues = {
|
|
1962
|
-
tabs: this.tabValues,
|
|
1963
|
-
activeTabId: this.activeTabId
|
|
1964
|
-
}, Object.values(e.settings).forEach((i) => {
|
|
1965
|
-
i instanceof w && (i._parentTabsSettings = this);
|
|
1966
|
-
}), this.connectChildChangeHandlers());
|
|
1967
|
-
}
|
|
1968
|
-
connectChildChangeHandlers() {
|
|
1969
|
-
if (!this.settings) return;
|
|
1970
|
-
const t = () => {
|
|
1971
|
-
Promise.resolve().then(() => {
|
|
1972
|
-
if (this.activeTabId) {
|
|
1973
|
-
const e = this.tabs.find((i) => i.id === this.activeTabId);
|
|
1974
|
-
e && (this.tabValues[this.activeTabId] = this.getTabValues(e));
|
|
1975
|
-
}
|
|
1976
|
-
this.initialValues = {
|
|
1977
|
-
tabs: this.tabValues,
|
|
1978
|
-
activeTabId: this.activeTabId
|
|
1979
|
-
}, this.triggerDebouncedChange();
|
|
1980
|
-
});
|
|
1981
|
-
};
|
|
1982
|
-
Object.values(this.settings).forEach((e) => {
|
|
1983
|
-
e instanceof g ? e.setOnChange(() => {
|
|
1984
|
-
t();
|
|
1985
|
-
}) : e instanceof p && e.setOnChange(() => {
|
|
1986
|
-
t();
|
|
1987
|
-
});
|
|
1988
|
-
}), this.tabs.forEach((e) => {
|
|
1989
|
-
Object.entries(e.settings).forEach(([i, s]) => {
|
|
1990
|
-
(s instanceof g || s instanceof p) && (s instanceof w ? (s._parentTabsSettings = this, s.setOnChange((n) => {
|
|
1991
|
-
Promise.resolve().then(() => {
|
|
1992
|
-
this.tabValues[e.id] = this.getTabValues(e), this.triggerDebouncedChange();
|
|
1993
|
-
});
|
|
1994
|
-
})) : s instanceof g ? s.setOnChange(() => {
|
|
1995
|
-
Promise.resolve().then(() => {
|
|
1996
|
-
this.tabValues[e.id] = this.getTabValues(e), this.triggerDebouncedChange();
|
|
1997
|
-
});
|
|
1998
|
-
}) : s instanceof p && s.setOnChange(() => {
|
|
1999
|
-
Promise.resolve().then(() => {
|
|
2000
|
-
this.tabValues[e.id] = this.getTabValues(e), this.triggerDebouncedChange();
|
|
2001
|
-
});
|
|
2002
|
-
}));
|
|
2003
|
-
});
|
|
2004
|
-
});
|
|
2005
|
-
}
|
|
2006
|
-
draw() {
|
|
2007
|
-
const t = super.draw();
|
|
2008
|
-
this.container = t, t.classList.add("tabs-settings-container");
|
|
2009
|
-
const e = document.createElement("div");
|
|
2010
|
-
e.classList.add("tabs-header"), this.main && e.classList.add("main-header"), this.tabsContainer = e, this.tabs.forEach((s) => {
|
|
2011
|
-
const n = document.createElement("button");
|
|
2012
|
-
n.classList.add("tab-button"), s.id === this.activeTabId && n.classList.add("active"), n.textContent = s.label, n.onclick = () => this.handleTabClick(s.id), e.appendChild(n);
|
|
2013
|
-
});
|
|
2014
|
-
const i = t.querySelector(".setting-group-content");
|
|
2015
|
-
return i && t.insertBefore(e, i), t;
|
|
2016
|
-
}
|
|
2017
|
-
handleTabClick(t) {
|
|
2018
|
-
var o, l;
|
|
2019
|
-
if (t === this.activeTabId) return;
|
|
2020
|
-
const e = this.tabs.find((r) => r.id === this.activeTabId);
|
|
2021
|
-
e && (this.tabValues[this.activeTabId] = this.getTabValues(e)), this.previousTabId = this.activeTabId, this.activeTabId = t;
|
|
2022
|
-
const i = (o = this.tabsContainer) == null ? void 0 : o.querySelectorAll(".tab-button");
|
|
2023
|
-
i == null || i.forEach((r) => {
|
|
2024
|
-
if (r instanceof HTMLElement) {
|
|
2025
|
-
const h = this.tabs.find((d) => d.label === r.textContent);
|
|
2026
|
-
r.classList.toggle("active", (h == null ? void 0 : h.id) === t);
|
|
2027
|
-
}
|
|
2028
|
-
}), this.updateSettingsFromTab(t);
|
|
2029
|
-
const s = (l = this.container) == null ? void 0 : l.querySelector(".setting-group-content");
|
|
2030
|
-
if (s) {
|
|
2031
|
-
s.innerHTML = "";
|
|
2032
|
-
const r = this.settings;
|
|
2033
|
-
Object.values(r).forEach((h) => {
|
|
2034
|
-
s.appendChild(h.draw());
|
|
2035
|
-
});
|
|
2036
|
-
}
|
|
2037
|
-
const n = this.getValues();
|
|
2038
|
-
this.initialValues = {
|
|
2039
|
-
tabs: this.tabValues,
|
|
2040
|
-
activeTabId: this.activeTabId
|
|
2041
|
-
}, this.connectChildChangeHandlers(), this.onStateChangeCallback && this.onStateChangeCallback(t, n), this.detectChangeCallback && this.detectChangeCallback(t, n), this.onChange && this.onChange(n);
|
|
2042
|
-
const a = this.findParentTabsSettings();
|
|
2043
|
-
a && a.onChange && a.onChange(a.getValues());
|
|
2044
|
-
}
|
|
2045
|
-
findParentTabsSettings() {
|
|
2046
|
-
return this._parentTabsSettings || null;
|
|
2047
|
-
}
|
|
2048
|
-
setOnStateChange(t) {
|
|
2049
|
-
return this.onStateChangeCallback = t, this;
|
|
2050
|
-
}
|
|
2051
|
-
setDetectChange(t) {
|
|
2052
|
-
return this.detectChangeCallback = t, this;
|
|
2053
|
-
}
|
|
2054
|
-
getActiveTabId() {
|
|
2055
|
-
return this.activeTabId;
|
|
2056
|
-
}
|
|
2057
|
-
getValues() {
|
|
2058
|
-
return this.updateTabValues(), {
|
|
2059
|
-
tabs: this.tabValues,
|
|
2060
|
-
activeTabId: this.activeTabId
|
|
2061
|
-
};
|
|
2062
|
-
}
|
|
2063
|
-
updateTabValues() {
|
|
2064
|
-
!this.tabs || this.tabs.length === 0 || this.tabs.forEach((t) => {
|
|
2065
|
-
this.tabValues[t.id] = this.getTabValues(t);
|
|
2066
|
-
});
|
|
2067
|
-
}
|
|
2068
|
-
propagateChanges() {
|
|
2069
|
-
const t = this.findParentTabsSettings();
|
|
2070
|
-
t && (t.updateTabValues(), t.triggerDebouncedChange());
|
|
2071
|
-
}
|
|
2072
|
-
triggerDebouncedChange() {
|
|
2073
|
-
this.isHandlingInternalChange || (this.isHandlingInternalChange = !0, this.internalChangeTimeout && clearTimeout(this.internalChangeTimeout), this.internalChangeTimeout = setTimeout(() => {
|
|
2074
|
-
this.onChange && this.onChange(this.getValues()), this.isHandlingInternalChange = !1, this.internalChangeTimeout = null;
|
|
2075
|
-
const t = this.findParentTabsSettings();
|
|
2076
|
-
t && t.triggerDebouncedChange();
|
|
2077
|
-
}, this.INTERNAL_CHANGE_DEBOUNCE));
|
|
2078
|
-
}
|
|
2079
|
-
updateInitialValues() {
|
|
2080
|
-
!this.tabs || this.tabs.length === 0 || (this.updateTabValues(), this.initialValues = {
|
|
2081
|
-
tabs: this.tabValues,
|
|
2082
|
-
activeTabId: this.activeTabId
|
|
2083
|
-
}, this.tabs.forEach((t) => {
|
|
2084
|
-
Object.values(t.settings).forEach((e) => {
|
|
2085
|
-
e instanceof w && e.updateInitialValues();
|
|
2086
|
-
});
|
|
2087
|
-
}));
|
|
2088
|
-
}
|
|
2089
|
-
setOnChange(t) {
|
|
2090
|
-
return this.onChange = t, this.connectChildChangeHandlers(), this.updateTabValues(), this;
|
|
2091
|
-
}
|
|
2092
|
-
initializeTabValues() {
|
|
2093
|
-
!this.tabs || this.tabs.length === 0 || (this.tabs.forEach((t) => {
|
|
2094
|
-
this.tabValues[t.id] = this.getTabValues(t);
|
|
2095
|
-
}), this.initialValues = {
|
|
2096
|
-
tabs: this.tabValues,
|
|
2097
|
-
activeTabId: this.activeTabId
|
|
2098
|
-
});
|
|
2099
|
-
}
|
|
2100
|
-
getTabValues(t) {
|
|
2101
|
-
const e = {};
|
|
2102
|
-
return Object.entries(t.settings).forEach(([i, s]) => {
|
|
2103
|
-
s instanceof w || s instanceof g ? e[i] = s.getValues() : (s instanceof p, e[i] = s.value);
|
|
2104
|
-
}), e;
|
|
2105
|
-
}
|
|
2106
|
-
clone() {
|
|
2107
|
-
const t = this.tabs.map((i) => {
|
|
2108
|
-
const s = {};
|
|
2109
|
-
return Object.entries(i.settings).forEach(([n, a]) => {
|
|
2110
|
-
typeof a.clone == "function" ? s[n] = a.clone() : (console.warn(
|
|
2111
|
-
`Setting with key '${n}' in tab '${i.id}' does not have a clone method. Copying reference.`
|
|
2112
|
-
), s[n] = a);
|
|
2113
|
-
}), {
|
|
2114
|
-
...i,
|
|
2115
|
-
settings: s
|
|
2116
|
-
};
|
|
2117
|
-
}), e = {
|
|
2118
|
-
title: this.title,
|
|
2119
|
-
tabs: t,
|
|
2120
|
-
activeTabId: this.activeTabId,
|
|
2121
|
-
collapsed: this.isCollapsed,
|
|
2122
|
-
main: this.isMain,
|
|
2123
|
-
description: this.description,
|
|
2124
|
-
icon: this.icon,
|
|
2125
|
-
custom: this.custom,
|
|
2126
|
-
hideCondition: this.hideCondition,
|
|
2127
|
-
settings: {}
|
|
2128
|
-
};
|
|
2129
|
-
return new w(
|
|
2130
|
-
e
|
|
2131
|
-
);
|
|
2132
|
-
}
|
|
2133
|
-
setValue(t) {
|
|
2134
|
-
if (t && typeof t == "object") {
|
|
2135
|
-
let e = !1;
|
|
2136
|
-
if (t.activeTabId && t.activeTabId !== this.activeTabId && (this.previousTabId = this.activeTabId, this.activeTabId = t.activeTabId, e = !0), t.tabs && typeof t.tabs == "object" && Object.entries(t.tabs).forEach(([i, s]) => {
|
|
2137
|
-
const n = this.tabs.find((a) => a.id === i);
|
|
2138
|
-
n && s && typeof s == "object" && Object.entries(s).forEach(([a, o]) => {
|
|
2139
|
-
n.settings[a] && typeof n.settings[a].setValue == "function" && n.settings[a].setValue(o);
|
|
2140
|
-
});
|
|
2141
|
-
}), this.updateTabValues(), this.triggerDebouncedChange(), this.container) {
|
|
2142
|
-
if (this.updateSettingsFromTab(this.activeTabId), this.tabsContainer) {
|
|
2143
|
-
const s = this.tabsContainer.querySelectorAll(".tab-button");
|
|
2144
|
-
s == null || s.forEach((n) => {
|
|
2145
|
-
if (n instanceof HTMLElement) {
|
|
2146
|
-
const a = this.tabs.find(
|
|
2147
|
-
(o) => o.label === n.textContent
|
|
2148
|
-
);
|
|
2149
|
-
n.classList.toggle(
|
|
2150
|
-
"active",
|
|
2151
|
-
(a == null ? void 0 : a.id) === this.activeTabId
|
|
2152
|
-
);
|
|
2153
|
-
}
|
|
2154
|
-
});
|
|
2155
|
-
}
|
|
2156
|
-
const i = this.container.querySelector(".setting-group-content");
|
|
2157
|
-
if (i) {
|
|
2158
|
-
i.innerHTML = "";
|
|
2159
|
-
const s = this.settings;
|
|
2160
|
-
Object.values(s).forEach((n) => {
|
|
2161
|
-
i.appendChild(n.draw());
|
|
2162
|
-
});
|
|
2163
|
-
}
|
|
2164
|
-
e && this.onStateChangeCallback && this.onStateChangeCallback(this.activeTabId, this.getValues());
|
|
2165
|
-
}
|
|
2166
|
-
this.initialValues = {
|
|
2167
|
-
tabs: this.tabValues,
|
|
2168
|
-
activeTabId: this.activeTabId
|
|
2169
|
-
};
|
|
2170
|
-
}
|
|
2171
|
-
}
|
|
2172
|
-
updateTabSetting(t, e, i) {
|
|
2173
|
-
const s = this.tabs.find((a) => a.id === t);
|
|
2174
|
-
if (!s || !s.settings[e]) return;
|
|
2175
|
-
const n = s.settings[e];
|
|
2176
|
-
typeof n.setValue == "function" && (n.setValue(i), this.tabValues[t] = this.getTabValues(s), t !== this.activeTabId && this.onChange && this.onChange(this.getValues()));
|
|
2177
|
-
}
|
|
2178
|
-
getTabsConfiguration() {
|
|
2179
|
-
return this.tabs;
|
|
2180
|
-
}
|
|
2181
|
-
}
|
|
2182
|
-
const nt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1727
|
+
const it = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2183
1728
|
<path d="M2.25 11.75H15.75M5.85 2.75H12.15C13.4101 2.75 14.0402 2.75 14.5215 2.99524C14.9448 3.21095 15.289 3.55516 15.5048 3.97852C15.75 4.45982 15.75 5.08988 15.75 6.35V12.65C15.75 13.9101 15.75 14.5402 15.5048 15.0215C15.289 15.4448 14.9448 15.789 14.5215 16.0048C14.0402 16.25 13.4101 16.25 12.15 16.25H5.85C4.58988 16.25 3.95982 16.25 3.47852 16.0048C3.05516 15.789 2.71095 15.4448 2.49524 15.0215C2.25 14.5402 2.25 13.9101 2.25 12.65V6.35C2.25 5.08988 2.25 4.45982 2.49524 3.97852C2.71095 3.55516 3.05516 3.21095 3.47852 2.99524C3.95982 2.75 4.58988 2.75 5.85 2.75Z" stroke="#667085" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2184
1729
|
</svg>`;
|
|
2185
|
-
class
|
|
1730
|
+
class Mt extends v {
|
|
2186
1731
|
constructor(t = {}) {
|
|
2187
1732
|
super({
|
|
2188
1733
|
...t,
|
|
2189
1734
|
minValue: t.minValue ?? 0,
|
|
2190
1735
|
maxValue: t.maxValue ?? 1e3,
|
|
2191
|
-
icon: t.icon ||
|
|
1736
|
+
icon: t.icon || it,
|
|
2192
1737
|
title: t.title || "Margin Bottom",
|
|
2193
1738
|
default: t.default ?? 20,
|
|
2194
1739
|
wrapperClassName: "margin-bottom-wrapper " + (t.wrapperClassName || "")
|
|
2195
1740
|
}), this.inputType = "number";
|
|
2196
1741
|
}
|
|
2197
1742
|
}
|
|
2198
|
-
const
|
|
1743
|
+
const st = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2199
1744
|
<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"
|
|
2200
1745
|
stroke="#667085" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2201
1746
|
</svg>`;
|
|
2202
|
-
class
|
|
1747
|
+
class Vt extends v {
|
|
2203
1748
|
constructor(t = {}) {
|
|
2204
1749
|
super({
|
|
2205
1750
|
...t,
|
|
2206
1751
|
minValue: t.minValue ?? 0,
|
|
2207
1752
|
maxValue: t.maxValue ?? 1e3,
|
|
2208
|
-
icon: t.icon ||
|
|
1753
|
+
icon: t.icon || st,
|
|
2209
1754
|
title: t.title || "Margin Top",
|
|
2210
1755
|
default: t.default ?? 20,
|
|
2211
1756
|
wrapperClassName: "margin-top-wrapper " + (t.wrapperClassName || "")
|
|
2212
1757
|
}), this.inputType = "number";
|
|
2213
1758
|
}
|
|
2214
1759
|
}
|
|
2215
|
-
const
|
|
1760
|
+
const nt = `
|
|
2216
1761
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
2217
1762
|
<polyline points="3,6 5,6 21,6"></polyline>
|
|
2218
1763
|
<path d="m19,6v14a2,2 0 0,1-2,2H7a2,2 0 0,1-2-2V6m3,0V4a2,2 0 0,1,2-2h4a2,2 0 0,1,2,2v2"></path>
|
|
2219
1764
|
<line x1="10" y1="11" x2="10" y2="17"></line>
|
|
2220
1765
|
<line x1="14" y1="11" x2="14" y2="17"></line>
|
|
2221
1766
|
</svg>
|
|
2222
|
-
`,
|
|
1767
|
+
`, at = `
|
|
2223
1768
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
2224
1769
|
<line x1="12" y1="5" x2="12" y2="19"></line>
|
|
2225
1770
|
<line x1="5" y1="12" x2="19" y2="12"></line>
|
|
@@ -2273,7 +1818,7 @@ class Nt extends p {
|
|
|
2273
1818
|
this.updateLanguageValue(t, r.value);
|
|
2274
1819
|
});
|
|
2275
1820
|
const o = document.createElement("button");
|
|
2276
|
-
return o.type = "button", o.classList.add("delete-language-btn"), o.innerHTML =
|
|
1821
|
+
return o.type = "button", o.classList.add("delete-language-btn"), o.innerHTML = nt, o.title = `Delete ${t.toUpperCase()}`, o.addEventListener("click", () => {
|
|
2277
1822
|
this.removeLanguage(t);
|
|
2278
1823
|
}), n.appendChild(a), n.appendChild(o), i.appendChild(s), i.appendChild(n), i;
|
|
2279
1824
|
}
|
|
@@ -2306,7 +1851,7 @@ class Nt extends p {
|
|
|
2306
1851
|
const s = document.createElement("select");
|
|
2307
1852
|
s.classList.add("add-language-select"), this.addLanguageSelect = s;
|
|
2308
1853
|
const n = document.createElement("button");
|
|
2309
|
-
return n.type = "button", n.classList.add("add-language-btn"), n.innerHTML = `${
|
|
1854
|
+
return n.type = "button", n.classList.add("add-language-btn"), n.innerHTML = `${at} Add`, this.addButton = n, n.addEventListener("click", () => {
|
|
2310
1855
|
const a = s.value;
|
|
2311
1856
|
a && this.addLanguage(a);
|
|
2312
1857
|
}), i.appendChild(s), i.appendChild(n), t.appendChild(e), t.appendChild(i), t;
|
|
@@ -2334,16 +1879,16 @@ class Nt extends p {
|
|
|
2334
1879
|
}), this.updateAddLanguageSelect());
|
|
2335
1880
|
}
|
|
2336
1881
|
}
|
|
2337
|
-
const
|
|
1882
|
+
const ot = `
|
|
2338
1883
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2339
1884
|
<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"/>
|
|
2340
1885
|
</svg>
|
|
2341
|
-
`,
|
|
1886
|
+
`, lt = `
|
|
2342
1887
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2343
1888
|
<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"/>
|
|
2344
1889
|
</svg>
|
|
2345
1890
|
`;
|
|
2346
|
-
class
|
|
1891
|
+
class St extends f {
|
|
2347
1892
|
constructor(t) {
|
|
2348
1893
|
super({
|
|
2349
1894
|
title: "Border",
|
|
@@ -2352,7 +1897,7 @@ class Ot extends g {
|
|
|
2352
1897
|
settings: {
|
|
2353
1898
|
size: new v({
|
|
2354
1899
|
title: "Size",
|
|
2355
|
-
icon:
|
|
1900
|
+
icon: lt,
|
|
2356
1901
|
default: (t == null ? void 0 : t.size) ?? 0,
|
|
2357
1902
|
suffix: "px"
|
|
2358
1903
|
}),
|
|
@@ -2361,7 +1906,7 @@ class Ot extends g {
|
|
|
2361
1906
|
}),
|
|
2362
1907
|
radius: new v({
|
|
2363
1908
|
title: "Radius",
|
|
2364
|
-
icon:
|
|
1909
|
+
icon: ot,
|
|
2365
1910
|
default: (t == null ? void 0 : t.radius) ?? 12,
|
|
2366
1911
|
suffix: "px"
|
|
2367
1912
|
})
|
|
@@ -2380,20 +1925,20 @@ class Ot extends g {
|
|
|
2380
1925
|
`;
|
|
2381
1926
|
}
|
|
2382
1927
|
}
|
|
2383
|
-
const
|
|
1928
|
+
const rt = `
|
|
2384
1929
|
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="13" viewBox="0 0 14 13" fill="none">
|
|
2385
1930
|
<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"/>
|
|
2386
1931
|
</svg>
|
|
2387
|
-
`,
|
|
1932
|
+
`, ht = `
|
|
2388
1933
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2389
1934
|
<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"/>
|
|
2390
1935
|
</svg>
|
|
2391
|
-
`,
|
|
1936
|
+
`, ct = `
|
|
2392
1937
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2393
1938
|
<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"/>
|
|
2394
1939
|
</svg>
|
|
2395
1940
|
`;
|
|
2396
|
-
class
|
|
1941
|
+
class It extends f {
|
|
2397
1942
|
constructor(t = {}) {
|
|
2398
1943
|
super({
|
|
2399
1944
|
title: t.title || "Typography",
|
|
@@ -2403,9 +1948,9 @@ class Ht extends g {
|
|
|
2403
1948
|
color: new C({
|
|
2404
1949
|
default: t.colorDefault ?? "0, 0, 30"
|
|
2405
1950
|
}),
|
|
2406
|
-
fontFamily: new
|
|
1951
|
+
fontFamily: new V({
|
|
2407
1952
|
title: "Font",
|
|
2408
|
-
icon:
|
|
1953
|
+
icon: rt,
|
|
2409
1954
|
default: t.fontFamilyDefault ?? "Satoshi",
|
|
2410
1955
|
options: t.fontFamilyOptions ?? [
|
|
2411
1956
|
{ name: "Alt", value: "Croco Sans Black Caps Alt" },
|
|
@@ -2416,9 +1961,9 @@ class Ht extends g {
|
|
|
2416
1961
|
getOptions: t.fontFamilyGetOptions,
|
|
2417
1962
|
getOptionsAsync: t.fontFamilyGetOptionsAsync
|
|
2418
1963
|
}),
|
|
2419
|
-
fontWeight: new
|
|
1964
|
+
fontWeight: new V({
|
|
2420
1965
|
title: "Weight",
|
|
2421
|
-
icon:
|
|
1966
|
+
icon: ht,
|
|
2422
1967
|
default: t.fontWeightDefault ?? "400",
|
|
2423
1968
|
options: t.fontWeightOptions ?? [
|
|
2424
1969
|
{ name: "Regular", value: "400" },
|
|
@@ -2430,12 +1975,12 @@ class Ht extends g {
|
|
|
2430
1975
|
}),
|
|
2431
1976
|
fontSize: new v({
|
|
2432
1977
|
title: "Size",
|
|
2433
|
-
icon:
|
|
1978
|
+
icon: ct,
|
|
2434
1979
|
default: t.fontSizeDefault ?? 12,
|
|
2435
1980
|
suffix: "px",
|
|
2436
1981
|
mobile: t.fontSizeMobileDefault
|
|
2437
1982
|
}),
|
|
2438
|
-
align: new
|
|
1983
|
+
align: new _({
|
|
2439
1984
|
title: "Align",
|
|
2440
1985
|
default: t.alignDefault ?? "center"
|
|
2441
1986
|
})
|
|
@@ -2453,7 +1998,7 @@ class Ht extends g {
|
|
|
2453
1998
|
`;
|
|
2454
1999
|
}
|
|
2455
2000
|
}
|
|
2456
|
-
class
|
|
2001
|
+
class L extends p {
|
|
2457
2002
|
constructor(t) {
|
|
2458
2003
|
super({
|
|
2459
2004
|
...t,
|
|
@@ -2499,34 +2044,34 @@ class x extends p {
|
|
|
2499
2044
|
}), i;
|
|
2500
2045
|
}
|
|
2501
2046
|
}
|
|
2502
|
-
class
|
|
2047
|
+
class Ot extends f {
|
|
2503
2048
|
constructor(t) {
|
|
2504
2049
|
super({
|
|
2505
2050
|
title: "Margins",
|
|
2506
2051
|
collapsed: t == null ? void 0 : t.collapsed,
|
|
2507
2052
|
hideCondition: t == null ? void 0 : t.hideCondition,
|
|
2508
2053
|
settings: {
|
|
2509
|
-
marginTop: new
|
|
2054
|
+
marginTop: new L({
|
|
2510
2055
|
title: "Top",
|
|
2511
|
-
icon:
|
|
2056
|
+
icon: ut,
|
|
2512
2057
|
suffix: "px",
|
|
2513
2058
|
default: (t == null ? void 0 : t.marginTop) ?? "auto"
|
|
2514
2059
|
}),
|
|
2515
|
-
marginRight: new
|
|
2060
|
+
marginRight: new L({
|
|
2516
2061
|
title: "Right",
|
|
2517
|
-
icon:
|
|
2062
|
+
icon: dt,
|
|
2518
2063
|
suffix: "px",
|
|
2519
2064
|
default: (t == null ? void 0 : t.marginRight) ?? 0
|
|
2520
2065
|
}),
|
|
2521
|
-
marginBottom: new
|
|
2066
|
+
marginBottom: new L({
|
|
2522
2067
|
title: "Bottom",
|
|
2523
|
-
icon:
|
|
2068
|
+
icon: pt,
|
|
2524
2069
|
suffix: "px",
|
|
2525
2070
|
default: (t == null ? void 0 : t.marginBottom) ?? 0
|
|
2526
2071
|
}),
|
|
2527
|
-
marginLeft: new
|
|
2072
|
+
marginLeft: new L({
|
|
2528
2073
|
title: "Left",
|
|
2529
|
-
icon:
|
|
2074
|
+
icon: gt,
|
|
2530
2075
|
suffix: "px",
|
|
2531
2076
|
default: (t == null ? void 0 : t.marginLeft) ?? 0
|
|
2532
2077
|
})
|
|
@@ -2543,16 +2088,16 @@ class Bt extends g {
|
|
|
2543
2088
|
`;
|
|
2544
2089
|
}
|
|
2545
2090
|
}
|
|
2546
|
-
const
|
|
2091
|
+
const ut = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2547
2092
|
<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"/>
|
|
2548
|
-
</svg>`,
|
|
2093
|
+
</svg>`, dt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2549
2094
|
<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"/>
|
|
2550
|
-
</svg>`,
|
|
2095
|
+
</svg>`, pt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2551
2096
|
<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"/>
|
|
2552
|
-
</svg>`,
|
|
2097
|
+
</svg>`, gt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2553
2098
|
<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"/>
|
|
2554
2099
|
</svg>`;
|
|
2555
|
-
class
|
|
2100
|
+
class Ht extends f {
|
|
2556
2101
|
/**
|
|
2557
2102
|
* Constructs a new BackgroundSettingSet.
|
|
2558
2103
|
*
|
|
@@ -2582,11 +2127,11 @@ class At extends g {
|
|
|
2582
2127
|
collapsed: t == null ? void 0 : t.collapsed,
|
|
2583
2128
|
hideCondition: t == null ? void 0 : t.hideCondition,
|
|
2584
2129
|
settings: {
|
|
2585
|
-
backgroundImage: new
|
|
2130
|
+
backgroundImage: new X({
|
|
2586
2131
|
...t == null ? void 0 : t.uploadProps,
|
|
2587
2132
|
default: (t == null ? void 0 : t.backgroundImage) ?? ""
|
|
2588
2133
|
}),
|
|
2589
|
-
opacity: new
|
|
2134
|
+
opacity: new D({
|
|
2590
2135
|
default: (t == null ? void 0 : t.opacity) ?? 100
|
|
2591
2136
|
}),
|
|
2592
2137
|
backgroundColor: new C({
|
|
@@ -2621,158 +2166,43 @@ class At extends g {
|
|
|
2621
2166
|
`;
|
|
2622
2167
|
}
|
|
2623
2168
|
}
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
super({
|
|
2627
|
-
title: `Tab ${t + 1}`,
|
|
2628
|
-
hideCondition: i == null ? void 0 : i.hideCondition,
|
|
2629
|
-
collapsed: i == null ? void 0 : i.collapsed,
|
|
2630
|
-
settings: {
|
|
2631
|
-
name: new k({
|
|
2632
|
-
title: "Tab Name",
|
|
2633
|
-
default: `Tab ${t + 1}`
|
|
2634
|
-
}),
|
|
2635
|
-
content: new k({
|
|
2636
|
-
title: "Content",
|
|
2637
|
-
default: ""
|
|
2638
|
-
})
|
|
2639
|
-
}
|
|
2640
|
-
}), this.onDeleteCallback = e;
|
|
2641
|
-
}
|
|
2642
|
-
draw() {
|
|
2643
|
-
const t = super.draw(), e = t.querySelector(".setting-group-arrow");
|
|
2644
|
-
e && e.parentElement && e.parentElement.removeChild(e);
|
|
2645
|
-
const i = t.querySelector(".setting-group-title");
|
|
2646
|
-
if (i) {
|
|
2647
|
-
const s = document.createElement("div");
|
|
2648
|
-
s.className = "tab-delete-container";
|
|
2649
|
-
const n = document.createElement("button");
|
|
2650
|
-
n.className = "tab-delete-button", n.innerHTML = `
|
|
2651
|
-
<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">
|
|
2652
|
-
<polyline points="3 6 5 6 21 6"></polyline>
|
|
2653
|
-
<path d="M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6"></path>
|
|
2654
|
-
<path d="M10 11v6"></path>
|
|
2655
|
-
<path d="M14 11v6"></path>
|
|
2656
|
-
<path d="M9 6V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2"></path>
|
|
2657
|
-
</svg>
|
|
2658
|
-
`, n.onclick = () => {
|
|
2659
|
-
var o;
|
|
2660
|
-
return (o = this.onDeleteCallback) == null ? void 0 : o.call(this);
|
|
2661
|
-
}, s.appendChild(n);
|
|
2662
|
-
const a = i.querySelector("h3");
|
|
2663
|
-
a ? a.insertAdjacentElement("afterend", s) : i.appendChild(s);
|
|
2664
|
-
}
|
|
2665
|
-
return t;
|
|
2666
|
-
}
|
|
2667
|
-
}
|
|
2668
|
-
class $t extends g {
|
|
2669
|
-
// Store the rendered element
|
|
2670
|
-
constructor(t) {
|
|
2671
|
-
super({
|
|
2672
|
-
title: "Tabs",
|
|
2673
|
-
settings: {},
|
|
2674
|
-
hideCondition: t == null ? void 0 : t.hideCondition,
|
|
2675
|
-
collapsed: t == null ? void 0 : t.collapsed
|
|
2676
|
-
}), this.tabs = [], this._el = null, this.addTab();
|
|
2677
|
-
}
|
|
2678
|
-
/** Adds a new tab. */
|
|
2679
|
-
addTab(t) {
|
|
2680
|
-
const e = this.tabs.length, i = new vt(
|
|
2681
|
-
e,
|
|
2682
|
-
() => this.removeTab(i),
|
|
2683
|
-
t
|
|
2684
|
-
);
|
|
2685
|
-
this.tabs.push(i), this.settings[`Tab ${e + 1}`] = i;
|
|
2686
|
-
}
|
|
2687
|
-
/** Removes a specific tab. */
|
|
2688
|
-
removeTab(t) {
|
|
2689
|
-
const e = this.tabs.indexOf(t);
|
|
2690
|
-
e >= 0 && (this.tabs.splice(e, 1), delete this.settings[`Tab ${e + 1}`], this.relabelTabs(), this.rerender());
|
|
2691
|
-
}
|
|
2692
|
-
/** Relabels tabs sequentially after removal. */
|
|
2693
|
-
relabelTabs() {
|
|
2694
|
-
this.settings = {}, this.tabs.forEach((t, e) => {
|
|
2695
|
-
t.title = `Tab ${e + 1}`, this.settings[`Tab ${e + 1}`] = t;
|
|
2696
|
-
});
|
|
2697
|
-
}
|
|
2698
|
-
/**
|
|
2699
|
-
* Override draw() so we can store the created DOM element
|
|
2700
|
-
* and add the "Add Tab" button in a container positioned at the bottom-right.
|
|
2701
|
-
*/
|
|
2702
|
-
draw() {
|
|
2703
|
-
const t = super.draw();
|
|
2704
|
-
this._el = t;
|
|
2705
|
-
const e = document.createElement("div");
|
|
2706
|
-
e.className = "tabs-add-btn-container";
|
|
2707
|
-
const i = document.createElement("button");
|
|
2708
|
-
return i.className = "tabs-add-button", i.innerHTML = `
|
|
2709
|
-
<span class="add-icon">
|
|
2710
|
-
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" stroke="#667085">
|
|
2711
|
-
<g id="SVGRepo_bgCarrier" stroke-width="0"></g>
|
|
2712
|
-
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>
|
|
2713
|
-
<g id="SVGRepo_iconCarrier">
|
|
2714
|
-
<g id="Edit / Add_Plus">
|
|
2715
|
-
<path id="Vector" d="M6 12H12M12 12H18M12 12V18M12 12V6" stroke="#667085" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
2716
|
-
</g>
|
|
2717
|
-
</g>
|
|
2718
|
-
</svg>
|
|
2719
|
-
</span>
|
|
2720
|
-
<span class="add-label">Add Tab</span>
|
|
2721
|
-
`, i.onclick = () => {
|
|
2722
|
-
this.addTab(), this.rerender();
|
|
2723
|
-
}, e.appendChild(i), t.appendChild(e), t;
|
|
2724
|
-
}
|
|
2725
|
-
/**
|
|
2726
|
-
* Re-renders the inner settings content based on the current tabs.
|
|
2727
|
-
*/
|
|
2728
|
-
rerender() {
|
|
2729
|
-
if (!this._el) return;
|
|
2730
|
-
const t = this._el.querySelector(".setting-group-content");
|
|
2731
|
-
t && (t.innerHTML = "", Object.keys(this.settings).forEach((e) => {
|
|
2732
|
-
const i = this.settings[e];
|
|
2733
|
-
t.appendChild(i.draw());
|
|
2734
|
-
}));
|
|
2735
|
-
}
|
|
2736
|
-
}
|
|
2737
|
-
function Rt(c) {
|
|
2738
|
-
return c instanceof g;
|
|
2169
|
+
function Tt(c) {
|
|
2170
|
+
return c instanceof f;
|
|
2739
2171
|
}
|
|
2740
|
-
function
|
|
2172
|
+
function Bt(c) {
|
|
2741
2173
|
return c instanceof p;
|
|
2742
2174
|
}
|
|
2743
2175
|
export {
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2176
|
+
_ as AlignSetting,
|
|
2177
|
+
Ht as BackgroundSettingSet,
|
|
2178
|
+
St as BorderSettingSet,
|
|
2179
|
+
wt as ButtonSetting,
|
|
2180
|
+
m as ColorSetting,
|
|
2749
2181
|
C as ColorWithOpacitySetting,
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2182
|
+
Et as DimensionSetting,
|
|
2183
|
+
kt as GapSetting,
|
|
2184
|
+
It as HeaderTypographySettingSet,
|
|
2185
|
+
bt as HeightSetting,
|
|
2186
|
+
Ct as HtmlSetting,
|
|
2187
|
+
Mt as MarginBottomSetting,
|
|
2188
|
+
Ot as MarginSettingGroup,
|
|
2189
|
+
Vt as MarginTopSetting,
|
|
2758
2190
|
Nt as MultiLanguageSetting,
|
|
2759
2191
|
v as NumberSetting,
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2192
|
+
D as OpacitySetting,
|
|
2193
|
+
xt as SelectApiSettings,
|
|
2194
|
+
V as SelectSetting,
|
|
2763
2195
|
p as Setting,
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
Rt as isSettingGroup,
|
|
2777
|
-
L as iterateSettings
|
|
2196
|
+
f as SettingGroup,
|
|
2197
|
+
j as StringSetting,
|
|
2198
|
+
ft as TabSettingGroup,
|
|
2199
|
+
ft as TabsSettingGroup,
|
|
2200
|
+
yt as Toggle,
|
|
2201
|
+
X as UploadSetting,
|
|
2202
|
+
Lt as WidthSetting,
|
|
2203
|
+
vt as asSettingGroupWithSettings,
|
|
2204
|
+
z as createSettingGroup,
|
|
2205
|
+
Bt as isSetting,
|
|
2206
|
+
Tt as isSettingGroup,
|
|
2207
|
+
b as iterateSettings
|
|
2778
2208
|
};
|