builder-settings-types 0.0.218 → 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 +485 -314
- 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
|
}
|
|
@@ -343,7 +343,14 @@ const p = class p {
|
|
|
343
343
|
setValue(t) {
|
|
344
344
|
if (!t || typeof t != "object") return;
|
|
345
345
|
Object.entries(t).forEach(([i, s]) => {
|
|
346
|
-
|
|
346
|
+
let n = this.settings[i];
|
|
347
|
+
if (!n && this.addItemCfg && i.startsWith(this.addItemCfg.keyPrefix)) {
|
|
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
|
+
this.addSetting(i, l), n = l;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
347
354
|
n && (n instanceof p || n instanceof g) && typeof n.setValue == "function" && n.setValue(s);
|
|
348
355
|
}), setTimeout(() => {
|
|
349
356
|
this.forceChildUIRefresh();
|
|
@@ -371,16 +378,16 @@ const p = class p {
|
|
|
371
378
|
wireChild(t) {
|
|
372
379
|
var i, s, n;
|
|
373
380
|
const e = () => {
|
|
374
|
-
var
|
|
375
|
-
const
|
|
376
|
-
this.initialValues =
|
|
381
|
+
var a;
|
|
382
|
+
const o = this.getValues();
|
|
383
|
+
this.initialValues = o, (a = this.onChange) == null || a.call(this, o), this.updateVisibility();
|
|
377
384
|
};
|
|
378
385
|
t instanceof p ? (t.setOnChange(() => e()), (i = t.setOnBlur) == null || i.call(t, () => {
|
|
379
|
-
var
|
|
380
|
-
return (
|
|
386
|
+
var o;
|
|
387
|
+
return (o = this.onBlur) == null ? void 0 : o.call(this);
|
|
381
388
|
})) : t instanceof g ? (t.setOnChange(() => e()), (s = t.setOnBlur) == null || s.call(t, () => {
|
|
382
|
-
var
|
|
383
|
-
return (
|
|
389
|
+
var o;
|
|
390
|
+
return (o = this.onBlur) == null ? void 0 : o.call(this);
|
|
384
391
|
})) : (n = t.setOnChange) == null || n.call(t, () => e());
|
|
385
392
|
}
|
|
386
393
|
addSetting(t, e) {
|
|
@@ -391,15 +398,179 @@ const p = class p {
|
|
|
391
398
|
);
|
|
392
399
|
if (n) {
|
|
393
400
|
e instanceof p && e.setNestingLevel(this.nestingLevel + 1);
|
|
394
|
-
const
|
|
395
|
-
|
|
396
|
-
const
|
|
397
|
-
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();
|
|
398
407
|
}
|
|
399
408
|
}
|
|
400
409
|
const i = this.getValues();
|
|
401
410
|
this.initialValues = i, (s = this.onChange) == null || s.call(this, i);
|
|
402
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
|
+
}
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
typeof e.cleanup == "function" && e.cleanup(), this.updateNestingStyles();
|
|
434
|
+
const i = this.getValues();
|
|
435
|
+
this.initialValues = i, (s = this.onChange) == null || s.call(this, i);
|
|
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
|
+
}
|
|
403
574
|
getNextIndexFromPrefix(t) {
|
|
404
575
|
const e = Object.keys(this.settings).filter((i) => i.startsWith(t)).map((i) => {
|
|
405
576
|
const s = Number(i.slice(t.length));
|
|
@@ -413,8 +584,8 @@ const p = class p {
|
|
|
413
584
|
...Object.keys(t),
|
|
414
585
|
...Object.keys(e)
|
|
415
586
|
])).forEach((n) => {
|
|
416
|
-
const
|
|
417
|
-
JSON.stringify(
|
|
587
|
+
const o = t[n], a = e[n];
|
|
588
|
+
JSON.stringify(o) !== JSON.stringify(a) && (i[n] = { from: o, to: a });
|
|
418
589
|
}), i;
|
|
419
590
|
}
|
|
420
591
|
hide() {
|
|
@@ -533,23 +704,23 @@ const p = class p {
|
|
|
533
704
|
</svg>
|
|
534
705
|
`, r.title = this.description, n.appendChild(r);
|
|
535
706
|
}
|
|
536
|
-
const
|
|
537
|
-
|
|
707
|
+
const o = document.createElement("span");
|
|
708
|
+
o.className = "setting-group-arrow", o.innerHTML = `
|
|
538
709
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
539
710
|
<path d="M4 6L8 10L12 6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
540
711
|
</svg>
|
|
541
|
-
`, this.isCollapsed &&
|
|
542
|
-
const
|
|
543
|
-
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) {
|
|
544
715
|
const r = document.createElement("div");
|
|
545
|
-
r.className = "setting-group-description", r.textContent = this.description,
|
|
716
|
+
r.className = "setting-group-description", r.textContent = this.description, a.appendChild(r);
|
|
546
717
|
}
|
|
547
718
|
const l = () => {
|
|
548
|
-
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(
|
|
549
720
|
"aria-expanded",
|
|
550
721
|
(!this.isCollapsed).toString()
|
|
551
722
|
);
|
|
552
|
-
const r =
|
|
723
|
+
const r = a.querySelector(
|
|
553
724
|
".setting-group-description"
|
|
554
725
|
), d = n.querySelector(".info-marker");
|
|
555
726
|
if (this.description)
|
|
@@ -561,14 +732,14 @@ const p = class p {
|
|
|
561
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"
|
|
562
733
|
stroke="currentColor" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>
|
|
563
734
|
</svg>
|
|
564
|
-
`, u.title = this.description, n.insertBefore(u,
|
|
735
|
+
`, u.title = this.description, n.insertBefore(u, o);
|
|
565
736
|
}
|
|
566
737
|
} else {
|
|
567
738
|
if (!r) {
|
|
568
739
|
const u = document.createElement("div");
|
|
569
|
-
u.className = "setting-group-description", u.textContent = this.description,
|
|
740
|
+
u.className = "setting-group-description", u.textContent = this.description, a.insertBefore(
|
|
570
741
|
u,
|
|
571
|
-
|
|
742
|
+
a.firstChild
|
|
572
743
|
);
|
|
573
744
|
}
|
|
574
745
|
d && d.remove();
|
|
@@ -580,11 +751,11 @@ const p = class p {
|
|
|
580
751
|
for (const r in this.settings)
|
|
581
752
|
if (Object.prototype.hasOwnProperty.call(this.settings, r)) {
|
|
582
753
|
const d = this.settings[r];
|
|
583
|
-
d instanceof p && d.setNestingLevel(this.nestingLevel + 1),
|
|
754
|
+
d instanceof p && d.setNestingLevel(this.nestingLevel + 1), a.appendChild(d.draw());
|
|
584
755
|
}
|
|
585
756
|
} else {
|
|
586
757
|
const r = document.createElement("div");
|
|
587
|
-
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);
|
|
588
759
|
}
|
|
589
760
|
if (this.addItemCfg) {
|
|
590
761
|
const r = document.createElement("button");
|
|
@@ -597,11 +768,11 @@ const p = class p {
|
|
|
597
768
|
</svg>`;
|
|
598
769
|
r.innerHTML = `${d}<span style="margin-left:4px;">${this.addItemCfg.buttonLabel ?? "Add"}</span>`, r.addEventListener("click", (u) => {
|
|
599
770
|
u.stopPropagation(), u.preventDefault();
|
|
600
|
-
const V = this.getNextIndexFromPrefix(this.addItemCfg.keyPrefix),
|
|
601
|
-
this.addSetting(S,
|
|
602
|
-
}),
|
|
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);
|
|
603
774
|
}
|
|
604
|
-
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(() => {
|
|
605
776
|
this.updateNestingStyles();
|
|
606
777
|
}, 0), this.pendingBlurHandler && (this.setupBlurHandlers(), this.pendingBlurHandler = null), t;
|
|
607
778
|
}
|
|
@@ -638,10 +809,10 @@ const p = class p {
|
|
|
638
809
|
let i = e;
|
|
639
810
|
const s = Object.keys(this.settings), n = Object.keys(e);
|
|
640
811
|
if (!s.some(
|
|
641
|
-
(
|
|
812
|
+
(a) => n.includes(a)
|
|
642
813
|
) && n.length === 1) {
|
|
643
|
-
const
|
|
644
|
-
i = e[
|
|
814
|
+
const a = n[0];
|
|
815
|
+
i = e[a];
|
|
645
816
|
}
|
|
646
817
|
this.setValue(i);
|
|
647
818
|
} catch (e) {
|
|
@@ -685,26 +856,26 @@ class pt extends f {
|
|
|
685
856
|
s.textContent = this.title, i.appendChild(s);
|
|
686
857
|
const n = document.createElement("div");
|
|
687
858
|
n.className = "tabs-header", this.tabsContainer = n;
|
|
688
|
-
const
|
|
689
|
-
if (
|
|
690
|
-
const
|
|
691
|
-
|
|
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);
|
|
692
863
|
const r = document.createElement("div");
|
|
693
|
-
r.className = "tab-panel", this.contentContainers[
|
|
694
|
-
const d = this.settings[
|
|
695
|
-
d && (d instanceof f && d.setNestingLevel(this.getNestingLevel() + 1), r.appendChild(d.draw())),
|
|
696
|
-
}), e.appendChild(i), e.appendChild(n), e.appendChild(
|
|
697
|
-
const
|
|
698
|
-
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 || "";
|
|
699
870
|
}
|
|
700
871
|
return this.updateTabUI(), t;
|
|
701
872
|
}
|
|
702
873
|
}
|
|
703
|
-
function R(
|
|
704
|
-
return new f(
|
|
874
|
+
function R(h) {
|
|
875
|
+
return new f(h);
|
|
705
876
|
}
|
|
706
|
-
function gt(
|
|
707
|
-
return
|
|
877
|
+
function gt(h) {
|
|
878
|
+
return h;
|
|
708
879
|
}
|
|
709
880
|
class $ extends g {
|
|
710
881
|
constructor(t = {}) {
|
|
@@ -746,11 +917,11 @@ class m extends $ {
|
|
|
746
917
|
const e = t.split(",").map((r) => parseInt(r.trim()));
|
|
747
918
|
if (e.length !== 3 || e.some(isNaN))
|
|
748
919
|
return console.warn(`Invalid RGB value "${t}", using default "#000000"`), "#000000";
|
|
749
|
-
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) => {
|
|
750
921
|
const d = r.toString(16);
|
|
751
922
|
return d.length === 1 ? "0" + d : d;
|
|
752
923
|
};
|
|
753
|
-
return `#${
|
|
924
|
+
return `#${c(o)}${c(a)}${c(l)}`;
|
|
754
925
|
}
|
|
755
926
|
setValue(t) {
|
|
756
927
|
if (t === void 0) {
|
|
@@ -773,46 +944,46 @@ class m extends $ {
|
|
|
773
944
|
if (t.className = "color-setting-wrapper " + (this.props.wrapperClassName || ""), this.props.title || this.props.icon) {
|
|
774
945
|
const l = document.createElement("div");
|
|
775
946
|
if (l.className = "icon-container", this.props.icon) {
|
|
776
|
-
const
|
|
777
|
-
|
|
947
|
+
const c = document.createElement("span");
|
|
948
|
+
c.className = "input-icon", c.innerHTML = this.props.icon, l.appendChild(c);
|
|
778
949
|
}
|
|
779
950
|
if (this.props.title) {
|
|
780
|
-
const
|
|
781
|
-
|
|
951
|
+
const c = document.createElement("span");
|
|
952
|
+
c.className = "input-label", c.textContent = this.props.title, l.appendChild(c);
|
|
782
953
|
}
|
|
783
954
|
t.appendChild(l);
|
|
784
955
|
}
|
|
785
956
|
const e = document.createElement("div");
|
|
786
957
|
e.className = "color-input-wrapper";
|
|
787
958
|
const i = (l) => {
|
|
788
|
-
const
|
|
789
|
-
if (!
|
|
959
|
+
const c = l.value.trim();
|
|
960
|
+
if (!c)
|
|
790
961
|
return e.classList.remove("error"), !0;
|
|
791
|
-
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);
|
|
792
963
|
return d ? e.classList.remove("error") : e.classList.add("error"), d;
|
|
793
964
|
}, s = document.createElement("input");
|
|
794
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;
|
|
795
966
|
const n = document.createElement("div");
|
|
796
967
|
n.className = "color-preview";
|
|
797
|
-
const
|
|
798
|
-
n.style.backgroundColor =
|
|
799
|
-
const
|
|
800
|
-
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) => {
|
|
801
972
|
var r, d;
|
|
802
|
-
let
|
|
973
|
+
let c = l.target.value.trim();
|
|
803
974
|
if (this.textInputEl && i(this.textInputEl)) {
|
|
804
|
-
const u = m.normalizeColorValue(
|
|
975
|
+
const u = m.normalizeColorValue(c);
|
|
805
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;
|
|
806
977
|
}
|
|
807
978
|
}), this.colorInputEl.addEventListener("input", (l) => {
|
|
808
979
|
var d, u;
|
|
809
|
-
const
|
|
980
|
+
const c = l.target.value, r = m.normalizeColorValue(c);
|
|
810
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");
|
|
811
982
|
}), this.colorInputEl.addEventListener("change", (l) => {
|
|
812
983
|
var d, u;
|
|
813
|
-
const
|
|
984
|
+
const c = l.target.value, r = m.normalizeColorValue(c);
|
|
814
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;
|
|
815
|
-
}), 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;
|
|
816
987
|
}
|
|
817
988
|
getElement() {
|
|
818
989
|
return this.element;
|
|
@@ -868,8 +1039,8 @@ class C extends g {
|
|
|
868
1039
|
}
|
|
869
1040
|
updateColorPreview() {
|
|
870
1041
|
if (!this.colorPreviewEl || !this.value) return;
|
|
871
|
-
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),
|
|
872
|
-
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})`;
|
|
873
1044
|
}
|
|
874
1045
|
handleColorChange(t) {
|
|
875
1046
|
const e = this.getOpacityPercent(), i = C.combineColorOpacity(t, e);
|
|
@@ -886,41 +1057,41 @@ class C extends g {
|
|
|
886
1057
|
draw() {
|
|
887
1058
|
const t = document.createElement("div");
|
|
888
1059
|
if (t.className = "color-with-opacity-setting-wrapper " + (this.props.wrapperClassName || ""), this.props.title || this.props.icon) {
|
|
889
|
-
const
|
|
890
|
-
if (
|
|
891
|
-
const
|
|
892
|
-
|
|
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);
|
|
893
1064
|
}
|
|
894
1065
|
if (this.props.title) {
|
|
895
|
-
const
|
|
896
|
-
|
|
1066
|
+
const a = document.createElement("span");
|
|
1067
|
+
a.className = "input-label", a.textContent = this.props.title, o.appendChild(a);
|
|
897
1068
|
}
|
|
898
|
-
t.appendChild(
|
|
1069
|
+
t.appendChild(o);
|
|
899
1070
|
}
|
|
900
1071
|
const e = document.createElement("div");
|
|
901
|
-
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", (
|
|
902
|
-
const
|
|
903
|
-
this.handleColorChange(
|
|
904
|
-
}), this.textInputEl.addEventListener("input", (
|
|
905
|
-
const
|
|
906
|
-
this.handleTextInput(
|
|
907
|
-
}), this.textInputEl.addEventListener("blur", (
|
|
908
|
-
const
|
|
909
|
-
|
|
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"));
|
|
910
1081
|
}), this.colorPreviewEl.addEventListener("click", () => {
|
|
911
|
-
var
|
|
912
|
-
(
|
|
1082
|
+
var o;
|
|
1083
|
+
(o = this.colorInputEl) == null || o.click();
|
|
913
1084
|
}), e.appendChild(this.colorInputEl), e.appendChild(this.colorPreviewEl), e.appendChild(this.textInputEl);
|
|
914
1085
|
const i = document.createElement("div");
|
|
915
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";
|
|
916
1087
|
const s = document.createElement("span");
|
|
917
|
-
s.className = "color-with-opacity-opacity-suffix", s.textContent = "%", this.opacityInputEl.addEventListener("input", (
|
|
918
|
-
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);
|
|
919
1090
|
isNaN(l) || (this.handleOpacityChange(l), this.textInputEl && (this.textInputEl.value = this.value || "#000000FF"), this.updateColorPreview());
|
|
920
|
-
}), this.opacityInputEl.addEventListener("blur", (
|
|
921
|
-
const
|
|
922
|
-
let l = parseFloat(
|
|
923
|
-
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();
|
|
924
1095
|
}), i.appendChild(this.opacityInputEl), i.appendChild(s);
|
|
925
1096
|
const n = document.createElement("div");
|
|
926
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;
|
|
@@ -933,8 +1104,8 @@ class C extends g {
|
|
|
933
1104
|
}
|
|
934
1105
|
getRgbaValue() {
|
|
935
1106
|
if (!this.value) return "rgba(0, 0, 0, 1)";
|
|
936
|
-
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),
|
|
937
|
-
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})`;
|
|
938
1109
|
}
|
|
939
1110
|
getColorAndOpacity() {
|
|
940
1111
|
return {
|
|
@@ -955,20 +1126,20 @@ class mt extends g {
|
|
|
955
1126
|
if (t.className = "html-setting-wrapper " + (this.props.wrapperClassName || ""), this.props.title || this.props.icon) {
|
|
956
1127
|
const n = document.createElement("div");
|
|
957
1128
|
if (n.className = "icon-container", this.props.icon) {
|
|
958
|
-
const
|
|
959
|
-
n.appendChild(
|
|
1129
|
+
const o = this.createIcon(this.props.icon);
|
|
1130
|
+
n.appendChild(o);
|
|
960
1131
|
}
|
|
961
1132
|
if (this.props.title) {
|
|
962
|
-
const
|
|
963
|
-
n.appendChild(
|
|
1133
|
+
const o = this.createLabel(this.props.title);
|
|
1134
|
+
n.appendChild(o);
|
|
964
1135
|
}
|
|
965
1136
|
t.appendChild(n);
|
|
966
1137
|
}
|
|
967
1138
|
const e = document.createElement("textarea");
|
|
968
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);
|
|
969
1140
|
const i = (n) => {
|
|
970
|
-
const
|
|
971
|
-
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);
|
|
972
1143
|
}, s = (n) => {
|
|
973
1144
|
this.onBlur && this.value !== void 0 && this.onBlur(this.value);
|
|
974
1145
|
};
|
|
@@ -998,12 +1169,12 @@ class v extends g {
|
|
|
998
1169
|
const i = document.createElement("input");
|
|
999
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", () => {
|
|
1000
1171
|
const s = this.props.minValue ?? Number.MIN_SAFE_INTEGER, n = this.props.maxValue ?? Number.MAX_SAFE_INTEGER;
|
|
1001
|
-
let
|
|
1002
|
-
|
|
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);
|
|
1003
1174
|
}), i.addEventListener("blur", () => {
|
|
1004
|
-
var n,
|
|
1175
|
+
var n, o;
|
|
1005
1176
|
const s = this.validateValue(Number(i.value));
|
|
1006
|
-
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);
|
|
1007
1178
|
}), e.appendChild(i), this.props.suffix && this.props.suffix !== "none") {
|
|
1008
1179
|
const s = document.createElement("span");
|
|
1009
1180
|
s.className = "suffix-label", s.textContent = this.props.suffix, e.appendChild(s);
|
|
@@ -1034,12 +1205,12 @@ class v extends g {
|
|
|
1034
1205
|
);
|
|
1035
1206
|
}
|
|
1036
1207
|
}
|
|
1037
|
-
const
|
|
1208
|
+
const j = `
|
|
1038
1209
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1039
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"/>
|
|
1040
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"/>
|
|
1041
1212
|
</svg>`;
|
|
1042
|
-
class
|
|
1213
|
+
class P extends v {
|
|
1043
1214
|
constructor(t = {}) {
|
|
1044
1215
|
const e = {
|
|
1045
1216
|
title: "Opacity",
|
|
@@ -1048,7 +1219,7 @@ class j extends v {
|
|
|
1048
1219
|
maxValue: 100,
|
|
1049
1220
|
step: 1,
|
|
1050
1221
|
default: t.default ?? 100,
|
|
1051
|
-
icon:
|
|
1222
|
+
icon: j,
|
|
1052
1223
|
...t
|
|
1053
1224
|
};
|
|
1054
1225
|
super(e), this.inputType = "number", this.mobileValue = t.mobile;
|
|
@@ -1060,12 +1231,12 @@ class j extends v {
|
|
|
1060
1231
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
1061
1232
|
}
|
|
1062
1233
|
}
|
|
1063
|
-
const
|
|
1234
|
+
const G = `
|
|
1064
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">
|
|
1065
1236
|
<polyline points="6 9 12 15 18 9"></polyline>
|
|
1066
1237
|
</svg>
|
|
1067
1238
|
`;
|
|
1068
|
-
class
|
|
1239
|
+
class M extends g {
|
|
1069
1240
|
constructor(t = {}) {
|
|
1070
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) {
|
|
1071
1242
|
const e = this._options.findIndex((i) => i.value === this.value);
|
|
@@ -1086,12 +1257,12 @@ class k extends g {
|
|
|
1086
1257
|
if (t.classList.add("select-container"), this.container = t, this.props.icon || this.props.title) {
|
|
1087
1258
|
const n = document.createElement("div");
|
|
1088
1259
|
if (n.className = "icon-container", this.props.icon) {
|
|
1089
|
-
const
|
|
1090
|
-
n.appendChild(
|
|
1260
|
+
const o = this.createIcon(this.props.icon);
|
|
1261
|
+
n.appendChild(o);
|
|
1091
1262
|
}
|
|
1092
1263
|
if (this.props.title) {
|
|
1093
|
-
const
|
|
1094
|
-
n.appendChild(
|
|
1264
|
+
const o = this.createLabel(this.props.title);
|
|
1265
|
+
n.appendChild(o);
|
|
1095
1266
|
}
|
|
1096
1267
|
t.appendChild(n);
|
|
1097
1268
|
} else {
|
|
@@ -1100,22 +1271,22 @@ class k extends g {
|
|
|
1100
1271
|
}
|
|
1101
1272
|
const e = document.createElement("div");
|
|
1102
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 = () => {
|
|
1103
|
-
var n,
|
|
1104
|
-
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));
|
|
1105
1276
|
}, t.appendChild(e), this.buttonEl = e;
|
|
1106
1277
|
const i = document.createElement("ul");
|
|
1107
|
-
i.classList.add("select-options"), this._options.forEach((n,
|
|
1108
|
-
const
|
|
1109
|
-
|
|
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);
|
|
1110
1281
|
}), document.body.appendChild(i);
|
|
1111
1282
|
const s = document.createElement("div");
|
|
1112
|
-
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) => {
|
|
1113
1284
|
this._options.push(...n), this.isLoading = !1, this.updateOptionsList(), this.updateButtonText();
|
|
1114
1285
|
}).catch((n) => {
|
|
1115
1286
|
console.error("Failed to fetch async options:", n), this.isLoading = !1, this.updateButtonText("Failed to load options");
|
|
1116
1287
|
})), this.clickOutsideListener && document.removeEventListener("click", this.clickOutsideListener), this.clickOutsideListener = (n) => {
|
|
1117
|
-
var
|
|
1118
|
-
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());
|
|
1119
1290
|
}, document.addEventListener("click", this.clickOutsideListener), this.resizeListener && window.removeEventListener("resize", this.resizeListener), this.resizeListener = () => {
|
|
1120
1291
|
this.isOpen && this.checkDropdownPosition();
|
|
1121
1292
|
}, window.addEventListener("resize", this.resizeListener), t;
|
|
@@ -1137,10 +1308,10 @@ class k extends g {
|
|
|
1137
1308
|
}
|
|
1138
1309
|
}
|
|
1139
1310
|
selectOption(t, e, i) {
|
|
1140
|
-
var n,
|
|
1311
|
+
var n, o, a;
|
|
1141
1312
|
const s = this._options[e];
|
|
1142
|
-
s && (this.value = s.value, (n = this.onChange) == null || n.call(this, this.value), this.selectedOptionIndex = e, this.isOpen = !1, i.textContent = s.name, (
|
|
1143
|
-
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");
|
|
1144
1315
|
}));
|
|
1145
1316
|
}
|
|
1146
1317
|
/**
|
|
@@ -1223,11 +1394,11 @@ class W extends g {
|
|
|
1223
1394
|
`
|
|
1224
1395
|
}
|
|
1225
1396
|
].forEach((n) => {
|
|
1226
|
-
const
|
|
1227
|
-
|
|
1228
|
-
var
|
|
1229
|
-
i.querySelectorAll(".align-option-button").forEach((l) => l.classList.remove("selected")),
|
|
1230
|
-
}), 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);
|
|
1231
1402
|
}), t.appendChild(i), t;
|
|
1232
1403
|
}
|
|
1233
1404
|
}
|
|
@@ -1245,19 +1416,19 @@ class ft extends g {
|
|
|
1245
1416
|
/^rgba\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)$/i
|
|
1246
1417
|
);
|
|
1247
1418
|
if (n) {
|
|
1248
|
-
let
|
|
1249
|
-
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})`;
|
|
1250
1421
|
}
|
|
1251
1422
|
t.addEventListener("mouseenter", () => {
|
|
1252
1423
|
console.log("hoverBg", s), t.style.setProperty("background-color", s, "important");
|
|
1253
1424
|
}), t.addEventListener("mouseleave", () => {
|
|
1254
1425
|
t.style.setProperty("background-color", e, "important");
|
|
1255
1426
|
}), t.addEventListener("click", () => {
|
|
1256
|
-
var
|
|
1257
|
-
return (l = (
|
|
1427
|
+
var a, l;
|
|
1428
|
+
return (l = (a = this.props).onClick) == null ? void 0 : l.call(a);
|
|
1258
1429
|
});
|
|
1259
|
-
const
|
|
1260
|
-
return
|
|
1430
|
+
const o = document.createElement("div");
|
|
1431
|
+
return o.className = "button-setting-wrapper " + (this.props.wrapperClassName || ""), o.appendChild(t), o;
|
|
1261
1432
|
}
|
|
1262
1433
|
}
|
|
1263
1434
|
class vt extends g {
|
|
@@ -1350,8 +1521,8 @@ class vt extends g {
|
|
|
1350
1521
|
return n.className = "dimension-lock-icon", n.setAttribute("type", "button"), n.setAttribute("aria-pressed", String(this.locked)), n.setAttribute(
|
|
1351
1522
|
"aria-label",
|
|
1352
1523
|
this.locked ? "Unlock aspect ratio" : "Lock aspect ratio"
|
|
1353
|
-
), n.title = this.locked ? "Unlock aspect ratio" : "Lock aspect ratio", n.innerHTML = this.getLockSVG(this.locked), n.onclick = (
|
|
1354
|
-
|
|
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);
|
|
1355
1526
|
}, s.appendChild(n), t.appendChild(e), t.appendChild(s), t.appendChild(i), t;
|
|
1356
1527
|
}
|
|
1357
1528
|
isLocked() {
|
|
@@ -1465,11 +1636,11 @@ class Z extends g {
|
|
|
1465
1636
|
<span class="upload-label">Replace</span>
|
|
1466
1637
|
`);
|
|
1467
1638
|
const n = () => {
|
|
1468
|
-
this.hideLoading(), this.previewWrapper.classList.add("has-image"), this.previewEl.style.display = "block", this.previewEl.removeEventListener("load", n), this.previewEl.removeEventListener("error",
|
|
1469
|
-
},
|
|
1470
|
-
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);
|
|
1471
1642
|
};
|
|
1472
|
-
this.previewEl.addEventListener("load", n), this.previewEl.addEventListener("error",
|
|
1643
|
+
this.previewEl.addEventListener("load", n), this.previewEl.addEventListener("error", o), this.previewEl.src = t;
|
|
1473
1644
|
} else
|
|
1474
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 = `
|
|
1475
1646
|
<span class="upload-icon">${y}</span>
|
|
@@ -1480,24 +1651,24 @@ class Z extends g {
|
|
|
1480
1651
|
const t = document.createElement("div");
|
|
1481
1652
|
t.className = "upload-setting-wrapper", t.setAttribute("data-setting-id", this.id), t.addEventListener(
|
|
1482
1653
|
"focusout",
|
|
1483
|
-
(
|
|
1654
|
+
(a) => {
|
|
1484
1655
|
var l;
|
|
1485
|
-
|
|
1656
|
+
a.relatedTarget && t.contains(a.relatedTarget) || (l = this.onBlur) == null || l.call(this, this.value ?? "");
|
|
1486
1657
|
},
|
|
1487
1658
|
!0
|
|
1488
1659
|
);
|
|
1489
1660
|
const e = !!(this.props.title || this.props.icon);
|
|
1490
1661
|
if (e || t.classList.add("no-label"), e) {
|
|
1491
|
-
const
|
|
1492
|
-
if (
|
|
1662
|
+
const a = document.createElement("div");
|
|
1663
|
+
if (a.className = "icon-title-container", this.props.icon) {
|
|
1493
1664
|
const l = this.createIcon(this.props.icon);
|
|
1494
|
-
|
|
1665
|
+
a.appendChild(l);
|
|
1495
1666
|
}
|
|
1496
1667
|
if (this.props.title) {
|
|
1497
1668
|
const l = this.createLabel(this.props.title);
|
|
1498
|
-
|
|
1669
|
+
a.appendChild(l);
|
|
1499
1670
|
}
|
|
1500
|
-
t.appendChild(
|
|
1671
|
+
t.appendChild(a);
|
|
1501
1672
|
}
|
|
1502
1673
|
this.errorContainer = document.createElement("div"), this.errorContainer.className = "error-message", this.errorContainer.style.display = "none", t.appendChild(this.errorContainer);
|
|
1503
1674
|
const i = document.createElement("div");
|
|
@@ -1506,18 +1677,18 @@ class Z extends g {
|
|
|
1506
1677
|
s || i.classList.add("no-image");
|
|
1507
1678
|
const n = document.createElement("div");
|
|
1508
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) {
|
|
1509
|
-
const
|
|
1510
|
-
|
|
1511
|
-
var
|
|
1512
|
-
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();
|
|
1513
1684
|
};
|
|
1514
1685
|
}
|
|
1515
1686
|
this.previewWrapper.appendChild(this.previewEl);
|
|
1516
|
-
const
|
|
1517
|
-
return
|
|
1687
|
+
const o = document.createElement("button");
|
|
1688
|
+
return o.className = "upload-button", o.innerHTML = `
|
|
1518
1689
|
<span class="upload-icon">${y}</span>
|
|
1519
1690
|
<span class="upload-label">Upload</span>
|
|
1520
|
-
`, 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 = () => {
|
|
1521
1692
|
window.postMessage(
|
|
1522
1693
|
{
|
|
1523
1694
|
type: "OPEN_FILE_MANAGER_MODAL",
|
|
@@ -1601,46 +1772,46 @@ class Et extends g {
|
|
|
1601
1772
|
e.classList.add("has-label");
|
|
1602
1773
|
const n = document.createElement("div");
|
|
1603
1774
|
n.className = "select-label", n.textContent = this.props.title, e.appendChild(n);
|
|
1604
|
-
const
|
|
1605
|
-
if (
|
|
1606
|
-
|
|
1775
|
+
const o = document.createElement("span");
|
|
1776
|
+
if (o.className = "select-value", this.isLoading)
|
|
1777
|
+
o.textContent = this.props.loadingText || "Loading options...";
|
|
1607
1778
|
else {
|
|
1608
|
-
const
|
|
1609
|
-
|
|
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;
|
|
1610
1781
|
}
|
|
1611
|
-
e.appendChild(
|
|
1782
|
+
e.appendChild(o);
|
|
1612
1783
|
} else {
|
|
1613
1784
|
const n = document.createElement("span");
|
|
1614
1785
|
if (this.isLoading)
|
|
1615
1786
|
n.textContent = this.props.loadingText || "Loading options...";
|
|
1616
1787
|
else {
|
|
1617
|
-
const
|
|
1618
|
-
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;
|
|
1619
1790
|
}
|
|
1620
1791
|
e.appendChild(n);
|
|
1621
1792
|
}
|
|
1622
1793
|
e.onclick = () => {
|
|
1623
|
-
var n,
|
|
1624
|
-
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));
|
|
1625
1796
|
}, t.appendChild(e), this.buttonEl = e;
|
|
1626
1797
|
const i = document.createElement("ul");
|
|
1627
|
-
i.classList.add("select-api-options"), this._options.forEach((n,
|
|
1628
|
-
const
|
|
1629
|
-
|
|
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);
|
|
1630
1801
|
}), t.appendChild(i);
|
|
1631
1802
|
const s = document.createElement("div");
|
|
1632
1803
|
return s.classList.add("svg-container"), s.innerHTML = Q, t.appendChild(s), s.onclick = () => {
|
|
1633
|
-
var n,
|
|
1634
|
-
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));
|
|
1635
1806
|
}, this.optionsListEl = i, this.svgContainer = s, this.props.getOptionsAsync && !this.hasInitializedOptions ? (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((n) => {
|
|
1636
|
-
const
|
|
1807
|
+
const o = new Set(
|
|
1637
1808
|
this._options.map((l) => JSON.stringify(l.value))
|
|
1638
|
-
),
|
|
1639
|
-
(l) => !
|
|
1809
|
+
), a = n.filter(
|
|
1810
|
+
(l) => !o.has(JSON.stringify(l.value))
|
|
1640
1811
|
);
|
|
1641
|
-
if (this._options.push(...
|
|
1812
|
+
if (this._options.push(...a), this.isLoading = !1, this.hasInitializedOptions = !0, this.value !== void 0) {
|
|
1642
1813
|
const l = this._options.findIndex(
|
|
1643
|
-
(
|
|
1814
|
+
(c) => JSON.stringify(c.value) === JSON.stringify(this.value)
|
|
1644
1815
|
);
|
|
1645
1816
|
this.selectedOptionIndex = l !== -1 ? l : null;
|
|
1646
1817
|
} else
|
|
@@ -1652,14 +1823,14 @@ class Et extends g {
|
|
|
1652
1823
|
!0
|
|
1653
1824
|
);
|
|
1654
1825
|
})) : this.props.getOptionsAsync && this._options.length <= 1 && (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((n) => {
|
|
1655
|
-
const
|
|
1826
|
+
const o = new Set(
|
|
1656
1827
|
this._options.map((l) => JSON.stringify(l.value))
|
|
1657
|
-
),
|
|
1658
|
-
(l) => !
|
|
1828
|
+
), a = n.filter(
|
|
1829
|
+
(l) => !o.has(JSON.stringify(l.value))
|
|
1659
1830
|
);
|
|
1660
|
-
if (this._options.push(...
|
|
1831
|
+
if (this._options.push(...a), this.isLoading = !1, this.value !== void 0) {
|
|
1661
1832
|
const l = this._options.findIndex(
|
|
1662
|
-
(
|
|
1833
|
+
(c) => JSON.stringify(c.value) === JSON.stringify(this.value)
|
|
1663
1834
|
);
|
|
1664
1835
|
this.selectedOptionIndex = l !== -1 ? l : null;
|
|
1665
1836
|
} else
|
|
@@ -1676,19 +1847,19 @@ class Et extends g {
|
|
|
1676
1847
|
return JSON.stringify(t ? {} : { value: this.value }, null, 2);
|
|
1677
1848
|
}
|
|
1678
1849
|
selectApiOption(t, e, i) {
|
|
1679
|
-
var l,
|
|
1850
|
+
var l, c, r, d;
|
|
1680
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"));
|
|
1681
1852
|
n && (n.checked = !0), this.selectedOptionIndex = e;
|
|
1682
|
-
const
|
|
1683
|
-
this.value =
|
|
1684
|
-
const
|
|
1685
|
-
if (
|
|
1686
|
-
|
|
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;
|
|
1687
1858
|
else {
|
|
1688
1859
|
const u = i.firstChild;
|
|
1689
1860
|
u && u.tagName === "SPAN" && (u.textContent = this._options[e].name);
|
|
1690
1861
|
}
|
|
1691
|
-
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);
|
|
1692
1863
|
}
|
|
1693
1864
|
updateOptionsList() {
|
|
1694
1865
|
!this.optionsListEl || !this.buttonEl || (this.optionsListEl.innerHTML = "", this._options.forEach((t, e) => {
|
|
@@ -1727,7 +1898,7 @@ class bt extends g {
|
|
|
1727
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;
|
|
1728
1899
|
}
|
|
1729
1900
|
draw() {
|
|
1730
|
-
var
|
|
1901
|
+
var o, a;
|
|
1731
1902
|
const t = document.createElement("div");
|
|
1732
1903
|
t.className = "toggle-setting-container", this.props.icon && t.classList.add("toggle-with-icon");
|
|
1733
1904
|
const e = document.createElement("div");
|
|
@@ -1743,17 +1914,17 @@ class bt extends g {
|
|
|
1743
1914
|
const i = document.createElement("label");
|
|
1744
1915
|
i.className = "toggle-switch";
|
|
1745
1916
|
const s = document.createElement("input");
|
|
1746
|
-
s.type = "checkbox", s.checked = ((
|
|
1747
|
-
var
|
|
1748
|
-
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) ?? "";
|
|
1749
1920
|
this.value = l, this.onChange && this.onChange(this.value), this.detectChangeCallback && this.detectChangeCallback(this.value);
|
|
1750
1921
|
});
|
|
1751
1922
|
const n = document.createElement("span");
|
|
1752
1923
|
if (n.className = "toggle-slider", this.props.activeColor || this.props.inactiveColor) {
|
|
1753
|
-
const l = document.createElement("style"),
|
|
1924
|
+
const l = document.createElement("style"), c = this.props.activeColor || "#4CAF50", r = this.props.inactiveColor || "#ccc";
|
|
1754
1925
|
l.textContent = `
|
|
1755
1926
|
.toggle-switch input:checked + .toggle-slider {
|
|
1756
|
-
background-color: ${
|
|
1927
|
+
background-color: ${c};
|
|
1757
1928
|
}
|
|
1758
1929
|
.toggle-switch .toggle-slider {
|
|
1759
1930
|
background-color: ${r};
|
|
@@ -1769,7 +1940,7 @@ class bt extends g {
|
|
|
1769
1940
|
const Y = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1770
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"/>
|
|
1771
1942
|
</svg>`;
|
|
1772
|
-
class
|
|
1943
|
+
class xt extends g {
|
|
1773
1944
|
// Store mobile value
|
|
1774
1945
|
constructor(t = {}) {
|
|
1775
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);
|
|
@@ -1783,27 +1954,27 @@ class Lt extends g {
|
|
|
1783
1954
|
i.className = "setting-label", i.setAttribute("for", this.id + "-input");
|
|
1784
1955
|
const s = document.createElement("span");
|
|
1785
1956
|
if (s.textContent = this.props.title ?? "Gap", i.appendChild(s), this.props.icon) {
|
|
1786
|
-
const
|
|
1787
|
-
|
|
1957
|
+
const a = document.createElement("span");
|
|
1958
|
+
a.className = "setting-icon", a.innerHTML = this.props.icon, i.insertBefore(a, s);
|
|
1788
1959
|
}
|
|
1789
1960
|
const n = document.createElement("div");
|
|
1790
1961
|
n.className = `setting-input-wrapper ${this.props.wrapperClassName || ""}`, n.classList.add("gap-setting-wrapper");
|
|
1791
|
-
const
|
|
1792
|
-
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;
|
|
1793
1964
|
}
|
|
1794
1965
|
createGapInput(t, e) {
|
|
1795
1966
|
const i = document.createElement("div");
|
|
1796
1967
|
i.className = "gap-input-wrapper";
|
|
1797
1968
|
const s = document.createElement("input");
|
|
1798
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) => {
|
|
1799
|
-
const
|
|
1800
|
-
let
|
|
1801
|
-
|
|
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);
|
|
1802
1973
|
}), s.addEventListener("blur", (n) => {
|
|
1803
|
-
var l,
|
|
1804
|
-
const
|
|
1805
|
-
let
|
|
1806
|
-
|
|
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);
|
|
1807
1978
|
}), i.appendChild(s), this.props.suffix && this.props.suffix !== "none") {
|
|
1808
1979
|
const n = document.createElement("span");
|
|
1809
1980
|
n.className = "gap-suffix", n.textContent = this.props.suffix, i.appendChild(n), s.style.paddingRight = "30px";
|
|
@@ -1826,7 +1997,7 @@ class Lt extends g {
|
|
|
1826
1997
|
const tt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1827
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"/>
|
|
1828
1999
|
</svg>`;
|
|
1829
|
-
class
|
|
2000
|
+
class Lt extends v {
|
|
1830
2001
|
constructor(t = {}) {
|
|
1831
2002
|
super({
|
|
1832
2003
|
...t,
|
|
@@ -1869,7 +2040,7 @@ const it = `
|
|
|
1869
2040
|
<line x1="5" y1="12" x2="19" y2="12"></line>
|
|
1870
2041
|
</svg>
|
|
1871
2042
|
`;
|
|
1872
|
-
class
|
|
2043
|
+
class kt extends g {
|
|
1873
2044
|
constructor(t = {}) {
|
|
1874
2045
|
super(t), this.inputType = {}, this.container = null, this.languagesContainer = null, this.addLanguageSelect = null, this.addButton = null, this.defaultLanguages = [
|
|
1875
2046
|
{ code: "en", name: "English" },
|
|
@@ -1911,15 +2082,15 @@ class Mt extends g {
|
|
|
1911
2082
|
s.classList.add("language-label"), s.textContent = t.toUpperCase();
|
|
1912
2083
|
const n = document.createElement("div");
|
|
1913
2084
|
n.classList.add("language-input-group");
|
|
1914
|
-
const
|
|
1915
|
-
|
|
1916
|
-
const
|
|
1917
|
-
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);
|
|
1918
2089
|
});
|
|
1919
|
-
const
|
|
1920
|
-
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", () => {
|
|
1921
2092
|
this.removeLanguage(t);
|
|
1922
|
-
}), n.appendChild(
|
|
2093
|
+
}), n.appendChild(o), n.appendChild(a), i.appendChild(s), i.appendChild(n), i;
|
|
1923
2094
|
}
|
|
1924
2095
|
updateLanguageValue(t, e) {
|
|
1925
2096
|
this.value || (this.value = {}), this.value[t] = e, this.onChange && this.onChange(this.value), this.props.detectChange && this.props.detectChange(this.value);
|
|
@@ -1951,8 +2122,8 @@ class Mt extends g {
|
|
|
1951
2122
|
s.classList.add("add-language-select"), this.addLanguageSelect = s;
|
|
1952
2123
|
const n = document.createElement("button");
|
|
1953
2124
|
return n.type = "button", n.classList.add("add-language-btn"), n.innerHTML = `${st} Add`, this.addButton = n, n.addEventListener("click", () => {
|
|
1954
|
-
const
|
|
1955
|
-
|
|
2125
|
+
const o = s.value;
|
|
2126
|
+
o && this.addLanguage(o);
|
|
1956
2127
|
}), i.appendChild(s), i.appendChild(n), t.appendChild(e), t.appendChild(i), t;
|
|
1957
2128
|
}
|
|
1958
2129
|
draw() {
|
|
@@ -1964,9 +2135,9 @@ class Mt extends g {
|
|
|
1964
2135
|
const e = document.createElement("div");
|
|
1965
2136
|
e.classList.add("multi-language-content");
|
|
1966
2137
|
const i = document.createElement("div");
|
|
1967
|
-
i.classList.add("languages-container"), this.languagesContainer = i, this.value && Object.entries(this.value).forEach(([n,
|
|
1968
|
-
const
|
|
1969
|
-
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);
|
|
1970
2141
|
}), e.appendChild(i);
|
|
1971
2142
|
const s = this.createAddLanguageSection();
|
|
1972
2143
|
return e.appendChild(s), t.appendChild(e), this.updateAddLanguageSelect(), this.container = t, t;
|
|
@@ -1978,7 +2149,7 @@ class Mt extends g {
|
|
|
1978
2149
|
}), this.updateAddLanguageSelect());
|
|
1979
2150
|
}
|
|
1980
2151
|
}
|
|
1981
|
-
class
|
|
2152
|
+
class Mt extends g {
|
|
1982
2153
|
constructor(t = {}) {
|
|
1983
2154
|
super(t), this.inputType = "select";
|
|
1984
2155
|
const e = [
|
|
@@ -1989,7 +2160,7 @@ class kt extends g {
|
|
|
1989
2160
|
{ name: "Bounce", value: "bounce 1.5s ease-in-out infinite" },
|
|
1990
2161
|
{ name: "Pulse", value: "pulse 1.5s ease-in-out infinite" }
|
|
1991
2162
|
];
|
|
1992
|
-
this.selectSetting = new
|
|
2163
|
+
this.selectSetting = new M({
|
|
1993
2164
|
title: this.title || "Animation",
|
|
1994
2165
|
options: e,
|
|
1995
2166
|
default: this.props.default || "none"
|
|
@@ -2009,7 +2180,7 @@ const nt = `
|
|
|
2009
2180
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2010
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"/>
|
|
2011
2182
|
</svg>
|
|
2012
|
-
`,
|
|
2183
|
+
`, ot = `
|
|
2013
2184
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2014
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"/>
|
|
2015
2186
|
</svg>
|
|
@@ -2023,7 +2194,7 @@ class Vt extends f {
|
|
|
2023
2194
|
settings: {
|
|
2024
2195
|
size: new v({
|
|
2025
2196
|
title: "Size",
|
|
2026
|
-
icon:
|
|
2197
|
+
icon: ot,
|
|
2027
2198
|
default: (t == null ? void 0 : t.size) ?? 0,
|
|
2028
2199
|
suffix: "px"
|
|
2029
2200
|
}),
|
|
@@ -2051,7 +2222,7 @@ class Vt extends f {
|
|
|
2051
2222
|
`;
|
|
2052
2223
|
}
|
|
2053
2224
|
}
|
|
2054
|
-
const
|
|
2225
|
+
const at = `
|
|
2055
2226
|
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="13" viewBox="0 0 14 13" fill="none">
|
|
2056
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"/>
|
|
2057
2228
|
</svg>
|
|
@@ -2076,9 +2247,9 @@ class Nt extends f {
|
|
|
2076
2247
|
color: new C({
|
|
2077
2248
|
default: i.colorDefault ?? "0, 0, 30"
|
|
2078
2249
|
}),
|
|
2079
|
-
fontFamily: new
|
|
2250
|
+
fontFamily: new M({
|
|
2080
2251
|
title: "Font",
|
|
2081
|
-
icon:
|
|
2252
|
+
icon: at,
|
|
2082
2253
|
default: i.fontFamilyDefault ?? "Satoshi",
|
|
2083
2254
|
options: i.fontFamilyOptions ?? [
|
|
2084
2255
|
{ name: "Alt", value: "Croco Sans Black Caps Alt" },
|
|
@@ -2089,7 +2260,7 @@ class Nt extends f {
|
|
|
2089
2260
|
getOptions: i.fontFamilyGetOptions,
|
|
2090
2261
|
getOptionsAsync: i.fontFamilyGetOptionsAsync
|
|
2091
2262
|
}),
|
|
2092
|
-
fontWeight: new
|
|
2263
|
+
fontWeight: new M({
|
|
2093
2264
|
title: "Weight",
|
|
2094
2265
|
icon: lt,
|
|
2095
2266
|
default: i.fontWeightDefault ?? "400",
|
|
@@ -2120,8 +2291,8 @@ class Nt extends f {
|
|
|
2120
2291
|
});
|
|
2121
2292
|
}
|
|
2122
2293
|
getCssCode() {
|
|
2123
|
-
var
|
|
2124
|
-
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";
|
|
2125
2296
|
return `
|
|
2126
2297
|
color: ${t};
|
|
2127
2298
|
font-family: ${e};
|
|
@@ -2139,11 +2310,11 @@ class E extends g {
|
|
|
2139
2310
|
}), this.inputType = "number", this.value = t.default !== void 0 ? t.default : "auto";
|
|
2140
2311
|
}
|
|
2141
2312
|
draw() {
|
|
2142
|
-
const t = this.value === "auto" ? "text" : "number", e = (
|
|
2143
|
-
this.value !== "auto" && (this.props.minValue !== void 0 && (
|
|
2144
|
-
const l = this.props.minValue ?? Number.MIN_SAFE_INTEGER,
|
|
2145
|
-
let r = Number(
|
|
2146
|
-
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);
|
|
2147
2318
|
}));
|
|
2148
2319
|
}, i = this.createInput({
|
|
2149
2320
|
value: this.value,
|
|
@@ -2164,14 +2335,14 @@ class E extends g {
|
|
|
2164
2335
|
s && (s.style.paddingRight = "35px");
|
|
2165
2336
|
const n = document.createElement("span");
|
|
2166
2337
|
n.className = "suffix-label", n.textContent = this.props.suffix, i.appendChild(n);
|
|
2167
|
-
const
|
|
2168
|
-
return
|
|
2169
|
-
const l =
|
|
2338
|
+
const o = i.querySelector("input");
|
|
2339
|
+
return o && (o.oninput = (a) => {
|
|
2340
|
+
const l = a.target.value.trim();
|
|
2170
2341
|
if (l.toLowerCase() === "auto")
|
|
2171
2342
|
this.value = "auto";
|
|
2172
2343
|
else {
|
|
2173
|
-
const
|
|
2174
|
-
isNaN(
|
|
2344
|
+
const c = Number(l);
|
|
2345
|
+
isNaN(c) || (this.value = c);
|
|
2175
2346
|
}
|
|
2176
2347
|
this.onChange && this.onChange(this.value);
|
|
2177
2348
|
}), i;
|
|
@@ -2186,13 +2357,13 @@ class It extends f {
|
|
|
2186
2357
|
settings: {
|
|
2187
2358
|
marginTop: new E({
|
|
2188
2359
|
title: "Top",
|
|
2189
|
-
icon:
|
|
2360
|
+
icon: ct,
|
|
2190
2361
|
suffix: "px",
|
|
2191
2362
|
default: (t == null ? void 0 : t.marginTop) ?? "auto"
|
|
2192
2363
|
}),
|
|
2193
2364
|
marginRight: new E({
|
|
2194
2365
|
title: "Right",
|
|
2195
|
-
icon:
|
|
2366
|
+
icon: ht,
|
|
2196
2367
|
suffix: "px",
|
|
2197
2368
|
default: (t == null ? void 0 : t.marginRight) ?? 0
|
|
2198
2369
|
}),
|
|
@@ -2221,9 +2392,9 @@ class It extends f {
|
|
|
2221
2392
|
`;
|
|
2222
2393
|
}
|
|
2223
2394
|
}
|
|
2224
|
-
const
|
|
2395
|
+
const ct = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2225
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"/>
|
|
2226
|
-
</svg>`,
|
|
2397
|
+
</svg>`, ht = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2227
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"/>
|
|
2228
2399
|
</svg>`, dt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2229
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"/>
|
|
@@ -2264,7 +2435,7 @@ class St extends f {
|
|
|
2264
2435
|
...t == null ? void 0 : t.uploadProps,
|
|
2265
2436
|
default: (t == null ? void 0 : t.backgroundImage) ?? ""
|
|
2266
2437
|
}),
|
|
2267
|
-
opacity: new
|
|
2438
|
+
opacity: new P({
|
|
2268
2439
|
default: (t == null ? void 0 : t.opacity) ?? 100
|
|
2269
2440
|
}),
|
|
2270
2441
|
backgroundColor: new C({
|
|
@@ -2279,10 +2450,10 @@ class St extends f {
|
|
|
2279
2450
|
draw() {
|
|
2280
2451
|
const t = super.draw(), e = t.querySelector(".setting-group-content");
|
|
2281
2452
|
if (!e) return t;
|
|
2282
|
-
const i = Array.from(e.children), [s, n,
|
|
2453
|
+
const i = Array.from(e.children), [s, n, o] = i;
|
|
2283
2454
|
e.innerHTML = "", e.appendChild(s), e.appendChild(n);
|
|
2284
|
-
const
|
|
2285
|
-
return
|
|
2455
|
+
const a = document.createElement("div");
|
|
2456
|
+
return a.className = "bgset-or-label", a.textContent = "OR", e.appendChild(a), e.appendChild(o), t;
|
|
2286
2457
|
}
|
|
2287
2458
|
/**
|
|
2288
2459
|
* Helper method to generate CSS based on the current settings.
|
|
@@ -2299,33 +2470,33 @@ class St extends f {
|
|
|
2299
2470
|
`;
|
|
2300
2471
|
}
|
|
2301
2472
|
}
|
|
2302
|
-
function Ot(
|
|
2303
|
-
return
|
|
2473
|
+
function Ot(h) {
|
|
2474
|
+
return h instanceof f;
|
|
2304
2475
|
}
|
|
2305
|
-
function Ht(
|
|
2306
|
-
return
|
|
2476
|
+
function Ht(h) {
|
|
2477
|
+
return h instanceof g;
|
|
2307
2478
|
}
|
|
2308
2479
|
export {
|
|
2309
2480
|
W as AlignSetting,
|
|
2310
|
-
|
|
2481
|
+
Mt as AnimationSetting,
|
|
2311
2482
|
St as BackgroundSettingSet,
|
|
2312
2483
|
Vt as BorderSettingSet,
|
|
2313
2484
|
ft as ButtonSetting,
|
|
2314
2485
|
m as ColorSetting,
|
|
2315
2486
|
C as ColorWithOpacitySetting,
|
|
2316
2487
|
vt as DimensionSetting,
|
|
2317
|
-
|
|
2488
|
+
xt as GapSetting,
|
|
2318
2489
|
Nt as HeaderTypographySettingSet,
|
|
2319
2490
|
Ct as HeightSetting,
|
|
2320
2491
|
mt as HtmlSetting,
|
|
2321
|
-
|
|
2492
|
+
Lt as MarginBottomSetting,
|
|
2322
2493
|
It as MarginSettingGroup,
|
|
2323
2494
|
yt as MarginTopSetting,
|
|
2324
|
-
|
|
2495
|
+
kt as MultiLanguageSetting,
|
|
2325
2496
|
v as NumberSetting,
|
|
2326
|
-
|
|
2497
|
+
P as OpacitySetting,
|
|
2327
2498
|
Et as SelectApiSettings,
|
|
2328
|
-
|
|
2499
|
+
M as SelectSetting,
|
|
2329
2500
|
g as Setting,
|
|
2330
2501
|
f as SettingGroup,
|
|
2331
2502
|
$ as StringSetting,
|