builder-settings-types 0.0.219 → 0.0.223
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 +115 -43
- package/dist/builder-settings-types.es.js +484 -287
- package/dist/index.d.ts +15 -0
- package/package.json +1 -1
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
const
|
|
2
|
-
let
|
|
3
|
-
let t = "", e = crypto.getRandomValues(new Uint8Array(
|
|
4
|
-
for (;
|
|
5
|
-
t +=
|
|
1
|
+
const H = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
2
|
+
let O = (h = 21) => {
|
|
3
|
+
let t = "", e = crypto.getRandomValues(new Uint8Array(h |= 0));
|
|
4
|
+
for (; h--; )
|
|
5
|
+
t += H[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 k(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] = k(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] = k(h[i]));
|
|
22
|
+
const e = Object.getPrototypeOf(h);
|
|
23
23
|
return e !== Object.prototype && Object.setPrototypeOf(t, e), t;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
switch (
|
|
25
|
+
function T(h) {
|
|
26
|
+
switch (h) {
|
|
27
27
|
case "number":
|
|
28
28
|
return 0;
|
|
29
29
|
case "text":
|
|
@@ -42,7 +42,7 @@ function H(c) {
|
|
|
42
42
|
}
|
|
43
43
|
class g {
|
|
44
44
|
constructor(t = {}) {
|
|
45
|
-
this.props = t, this.id = t.id ||
|
|
45
|
+
this.props = t, this.id = t.id || O(), this.value = this.props.default, this.desktop = this.props.default, this.title = t.title || "", this.includeGetJson = t.includeGetJson !== void 0 ? t.includeGetJson : !0;
|
|
46
46
|
}
|
|
47
47
|
static SetUploadUrl(t) {
|
|
48
48
|
window.DefaultUploadUrl = t, g.DefaultUploadUrl = t;
|
|
@@ -60,8 +60,8 @@ 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 = k(this.props), i = new t(e);
|
|
64
|
+
return i.value = k(this.value), i;
|
|
65
65
|
}
|
|
66
66
|
createInput(t) {
|
|
67
67
|
t = { ...this.props.inputProps, ...t };
|
|
@@ -81,33 +81,33 @@ class g {
|
|
|
81
81
|
const i = document.createElement("div");
|
|
82
82
|
i.className = t.wrapperClassName || "";
|
|
83
83
|
const s = document.createElement("input");
|
|
84
|
-
this.inputEl = s, s.value = String(t.value ||
|
|
84
|
+
this.inputEl = s, s.value = String(t.value || T(t.inputType)), s.type = t.inputType, s.placeholder = t.placeholder || "", s.className = t.inputClassName || "";
|
|
85
85
|
const n = (o) => {
|
|
86
86
|
const l = o.target;
|
|
87
|
-
let
|
|
87
|
+
let r = l.value;
|
|
88
88
|
switch (t.inputType) {
|
|
89
89
|
case "number":
|
|
90
|
-
|
|
90
|
+
r = Number(l.value);
|
|
91
91
|
break;
|
|
92
92
|
case "color":
|
|
93
|
-
|
|
93
|
+
r = l.value;
|
|
94
94
|
break;
|
|
95
95
|
case "date":
|
|
96
|
-
|
|
96
|
+
r = l.value;
|
|
97
97
|
break;
|
|
98
98
|
case "select":
|
|
99
|
-
|
|
99
|
+
r = l.value;
|
|
100
100
|
break;
|
|
101
101
|
case "text":
|
|
102
|
-
|
|
102
|
+
r = l.value;
|
|
103
103
|
break;
|
|
104
104
|
case "button":
|
|
105
|
-
|
|
105
|
+
r = l.value;
|
|
106
106
|
break;
|
|
107
107
|
default:
|
|
108
|
-
|
|
108
|
+
r = l.value;
|
|
109
109
|
}
|
|
110
|
-
this.value =
|
|
110
|
+
this.value = r, this.onChange && this.onChange(this.value), this.props.detectChange && this.props.detectChange(this.value);
|
|
111
111
|
}, a = (o) => {
|
|
112
112
|
o.target, this.onBlur && this.onBlur(this.value);
|
|
113
113
|
};
|
|
@@ -122,31 +122,31 @@ class g {
|
|
|
122
122
|
return i.className = "input-icon " + (e || ""), i.innerHTML = t, i;
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
function
|
|
126
|
-
let t = 0, e =
|
|
125
|
+
function B(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
|
|
131
|
+
function L(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 I(h, t = 0) {
|
|
136
|
+
h.querySelectorAll(":scope > .setting-group-content > .setting-group").forEach((i) => {
|
|
137
137
|
const s = i, n = t + 1;
|
|
138
|
-
|
|
138
|
+
L(s, n), I(s, n);
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
|
-
const
|
|
141
|
+
const A = {
|
|
142
142
|
maxLevel: 5,
|
|
143
143
|
spacingMultiplier: 1,
|
|
144
144
|
visualIndentMultiplier: 2,
|
|
145
145
|
enableAutoDetection: !0
|
|
146
146
|
};
|
|
147
|
-
class
|
|
147
|
+
class R {
|
|
148
148
|
constructor(t = {}) {
|
|
149
|
-
this.observedElements = /* @__PURE__ */ new Set(), this.config = { ...
|
|
149
|
+
this.observedElements = /* @__PURE__ */ new Set(), this.config = { ...A, ...t }, this.config.enableAutoDetection && this.setupAutoDetection();
|
|
150
150
|
}
|
|
151
151
|
/**
|
|
152
152
|
* Setup automatic detection using MutationObserver
|
|
@@ -180,7 +180,7 @@ class A {
|
|
|
180
180
|
* Update nesting for a specific element
|
|
181
181
|
*/
|
|
182
182
|
updateElementNesting(t) {
|
|
183
|
-
const e =
|
|
183
|
+
const e = B(t);
|
|
184
184
|
this.applyNestingWithConfig(t, e);
|
|
185
185
|
}
|
|
186
186
|
/**
|
|
@@ -228,22 +228,22 @@ class A {
|
|
|
228
228
|
this.observer && (this.observer.disconnect(), this.observer = void 0), this.observedElements.clear();
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
|
-
const
|
|
232
|
-
function
|
|
233
|
-
for (const e in
|
|
234
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
235
|
-
const i =
|
|
231
|
+
const S = new R();
|
|
232
|
+
function x(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
|
}
|
|
239
239
|
const p = class p {
|
|
240
240
|
constructor(t) {
|
|
241
241
|
this.elementRef = null, this.isHidden = !1, this.custom = !1, this.initialValues = {}, this.changeTimeout = null, this.isHandlingChange = !1, this.changeHandlers = /* @__PURE__ */ new Set(), this.blurTimeout = null, this.lastChangeTime = 0, this.handleBlur = () => {
|
|
242
|
-
}, this.pendingBlurHandler = null, this.originalDefaultValues = {}, this.nestingLevel = 0, this.parentNestingLevel = 0, this.id = t.id ||
|
|
242
|
+
}, this.pendingBlurHandler = null, this.originalDefaultValues = {}, this.nestingLevel = 0, this.parentNestingLevel = 0, this.id = t.id || O(), this.title = t.title, this.settings = t.settings, this.description = t.description, this.icon = t.icon, this.isCollapsed = t.collapsed ?? !1, this.isMain = t.main ?? !1, this.custom = t.custom ?? !1, this.hideCondition = t.hideCondition, this.onBlur = t.onBlur, this.parentNestingLevel = t.parentNestingLevel ?? 0, this.nestingLevel = this.parentNestingLevel, this.includeGetJson = t.includeGetJson ?? !0, this.addItemCfg = t.addItem, this.deleteItemCfg = t.deleteItem, Object.assign(this, t.settings), this.initialValues = this.getValues(), this.originalDefaultValues = this.getDefaultValues(), this.propagateNestingLevel();
|
|
243
243
|
}
|
|
244
244
|
propagateNestingLevel() {
|
|
245
245
|
const t = this.nestingLevel + 1;
|
|
246
|
-
|
|
246
|
+
x(this.settings, (e, i) => {
|
|
247
247
|
i instanceof p && (i.parentNestingLevel = this.nestingLevel, i.nestingLevel = t, i.propagateNestingLevel());
|
|
248
248
|
});
|
|
249
249
|
}
|
|
@@ -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 && (
|
|
257
|
+
this.elementRef && (L(this.elementRef, this.nestingLevel), I(this.elementRef, this.nestingLevel));
|
|
258
258
|
}
|
|
259
259
|
static hide() {
|
|
260
260
|
this.hiddenElements.forEach((t) => {
|
|
@@ -277,7 +277,7 @@ const p = class p {
|
|
|
277
277
|
Object.keys(s).length > 0 && (this.lastChangeTime = Date.now(), this.initialValues = i, t(i), this.updateVisibility()), this.isHandlingChange = !1;
|
|
278
278
|
}, 50));
|
|
279
279
|
};
|
|
280
|
-
return this.changeHandlers.clear(),
|
|
280
|
+
return this.changeHandlers.clear(), x(this.settings, (i, s) => {
|
|
281
281
|
var n;
|
|
282
282
|
if (s instanceof p)
|
|
283
283
|
s.setOnChange(() => {
|
|
@@ -306,7 +306,7 @@ const p = class p {
|
|
|
306
306
|
"focusout",
|
|
307
307
|
this.handleBlur,
|
|
308
308
|
!0
|
|
309
|
-
)),
|
|
309
|
+
)), x(this.settings, (t, e) => {
|
|
310
310
|
e instanceof p && e.setOnBlur(() => {
|
|
311
311
|
this.onBlur && this.onBlur();
|
|
312
312
|
});
|
|
@@ -320,7 +320,7 @@ const p = class p {
|
|
|
320
320
|
}
|
|
321
321
|
clone() {
|
|
322
322
|
const t = {};
|
|
323
|
-
|
|
323
|
+
x(this.settings, (s, n) => {
|
|
324
324
|
typeof n.clone == "function" ? t[s] = n.clone() : (console.warn(
|
|
325
325
|
`Setting with key '${s}' does not have a clone method. Copying reference.`
|
|
326
326
|
), t[s] = n);
|
|
@@ -336,8 +336,9 @@ const p = class p {
|
|
|
336
336
|
hideCondition: this.hideCondition,
|
|
337
337
|
parentNestingLevel: this.parentNestingLevel,
|
|
338
338
|
includeGetJson: this.includeGetJson,
|
|
339
|
-
addItem: this.addItemCfg
|
|
340
|
-
|
|
339
|
+
addItem: this.addItemCfg,
|
|
340
|
+
deleteItem: this.deleteItemCfg
|
|
341
|
+
}, i = $(e);
|
|
341
342
|
return i.initialValues = this.getValues(), i;
|
|
342
343
|
}
|
|
343
344
|
setValue(t) {
|
|
@@ -391,22 +392,206 @@ const p = class p {
|
|
|
391
392
|
})) : (n = t.setOnChange) == null || n.call(t, () => e());
|
|
392
393
|
}
|
|
393
394
|
addSetting(t, e) {
|
|
394
|
-
var s;
|
|
395
|
+
var s, n;
|
|
395
396
|
if (this.settings[t] = e, this.wireChild(e), this.elementRef) {
|
|
397
|
+
const a = this.elementRef.querySelector(
|
|
398
|
+
".setting-group-content"
|
|
399
|
+
);
|
|
400
|
+
if (a) {
|
|
401
|
+
e instanceof p && e.setNestingLevel(this.nestingLevel + 1);
|
|
402
|
+
const o = e.draw(), l = this.deleteItemCfg ?? this.addItemCfg;
|
|
403
|
+
if (l && l.showDeleteButton !== !1) {
|
|
404
|
+
const c = l.keyPrefix ?? ((s = this.addItemCfg) == null ? void 0 : s.keyPrefix);
|
|
405
|
+
c && t.startsWith(c) && this.addDeleteButtonToElement(o, t);
|
|
406
|
+
}
|
|
407
|
+
const r = a.querySelector(".sg-add-button-bottom");
|
|
408
|
+
r ? a.insertBefore(o, r) : a.appendChild(o), S.trackElement(o), L(o, this.nestingLevel + 1), I(o, this.nestingLevel + 1);
|
|
409
|
+
const d = o.style.display;
|
|
410
|
+
o.style.display = "none", o.offsetHeight, o.style.display = d, this.updateNestingStyles();
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
const i = this.getValues();
|
|
414
|
+
this.initialValues = i, (n = this.onChange) == null || n.call(this, i);
|
|
415
|
+
}
|
|
416
|
+
removeSetting(t) {
|
|
417
|
+
var s;
|
|
418
|
+
const e = this.settings[t];
|
|
419
|
+
if (!e) return;
|
|
420
|
+
if (delete this.settings[t], this.elementRef) {
|
|
396
421
|
const n = this.elementRef.querySelector(
|
|
397
422
|
".setting-group-content"
|
|
398
423
|
);
|
|
399
424
|
if (n) {
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
const
|
|
404
|
-
|
|
425
|
+
const a = Array.from(
|
|
426
|
+
n.querySelectorAll(".setting-group, .setting")
|
|
427
|
+
);
|
|
428
|
+
for (const o of a) {
|
|
429
|
+
const l = o.id;
|
|
430
|
+
if (l && l.includes(e.id)) {
|
|
431
|
+
o.remove();
|
|
432
|
+
break;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
405
435
|
}
|
|
406
436
|
}
|
|
437
|
+
typeof e.cleanup == "function" && e.cleanup(), this.updateNestingStyles();
|
|
407
438
|
const i = this.getValues();
|
|
408
439
|
this.initialValues = i, (s = this.onChange) == null || s.call(this, i);
|
|
409
440
|
}
|
|
441
|
+
addDeleteButtonToElement(t, e) {
|
|
442
|
+
let i = null;
|
|
443
|
+
try {
|
|
444
|
+
i = t.querySelector(":scope > .setting-group-title");
|
|
445
|
+
} catch {
|
|
446
|
+
i = null;
|
|
447
|
+
}
|
|
448
|
+
if (!i) {
|
|
449
|
+
const r = Array.from(
|
|
450
|
+
t.querySelectorAll(".setting-group-title")
|
|
451
|
+
);
|
|
452
|
+
for (const d of r)
|
|
453
|
+
if (d.closest(".setting-group") === t) {
|
|
454
|
+
i = d;
|
|
455
|
+
break;
|
|
456
|
+
}
|
|
457
|
+
i || (i = r[0] ?? null);
|
|
458
|
+
}
|
|
459
|
+
if (!i) return;
|
|
460
|
+
const s = i.querySelector(".actions-section");
|
|
461
|
+
if (!s) return;
|
|
462
|
+
const n = document.createElement("button");
|
|
463
|
+
n.type = "button", n.className = "sg-delete-button";
|
|
464
|
+
const a = this.deleteItemCfg ?? this.addItemCfg;
|
|
465
|
+
n.title = (a == null ? void 0 : a.deleteButtonLabel) || "Delete", n.style.cssText = `
|
|
466
|
+
background: none;
|
|
467
|
+
border: none;
|
|
468
|
+
cursor: pointer;
|
|
469
|
+
padding: 4px;
|
|
470
|
+
margin-left: 8px;
|
|
471
|
+
color: #ef4444;
|
|
472
|
+
display: flex;
|
|
473
|
+
align-items: center;
|
|
474
|
+
justify-content: center;
|
|
475
|
+
border-radius: 4px;
|
|
476
|
+
transition: background-color 0.2s;
|
|
477
|
+
`;
|
|
478
|
+
const o = (a == null ? void 0 : a.deleteButtonIconSvg) || `
|
|
479
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
480
|
+
<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"/>
|
|
481
|
+
<path d="M6.667 7.333v4M9.333 7.333v4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
482
|
+
</svg>
|
|
483
|
+
`;
|
|
484
|
+
n.innerHTML = o, n.addEventListener("mouseenter", () => {
|
|
485
|
+
n.style.backgroundColor = "#fef2f2";
|
|
486
|
+
}), n.addEventListener("mouseleave", () => {
|
|
487
|
+
n.style.backgroundColor = "transparent";
|
|
488
|
+
}), n.addEventListener("click", (r) => {
|
|
489
|
+
r.stopPropagation(), r.preventDefault(), this.showDeleteConfirmation().then((d) => {
|
|
490
|
+
d && this.removeSetting(e);
|
|
491
|
+
});
|
|
492
|
+
});
|
|
493
|
+
const l = s.querySelector(".setting-group-arrow");
|
|
494
|
+
l ? s.insertBefore(n, l) : s.appendChild(n);
|
|
495
|
+
}
|
|
496
|
+
showDeleteConfirmation() {
|
|
497
|
+
return new Promise((t) => {
|
|
498
|
+
const e = document.createElement("div");
|
|
499
|
+
e.className = "sg-modal-overlay", e.style.cssText = `
|
|
500
|
+
position: fixed;
|
|
501
|
+
top: 0;
|
|
502
|
+
left: 0;
|
|
503
|
+
right: 0;
|
|
504
|
+
bottom: 0;
|
|
505
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
506
|
+
display: flex;
|
|
507
|
+
align-items: center;
|
|
508
|
+
justify-content: center;
|
|
509
|
+
z-index: 10000;
|
|
510
|
+
backdrop-filter: blur(2px);
|
|
511
|
+
`;
|
|
512
|
+
const i = document.createElement("div");
|
|
513
|
+
i.className = "sg-confirmation-modal", i.style.cssText = `
|
|
514
|
+
background: white;
|
|
515
|
+
border-radius: 8px;
|
|
516
|
+
padding: 24px;
|
|
517
|
+
max-width: 400px;
|
|
518
|
+
width: 90%;
|
|
519
|
+
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
|
520
|
+
transform: scale(0.95);
|
|
521
|
+
transition: transform 0.2s ease-out;
|
|
522
|
+
`;
|
|
523
|
+
const s = document.createElement("h3");
|
|
524
|
+
s.textContent = "Confirm Deletion", s.style.cssText = `
|
|
525
|
+
margin: 0 0 12px 0;
|
|
526
|
+
font-size: 18px;
|
|
527
|
+
font-weight: 600;
|
|
528
|
+
color: #1f2937;
|
|
529
|
+
`;
|
|
530
|
+
const n = document.createElement("p");
|
|
531
|
+
n.textContent = "Are you sure you want to delete this item? This action cannot be undone.", n.style.cssText = `
|
|
532
|
+
margin: 0 0 24px 0;
|
|
533
|
+
color: #6b7280;
|
|
534
|
+
font-size: 14px;
|
|
535
|
+
line-height: 1.5;
|
|
536
|
+
`;
|
|
537
|
+
const a = document.createElement("div");
|
|
538
|
+
a.style.cssText = `
|
|
539
|
+
display: flex;
|
|
540
|
+
gap: 12px;
|
|
541
|
+
justify-content: flex-end;
|
|
542
|
+
`;
|
|
543
|
+
const o = document.createElement("button");
|
|
544
|
+
o.textContent = "Cancel", o.type = "button", o.style.cssText = `
|
|
545
|
+
padding: 8px 16px;
|
|
546
|
+
border: 1px solid #d1d5db;
|
|
547
|
+
background: white;
|
|
548
|
+
color: #374151;
|
|
549
|
+
border-radius: 6px;
|
|
550
|
+
font-size: 14px;
|
|
551
|
+
font-weight: 500;
|
|
552
|
+
cursor: pointer;
|
|
553
|
+
transition: all 0.2s;
|
|
554
|
+
`;
|
|
555
|
+
const l = document.createElement("button");
|
|
556
|
+
l.textContent = "Delete", l.type = "button", l.style.cssText = `
|
|
557
|
+
padding: 8px 16px;
|
|
558
|
+
border: none;
|
|
559
|
+
background: #ef4444;
|
|
560
|
+
color: white;
|
|
561
|
+
border-radius: 6px;
|
|
562
|
+
font-size: 14px;
|
|
563
|
+
font-weight: 500;
|
|
564
|
+
cursor: pointer;
|
|
565
|
+
transition: all 0.2s;
|
|
566
|
+
`, o.addEventListener("mouseenter", () => {
|
|
567
|
+
o.style.backgroundColor = "#f9fafb", o.style.borderColor = "#9ca3af";
|
|
568
|
+
}), o.addEventListener("mouseleave", () => {
|
|
569
|
+
o.style.backgroundColor = "white", o.style.borderColor = "#d1d5db";
|
|
570
|
+
}), l.addEventListener("mouseenter", () => {
|
|
571
|
+
l.style.backgroundColor = "#dc2626";
|
|
572
|
+
}), l.addEventListener("mouseleave", () => {
|
|
573
|
+
l.style.backgroundColor = "#ef4444";
|
|
574
|
+
});
|
|
575
|
+
const r = () => {
|
|
576
|
+
e.style.opacity = "0", i.style.transform = "scale(0.95)", setTimeout(() => {
|
|
577
|
+
e.parentNode && e.parentNode.removeChild(e);
|
|
578
|
+
}, 200);
|
|
579
|
+
};
|
|
580
|
+
o.addEventListener("click", () => {
|
|
581
|
+
r(), t(!1);
|
|
582
|
+
}), l.addEventListener("click", () => {
|
|
583
|
+
r(), t(!0);
|
|
584
|
+
}), e.addEventListener("click", (c) => {
|
|
585
|
+
c.target === e && (r(), t(!1));
|
|
586
|
+
});
|
|
587
|
+
const d = (c) => {
|
|
588
|
+
c.key === "Escape" && (r(), t(!1), document.removeEventListener("keydown", d));
|
|
589
|
+
};
|
|
590
|
+
document.addEventListener("keydown", d), a.appendChild(o), a.appendChild(l), i.appendChild(s), i.appendChild(n), i.appendChild(a), e.appendChild(i), document.body.appendChild(e), requestAnimationFrame(() => {
|
|
591
|
+
e.style.opacity = "1", i.style.transform = "scale(1)";
|
|
592
|
+
}), setTimeout(() => l.focus(), 100);
|
|
593
|
+
});
|
|
594
|
+
}
|
|
410
595
|
getNextIndexFromPrefix(t) {
|
|
411
596
|
const e = Object.keys(this.settings).filter((i) => i.startsWith(t)).map((i) => {
|
|
412
597
|
const s = Number(i.slice(t.length));
|
|
@@ -516,8 +701,9 @@ const p = class p {
|
|
|
516
701
|
}
|
|
517
702
|
}
|
|
518
703
|
draw() {
|
|
704
|
+
var d;
|
|
519
705
|
const t = document.createElement("div");
|
|
520
|
-
t.className = "setting-group", t.id = `setting-group-${this.id}`, p.hiddenElements.add(t), this.hideCondition && this.hideCondition() && (t.style.display = "none"), this.isMain && t.classList.add("main-group"), this.custom && t.classList.add("custom_class"),
|
|
706
|
+
t.className = "setting-group", t.id = `setting-group-${this.id}`, p.hiddenElements.add(t), this.hideCondition && this.hideCondition() && (t.style.display = "none"), this.isMain && t.classList.add("main-group"), this.custom && t.classList.add("custom_class"), L(t, this.nestingLevel);
|
|
521
707
|
const e = document.createElement("div");
|
|
522
708
|
e.className = "setting-group-title", this.isCollapsed && e.classList.add("collapsed-view"), e.setAttribute("role", "button"), e.setAttribute(
|
|
523
709
|
"aria-expanded",
|
|
@@ -525,20 +711,20 @@ const p = class p {
|
|
|
525
711
|
), e.setAttribute("tabindex", "0");
|
|
526
712
|
const i = document.createElement("div");
|
|
527
713
|
if (i.className = "title-section", this.icon) {
|
|
528
|
-
const
|
|
529
|
-
|
|
714
|
+
const c = document.createElement("span");
|
|
715
|
+
c.className = "group-icon", c.innerHTML = this.icon, i.appendChild(c);
|
|
530
716
|
}
|
|
531
717
|
const s = document.createElement("h3");
|
|
532
718
|
s.textContent = this.title, i.appendChild(s);
|
|
533
719
|
const n = document.createElement("div");
|
|
534
720
|
if (n.className = "actions-section", this.description && this.isCollapsed) {
|
|
535
|
-
const
|
|
536
|
-
|
|
721
|
+
const c = document.createElement("span");
|
|
722
|
+
c.className = "info-marker", c.innerHTML = `
|
|
537
723
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
538
724
|
<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"
|
|
539
725
|
stroke="currentColor" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>
|
|
540
726
|
</svg>
|
|
541
|
-
`,
|
|
727
|
+
`, c.title = this.description, n.appendChild(c);
|
|
542
728
|
}
|
|
543
729
|
const a = document.createElement("span");
|
|
544
730
|
a.className = "setting-group-arrow", a.innerHTML = `
|
|
@@ -548,67 +734,78 @@ const p = class p {
|
|
|
548
734
|
`, this.isCollapsed && a.classList.add("rotated"), n.appendChild(a);
|
|
549
735
|
const o = document.createElement("div");
|
|
550
736
|
if (o.className = "setting-group-content", this.isCollapsed && (o.classList.add("collapsed"), e.classList.add("collapsed-view"), a.classList.add("rotated"), t.classList.add("collapsed")), this.isMain && o.classList.add("main-content"), this.description && !this.isCollapsed) {
|
|
551
|
-
const
|
|
552
|
-
|
|
737
|
+
const c = document.createElement("div");
|
|
738
|
+
c.className = "setting-group-description", c.textContent = this.description, o.appendChild(c);
|
|
553
739
|
}
|
|
554
740
|
const l = () => {
|
|
555
741
|
this.isCollapsed = !this.isCollapsed, o.classList.toggle("collapsed"), e.classList.toggle("collapsed-view"), a.classList.toggle("rotated"), t.classList.toggle("collapsed", this.isCollapsed), e.setAttribute(
|
|
556
742
|
"aria-expanded",
|
|
557
743
|
(!this.isCollapsed).toString()
|
|
558
744
|
);
|
|
559
|
-
const
|
|
745
|
+
const c = o.querySelector(
|
|
560
746
|
".setting-group-description"
|
|
561
|
-
),
|
|
747
|
+
), u = n.querySelector(".info-marker");
|
|
562
748
|
if (this.description)
|
|
563
749
|
if (this.isCollapsed) {
|
|
564
|
-
if (
|
|
565
|
-
const
|
|
566
|
-
|
|
750
|
+
if (c && c.remove(), !u) {
|
|
751
|
+
const m = document.createElement("span");
|
|
752
|
+
m.className = "info-marker", m.innerHTML = `
|
|
567
753
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
568
754
|
<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
755
|
stroke="currentColor" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>
|
|
570
756
|
</svg>
|
|
571
|
-
`,
|
|
757
|
+
`, m.title = this.description, n.insertBefore(m, a);
|
|
572
758
|
}
|
|
573
759
|
} else {
|
|
574
|
-
if (!
|
|
575
|
-
const
|
|
576
|
-
|
|
577
|
-
|
|
760
|
+
if (!c) {
|
|
761
|
+
const m = document.createElement("div");
|
|
762
|
+
m.className = "setting-group-description", m.textContent = this.description, o.insertBefore(
|
|
763
|
+
m,
|
|
578
764
|
o.firstChild
|
|
579
765
|
);
|
|
580
766
|
}
|
|
581
|
-
|
|
767
|
+
u && u.remove();
|
|
582
768
|
}
|
|
583
769
|
};
|
|
584
|
-
if (e.onclick = l, e.onkeydown = (
|
|
585
|
-
(
|
|
770
|
+
if (e.onclick = l, e.onkeydown = (c) => {
|
|
771
|
+
(c.key === "Enter" || c.key === " ") && (c.preventDefault(), l());
|
|
586
772
|
}, Object.keys(this.settings).length > 0) {
|
|
587
|
-
for (const
|
|
588
|
-
if (Object.prototype.hasOwnProperty.call(this.settings,
|
|
589
|
-
const
|
|
590
|
-
|
|
773
|
+
for (const c in this.settings)
|
|
774
|
+
if (Object.prototype.hasOwnProperty.call(this.settings, c)) {
|
|
775
|
+
const u = this.settings[c];
|
|
776
|
+
u instanceof p && u.setNestingLevel(this.nestingLevel + 1);
|
|
777
|
+
const m = u.draw();
|
|
778
|
+
if (u instanceof p && u.deleteItemCfg)
|
|
779
|
+
this.addDeleteButtonToElement(m, c);
|
|
780
|
+
else {
|
|
781
|
+
const E = this.deleteItemCfg ?? this.addItemCfg;
|
|
782
|
+
if (E && E.showDeleteButton !== !1) {
|
|
783
|
+
const b = E.keyPrefix ?? ((d = this.addItemCfg) == null ? void 0 : d.keyPrefix);
|
|
784
|
+
b && c.startsWith(b) && this.addDeleteButtonToElement(m, c);
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
o.appendChild(m);
|
|
591
788
|
}
|
|
592
789
|
} else {
|
|
593
|
-
const
|
|
594
|
-
|
|
790
|
+
const c = document.createElement("div");
|
|
791
|
+
c.className = "setting-group-empty", c.textContent = "No settings in this group", o.appendChild(c);
|
|
595
792
|
}
|
|
596
793
|
if (this.addItemCfg) {
|
|
597
|
-
const
|
|
598
|
-
|
|
599
|
-
const
|
|
794
|
+
const c = document.createElement("button");
|
|
795
|
+
c.type = "button", c.className = "sg-add-button-bottom", c.style.marginTop = "8px";
|
|
796
|
+
const u = this.addItemCfg.buttonIconSvg ?? `
|
|
600
797
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none"
|
|
601
798
|
xmlns="http://www.w3.org/2000/svg">
|
|
602
799
|
<path d="M8 3.333v9.334M3.333 8h9.334" stroke="currentColor"
|
|
603
800
|
stroke-width="1.5" stroke-linecap="round"/>
|
|
604
801
|
</svg>`;
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
const
|
|
608
|
-
this.addSetting(
|
|
609
|
-
}), o.appendChild(
|
|
802
|
+
c.innerHTML = `${u}<span style="margin-left:4px;">${this.addItemCfg.buttonLabel ?? "Add"}</span>`, c.addEventListener("click", (m) => {
|
|
803
|
+
m.stopPropagation(), m.preventDefault();
|
|
804
|
+
const M = this.getNextIndexFromPrefix(this.addItemCfg.keyPrefix), E = this.addItemCfg.createItem(M), b = `${this.addItemCfg.keyPrefix}${M}`;
|
|
805
|
+
this.addSetting(b, E), this.addItemCfg.expandNewItem !== !1 && E.expand && E.expand();
|
|
806
|
+
}), o.appendChild(c);
|
|
610
807
|
}
|
|
611
|
-
return e.appendChild(i), e.appendChild(n), t.appendChild(e), t.appendChild(o), this.elementRef = t,
|
|
808
|
+
return e.appendChild(i), e.appendChild(n), t.appendChild(e), t.appendChild(o), this.elementRef = t, S.trackElement(t), setTimeout(() => {
|
|
612
809
|
this.updateNestingStyles();
|
|
613
810
|
}, 0), this.pendingBlurHandler && (this.setupBlurHandlers(), this.pendingBlurHandler = null), t;
|
|
614
811
|
}
|
|
@@ -657,8 +854,8 @@ const p = class p {
|
|
|
657
854
|
}
|
|
658
855
|
};
|
|
659
856
|
p.hiddenElements = /* @__PURE__ */ new Set();
|
|
660
|
-
let
|
|
661
|
-
class
|
|
857
|
+
let v = p;
|
|
858
|
+
class gt extends v {
|
|
662
859
|
constructor(t) {
|
|
663
860
|
super(t);
|
|
664
861
|
const e = Object.keys(this.settings)[0];
|
|
@@ -694,12 +891,12 @@ class pt extends f {
|
|
|
694
891
|
n.className = "tabs-header", this.tabsContainer = n;
|
|
695
892
|
const a = document.createElement("div");
|
|
696
893
|
if (a.className = "tab-content", this.contentContainers = {}, Object.keys(this.settings).forEach((o, l) => {
|
|
697
|
-
const
|
|
698
|
-
|
|
699
|
-
const
|
|
700
|
-
|
|
701
|
-
const
|
|
702
|
-
|
|
894
|
+
const r = document.createElement("button");
|
|
895
|
+
r.className = "tab-button", r.type = "button", r.setAttribute("data-tab-id", o), r.textContent = o, r.addEventListener("click", () => this.switchToTab(o)), n.appendChild(r);
|
|
896
|
+
const d = document.createElement("div");
|
|
897
|
+
d.className = "tab-panel", this.contentContainers[o] = d;
|
|
898
|
+
const c = this.settings[o];
|
|
899
|
+
c && (c instanceof v && c.setNestingLevel(this.getNestingLevel() + 1), d.appendChild(c.draw())), a.appendChild(d), l === 0 && !this.activeTabId && (this.activeTabId = o);
|
|
703
900
|
}), e.appendChild(i), e.appendChild(n), e.appendChild(a), !this.activeTabId) {
|
|
704
901
|
const o = Object.keys(this.settings)[0];
|
|
705
902
|
this.activeTabId = o || "";
|
|
@@ -707,13 +904,13 @@ class pt extends f {
|
|
|
707
904
|
return this.updateTabUI(), t;
|
|
708
905
|
}
|
|
709
906
|
}
|
|
710
|
-
function
|
|
711
|
-
return new
|
|
907
|
+
function $(h) {
|
|
908
|
+
return new v(h);
|
|
712
909
|
}
|
|
713
|
-
function
|
|
714
|
-
return
|
|
910
|
+
function mt(h) {
|
|
911
|
+
return h;
|
|
715
912
|
}
|
|
716
|
-
class
|
|
913
|
+
class F extends g {
|
|
717
914
|
constructor(t = {}) {
|
|
718
915
|
super(t), this.inputType = "text", t.onChange && this.setOnChange(t.onChange);
|
|
719
916
|
}
|
|
@@ -733,31 +930,31 @@ class $ extends g {
|
|
|
733
930
|
});
|
|
734
931
|
}
|
|
735
932
|
}
|
|
736
|
-
const
|
|
737
|
-
class
|
|
933
|
+
const z = "<svg xmlns='http://www.w3.org/2000/svg' width='18' height='19' viewBox='0 0 18 19' fill='none'><path d='M8.99999 15.8542C9.79613 16.5667 10.8475 17 12 17C14.4853 17 16.5 14.9853 16.5 12.5C16.5 10.4248 15.0953 8.67769 13.1849 8.15763M4.81513 8.15762C2.9047 8.67768 1.5 10.4248 1.5 12.5C1.5 14.9853 3.51472 17 6 17C8.48528 17 10.5 14.9853 10.5 12.5C10.5 11.9146 10.3882 11.3554 10.1849 10.8424M13.5 6.5C13.5 8.98528 11.4853 11 9 11C6.51472 11 4.5 8.98528 4.5 6.5C4.5 4.01472 6.51472 2 9 2C11.4853 2 13.5 4.01472 13.5 6.5Z' stroke='#667085' stroke-linecap='round' stroke-linejoin='round'/></svg>";
|
|
934
|
+
class f extends F {
|
|
738
935
|
constructor(t) {
|
|
739
936
|
super({
|
|
740
937
|
...t,
|
|
741
|
-
icon: t.icon ||
|
|
938
|
+
icon: t.icon || z,
|
|
742
939
|
title: t.title || "Color",
|
|
743
|
-
default: t.default ?
|
|
940
|
+
default: t.default ? f.normalizeColorValue(t.default) : "#000000"
|
|
744
941
|
}), this.inputType = "color", this.element = null, this.colorInputEl = null, this.textInputEl = null, this.detectChange = t.detectChange;
|
|
745
942
|
}
|
|
746
943
|
static normalizeColorValue(t) {
|
|
747
|
-
return t.startsWith("#") ?
|
|
944
|
+
return t.startsWith("#") ? f.normalizeHexValue(t) : t.includes(",") ? f.rgbToHexStatic(t) : f.normalizeHexValue(t);
|
|
748
945
|
}
|
|
749
946
|
static normalizeHexValue(t) {
|
|
750
947
|
return t = t.replace("#", ""), t.length === 3 && (t = t.split("").map((e) => e + e).join("")), t.length !== 6 ? (console.warn(`Invalid hex value "${t}", using default "#000000"`), "#000000") : /^[0-9A-Fa-f]{6}$/.test(t) ? `#${t.toLowerCase()}` : (console.warn(`Invalid hex value "${t}", using default "#000000"`), "#000000");
|
|
751
948
|
}
|
|
752
949
|
static rgbToHexStatic(t) {
|
|
753
|
-
const e = t.split(",").map((
|
|
950
|
+
const e = t.split(",").map((d) => parseInt(d.trim()));
|
|
754
951
|
if (e.length !== 3 || e.some(isNaN))
|
|
755
952
|
return console.warn(`Invalid RGB value "${t}", using default "#000000"`), "#000000";
|
|
756
|
-
const [i, s, n] = e, a = Math.max(0, Math.min(255, i)), o = Math.max(0, Math.min(255, s)), l = Math.max(0, Math.min(255, n)),
|
|
757
|
-
const
|
|
758
|
-
return
|
|
953
|
+
const [i, s, n] = e, a = Math.max(0, Math.min(255, i)), o = Math.max(0, Math.min(255, s)), l = Math.max(0, Math.min(255, n)), r = (d) => {
|
|
954
|
+
const c = d.toString(16);
|
|
955
|
+
return c.length === 1 ? "0" + c : c;
|
|
759
956
|
};
|
|
760
|
-
return `#${
|
|
957
|
+
return `#${r(a)}${r(o)}${r(l)}`;
|
|
761
958
|
}
|
|
762
959
|
setValue(t) {
|
|
763
960
|
if (t === void 0) {
|
|
@@ -765,7 +962,7 @@ class m extends $ {
|
|
|
765
962
|
return;
|
|
766
963
|
}
|
|
767
964
|
if (typeof t == "string") {
|
|
768
|
-
const e =
|
|
965
|
+
const e = f.normalizeColorValue(t);
|
|
769
966
|
this.value = e, this.colorInputEl && (this.colorInputEl.value = e), this.textInputEl && (this.textInputEl.value = e), this.onChange && this.onChange(e), this.props.detectChange && this.props.detectChange(e);
|
|
770
967
|
} else
|
|
771
968
|
this.value = "#000000", this.colorInputEl && (this.colorInputEl.value = "#000000"), this.textInputEl && (this.textInputEl.value = "#000000"), this.onChange && this.onChange("#000000"), this.props.detectChange && this.props.detectChange("#000000");
|
|
@@ -780,23 +977,23 @@ class m extends $ {
|
|
|
780
977
|
if (t.className = "color-setting-wrapper " + (this.props.wrapperClassName || ""), this.props.title || this.props.icon) {
|
|
781
978
|
const l = document.createElement("div");
|
|
782
979
|
if (l.className = "icon-container", this.props.icon) {
|
|
783
|
-
const
|
|
784
|
-
|
|
980
|
+
const r = document.createElement("span");
|
|
981
|
+
r.className = "input-icon", r.innerHTML = this.props.icon, l.appendChild(r);
|
|
785
982
|
}
|
|
786
983
|
if (this.props.title) {
|
|
787
|
-
const
|
|
788
|
-
|
|
984
|
+
const r = document.createElement("span");
|
|
985
|
+
r.className = "input-label", r.textContent = this.props.title, l.appendChild(r);
|
|
789
986
|
}
|
|
790
987
|
t.appendChild(l);
|
|
791
988
|
}
|
|
792
989
|
const e = document.createElement("div");
|
|
793
990
|
e.className = "color-input-wrapper";
|
|
794
991
|
const i = (l) => {
|
|
795
|
-
const
|
|
796
|
-
if (!
|
|
992
|
+
const r = l.value.trim();
|
|
993
|
+
if (!r)
|
|
797
994
|
return e.classList.remove("error"), !0;
|
|
798
|
-
const
|
|
799
|
-
return
|
|
995
|
+
const c = /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/.test(r);
|
|
996
|
+
return c ? e.classList.remove("error") : e.classList.add("error"), c;
|
|
800
997
|
}, s = document.createElement("input");
|
|
801
998
|
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
999
|
const n = document.createElement("div");
|
|
@@ -805,20 +1002,20 @@ class m extends $ {
|
|
|
805
1002
|
n.style.backgroundColor = a;
|
|
806
1003
|
const o = document.createElement("input");
|
|
807
1004
|
return o.type = "text", o.className = "color-text-input", o.value = this.value || "", o.placeholder = "#000000", o.setAttribute("pattern", "#[0-9A-Fa-f]{6}"), o.setAttribute("title", "Enter a hex color value (e.g., #ff0000)"), o.setAttribute("aria-label", "Hex color value"), o.setAttribute("maxlength", "7"), this.textInputEl = o, this.textInputEl.addEventListener("input", (l) => {
|
|
808
|
-
var
|
|
809
|
-
let
|
|
1005
|
+
var d, c;
|
|
1006
|
+
let r = l.target.value.trim();
|
|
810
1007
|
if (this.textInputEl && i(this.textInputEl)) {
|
|
811
|
-
const u =
|
|
812
|
-
this.value = u, (
|
|
1008
|
+
const u = f.normalizeColorValue(r);
|
|
1009
|
+
this.value = u, (d = this.onChange) == null || d.call(this, u), (c = this.detectChange) == null || c.call(this, u), this.colorInputEl && (this.colorInputEl.value = u), n.style.backgroundColor = u;
|
|
813
1010
|
}
|
|
814
1011
|
}), this.colorInputEl.addEventListener("input", (l) => {
|
|
815
|
-
var
|
|
816
|
-
const
|
|
817
|
-
this.value =
|
|
1012
|
+
var c, u;
|
|
1013
|
+
const r = l.target.value, d = f.normalizeColorValue(r);
|
|
1014
|
+
this.value = d, (c = this.onChange) == null || c.call(this, d), (u = this.detectChange) == null || u.call(this, d), this.textInputEl && (this.textInputEl.value = d), n.style.backgroundColor = d, e.classList.remove("error");
|
|
818
1015
|
}), this.colorInputEl.addEventListener("change", (l) => {
|
|
819
|
-
var
|
|
820
|
-
const
|
|
821
|
-
this.value =
|
|
1016
|
+
var c, u;
|
|
1017
|
+
const r = l.target.value, d = f.normalizeColorValue(r);
|
|
1018
|
+
this.value = d, (c = this.onChange) == null || c.call(this, d), (u = this.detectChange) == null || u.call(this, d), this.textInputEl && (this.textInputEl.value = d), n.style.backgroundColor = d;
|
|
822
1019
|
}), e.appendChild(s), e.appendChild(n), e.appendChild(o), t.appendChild(e), this.element = t, t;
|
|
823
1020
|
}
|
|
824
1021
|
getElement() {
|
|
@@ -826,7 +1023,7 @@ class m extends $ {
|
|
|
826
1023
|
}
|
|
827
1024
|
// Helper method to get normalized hex value
|
|
828
1025
|
getNormalizedValue() {
|
|
829
|
-
return this.value ?
|
|
1026
|
+
return this.value ? f.normalizeColorValue(this.value) : "#000000";
|
|
830
1027
|
}
|
|
831
1028
|
// Helper method to check if current value is valid hex
|
|
832
1029
|
isValidHex() {
|
|
@@ -837,20 +1034,20 @@ class m extends $ {
|
|
|
837
1034
|
return this.isValidHex() ? this.hexToRgb(this.value) : "0, 0, 0";
|
|
838
1035
|
}
|
|
839
1036
|
}
|
|
840
|
-
const
|
|
1037
|
+
const j = `
|
|
841
1038
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
842
1039
|
<path d="M8.99999 15.8542C9.79613 16.5667 10.8475 17 12 17C14.4853 17 16.5 14.9853 16.5 12.5C16.5 10.4248 15.0953 8.67769 13.1849 8.15763M4.81513 8.15762C2.9047 8.67768 1.5 10.4248 1.5 12.5C1.5 14.9853 3.51472 17 6 17C8.48528 17 10.5 14.9853 10.5 12.5C10.5 11.9146 10.3882 11.3554 10.1849 10.8424M13.5 6.5C13.5 8.98528 11.4853 11 9 11C6.51472 11 4.5 8.98528 4.5 6.5C4.5 4.01472 6.51472 2 9 2C11.4853 2 13.5 4.01472 13.5 6.5Z" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
843
1040
|
<path d="M9 17C13.4183 17 17 13.4183 17 9C17 4.58172 13.4183 1 9 1C4.58172 1 1 4.58172 1 9C1 13.4183 4.58172 17 9 17Z" stroke="#667085" stroke-width="0.5" stroke-linecap="round" stroke-linejoin="round" opacity="0.5"/>
|
|
844
1041
|
<path d="M9 1V17C4.58172 17 1 13.4183 1 9C1 4.58172 4.58172 1 9 1Z" fill="#667085" stroke="#667085" stroke-width="0.5" stroke-linecap="round" stroke-linejoin="round" opacity="0.5"/>
|
|
845
1042
|
</svg>`;
|
|
846
|
-
class
|
|
1043
|
+
class w extends g {
|
|
847
1044
|
constructor(t = {}) {
|
|
848
1045
|
super({
|
|
849
1046
|
...t,
|
|
850
|
-
icon: t.icon ||
|
|
1047
|
+
icon: t.icon || j,
|
|
851
1048
|
title: t.title || "Color & Opacity",
|
|
852
1049
|
default: t.default || "#000000FF"
|
|
853
|
-
}), this.inputType = "color", this.element = null, this.colorInputEl = null, this.textInputEl = null, this.opacityInputEl = null, this.colorPreviewEl = null, this.detectChange = t.detectChange, this.value && (this.value =
|
|
1050
|
+
}), this.inputType = "color", this.element = null, this.colorInputEl = null, this.textInputEl = null, this.opacityInputEl = null, this.colorPreviewEl = null, this.detectChange = t.detectChange, this.value && (this.value = w.normalizeHexWithOpacity(this.value));
|
|
854
1051
|
}
|
|
855
1052
|
static normalizeHexWithOpacity(t) {
|
|
856
1053
|
return t = t.replace("#", ""), t.length === 3 && (t = t.split("").map((e) => e + e).join("")), t.length === 6 && (t = t + "FF"), t.length === 8 && /^[0-9A-Fa-f]{8}$/.test(t) ? `#${t.toUpperCase()}` : (console.warn(`Invalid hex value "${t}", using default "#000000FF"`), "#000000FF");
|
|
@@ -868,7 +1065,7 @@ class C extends g {
|
|
|
868
1065
|
return `#${i}${n}`;
|
|
869
1066
|
}
|
|
870
1067
|
setValue(t) {
|
|
871
|
-
t === void 0 || t === "" ? this.value = "#000000FF" : this.value =
|
|
1068
|
+
t === void 0 || t === "" ? this.value = "#000000FF" : this.value = w.normalizeHexWithOpacity(t), this.updateInputElements(), this.updateColorPreview(), this.onChange && this.onChange(this.value), this.detectChange && this.detectChange(this.value);
|
|
872
1069
|
}
|
|
873
1070
|
updateInputElements() {
|
|
874
1071
|
this.value && (this.colorInputEl && (this.colorInputEl.value = this.getRgbColor()), this.textInputEl && (this.textInputEl.value = this.value), this.opacityInputEl && (this.opacityInputEl.value = this.getOpacityPercent().toString()));
|
|
@@ -879,7 +1076,7 @@ class C extends g {
|
|
|
879
1076
|
this.colorPreviewEl.style.backgroundColor = `rgba(${s}, ${n}, ${a}, ${e})`;
|
|
880
1077
|
}
|
|
881
1078
|
handleColorChange(t) {
|
|
882
|
-
const e = this.getOpacityPercent(), i =
|
|
1079
|
+
const e = this.getOpacityPercent(), i = w.combineColorOpacity(t, e);
|
|
883
1080
|
this.setValue(i);
|
|
884
1081
|
}
|
|
885
1082
|
handleTextInput(t) {
|
|
@@ -887,7 +1084,7 @@ class C extends g {
|
|
|
887
1084
|
return e || i ? (this.setValue(t), !0) : !1;
|
|
888
1085
|
}
|
|
889
1086
|
handleOpacityChange(t) {
|
|
890
|
-
const e = this.getRgbColor(), i = Math.max(0, Math.min(100, t)), s =
|
|
1087
|
+
const e = this.getRgbColor(), i = Math.max(0, Math.min(100, t)), s = w.combineColorOpacity(e, i);
|
|
891
1088
|
this.setValue(s);
|
|
892
1089
|
}
|
|
893
1090
|
draw() {
|
|
@@ -950,7 +1147,7 @@ class C extends g {
|
|
|
950
1147
|
};
|
|
951
1148
|
}
|
|
952
1149
|
}
|
|
953
|
-
class
|
|
1150
|
+
class ft extends g {
|
|
954
1151
|
constructor(t = {}) {
|
|
955
1152
|
super(t), this.inputType = "text", t.onChange && this.setOnChange(t.onChange);
|
|
956
1153
|
}
|
|
@@ -982,7 +1179,7 @@ class mt extends g {
|
|
|
982
1179
|
return e.addEventListener("input", i), e.addEventListener("change", i), e.addEventListener("blur", s), t.appendChild(e), t;
|
|
983
1180
|
}
|
|
984
1181
|
}
|
|
985
|
-
class
|
|
1182
|
+
class C extends g {
|
|
986
1183
|
constructor(t) {
|
|
987
1184
|
super(t), this.inputType = "number", this.inputElement = null, this.mobileValue = t.mobile, this.validateProps(), this.value = this.validateValue(this.value);
|
|
988
1185
|
}
|
|
@@ -1041,12 +1238,12 @@ class v extends g {
|
|
|
1041
1238
|
);
|
|
1042
1239
|
}
|
|
1043
1240
|
}
|
|
1044
|
-
const
|
|
1241
|
+
const P = `
|
|
1045
1242
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1046
1243
|
<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
1244
|
<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
1245
|
</svg>`;
|
|
1049
|
-
class
|
|
1246
|
+
class G extends C {
|
|
1050
1247
|
constructor(t = {}) {
|
|
1051
1248
|
const e = {
|
|
1052
1249
|
title: "Opacity",
|
|
@@ -1055,7 +1252,7 @@ class j extends v {
|
|
|
1055
1252
|
maxValue: 100,
|
|
1056
1253
|
step: 1,
|
|
1057
1254
|
default: t.default ?? 100,
|
|
1058
|
-
icon:
|
|
1255
|
+
icon: P,
|
|
1059
1256
|
...t
|
|
1060
1257
|
};
|
|
1061
1258
|
super(e), this.inputType = "number", this.mobileValue = t.mobile;
|
|
@@ -1067,12 +1264,12 @@ class j extends v {
|
|
|
1067
1264
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
1068
1265
|
}
|
|
1069
1266
|
}
|
|
1070
|
-
const
|
|
1267
|
+
const D = `
|
|
1071
1268
|
<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
1269
|
<polyline points="6 9 12 15 18 9"></polyline>
|
|
1073
1270
|
</svg>
|
|
1074
1271
|
`;
|
|
1075
|
-
class
|
|
1272
|
+
class N extends g {
|
|
1076
1273
|
constructor(t = {}) {
|
|
1077
1274
|
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
1275
|
const e = this._options.findIndex((i) => i.value === this.value);
|
|
@@ -1116,7 +1313,7 @@ class k extends g {
|
|
|
1116
1313
|
o.onclick = (l) => this.selectOption(l, a, e), i.appendChild(o);
|
|
1117
1314
|
}), document.body.appendChild(i);
|
|
1118
1315
|
const s = document.createElement("div");
|
|
1119
|
-
return s.classList.add("svg-container"), s.innerHTML =
|
|
1316
|
+
return s.classList.add("svg-container"), s.innerHTML = D, t.appendChild(s), this.optionsListEl = i, this.svgContainer = s, this.props.getOptionsAsync && (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((n) => {
|
|
1120
1317
|
this._options.push(...n), this.isLoading = !1, this.updateOptionsList(), this.updateButtonText();
|
|
1121
1318
|
}).catch((n) => {
|
|
1122
1319
|
console.error("Failed to fetch async options:", n), this.isLoading = !1, this.updateButtonText("Failed to load options");
|
|
@@ -1146,8 +1343,8 @@ class k extends g {
|
|
|
1146
1343
|
selectOption(t, e, i) {
|
|
1147
1344
|
var n, a, o;
|
|
1148
1345
|
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, (a = this.optionsListEl) == null || a.classList.remove("open"), (o = this.svgContainer) == null || o.classList.remove("open"), this.cleanupDropdownPosition(), this.optionsListEl && this.optionsListEl.querySelectorAll(".select-option").forEach((
|
|
1150
|
-
|
|
1346
|
+
s && (this.value = s.value, (n = this.onChange) == null || n.call(this, this.value), this.selectedOptionIndex = e, this.isOpen = !1, i.textContent = s.name, (a = this.optionsListEl) == null || a.classList.remove("open"), (o = this.svgContainer) == null || o.classList.remove("open"), this.cleanupDropdownPosition(), this.optionsListEl && this.optionsListEl.querySelectorAll(".select-option").forEach((r, d) => {
|
|
1347
|
+
d === e ? r.classList.add("selected") : r.classList.remove("selected");
|
|
1151
1348
|
}));
|
|
1152
1349
|
}
|
|
1153
1350
|
/**
|
|
@@ -1238,7 +1435,7 @@ class W extends g {
|
|
|
1238
1435
|
}), t.appendChild(i), t;
|
|
1239
1436
|
}
|
|
1240
1437
|
}
|
|
1241
|
-
class
|
|
1438
|
+
class vt extends g {
|
|
1242
1439
|
constructor(t) {
|
|
1243
1440
|
super(t), this.inputType = "button", this.bgWithAlpha = "rgba(145, 158, 171, 0.08)";
|
|
1244
1441
|
}
|
|
@@ -1252,8 +1449,8 @@ class ft extends g {
|
|
|
1252
1449
|
/^rgba\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)$/i
|
|
1253
1450
|
);
|
|
1254
1451
|
if (n) {
|
|
1255
|
-
let o = +n[1], l = +n[2],
|
|
1256
|
-
|
|
1452
|
+
let o = +n[1], l = +n[2], r = +n[3], d = +n[4];
|
|
1453
|
+
d >= 1 ? (o = Math.round(o * 0.9), l = Math.round(l * 0.9), r = Math.round(r * 0.9)) : d = Math.min(1, d + 0.12), s = `rgba(${o},${l},${r},${d})`;
|
|
1257
1454
|
}
|
|
1258
1455
|
t.addEventListener("mouseenter", () => {
|
|
1259
1456
|
console.log("hoverBg", s), t.style.setProperty("background-color", s, "important");
|
|
@@ -1267,27 +1464,27 @@ class ft extends g {
|
|
|
1267
1464
|
return a.className = "button-setting-wrapper " + (this.props.wrapperClassName || ""), a.appendChild(t), a;
|
|
1268
1465
|
}
|
|
1269
1466
|
}
|
|
1270
|
-
class
|
|
1467
|
+
class Ct extends g {
|
|
1271
1468
|
constructor(t = {}) {
|
|
1272
1469
|
super(t), this.inputType = { width: "number", height: "number" }, this.aspectRatio = 1, this.isUpdating = !1;
|
|
1273
1470
|
const e = t.width || 0, i = t.height || 0;
|
|
1274
1471
|
this.value || (this.value = {
|
|
1275
1472
|
width: e,
|
|
1276
1473
|
height: i
|
|
1277
|
-
}), this.minWidth = t.minWidth ?? 0, this.maxWidth = t.maxWidth, this.minHeight = t.minHeight ?? 0, this.maxHeight = t.maxHeight, this.locked = t.locked ?? !1, this.value.height > 0 && (this.aspectRatio = this.value.width / this.value.height), this.widthSetting = new
|
|
1474
|
+
}), this.minWidth = t.minWidth ?? 0, this.maxWidth = t.maxWidth, this.minHeight = t.minHeight ?? 0, this.maxHeight = t.maxHeight, this.locked = t.locked ?? !1, this.value.height > 0 && (this.aspectRatio = this.value.width / this.value.height), this.widthSetting = new C({
|
|
1278
1475
|
title: "Width",
|
|
1279
1476
|
default: this.value.width,
|
|
1280
1477
|
suffix: "px",
|
|
1281
1478
|
minValue: this.minWidth,
|
|
1282
1479
|
maxValue: this.maxWidth,
|
|
1283
|
-
icon:
|
|
1284
|
-
}), this.heightSetting = new
|
|
1480
|
+
icon: J
|
|
1481
|
+
}), this.heightSetting = new C({
|
|
1285
1482
|
title: "Height",
|
|
1286
1483
|
default: this.value.height,
|
|
1287
1484
|
suffix: "px",
|
|
1288
1485
|
minValue: this.minHeight,
|
|
1289
1486
|
maxValue: this.maxHeight,
|
|
1290
|
-
icon:
|
|
1487
|
+
icon: U
|
|
1291
1488
|
}), this.widthSetting.setOnChange(this.handleWidthChange.bind(this)), this.heightSetting.setOnChange(this.handleHeightChange.bind(this));
|
|
1292
1489
|
}
|
|
1293
1490
|
handleWidthChange(t) {
|
|
@@ -1381,15 +1578,15 @@ class vt extends g {
|
|
|
1381
1578
|
}
|
|
1382
1579
|
}
|
|
1383
1580
|
}
|
|
1384
|
-
const
|
|
1581
|
+
const J = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1385
1582
|
<path d="M4.5 9.5H13.5M4.5 9.5L6 7.25M4.5 9.5L6 11.75M13.5 9.5L12 7.25M13.5 9.5L12 11.75M15.75 16.25V2.75M2.25 16.25V2.75" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
|
1386
|
-
</svg>`,
|
|
1583
|
+
</svg>`, U = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1387
1584
|
<path d="M9 14L9 5M9 14L6.75 12.5M9 14L11.25 12.5M9 5L6.75 6.5M9 5L11.25 6.5M15.75 2.75H2.25M15.75 16.25H2.25" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
|
1388
|
-
</svg>`,
|
|
1585
|
+
</svg>`, V = `
|
|
1389
1586
|
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="16" viewBox="0 0 15 16" fill="none">
|
|
1390
1587
|
<path d="M5 10.5L7.5 8M7.5 8L10 10.5M7.5 8V13.625M12.5 10.9643C13.2634 10.3338 13.75 9.37996 13.75 8.3125C13.75 6.41402 12.211 4.875 10.3125 4.875C10.1759 4.875 10.0482 4.80375 9.97882 4.68609C9.16379 3.30302 7.65902 2.375 5.9375 2.375C3.34867 2.375 1.25 4.47367 1.25 7.0625C1.25 8.35381 1.77215 9.52317 2.61684 10.371" stroke="#475467" stroke-linecap="round" stroke-linejoin="round"/>
|
|
1391
1588
|
</svg>
|
|
1392
|
-
`,
|
|
1589
|
+
`, q = `
|
|
1393
1590
|
<svg width="91" height="71" viewBox="0 0 91 71" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1394
1591
|
<rect width="91" height="71" rx="4" fill="#F2F4F7"/>
|
|
1395
1592
|
<path d="M37 31.5L39.5 29M39.5 29L42 31.5M39.5 29V34.625M44.5 31.9643C45.2634 31.3338 45.75 30.38 45.75 29.3125C45.75 27.414 44.211 25.875 42.3125 25.875C42.1759 25.875 42.0482 25.8037 41.9788 25.6861C41.1638 24.303 39.659 23.375 37.9375 23.375C35.3487 23.375 33.25 25.4737 33.25 28.0625C33.25 29.3538 33.7721 30.5232 34.6168 31.371" stroke="#475467" stroke-linecap="round" stroke-linejoin="round"/>
|
|
@@ -1398,7 +1595,7 @@ const D = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBo
|
|
|
1398
1595
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 12 12" fill="none">
|
|
1399
1596
|
<path d="M8 3V2.6C8 2.03995 8 1.75992 7.89101 1.54601C7.79513 1.35785 7.64215 1.20487 7.45399 1.10899C7.24008 1 6.96005 1 6.4 1H5.6C5.03995 1 4.75992 1 4.54601 1.10899C4.35785 1.20487 4.20487 1.35785 4.10899 1.54601C4 1.75992 4 2.03995 4 2.6V3M5 5.75V8.25M7 5.75V8.25M1.5 3H10.5M9.5 3V8.6C9.5 9.44008 9.5 9.86012 9.33651 10.181C9.1927 10.4632 8.96323 10.6927 8.68099 10.8365C8.36012 11 7.94008 11 7.1 11H4.9C4.05992 11 3.63988 11 3.31901 10.8365C3.03677 10.6927 2.8073 10.4632 2.66349 10.181C2.5 9.86012 2.5 9.44008 2.5 8.6V3" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
1400
1597
|
</svg>
|
|
1401
|
-
`,
|
|
1598
|
+
`, Z = `
|
|
1402
1599
|
<svg xmlns="http://www.w3.org/2000/svg" width="29" height="29" viewBox="0 0 29 29" fill="none">
|
|
1403
1600
|
<!-- Top dot -->
|
|
1404
1601
|
<circle cx="14.5" cy="3" r="1.5" fill="#02CC59" opacity="1"/>
|
|
@@ -1418,7 +1615,7 @@ const D = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBo
|
|
|
1418
1615
|
<circle cx="6.7" cy="6.7" r="1.5" fill="#02CC59" opacity="0.3"/>
|
|
1419
1616
|
</svg>
|
|
1420
1617
|
`;
|
|
1421
|
-
class
|
|
1618
|
+
class K extends g {
|
|
1422
1619
|
constructor(t = {}) {
|
|
1423
1620
|
super(t), this.inputType = "button", this.previewWrapper = null, this.previewEl = null, this.emptyStateEl = null, this.errorContainer = null, this.messageListener = null, this.loadingSpinner = null, this.props.delete === void 0 && (this.props.delete = !0), this.props.maxFileSizeMB === void 0 && (this.props.maxFileSizeMB = 5), !this.value && t.defaultUrl && t.defaultUrl !== "" && (this.value = t.defaultUrl), this.setupMessageListener();
|
|
1424
1621
|
}
|
|
@@ -1468,7 +1665,7 @@ class Z extends g {
|
|
|
1468
1665
|
);
|
|
1469
1666
|
if (t && t !== "") {
|
|
1470
1667
|
this.showLoading(), s && s instanceof HTMLElement && (s.style.display = "none"), e && e.classList.remove("no-image"), i && (i.innerHTML = `
|
|
1471
|
-
<span class="upload-icon">${
|
|
1668
|
+
<span class="upload-icon">${V}</span>
|
|
1472
1669
|
<span class="upload-label">Replace</span>
|
|
1473
1670
|
`);
|
|
1474
1671
|
const n = () => {
|
|
@@ -1479,7 +1676,7 @@ class Z extends g {
|
|
|
1479
1676
|
this.previewEl.addEventListener("load", n), this.previewEl.addEventListener("error", a), this.previewEl.src = t;
|
|
1480
1677
|
} else
|
|
1481
1678
|
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
|
-
<span class="upload-icon">${
|
|
1679
|
+
<span class="upload-icon">${V}</span>
|
|
1483
1680
|
<span class="upload-label">Upload</span>
|
|
1484
1681
|
`);
|
|
1485
1682
|
}
|
|
@@ -1512,17 +1709,17 @@ class Z extends g {
|
|
|
1512
1709
|
const s = this.value && this.value !== "";
|
|
1513
1710
|
s || i.classList.add("no-image");
|
|
1514
1711
|
const n = document.createElement("div");
|
|
1515
|
-
if (n.className = "preview-placeholder", n.innerHTML =
|
|
1712
|
+
if (n.className = "preview-placeholder", n.innerHTML = q, this.previewWrapper = document.createElement("div"), this.previewWrapper.className = "preview-wrapper", this.loadingSpinner = document.createElement("div"), this.loadingSpinner.className = "loading-spinner", this.loadingSpinner.innerHTML = Z, this.loadingSpinner.style.display = "none", this.previewWrapper.appendChild(this.loadingSpinner), this.previewEl = document.createElement("img"), this.previewEl.className = "upload-preview", this.props.delete) {
|
|
1516
1713
|
const o = document.createElement("button");
|
|
1517
1714
|
o.className = "delete-button", o.type = "button", o.title = "Delete image", o.innerHTML = _, this.previewWrapper.appendChild(o), o.onclick = (l) => {
|
|
1518
|
-
var
|
|
1519
|
-
l.stopPropagation(), this.value = "", this.updatePreviewState(null), (
|
|
1715
|
+
var r;
|
|
1716
|
+
l.stopPropagation(), this.value = "", this.updatePreviewState(null), (r = this.onChange) == null || r.call(this, ""), this.hideError();
|
|
1520
1717
|
};
|
|
1521
1718
|
}
|
|
1522
1719
|
this.previewWrapper.appendChild(this.previewEl);
|
|
1523
1720
|
const a = document.createElement("button");
|
|
1524
1721
|
return a.className = "upload-button", a.innerHTML = `
|
|
1525
|
-
<span class="upload-icon">${
|
|
1722
|
+
<span class="upload-icon">${V}</span>
|
|
1526
1723
|
<span class="upload-label">Upload</span>
|
|
1527
1724
|
`, i.appendChild(n), i.appendChild(this.previewWrapper), i.appendChild(a), t.appendChild(i), s ? this.updatePreviewState(this.value) : this.updatePreviewState(null), a.onclick = () => {
|
|
1528
1725
|
window.postMessage(
|
|
@@ -1535,14 +1732,14 @@ class Z extends g {
|
|
|
1535
1732
|
}, t;
|
|
1536
1733
|
}
|
|
1537
1734
|
}
|
|
1538
|
-
class
|
|
1735
|
+
class wt extends C {
|
|
1539
1736
|
constructor(t = {}) {
|
|
1540
1737
|
super({
|
|
1541
1738
|
...t,
|
|
1542
1739
|
title: t.title || "Height",
|
|
1543
1740
|
suffix: t.suffix || "px",
|
|
1544
1741
|
minValue: t.minValue ?? 0,
|
|
1545
|
-
icon: t.icon ||
|
|
1742
|
+
icon: t.icon || X,
|
|
1546
1743
|
default: t.default ?? 100
|
|
1547
1744
|
}), this.inputType = "number", this.mobileValue = t.mobile;
|
|
1548
1745
|
}
|
|
@@ -1553,17 +1750,17 @@ class Ct extends v {
|
|
|
1553
1750
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
1554
1751
|
}
|
|
1555
1752
|
}
|
|
1556
|
-
const
|
|
1753
|
+
const X = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1557
1754
|
<path d="M9 14L9 5M9 14L6.75 12.5M9 14L11.25 12.5M9 5L6.75 6.5M9 5L11.25 6.5M15.75 2.75H2.25M15.75 16.25H2.25" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
1558
1755
|
</svg>`;
|
|
1559
|
-
class
|
|
1756
|
+
class Et extends C {
|
|
1560
1757
|
constructor(t = {}) {
|
|
1561
1758
|
super({
|
|
1562
1759
|
...t,
|
|
1563
1760
|
title: t.title || "Width",
|
|
1564
1761
|
suffix: t.suffix || "px",
|
|
1565
1762
|
minValue: t.minValue ?? 0,
|
|
1566
|
-
icon: t.icon ||
|
|
1763
|
+
icon: t.icon || Q,
|
|
1567
1764
|
default: t.default ?? 100
|
|
1568
1765
|
}), this.inputType = "number", this.mobileValue = t.mobile;
|
|
1569
1766
|
}
|
|
@@ -1574,14 +1771,14 @@ class wt extends v {
|
|
|
1574
1771
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
1575
1772
|
}
|
|
1576
1773
|
}
|
|
1577
|
-
const
|
|
1774
|
+
const Q = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1578
1775
|
<path d="M4.5 9.5H13.5M4.5 9.5L6 7.25M4.5 9.5L6 11.75M13.5 9.5L12 7.25M13.5 9.5L12 11.75M15.75 16.25V2.75M2.25 16.25V2.75" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
1579
|
-
</svg>`,
|
|
1776
|
+
</svg>`, Y = `
|
|
1580
1777
|
<svg xmlns="http://www.w3.org/2000/svg" class="svg-select-api" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down">
|
|
1581
1778
|
<polyline points="6 9 12 15 18 9"></polyline>
|
|
1582
1779
|
</svg>
|
|
1583
1780
|
`;
|
|
1584
|
-
class
|
|
1781
|
+
class bt extends g {
|
|
1585
1782
|
constructor(t = {}) {
|
|
1586
1783
|
if (super(t), this.inputType = "select", this._options = [], this.isOpen = !1, this.selectedOptionIndex = null, this.optionsListEl = null, this.svgContainer = null, this.buttonEl = null, this.isLoading = !1, this.container = null, this.hasInitializedOptions = !1, this.selectedOptionIndex = null, t.default !== void 0 && (this.value = t.default), this.initializeOptions(t), !t.getOptionsAsync && this.value !== void 0) {
|
|
1587
1784
|
const e = this._options.findIndex(
|
|
@@ -1636,7 +1833,7 @@ class Et extends g {
|
|
|
1636
1833
|
o.onclick = (l) => this.selectApiOption(l, a, e), i.appendChild(o);
|
|
1637
1834
|
}), t.appendChild(i);
|
|
1638
1835
|
const s = document.createElement("div");
|
|
1639
|
-
return s.classList.add("svg-container"), s.innerHTML =
|
|
1836
|
+
return s.classList.add("svg-container"), s.innerHTML = Y, t.appendChild(s), s.onclick = () => {
|
|
1640
1837
|
var n, a;
|
|
1641
1838
|
this.isLoading || (this.isOpen = !this.isOpen, (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (a = this.svgContainer) == null || a.classList.toggle("open", this.isOpen));
|
|
1642
1839
|
}, this.optionsListEl = i, this.svgContainer = s, this.props.getOptionsAsync && !this.hasInitializedOptions ? (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((n) => {
|
|
@@ -1647,7 +1844,7 @@ class Et extends g {
|
|
|
1647
1844
|
);
|
|
1648
1845
|
if (this._options.push(...o), this.isLoading = !1, this.hasInitializedOptions = !0, this.value !== void 0) {
|
|
1649
1846
|
const l = this._options.findIndex(
|
|
1650
|
-
(
|
|
1847
|
+
(r) => JSON.stringify(r.value) === JSON.stringify(this.value)
|
|
1651
1848
|
);
|
|
1652
1849
|
this.selectedOptionIndex = l !== -1 ? l : null;
|
|
1653
1850
|
} else
|
|
@@ -1666,7 +1863,7 @@ class Et extends g {
|
|
|
1666
1863
|
);
|
|
1667
1864
|
if (this._options.push(...o), this.isLoading = !1, this.value !== void 0) {
|
|
1668
1865
|
const l = this._options.findIndex(
|
|
1669
|
-
(
|
|
1866
|
+
(r) => JSON.stringify(r.value) === JSON.stringify(this.value)
|
|
1670
1867
|
);
|
|
1671
1868
|
this.selectedOptionIndex = l !== -1 ? l : null;
|
|
1672
1869
|
} else
|
|
@@ -1683,7 +1880,7 @@ class Et extends g {
|
|
|
1683
1880
|
return JSON.stringify(t ? {} : { value: this.value }, null, 2);
|
|
1684
1881
|
}
|
|
1685
1882
|
selectApiOption(t, e, i) {
|
|
1686
|
-
var l,
|
|
1883
|
+
var l, r, d, c;
|
|
1687
1884
|
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
1885
|
n && (n.checked = !0), this.selectedOptionIndex = e;
|
|
1689
1886
|
const a = this._options[e].value;
|
|
@@ -1695,7 +1892,7 @@ class Et extends g {
|
|
|
1695
1892
|
const u = i.firstChild;
|
|
1696
1893
|
u && u.tagName === "SPAN" && (u.textContent = this._options[e].name);
|
|
1697
1894
|
}
|
|
1698
|
-
this.isOpen = !1, (
|
|
1895
|
+
this.isOpen = !1, (r = this.optionsListEl) == null || r.classList.remove("open"), (d = this.svgContainer) == null || d.classList.remove("open"), (c = this.onChange) == null || c.call(this, a), this.detectChangeCallback && this.detectChangeCallback(a);
|
|
1699
1896
|
}
|
|
1700
1897
|
updateOptionsList() {
|
|
1701
1898
|
!this.optionsListEl || !this.buttonEl || (this.optionsListEl.innerHTML = "", this._options.forEach((t, e) => {
|
|
@@ -1728,7 +1925,7 @@ class Et extends g {
|
|
|
1728
1925
|
), this.updateButtonText();
|
|
1729
1926
|
}
|
|
1730
1927
|
}
|
|
1731
|
-
class
|
|
1928
|
+
class xt extends g {
|
|
1732
1929
|
constructor(t) {
|
|
1733
1930
|
var e, i;
|
|
1734
1931
|
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;
|
|
@@ -1751,19 +1948,19 @@ class bt extends g {
|
|
|
1751
1948
|
i.className = "toggle-switch";
|
|
1752
1949
|
const s = document.createElement("input");
|
|
1753
1950
|
s.type = "checkbox", s.checked = ((o = (a = this.props.options) == null ? void 0 : a.find((l) => l.value === this.value)) == null ? void 0 : o.status) ?? !1, s.addEventListener("change", () => {
|
|
1754
|
-
var
|
|
1755
|
-
const l = ((
|
|
1951
|
+
var r, d;
|
|
1952
|
+
const l = ((d = (r = this.props.options) == null ? void 0 : r.find((c) => c.status === s.checked)) == null ? void 0 : d.value) ?? "";
|
|
1756
1953
|
this.value = l, this.onChange && this.onChange(this.value), this.detectChangeCallback && this.detectChangeCallback(this.value);
|
|
1757
1954
|
});
|
|
1758
1955
|
const n = document.createElement("span");
|
|
1759
1956
|
if (n.className = "toggle-slider", this.props.activeColor || this.props.inactiveColor) {
|
|
1760
|
-
const l = document.createElement("style"),
|
|
1957
|
+
const l = document.createElement("style"), r = this.props.activeColor || "#4CAF50", d = this.props.inactiveColor || "#ccc";
|
|
1761
1958
|
l.textContent = `
|
|
1762
1959
|
.toggle-switch input:checked + .toggle-slider {
|
|
1763
|
-
background-color: ${
|
|
1960
|
+
background-color: ${r};
|
|
1764
1961
|
}
|
|
1765
1962
|
.toggle-switch .toggle-slider {
|
|
1766
|
-
background-color: ${
|
|
1963
|
+
background-color: ${d};
|
|
1767
1964
|
}
|
|
1768
1965
|
`, document.head.appendChild(l);
|
|
1769
1966
|
}
|
|
@@ -1773,13 +1970,13 @@ class bt extends g {
|
|
|
1773
1970
|
this.detectChangeCallback = t;
|
|
1774
1971
|
}
|
|
1775
1972
|
}
|
|
1776
|
-
const
|
|
1973
|
+
const tt = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1777
1974
|
<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
1975
|
</svg>`;
|
|
1779
|
-
class
|
|
1976
|
+
class yt extends g {
|
|
1780
1977
|
// Store mobile value
|
|
1781
1978
|
constructor(t = {}) {
|
|
1782
|
-
t.rowGap = t.rowGap ?? !0, t.columnGap = t.columnGap ?? !0, t.title = t.title ?? "Gap", t.icon = t.icon ??
|
|
1979
|
+
t.rowGap = t.rowGap ?? !0, t.columnGap = t.columnGap ?? !0, t.title = t.title ?? "Gap", t.icon = t.icon ?? tt, 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
1980
|
}
|
|
1784
1981
|
draw() {
|
|
1785
1982
|
const t = document.createElement("div");
|
|
@@ -1807,10 +2004,10 @@ class Lt extends g {
|
|
|
1807
2004
|
let o = parseFloat(a.value);
|
|
1808
2005
|
o = this.validateValue(o), String(o) !== a.value && (a.value = String(o)), this.inputValues[t] = o, this.setValue(o);
|
|
1809
2006
|
}), s.addEventListener("blur", (n) => {
|
|
1810
|
-
var l,
|
|
2007
|
+
var l, r;
|
|
1811
2008
|
const a = n.target;
|
|
1812
2009
|
let o = parseFloat(a.value);
|
|
1813
|
-
o = this.validateValue(o), String(o) !== a.value && (a.value = String(o), this.inputValues[t] = o, this.setValue(o)), (
|
|
2010
|
+
o = this.validateValue(o), String(o) !== a.value && (a.value = String(o), this.inputValues[t] = o, this.setValue(o)), (r = (l = this.props).onBlur) == null || r.call(l);
|
|
1814
2011
|
}), i.appendChild(s), this.props.suffix && this.props.suffix !== "none") {
|
|
1815
2012
|
const n = document.createElement("span");
|
|
1816
2013
|
n.className = "gap-suffix", n.textContent = this.props.suffix, i.appendChild(n), s.style.paddingRight = "30px";
|
|
@@ -1830,47 +2027,47 @@ class Lt extends g {
|
|
|
1830
2027
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
1831
2028
|
}
|
|
1832
2029
|
}
|
|
1833
|
-
const
|
|
2030
|
+
const et = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1834
2031
|
<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
2032
|
</svg>`;
|
|
1836
|
-
class
|
|
2033
|
+
class Lt extends C {
|
|
1837
2034
|
constructor(t = {}) {
|
|
1838
2035
|
super({
|
|
1839
2036
|
...t,
|
|
1840
2037
|
minValue: t.minValue ?? 0,
|
|
1841
2038
|
maxValue: t.maxValue ?? 1e3,
|
|
1842
|
-
icon: t.icon ||
|
|
2039
|
+
icon: t.icon || et,
|
|
1843
2040
|
title: t.title || "Margin Bottom",
|
|
1844
2041
|
default: t.default ?? 20,
|
|
1845
2042
|
wrapperClassName: "margin-bottom-wrapper " + (t.wrapperClassName || "")
|
|
1846
2043
|
}), this.inputType = "number";
|
|
1847
2044
|
}
|
|
1848
2045
|
}
|
|
1849
|
-
const
|
|
2046
|
+
const it = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1850
2047
|
<path d="M15.75 7.25H2.25m9.9 9h-6.3c-1.26 0-1.89 0-2.371-.245a2.25 2.25 0 0 1-.984-.983c-.245-.482-.245-1.112-.245-2.372v-6.3c0-1.26 0-1.89.245-2.371a2.25 2.25 0 0 1 .984-.984c.48-.245 1.11-.245 2.371-.245h6.3c1.26 0 1.89 0 2.371.245.424.216.768.56.984.984.245.48.245 1.11.245 2.371v6.3c0 1.26 0 1.89-.245 2.371-.216.424-.56.768-.984.984-.48.245-1.11.245-2.371.245"
|
|
1851
2048
|
stroke="#667085" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
1852
2049
|
</svg>`;
|
|
1853
|
-
class
|
|
2050
|
+
class kt extends C {
|
|
1854
2051
|
constructor(t = {}) {
|
|
1855
2052
|
super({
|
|
1856
2053
|
...t,
|
|
1857
2054
|
minValue: t.minValue ?? 0,
|
|
1858
2055
|
maxValue: t.maxValue ?? 1e3,
|
|
1859
|
-
icon: t.icon ||
|
|
2056
|
+
icon: t.icon || it,
|
|
1860
2057
|
title: t.title || "Margin Top",
|
|
1861
2058
|
default: t.default ?? 20,
|
|
1862
2059
|
wrapperClassName: "margin-top-wrapper " + (t.wrapperClassName || "")
|
|
1863
2060
|
}), this.inputType = "number";
|
|
1864
2061
|
}
|
|
1865
2062
|
}
|
|
1866
|
-
const
|
|
2063
|
+
const st = `
|
|
1867
2064
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
1868
2065
|
<polyline points="3,6 5,6 21,6"></polyline>
|
|
1869
2066
|
<path d="m19,6v14a2,2 0 0,1-2,2H7a2,2 0 0,1-2-2V6m3,0V4a2,2 0 0,1,2-2h4a2,2 0 0,1,2,2v2"></path>
|
|
1870
2067
|
<line x1="10" y1="11" x2="10" y2="17"></line>
|
|
1871
2068
|
<line x1="14" y1="11" x2="14" y2="17"></line>
|
|
1872
2069
|
</svg>
|
|
1873
|
-
`,
|
|
2070
|
+
`, nt = `
|
|
1874
2071
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
1875
2072
|
<line x1="12" y1="5" x2="12" y2="19"></line>
|
|
1876
2073
|
<line x1="5" y1="12" x2="19" y2="12"></line>
|
|
@@ -1920,11 +2117,11 @@ class Mt extends g {
|
|
|
1920
2117
|
n.classList.add("language-input-group");
|
|
1921
2118
|
const a = document.createElement("input");
|
|
1922
2119
|
a.type = "text", a.classList.add("language-input"), a.value = e || "", a.placeholder = this.props.placeholder || "Enter text...", a.addEventListener("input", (l) => {
|
|
1923
|
-
const
|
|
1924
|
-
this.updateLanguageValue(t,
|
|
2120
|
+
const r = l.target;
|
|
2121
|
+
this.updateLanguageValue(t, r.value);
|
|
1925
2122
|
});
|
|
1926
2123
|
const o = document.createElement("button");
|
|
1927
|
-
return o.type = "button", o.classList.add("delete-language-btn"), o.innerHTML =
|
|
2124
|
+
return o.type = "button", o.classList.add("delete-language-btn"), o.innerHTML = st, o.title = `Delete ${t.toUpperCase()}`, o.addEventListener("click", () => {
|
|
1928
2125
|
this.removeLanguage(t);
|
|
1929
2126
|
}), n.appendChild(a), n.appendChild(o), i.appendChild(s), i.appendChild(n), i;
|
|
1930
2127
|
}
|
|
@@ -1957,7 +2154,7 @@ class Mt extends g {
|
|
|
1957
2154
|
const s = document.createElement("select");
|
|
1958
2155
|
s.classList.add("add-language-select"), this.addLanguageSelect = s;
|
|
1959
2156
|
const n = document.createElement("button");
|
|
1960
|
-
return n.type = "button", n.classList.add("add-language-btn"), n.innerHTML = `${
|
|
2157
|
+
return n.type = "button", n.classList.add("add-language-btn"), n.innerHTML = `${nt} Add`, this.addButton = n, n.addEventListener("click", () => {
|
|
1961
2158
|
const a = s.value;
|
|
1962
2159
|
a && this.addLanguage(a);
|
|
1963
2160
|
}), i.appendChild(s), i.appendChild(n), t.appendChild(e), t.appendChild(i), t;
|
|
@@ -1985,7 +2182,7 @@ class Mt extends g {
|
|
|
1985
2182
|
}), this.updateAddLanguageSelect());
|
|
1986
2183
|
}
|
|
1987
2184
|
}
|
|
1988
|
-
class
|
|
2185
|
+
class Vt extends g {
|
|
1989
2186
|
constructor(t = {}) {
|
|
1990
2187
|
super(t), this.inputType = "select";
|
|
1991
2188
|
const e = [
|
|
@@ -1996,7 +2193,7 @@ class kt extends g {
|
|
|
1996
2193
|
{ name: "Bounce", value: "bounce 1.5s ease-in-out infinite" },
|
|
1997
2194
|
{ name: "Pulse", value: "pulse 1.5s ease-in-out infinite" }
|
|
1998
2195
|
];
|
|
1999
|
-
this.selectSetting = new
|
|
2196
|
+
this.selectSetting = new N({
|
|
2000
2197
|
title: this.title || "Animation",
|
|
2001
2198
|
options: e,
|
|
2002
2199
|
default: this.props.default || "none"
|
|
@@ -2012,7 +2209,7 @@ class kt extends g {
|
|
|
2012
2209
|
this.selectSetting.destroy(), super.destroy();
|
|
2013
2210
|
}
|
|
2014
2211
|
}
|
|
2015
|
-
const
|
|
2212
|
+
const ot = `
|
|
2016
2213
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2017
2214
|
<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
2215
|
</svg>
|
|
@@ -2021,25 +2218,25 @@ const nt = `
|
|
|
2021
2218
|
<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
2219
|
</svg>
|
|
2023
2220
|
`;
|
|
2024
|
-
class
|
|
2221
|
+
class It extends v {
|
|
2025
2222
|
constructor(t) {
|
|
2026
2223
|
super({
|
|
2027
2224
|
title: "Border",
|
|
2028
2225
|
collapsed: t == null ? void 0 : t.collapsed,
|
|
2029
2226
|
hideCondition: t == null ? void 0 : t.hideCondition,
|
|
2030
2227
|
settings: {
|
|
2031
|
-
size: new
|
|
2228
|
+
size: new C({
|
|
2032
2229
|
title: "Size",
|
|
2033
2230
|
icon: at,
|
|
2034
2231
|
default: (t == null ? void 0 : t.size) ?? 0,
|
|
2035
2232
|
suffix: "px"
|
|
2036
2233
|
}),
|
|
2037
|
-
color: new
|
|
2234
|
+
color: new w({
|
|
2038
2235
|
default: (t == null ? void 0 : t.color) ?? "0, 0, 30"
|
|
2039
2236
|
}),
|
|
2040
|
-
radius: new
|
|
2237
|
+
radius: new C({
|
|
2041
2238
|
title: "Radius",
|
|
2042
|
-
icon:
|
|
2239
|
+
icon: ot,
|
|
2043
2240
|
default: (t == null ? void 0 : t.radius) ?? 12,
|
|
2044
2241
|
suffix: "px"
|
|
2045
2242
|
})
|
|
@@ -2058,20 +2255,20 @@ class Vt extends f {
|
|
|
2058
2255
|
`;
|
|
2059
2256
|
}
|
|
2060
2257
|
}
|
|
2061
|
-
const
|
|
2258
|
+
const lt = `
|
|
2062
2259
|
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="13" viewBox="0 0 14 13" fill="none">
|
|
2063
2260
|
<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
2261
|
</svg>
|
|
2065
|
-
`,
|
|
2262
|
+
`, rt = `
|
|
2066
2263
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2067
2264
|
<path d="M3 5.75C3 5.05109 3 4.70163 3.11418 4.42597C3.26642 4.05843 3.55843 3.76642 3.92597 3.61418C4.20163 3.5 4.55109 3.5 5.25 3.5H12.75C13.4489 3.5 13.7984 3.5 14.074 3.61418C14.4416 3.76642 14.7336 4.05843 14.8858 4.42597C15 4.70163 15 5.05109 15 5.75M6 15.5H12M7.6875 3.5V15.5M10.3125 3.5V15.5" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2068
2265
|
</svg>
|
|
2069
|
-
`,
|
|
2266
|
+
`, ct = `
|
|
2070
2267
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2071
2268
|
<path d="M6 5.75H12M9 5.75V13.25M5.85 16.25H12.15C13.4101 16.25 14.0402 16.25 14.5215 16.0048C14.9448 15.789 15.289 15.4448 15.5048 15.0215C15.75 14.5402 15.75 13.9101 15.75 12.65V6.35C15.75 5.08988 15.75 4.45982 15.5048 3.97852C15.289 3.55516 14.9448 3.21095 14.5215 2.99524C14.0402 2.75 13.4101 2.75 12.15 2.75H5.85C4.58988 2.75 3.95982 2.75 3.47852 2.99524C3.05516 3.21095 2.71095 3.55516 2.49524 3.97852C2.25 4.45982 2.25 5.08988 2.25 6.35V12.65C2.25 13.9101 2.25 14.5402 2.49524 15.0215C2.71095 15.4448 3.05516 15.789 3.47852 16.0048C3.95982 16.25 4.58988 16.25 5.85 16.25Z" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2072
2269
|
</svg>
|
|
2073
2270
|
`;
|
|
2074
|
-
class Nt extends
|
|
2271
|
+
class Nt extends v {
|
|
2075
2272
|
constructor(t = {}) {
|
|
2076
2273
|
const { showAlign: e = t.showAlign ?? !0, ...i } = t;
|
|
2077
2274
|
super({
|
|
@@ -2080,12 +2277,12 @@ class Nt extends f {
|
|
|
2080
2277
|
hideCondition: i.hideCondition,
|
|
2081
2278
|
settings: (() => {
|
|
2082
2279
|
const s = {
|
|
2083
|
-
color: new
|
|
2280
|
+
color: new w({
|
|
2084
2281
|
default: i.colorDefault ?? "0, 0, 30"
|
|
2085
2282
|
}),
|
|
2086
|
-
fontFamily: new
|
|
2283
|
+
fontFamily: new N({
|
|
2087
2284
|
title: "Font",
|
|
2088
|
-
icon:
|
|
2285
|
+
icon: lt,
|
|
2089
2286
|
default: i.fontFamilyDefault ?? "Satoshi",
|
|
2090
2287
|
options: i.fontFamilyOptions ?? [
|
|
2091
2288
|
{ name: "Alt", value: "Croco Sans Black Caps Alt" },
|
|
@@ -2096,9 +2293,9 @@ class Nt extends f {
|
|
|
2096
2293
|
getOptions: i.fontFamilyGetOptions,
|
|
2097
2294
|
getOptionsAsync: i.fontFamilyGetOptionsAsync
|
|
2098
2295
|
}),
|
|
2099
|
-
fontWeight: new
|
|
2296
|
+
fontWeight: new N({
|
|
2100
2297
|
title: "Weight",
|
|
2101
|
-
icon:
|
|
2298
|
+
icon: rt,
|
|
2102
2299
|
default: i.fontWeightDefault ?? "400",
|
|
2103
2300
|
options: i.fontWeightOptions ?? [
|
|
2104
2301
|
{ name: "Regular", value: "400" },
|
|
@@ -2108,9 +2305,9 @@ class Nt extends f {
|
|
|
2108
2305
|
getOptions: i.fontWeightGetOptions,
|
|
2109
2306
|
getOptionsAsync: i.fontWeightGetOptionsAsync
|
|
2110
2307
|
}),
|
|
2111
|
-
fontSize: new
|
|
2308
|
+
fontSize: new C({
|
|
2112
2309
|
title: "Size",
|
|
2113
|
-
icon:
|
|
2310
|
+
icon: ct,
|
|
2114
2311
|
default: i.fontSizeDefault ?? 12,
|
|
2115
2312
|
suffix: "px",
|
|
2116
2313
|
mobile: i.fontSizeMobileDefault
|
|
@@ -2138,7 +2335,7 @@ class Nt extends f {
|
|
|
2138
2335
|
`;
|
|
2139
2336
|
}
|
|
2140
2337
|
}
|
|
2141
|
-
class
|
|
2338
|
+
class y extends g {
|
|
2142
2339
|
constructor(t) {
|
|
2143
2340
|
super({
|
|
2144
2341
|
...t,
|
|
@@ -2148,9 +2345,9 @@ class E extends g {
|
|
|
2148
2345
|
draw() {
|
|
2149
2346
|
const t = this.value === "auto" ? "text" : "number", e = (o) => {
|
|
2150
2347
|
this.value !== "auto" && (this.props.minValue !== void 0 && (o.min = String(this.props.minValue)), this.props.maxValue !== void 0 && (o.max = String(this.props.maxValue)), this.props.className && o.classList.add(this.props.className), o.addEventListener("input", () => {
|
|
2151
|
-
const l = this.props.minValue ?? Number.MIN_SAFE_INTEGER,
|
|
2152
|
-
let
|
|
2153
|
-
|
|
2348
|
+
const l = this.props.minValue ?? Number.MIN_SAFE_INTEGER, r = this.props.maxValue ?? Number.MAX_SAFE_INTEGER;
|
|
2349
|
+
let d = Number(o.value);
|
|
2350
|
+
d < l && (d = l), d > r && (d = r), o.value = String(d);
|
|
2154
2351
|
}));
|
|
2155
2352
|
}, i = this.createInput({
|
|
2156
2353
|
value: this.value,
|
|
@@ -2177,41 +2374,41 @@ class E extends g {
|
|
|
2177
2374
|
if (l.toLowerCase() === "auto")
|
|
2178
2375
|
this.value = "auto";
|
|
2179
2376
|
else {
|
|
2180
|
-
const
|
|
2181
|
-
isNaN(
|
|
2377
|
+
const r = Number(l);
|
|
2378
|
+
isNaN(r) || (this.value = r);
|
|
2182
2379
|
}
|
|
2183
2380
|
this.onChange && this.onChange(this.value);
|
|
2184
2381
|
}), i;
|
|
2185
2382
|
}
|
|
2186
2383
|
}
|
|
2187
|
-
class
|
|
2384
|
+
class St extends v {
|
|
2188
2385
|
constructor(t) {
|
|
2189
2386
|
super({
|
|
2190
2387
|
title: "Margins",
|
|
2191
2388
|
collapsed: t == null ? void 0 : t.collapsed,
|
|
2192
2389
|
hideCondition: t == null ? void 0 : t.hideCondition,
|
|
2193
2390
|
settings: {
|
|
2194
|
-
marginTop: new
|
|
2391
|
+
marginTop: new y({
|
|
2195
2392
|
title: "Top",
|
|
2196
2393
|
icon: ht,
|
|
2197
2394
|
suffix: "px",
|
|
2198
2395
|
default: (t == null ? void 0 : t.marginTop) ?? "auto"
|
|
2199
2396
|
}),
|
|
2200
|
-
marginRight: new
|
|
2397
|
+
marginRight: new y({
|
|
2201
2398
|
title: "Right",
|
|
2202
|
-
icon:
|
|
2399
|
+
icon: dt,
|
|
2203
2400
|
suffix: "px",
|
|
2204
2401
|
default: (t == null ? void 0 : t.marginRight) ?? 0
|
|
2205
2402
|
}),
|
|
2206
|
-
marginBottom: new
|
|
2403
|
+
marginBottom: new y({
|
|
2207
2404
|
title: "Bottom",
|
|
2208
|
-
icon:
|
|
2405
|
+
icon: ut,
|
|
2209
2406
|
suffix: "px",
|
|
2210
2407
|
default: (t == null ? void 0 : t.marginBottom) ?? 0
|
|
2211
2408
|
}),
|
|
2212
|
-
marginLeft: new
|
|
2409
|
+
marginLeft: new y({
|
|
2213
2410
|
title: "Left",
|
|
2214
|
-
icon:
|
|
2411
|
+
icon: pt,
|
|
2215
2412
|
suffix: "px",
|
|
2216
2413
|
default: (t == null ? void 0 : t.marginLeft) ?? 0
|
|
2217
2414
|
})
|
|
@@ -2230,14 +2427,14 @@ class It extends f {
|
|
|
2230
2427
|
}
|
|
2231
2428
|
const ht = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2232
2429
|
<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>`, ct = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2234
|
-
<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
2430
|
</svg>`, dt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2236
|
-
<path d="
|
|
2431
|
+
<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"/>
|
|
2237
2432
|
</svg>`, ut = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2433
|
+
<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"/>
|
|
2434
|
+
</svg>`, pt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2238
2435
|
<path d="M5.625 2.75H5.6325M5.625 9.5H5.6325M5.625 16.25H5.6325M12.375 2.75H12.3825M12.375 9.5H12.3825M12.375 16.25H12.3825M9 2.75H9.0075M9 9.5H9.0075M9 16.25H9.0075M9 12.875H9.0075M9 6.125H9.0075M15.75 2.75H15.7575M15.75 9.5H15.7575M15.75 16.25H15.7575M15.75 12.875H15.7575M15.75 6.125H15.7575M2.25 16.25V2.75" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2239
2436
|
</svg>`;
|
|
2240
|
-
class
|
|
2437
|
+
class Ot extends v {
|
|
2241
2438
|
/**
|
|
2242
2439
|
* Constructs a new BackgroundSettingSet.
|
|
2243
2440
|
*
|
|
@@ -2267,14 +2464,14 @@ class St extends f {
|
|
|
2267
2464
|
collapsed: t == null ? void 0 : t.collapsed,
|
|
2268
2465
|
hideCondition: t == null ? void 0 : t.hideCondition,
|
|
2269
2466
|
settings: {
|
|
2270
|
-
backgroundImage: new
|
|
2467
|
+
backgroundImage: new K({
|
|
2271
2468
|
...t == null ? void 0 : t.uploadProps,
|
|
2272
2469
|
default: (t == null ? void 0 : t.backgroundImage) ?? ""
|
|
2273
2470
|
}),
|
|
2274
|
-
opacity: new
|
|
2471
|
+
opacity: new G({
|
|
2275
2472
|
default: (t == null ? void 0 : t.opacity) ?? 100
|
|
2276
2473
|
}),
|
|
2277
|
-
backgroundColor: new
|
|
2474
|
+
backgroundColor: new w({
|
|
2278
2475
|
default: (t == null ? void 0 : t.backgroundColor) ?? "0, 0, 30"
|
|
2279
2476
|
})
|
|
2280
2477
|
}
|
|
@@ -2306,44 +2503,44 @@ class St extends f {
|
|
|
2306
2503
|
`;
|
|
2307
2504
|
}
|
|
2308
2505
|
}
|
|
2309
|
-
function
|
|
2310
|
-
return
|
|
2506
|
+
function Ht(h) {
|
|
2507
|
+
return h instanceof v;
|
|
2311
2508
|
}
|
|
2312
|
-
function
|
|
2313
|
-
return
|
|
2509
|
+
function Tt(h) {
|
|
2510
|
+
return h instanceof g;
|
|
2314
2511
|
}
|
|
2315
2512
|
export {
|
|
2316
2513
|
W as AlignSetting,
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2514
|
+
Vt as AnimationSetting,
|
|
2515
|
+
Ot as BackgroundSettingSet,
|
|
2516
|
+
It as BorderSettingSet,
|
|
2517
|
+
vt as ButtonSetting,
|
|
2518
|
+
f as ColorSetting,
|
|
2519
|
+
w as ColorWithOpacitySetting,
|
|
2520
|
+
Ct as DimensionSetting,
|
|
2521
|
+
yt as GapSetting,
|
|
2325
2522
|
Nt as HeaderTypographySettingSet,
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2523
|
+
wt as HeightSetting,
|
|
2524
|
+
ft as HtmlSetting,
|
|
2525
|
+
Lt as MarginBottomSetting,
|
|
2526
|
+
St as MarginSettingGroup,
|
|
2527
|
+
kt as MarginTopSetting,
|
|
2331
2528
|
Mt as MultiLanguageSetting,
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2529
|
+
C as NumberSetting,
|
|
2530
|
+
G as OpacitySetting,
|
|
2531
|
+
bt as SelectApiSettings,
|
|
2532
|
+
N as SelectSetting,
|
|
2336
2533
|
g as Setting,
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2534
|
+
v as SettingGroup,
|
|
2535
|
+
F as StringSetting,
|
|
2536
|
+
gt as TabSettingGroup,
|
|
2537
|
+
gt as TabsSettingGroup,
|
|
2538
|
+
xt as Toggle,
|
|
2539
|
+
K as UploadSetting,
|
|
2540
|
+
Et as WidthSetting,
|
|
2541
|
+
mt as asSettingGroupWithSettings,
|
|
2542
|
+
$ as createSettingGroup,
|
|
2543
|
+
Tt as isSetting,
|
|
2544
|
+
Ht as isSettingGroup,
|
|
2545
|
+
x as iterateSettings
|
|
2349
2546
|
};
|