builder-settings-types 0.0.219 → 0.0.220
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 +101 -29
- package/dist/builder-settings-types.es.js +480 -316
- package/dist/index.d.ts +6 -0
- package/package.json +1 -1
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
const O = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
2
|
-
let I = (
|
|
3
|
-
let t = "", e = crypto.getRandomValues(new Uint8Array(
|
|
4
|
-
for (;
|
|
5
|
-
t += O[e[
|
|
2
|
+
let I = (h = 21) => {
|
|
3
|
+
let t = "", e = crypto.getRandomValues(new Uint8Array(h |= 0));
|
|
4
|
+
for (; h--; )
|
|
5
|
+
t += O[e[h] & 63];
|
|
6
6
|
return t;
|
|
7
7
|
};
|
|
8
|
-
function
|
|
9
|
-
if (
|
|
10
|
-
return
|
|
11
|
-
if (
|
|
12
|
-
return new Date(
|
|
13
|
-
if (Array.isArray(
|
|
8
|
+
function x(h) {
|
|
9
|
+
if (h === null || typeof h != "object")
|
|
10
|
+
return h;
|
|
11
|
+
if (h instanceof Date)
|
|
12
|
+
return new Date(h.getTime());
|
|
13
|
+
if (Array.isArray(h)) {
|
|
14
14
|
const i = [];
|
|
15
|
-
for (let s = 0; s <
|
|
16
|
-
i[s] =
|
|
15
|
+
for (let s = 0; s < h.length; s++)
|
|
16
|
+
i[s] = x(h[s]);
|
|
17
17
|
return i;
|
|
18
18
|
}
|
|
19
19
|
const t = {};
|
|
20
|
-
for (const i in
|
|
21
|
-
Object.prototype.hasOwnProperty.call(
|
|
22
|
-
const e = Object.getPrototypeOf(
|
|
20
|
+
for (const i in h)
|
|
21
|
+
Object.prototype.hasOwnProperty.call(h, i) && (t[i] = x(h[i]));
|
|
22
|
+
const e = Object.getPrototypeOf(h);
|
|
23
23
|
return e !== Object.prototype && Object.setPrototypeOf(t, e), t;
|
|
24
24
|
}
|
|
25
|
-
function H(
|
|
26
|
-
switch (
|
|
25
|
+
function H(h) {
|
|
26
|
+
switch (h) {
|
|
27
27
|
case "number":
|
|
28
28
|
return 0;
|
|
29
29
|
case "text":
|
|
@@ -60,58 +60,58 @@ class g {
|
|
|
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 };
|
|
68
68
|
const e = document.createElement("div");
|
|
69
69
|
if (e.className = t.wrapperClassName || "", t.title || t.icon) {
|
|
70
|
-
const
|
|
71
|
-
if (
|
|
70
|
+
const a = document.createElement("div");
|
|
71
|
+
if (a.className = "icon-container", t.icon) {
|
|
72
72
|
const l = this.createIcon(t.icon, t.iconClassName);
|
|
73
|
-
|
|
73
|
+
a.appendChild(l);
|
|
74
74
|
}
|
|
75
75
|
if (t.title) {
|
|
76
76
|
const l = this.createLabel(t.title, t.labelClassName);
|
|
77
|
-
|
|
77
|
+
a.appendChild(l);
|
|
78
78
|
}
|
|
79
|
-
e.appendChild(
|
|
79
|
+
e.appendChild(a);
|
|
80
80
|
}
|
|
81
81
|
const i = document.createElement("div");
|
|
82
82
|
i.className = t.wrapperClassName || "";
|
|
83
83
|
const s = document.createElement("input");
|
|
84
84
|
this.inputEl = s, s.value = String(t.value || H(t.inputType)), s.type = t.inputType, s.placeholder = t.placeholder || "", s.className = t.inputClassName || "";
|
|
85
|
-
const n = (
|
|
86
|
-
const l =
|
|
87
|
-
let
|
|
85
|
+
const n = (a) => {
|
|
86
|
+
const l = a.target;
|
|
87
|
+
let c = l.value;
|
|
88
88
|
switch (t.inputType) {
|
|
89
89
|
case "number":
|
|
90
|
-
|
|
90
|
+
c = Number(l.value);
|
|
91
91
|
break;
|
|
92
92
|
case "color":
|
|
93
|
-
|
|
93
|
+
c = l.value;
|
|
94
94
|
break;
|
|
95
95
|
case "date":
|
|
96
|
-
|
|
96
|
+
c = l.value;
|
|
97
97
|
break;
|
|
98
98
|
case "select":
|
|
99
|
-
|
|
99
|
+
c = l.value;
|
|
100
100
|
break;
|
|
101
101
|
case "text":
|
|
102
|
-
|
|
102
|
+
c = l.value;
|
|
103
103
|
break;
|
|
104
104
|
case "button":
|
|
105
|
-
|
|
105
|
+
c = l.value;
|
|
106
106
|
break;
|
|
107
107
|
default:
|
|
108
|
-
|
|
108
|
+
c = l.value;
|
|
109
109
|
}
|
|
110
|
-
this.value =
|
|
111
|
-
},
|
|
112
|
-
|
|
110
|
+
this.value = c, this.onChange && this.onChange(this.value), this.props.detectChange && this.props.detectChange(this.value);
|
|
111
|
+
}, o = (a) => {
|
|
112
|
+
a.target, this.onBlur && this.onBlur(this.value);
|
|
113
113
|
};
|
|
114
|
-
return s.addEventListener("input", n), s.addEventListener("change", n), s.addEventListener("blur",
|
|
114
|
+
return s.addEventListener("input", n), s.addEventListener("change", n), s.addEventListener("blur", o), t.inputCustomizer && t.inputCustomizer(s), i.appendChild(s), e.appendChild(i), e;
|
|
115
115
|
}
|
|
116
116
|
createLabel(t, e) {
|
|
117
117
|
const i = document.createElement("span");
|
|
@@ -122,20 +122,20 @@ class g {
|
|
|
122
122
|
return i.className = "input-icon " + (e || ""), i.innerHTML = t, i;
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
function T(
|
|
126
|
-
let t = 0, e =
|
|
125
|
+
function T(h) {
|
|
126
|
+
let t = 0, e = h.parentElement;
|
|
127
127
|
for (; e; )
|
|
128
|
-
e.classList.contains("setting-group") && e !==
|
|
128
|
+
e.classList.contains("setting-group") && e !== h && t++, e = e.parentElement;
|
|
129
129
|
return t;
|
|
130
130
|
}
|
|
131
|
-
function b(
|
|
131
|
+
function b(h, t) {
|
|
132
132
|
const e = Math.min(Math.max(t, 0), 5);
|
|
133
|
-
|
|
133
|
+
h.setAttribute("data-nesting-level", e.toString()), e > 0 ? h.style.setProperty("--visual-indent", `${e * 2}px`) : (h.style.removeProperty("--visual-indent"), h.style.marginLeft = "");
|
|
134
134
|
}
|
|
135
|
-
function
|
|
136
|
-
|
|
135
|
+
function k(h, t = 0) {
|
|
136
|
+
h.querySelectorAll(":scope > .setting-group-content > .setting-group").forEach((i) => {
|
|
137
137
|
const s = i, n = t + 1;
|
|
138
|
-
b(s, n),
|
|
138
|
+
b(s, n), k(s, n);
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
141
|
const B = {
|
|
@@ -229,10 +229,10 @@ class A {
|
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
231
|
const N = new A();
|
|
232
|
-
function w(
|
|
233
|
-
for (const e in
|
|
234
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
235
|
-
const i =
|
|
232
|
+
function w(h, t) {
|
|
233
|
+
for (const e in h)
|
|
234
|
+
if (Object.prototype.hasOwnProperty.call(h, e)) {
|
|
235
|
+
const i = h[e];
|
|
236
236
|
t(e, i);
|
|
237
237
|
}
|
|
238
238
|
}
|
|
@@ -254,7 +254,7 @@ const p = class p {
|
|
|
254
254
|
this.nestingLevel = t, this.propagateNestingLevel(), this.elementRef && this.updateNestingStyles();
|
|
255
255
|
}
|
|
256
256
|
updateNestingStyles() {
|
|
257
|
-
this.elementRef && (b(this.elementRef, this.nestingLevel),
|
|
257
|
+
this.elementRef && (b(this.elementRef, this.nestingLevel), k(this.elementRef, this.nestingLevel));
|
|
258
258
|
}
|
|
259
259
|
static hide() {
|
|
260
260
|
this.hiddenElements.forEach((t) => {
|
|
@@ -281,15 +281,15 @@ const p = class p {
|
|
|
281
281
|
var n;
|
|
282
282
|
if (s instanceof p)
|
|
283
283
|
s.setOnChange(() => {
|
|
284
|
-
const
|
|
285
|
-
this.initialValues =
|
|
284
|
+
const o = this.getValues();
|
|
285
|
+
this.initialValues = o, t(o);
|
|
286
286
|
}), this.changeHandlers.add(() => t(this.getValues()));
|
|
287
287
|
else if (s instanceof g) {
|
|
288
|
-
const
|
|
289
|
-
this.changeHandlers.add(
|
|
288
|
+
const o = () => e();
|
|
289
|
+
this.changeHandlers.add(o), s.setOnChange(o);
|
|
290
290
|
} else {
|
|
291
|
-
const
|
|
292
|
-
this.changeHandlers.add(
|
|
291
|
+
const o = () => e();
|
|
292
|
+
this.changeHandlers.add(o), (n = s.setOnChange) == null || n.call(s, o);
|
|
293
293
|
}
|
|
294
294
|
}), this;
|
|
295
295
|
}
|
|
@@ -345,9 +345,9 @@ const p = class p {
|
|
|
345
345
|
Object.entries(t).forEach(([i, s]) => {
|
|
346
346
|
let n = this.settings[i];
|
|
347
347
|
if (!n && this.addItemCfg && i.startsWith(this.addItemCfg.keyPrefix)) {
|
|
348
|
-
const
|
|
349
|
-
if (Number.isFinite(
|
|
350
|
-
const l = this.addItemCfg.createItem(
|
|
348
|
+
const o = i.slice(this.addItemCfg.keyPrefix.length), a = Number(o);
|
|
349
|
+
if (Number.isFinite(a)) {
|
|
350
|
+
const l = this.addItemCfg.createItem(a);
|
|
351
351
|
this.addSetting(i, l), n = l;
|
|
352
352
|
}
|
|
353
353
|
}
|
|
@@ -378,16 +378,16 @@ const p = class p {
|
|
|
378
378
|
wireChild(t) {
|
|
379
379
|
var i, s, n;
|
|
380
380
|
const e = () => {
|
|
381
|
-
var
|
|
382
|
-
const
|
|
383
|
-
this.initialValues =
|
|
381
|
+
var a;
|
|
382
|
+
const o = this.getValues();
|
|
383
|
+
this.initialValues = o, (a = this.onChange) == null || a.call(this, o), this.updateVisibility();
|
|
384
384
|
};
|
|
385
385
|
t instanceof p ? (t.setOnChange(() => e()), (i = t.setOnBlur) == null || i.call(t, () => {
|
|
386
|
-
var
|
|
387
|
-
return (
|
|
386
|
+
var o;
|
|
387
|
+
return (o = this.onBlur) == null ? void 0 : o.call(this);
|
|
388
388
|
})) : t instanceof g ? (t.setOnChange(() => e()), (s = t.setOnBlur) == null || s.call(t, () => {
|
|
389
|
-
var
|
|
390
|
-
return (
|
|
389
|
+
var o;
|
|
390
|
+
return (o = this.onBlur) == null ? void 0 : o.call(this);
|
|
391
391
|
})) : (n = t.setOnChange) == null || n.call(t, () => e());
|
|
392
392
|
}
|
|
393
393
|
addSetting(t, e) {
|
|
@@ -398,15 +398,179 @@ const p = class p {
|
|
|
398
398
|
);
|
|
399
399
|
if (n) {
|
|
400
400
|
e instanceof p && e.setNestingLevel(this.nestingLevel + 1);
|
|
401
|
-
const
|
|
402
|
-
|
|
403
|
-
const
|
|
404
|
-
a
|
|
401
|
+
const o = e.draw();
|
|
402
|
+
this.addItemCfg && this.addItemCfg.showDeleteButton !== !1 && t.startsWith(this.addItemCfg.keyPrefix) && this.addDeleteButtonToElement(o, t);
|
|
403
|
+
const a = n.querySelector(".sg-add-button-bottom");
|
|
404
|
+
a ? n.insertBefore(o, a) : n.appendChild(o), N.trackElement(o), b(o, this.nestingLevel + 1), k(o, this.nestingLevel + 1);
|
|
405
|
+
const l = o.style.display;
|
|
406
|
+
o.style.display = "none", o.offsetHeight, o.style.display = l, this.updateNestingStyles();
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
const i = this.getValues();
|
|
410
|
+
this.initialValues = i, (s = this.onChange) == null || s.call(this, i);
|
|
411
|
+
}
|
|
412
|
+
removeSetting(t) {
|
|
413
|
+
var s;
|
|
414
|
+
const e = this.settings[t];
|
|
415
|
+
if (!e) return;
|
|
416
|
+
if (delete this.settings[t], this.elementRef) {
|
|
417
|
+
const n = this.elementRef.querySelector(
|
|
418
|
+
".setting-group-content"
|
|
419
|
+
);
|
|
420
|
+
if (n) {
|
|
421
|
+
const o = Array.from(
|
|
422
|
+
n.querySelectorAll(".setting-group, .setting")
|
|
423
|
+
);
|
|
424
|
+
for (const a of o) {
|
|
425
|
+
const l = a.id;
|
|
426
|
+
if (l && l.includes(e.id)) {
|
|
427
|
+
a.remove();
|
|
428
|
+
break;
|
|
429
|
+
}
|
|
430
|
+
}
|
|
405
431
|
}
|
|
406
432
|
}
|
|
433
|
+
typeof e.cleanup == "function" && e.cleanup(), this.updateNestingStyles();
|
|
407
434
|
const i = this.getValues();
|
|
408
435
|
this.initialValues = i, (s = this.onChange) == null || s.call(this, i);
|
|
409
436
|
}
|
|
437
|
+
addDeleteButtonToElement(t, e) {
|
|
438
|
+
var l, c;
|
|
439
|
+
const i = t.querySelector(".setting-group-title");
|
|
440
|
+
if (!i) return;
|
|
441
|
+
const s = i.querySelector(".actions-section");
|
|
442
|
+
if (!s) return;
|
|
443
|
+
const n = document.createElement("button");
|
|
444
|
+
n.type = "button", n.className = "sg-delete-button", n.title = ((l = this.addItemCfg) == null ? void 0 : l.deleteButtonLabel) || "Delete", n.style.cssText = `
|
|
445
|
+
background: none;
|
|
446
|
+
border: none;
|
|
447
|
+
cursor: pointer;
|
|
448
|
+
padding: 4px;
|
|
449
|
+
margin-left: 8px;
|
|
450
|
+
color: #ef4444;
|
|
451
|
+
display: flex;
|
|
452
|
+
align-items: center;
|
|
453
|
+
justify-content: center;
|
|
454
|
+
border-radius: 4px;
|
|
455
|
+
transition: background-color 0.2s;
|
|
456
|
+
`;
|
|
457
|
+
const o = ((c = this.addItemCfg) == null ? void 0 : c.deleteButtonIconSvg) || `
|
|
458
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
459
|
+
<path d="M2 4h12M5.333 4V2.667a1.333 1.333 0 0 1 1.334-1.334h2.666a1.333 1.333 0 0 1 1.334 1.334V4m2 0v9.333a1.333 1.333 0 0 1-1.334 1.334H4.667a1.333 1.333 0 0 1-1.334-1.334V4h8.667Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
460
|
+
<path d="M6.667 7.333v4M9.333 7.333v4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
461
|
+
</svg>
|
|
462
|
+
`;
|
|
463
|
+
n.innerHTML = o, n.addEventListener("mouseenter", () => {
|
|
464
|
+
n.style.backgroundColor = "#fef2f2";
|
|
465
|
+
}), n.addEventListener("mouseleave", () => {
|
|
466
|
+
n.style.backgroundColor = "transparent";
|
|
467
|
+
}), n.addEventListener("click", (r) => {
|
|
468
|
+
r.stopPropagation(), r.preventDefault(), this.showDeleteConfirmation().then((d) => {
|
|
469
|
+
d && this.removeSetting(e);
|
|
470
|
+
});
|
|
471
|
+
});
|
|
472
|
+
const a = s.querySelector(".setting-group-arrow");
|
|
473
|
+
a ? s.insertBefore(n, a) : s.appendChild(n);
|
|
474
|
+
}
|
|
475
|
+
showDeleteConfirmation() {
|
|
476
|
+
return new Promise((t) => {
|
|
477
|
+
const e = document.createElement("div");
|
|
478
|
+
e.className = "sg-modal-overlay", e.style.cssText = `
|
|
479
|
+
position: fixed;
|
|
480
|
+
top: 0;
|
|
481
|
+
left: 0;
|
|
482
|
+
right: 0;
|
|
483
|
+
bottom: 0;
|
|
484
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
485
|
+
display: flex;
|
|
486
|
+
align-items: center;
|
|
487
|
+
justify-content: center;
|
|
488
|
+
z-index: 10000;
|
|
489
|
+
backdrop-filter: blur(2px);
|
|
490
|
+
`;
|
|
491
|
+
const i = document.createElement("div");
|
|
492
|
+
i.className = "sg-confirmation-modal", i.style.cssText = `
|
|
493
|
+
background: white;
|
|
494
|
+
border-radius: 8px;
|
|
495
|
+
padding: 24px;
|
|
496
|
+
max-width: 400px;
|
|
497
|
+
width: 90%;
|
|
498
|
+
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
|
499
|
+
transform: scale(0.95);
|
|
500
|
+
transition: transform 0.2s ease-out;
|
|
501
|
+
`;
|
|
502
|
+
const s = document.createElement("h3");
|
|
503
|
+
s.textContent = "Confirm Deletion", s.style.cssText = `
|
|
504
|
+
margin: 0 0 12px 0;
|
|
505
|
+
font-size: 18px;
|
|
506
|
+
font-weight: 600;
|
|
507
|
+
color: #1f2937;
|
|
508
|
+
`;
|
|
509
|
+
const n = document.createElement("p");
|
|
510
|
+
n.textContent = "Are you sure you want to delete this item? This action cannot be undone.", n.style.cssText = `
|
|
511
|
+
margin: 0 0 24px 0;
|
|
512
|
+
color: #6b7280;
|
|
513
|
+
font-size: 14px;
|
|
514
|
+
line-height: 1.5;
|
|
515
|
+
`;
|
|
516
|
+
const o = document.createElement("div");
|
|
517
|
+
o.style.cssText = `
|
|
518
|
+
display: flex;
|
|
519
|
+
gap: 12px;
|
|
520
|
+
justify-content: flex-end;
|
|
521
|
+
`;
|
|
522
|
+
const a = document.createElement("button");
|
|
523
|
+
a.textContent = "Cancel", a.type = "button", a.style.cssText = `
|
|
524
|
+
padding: 8px 16px;
|
|
525
|
+
border: 1px solid #d1d5db;
|
|
526
|
+
background: white;
|
|
527
|
+
color: #374151;
|
|
528
|
+
border-radius: 6px;
|
|
529
|
+
font-size: 14px;
|
|
530
|
+
font-weight: 500;
|
|
531
|
+
cursor: pointer;
|
|
532
|
+
transition: all 0.2s;
|
|
533
|
+
`;
|
|
534
|
+
const l = document.createElement("button");
|
|
535
|
+
l.textContent = "Delete", l.type = "button", l.style.cssText = `
|
|
536
|
+
padding: 8px 16px;
|
|
537
|
+
border: none;
|
|
538
|
+
background: #ef4444;
|
|
539
|
+
color: white;
|
|
540
|
+
border-radius: 6px;
|
|
541
|
+
font-size: 14px;
|
|
542
|
+
font-weight: 500;
|
|
543
|
+
cursor: pointer;
|
|
544
|
+
transition: all 0.2s;
|
|
545
|
+
`, a.addEventListener("mouseenter", () => {
|
|
546
|
+
a.style.backgroundColor = "#f9fafb", a.style.borderColor = "#9ca3af";
|
|
547
|
+
}), a.addEventListener("mouseleave", () => {
|
|
548
|
+
a.style.backgroundColor = "white", a.style.borderColor = "#d1d5db";
|
|
549
|
+
}), l.addEventListener("mouseenter", () => {
|
|
550
|
+
l.style.backgroundColor = "#dc2626";
|
|
551
|
+
}), l.addEventListener("mouseleave", () => {
|
|
552
|
+
l.style.backgroundColor = "#ef4444";
|
|
553
|
+
});
|
|
554
|
+
const c = () => {
|
|
555
|
+
e.style.opacity = "0", i.style.transform = "scale(0.95)", setTimeout(() => {
|
|
556
|
+
e.parentNode && e.parentNode.removeChild(e);
|
|
557
|
+
}, 200);
|
|
558
|
+
};
|
|
559
|
+
a.addEventListener("click", () => {
|
|
560
|
+
c(), t(!1);
|
|
561
|
+
}), l.addEventListener("click", () => {
|
|
562
|
+
c(), t(!0);
|
|
563
|
+
}), e.addEventListener("click", (d) => {
|
|
564
|
+
d.target === e && (c(), t(!1));
|
|
565
|
+
});
|
|
566
|
+
const r = (d) => {
|
|
567
|
+
d.key === "Escape" && (c(), t(!1), document.removeEventListener("keydown", r));
|
|
568
|
+
};
|
|
569
|
+
document.addEventListener("keydown", r), o.appendChild(a), o.appendChild(l), i.appendChild(s), i.appendChild(n), i.appendChild(o), e.appendChild(i), document.body.appendChild(e), requestAnimationFrame(() => {
|
|
570
|
+
e.style.opacity = "1", i.style.transform = "scale(1)";
|
|
571
|
+
}), setTimeout(() => l.focus(), 100);
|
|
572
|
+
});
|
|
573
|
+
}
|
|
410
574
|
getNextIndexFromPrefix(t) {
|
|
411
575
|
const e = Object.keys(this.settings).filter((i) => i.startsWith(t)).map((i) => {
|
|
412
576
|
const s = Number(i.slice(t.length));
|
|
@@ -420,8 +584,8 @@ const p = class p {
|
|
|
420
584
|
...Object.keys(t),
|
|
421
585
|
...Object.keys(e)
|
|
422
586
|
])).forEach((n) => {
|
|
423
|
-
const
|
|
424
|
-
JSON.stringify(
|
|
587
|
+
const o = t[n], a = e[n];
|
|
588
|
+
JSON.stringify(o) !== JSON.stringify(a) && (i[n] = { from: o, to: a });
|
|
425
589
|
}), i;
|
|
426
590
|
}
|
|
427
591
|
hide() {
|
|
@@ -540,23 +704,23 @@ const p = class p {
|
|
|
540
704
|
</svg>
|
|
541
705
|
`, r.title = this.description, n.appendChild(r);
|
|
542
706
|
}
|
|
543
|
-
const
|
|
544
|
-
|
|
707
|
+
const o = document.createElement("span");
|
|
708
|
+
o.className = "setting-group-arrow", o.innerHTML = `
|
|
545
709
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
546
710
|
<path d="M4 6L8 10L12 6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
547
711
|
</svg>
|
|
548
|
-
`, this.isCollapsed &&
|
|
549
|
-
const
|
|
550
|
-
if (
|
|
712
|
+
`, this.isCollapsed && o.classList.add("rotated"), n.appendChild(o);
|
|
713
|
+
const a = document.createElement("div");
|
|
714
|
+
if (a.className = "setting-group-content", this.isCollapsed && (a.classList.add("collapsed"), e.classList.add("collapsed-view"), o.classList.add("rotated"), t.classList.add("collapsed")), this.isMain && a.classList.add("main-content"), this.description && !this.isCollapsed) {
|
|
551
715
|
const r = document.createElement("div");
|
|
552
|
-
r.className = "setting-group-description", r.textContent = this.description,
|
|
716
|
+
r.className = "setting-group-description", r.textContent = this.description, a.appendChild(r);
|
|
553
717
|
}
|
|
554
718
|
const l = () => {
|
|
555
|
-
this.isCollapsed = !this.isCollapsed,
|
|
719
|
+
this.isCollapsed = !this.isCollapsed, a.classList.toggle("collapsed"), e.classList.toggle("collapsed-view"), o.classList.toggle("rotated"), t.classList.toggle("collapsed", this.isCollapsed), e.setAttribute(
|
|
556
720
|
"aria-expanded",
|
|
557
721
|
(!this.isCollapsed).toString()
|
|
558
722
|
);
|
|
559
|
-
const r =
|
|
723
|
+
const r = a.querySelector(
|
|
560
724
|
".setting-group-description"
|
|
561
725
|
), d = n.querySelector(".info-marker");
|
|
562
726
|
if (this.description)
|
|
@@ -568,14 +732,14 @@ const p = class p {
|
|
|
568
732
|
<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"
|
|
569
733
|
stroke="currentColor" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>
|
|
570
734
|
</svg>
|
|
571
|
-
`, u.title = this.description, n.insertBefore(u,
|
|
735
|
+
`, u.title = this.description, n.insertBefore(u, o);
|
|
572
736
|
}
|
|
573
737
|
} else {
|
|
574
738
|
if (!r) {
|
|
575
739
|
const u = document.createElement("div");
|
|
576
|
-
u.className = "setting-group-description", u.textContent = this.description,
|
|
740
|
+
u.className = "setting-group-description", u.textContent = this.description, a.insertBefore(
|
|
577
741
|
u,
|
|
578
|
-
|
|
742
|
+
a.firstChild
|
|
579
743
|
);
|
|
580
744
|
}
|
|
581
745
|
d && d.remove();
|
|
@@ -587,11 +751,11 @@ const p = class p {
|
|
|
587
751
|
for (const r in this.settings)
|
|
588
752
|
if (Object.prototype.hasOwnProperty.call(this.settings, r)) {
|
|
589
753
|
const d = this.settings[r];
|
|
590
|
-
d instanceof p && d.setNestingLevel(this.nestingLevel + 1),
|
|
754
|
+
d instanceof p && d.setNestingLevel(this.nestingLevel + 1), a.appendChild(d.draw());
|
|
591
755
|
}
|
|
592
756
|
} else {
|
|
593
757
|
const r = document.createElement("div");
|
|
594
|
-
r.className = "setting-group-empty", r.textContent = "No settings in this group",
|
|
758
|
+
r.className = "setting-group-empty", r.textContent = "No settings in this group", a.appendChild(r);
|
|
595
759
|
}
|
|
596
760
|
if (this.addItemCfg) {
|
|
597
761
|
const r = document.createElement("button");
|
|
@@ -604,11 +768,11 @@ const p = class p {
|
|
|
604
768
|
</svg>`;
|
|
605
769
|
r.innerHTML = `${d}<span style="margin-left:4px;">${this.addItemCfg.buttonLabel ?? "Add"}</span>`, r.addEventListener("click", (u) => {
|
|
606
770
|
u.stopPropagation(), u.preventDefault();
|
|
607
|
-
const V = this.getNextIndexFromPrefix(this.addItemCfg.keyPrefix),
|
|
608
|
-
this.addSetting(S,
|
|
609
|
-
}),
|
|
771
|
+
const V = this.getNextIndexFromPrefix(this.addItemCfg.keyPrefix), L = this.addItemCfg.createItem(V), S = `${this.addItemCfg.keyPrefix}${V}`;
|
|
772
|
+
this.addSetting(S, L), this.addItemCfg.expandNewItem !== !1 && L.expand && L.expand();
|
|
773
|
+
}), a.appendChild(r);
|
|
610
774
|
}
|
|
611
|
-
return e.appendChild(i), e.appendChild(n), t.appendChild(e), t.appendChild(
|
|
775
|
+
return e.appendChild(i), e.appendChild(n), t.appendChild(e), t.appendChild(a), this.elementRef = t, N.trackElement(t), setTimeout(() => {
|
|
612
776
|
this.updateNestingStyles();
|
|
613
777
|
}, 0), this.pendingBlurHandler && (this.setupBlurHandlers(), this.pendingBlurHandler = null), t;
|
|
614
778
|
}
|
|
@@ -645,10 +809,10 @@ const p = class p {
|
|
|
645
809
|
let i = e;
|
|
646
810
|
const s = Object.keys(this.settings), n = Object.keys(e);
|
|
647
811
|
if (!s.some(
|
|
648
|
-
(
|
|
812
|
+
(a) => n.includes(a)
|
|
649
813
|
) && n.length === 1) {
|
|
650
|
-
const
|
|
651
|
-
i = e[
|
|
814
|
+
const a = n[0];
|
|
815
|
+
i = e[a];
|
|
652
816
|
}
|
|
653
817
|
this.setValue(i);
|
|
654
818
|
} catch (e) {
|
|
@@ -692,26 +856,26 @@ class pt extends f {
|
|
|
692
856
|
s.textContent = this.title, i.appendChild(s);
|
|
693
857
|
const n = document.createElement("div");
|
|
694
858
|
n.className = "tabs-header", this.tabsContainer = n;
|
|
695
|
-
const
|
|
696
|
-
if (
|
|
697
|
-
const
|
|
698
|
-
|
|
859
|
+
const o = document.createElement("div");
|
|
860
|
+
if (o.className = "tab-content", this.contentContainers = {}, Object.keys(this.settings).forEach((a, l) => {
|
|
861
|
+
const c = document.createElement("button");
|
|
862
|
+
c.className = "tab-button", c.type = "button", c.setAttribute("data-tab-id", a), c.textContent = a, c.addEventListener("click", () => this.switchToTab(a)), n.appendChild(c);
|
|
699
863
|
const r = document.createElement("div");
|
|
700
|
-
r.className = "tab-panel", this.contentContainers[
|
|
701
|
-
const d = this.settings[
|
|
702
|
-
d && (d instanceof f && d.setNestingLevel(this.getNestingLevel() + 1), r.appendChild(d.draw())),
|
|
703
|
-
}), e.appendChild(i), e.appendChild(n), e.appendChild(
|
|
704
|
-
const
|
|
705
|
-
this.activeTabId =
|
|
864
|
+
r.className = "tab-panel", this.contentContainers[a] = r;
|
|
865
|
+
const d = this.settings[a];
|
|
866
|
+
d && (d instanceof f && d.setNestingLevel(this.getNestingLevel() + 1), r.appendChild(d.draw())), o.appendChild(r), l === 0 && !this.activeTabId && (this.activeTabId = a);
|
|
867
|
+
}), e.appendChild(i), e.appendChild(n), e.appendChild(o), !this.activeTabId) {
|
|
868
|
+
const a = Object.keys(this.settings)[0];
|
|
869
|
+
this.activeTabId = a || "";
|
|
706
870
|
}
|
|
707
871
|
return this.updateTabUI(), t;
|
|
708
872
|
}
|
|
709
873
|
}
|
|
710
|
-
function R(
|
|
711
|
-
return new f(
|
|
874
|
+
function R(h) {
|
|
875
|
+
return new f(h);
|
|
712
876
|
}
|
|
713
|
-
function gt(
|
|
714
|
-
return
|
|
877
|
+
function gt(h) {
|
|
878
|
+
return h;
|
|
715
879
|
}
|
|
716
880
|
class $ extends g {
|
|
717
881
|
constructor(t = {}) {
|
|
@@ -753,11 +917,11 @@ class m extends $ {
|
|
|
753
917
|
const e = t.split(",").map((r) => parseInt(r.trim()));
|
|
754
918
|
if (e.length !== 3 || e.some(isNaN))
|
|
755
919
|
return console.warn(`Invalid RGB value "${t}", using default "#000000"`), "#000000";
|
|
756
|
-
const [i, s, n] = e,
|
|
920
|
+
const [i, s, n] = e, o = Math.max(0, Math.min(255, i)), a = Math.max(0, Math.min(255, s)), l = Math.max(0, Math.min(255, n)), c = (r) => {
|
|
757
921
|
const d = r.toString(16);
|
|
758
922
|
return d.length === 1 ? "0" + d : d;
|
|
759
923
|
};
|
|
760
|
-
return `#${
|
|
924
|
+
return `#${c(o)}${c(a)}${c(l)}`;
|
|
761
925
|
}
|
|
762
926
|
setValue(t) {
|
|
763
927
|
if (t === void 0) {
|
|
@@ -780,46 +944,46 @@ class m extends $ {
|
|
|
780
944
|
if (t.className = "color-setting-wrapper " + (this.props.wrapperClassName || ""), this.props.title || this.props.icon) {
|
|
781
945
|
const l = document.createElement("div");
|
|
782
946
|
if (l.className = "icon-container", this.props.icon) {
|
|
783
|
-
const
|
|
784
|
-
|
|
947
|
+
const c = document.createElement("span");
|
|
948
|
+
c.className = "input-icon", c.innerHTML = this.props.icon, l.appendChild(c);
|
|
785
949
|
}
|
|
786
950
|
if (this.props.title) {
|
|
787
|
-
const
|
|
788
|
-
|
|
951
|
+
const c = document.createElement("span");
|
|
952
|
+
c.className = "input-label", c.textContent = this.props.title, l.appendChild(c);
|
|
789
953
|
}
|
|
790
954
|
t.appendChild(l);
|
|
791
955
|
}
|
|
792
956
|
const e = document.createElement("div");
|
|
793
957
|
e.className = "color-input-wrapper";
|
|
794
958
|
const i = (l) => {
|
|
795
|
-
const
|
|
796
|
-
if (!
|
|
959
|
+
const c = l.value.trim();
|
|
960
|
+
if (!c)
|
|
797
961
|
return e.classList.remove("error"), !0;
|
|
798
|
-
const d = /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/.test(
|
|
962
|
+
const d = /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/.test(c);
|
|
799
963
|
return d ? e.classList.remove("error") : e.classList.add("error"), d;
|
|
800
964
|
}, s = document.createElement("input");
|
|
801
965
|
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;
|
|
802
966
|
const n = document.createElement("div");
|
|
803
967
|
n.className = "color-preview";
|
|
804
|
-
const
|
|
805
|
-
n.style.backgroundColor =
|
|
806
|
-
const
|
|
807
|
-
return
|
|
968
|
+
const o = this.value || "#000000";
|
|
969
|
+
n.style.backgroundColor = o;
|
|
970
|
+
const a = document.createElement("input");
|
|
971
|
+
return a.type = "text", a.className = "color-text-input", a.value = this.value || "", a.placeholder = "#000000", a.setAttribute("pattern", "#[0-9A-Fa-f]{6}"), a.setAttribute("title", "Enter a hex color value (e.g., #ff0000)"), a.setAttribute("aria-label", "Hex color value"), a.setAttribute("maxlength", "7"), this.textInputEl = a, this.textInputEl.addEventListener("input", (l) => {
|
|
808
972
|
var r, d;
|
|
809
|
-
let
|
|
973
|
+
let c = l.target.value.trim();
|
|
810
974
|
if (this.textInputEl && i(this.textInputEl)) {
|
|
811
|
-
const u = m.normalizeColorValue(
|
|
975
|
+
const u = m.normalizeColorValue(c);
|
|
812
976
|
this.value = u, (r = this.onChange) == null || r.call(this, u), (d = this.detectChange) == null || d.call(this, u), this.colorInputEl && (this.colorInputEl.value = u), n.style.backgroundColor = u;
|
|
813
977
|
}
|
|
814
978
|
}), this.colorInputEl.addEventListener("input", (l) => {
|
|
815
979
|
var d, u;
|
|
816
|
-
const
|
|
980
|
+
const c = l.target.value, r = m.normalizeColorValue(c);
|
|
817
981
|
this.value = r, (d = this.onChange) == null || d.call(this, r), (u = this.detectChange) == null || u.call(this, r), this.textInputEl && (this.textInputEl.value = r), n.style.backgroundColor = r, e.classList.remove("error");
|
|
818
982
|
}), this.colorInputEl.addEventListener("change", (l) => {
|
|
819
983
|
var d, u;
|
|
820
|
-
const
|
|
984
|
+
const c = l.target.value, r = m.normalizeColorValue(c);
|
|
821
985
|
this.value = r, (d = this.onChange) == null || d.call(this, r), (u = this.detectChange) == null || u.call(this, r), this.textInputEl && (this.textInputEl.value = r), n.style.backgroundColor = r;
|
|
822
|
-
}), e.appendChild(s), e.appendChild(n), e.appendChild(
|
|
986
|
+
}), e.appendChild(s), e.appendChild(n), e.appendChild(a), t.appendChild(e), this.element = t, t;
|
|
823
987
|
}
|
|
824
988
|
getElement() {
|
|
825
989
|
return this.element;
|
|
@@ -875,8 +1039,8 @@ class C extends g {
|
|
|
875
1039
|
}
|
|
876
1040
|
updateColorPreview() {
|
|
877
1041
|
if (!this.colorPreviewEl || !this.value) return;
|
|
878
|
-
const t = this.getRgbColor(), e = this.getOpacityPercent() / 100, i = t.replace("#", ""), s = parseInt(i.substring(0, 2), 16), n = parseInt(i.substring(2, 4), 16),
|
|
879
|
-
this.colorPreviewEl.style.backgroundColor = `rgba(${s}, ${n}, ${
|
|
1042
|
+
const t = this.getRgbColor(), e = this.getOpacityPercent() / 100, i = t.replace("#", ""), s = parseInt(i.substring(0, 2), 16), n = parseInt(i.substring(2, 4), 16), o = parseInt(i.substring(4, 6), 16);
|
|
1043
|
+
this.colorPreviewEl.style.backgroundColor = `rgba(${s}, ${n}, ${o}, ${e})`;
|
|
880
1044
|
}
|
|
881
1045
|
handleColorChange(t) {
|
|
882
1046
|
const e = this.getOpacityPercent(), i = C.combineColorOpacity(t, e);
|
|
@@ -893,41 +1057,41 @@ class C extends g {
|
|
|
893
1057
|
draw() {
|
|
894
1058
|
const t = document.createElement("div");
|
|
895
1059
|
if (t.className = "color-with-opacity-setting-wrapper " + (this.props.wrapperClassName || ""), this.props.title || this.props.icon) {
|
|
896
|
-
const
|
|
897
|
-
if (
|
|
898
|
-
const
|
|
899
|
-
|
|
1060
|
+
const o = document.createElement("div");
|
|
1061
|
+
if (o.className = "icon-container", this.props.icon) {
|
|
1062
|
+
const a = document.createElement("span");
|
|
1063
|
+
a.className = "input-icon", a.innerHTML = this.props.icon, o.appendChild(a);
|
|
900
1064
|
}
|
|
901
1065
|
if (this.props.title) {
|
|
902
|
-
const
|
|
903
|
-
|
|
1066
|
+
const a = document.createElement("span");
|
|
1067
|
+
a.className = "input-label", a.textContent = this.props.title, o.appendChild(a);
|
|
904
1068
|
}
|
|
905
|
-
t.appendChild(
|
|
1069
|
+
t.appendChild(o);
|
|
906
1070
|
}
|
|
907
1071
|
const e = document.createElement("div");
|
|
908
|
-
e.className = "color-with-opacity-input-wrapper", this.colorInputEl = document.createElement("input"), this.colorInputEl.type = "color", this.colorInputEl.className = "color-with-opacity-picker", this.colorPreviewEl = document.createElement("div"), this.colorPreviewEl.className = "color-with-opacity-preview", this.textInputEl = document.createElement("input"), this.textInputEl.type = "text", this.textInputEl.className = "color-with-opacity-text-input", this.textInputEl.placeholder = "#000000FF", this.updateInputElements(), this.updateColorPreview(), this.colorInputEl.addEventListener("input", (
|
|
909
|
-
const
|
|
910
|
-
this.handleColorChange(
|
|
911
|
-
}), this.textInputEl.addEventListener("input", (
|
|
912
|
-
const
|
|
913
|
-
this.handleTextInput(
|
|
914
|
-
}), this.textInputEl.addEventListener("blur", (
|
|
915
|
-
const
|
|
916
|
-
|
|
1072
|
+
e.className = "color-with-opacity-input-wrapper", this.colorInputEl = document.createElement("input"), this.colorInputEl.type = "color", this.colorInputEl.className = "color-with-opacity-picker", this.colorPreviewEl = document.createElement("div"), this.colorPreviewEl.className = "color-with-opacity-preview", this.textInputEl = document.createElement("input"), this.textInputEl.type = "text", this.textInputEl.className = "color-with-opacity-text-input", this.textInputEl.placeholder = "#000000FF", this.updateInputElements(), this.updateColorPreview(), this.colorInputEl.addEventListener("input", (o) => {
|
|
1073
|
+
const a = o.target;
|
|
1074
|
+
this.handleColorChange(a.value), this.textInputEl && (this.textInputEl.value = this.value || "#000000FF"), this.updateColorPreview();
|
|
1075
|
+
}), this.textInputEl.addEventListener("input", (o) => {
|
|
1076
|
+
const a = o.target;
|
|
1077
|
+
this.handleTextInput(a.value) ? (this.colorInputEl && (this.colorInputEl.value = this.getRgbColor()), this.updateColorPreview(), e.classList.remove("error")) : a.value.trim() === "" ? e.classList.remove("error") : e.classList.add("error");
|
|
1078
|
+
}), this.textInputEl.addEventListener("blur", (o) => {
|
|
1079
|
+
const a = o.target;
|
|
1080
|
+
a.value.trim() === "" && (a.value = this.value || "#000000FF", e.classList.remove("error"));
|
|
917
1081
|
}), this.colorPreviewEl.addEventListener("click", () => {
|
|
918
|
-
var
|
|
919
|
-
(
|
|
1082
|
+
var o;
|
|
1083
|
+
(o = this.colorInputEl) == null || o.click();
|
|
920
1084
|
}), e.appendChild(this.colorInputEl), e.appendChild(this.colorPreviewEl), e.appendChild(this.textInputEl);
|
|
921
1085
|
const i = document.createElement("div");
|
|
922
1086
|
i.className = "color-with-opacity-opacity-wrapper", this.opacityInputEl = document.createElement("input"), this.opacityInputEl.type = "number", this.opacityInputEl.className = "color-with-opacity-opacity-input", this.opacityInputEl.value = this.getOpacityPercent().toString(), this.opacityInputEl.min = "0", this.opacityInputEl.max = "100", this.opacityInputEl.step = "1", this.opacityInputEl.placeholder = "100";
|
|
923
1087
|
const s = document.createElement("span");
|
|
924
|
-
s.className = "color-with-opacity-opacity-suffix", s.textContent = "%", this.opacityInputEl.addEventListener("input", (
|
|
925
|
-
const
|
|
1088
|
+
s.className = "color-with-opacity-opacity-suffix", s.textContent = "%", this.opacityInputEl.addEventListener("input", (o) => {
|
|
1089
|
+
const a = o.target, l = parseFloat(a.value);
|
|
926
1090
|
isNaN(l) || (this.handleOpacityChange(l), this.textInputEl && (this.textInputEl.value = this.value || "#000000FF"), this.updateColorPreview());
|
|
927
|
-
}), this.opacityInputEl.addEventListener("blur", (
|
|
928
|
-
const
|
|
929
|
-
let l = parseFloat(
|
|
930
|
-
isNaN(l) && (l = this.getOpacityPercent()), l = Math.max(0, Math.min(100, l)),
|
|
1091
|
+
}), this.opacityInputEl.addEventListener("blur", (o) => {
|
|
1092
|
+
const a = o.target;
|
|
1093
|
+
let l = parseFloat(a.value);
|
|
1094
|
+
isNaN(l) && (l = this.getOpacityPercent()), l = Math.max(0, Math.min(100, l)), a.value = l.toString(), this.handleOpacityChange(l), this.textInputEl && (this.textInputEl.value = this.value || "#000000FF"), this.updateColorPreview();
|
|
931
1095
|
}), i.appendChild(this.opacityInputEl), i.appendChild(s);
|
|
932
1096
|
const n = document.createElement("div");
|
|
933
1097
|
return n.className = "color-with-opacity-controls-wrapper", n.appendChild(e), n.appendChild(i), t.appendChild(n), this.element = t, this.updateInputElements(), this.updateColorPreview(), t;
|
|
@@ -940,8 +1104,8 @@ class C extends g {
|
|
|
940
1104
|
}
|
|
941
1105
|
getRgbaValue() {
|
|
942
1106
|
if (!this.value) return "rgba(0, 0, 0, 1)";
|
|
943
|
-
const t = this.getRgbColor(), e = this.getOpacityPercent() / 100, i = t.replace("#", ""), s = parseInt(i.substring(0, 2), 16), n = parseInt(i.substring(2, 4), 16),
|
|
944
|
-
return `rgba(${s}, ${n}, ${
|
|
1107
|
+
const t = this.getRgbColor(), e = this.getOpacityPercent() / 100, i = t.replace("#", ""), s = parseInt(i.substring(0, 2), 16), n = parseInt(i.substring(2, 4), 16), o = parseInt(i.substring(4, 6), 16);
|
|
1108
|
+
return `rgba(${s}, ${n}, ${o}, ${e})`;
|
|
945
1109
|
}
|
|
946
1110
|
getColorAndOpacity() {
|
|
947
1111
|
return {
|
|
@@ -962,20 +1126,20 @@ class mt extends g {
|
|
|
962
1126
|
if (t.className = "html-setting-wrapper " + (this.props.wrapperClassName || ""), this.props.title || this.props.icon) {
|
|
963
1127
|
const n = document.createElement("div");
|
|
964
1128
|
if (n.className = "icon-container", this.props.icon) {
|
|
965
|
-
const
|
|
966
|
-
n.appendChild(
|
|
1129
|
+
const o = this.createIcon(this.props.icon);
|
|
1130
|
+
n.appendChild(o);
|
|
967
1131
|
}
|
|
968
1132
|
if (this.props.title) {
|
|
969
|
-
const
|
|
970
|
-
n.appendChild(
|
|
1133
|
+
const o = this.createLabel(this.props.title);
|
|
1134
|
+
n.appendChild(o);
|
|
971
1135
|
}
|
|
972
1136
|
t.appendChild(n);
|
|
973
1137
|
}
|
|
974
1138
|
const e = document.createElement("textarea");
|
|
975
1139
|
this.textareaEl = e, e.value = this.value || "", e.placeholder = this.props.placeholder || "Paste your HTML here...", e.className = "html-setting-textarea " + (this.props.textareaClassName || ""), e.rows = this.props.rows || 6, this.props.maxLength !== void 0 && (e.maxLength = this.props.maxLength), this.props.className && e.classList.add(this.props.className);
|
|
976
1140
|
const i = (n) => {
|
|
977
|
-
const
|
|
978
|
-
this.value =
|
|
1141
|
+
const a = n.target.value;
|
|
1142
|
+
this.value = a, this.onChange && this.onChange(this.value), this.props.detectChange && this.props.detectChange(this.value);
|
|
979
1143
|
}, s = (n) => {
|
|
980
1144
|
this.onBlur && this.value !== void 0 && this.onBlur(this.value);
|
|
981
1145
|
};
|
|
@@ -1005,12 +1169,12 @@ class v extends g {
|
|
|
1005
1169
|
const i = document.createElement("input");
|
|
1006
1170
|
if (i.type = "number", i.className = "number-setting-input " + (this.props.inputClassName || ""), i.value = String(this.value ?? ""), i.placeholder = this.props.placeholder || "", this.props.minValue !== void 0 && (i.min = String(this.props.minValue)), this.props.maxValue !== void 0 && (i.max = String(this.props.maxValue)), this.props.step !== void 0 && (i.step = String(this.props.step)), i.addEventListener("input", () => {
|
|
1007
1171
|
const s = this.props.minValue ?? Number.MIN_SAFE_INTEGER, n = this.props.maxValue ?? Number.MAX_SAFE_INTEGER;
|
|
1008
|
-
let
|
|
1009
|
-
|
|
1172
|
+
let o = Number(i.value);
|
|
1173
|
+
o < s && (o = s), o > n && (o = n), String(o) !== i.value && (i.value = String(o)), this.setValue(o);
|
|
1010
1174
|
}), i.addEventListener("blur", () => {
|
|
1011
|
-
var n,
|
|
1175
|
+
var n, o;
|
|
1012
1176
|
const s = this.validateValue(Number(i.value));
|
|
1013
|
-
s !== Number(i.value) && (i.value = String(s), this.setValue(s)), (
|
|
1177
|
+
s !== Number(i.value) && (i.value = String(s), this.setValue(s)), (o = (n = this.props).onBlur) == null || o.call(n);
|
|
1014
1178
|
}), e.appendChild(i), this.props.suffix && this.props.suffix !== "none") {
|
|
1015
1179
|
const s = document.createElement("span");
|
|
1016
1180
|
s.className = "suffix-label", s.textContent = this.props.suffix, e.appendChild(s);
|
|
@@ -1041,12 +1205,12 @@ class v extends g {
|
|
|
1041
1205
|
);
|
|
1042
1206
|
}
|
|
1043
1207
|
}
|
|
1044
|
-
const
|
|
1208
|
+
const j = `
|
|
1045
1209
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1046
1210
|
<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"/>
|
|
1047
1211
|
<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"/>
|
|
1048
1212
|
</svg>`;
|
|
1049
|
-
class
|
|
1213
|
+
class P extends v {
|
|
1050
1214
|
constructor(t = {}) {
|
|
1051
1215
|
const e = {
|
|
1052
1216
|
title: "Opacity",
|
|
@@ -1055,7 +1219,7 @@ class j extends v {
|
|
|
1055
1219
|
maxValue: 100,
|
|
1056
1220
|
step: 1,
|
|
1057
1221
|
default: t.default ?? 100,
|
|
1058
|
-
icon:
|
|
1222
|
+
icon: j,
|
|
1059
1223
|
...t
|
|
1060
1224
|
};
|
|
1061
1225
|
super(e), this.inputType = "number", this.mobileValue = t.mobile;
|
|
@@ -1067,12 +1231,12 @@ class j extends v {
|
|
|
1067
1231
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
1068
1232
|
}
|
|
1069
1233
|
}
|
|
1070
|
-
const
|
|
1234
|
+
const G = `
|
|
1071
1235
|
<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">
|
|
1072
1236
|
<polyline points="6 9 12 15 18 9"></polyline>
|
|
1073
1237
|
</svg>
|
|
1074
1238
|
`;
|
|
1075
|
-
class
|
|
1239
|
+
class M extends g {
|
|
1076
1240
|
constructor(t = {}) {
|
|
1077
1241
|
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) {
|
|
1078
1242
|
const e = this._options.findIndex((i) => i.value === this.value);
|
|
@@ -1093,12 +1257,12 @@ class k extends g {
|
|
|
1093
1257
|
if (t.classList.add("select-container"), this.container = t, this.props.icon || this.props.title) {
|
|
1094
1258
|
const n = document.createElement("div");
|
|
1095
1259
|
if (n.className = "icon-container", this.props.icon) {
|
|
1096
|
-
const
|
|
1097
|
-
n.appendChild(
|
|
1260
|
+
const o = this.createIcon(this.props.icon);
|
|
1261
|
+
n.appendChild(o);
|
|
1098
1262
|
}
|
|
1099
1263
|
if (this.props.title) {
|
|
1100
|
-
const
|
|
1101
|
-
n.appendChild(
|
|
1264
|
+
const o = this.createLabel(this.props.title);
|
|
1265
|
+
n.appendChild(o);
|
|
1102
1266
|
}
|
|
1103
1267
|
t.appendChild(n);
|
|
1104
1268
|
} else {
|
|
@@ -1107,22 +1271,22 @@ class k extends g {
|
|
|
1107
1271
|
}
|
|
1108
1272
|
const e = document.createElement("div");
|
|
1109
1273
|
e.classList.add("select-button"), this.isLoading ? e.classList.add("loading") : e.textContent = this.selectedOptionIndex !== null ? this._options[this.selectedOptionIndex].name : this.props.placeholder || "Select an option", e.onclick = () => {
|
|
1110
|
-
var n,
|
|
1111
|
-
this.isLoading || (this.isOpen = !this.isOpen, this.isOpen ? this.checkDropdownPosition() : this.cleanupDropdownPosition(), (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (
|
|
1274
|
+
var n, o;
|
|
1275
|
+
this.isLoading || (this.isOpen = !this.isOpen, this.isOpen ? this.checkDropdownPosition() : this.cleanupDropdownPosition(), (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (o = this.svgContainer) == null || o.classList.toggle("open", this.isOpen));
|
|
1112
1276
|
}, t.appendChild(e), this.buttonEl = e;
|
|
1113
1277
|
const i = document.createElement("ul");
|
|
1114
|
-
i.classList.add("select-options"), this._options.forEach((n,
|
|
1115
|
-
const
|
|
1116
|
-
|
|
1278
|
+
i.classList.add("select-options"), this._options.forEach((n, o) => {
|
|
1279
|
+
const a = this.createOption(n, o);
|
|
1280
|
+
a.onclick = (l) => this.selectOption(l, o, e), i.appendChild(a);
|
|
1117
1281
|
}), document.body.appendChild(i);
|
|
1118
1282
|
const s = document.createElement("div");
|
|
1119
|
-
return s.classList.add("svg-container"), s.innerHTML =
|
|
1283
|
+
return s.classList.add("svg-container"), s.innerHTML = G, t.appendChild(s), this.optionsListEl = i, this.svgContainer = s, this.props.getOptionsAsync && (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((n) => {
|
|
1120
1284
|
this._options.push(...n), this.isLoading = !1, this.updateOptionsList(), this.updateButtonText();
|
|
1121
1285
|
}).catch((n) => {
|
|
1122
1286
|
console.error("Failed to fetch async options:", n), this.isLoading = !1, this.updateButtonText("Failed to load options");
|
|
1123
1287
|
})), this.clickOutsideListener && document.removeEventListener("click", this.clickOutsideListener), this.clickOutsideListener = (n) => {
|
|
1124
|
-
var
|
|
1125
|
-
this.isOpen && !t.contains(n.target) && (this.isOpen = !1, (
|
|
1288
|
+
var o, a;
|
|
1289
|
+
this.isOpen && !t.contains(n.target) && (this.isOpen = !1, (o = this.optionsListEl) == null || o.classList.remove("open"), (a = this.svgContainer) == null || a.classList.remove("open"), this.cleanupDropdownPosition());
|
|
1126
1290
|
}, document.addEventListener("click", this.clickOutsideListener), this.resizeListener && window.removeEventListener("resize", this.resizeListener), this.resizeListener = () => {
|
|
1127
1291
|
this.isOpen && this.checkDropdownPosition();
|
|
1128
1292
|
}, window.addEventListener("resize", this.resizeListener), t;
|
|
@@ -1144,10 +1308,10 @@ class k extends g {
|
|
|
1144
1308
|
}
|
|
1145
1309
|
}
|
|
1146
1310
|
selectOption(t, e, i) {
|
|
1147
|
-
var n,
|
|
1311
|
+
var n, o, a;
|
|
1148
1312
|
const s = this._options[e];
|
|
1149
|
-
s && (this.value = s.value, (n = this.onChange) == null || n.call(this, this.value), this.selectedOptionIndex = e, this.isOpen = !1, i.textContent = s.name, (
|
|
1150
|
-
r === e ?
|
|
1313
|
+
s && (this.value = s.value, (n = this.onChange) == null || n.call(this, this.value), this.selectedOptionIndex = e, this.isOpen = !1, i.textContent = s.name, (o = this.optionsListEl) == null || o.classList.remove("open"), (a = this.svgContainer) == null || a.classList.remove("open"), this.cleanupDropdownPosition(), this.optionsListEl && this.optionsListEl.querySelectorAll(".select-option").forEach((c, r) => {
|
|
1314
|
+
r === e ? c.classList.add("selected") : c.classList.remove("selected");
|
|
1151
1315
|
}));
|
|
1152
1316
|
}
|
|
1153
1317
|
/**
|
|
@@ -1230,11 +1394,11 @@ class W extends g {
|
|
|
1230
1394
|
`
|
|
1231
1395
|
}
|
|
1232
1396
|
].forEach((n) => {
|
|
1233
|
-
const
|
|
1234
|
-
|
|
1235
|
-
var
|
|
1236
|
-
i.querySelectorAll(".align-option-button").forEach((l) => l.classList.remove("selected")),
|
|
1237
|
-
}), i.appendChild(
|
|
1397
|
+
const o = document.createElement("button");
|
|
1398
|
+
o.className = "align-option-button", o.innerHTML = n.icon, this.value === n.name && o.classList.add("selected"), o.addEventListener("click", () => {
|
|
1399
|
+
var a;
|
|
1400
|
+
i.querySelectorAll(".align-option-button").forEach((l) => l.classList.remove("selected")), o.classList.add("selected"), this.value = n.name, (a = this.onChange) == null || a.call(this, this.value);
|
|
1401
|
+
}), i.appendChild(o);
|
|
1238
1402
|
}), t.appendChild(i), t;
|
|
1239
1403
|
}
|
|
1240
1404
|
}
|
|
@@ -1252,19 +1416,19 @@ class ft extends g {
|
|
|
1252
1416
|
/^rgba\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)$/i
|
|
1253
1417
|
);
|
|
1254
1418
|
if (n) {
|
|
1255
|
-
let
|
|
1256
|
-
r >= 1 ? (
|
|
1419
|
+
let a = +n[1], l = +n[2], c = +n[3], r = +n[4];
|
|
1420
|
+
r >= 1 ? (a = Math.round(a * 0.9), l = Math.round(l * 0.9), c = Math.round(c * 0.9)) : r = Math.min(1, r + 0.12), s = `rgba(${a},${l},${c},${r})`;
|
|
1257
1421
|
}
|
|
1258
1422
|
t.addEventListener("mouseenter", () => {
|
|
1259
1423
|
console.log("hoverBg", s), t.style.setProperty("background-color", s, "important");
|
|
1260
1424
|
}), t.addEventListener("mouseleave", () => {
|
|
1261
1425
|
t.style.setProperty("background-color", e, "important");
|
|
1262
1426
|
}), t.addEventListener("click", () => {
|
|
1263
|
-
var
|
|
1264
|
-
return (l = (
|
|
1427
|
+
var a, l;
|
|
1428
|
+
return (l = (a = this.props).onClick) == null ? void 0 : l.call(a);
|
|
1265
1429
|
});
|
|
1266
|
-
const
|
|
1267
|
-
return
|
|
1430
|
+
const o = document.createElement("div");
|
|
1431
|
+
return o.className = "button-setting-wrapper " + (this.props.wrapperClassName || ""), o.appendChild(t), o;
|
|
1268
1432
|
}
|
|
1269
1433
|
}
|
|
1270
1434
|
class vt extends g {
|
|
@@ -1357,8 +1521,8 @@ class vt extends g {
|
|
|
1357
1521
|
return n.className = "dimension-lock-icon", n.setAttribute("type", "button"), n.setAttribute("aria-pressed", String(this.locked)), n.setAttribute(
|
|
1358
1522
|
"aria-label",
|
|
1359
1523
|
this.locked ? "Unlock aspect ratio" : "Lock aspect ratio"
|
|
1360
|
-
), n.title = this.locked ? "Unlock aspect ratio" : "Lock aspect ratio", n.innerHTML = this.getLockSVG(this.locked), n.onclick = (
|
|
1361
|
-
|
|
1524
|
+
), n.title = this.locked ? "Unlock aspect ratio" : "Lock aspect ratio", n.innerHTML = this.getLockSVG(this.locked), n.onclick = (o) => {
|
|
1525
|
+
o.preventDefault(), this.toggleLock(n);
|
|
1362
1526
|
}, s.appendChild(n), t.appendChild(e), t.appendChild(s), t.appendChild(i), t;
|
|
1363
1527
|
}
|
|
1364
1528
|
isLocked() {
|
|
@@ -1472,11 +1636,11 @@ class Z extends g {
|
|
|
1472
1636
|
<span class="upload-label">Replace</span>
|
|
1473
1637
|
`);
|
|
1474
1638
|
const n = () => {
|
|
1475
|
-
this.hideLoading(), this.previewWrapper.classList.add("has-image"), this.previewEl.style.display = "block", this.previewEl.removeEventListener("load", n), this.previewEl.removeEventListener("error",
|
|
1476
|
-
},
|
|
1477
|
-
this.hideLoading(), this.showError("Failed to load image. Please try again."), this.previewWrapper.classList.remove("has-image"), this.previewEl.style.display = "none", this.previewWrapper.style.display = "none", s && s instanceof HTMLElement && (s.style.display = "block"), e && e.classList.add("no-image"), this.previewEl.removeEventListener("load", n), this.previewEl.removeEventListener("error",
|
|
1639
|
+
this.hideLoading(), this.previewWrapper.classList.add("has-image"), this.previewEl.style.display = "block", this.previewEl.removeEventListener("load", n), this.previewEl.removeEventListener("error", o);
|
|
1640
|
+
}, o = () => {
|
|
1641
|
+
this.hideLoading(), this.showError("Failed to load image. Please try again."), this.previewWrapper.classList.remove("has-image"), this.previewEl.style.display = "none", this.previewWrapper.style.display = "none", s && s instanceof HTMLElement && (s.style.display = "block"), e && e.classList.add("no-image"), this.previewEl.removeEventListener("load", n), this.previewEl.removeEventListener("error", o);
|
|
1478
1642
|
};
|
|
1479
|
-
this.previewEl.addEventListener("load", n), this.previewEl.addEventListener("error",
|
|
1643
|
+
this.previewEl.addEventListener("load", n), this.previewEl.addEventListener("error", o), this.previewEl.src = t;
|
|
1480
1644
|
} else
|
|
1481
1645
|
this.hideLoading(), this.previewWrapper.classList.remove("has-image"), this.previewEl.src = "", this.previewEl.style.display = "none", this.previewWrapper.style.display = "none", s && s instanceof HTMLElement && (s.style.display = "block"), e && e.classList.add("no-image"), i && (i.innerHTML = `
|
|
1482
1646
|
<span class="upload-icon">${y}</span>
|
|
@@ -1487,24 +1651,24 @@ class Z extends g {
|
|
|
1487
1651
|
const t = document.createElement("div");
|
|
1488
1652
|
t.className = "upload-setting-wrapper", t.setAttribute("data-setting-id", this.id), t.addEventListener(
|
|
1489
1653
|
"focusout",
|
|
1490
|
-
(
|
|
1654
|
+
(a) => {
|
|
1491
1655
|
var l;
|
|
1492
|
-
|
|
1656
|
+
a.relatedTarget && t.contains(a.relatedTarget) || (l = this.onBlur) == null || l.call(this, this.value ?? "");
|
|
1493
1657
|
},
|
|
1494
1658
|
!0
|
|
1495
1659
|
);
|
|
1496
1660
|
const e = !!(this.props.title || this.props.icon);
|
|
1497
1661
|
if (e || t.classList.add("no-label"), e) {
|
|
1498
|
-
const
|
|
1499
|
-
if (
|
|
1662
|
+
const a = document.createElement("div");
|
|
1663
|
+
if (a.className = "icon-title-container", this.props.icon) {
|
|
1500
1664
|
const l = this.createIcon(this.props.icon);
|
|
1501
|
-
|
|
1665
|
+
a.appendChild(l);
|
|
1502
1666
|
}
|
|
1503
1667
|
if (this.props.title) {
|
|
1504
1668
|
const l = this.createLabel(this.props.title);
|
|
1505
|
-
|
|
1669
|
+
a.appendChild(l);
|
|
1506
1670
|
}
|
|
1507
|
-
t.appendChild(
|
|
1671
|
+
t.appendChild(a);
|
|
1508
1672
|
}
|
|
1509
1673
|
this.errorContainer = document.createElement("div"), this.errorContainer.className = "error-message", this.errorContainer.style.display = "none", t.appendChild(this.errorContainer);
|
|
1510
1674
|
const i = document.createElement("div");
|
|
@@ -1513,18 +1677,18 @@ class Z extends g {
|
|
|
1513
1677
|
s || i.classList.add("no-image");
|
|
1514
1678
|
const n = document.createElement("div");
|
|
1515
1679
|
if (n.className = "preview-placeholder", n.innerHTML = U, this.previewWrapper = document.createElement("div"), this.previewWrapper.className = "preview-wrapper", this.loadingSpinner = document.createElement("div"), this.loadingSpinner.className = "loading-spinner", this.loadingSpinner.innerHTML = q, this.loadingSpinner.style.display = "none", this.previewWrapper.appendChild(this.loadingSpinner), this.previewEl = document.createElement("img"), this.previewEl.className = "upload-preview", this.props.delete) {
|
|
1516
|
-
const
|
|
1517
|
-
|
|
1518
|
-
var
|
|
1519
|
-
l.stopPropagation(), this.value = "", this.updatePreviewState(null), (
|
|
1680
|
+
const a = document.createElement("button");
|
|
1681
|
+
a.className = "delete-button", a.type = "button", a.title = "Delete image", a.innerHTML = _, this.previewWrapper.appendChild(a), a.onclick = (l) => {
|
|
1682
|
+
var c;
|
|
1683
|
+
l.stopPropagation(), this.value = "", this.updatePreviewState(null), (c = this.onChange) == null || c.call(this, ""), this.hideError();
|
|
1520
1684
|
};
|
|
1521
1685
|
}
|
|
1522
1686
|
this.previewWrapper.appendChild(this.previewEl);
|
|
1523
|
-
const
|
|
1524
|
-
return
|
|
1687
|
+
const o = document.createElement("button");
|
|
1688
|
+
return o.className = "upload-button", o.innerHTML = `
|
|
1525
1689
|
<span class="upload-icon">${y}</span>
|
|
1526
1690
|
<span class="upload-label">Upload</span>
|
|
1527
|
-
`, i.appendChild(n), i.appendChild(this.previewWrapper), i.appendChild(
|
|
1691
|
+
`, i.appendChild(n), i.appendChild(this.previewWrapper), i.appendChild(o), t.appendChild(i), s ? this.updatePreviewState(this.value) : this.updatePreviewState(null), o.onclick = () => {
|
|
1528
1692
|
window.postMessage(
|
|
1529
1693
|
{
|
|
1530
1694
|
type: "OPEN_FILE_MANAGER_MODAL",
|
|
@@ -1608,46 +1772,46 @@ class Et extends g {
|
|
|
1608
1772
|
e.classList.add("has-label");
|
|
1609
1773
|
const n = document.createElement("div");
|
|
1610
1774
|
n.className = "select-label", n.textContent = this.props.title, e.appendChild(n);
|
|
1611
|
-
const
|
|
1612
|
-
if (
|
|
1613
|
-
|
|
1775
|
+
const o = document.createElement("span");
|
|
1776
|
+
if (o.className = "select-value", this.isLoading)
|
|
1777
|
+
o.textContent = this.props.loadingText || "Loading options...";
|
|
1614
1778
|
else {
|
|
1615
|
-
const
|
|
1616
|
-
|
|
1779
|
+
const a = this.selectedOptionIndex !== null && this._options && this.selectedOptionIndex >= 0 && this.selectedOptionIndex < this._options.length ? this._options[this.selectedOptionIndex] : null, l = a && typeof a.name == "string" ? a.name : "Select an option";
|
|
1780
|
+
o.textContent = l;
|
|
1617
1781
|
}
|
|
1618
|
-
e.appendChild(
|
|
1782
|
+
e.appendChild(o);
|
|
1619
1783
|
} else {
|
|
1620
1784
|
const n = document.createElement("span");
|
|
1621
1785
|
if (this.isLoading)
|
|
1622
1786
|
n.textContent = this.props.loadingText || "Loading options...";
|
|
1623
1787
|
else {
|
|
1624
|
-
const
|
|
1625
|
-
n.textContent =
|
|
1788
|
+
const o = this.selectedOptionIndex !== null && this._options && this.selectedOptionIndex >= 0 && this.selectedOptionIndex < this._options.length ? this._options[this.selectedOptionIndex] : null, a = o && typeof o.name == "string" ? o.name : "Select an option";
|
|
1789
|
+
n.textContent = a;
|
|
1626
1790
|
}
|
|
1627
1791
|
e.appendChild(n);
|
|
1628
1792
|
}
|
|
1629
1793
|
e.onclick = () => {
|
|
1630
|
-
var n,
|
|
1631
|
-
this.isLoading || (this.isOpen = !this.isOpen, (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (
|
|
1794
|
+
var n, o;
|
|
1795
|
+
this.isLoading || (this.isOpen = !this.isOpen, (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (o = this.svgContainer) == null || o.classList.toggle("open", this.isOpen));
|
|
1632
1796
|
}, t.appendChild(e), this.buttonEl = e;
|
|
1633
1797
|
const i = document.createElement("ul");
|
|
1634
|
-
i.classList.add("select-api-options"), this._options.forEach((n,
|
|
1635
|
-
const
|
|
1636
|
-
|
|
1798
|
+
i.classList.add("select-api-options"), this._options.forEach((n, o) => {
|
|
1799
|
+
const a = this.createOption(n, o);
|
|
1800
|
+
a.onclick = (l) => this.selectApiOption(l, o, e), i.appendChild(a);
|
|
1637
1801
|
}), t.appendChild(i);
|
|
1638
1802
|
const s = document.createElement("div");
|
|
1639
1803
|
return s.classList.add("svg-container"), s.innerHTML = Q, t.appendChild(s), s.onclick = () => {
|
|
1640
|
-
var n,
|
|
1641
|
-
this.isLoading || (this.isOpen = !this.isOpen, (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (
|
|
1804
|
+
var n, o;
|
|
1805
|
+
this.isLoading || (this.isOpen = !this.isOpen, (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (o = this.svgContainer) == null || o.classList.toggle("open", this.isOpen));
|
|
1642
1806
|
}, this.optionsListEl = i, this.svgContainer = s, this.props.getOptionsAsync && !this.hasInitializedOptions ? (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((n) => {
|
|
1643
|
-
const
|
|
1807
|
+
const o = new Set(
|
|
1644
1808
|
this._options.map((l) => JSON.stringify(l.value))
|
|
1645
|
-
),
|
|
1646
|
-
(l) => !
|
|
1809
|
+
), a = n.filter(
|
|
1810
|
+
(l) => !o.has(JSON.stringify(l.value))
|
|
1647
1811
|
);
|
|
1648
|
-
if (this._options.push(...
|
|
1812
|
+
if (this._options.push(...a), this.isLoading = !1, this.hasInitializedOptions = !0, this.value !== void 0) {
|
|
1649
1813
|
const l = this._options.findIndex(
|
|
1650
|
-
(
|
|
1814
|
+
(c) => JSON.stringify(c.value) === JSON.stringify(this.value)
|
|
1651
1815
|
);
|
|
1652
1816
|
this.selectedOptionIndex = l !== -1 ? l : null;
|
|
1653
1817
|
} else
|
|
@@ -1659,14 +1823,14 @@ class Et extends g {
|
|
|
1659
1823
|
!0
|
|
1660
1824
|
);
|
|
1661
1825
|
})) : this.props.getOptionsAsync && this._options.length <= 1 && (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((n) => {
|
|
1662
|
-
const
|
|
1826
|
+
const o = new Set(
|
|
1663
1827
|
this._options.map((l) => JSON.stringify(l.value))
|
|
1664
|
-
),
|
|
1665
|
-
(l) => !
|
|
1828
|
+
), a = n.filter(
|
|
1829
|
+
(l) => !o.has(JSON.stringify(l.value))
|
|
1666
1830
|
);
|
|
1667
|
-
if (this._options.push(...
|
|
1831
|
+
if (this._options.push(...a), this.isLoading = !1, this.value !== void 0) {
|
|
1668
1832
|
const l = this._options.findIndex(
|
|
1669
|
-
(
|
|
1833
|
+
(c) => JSON.stringify(c.value) === JSON.stringify(this.value)
|
|
1670
1834
|
);
|
|
1671
1835
|
this.selectedOptionIndex = l !== -1 ? l : null;
|
|
1672
1836
|
} else
|
|
@@ -1683,19 +1847,19 @@ class Et extends g {
|
|
|
1683
1847
|
return JSON.stringify(t ? {} : { value: this.value }, null, 2);
|
|
1684
1848
|
}
|
|
1685
1849
|
selectApiOption(t, e, i) {
|
|
1686
|
-
var l,
|
|
1850
|
+
var l, c, r, d;
|
|
1687
1851
|
const s = t.target, n = s.querySelector(".select-api-radio") || ((l = s.closest(".select-api-option")) == null ? void 0 : l.querySelector(".select-api-radio"));
|
|
1688
1852
|
n && (n.checked = !0), this.selectedOptionIndex = e;
|
|
1689
|
-
const
|
|
1690
|
-
this.value =
|
|
1691
|
-
const
|
|
1692
|
-
if (
|
|
1693
|
-
|
|
1853
|
+
const o = this._options[e].value;
|
|
1854
|
+
this.value = o;
|
|
1855
|
+
const a = i.querySelector(".select-value");
|
|
1856
|
+
if (a)
|
|
1857
|
+
a.textContent = this._options[e].name;
|
|
1694
1858
|
else {
|
|
1695
1859
|
const u = i.firstChild;
|
|
1696
1860
|
u && u.tagName === "SPAN" && (u.textContent = this._options[e].name);
|
|
1697
1861
|
}
|
|
1698
|
-
this.isOpen = !1, (
|
|
1862
|
+
this.isOpen = !1, (c = this.optionsListEl) == null || c.classList.remove("open"), (r = this.svgContainer) == null || r.classList.remove("open"), (d = this.onChange) == null || d.call(this, o), this.detectChangeCallback && this.detectChangeCallback(o);
|
|
1699
1863
|
}
|
|
1700
1864
|
updateOptionsList() {
|
|
1701
1865
|
!this.optionsListEl || !this.buttonEl || (this.optionsListEl.innerHTML = "", this._options.forEach((t, e) => {
|
|
@@ -1734,7 +1898,7 @@ class bt extends g {
|
|
|
1734
1898
|
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;
|
|
1735
1899
|
}
|
|
1736
1900
|
draw() {
|
|
1737
|
-
var
|
|
1901
|
+
var o, a;
|
|
1738
1902
|
const t = document.createElement("div");
|
|
1739
1903
|
t.className = "toggle-setting-container", this.props.icon && t.classList.add("toggle-with-icon");
|
|
1740
1904
|
const e = document.createElement("div");
|
|
@@ -1750,17 +1914,17 @@ class bt extends g {
|
|
|
1750
1914
|
const i = document.createElement("label");
|
|
1751
1915
|
i.className = "toggle-switch";
|
|
1752
1916
|
const s = document.createElement("input");
|
|
1753
|
-
s.type = "checkbox", s.checked = ((
|
|
1754
|
-
var
|
|
1755
|
-
const l = ((r = (
|
|
1917
|
+
s.type = "checkbox", s.checked = ((a = (o = this.props.options) == null ? void 0 : o.find((l) => l.value === this.value)) == null ? void 0 : a.status) ?? !1, s.addEventListener("change", () => {
|
|
1918
|
+
var c, r;
|
|
1919
|
+
const l = ((r = (c = this.props.options) == null ? void 0 : c.find((d) => d.status === s.checked)) == null ? void 0 : r.value) ?? "";
|
|
1756
1920
|
this.value = l, this.onChange && this.onChange(this.value), this.detectChangeCallback && this.detectChangeCallback(this.value);
|
|
1757
1921
|
});
|
|
1758
1922
|
const n = document.createElement("span");
|
|
1759
1923
|
if (n.className = "toggle-slider", this.props.activeColor || this.props.inactiveColor) {
|
|
1760
|
-
const l = document.createElement("style"),
|
|
1924
|
+
const l = document.createElement("style"), c = this.props.activeColor || "#4CAF50", r = this.props.inactiveColor || "#ccc";
|
|
1761
1925
|
l.textContent = `
|
|
1762
1926
|
.toggle-switch input:checked + .toggle-slider {
|
|
1763
|
-
background-color: ${
|
|
1927
|
+
background-color: ${c};
|
|
1764
1928
|
}
|
|
1765
1929
|
.toggle-switch .toggle-slider {
|
|
1766
1930
|
background-color: ${r};
|
|
@@ -1776,7 +1940,7 @@ class bt extends g {
|
|
|
1776
1940
|
const Y = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1777
1941
|
<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"/>
|
|
1778
1942
|
</svg>`;
|
|
1779
|
-
class
|
|
1943
|
+
class xt extends g {
|
|
1780
1944
|
// Store mobile value
|
|
1781
1945
|
constructor(t = {}) {
|
|
1782
1946
|
t.rowGap = t.rowGap ?? !0, t.columnGap = t.columnGap ?? !0, t.title = t.title ?? "Gap", t.icon = t.icon ?? Y, 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);
|
|
@@ -1790,27 +1954,27 @@ class Lt extends g {
|
|
|
1790
1954
|
i.className = "setting-label", i.setAttribute("for", this.id + "-input");
|
|
1791
1955
|
const s = document.createElement("span");
|
|
1792
1956
|
if (s.textContent = this.props.title ?? "Gap", i.appendChild(s), this.props.icon) {
|
|
1793
|
-
const
|
|
1794
|
-
|
|
1957
|
+
const a = document.createElement("span");
|
|
1958
|
+
a.className = "setting-icon", a.innerHTML = this.props.icon, i.insertBefore(a, s);
|
|
1795
1959
|
}
|
|
1796
1960
|
const n = document.createElement("div");
|
|
1797
1961
|
n.className = `setting-input-wrapper ${this.props.wrapperClassName || ""}`, n.classList.add("gap-setting-wrapper");
|
|
1798
|
-
const
|
|
1799
|
-
return
|
|
1962
|
+
const o = document.createElement("div");
|
|
1963
|
+
return o.className = "gap-inputs-container", this.props.rowGap && o.appendChild(this.createGapInput("row", "Row")), this.props.columnGap && o.appendChild(this.createGapInput("column", "Col")), n.appendChild(o), e.appendChild(i), e.appendChild(n), t.appendChild(e), t;
|
|
1800
1964
|
}
|
|
1801
1965
|
createGapInput(t, e) {
|
|
1802
1966
|
const i = document.createElement("div");
|
|
1803
1967
|
i.className = "gap-input-wrapper";
|
|
1804
1968
|
const s = document.createElement("input");
|
|
1805
1969
|
if (s.type = "number", s.className = `gap-input gap-${t}-input ${this.props.inputClassName || ""}`, s.id = `${this.id}-${t}-input`, s.min = String(this.props.minValue ?? 0), this.props.maxValue !== void 0 && (s.max = String(this.props.maxValue)), s.step = String(this.props.step ?? 1), s.value = String(this.inputValues[t] ?? this.value), s.title = e, s.addEventListener("input", (n) => {
|
|
1806
|
-
const
|
|
1807
|
-
let
|
|
1808
|
-
|
|
1970
|
+
const o = n.target;
|
|
1971
|
+
let a = parseFloat(o.value);
|
|
1972
|
+
a = this.validateValue(a), String(a) !== o.value && (o.value = String(a)), this.inputValues[t] = a, this.setValue(a);
|
|
1809
1973
|
}), s.addEventListener("blur", (n) => {
|
|
1810
|
-
var l,
|
|
1811
|
-
const
|
|
1812
|
-
let
|
|
1813
|
-
|
|
1974
|
+
var l, c;
|
|
1975
|
+
const o = n.target;
|
|
1976
|
+
let a = parseFloat(o.value);
|
|
1977
|
+
a = this.validateValue(a), String(a) !== o.value && (o.value = String(a), this.inputValues[t] = a, this.setValue(a)), (c = (l = this.props).onBlur) == null || c.call(l);
|
|
1814
1978
|
}), i.appendChild(s), this.props.suffix && this.props.suffix !== "none") {
|
|
1815
1979
|
const n = document.createElement("span");
|
|
1816
1980
|
n.className = "gap-suffix", n.textContent = this.props.suffix, i.appendChild(n), s.style.paddingRight = "30px";
|
|
@@ -1833,7 +1997,7 @@ class Lt extends g {
|
|
|
1833
1997
|
const tt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1834
1998
|
<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"/>
|
|
1835
1999
|
</svg>`;
|
|
1836
|
-
class
|
|
2000
|
+
class Lt extends v {
|
|
1837
2001
|
constructor(t = {}) {
|
|
1838
2002
|
super({
|
|
1839
2003
|
...t,
|
|
@@ -1876,7 +2040,7 @@ const it = `
|
|
|
1876
2040
|
<line x1="5" y1="12" x2="19" y2="12"></line>
|
|
1877
2041
|
</svg>
|
|
1878
2042
|
`;
|
|
1879
|
-
class
|
|
2043
|
+
class kt extends g {
|
|
1880
2044
|
constructor(t = {}) {
|
|
1881
2045
|
super(t), this.inputType = {}, this.container = null, this.languagesContainer = null, this.addLanguageSelect = null, this.addButton = null, this.defaultLanguages = [
|
|
1882
2046
|
{ code: "en", name: "English" },
|
|
@@ -1918,15 +2082,15 @@ class Mt extends g {
|
|
|
1918
2082
|
s.classList.add("language-label"), s.textContent = t.toUpperCase();
|
|
1919
2083
|
const n = document.createElement("div");
|
|
1920
2084
|
n.classList.add("language-input-group");
|
|
1921
|
-
const
|
|
1922
|
-
|
|
1923
|
-
const
|
|
1924
|
-
this.updateLanguageValue(t,
|
|
2085
|
+
const o = document.createElement("input");
|
|
2086
|
+
o.type = "text", o.classList.add("language-input"), o.value = e || "", o.placeholder = this.props.placeholder || "Enter text...", o.addEventListener("input", (l) => {
|
|
2087
|
+
const c = l.target;
|
|
2088
|
+
this.updateLanguageValue(t, c.value);
|
|
1925
2089
|
});
|
|
1926
|
-
const
|
|
1927
|
-
return
|
|
2090
|
+
const a = document.createElement("button");
|
|
2091
|
+
return a.type = "button", a.classList.add("delete-language-btn"), a.innerHTML = it, a.title = `Delete ${t.toUpperCase()}`, a.addEventListener("click", () => {
|
|
1928
2092
|
this.removeLanguage(t);
|
|
1929
|
-
}), n.appendChild(
|
|
2093
|
+
}), n.appendChild(o), n.appendChild(a), i.appendChild(s), i.appendChild(n), i;
|
|
1930
2094
|
}
|
|
1931
2095
|
updateLanguageValue(t, e) {
|
|
1932
2096
|
this.value || (this.value = {}), this.value[t] = e, this.onChange && this.onChange(this.value), this.props.detectChange && this.props.detectChange(this.value);
|
|
@@ -1958,8 +2122,8 @@ class Mt extends g {
|
|
|
1958
2122
|
s.classList.add("add-language-select"), this.addLanguageSelect = s;
|
|
1959
2123
|
const n = document.createElement("button");
|
|
1960
2124
|
return n.type = "button", n.classList.add("add-language-btn"), n.innerHTML = `${st} Add`, this.addButton = n, n.addEventListener("click", () => {
|
|
1961
|
-
const
|
|
1962
|
-
|
|
2125
|
+
const o = s.value;
|
|
2126
|
+
o && this.addLanguage(o);
|
|
1963
2127
|
}), i.appendChild(s), i.appendChild(n), t.appendChild(e), t.appendChild(i), t;
|
|
1964
2128
|
}
|
|
1965
2129
|
draw() {
|
|
@@ -1971,9 +2135,9 @@ class Mt extends g {
|
|
|
1971
2135
|
const e = document.createElement("div");
|
|
1972
2136
|
e.classList.add("multi-language-content");
|
|
1973
2137
|
const i = document.createElement("div");
|
|
1974
|
-
i.classList.add("languages-container"), this.languagesContainer = i, this.value && Object.entries(this.value).forEach(([n,
|
|
1975
|
-
const
|
|
1976
|
-
i.appendChild(
|
|
2138
|
+
i.classList.add("languages-container"), this.languagesContainer = i, this.value && Object.entries(this.value).forEach(([n, o]) => {
|
|
2139
|
+
const a = this.createLanguageRow(n, o);
|
|
2140
|
+
i.appendChild(a);
|
|
1977
2141
|
}), e.appendChild(i);
|
|
1978
2142
|
const s = this.createAddLanguageSection();
|
|
1979
2143
|
return e.appendChild(s), t.appendChild(e), this.updateAddLanguageSelect(), this.container = t, t;
|
|
@@ -1985,7 +2149,7 @@ class Mt extends g {
|
|
|
1985
2149
|
}), this.updateAddLanguageSelect());
|
|
1986
2150
|
}
|
|
1987
2151
|
}
|
|
1988
|
-
class
|
|
2152
|
+
class Mt extends g {
|
|
1989
2153
|
constructor(t = {}) {
|
|
1990
2154
|
super(t), this.inputType = "select";
|
|
1991
2155
|
const e = [
|
|
@@ -1996,7 +2160,7 @@ class kt extends g {
|
|
|
1996
2160
|
{ name: "Bounce", value: "bounce 1.5s ease-in-out infinite" },
|
|
1997
2161
|
{ name: "Pulse", value: "pulse 1.5s ease-in-out infinite" }
|
|
1998
2162
|
];
|
|
1999
|
-
this.selectSetting = new
|
|
2163
|
+
this.selectSetting = new M({
|
|
2000
2164
|
title: this.title || "Animation",
|
|
2001
2165
|
options: e,
|
|
2002
2166
|
default: this.props.default || "none"
|
|
@@ -2016,7 +2180,7 @@ const nt = `
|
|
|
2016
2180
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2017
2181
|
<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"/>
|
|
2018
2182
|
</svg>
|
|
2019
|
-
`,
|
|
2183
|
+
`, ot = `
|
|
2020
2184
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2021
2185
|
<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"/>
|
|
2022
2186
|
</svg>
|
|
@@ -2030,7 +2194,7 @@ class Vt extends f {
|
|
|
2030
2194
|
settings: {
|
|
2031
2195
|
size: new v({
|
|
2032
2196
|
title: "Size",
|
|
2033
|
-
icon:
|
|
2197
|
+
icon: ot,
|
|
2034
2198
|
default: (t == null ? void 0 : t.size) ?? 0,
|
|
2035
2199
|
suffix: "px"
|
|
2036
2200
|
}),
|
|
@@ -2058,7 +2222,7 @@ class Vt extends f {
|
|
|
2058
2222
|
`;
|
|
2059
2223
|
}
|
|
2060
2224
|
}
|
|
2061
|
-
const
|
|
2225
|
+
const at = `
|
|
2062
2226
|
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="13" viewBox="0 0 14 13" fill="none">
|
|
2063
2227
|
<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"/>
|
|
2064
2228
|
</svg>
|
|
@@ -2083,9 +2247,9 @@ class Nt extends f {
|
|
|
2083
2247
|
color: new C({
|
|
2084
2248
|
default: i.colorDefault ?? "0, 0, 30"
|
|
2085
2249
|
}),
|
|
2086
|
-
fontFamily: new
|
|
2250
|
+
fontFamily: new M({
|
|
2087
2251
|
title: "Font",
|
|
2088
|
-
icon:
|
|
2252
|
+
icon: at,
|
|
2089
2253
|
default: i.fontFamilyDefault ?? "Satoshi",
|
|
2090
2254
|
options: i.fontFamilyOptions ?? [
|
|
2091
2255
|
{ name: "Alt", value: "Croco Sans Black Caps Alt" },
|
|
@@ -2096,7 +2260,7 @@ class Nt extends f {
|
|
|
2096
2260
|
getOptions: i.fontFamilyGetOptions,
|
|
2097
2261
|
getOptionsAsync: i.fontFamilyGetOptionsAsync
|
|
2098
2262
|
}),
|
|
2099
|
-
fontWeight: new
|
|
2263
|
+
fontWeight: new M({
|
|
2100
2264
|
title: "Weight",
|
|
2101
2265
|
icon: lt,
|
|
2102
2266
|
default: i.fontWeightDefault ?? "400",
|
|
@@ -2127,8 +2291,8 @@ class Nt extends f {
|
|
|
2127
2291
|
});
|
|
2128
2292
|
}
|
|
2129
2293
|
getCssCode() {
|
|
2130
|
-
var
|
|
2131
|
-
const t = this.settings.color.value ?? "#000000", e = this.settings.fontFamily.value ?? "Satoshi", i = this.settings.fontWeight.value ?? "bold", s = this.settings.fontSize.value ?? 12, n = ((
|
|
2294
|
+
var o;
|
|
2295
|
+
const t = this.settings.color.value ?? "#000000", e = this.settings.fontFamily.value ?? "Satoshi", i = this.settings.fontWeight.value ?? "bold", s = this.settings.fontSize.value ?? 12, n = ((o = this.settings.align) == null ? void 0 : o.value) ?? "left";
|
|
2132
2296
|
return `
|
|
2133
2297
|
color: ${t};
|
|
2134
2298
|
font-family: ${e};
|
|
@@ -2146,11 +2310,11 @@ class E extends g {
|
|
|
2146
2310
|
}), this.inputType = "number", this.value = t.default !== void 0 ? t.default : "auto";
|
|
2147
2311
|
}
|
|
2148
2312
|
draw() {
|
|
2149
|
-
const t = this.value === "auto" ? "text" : "number", e = (
|
|
2150
|
-
this.value !== "auto" && (this.props.minValue !== void 0 && (
|
|
2151
|
-
const l = this.props.minValue ?? Number.MIN_SAFE_INTEGER,
|
|
2152
|
-
let r = Number(
|
|
2153
|
-
r < l && (r = l), r >
|
|
2313
|
+
const t = this.value === "auto" ? "text" : "number", e = (a) => {
|
|
2314
|
+
this.value !== "auto" && (this.props.minValue !== void 0 && (a.min = String(this.props.minValue)), this.props.maxValue !== void 0 && (a.max = String(this.props.maxValue)), this.props.className && a.classList.add(this.props.className), a.addEventListener("input", () => {
|
|
2315
|
+
const l = this.props.minValue ?? Number.MIN_SAFE_INTEGER, c = this.props.maxValue ?? Number.MAX_SAFE_INTEGER;
|
|
2316
|
+
let r = Number(a.value);
|
|
2317
|
+
r < l && (r = l), r > c && (r = c), a.value = String(r);
|
|
2154
2318
|
}));
|
|
2155
2319
|
}, i = this.createInput({
|
|
2156
2320
|
value: this.value,
|
|
@@ -2171,14 +2335,14 @@ class E extends g {
|
|
|
2171
2335
|
s && (s.style.paddingRight = "35px");
|
|
2172
2336
|
const n = document.createElement("span");
|
|
2173
2337
|
n.className = "suffix-label", n.textContent = this.props.suffix, i.appendChild(n);
|
|
2174
|
-
const
|
|
2175
|
-
return
|
|
2176
|
-
const l =
|
|
2338
|
+
const o = i.querySelector("input");
|
|
2339
|
+
return o && (o.oninput = (a) => {
|
|
2340
|
+
const l = a.target.value.trim();
|
|
2177
2341
|
if (l.toLowerCase() === "auto")
|
|
2178
2342
|
this.value = "auto";
|
|
2179
2343
|
else {
|
|
2180
|
-
const
|
|
2181
|
-
isNaN(
|
|
2344
|
+
const c = Number(l);
|
|
2345
|
+
isNaN(c) || (this.value = c);
|
|
2182
2346
|
}
|
|
2183
2347
|
this.onChange && this.onChange(this.value);
|
|
2184
2348
|
}), i;
|
|
@@ -2193,13 +2357,13 @@ class It extends f {
|
|
|
2193
2357
|
settings: {
|
|
2194
2358
|
marginTop: new E({
|
|
2195
2359
|
title: "Top",
|
|
2196
|
-
icon:
|
|
2360
|
+
icon: ct,
|
|
2197
2361
|
suffix: "px",
|
|
2198
2362
|
default: (t == null ? void 0 : t.marginTop) ?? "auto"
|
|
2199
2363
|
}),
|
|
2200
2364
|
marginRight: new E({
|
|
2201
2365
|
title: "Right",
|
|
2202
|
-
icon:
|
|
2366
|
+
icon: ht,
|
|
2203
2367
|
suffix: "px",
|
|
2204
2368
|
default: (t == null ? void 0 : t.marginRight) ?? 0
|
|
2205
2369
|
}),
|
|
@@ -2228,9 +2392,9 @@ class It extends f {
|
|
|
2228
2392
|
`;
|
|
2229
2393
|
}
|
|
2230
2394
|
}
|
|
2231
|
-
const
|
|
2395
|
+
const ct = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2232
2396
|
<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"/>
|
|
2233
|
-
</svg>`,
|
|
2397
|
+
</svg>`, ht = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2234
2398
|
<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"/>
|
|
2235
2399
|
</svg>`, dt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2236
2400
|
<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"/>
|
|
@@ -2271,7 +2435,7 @@ class St extends f {
|
|
|
2271
2435
|
...t == null ? void 0 : t.uploadProps,
|
|
2272
2436
|
default: (t == null ? void 0 : t.backgroundImage) ?? ""
|
|
2273
2437
|
}),
|
|
2274
|
-
opacity: new
|
|
2438
|
+
opacity: new P({
|
|
2275
2439
|
default: (t == null ? void 0 : t.opacity) ?? 100
|
|
2276
2440
|
}),
|
|
2277
2441
|
backgroundColor: new C({
|
|
@@ -2286,10 +2450,10 @@ class St extends f {
|
|
|
2286
2450
|
draw() {
|
|
2287
2451
|
const t = super.draw(), e = t.querySelector(".setting-group-content");
|
|
2288
2452
|
if (!e) return t;
|
|
2289
|
-
const i = Array.from(e.children), [s, n,
|
|
2453
|
+
const i = Array.from(e.children), [s, n, o] = i;
|
|
2290
2454
|
e.innerHTML = "", e.appendChild(s), e.appendChild(n);
|
|
2291
|
-
const
|
|
2292
|
-
return
|
|
2455
|
+
const a = document.createElement("div");
|
|
2456
|
+
return a.className = "bgset-or-label", a.textContent = "OR", e.appendChild(a), e.appendChild(o), t;
|
|
2293
2457
|
}
|
|
2294
2458
|
/**
|
|
2295
2459
|
* Helper method to generate CSS based on the current settings.
|
|
@@ -2306,33 +2470,33 @@ class St extends f {
|
|
|
2306
2470
|
`;
|
|
2307
2471
|
}
|
|
2308
2472
|
}
|
|
2309
|
-
function Ot(
|
|
2310
|
-
return
|
|
2473
|
+
function Ot(h) {
|
|
2474
|
+
return h instanceof f;
|
|
2311
2475
|
}
|
|
2312
|
-
function Ht(
|
|
2313
|
-
return
|
|
2476
|
+
function Ht(h) {
|
|
2477
|
+
return h instanceof g;
|
|
2314
2478
|
}
|
|
2315
2479
|
export {
|
|
2316
2480
|
W as AlignSetting,
|
|
2317
|
-
|
|
2481
|
+
Mt as AnimationSetting,
|
|
2318
2482
|
St as BackgroundSettingSet,
|
|
2319
2483
|
Vt as BorderSettingSet,
|
|
2320
2484
|
ft as ButtonSetting,
|
|
2321
2485
|
m as ColorSetting,
|
|
2322
2486
|
C as ColorWithOpacitySetting,
|
|
2323
2487
|
vt as DimensionSetting,
|
|
2324
|
-
|
|
2488
|
+
xt as GapSetting,
|
|
2325
2489
|
Nt as HeaderTypographySettingSet,
|
|
2326
2490
|
Ct as HeightSetting,
|
|
2327
2491
|
mt as HtmlSetting,
|
|
2328
|
-
|
|
2492
|
+
Lt as MarginBottomSetting,
|
|
2329
2493
|
It as MarginSettingGroup,
|
|
2330
2494
|
yt as MarginTopSetting,
|
|
2331
|
-
|
|
2495
|
+
kt as MultiLanguageSetting,
|
|
2332
2496
|
v as NumberSetting,
|
|
2333
|
-
|
|
2497
|
+
P as OpacitySetting,
|
|
2334
2498
|
Et as SelectApiSettings,
|
|
2335
|
-
|
|
2499
|
+
M as SelectSetting,
|
|
2336
2500
|
g as Setting,
|
|
2337
2501
|
f as SettingGroup,
|
|
2338
2502
|
$ as StringSetting,
|