builder-settings-types 0.0.216 → 0.0.218
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 +50 -45
- package/dist/builder-settings-types.es.js +424 -378
- package/dist/index.css +1 -1
- package/dist/index.d.ts +18 -3
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const
|
|
2
|
-
let
|
|
1
|
+
const O = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
2
|
+
let I = (c = 21) => {
|
|
3
3
|
let t = "", e = crypto.getRandomValues(new Uint8Array(c |= 0));
|
|
4
4
|
for (; c--; )
|
|
5
|
-
t +=
|
|
5
|
+
t += O[e[c] & 63];
|
|
6
6
|
return t;
|
|
7
7
|
};
|
|
8
8
|
function L(c) {
|
|
@@ -22,7 +22,7 @@ function L(c) {
|
|
|
22
22
|
const e = Object.getPrototypeOf(c);
|
|
23
23
|
return e !== Object.prototype && Object.setPrototypeOf(t, e), t;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function H(c) {
|
|
26
26
|
switch (c) {
|
|
27
27
|
case "number":
|
|
28
28
|
return 0;
|
|
@@ -40,12 +40,12 @@ function N(c) {
|
|
|
40
40
|
return "";
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
class
|
|
43
|
+
class g {
|
|
44
44
|
constructor(t = {}) {
|
|
45
|
-
this.props = t, this.id = t.id ||
|
|
45
|
+
this.props = t, this.id = t.id || I(), 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
|
-
window.DefaultUploadUrl = t,
|
|
48
|
+
window.DefaultUploadUrl = t, g.DefaultUploadUrl = t;
|
|
49
49
|
}
|
|
50
50
|
destroy() {
|
|
51
51
|
throw new Error("Method not implemented.");
|
|
@@ -67,23 +67,23 @@ class p {
|
|
|
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 o = document.createElement("div");
|
|
71
|
+
if (o.className = "icon-container", t.icon) {
|
|
72
72
|
const l = this.createIcon(t.icon, t.iconClassName);
|
|
73
|
-
|
|
73
|
+
o.appendChild(l);
|
|
74
74
|
}
|
|
75
75
|
if (t.title) {
|
|
76
76
|
const l = this.createLabel(t.title, t.labelClassName);
|
|
77
|
-
|
|
77
|
+
o.appendChild(l);
|
|
78
78
|
}
|
|
79
|
-
e.appendChild(
|
|
79
|
+
e.appendChild(o);
|
|
80
80
|
}
|
|
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 ||
|
|
85
|
-
const n = (
|
|
86
|
-
const l =
|
|
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 = (o) => {
|
|
86
|
+
const l = o.target;
|
|
87
87
|
let h = l.value;
|
|
88
88
|
switch (t.inputType) {
|
|
89
89
|
case "number":
|
|
@@ -108,10 +108,10 @@ class p {
|
|
|
108
108
|
h = l.value;
|
|
109
109
|
}
|
|
110
110
|
this.value = h, this.onChange && this.onChange(this.value), this.props.detectChange && this.props.detectChange(this.value);
|
|
111
|
-
},
|
|
112
|
-
|
|
111
|
+
}, a = (o) => {
|
|
112
|
+
o.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", a), 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,31 +122,31 @@ class p {
|
|
|
122
122
|
return i.className = "input-icon " + (e || ""), i.innerHTML = t, i;
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function T(c) {
|
|
126
126
|
let t = 0, e = c.parentElement;
|
|
127
127
|
for (; e; )
|
|
128
128
|
e.classList.contains("setting-group") && e !== c && t++, e = e.parentElement;
|
|
129
129
|
return t;
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function b(c, t) {
|
|
132
132
|
const e = Math.min(Math.max(t, 0), 5);
|
|
133
133
|
c.setAttribute("data-nesting-level", e.toString()), e > 0 ? c.style.setProperty("--visual-indent", `${e * 2}px`) : (c.style.removeProperty("--visual-indent"), c.style.marginLeft = "");
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function M(c, t = 0) {
|
|
136
136
|
c.querySelectorAll(":scope > .setting-group-content > .setting-group").forEach((i) => {
|
|
137
137
|
const s = i, n = t + 1;
|
|
138
|
-
|
|
138
|
+
b(s, n), M(s, n);
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
|
-
const
|
|
141
|
+
const B = {
|
|
142
142
|
maxLevel: 5,
|
|
143
143
|
spacingMultiplier: 1,
|
|
144
144
|
visualIndentMultiplier: 2,
|
|
145
145
|
enableAutoDetection: !0
|
|
146
146
|
};
|
|
147
|
-
class
|
|
147
|
+
class A {
|
|
148
148
|
constructor(t = {}) {
|
|
149
|
-
this.observedElements = /* @__PURE__ */ new Set(), this.config = { ...
|
|
149
|
+
this.observedElements = /* @__PURE__ */ new Set(), this.config = { ...B, ...t }, this.config.enableAutoDetection && this.setupAutoDetection();
|
|
150
150
|
}
|
|
151
151
|
/**
|
|
152
152
|
* Setup automatic detection using MutationObserver
|
|
@@ -180,7 +180,7 @@ class O {
|
|
|
180
180
|
* Update nesting for a specific element
|
|
181
181
|
*/
|
|
182
182
|
updateElementNesting(t) {
|
|
183
|
-
const e =
|
|
183
|
+
const e = T(t);
|
|
184
184
|
this.applyNestingWithConfig(t, e);
|
|
185
185
|
}
|
|
186
186
|
/**
|
|
@@ -228,23 +228,23 @@ class O {
|
|
|
228
228
|
this.observer && (this.observer.disconnect(), this.observer = void 0), this.observedElements.clear();
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
|
-
const
|
|
231
|
+
const N = new A();
|
|
232
232
|
function w(c, t) {
|
|
233
233
|
for (const e in c)
|
|
234
|
-
if (
|
|
234
|
+
if (Object.prototype.hasOwnProperty.call(c, e)) {
|
|
235
235
|
const i = c[e];
|
|
236
236
|
t(e, i);
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
|
-
const
|
|
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 || I(), this.title = t.title, this.settings = t.settings, this.description = t.description, this.icon = t.icon, this.isCollapsed = t.collapsed ?? !1, this.isMain = t.main ?? !1, this.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, 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
|
w(this.settings, (e, i) => {
|
|
247
|
-
i instanceof
|
|
247
|
+
i instanceof p && (i.parentNestingLevel = this.nestingLevel, i.nestingLevel = t, i.propagateNestingLevel());
|
|
248
248
|
});
|
|
249
249
|
}
|
|
250
250
|
getNestingLevel() {
|
|
@@ -254,7 +254,7 @@ const g = class g {
|
|
|
254
254
|
this.nestingLevel = t, this.propagateNestingLevel(), this.elementRef && this.updateNestingStyles();
|
|
255
255
|
}
|
|
256
256
|
updateNestingStyles() {
|
|
257
|
-
this.elementRef && (
|
|
257
|
+
this.elementRef && (b(this.elementRef, this.nestingLevel), M(this.elementRef, this.nestingLevel));
|
|
258
258
|
}
|
|
259
259
|
static hide() {
|
|
260
260
|
this.hiddenElements.forEach((t) => {
|
|
@@ -279,41 +279,35 @@ const g = class g {
|
|
|
279
279
|
};
|
|
280
280
|
return this.changeHandlers.clear(), w(this.settings, (i, s) => {
|
|
281
281
|
var n;
|
|
282
|
-
if (s instanceof
|
|
283
|
-
s.setOnChange((
|
|
282
|
+
if (s instanceof p)
|
|
283
|
+
s.setOnChange(() => {
|
|
284
284
|
const a = this.getValues();
|
|
285
285
|
this.initialValues = a, t(a);
|
|
286
286
|
}), this.changeHandlers.add(() => t(this.getValues()));
|
|
287
|
-
else if (s instanceof
|
|
288
|
-
const
|
|
289
|
-
|
|
290
|
-
};
|
|
291
|
-
this.changeHandlers.add(o), s.setOnChange(o);
|
|
287
|
+
else if (s instanceof g) {
|
|
288
|
+
const a = () => e();
|
|
289
|
+
this.changeHandlers.add(a), s.setOnChange(a);
|
|
292
290
|
} else {
|
|
293
|
-
const
|
|
294
|
-
|
|
295
|
-
};
|
|
296
|
-
this.changeHandlers.add(o), (n = s.setOnChange) == null || n.call(s, o);
|
|
291
|
+
const a = () => e();
|
|
292
|
+
this.changeHandlers.add(a), (n = s.setOnChange) == null || n.call(s, a);
|
|
297
293
|
}
|
|
298
294
|
}), this;
|
|
299
295
|
}
|
|
300
296
|
setOnBlur(t) {
|
|
301
297
|
return this.onBlur = t, this.pendingBlurHandler = t, this.handleBlur = (e) => {
|
|
302
|
-
(e == null ? void 0 : e.target) instanceof HTMLElement && e.target.closest(".setting-group") !== this.elementRef || (this.blurTimeout && clearTimeout(this.blurTimeout), this.blurTimeout = setTimeout(() =>
|
|
303
|
-
t();
|
|
304
|
-
}, 100));
|
|
298
|
+
(e == null ? void 0 : e.target) instanceof HTMLElement && e.target.closest(".setting-group") !== this.elementRef || (this.blurTimeout && clearTimeout(this.blurTimeout), this.blurTimeout = setTimeout(() => t(), 100));
|
|
305
299
|
}, this.elementRef && this.setupBlurHandlers(), this;
|
|
306
300
|
}
|
|
307
301
|
setupBlurHandlers() {
|
|
308
|
-
this.elementRef && this.elementRef.removeEventListener(
|
|
302
|
+
this.elementRef && (this.elementRef.removeEventListener(
|
|
309
303
|
"focusout",
|
|
310
304
|
this.handleBlur
|
|
311
|
-
), this.elementRef
|
|
305
|
+
), this.elementRef.addEventListener(
|
|
312
306
|
"focusout",
|
|
313
307
|
this.handleBlur,
|
|
314
308
|
!0
|
|
315
|
-
), w(this.settings, (t, e) => {
|
|
316
|
-
e instanceof
|
|
309
|
+
)), w(this.settings, (t, e) => {
|
|
310
|
+
e instanceof p && e.setOnBlur(() => {
|
|
317
311
|
this.onBlur && this.onBlur();
|
|
318
312
|
});
|
|
319
313
|
});
|
|
@@ -340,28 +334,28 @@ const g = class g {
|
|
|
340
334
|
main: this.isMain,
|
|
341
335
|
custom: this.custom,
|
|
342
336
|
hideCondition: this.hideCondition,
|
|
343
|
-
parentNestingLevel: this.parentNestingLevel
|
|
344
|
-
|
|
337
|
+
parentNestingLevel: this.parentNestingLevel,
|
|
338
|
+
includeGetJson: this.includeGetJson,
|
|
339
|
+
addItem: this.addItemCfg
|
|
340
|
+
}, i = R(e);
|
|
345
341
|
return i.initialValues = this.getValues(), i;
|
|
346
342
|
}
|
|
347
343
|
setValue(t) {
|
|
348
344
|
if (!t || typeof t != "object") return;
|
|
349
345
|
Object.entries(t).forEach(([i, s]) => {
|
|
350
346
|
const n = this.settings[i];
|
|
351
|
-
n && (n instanceof
|
|
347
|
+
n && (n instanceof p || n instanceof g) && typeof n.setValue == "function" && n.setValue(s);
|
|
352
348
|
}), setTimeout(() => {
|
|
353
349
|
this.forceChildUIRefresh();
|
|
354
350
|
}, 0);
|
|
355
351
|
const e = this.getValues();
|
|
356
352
|
this.initialValues = e, this.onChange && this.onChange(e);
|
|
357
353
|
}
|
|
358
|
-
/**
|
|
359
|
-
* Force UI refresh for all child settings
|
|
360
|
-
*/
|
|
354
|
+
/** Force UI refresh for all child settings */
|
|
361
355
|
forceChildUIRefresh() {
|
|
362
356
|
Object.entries(this.settings).forEach(([t, e]) => {
|
|
363
357
|
try {
|
|
364
|
-
if (e instanceof
|
|
358
|
+
if (e instanceof p) {
|
|
365
359
|
const i = e.getValues();
|
|
366
360
|
e.setValue(i);
|
|
367
361
|
} else if (typeof e.setValue == "function") {
|
|
@@ -373,17 +367,54 @@ const g = class g {
|
|
|
373
367
|
}
|
|
374
368
|
});
|
|
375
369
|
}
|
|
370
|
+
/** Attach change/blur bubbling for a newly added child */
|
|
371
|
+
wireChild(t) {
|
|
372
|
+
var i, s, n;
|
|
373
|
+
const e = () => {
|
|
374
|
+
var o;
|
|
375
|
+
const a = this.getValues();
|
|
376
|
+
this.initialValues = a, (o = this.onChange) == null || o.call(this, a), this.updateVisibility();
|
|
377
|
+
};
|
|
378
|
+
t instanceof p ? (t.setOnChange(() => e()), (i = t.setOnBlur) == null || i.call(t, () => {
|
|
379
|
+
var a;
|
|
380
|
+
return (a = this.onBlur) == null ? void 0 : a.call(this);
|
|
381
|
+
})) : t instanceof g ? (t.setOnChange(() => e()), (s = t.setOnBlur) == null || s.call(t, () => {
|
|
382
|
+
var a;
|
|
383
|
+
return (a = this.onBlur) == null ? void 0 : a.call(this);
|
|
384
|
+
})) : (n = t.setOnChange) == null || n.call(t, () => e());
|
|
385
|
+
}
|
|
386
|
+
addSetting(t, e) {
|
|
387
|
+
var s;
|
|
388
|
+
if (this.settings[t] = e, this.wireChild(e), this.elementRef) {
|
|
389
|
+
const n = this.elementRef.querySelector(
|
|
390
|
+
".setting-group-content"
|
|
391
|
+
);
|
|
392
|
+
if (n) {
|
|
393
|
+
e instanceof p && e.setNestingLevel(this.nestingLevel + 1);
|
|
394
|
+
const a = e.draw(), o = n.querySelector(".sg-add-button-bottom");
|
|
395
|
+
o ? n.insertBefore(a, o) : n.appendChild(a), N.trackElement(a), b(a, this.nestingLevel + 1), M(a, this.nestingLevel + 1);
|
|
396
|
+
const l = a.style.display;
|
|
397
|
+
a.style.display = "none", a.offsetHeight, a.style.display = l, this.updateNestingStyles();
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
const i = this.getValues();
|
|
401
|
+
this.initialValues = i, (s = this.onChange) == null || s.call(this, i);
|
|
402
|
+
}
|
|
403
|
+
getNextIndexFromPrefix(t) {
|
|
404
|
+
const e = Object.keys(this.settings).filter((i) => i.startsWith(t)).map((i) => {
|
|
405
|
+
const s = Number(i.slice(t.length));
|
|
406
|
+
return Number.isFinite(s) ? s : -1;
|
|
407
|
+
}).filter((i) => i >= 0);
|
|
408
|
+
return e.length ? Math.max(...e) + 1 : 0;
|
|
409
|
+
}
|
|
376
410
|
calculateChanges(t, e) {
|
|
377
411
|
const i = {};
|
|
378
412
|
return (/* @__PURE__ */ new Set([
|
|
379
413
|
...Object.keys(t),
|
|
380
414
|
...Object.keys(e)
|
|
381
415
|
])).forEach((n) => {
|
|
382
|
-
const
|
|
383
|
-
JSON.stringify(
|
|
384
|
-
from: o,
|
|
385
|
-
to: a
|
|
386
|
-
});
|
|
416
|
+
const a = t[n], o = e[n];
|
|
417
|
+
JSON.stringify(a) !== JSON.stringify(o) && (i[n] = { from: a, to: o });
|
|
387
418
|
}), i;
|
|
388
419
|
}
|
|
389
420
|
hide() {
|
|
@@ -396,51 +427,52 @@ const g = class g {
|
|
|
396
427
|
if (t === void 0) {
|
|
397
428
|
const e = {};
|
|
398
429
|
for (const i in this.settings)
|
|
399
|
-
if (
|
|
430
|
+
if (Object.prototype.hasOwnProperty.call(this.settings, i)) {
|
|
400
431
|
const s = this.settings[i];
|
|
401
|
-
s instanceof
|
|
432
|
+
s instanceof p ? e[i] = s.getValues() : e[i] = s.value;
|
|
402
433
|
}
|
|
403
434
|
return e;
|
|
404
435
|
} else {
|
|
405
436
|
const e = this.settings[t];
|
|
406
|
-
return e ? e instanceof
|
|
437
|
+
return e ? e instanceof p ? e.getValues() : e.value : void 0;
|
|
407
438
|
}
|
|
408
439
|
}
|
|
409
440
|
getValuesForJson(t) {
|
|
410
441
|
if (t === void 0) {
|
|
442
|
+
if (this.includeGetJson === !1) return null;
|
|
411
443
|
const e = {};
|
|
412
444
|
for (const i in this.settings)
|
|
413
|
-
if (
|
|
445
|
+
if (Object.prototype.hasOwnProperty.call(this.settings, i)) {
|
|
414
446
|
const s = this.settings[i];
|
|
415
|
-
s instanceof
|
|
447
|
+
s instanceof p ? e[i] = s.getValuesForJson() : s.includeGetJson === !1 ? e[i] = null : e[i] = s.value;
|
|
416
448
|
}
|
|
417
449
|
return e;
|
|
418
450
|
} else {
|
|
419
451
|
const e = this.settings[t];
|
|
420
|
-
return e ? e instanceof
|
|
452
|
+
return e ? e instanceof p ? e.includeGetJson === !1 ? null : e.getValuesForJson() : e.includeGetJson === !1 ? null : e.value : void 0;
|
|
421
453
|
}
|
|
422
454
|
}
|
|
423
455
|
getDefaultValues(t) {
|
|
424
456
|
if (t === void 0) {
|
|
425
457
|
const e = {};
|
|
426
458
|
for (const i in this.settings)
|
|
427
|
-
if (
|
|
459
|
+
if (Object.prototype.hasOwnProperty.call(this.settings, i)) {
|
|
428
460
|
const s = this.settings[i];
|
|
429
|
-
s instanceof
|
|
461
|
+
s instanceof p ? e[i] = s.getDefaultValues() : e[i] = s.default !== void 0 ? s.default : s.value;
|
|
430
462
|
}
|
|
431
463
|
return e;
|
|
432
464
|
} else {
|
|
433
465
|
const e = this.settings[t];
|
|
434
|
-
return e ? e instanceof
|
|
466
|
+
return e ? e instanceof p ? e.getDefaultValues() : e.default !== void 0 ? e.default : e.value : void 0;
|
|
435
467
|
}
|
|
436
468
|
}
|
|
437
469
|
getMobileValues(t) {
|
|
438
470
|
if (t === void 0) {
|
|
439
471
|
const e = {};
|
|
440
472
|
for (const i in this.settings)
|
|
441
|
-
if (
|
|
473
|
+
if (Object.prototype.hasOwnProperty.call(this.settings, i)) {
|
|
442
474
|
const s = this.settings[i];
|
|
443
|
-
if (s instanceof
|
|
475
|
+
if (s instanceof p)
|
|
444
476
|
e[i] = s.getMobileValues();
|
|
445
477
|
else if (typeof s.getMobileValue == "function") {
|
|
446
478
|
const n = s.getMobileValue();
|
|
@@ -452,19 +484,18 @@ const g = class g {
|
|
|
452
484
|
} else {
|
|
453
485
|
const e = this.settings[t];
|
|
454
486
|
if (!e) return;
|
|
455
|
-
if (e instanceof
|
|
456
|
-
return e.getMobileValues();
|
|
487
|
+
if (e instanceof p) return e.getMobileValues();
|
|
457
488
|
if (typeof e.getMobileValue == "function") {
|
|
458
489
|
const i = e.getMobileValue();
|
|
459
490
|
return i !== void 0 ? i : e.value;
|
|
460
|
-
}
|
|
461
|
-
|
|
491
|
+
}
|
|
492
|
+
return e.value;
|
|
462
493
|
}
|
|
463
494
|
}
|
|
464
495
|
setMobileValues(t) {
|
|
465
496
|
if (!(!t || typeof t != "object") && (Object.entries(t).forEach(([e, i]) => {
|
|
466
497
|
const s = this.settings[e];
|
|
467
|
-
s && (s instanceof
|
|
498
|
+
s && (s instanceof p ? typeof i == "object" && i !== null && s.setMobileValues(i) : typeof s.setMobileValue == "function" && s.setMobileValue(i));
|
|
468
499
|
}), this.setValue(t), this.onChange)) {
|
|
469
500
|
const e = this.getValues();
|
|
470
501
|
this.onChange(e);
|
|
@@ -479,7 +510,7 @@ const g = class g {
|
|
|
479
510
|
}
|
|
480
511
|
draw() {
|
|
481
512
|
const t = document.createElement("div");
|
|
482
|
-
t.className = "setting-group", t.id = `setting-group-${this.id}`,
|
|
513
|
+
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"), b(t, this.nestingLevel);
|
|
483
514
|
const e = document.createElement("div");
|
|
484
515
|
e.className = "setting-group-title", this.isCollapsed && e.classList.add("collapsed-view"), e.setAttribute("role", "button"), e.setAttribute(
|
|
485
516
|
"aria-expanded",
|
|
@@ -497,28 +528,28 @@ const g = class g {
|
|
|
497
528
|
const r = document.createElement("span");
|
|
498
529
|
r.className = "info-marker", r.innerHTML = `
|
|
499
530
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
500
|
-
<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"
|
|
531
|
+
<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"
|
|
501
532
|
stroke="currentColor" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>
|
|
502
533
|
</svg>
|
|
503
534
|
`, r.title = this.description, n.appendChild(r);
|
|
504
535
|
}
|
|
505
|
-
const
|
|
506
|
-
|
|
536
|
+
const a = document.createElement("span");
|
|
537
|
+
a.className = "setting-group-arrow", a.innerHTML = `
|
|
507
538
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
508
539
|
<path d="M4 6L8 10L12 6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
509
540
|
</svg>
|
|
510
|
-
`, this.isCollapsed &&
|
|
511
|
-
const
|
|
512
|
-
if (
|
|
541
|
+
`, this.isCollapsed && a.classList.add("rotated"), n.appendChild(a);
|
|
542
|
+
const o = document.createElement("div");
|
|
543
|
+
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) {
|
|
513
544
|
const r = document.createElement("div");
|
|
514
|
-
r.className = "setting-group-description", r.textContent = this.description,
|
|
545
|
+
r.className = "setting-group-description", r.textContent = this.description, o.appendChild(r);
|
|
515
546
|
}
|
|
516
547
|
const l = () => {
|
|
517
|
-
this.isCollapsed = !this.isCollapsed,
|
|
548
|
+
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(
|
|
518
549
|
"aria-expanded",
|
|
519
550
|
(!this.isCollapsed).toString()
|
|
520
551
|
);
|
|
521
|
-
const r =
|
|
552
|
+
const r = o.querySelector(
|
|
522
553
|
".setting-group-description"
|
|
523
554
|
), d = n.querySelector(".info-marker");
|
|
524
555
|
if (this.description)
|
|
@@ -527,17 +558,17 @@ const g = class g {
|
|
|
527
558
|
const u = document.createElement("span");
|
|
528
559
|
u.className = "info-marker", u.innerHTML = `
|
|
529
560
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
530
|
-
<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"
|
|
561
|
+
<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"
|
|
531
562
|
stroke="currentColor" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>
|
|
532
563
|
</svg>
|
|
533
|
-
`, u.title = this.description, n.insertBefore(u,
|
|
564
|
+
`, u.title = this.description, n.insertBefore(u, a);
|
|
534
565
|
}
|
|
535
566
|
} else {
|
|
536
567
|
if (!r) {
|
|
537
568
|
const u = document.createElement("div");
|
|
538
|
-
u.className = "setting-group-description", u.textContent = this.description,
|
|
569
|
+
u.className = "setting-group-description", u.textContent = this.description, o.insertBefore(
|
|
539
570
|
u,
|
|
540
|
-
|
|
571
|
+
o.firstChild
|
|
541
572
|
);
|
|
542
573
|
}
|
|
543
574
|
d && d.remove();
|
|
@@ -547,15 +578,30 @@ const g = class g {
|
|
|
547
578
|
(r.key === "Enter" || r.key === " ") && (r.preventDefault(), l());
|
|
548
579
|
}, Object.keys(this.settings).length > 0) {
|
|
549
580
|
for (const r in this.settings)
|
|
550
|
-
if (
|
|
581
|
+
if (Object.prototype.hasOwnProperty.call(this.settings, r)) {
|
|
551
582
|
const d = this.settings[r];
|
|
552
|
-
d instanceof
|
|
583
|
+
d instanceof p && d.setNestingLevel(this.nestingLevel + 1), o.appendChild(d.draw());
|
|
553
584
|
}
|
|
554
585
|
} else {
|
|
555
586
|
const r = document.createElement("div");
|
|
556
|
-
r.className = "setting-group-empty", r.textContent = "No settings in this group",
|
|
587
|
+
r.className = "setting-group-empty", r.textContent = "No settings in this group", o.appendChild(r);
|
|
588
|
+
}
|
|
589
|
+
if (this.addItemCfg) {
|
|
590
|
+
const r = document.createElement("button");
|
|
591
|
+
r.type = "button", r.className = "sg-add-button-bottom", r.style.marginTop = "8px";
|
|
592
|
+
const d = this.addItemCfg.buttonIconSvg ?? `
|
|
593
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none"
|
|
594
|
+
xmlns="http://www.w3.org/2000/svg">
|
|
595
|
+
<path d="M8 3.333v9.334M3.333 8h9.334" stroke="currentColor"
|
|
596
|
+
stroke-width="1.5" stroke-linecap="round"/>
|
|
597
|
+
</svg>`;
|
|
598
|
+
r.innerHTML = `${d}<span style="margin-left:4px;">${this.addItemCfg.buttonLabel ?? "Add"}</span>`, r.addEventListener("click", (u) => {
|
|
599
|
+
u.stopPropagation(), u.preventDefault();
|
|
600
|
+
const V = this.getNextIndexFromPrefix(this.addItemCfg.keyPrefix), x = this.addItemCfg.createItem(V), S = `${this.addItemCfg.keyPrefix}${V}`;
|
|
601
|
+
this.addSetting(S, x), this.addItemCfg.expandNewItem !== !1 && x.expand && x.expand();
|
|
602
|
+
}), o.appendChild(r);
|
|
557
603
|
}
|
|
558
|
-
return e.appendChild(i), e.appendChild(n), t.appendChild(e), t.appendChild(
|
|
604
|
+
return e.appendChild(i), e.appendChild(n), t.appendChild(e), t.appendChild(o), this.elementRef = t, N.trackElement(t), setTimeout(() => {
|
|
559
605
|
this.updateNestingStyles();
|
|
560
606
|
}, 0), this.pendingBlurHandler && (this.setupBlurHandlers(), this.pendingBlurHandler = null), t;
|
|
561
607
|
}
|
|
@@ -592,10 +638,10 @@ const g = class g {
|
|
|
592
638
|
let i = e;
|
|
593
639
|
const s = Object.keys(this.settings), n = Object.keys(e);
|
|
594
640
|
if (!s.some(
|
|
595
|
-
(
|
|
641
|
+
(o) => n.includes(o)
|
|
596
642
|
) && n.length === 1) {
|
|
597
|
-
const
|
|
598
|
-
i = e[
|
|
643
|
+
const o = n[0];
|
|
644
|
+
i = e[o];
|
|
599
645
|
}
|
|
600
646
|
this.setValue(i);
|
|
601
647
|
} catch (e) {
|
|
@@ -603,9 +649,9 @@ const g = class g {
|
|
|
603
649
|
}
|
|
604
650
|
}
|
|
605
651
|
};
|
|
606
|
-
|
|
607
|
-
let f =
|
|
608
|
-
class
|
|
652
|
+
p.hiddenElements = /* @__PURE__ */ new Set();
|
|
653
|
+
let f = p;
|
|
654
|
+
class pt extends f {
|
|
609
655
|
constructor(t) {
|
|
610
656
|
super(t);
|
|
611
657
|
const e = Object.keys(this.settings)[0];
|
|
@@ -639,28 +685,28 @@ class ct extends f {
|
|
|
639
685
|
s.textContent = this.title, i.appendChild(s);
|
|
640
686
|
const n = document.createElement("div");
|
|
641
687
|
n.className = "tabs-header", this.tabsContainer = n;
|
|
642
|
-
const
|
|
643
|
-
if (
|
|
688
|
+
const a = document.createElement("div");
|
|
689
|
+
if (a.className = "tab-content", this.contentContainers = {}, Object.keys(this.settings).forEach((o, l) => {
|
|
644
690
|
const h = document.createElement("button");
|
|
645
|
-
h.className = "tab-button", h.type = "button", h.setAttribute("data-tab-id",
|
|
691
|
+
h.className = "tab-button", h.type = "button", h.setAttribute("data-tab-id", o), h.textContent = o, h.addEventListener("click", () => this.switchToTab(o)), n.appendChild(h);
|
|
646
692
|
const r = document.createElement("div");
|
|
647
|
-
r.className = "tab-panel", this.contentContainers[
|
|
648
|
-
const d = this.settings[
|
|
649
|
-
d && (d instanceof f && d.setNestingLevel(this.getNestingLevel() + 1), r.appendChild(d.draw())),
|
|
650
|
-
}), e.appendChild(i), e.appendChild(n), e.appendChild(
|
|
651
|
-
const
|
|
652
|
-
this.activeTabId =
|
|
693
|
+
r.className = "tab-panel", this.contentContainers[o] = r;
|
|
694
|
+
const d = this.settings[o];
|
|
695
|
+
d && (d instanceof f && d.setNestingLevel(this.getNestingLevel() + 1), r.appendChild(d.draw())), a.appendChild(r), l === 0 && !this.activeTabId && (this.activeTabId = o);
|
|
696
|
+
}), e.appendChild(i), e.appendChild(n), e.appendChild(a), !this.activeTabId) {
|
|
697
|
+
const o = Object.keys(this.settings)[0];
|
|
698
|
+
this.activeTabId = o || "";
|
|
653
699
|
}
|
|
654
700
|
return this.updateTabUI(), t;
|
|
655
701
|
}
|
|
656
702
|
}
|
|
657
|
-
function
|
|
703
|
+
function R(c) {
|
|
658
704
|
return new f(c);
|
|
659
705
|
}
|
|
660
|
-
function
|
|
706
|
+
function gt(c) {
|
|
661
707
|
return c;
|
|
662
708
|
}
|
|
663
|
-
class
|
|
709
|
+
class $ extends g {
|
|
664
710
|
constructor(t = {}) {
|
|
665
711
|
super(t), this.inputType = "text", t.onChange && this.setOnChange(t.onChange);
|
|
666
712
|
}
|
|
@@ -680,12 +726,12 @@ class B extends p {
|
|
|
680
726
|
});
|
|
681
727
|
}
|
|
682
728
|
}
|
|
683
|
-
const
|
|
684
|
-
class m extends
|
|
729
|
+
const F = "<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>";
|
|
730
|
+
class m extends $ {
|
|
685
731
|
constructor(t) {
|
|
686
732
|
super({
|
|
687
733
|
...t,
|
|
688
|
-
icon: t.icon ||
|
|
734
|
+
icon: t.icon || F,
|
|
689
735
|
title: t.title || "Color",
|
|
690
736
|
default: t.default ? m.normalizeColorValue(t.default) : "#000000"
|
|
691
737
|
}), this.inputType = "color", this.element = null, this.colorInputEl = null, this.textInputEl = null, this.detectChange = t.detectChange;
|
|
@@ -700,11 +746,11 @@ class m extends B {
|
|
|
700
746
|
const e = t.split(",").map((r) => parseInt(r.trim()));
|
|
701
747
|
if (e.length !== 3 || e.some(isNaN))
|
|
702
748
|
return console.warn(`Invalid RGB value "${t}", using default "#000000"`), "#000000";
|
|
703
|
-
const [i, s, n] = e,
|
|
749
|
+
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)), h = (r) => {
|
|
704
750
|
const d = r.toString(16);
|
|
705
751
|
return d.length === 1 ? "0" + d : d;
|
|
706
752
|
};
|
|
707
|
-
return `#${h(
|
|
753
|
+
return `#${h(a)}${h(o)}${h(l)}`;
|
|
708
754
|
}
|
|
709
755
|
setValue(t) {
|
|
710
756
|
if (t === void 0) {
|
|
@@ -748,10 +794,10 @@ class m extends B {
|
|
|
748
794
|
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;
|
|
749
795
|
const n = document.createElement("div");
|
|
750
796
|
n.className = "color-preview";
|
|
751
|
-
const
|
|
752
|
-
n.style.backgroundColor =
|
|
753
|
-
const
|
|
754
|
-
return
|
|
797
|
+
const a = this.value || "#000000";
|
|
798
|
+
n.style.backgroundColor = a;
|
|
799
|
+
const o = document.createElement("input");
|
|
800
|
+
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) => {
|
|
755
801
|
var r, d;
|
|
756
802
|
let h = l.target.value.trim();
|
|
757
803
|
if (this.textInputEl && i(this.textInputEl)) {
|
|
@@ -766,7 +812,7 @@ class m extends B {
|
|
|
766
812
|
var d, u;
|
|
767
813
|
const h = l.target.value, r = m.normalizeColorValue(h);
|
|
768
814
|
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;
|
|
769
|
-
}), e.appendChild(s), e.appendChild(n), e.appendChild(
|
|
815
|
+
}), e.appendChild(s), e.appendChild(n), e.appendChild(o), t.appendChild(e), this.element = t, t;
|
|
770
816
|
}
|
|
771
817
|
getElement() {
|
|
772
818
|
return this.element;
|
|
@@ -784,17 +830,17 @@ class m extends B {
|
|
|
784
830
|
return this.isValidHex() ? this.hexToRgb(this.value) : "0, 0, 0";
|
|
785
831
|
}
|
|
786
832
|
}
|
|
787
|
-
const
|
|
833
|
+
const z = `
|
|
788
834
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
789
835
|
<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"/>
|
|
790
836
|
<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"/>
|
|
791
837
|
<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"/>
|
|
792
838
|
</svg>`;
|
|
793
|
-
class C extends
|
|
839
|
+
class C extends g {
|
|
794
840
|
constructor(t = {}) {
|
|
795
841
|
super({
|
|
796
842
|
...t,
|
|
797
|
-
icon: t.icon ||
|
|
843
|
+
icon: t.icon || z,
|
|
798
844
|
title: t.title || "Color & Opacity",
|
|
799
845
|
default: t.default || "#000000FF"
|
|
800
846
|
}), this.inputType = "color", this.element = null, this.colorInputEl = null, this.textInputEl = null, this.opacityInputEl = null, this.colorPreviewEl = null, this.detectChange = t.detectChange, this.value && (this.value = C.normalizeHexWithOpacity(this.value));
|
|
@@ -822,8 +868,8 @@ class C extends p {
|
|
|
822
868
|
}
|
|
823
869
|
updateColorPreview() {
|
|
824
870
|
if (!this.colorPreviewEl || !this.value) return;
|
|
825
|
-
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),
|
|
826
|
-
this.colorPreviewEl.style.backgroundColor = `rgba(${s}, ${n}, ${
|
|
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), a = parseInt(i.substring(4, 6), 16);
|
|
872
|
+
this.colorPreviewEl.style.backgroundColor = `rgba(${s}, ${n}, ${a}, ${e})`;
|
|
827
873
|
}
|
|
828
874
|
handleColorChange(t) {
|
|
829
875
|
const e = this.getOpacityPercent(), i = C.combineColorOpacity(t, e);
|
|
@@ -840,41 +886,41 @@ class C extends p {
|
|
|
840
886
|
draw() {
|
|
841
887
|
const t = document.createElement("div");
|
|
842
888
|
if (t.className = "color-with-opacity-setting-wrapper " + (this.props.wrapperClassName || ""), this.props.title || this.props.icon) {
|
|
843
|
-
const
|
|
844
|
-
if (
|
|
845
|
-
const
|
|
846
|
-
|
|
889
|
+
const a = document.createElement("div");
|
|
890
|
+
if (a.className = "icon-container", this.props.icon) {
|
|
891
|
+
const o = document.createElement("span");
|
|
892
|
+
o.className = "input-icon", o.innerHTML = this.props.icon, a.appendChild(o);
|
|
847
893
|
}
|
|
848
894
|
if (this.props.title) {
|
|
849
|
-
const
|
|
850
|
-
|
|
895
|
+
const o = document.createElement("span");
|
|
896
|
+
o.className = "input-label", o.textContent = this.props.title, a.appendChild(o);
|
|
851
897
|
}
|
|
852
|
-
t.appendChild(
|
|
898
|
+
t.appendChild(a);
|
|
853
899
|
}
|
|
854
900
|
const e = document.createElement("div");
|
|
855
|
-
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", (
|
|
856
|
-
const
|
|
857
|
-
this.handleColorChange(
|
|
858
|
-
}), this.textInputEl.addEventListener("input", (
|
|
859
|
-
const
|
|
860
|
-
this.handleTextInput(
|
|
861
|
-
}), this.textInputEl.addEventListener("blur", (
|
|
862
|
-
const
|
|
863
|
-
|
|
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", (a) => {
|
|
902
|
+
const o = a.target;
|
|
903
|
+
this.handleColorChange(o.value), this.textInputEl && (this.textInputEl.value = this.value || "#000000FF"), this.updateColorPreview();
|
|
904
|
+
}), this.textInputEl.addEventListener("input", (a) => {
|
|
905
|
+
const o = a.target;
|
|
906
|
+
this.handleTextInput(o.value) ? (this.colorInputEl && (this.colorInputEl.value = this.getRgbColor()), this.updateColorPreview(), e.classList.remove("error")) : o.value.trim() === "" ? e.classList.remove("error") : e.classList.add("error");
|
|
907
|
+
}), this.textInputEl.addEventListener("blur", (a) => {
|
|
908
|
+
const o = a.target;
|
|
909
|
+
o.value.trim() === "" && (o.value = this.value || "#000000FF", e.classList.remove("error"));
|
|
864
910
|
}), this.colorPreviewEl.addEventListener("click", () => {
|
|
865
|
-
var
|
|
866
|
-
(
|
|
911
|
+
var a;
|
|
912
|
+
(a = this.colorInputEl) == null || a.click();
|
|
867
913
|
}), e.appendChild(this.colorInputEl), e.appendChild(this.colorPreviewEl), e.appendChild(this.textInputEl);
|
|
868
914
|
const i = document.createElement("div");
|
|
869
915
|
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";
|
|
870
916
|
const s = document.createElement("span");
|
|
871
|
-
s.className = "color-with-opacity-opacity-suffix", s.textContent = "%", this.opacityInputEl.addEventListener("input", (
|
|
872
|
-
const
|
|
917
|
+
s.className = "color-with-opacity-opacity-suffix", s.textContent = "%", this.opacityInputEl.addEventListener("input", (a) => {
|
|
918
|
+
const o = a.target, l = parseFloat(o.value);
|
|
873
919
|
isNaN(l) || (this.handleOpacityChange(l), this.textInputEl && (this.textInputEl.value = this.value || "#000000FF"), this.updateColorPreview());
|
|
874
|
-
}), this.opacityInputEl.addEventListener("blur", (
|
|
875
|
-
const
|
|
876
|
-
let l = parseFloat(
|
|
877
|
-
isNaN(l) && (l = this.getOpacityPercent()), l = Math.max(0, Math.min(100, l)),
|
|
920
|
+
}), this.opacityInputEl.addEventListener("blur", (a) => {
|
|
921
|
+
const o = a.target;
|
|
922
|
+
let l = parseFloat(o.value);
|
|
923
|
+
isNaN(l) && (l = this.getOpacityPercent()), l = Math.max(0, Math.min(100, l)), o.value = l.toString(), this.handleOpacityChange(l), this.textInputEl && (this.textInputEl.value = this.value || "#000000FF"), this.updateColorPreview();
|
|
878
924
|
}), i.appendChild(this.opacityInputEl), i.appendChild(s);
|
|
879
925
|
const n = document.createElement("div");
|
|
880
926
|
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;
|
|
@@ -887,8 +933,8 @@ class C extends p {
|
|
|
887
933
|
}
|
|
888
934
|
getRgbaValue() {
|
|
889
935
|
if (!this.value) return "rgba(0, 0, 0, 1)";
|
|
890
|
-
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),
|
|
891
|
-
return `rgba(${s}, ${n}, ${
|
|
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), a = parseInt(i.substring(4, 6), 16);
|
|
937
|
+
return `rgba(${s}, ${n}, ${a}, ${e})`;
|
|
892
938
|
}
|
|
893
939
|
getColorAndOpacity() {
|
|
894
940
|
return {
|
|
@@ -897,7 +943,7 @@ class C extends p {
|
|
|
897
943
|
};
|
|
898
944
|
}
|
|
899
945
|
}
|
|
900
|
-
class
|
|
946
|
+
class mt extends g {
|
|
901
947
|
constructor(t = {}) {
|
|
902
948
|
super(t), this.inputType = "text", t.onChange && this.setOnChange(t.onChange);
|
|
903
949
|
}
|
|
@@ -909,27 +955,27 @@ class ut extends p {
|
|
|
909
955
|
if (t.className = "html-setting-wrapper " + (this.props.wrapperClassName || ""), this.props.title || this.props.icon) {
|
|
910
956
|
const n = document.createElement("div");
|
|
911
957
|
if (n.className = "icon-container", this.props.icon) {
|
|
912
|
-
const
|
|
913
|
-
n.appendChild(
|
|
958
|
+
const a = this.createIcon(this.props.icon);
|
|
959
|
+
n.appendChild(a);
|
|
914
960
|
}
|
|
915
961
|
if (this.props.title) {
|
|
916
|
-
const
|
|
917
|
-
n.appendChild(
|
|
962
|
+
const a = this.createLabel(this.props.title);
|
|
963
|
+
n.appendChild(a);
|
|
918
964
|
}
|
|
919
965
|
t.appendChild(n);
|
|
920
966
|
}
|
|
921
967
|
const e = document.createElement("textarea");
|
|
922
968
|
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);
|
|
923
969
|
const i = (n) => {
|
|
924
|
-
const
|
|
925
|
-
this.value =
|
|
970
|
+
const o = n.target.value;
|
|
971
|
+
this.value = o, this.onChange && this.onChange(this.value), this.props.detectChange && this.props.detectChange(this.value);
|
|
926
972
|
}, s = (n) => {
|
|
927
973
|
this.onBlur && this.value !== void 0 && this.onBlur(this.value);
|
|
928
974
|
};
|
|
929
975
|
return e.addEventListener("input", i), e.addEventListener("change", i), e.addEventListener("blur", s), t.appendChild(e), t;
|
|
930
976
|
}
|
|
931
977
|
}
|
|
932
|
-
class v extends
|
|
978
|
+
class v extends g {
|
|
933
979
|
constructor(t) {
|
|
934
980
|
super(t), this.inputType = "number", this.inputElement = null, this.mobileValue = t.mobile, this.validateProps(), this.value = this.validateValue(this.value);
|
|
935
981
|
}
|
|
@@ -952,12 +998,12 @@ class v extends p {
|
|
|
952
998
|
const i = document.createElement("input");
|
|
953
999
|
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", () => {
|
|
954
1000
|
const s = this.props.minValue ?? Number.MIN_SAFE_INTEGER, n = this.props.maxValue ?? Number.MAX_SAFE_INTEGER;
|
|
955
|
-
let
|
|
956
|
-
|
|
1001
|
+
let a = Number(i.value);
|
|
1002
|
+
a < s && (a = s), a > n && (a = n), String(a) !== i.value && (i.value = String(a)), this.setValue(a);
|
|
957
1003
|
}), i.addEventListener("blur", () => {
|
|
958
|
-
var n,
|
|
1004
|
+
var n, a;
|
|
959
1005
|
const s = this.validateValue(Number(i.value));
|
|
960
|
-
s !== Number(i.value) && (i.value = String(s), this.setValue(s)), (
|
|
1006
|
+
s !== Number(i.value) && (i.value = String(s), this.setValue(s)), (a = (n = this.props).onBlur) == null || a.call(n);
|
|
961
1007
|
}), e.appendChild(i), this.props.suffix && this.props.suffix !== "none") {
|
|
962
1008
|
const s = document.createElement("span");
|
|
963
1009
|
s.className = "suffix-label", s.textContent = this.props.suffix, e.appendChild(s);
|
|
@@ -988,12 +1034,12 @@ class v extends p {
|
|
|
988
1034
|
);
|
|
989
1035
|
}
|
|
990
1036
|
}
|
|
991
|
-
const
|
|
1037
|
+
const G = `
|
|
992
1038
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
993
1039
|
<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"/>
|
|
994
1040
|
<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"/>
|
|
995
1041
|
</svg>`;
|
|
996
|
-
class
|
|
1042
|
+
class j extends v {
|
|
997
1043
|
constructor(t = {}) {
|
|
998
1044
|
const e = {
|
|
999
1045
|
title: "Opacity",
|
|
@@ -1002,7 +1048,7 @@ class F extends v {
|
|
|
1002
1048
|
maxValue: 100,
|
|
1003
1049
|
step: 1,
|
|
1004
1050
|
default: t.default ?? 100,
|
|
1005
|
-
icon:
|
|
1051
|
+
icon: G,
|
|
1006
1052
|
...t
|
|
1007
1053
|
};
|
|
1008
1054
|
super(e), this.inputType = "number", this.mobileValue = t.mobile;
|
|
@@ -1014,12 +1060,12 @@ class F extends v {
|
|
|
1014
1060
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
1015
1061
|
}
|
|
1016
1062
|
}
|
|
1017
|
-
const
|
|
1063
|
+
const P = `
|
|
1018
1064
|
<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">
|
|
1019
1065
|
<polyline points="6 9 12 15 18 9"></polyline>
|
|
1020
1066
|
</svg>
|
|
1021
1067
|
`;
|
|
1022
|
-
class
|
|
1068
|
+
class k extends g {
|
|
1023
1069
|
constructor(t = {}) {
|
|
1024
1070
|
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) {
|
|
1025
1071
|
const e = this._options.findIndex((i) => i.value === this.value);
|
|
@@ -1040,12 +1086,12 @@ class y extends p {
|
|
|
1040
1086
|
if (t.classList.add("select-container"), this.container = t, this.props.icon || this.props.title) {
|
|
1041
1087
|
const n = document.createElement("div");
|
|
1042
1088
|
if (n.className = "icon-container", this.props.icon) {
|
|
1043
|
-
const
|
|
1044
|
-
n.appendChild(
|
|
1089
|
+
const a = this.createIcon(this.props.icon);
|
|
1090
|
+
n.appendChild(a);
|
|
1045
1091
|
}
|
|
1046
1092
|
if (this.props.title) {
|
|
1047
|
-
const
|
|
1048
|
-
n.appendChild(
|
|
1093
|
+
const a = this.createLabel(this.props.title);
|
|
1094
|
+
n.appendChild(a);
|
|
1049
1095
|
}
|
|
1050
1096
|
t.appendChild(n);
|
|
1051
1097
|
} else {
|
|
@@ -1054,22 +1100,22 @@ class y extends p {
|
|
|
1054
1100
|
}
|
|
1055
1101
|
const e = document.createElement("div");
|
|
1056
1102
|
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 = () => {
|
|
1057
|
-
var n,
|
|
1058
|
-
this.isLoading || (this.isOpen = !this.isOpen, this.isOpen ? this.checkDropdownPosition() : this.cleanupDropdownPosition(), (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (
|
|
1103
|
+
var n, a;
|
|
1104
|
+
this.isLoading || (this.isOpen = !this.isOpen, this.isOpen ? this.checkDropdownPosition() : this.cleanupDropdownPosition(), (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (a = this.svgContainer) == null || a.classList.toggle("open", this.isOpen));
|
|
1059
1105
|
}, t.appendChild(e), this.buttonEl = e;
|
|
1060
1106
|
const i = document.createElement("ul");
|
|
1061
|
-
i.classList.add("select-options"), this._options.forEach((n,
|
|
1062
|
-
const
|
|
1063
|
-
|
|
1107
|
+
i.classList.add("select-options"), this._options.forEach((n, a) => {
|
|
1108
|
+
const o = this.createOption(n, a);
|
|
1109
|
+
o.onclick = (l) => this.selectOption(l, a, e), i.appendChild(o);
|
|
1064
1110
|
}), document.body.appendChild(i);
|
|
1065
1111
|
const s = document.createElement("div");
|
|
1066
|
-
return s.classList.add("svg-container"), s.innerHTML =
|
|
1112
|
+
return s.classList.add("svg-container"), s.innerHTML = P, t.appendChild(s), this.optionsListEl = i, this.svgContainer = s, this.props.getOptionsAsync && (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((n) => {
|
|
1067
1113
|
this._options.push(...n), this.isLoading = !1, this.updateOptionsList(), this.updateButtonText();
|
|
1068
1114
|
}).catch((n) => {
|
|
1069
1115
|
console.error("Failed to fetch async options:", n), this.isLoading = !1, this.updateButtonText("Failed to load options");
|
|
1070
1116
|
})), this.clickOutsideListener && document.removeEventListener("click", this.clickOutsideListener), this.clickOutsideListener = (n) => {
|
|
1071
|
-
var
|
|
1072
|
-
this.isOpen && !t.contains(n.target) && (this.isOpen = !1, (
|
|
1117
|
+
var a, o;
|
|
1118
|
+
this.isOpen && !t.contains(n.target) && (this.isOpen = !1, (a = this.optionsListEl) == null || a.classList.remove("open"), (o = this.svgContainer) == null || o.classList.remove("open"), this.cleanupDropdownPosition());
|
|
1073
1119
|
}, document.addEventListener("click", this.clickOutsideListener), this.resizeListener && window.removeEventListener("resize", this.resizeListener), this.resizeListener = () => {
|
|
1074
1120
|
this.isOpen && this.checkDropdownPosition();
|
|
1075
1121
|
}, window.addEventListener("resize", this.resizeListener), t;
|
|
@@ -1091,9 +1137,9 @@ class y extends p {
|
|
|
1091
1137
|
}
|
|
1092
1138
|
}
|
|
1093
1139
|
selectOption(t, e, i) {
|
|
1094
|
-
var n,
|
|
1140
|
+
var n, a, o;
|
|
1095
1141
|
const s = this._options[e];
|
|
1096
|
-
s && (this.value = s.value, (n = this.onChange) == null || n.call(this, this.value), this.selectedOptionIndex = e, this.isOpen = !1, i.textContent = s.name, (
|
|
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, (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((h, r) => {
|
|
1097
1143
|
r === e ? h.classList.add("selected") : h.classList.remove("selected");
|
|
1098
1144
|
}));
|
|
1099
1145
|
}
|
|
@@ -1132,7 +1178,7 @@ class y extends p {
|
|
|
1132
1178
|
this.clickOutsideListener && (document.removeEventListener("click", this.clickOutsideListener), this.clickOutsideListener = null), this.resizeListener && (window.removeEventListener("resize", this.resizeListener), this.resizeListener = null), this.cleanupDropdownPosition(), this.optionsListEl && this.optionsListEl.parentNode && this.optionsListEl.parentNode.removeChild(this.optionsListEl), super.destroy();
|
|
1133
1179
|
}
|
|
1134
1180
|
}
|
|
1135
|
-
class
|
|
1181
|
+
class W extends g {
|
|
1136
1182
|
constructor(t = {}) {
|
|
1137
1183
|
super(t), this.inputType = "button", this.value || (this.value = "center");
|
|
1138
1184
|
}
|
|
@@ -1177,15 +1223,15 @@ class G extends p {
|
|
|
1177
1223
|
`
|
|
1178
1224
|
}
|
|
1179
1225
|
].forEach((n) => {
|
|
1180
|
-
const
|
|
1181
|
-
|
|
1182
|
-
var
|
|
1183
|
-
i.querySelectorAll(".align-option-button").forEach((l) => l.classList.remove("selected")),
|
|
1184
|
-
}), i.appendChild(
|
|
1226
|
+
const a = document.createElement("button");
|
|
1227
|
+
a.className = "align-option-button", a.innerHTML = n.icon, this.value === n.name && a.classList.add("selected"), a.addEventListener("click", () => {
|
|
1228
|
+
var o;
|
|
1229
|
+
i.querySelectorAll(".align-option-button").forEach((l) => l.classList.remove("selected")), a.classList.add("selected"), this.value = n.name, (o = this.onChange) == null || o.call(this, this.value);
|
|
1230
|
+
}), i.appendChild(a);
|
|
1185
1231
|
}), t.appendChild(i), t;
|
|
1186
1232
|
}
|
|
1187
1233
|
}
|
|
1188
|
-
class
|
|
1234
|
+
class ft extends g {
|
|
1189
1235
|
constructor(t) {
|
|
1190
1236
|
super(t), this.inputType = "button", this.bgWithAlpha = "rgba(145, 158, 171, 0.08)";
|
|
1191
1237
|
}
|
|
@@ -1199,22 +1245,22 @@ class pt extends p {
|
|
|
1199
1245
|
/^rgba\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)$/i
|
|
1200
1246
|
);
|
|
1201
1247
|
if (n) {
|
|
1202
|
-
let
|
|
1203
|
-
r >= 1 ? (
|
|
1248
|
+
let o = +n[1], l = +n[2], h = +n[3], r = +n[4];
|
|
1249
|
+
r >= 1 ? (o = Math.round(o * 0.9), l = Math.round(l * 0.9), h = Math.round(h * 0.9)) : r = Math.min(1, r + 0.12), s = `rgba(${o},${l},${h},${r})`;
|
|
1204
1250
|
}
|
|
1205
1251
|
t.addEventListener("mouseenter", () => {
|
|
1206
1252
|
console.log("hoverBg", s), t.style.setProperty("background-color", s, "important");
|
|
1207
1253
|
}), t.addEventListener("mouseleave", () => {
|
|
1208
1254
|
t.style.setProperty("background-color", e, "important");
|
|
1209
1255
|
}), t.addEventListener("click", () => {
|
|
1210
|
-
var
|
|
1211
|
-
return (l = (
|
|
1256
|
+
var o, l;
|
|
1257
|
+
return (l = (o = this.props).onClick) == null ? void 0 : l.call(o);
|
|
1212
1258
|
});
|
|
1213
|
-
const
|
|
1214
|
-
return
|
|
1259
|
+
const a = document.createElement("div");
|
|
1260
|
+
return a.className = "button-setting-wrapper " + (this.props.wrapperClassName || ""), a.appendChild(t), a;
|
|
1215
1261
|
}
|
|
1216
1262
|
}
|
|
1217
|
-
class
|
|
1263
|
+
class vt extends g {
|
|
1218
1264
|
constructor(t = {}) {
|
|
1219
1265
|
super(t), this.inputType = { width: "number", height: "number" }, this.aspectRatio = 1, this.isUpdating = !1;
|
|
1220
1266
|
const e = t.width || 0, i = t.height || 0;
|
|
@@ -1227,14 +1273,14 @@ class gt extends p {
|
|
|
1227
1273
|
suffix: "px",
|
|
1228
1274
|
minValue: this.minWidth,
|
|
1229
1275
|
maxValue: this.maxWidth,
|
|
1230
|
-
icon:
|
|
1276
|
+
icon: D
|
|
1231
1277
|
}), this.heightSetting = new v({
|
|
1232
1278
|
title: "Height",
|
|
1233
1279
|
default: this.value.height,
|
|
1234
1280
|
suffix: "px",
|
|
1235
1281
|
minValue: this.minHeight,
|
|
1236
1282
|
maxValue: this.maxHeight,
|
|
1237
|
-
icon:
|
|
1283
|
+
icon: J
|
|
1238
1284
|
}), this.widthSetting.setOnChange(this.handleWidthChange.bind(this)), this.heightSetting.setOnChange(this.handleHeightChange.bind(this));
|
|
1239
1285
|
}
|
|
1240
1286
|
handleWidthChange(t) {
|
|
@@ -1304,8 +1350,8 @@ class gt extends p {
|
|
|
1304
1350
|
return n.className = "dimension-lock-icon", n.setAttribute("type", "button"), n.setAttribute("aria-pressed", String(this.locked)), n.setAttribute(
|
|
1305
1351
|
"aria-label",
|
|
1306
1352
|
this.locked ? "Unlock aspect ratio" : "Lock aspect ratio"
|
|
1307
|
-
), n.title = this.locked ? "Unlock aspect ratio" : "Lock aspect ratio", n.innerHTML = this.getLockSVG(this.locked), n.onclick = (
|
|
1308
|
-
|
|
1353
|
+
), n.title = this.locked ? "Unlock aspect ratio" : "Lock aspect ratio", n.innerHTML = this.getLockSVG(this.locked), n.onclick = (a) => {
|
|
1354
|
+
a.preventDefault(), this.toggleLock(n);
|
|
1309
1355
|
}, s.appendChild(n), t.appendChild(e), t.appendChild(s), t.appendChild(i), t;
|
|
1310
1356
|
}
|
|
1311
1357
|
isLocked() {
|
|
@@ -1328,24 +1374,24 @@ class gt extends p {
|
|
|
1328
1374
|
}
|
|
1329
1375
|
}
|
|
1330
1376
|
}
|
|
1331
|
-
const
|
|
1377
|
+
const D = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1332
1378
|
<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"/>
|
|
1333
|
-
</svg>`,
|
|
1379
|
+
</svg>`, J = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1334
1380
|
<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"/>
|
|
1335
|
-
</svg>`,
|
|
1381
|
+
</svg>`, y = `
|
|
1336
1382
|
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="16" viewBox="0 0 15 16" fill="none">
|
|
1337
1383
|
<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"/>
|
|
1338
1384
|
</svg>
|
|
1339
|
-
`,
|
|
1385
|
+
`, U = `
|
|
1340
1386
|
<svg width="91" height="71" viewBox="0 0 91 71" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1341
1387
|
<rect width="91" height="71" rx="4" fill="#F2F4F7"/>
|
|
1342
1388
|
<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"/>
|
|
1343
1389
|
</svg>
|
|
1344
|
-
`,
|
|
1390
|
+
`, _ = `
|
|
1345
1391
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 12 12" fill="none">
|
|
1346
1392
|
<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"/>
|
|
1347
1393
|
</svg>
|
|
1348
|
-
`,
|
|
1394
|
+
`, q = `
|
|
1349
1395
|
<svg xmlns="http://www.w3.org/2000/svg" width="29" height="29" viewBox="0 0 29 29" fill="none">
|
|
1350
1396
|
<!-- Top dot -->
|
|
1351
1397
|
<circle cx="14.5" cy="3" r="1.5" fill="#02CC59" opacity="1"/>
|
|
@@ -1365,7 +1411,7 @@ const P = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBo
|
|
|
1365
1411
|
<circle cx="6.7" cy="6.7" r="1.5" fill="#02CC59" opacity="0.3"/>
|
|
1366
1412
|
</svg>
|
|
1367
1413
|
`;
|
|
1368
|
-
class
|
|
1414
|
+
class Z extends g {
|
|
1369
1415
|
constructor(t = {}) {
|
|
1370
1416
|
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();
|
|
1371
1417
|
}
|
|
@@ -1415,18 +1461,18 @@ class U extends p {
|
|
|
1415
1461
|
);
|
|
1416
1462
|
if (t && t !== "") {
|
|
1417
1463
|
this.showLoading(), s && s instanceof HTMLElement && (s.style.display = "none"), e && e.classList.remove("no-image"), i && (i.innerHTML = `
|
|
1418
|
-
<span class="upload-icon">${
|
|
1464
|
+
<span class="upload-icon">${y}</span>
|
|
1419
1465
|
<span class="upload-label">Replace</span>
|
|
1420
1466
|
`);
|
|
1421
1467
|
const n = () => {
|
|
1422
|
-
this.hideLoading(), this.previewWrapper.classList.add("has-image"), this.previewEl.style.display = "block", this.previewEl.removeEventListener("load", n), this.previewEl.removeEventListener("error",
|
|
1423
|
-
},
|
|
1424
|
-
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",
|
|
1468
|
+
this.hideLoading(), this.previewWrapper.classList.add("has-image"), this.previewEl.style.display = "block", this.previewEl.removeEventListener("load", n), this.previewEl.removeEventListener("error", a);
|
|
1469
|
+
}, a = () => {
|
|
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", a);
|
|
1425
1471
|
};
|
|
1426
|
-
this.previewEl.addEventListener("load", n), this.previewEl.addEventListener("error",
|
|
1472
|
+
this.previewEl.addEventListener("load", n), this.previewEl.addEventListener("error", a), this.previewEl.src = t;
|
|
1427
1473
|
} else
|
|
1428
1474
|
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 = `
|
|
1429
|
-
<span class="upload-icon">${
|
|
1475
|
+
<span class="upload-icon">${y}</span>
|
|
1430
1476
|
<span class="upload-label">Upload</span>
|
|
1431
1477
|
`);
|
|
1432
1478
|
}
|
|
@@ -1434,24 +1480,24 @@ class U extends p {
|
|
|
1434
1480
|
const t = document.createElement("div");
|
|
1435
1481
|
t.className = "upload-setting-wrapper", t.setAttribute("data-setting-id", this.id), t.addEventListener(
|
|
1436
1482
|
"focusout",
|
|
1437
|
-
(
|
|
1483
|
+
(o) => {
|
|
1438
1484
|
var l;
|
|
1439
|
-
|
|
1485
|
+
o.relatedTarget && t.contains(o.relatedTarget) || (l = this.onBlur) == null || l.call(this, this.value ?? "");
|
|
1440
1486
|
},
|
|
1441
1487
|
!0
|
|
1442
1488
|
);
|
|
1443
1489
|
const e = !!(this.props.title || this.props.icon);
|
|
1444
1490
|
if (e || t.classList.add("no-label"), e) {
|
|
1445
|
-
const
|
|
1446
|
-
if (
|
|
1491
|
+
const o = document.createElement("div");
|
|
1492
|
+
if (o.className = "icon-title-container", this.props.icon) {
|
|
1447
1493
|
const l = this.createIcon(this.props.icon);
|
|
1448
|
-
|
|
1494
|
+
o.appendChild(l);
|
|
1449
1495
|
}
|
|
1450
1496
|
if (this.props.title) {
|
|
1451
1497
|
const l = this.createLabel(this.props.title);
|
|
1452
|
-
|
|
1498
|
+
o.appendChild(l);
|
|
1453
1499
|
}
|
|
1454
|
-
t.appendChild(
|
|
1500
|
+
t.appendChild(o);
|
|
1455
1501
|
}
|
|
1456
1502
|
this.errorContainer = document.createElement("div"), this.errorContainer.className = "error-message", this.errorContainer.style.display = "none", t.appendChild(this.errorContainer);
|
|
1457
1503
|
const i = document.createElement("div");
|
|
@@ -1459,19 +1505,19 @@ class U extends p {
|
|
|
1459
1505
|
const s = this.value && this.value !== "";
|
|
1460
1506
|
s || i.classList.add("no-image");
|
|
1461
1507
|
const n = document.createElement("div");
|
|
1462
|
-
if (n.className = "preview-placeholder", n.innerHTML =
|
|
1463
|
-
const
|
|
1464
|
-
|
|
1508
|
+
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 o = document.createElement("button");
|
|
1510
|
+
o.className = "delete-button", o.type = "button", o.title = "Delete image", o.innerHTML = _, this.previewWrapper.appendChild(o), o.onclick = (l) => {
|
|
1465
1511
|
var h;
|
|
1466
1512
|
l.stopPropagation(), this.value = "", this.updatePreviewState(null), (h = this.onChange) == null || h.call(this, ""), this.hideError();
|
|
1467
1513
|
};
|
|
1468
1514
|
}
|
|
1469
1515
|
this.previewWrapper.appendChild(this.previewEl);
|
|
1470
|
-
const
|
|
1471
|
-
return
|
|
1472
|
-
<span class="upload-icon">${
|
|
1516
|
+
const a = document.createElement("button");
|
|
1517
|
+
return a.className = "upload-button", a.innerHTML = `
|
|
1518
|
+
<span class="upload-icon">${y}</span>
|
|
1473
1519
|
<span class="upload-label">Upload</span>
|
|
1474
|
-
`, i.appendChild(n), i.appendChild(this.previewWrapper), i.appendChild(
|
|
1520
|
+
`, i.appendChild(n), i.appendChild(this.previewWrapper), i.appendChild(a), t.appendChild(i), s ? this.updatePreviewState(this.value) : this.updatePreviewState(null), a.onclick = () => {
|
|
1475
1521
|
window.postMessage(
|
|
1476
1522
|
{
|
|
1477
1523
|
type: "OPEN_FILE_MANAGER_MODAL",
|
|
@@ -1482,14 +1528,14 @@ class U extends p {
|
|
|
1482
1528
|
}, t;
|
|
1483
1529
|
}
|
|
1484
1530
|
}
|
|
1485
|
-
class
|
|
1531
|
+
class Ct extends v {
|
|
1486
1532
|
constructor(t = {}) {
|
|
1487
1533
|
super({
|
|
1488
1534
|
...t,
|
|
1489
1535
|
title: t.title || "Height",
|
|
1490
1536
|
suffix: t.suffix || "px",
|
|
1491
1537
|
minValue: t.minValue ?? 0,
|
|
1492
|
-
icon: t.icon ||
|
|
1538
|
+
icon: t.icon || K,
|
|
1493
1539
|
default: t.default ?? 100
|
|
1494
1540
|
}), this.inputType = "number", this.mobileValue = t.mobile;
|
|
1495
1541
|
}
|
|
@@ -1500,17 +1546,17 @@ class mt extends v {
|
|
|
1500
1546
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
1501
1547
|
}
|
|
1502
1548
|
}
|
|
1503
|
-
const
|
|
1549
|
+
const K = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1504
1550
|
<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"/>
|
|
1505
1551
|
</svg>`;
|
|
1506
|
-
class
|
|
1552
|
+
class wt extends v {
|
|
1507
1553
|
constructor(t = {}) {
|
|
1508
1554
|
super({
|
|
1509
1555
|
...t,
|
|
1510
1556
|
title: t.title || "Width",
|
|
1511
1557
|
suffix: t.suffix || "px",
|
|
1512
1558
|
minValue: t.minValue ?? 0,
|
|
1513
|
-
icon: t.icon ||
|
|
1559
|
+
icon: t.icon || X,
|
|
1514
1560
|
default: t.default ?? 100
|
|
1515
1561
|
}), this.inputType = "number", this.mobileValue = t.mobile;
|
|
1516
1562
|
}
|
|
@@ -1521,14 +1567,14 @@ class ft extends v {
|
|
|
1521
1567
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
1522
1568
|
}
|
|
1523
1569
|
}
|
|
1524
|
-
const
|
|
1570
|
+
const X = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1525
1571
|
<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"/>
|
|
1526
|
-
</svg>`,
|
|
1572
|
+
</svg>`, Q = `
|
|
1527
1573
|
<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">
|
|
1528
1574
|
<polyline points="6 9 12 15 18 9"></polyline>
|
|
1529
1575
|
</svg>
|
|
1530
1576
|
`;
|
|
1531
|
-
class
|
|
1577
|
+
class Et extends g {
|
|
1532
1578
|
constructor(t = {}) {
|
|
1533
1579
|
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) {
|
|
1534
1580
|
const e = this._options.findIndex(
|
|
@@ -1555,44 +1601,44 @@ class vt extends p {
|
|
|
1555
1601
|
e.classList.add("has-label");
|
|
1556
1602
|
const n = document.createElement("div");
|
|
1557
1603
|
n.className = "select-label", n.textContent = this.props.title, e.appendChild(n);
|
|
1558
|
-
const
|
|
1559
|
-
if (
|
|
1560
|
-
|
|
1604
|
+
const a = document.createElement("span");
|
|
1605
|
+
if (a.className = "select-value", this.isLoading)
|
|
1606
|
+
a.textContent = this.props.loadingText || "Loading options...";
|
|
1561
1607
|
else {
|
|
1562
|
-
const
|
|
1563
|
-
|
|
1608
|
+
const o = this.selectedOptionIndex !== null && this._options && this.selectedOptionIndex >= 0 && this.selectedOptionIndex < this._options.length ? this._options[this.selectedOptionIndex] : null, l = o && typeof o.name == "string" ? o.name : "Select an option";
|
|
1609
|
+
a.textContent = l;
|
|
1564
1610
|
}
|
|
1565
|
-
e.appendChild(
|
|
1611
|
+
e.appendChild(a);
|
|
1566
1612
|
} else {
|
|
1567
1613
|
const n = document.createElement("span");
|
|
1568
1614
|
if (this.isLoading)
|
|
1569
1615
|
n.textContent = this.props.loadingText || "Loading options...";
|
|
1570
1616
|
else {
|
|
1571
|
-
const
|
|
1572
|
-
n.textContent =
|
|
1617
|
+
const a = this.selectedOptionIndex !== null && this._options && this.selectedOptionIndex >= 0 && this.selectedOptionIndex < this._options.length ? this._options[this.selectedOptionIndex] : null, o = a && typeof a.name == "string" ? a.name : "Select an option";
|
|
1618
|
+
n.textContent = o;
|
|
1573
1619
|
}
|
|
1574
1620
|
e.appendChild(n);
|
|
1575
1621
|
}
|
|
1576
1622
|
e.onclick = () => {
|
|
1577
|
-
var n,
|
|
1578
|
-
this.isLoading || (this.isOpen = !this.isOpen, (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (
|
|
1623
|
+
var n, a;
|
|
1624
|
+
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));
|
|
1579
1625
|
}, t.appendChild(e), this.buttonEl = e;
|
|
1580
1626
|
const i = document.createElement("ul");
|
|
1581
|
-
i.classList.add("select-api-options"), this._options.forEach((n,
|
|
1582
|
-
const
|
|
1583
|
-
|
|
1627
|
+
i.classList.add("select-api-options"), this._options.forEach((n, a) => {
|
|
1628
|
+
const o = this.createOption(n, a);
|
|
1629
|
+
o.onclick = (l) => this.selectApiOption(l, a, e), i.appendChild(o);
|
|
1584
1630
|
}), t.appendChild(i);
|
|
1585
1631
|
const s = document.createElement("div");
|
|
1586
|
-
return s.classList.add("svg-container"), s.innerHTML =
|
|
1587
|
-
var n,
|
|
1588
|
-
this.isLoading || (this.isOpen = !this.isOpen, (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (
|
|
1632
|
+
return s.classList.add("svg-container"), s.innerHTML = Q, t.appendChild(s), s.onclick = () => {
|
|
1633
|
+
var n, a;
|
|
1634
|
+
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));
|
|
1589
1635
|
}, this.optionsListEl = i, this.svgContainer = s, this.props.getOptionsAsync && !this.hasInitializedOptions ? (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((n) => {
|
|
1590
|
-
const
|
|
1636
|
+
const a = new Set(
|
|
1591
1637
|
this._options.map((l) => JSON.stringify(l.value))
|
|
1592
|
-
),
|
|
1593
|
-
(l) => !
|
|
1638
|
+
), o = n.filter(
|
|
1639
|
+
(l) => !a.has(JSON.stringify(l.value))
|
|
1594
1640
|
);
|
|
1595
|
-
if (this._options.push(...
|
|
1641
|
+
if (this._options.push(...o), this.isLoading = !1, this.hasInitializedOptions = !0, this.value !== void 0) {
|
|
1596
1642
|
const l = this._options.findIndex(
|
|
1597
1643
|
(h) => JSON.stringify(h.value) === JSON.stringify(this.value)
|
|
1598
1644
|
);
|
|
@@ -1606,12 +1652,12 @@ class vt extends p {
|
|
|
1606
1652
|
!0
|
|
1607
1653
|
);
|
|
1608
1654
|
})) : this.props.getOptionsAsync && this._options.length <= 1 && (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((n) => {
|
|
1609
|
-
const
|
|
1655
|
+
const a = new Set(
|
|
1610
1656
|
this._options.map((l) => JSON.stringify(l.value))
|
|
1611
|
-
),
|
|
1612
|
-
(l) => !
|
|
1657
|
+
), o = n.filter(
|
|
1658
|
+
(l) => !a.has(JSON.stringify(l.value))
|
|
1613
1659
|
);
|
|
1614
|
-
if (this._options.push(...
|
|
1660
|
+
if (this._options.push(...o), this.isLoading = !1, this.value !== void 0) {
|
|
1615
1661
|
const l = this._options.findIndex(
|
|
1616
1662
|
(h) => JSON.stringify(h.value) === JSON.stringify(this.value)
|
|
1617
1663
|
);
|
|
@@ -1633,16 +1679,16 @@ class vt extends p {
|
|
|
1633
1679
|
var l, h, r, d;
|
|
1634
1680
|
const s = t.target, n = s.querySelector(".select-api-radio") || ((l = s.closest(".select-api-option")) == null ? void 0 : l.querySelector(".select-api-radio"));
|
|
1635
1681
|
n && (n.checked = !0), this.selectedOptionIndex = e;
|
|
1636
|
-
const
|
|
1637
|
-
this.value =
|
|
1638
|
-
const
|
|
1639
|
-
if (
|
|
1640
|
-
|
|
1682
|
+
const a = this._options[e].value;
|
|
1683
|
+
this.value = a;
|
|
1684
|
+
const o = i.querySelector(".select-value");
|
|
1685
|
+
if (o)
|
|
1686
|
+
o.textContent = this._options[e].name;
|
|
1641
1687
|
else {
|
|
1642
1688
|
const u = i.firstChild;
|
|
1643
1689
|
u && u.tagName === "SPAN" && (u.textContent = this._options[e].name);
|
|
1644
1690
|
}
|
|
1645
|
-
this.isOpen = !1, (h = this.optionsListEl) == null || h.classList.remove("open"), (r = this.svgContainer) == null || r.classList.remove("open"), (d = this.onChange) == null || d.call(this,
|
|
1691
|
+
this.isOpen = !1, (h = this.optionsListEl) == null || h.classList.remove("open"), (r = this.svgContainer) == null || r.classList.remove("open"), (d = this.onChange) == null || d.call(this, a), this.detectChangeCallback && this.detectChangeCallback(a);
|
|
1646
1692
|
}
|
|
1647
1693
|
updateOptionsList() {
|
|
1648
1694
|
!this.optionsListEl || !this.buttonEl || (this.optionsListEl.innerHTML = "", this._options.forEach((t, e) => {
|
|
@@ -1675,13 +1721,13 @@ class vt extends p {
|
|
|
1675
1721
|
), this.updateButtonText();
|
|
1676
1722
|
}
|
|
1677
1723
|
}
|
|
1678
|
-
class
|
|
1724
|
+
class bt extends g {
|
|
1679
1725
|
constructor(t) {
|
|
1680
1726
|
var e, i;
|
|
1681
1727
|
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;
|
|
1682
1728
|
}
|
|
1683
1729
|
draw() {
|
|
1684
|
-
var
|
|
1730
|
+
var a, o;
|
|
1685
1731
|
const t = document.createElement("div");
|
|
1686
1732
|
t.className = "toggle-setting-container", this.props.icon && t.classList.add("toggle-with-icon");
|
|
1687
1733
|
const e = document.createElement("div");
|
|
@@ -1697,7 +1743,7 @@ class Ct extends p {
|
|
|
1697
1743
|
const i = document.createElement("label");
|
|
1698
1744
|
i.className = "toggle-switch";
|
|
1699
1745
|
const s = document.createElement("input");
|
|
1700
|
-
s.type = "checkbox", s.checked = ((
|
|
1746
|
+
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", () => {
|
|
1701
1747
|
var h, r;
|
|
1702
1748
|
const l = ((r = (h = this.props.options) == null ? void 0 : h.find((d) => d.status === s.checked)) == null ? void 0 : r.value) ?? "";
|
|
1703
1749
|
this.value = l, this.onChange && this.onChange(this.value), this.detectChangeCallback && this.detectChangeCallback(this.value);
|
|
@@ -1720,13 +1766,13 @@ class Ct extends p {
|
|
|
1720
1766
|
this.detectChangeCallback = t;
|
|
1721
1767
|
}
|
|
1722
1768
|
}
|
|
1723
|
-
const
|
|
1769
|
+
const Y = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1724
1770
|
<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"/>
|
|
1725
1771
|
</svg>`;
|
|
1726
|
-
class
|
|
1772
|
+
class Lt extends g {
|
|
1727
1773
|
// Store mobile value
|
|
1728
1774
|
constructor(t = {}) {
|
|
1729
|
-
t.rowGap = t.rowGap ?? !0, t.columnGap = t.columnGap ?? !0, t.title = t.title ?? "Gap", t.icon = t.icon ??
|
|
1775
|
+
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);
|
|
1730
1776
|
}
|
|
1731
1777
|
draw() {
|
|
1732
1778
|
const t = document.createElement("div");
|
|
@@ -1737,27 +1783,27 @@ class wt extends p {
|
|
|
1737
1783
|
i.className = "setting-label", i.setAttribute("for", this.id + "-input");
|
|
1738
1784
|
const s = document.createElement("span");
|
|
1739
1785
|
if (s.textContent = this.props.title ?? "Gap", i.appendChild(s), this.props.icon) {
|
|
1740
|
-
const
|
|
1741
|
-
|
|
1786
|
+
const o = document.createElement("span");
|
|
1787
|
+
o.className = "setting-icon", o.innerHTML = this.props.icon, i.insertBefore(o, s);
|
|
1742
1788
|
}
|
|
1743
1789
|
const n = document.createElement("div");
|
|
1744
1790
|
n.className = `setting-input-wrapper ${this.props.wrapperClassName || ""}`, n.classList.add("gap-setting-wrapper");
|
|
1745
|
-
const
|
|
1746
|
-
return
|
|
1791
|
+
const a = document.createElement("div");
|
|
1792
|
+
return a.className = "gap-inputs-container", this.props.rowGap && a.appendChild(this.createGapInput("row", "Row")), this.props.columnGap && a.appendChild(this.createGapInput("column", "Col")), n.appendChild(a), e.appendChild(i), e.appendChild(n), t.appendChild(e), t;
|
|
1747
1793
|
}
|
|
1748
1794
|
createGapInput(t, e) {
|
|
1749
1795
|
const i = document.createElement("div");
|
|
1750
1796
|
i.className = "gap-input-wrapper";
|
|
1751
1797
|
const s = document.createElement("input");
|
|
1752
1798
|
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) => {
|
|
1753
|
-
const
|
|
1754
|
-
let
|
|
1755
|
-
|
|
1799
|
+
const a = n.target;
|
|
1800
|
+
let o = parseFloat(a.value);
|
|
1801
|
+
o = this.validateValue(o), String(o) !== a.value && (a.value = String(o)), this.inputValues[t] = o, this.setValue(o);
|
|
1756
1802
|
}), s.addEventListener("blur", (n) => {
|
|
1757
1803
|
var l, h;
|
|
1758
|
-
const
|
|
1759
|
-
let
|
|
1760
|
-
|
|
1804
|
+
const a = n.target;
|
|
1805
|
+
let o = parseFloat(a.value);
|
|
1806
|
+
o = this.validateValue(o), String(o) !== a.value && (a.value = String(o), this.inputValues[t] = o, this.setValue(o)), (h = (l = this.props).onBlur) == null || h.call(l);
|
|
1761
1807
|
}), i.appendChild(s), this.props.suffix && this.props.suffix !== "none") {
|
|
1762
1808
|
const n = document.createElement("span");
|
|
1763
1809
|
n.className = "gap-suffix", n.textContent = this.props.suffix, i.appendChild(n), s.style.paddingRight = "30px";
|
|
@@ -1777,53 +1823,53 @@ class wt extends p {
|
|
|
1777
1823
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
1778
1824
|
}
|
|
1779
1825
|
}
|
|
1780
|
-
const
|
|
1826
|
+
const tt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1781
1827
|
<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"/>
|
|
1782
1828
|
</svg>`;
|
|
1783
|
-
class
|
|
1829
|
+
class xt extends v {
|
|
1784
1830
|
constructor(t = {}) {
|
|
1785
1831
|
super({
|
|
1786
1832
|
...t,
|
|
1787
1833
|
minValue: t.minValue ?? 0,
|
|
1788
1834
|
maxValue: t.maxValue ?? 1e3,
|
|
1789
|
-
icon: t.icon ||
|
|
1835
|
+
icon: t.icon || tt,
|
|
1790
1836
|
title: t.title || "Margin Bottom",
|
|
1791
1837
|
default: t.default ?? 20,
|
|
1792
1838
|
wrapperClassName: "margin-bottom-wrapper " + (t.wrapperClassName || "")
|
|
1793
1839
|
}), this.inputType = "number";
|
|
1794
1840
|
}
|
|
1795
1841
|
}
|
|
1796
|
-
const
|
|
1842
|
+
const et = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1797
1843
|
<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"
|
|
1798
1844
|
stroke="#667085" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
1799
1845
|
</svg>`;
|
|
1800
|
-
class
|
|
1846
|
+
class yt extends v {
|
|
1801
1847
|
constructor(t = {}) {
|
|
1802
1848
|
super({
|
|
1803
1849
|
...t,
|
|
1804
1850
|
minValue: t.minValue ?? 0,
|
|
1805
1851
|
maxValue: t.maxValue ?? 1e3,
|
|
1806
|
-
icon: t.icon ||
|
|
1852
|
+
icon: t.icon || et,
|
|
1807
1853
|
title: t.title || "Margin Top",
|
|
1808
1854
|
default: t.default ?? 20,
|
|
1809
1855
|
wrapperClassName: "margin-top-wrapper " + (t.wrapperClassName || "")
|
|
1810
1856
|
}), this.inputType = "number";
|
|
1811
1857
|
}
|
|
1812
1858
|
}
|
|
1813
|
-
const
|
|
1859
|
+
const it = `
|
|
1814
1860
|
<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">
|
|
1815
1861
|
<polyline points="3,6 5,6 21,6"></polyline>
|
|
1816
1862
|
<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>
|
|
1817
1863
|
<line x1="10" y1="11" x2="10" y2="17"></line>
|
|
1818
1864
|
<line x1="14" y1="11" x2="14" y2="17"></line>
|
|
1819
1865
|
</svg>
|
|
1820
|
-
`,
|
|
1866
|
+
`, st = `
|
|
1821
1867
|
<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">
|
|
1822
1868
|
<line x1="12" y1="5" x2="12" y2="19"></line>
|
|
1823
1869
|
<line x1="5" y1="12" x2="19" y2="12"></line>
|
|
1824
1870
|
</svg>
|
|
1825
1871
|
`;
|
|
1826
|
-
class
|
|
1872
|
+
class Mt extends g {
|
|
1827
1873
|
constructor(t = {}) {
|
|
1828
1874
|
super(t), this.inputType = {}, this.container = null, this.languagesContainer = null, this.addLanguageSelect = null, this.addButton = null, this.defaultLanguages = [
|
|
1829
1875
|
{ code: "en", name: "English" },
|
|
@@ -1865,15 +1911,15 @@ class bt extends p {
|
|
|
1865
1911
|
s.classList.add("language-label"), s.textContent = t.toUpperCase();
|
|
1866
1912
|
const n = document.createElement("div");
|
|
1867
1913
|
n.classList.add("language-input-group");
|
|
1868
|
-
const
|
|
1869
|
-
|
|
1914
|
+
const a = document.createElement("input");
|
|
1915
|
+
a.type = "text", a.classList.add("language-input"), a.value = e || "", a.placeholder = this.props.placeholder || "Enter text...", a.addEventListener("input", (l) => {
|
|
1870
1916
|
const h = l.target;
|
|
1871
1917
|
this.updateLanguageValue(t, h.value);
|
|
1872
1918
|
});
|
|
1873
|
-
const
|
|
1874
|
-
return
|
|
1919
|
+
const o = document.createElement("button");
|
|
1920
|
+
return o.type = "button", o.classList.add("delete-language-btn"), o.innerHTML = it, o.title = `Delete ${t.toUpperCase()}`, o.addEventListener("click", () => {
|
|
1875
1921
|
this.removeLanguage(t);
|
|
1876
|
-
}), n.appendChild(
|
|
1922
|
+
}), n.appendChild(a), n.appendChild(o), i.appendChild(s), i.appendChild(n), i;
|
|
1877
1923
|
}
|
|
1878
1924
|
updateLanguageValue(t, e) {
|
|
1879
1925
|
this.value || (this.value = {}), this.value[t] = e, this.onChange && this.onChange(this.value), this.props.detectChange && this.props.detectChange(this.value);
|
|
@@ -1904,9 +1950,9 @@ class bt extends p {
|
|
|
1904
1950
|
const s = document.createElement("select");
|
|
1905
1951
|
s.classList.add("add-language-select"), this.addLanguageSelect = s;
|
|
1906
1952
|
const n = document.createElement("button");
|
|
1907
|
-
return n.type = "button", n.classList.add("add-language-btn"), n.innerHTML = `${
|
|
1908
|
-
const
|
|
1909
|
-
|
|
1953
|
+
return n.type = "button", n.classList.add("add-language-btn"), n.innerHTML = `${st} Add`, this.addButton = n, n.addEventListener("click", () => {
|
|
1954
|
+
const a = s.value;
|
|
1955
|
+
a && this.addLanguage(a);
|
|
1910
1956
|
}), i.appendChild(s), i.appendChild(n), t.appendChild(e), t.appendChild(i), t;
|
|
1911
1957
|
}
|
|
1912
1958
|
draw() {
|
|
@@ -1918,9 +1964,9 @@ class bt extends p {
|
|
|
1918
1964
|
const e = document.createElement("div");
|
|
1919
1965
|
e.classList.add("multi-language-content");
|
|
1920
1966
|
const i = document.createElement("div");
|
|
1921
|
-
i.classList.add("languages-container"), this.languagesContainer = i, this.value && Object.entries(this.value).forEach(([n,
|
|
1922
|
-
const
|
|
1923
|
-
i.appendChild(
|
|
1967
|
+
i.classList.add("languages-container"), this.languagesContainer = i, this.value && Object.entries(this.value).forEach(([n, a]) => {
|
|
1968
|
+
const o = this.createLanguageRow(n, a);
|
|
1969
|
+
i.appendChild(o);
|
|
1924
1970
|
}), e.appendChild(i);
|
|
1925
1971
|
const s = this.createAddLanguageSection();
|
|
1926
1972
|
return e.appendChild(s), t.appendChild(e), this.updateAddLanguageSelect(), this.container = t, t;
|
|
@@ -1932,7 +1978,7 @@ class bt extends p {
|
|
|
1932
1978
|
}), this.updateAddLanguageSelect());
|
|
1933
1979
|
}
|
|
1934
1980
|
}
|
|
1935
|
-
class
|
|
1981
|
+
class kt extends g {
|
|
1936
1982
|
constructor(t = {}) {
|
|
1937
1983
|
super(t), this.inputType = "select";
|
|
1938
1984
|
const e = [
|
|
@@ -1943,7 +1989,7 @@ class xt extends p {
|
|
|
1943
1989
|
{ name: "Bounce", value: "bounce 1.5s ease-in-out infinite" },
|
|
1944
1990
|
{ name: "Pulse", value: "pulse 1.5s ease-in-out infinite" }
|
|
1945
1991
|
];
|
|
1946
|
-
this.selectSetting = new
|
|
1992
|
+
this.selectSetting = new k({
|
|
1947
1993
|
title: this.title || "Animation",
|
|
1948
1994
|
options: e,
|
|
1949
1995
|
default: this.props.default || "none"
|
|
@@ -1959,16 +2005,16 @@ class xt extends p {
|
|
|
1959
2005
|
this.selectSetting.destroy(), super.destroy();
|
|
1960
2006
|
}
|
|
1961
2007
|
}
|
|
1962
|
-
const
|
|
2008
|
+
const nt = `
|
|
1963
2009
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1964
2010
|
<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"/>
|
|
1965
2011
|
</svg>
|
|
1966
|
-
`,
|
|
2012
|
+
`, at = `
|
|
1967
2013
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1968
2014
|
<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"/>
|
|
1969
2015
|
</svg>
|
|
1970
2016
|
`;
|
|
1971
|
-
class
|
|
2017
|
+
class Vt extends f {
|
|
1972
2018
|
constructor(t) {
|
|
1973
2019
|
super({
|
|
1974
2020
|
title: "Border",
|
|
@@ -1977,7 +2023,7 @@ class yt extends f {
|
|
|
1977
2023
|
settings: {
|
|
1978
2024
|
size: new v({
|
|
1979
2025
|
title: "Size",
|
|
1980
|
-
icon:
|
|
2026
|
+
icon: at,
|
|
1981
2027
|
default: (t == null ? void 0 : t.size) ?? 0,
|
|
1982
2028
|
suffix: "px"
|
|
1983
2029
|
}),
|
|
@@ -1986,7 +2032,7 @@ class yt extends f {
|
|
|
1986
2032
|
}),
|
|
1987
2033
|
radius: new v({
|
|
1988
2034
|
title: "Radius",
|
|
1989
|
-
icon:
|
|
2035
|
+
icon: nt,
|
|
1990
2036
|
default: (t == null ? void 0 : t.radius) ?? 12,
|
|
1991
2037
|
suffix: "px"
|
|
1992
2038
|
})
|
|
@@ -2005,20 +2051,20 @@ class yt extends f {
|
|
|
2005
2051
|
`;
|
|
2006
2052
|
}
|
|
2007
2053
|
}
|
|
2008
|
-
const
|
|
2054
|
+
const ot = `
|
|
2009
2055
|
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="13" viewBox="0 0 14 13" fill="none">
|
|
2010
2056
|
<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"/>
|
|
2011
2057
|
</svg>
|
|
2012
|
-
`,
|
|
2058
|
+
`, lt = `
|
|
2013
2059
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2014
2060
|
<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"/>
|
|
2015
2061
|
</svg>
|
|
2016
|
-
`,
|
|
2062
|
+
`, rt = `
|
|
2017
2063
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2018
2064
|
<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"/>
|
|
2019
2065
|
</svg>
|
|
2020
2066
|
`;
|
|
2021
|
-
class
|
|
2067
|
+
class Nt extends f {
|
|
2022
2068
|
constructor(t = {}) {
|
|
2023
2069
|
const { showAlign: e = t.showAlign ?? !0, ...i } = t;
|
|
2024
2070
|
super({
|
|
@@ -2030,9 +2076,9 @@ class Mt extends f {
|
|
|
2030
2076
|
color: new C({
|
|
2031
2077
|
default: i.colorDefault ?? "0, 0, 30"
|
|
2032
2078
|
}),
|
|
2033
|
-
fontFamily: new
|
|
2079
|
+
fontFamily: new k({
|
|
2034
2080
|
title: "Font",
|
|
2035
|
-
icon:
|
|
2081
|
+
icon: ot,
|
|
2036
2082
|
default: i.fontFamilyDefault ?? "Satoshi",
|
|
2037
2083
|
options: i.fontFamilyOptions ?? [
|
|
2038
2084
|
{ name: "Alt", value: "Croco Sans Black Caps Alt" },
|
|
@@ -2043,9 +2089,9 @@ class Mt extends f {
|
|
|
2043
2089
|
getOptions: i.fontFamilyGetOptions,
|
|
2044
2090
|
getOptionsAsync: i.fontFamilyGetOptionsAsync
|
|
2045
2091
|
}),
|
|
2046
|
-
fontWeight: new
|
|
2092
|
+
fontWeight: new k({
|
|
2047
2093
|
title: "Weight",
|
|
2048
|
-
icon:
|
|
2094
|
+
icon: lt,
|
|
2049
2095
|
default: i.fontWeightDefault ?? "400",
|
|
2050
2096
|
options: i.fontWeightOptions ?? [
|
|
2051
2097
|
{ name: "Regular", value: "400" },
|
|
@@ -2057,7 +2103,7 @@ class Mt extends f {
|
|
|
2057
2103
|
}),
|
|
2058
2104
|
fontSize: new v({
|
|
2059
2105
|
title: "Size",
|
|
2060
|
-
icon:
|
|
2106
|
+
icon: rt,
|
|
2061
2107
|
default: i.fontSizeDefault ?? 12,
|
|
2062
2108
|
suffix: "px",
|
|
2063
2109
|
mobile: i.fontSizeMobileDefault
|
|
@@ -2065,7 +2111,7 @@ class Mt extends f {
|
|
|
2065
2111
|
};
|
|
2066
2112
|
return e ? {
|
|
2067
2113
|
...s,
|
|
2068
|
-
align: new
|
|
2114
|
+
align: new W({
|
|
2069
2115
|
title: "Align",
|
|
2070
2116
|
default: i.alignDefault ?? "center"
|
|
2071
2117
|
})
|
|
@@ -2074,8 +2120,8 @@ class Mt extends f {
|
|
|
2074
2120
|
});
|
|
2075
2121
|
}
|
|
2076
2122
|
getCssCode() {
|
|
2077
|
-
var
|
|
2078
|
-
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 = ((
|
|
2123
|
+
var a;
|
|
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 = ((a = this.settings.align) == null ? void 0 : a.value) ?? "left";
|
|
2079
2125
|
return `
|
|
2080
2126
|
color: ${t};
|
|
2081
2127
|
font-family: ${e};
|
|
@@ -2085,7 +2131,7 @@ class Mt extends f {
|
|
|
2085
2131
|
`;
|
|
2086
2132
|
}
|
|
2087
2133
|
}
|
|
2088
|
-
class E extends
|
|
2134
|
+
class E extends g {
|
|
2089
2135
|
constructor(t) {
|
|
2090
2136
|
super({
|
|
2091
2137
|
...t,
|
|
@@ -2093,11 +2139,11 @@ class E extends p {
|
|
|
2093
2139
|
}), this.inputType = "number", this.value = t.default !== void 0 ? t.default : "auto";
|
|
2094
2140
|
}
|
|
2095
2141
|
draw() {
|
|
2096
|
-
const t = this.value === "auto" ? "text" : "number", e = (
|
|
2097
|
-
this.value !== "auto" && (this.props.minValue !== void 0 && (
|
|
2142
|
+
const t = this.value === "auto" ? "text" : "number", e = (o) => {
|
|
2143
|
+
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", () => {
|
|
2098
2144
|
const l = this.props.minValue ?? Number.MIN_SAFE_INTEGER, h = this.props.maxValue ?? Number.MAX_SAFE_INTEGER;
|
|
2099
|
-
let r = Number(
|
|
2100
|
-
r < l && (r = l), r > h && (r = h),
|
|
2145
|
+
let r = Number(o.value);
|
|
2146
|
+
r < l && (r = l), r > h && (r = h), o.value = String(r);
|
|
2101
2147
|
}));
|
|
2102
2148
|
}, i = this.createInput({
|
|
2103
2149
|
value: this.value,
|
|
@@ -2118,9 +2164,9 @@ class E extends p {
|
|
|
2118
2164
|
s && (s.style.paddingRight = "35px");
|
|
2119
2165
|
const n = document.createElement("span");
|
|
2120
2166
|
n.className = "suffix-label", n.textContent = this.props.suffix, i.appendChild(n);
|
|
2121
|
-
const
|
|
2122
|
-
return
|
|
2123
|
-
const l =
|
|
2167
|
+
const a = i.querySelector("input");
|
|
2168
|
+
return a && (a.oninput = (o) => {
|
|
2169
|
+
const l = o.target.value.trim();
|
|
2124
2170
|
if (l.toLowerCase() === "auto")
|
|
2125
2171
|
this.value = "auto";
|
|
2126
2172
|
else {
|
|
@@ -2131,7 +2177,7 @@ class E extends p {
|
|
|
2131
2177
|
}), i;
|
|
2132
2178
|
}
|
|
2133
2179
|
}
|
|
2134
|
-
class
|
|
2180
|
+
class It extends f {
|
|
2135
2181
|
constructor(t) {
|
|
2136
2182
|
super({
|
|
2137
2183
|
title: "Margins",
|
|
@@ -2140,25 +2186,25 @@ class kt extends f {
|
|
|
2140
2186
|
settings: {
|
|
2141
2187
|
marginTop: new E({
|
|
2142
2188
|
title: "Top",
|
|
2143
|
-
icon:
|
|
2189
|
+
icon: ht,
|
|
2144
2190
|
suffix: "px",
|
|
2145
2191
|
default: (t == null ? void 0 : t.marginTop) ?? "auto"
|
|
2146
2192
|
}),
|
|
2147
2193
|
marginRight: new E({
|
|
2148
2194
|
title: "Right",
|
|
2149
|
-
icon:
|
|
2195
|
+
icon: ct,
|
|
2150
2196
|
suffix: "px",
|
|
2151
2197
|
default: (t == null ? void 0 : t.marginRight) ?? 0
|
|
2152
2198
|
}),
|
|
2153
2199
|
marginBottom: new E({
|
|
2154
2200
|
title: "Bottom",
|
|
2155
|
-
icon:
|
|
2201
|
+
icon: dt,
|
|
2156
2202
|
suffix: "px",
|
|
2157
2203
|
default: (t == null ? void 0 : t.marginBottom) ?? 0
|
|
2158
2204
|
}),
|
|
2159
2205
|
marginLeft: new E({
|
|
2160
2206
|
title: "Left",
|
|
2161
|
-
icon:
|
|
2207
|
+
icon: ut,
|
|
2162
2208
|
suffix: "px",
|
|
2163
2209
|
default: (t == null ? void 0 : t.marginLeft) ?? 0
|
|
2164
2210
|
})
|
|
@@ -2175,16 +2221,16 @@ class kt extends f {
|
|
|
2175
2221
|
`;
|
|
2176
2222
|
}
|
|
2177
2223
|
}
|
|
2178
|
-
const
|
|
2224
|
+
const ht = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2179
2225
|
<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"/>
|
|
2180
|
-
</svg>`,
|
|
2226
|
+
</svg>`, ct = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2181
2227
|
<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"/>
|
|
2182
|
-
</svg>`,
|
|
2228
|
+
</svg>`, dt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2183
2229
|
<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"/>
|
|
2184
|
-
</svg>`,
|
|
2230
|
+
</svg>`, ut = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2185
2231
|
<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"/>
|
|
2186
2232
|
</svg>`;
|
|
2187
|
-
class
|
|
2233
|
+
class St extends f {
|
|
2188
2234
|
/**
|
|
2189
2235
|
* Constructs a new BackgroundSettingSet.
|
|
2190
2236
|
*
|
|
@@ -2214,11 +2260,11 @@ class Vt extends f {
|
|
|
2214
2260
|
collapsed: t == null ? void 0 : t.collapsed,
|
|
2215
2261
|
hideCondition: t == null ? void 0 : t.hideCondition,
|
|
2216
2262
|
settings: {
|
|
2217
|
-
backgroundImage: new
|
|
2263
|
+
backgroundImage: new Z({
|
|
2218
2264
|
...t == null ? void 0 : t.uploadProps,
|
|
2219
2265
|
default: (t == null ? void 0 : t.backgroundImage) ?? ""
|
|
2220
2266
|
}),
|
|
2221
|
-
opacity: new
|
|
2267
|
+
opacity: new j({
|
|
2222
2268
|
default: (t == null ? void 0 : t.opacity) ?? 100
|
|
2223
2269
|
}),
|
|
2224
2270
|
backgroundColor: new C({
|
|
@@ -2233,10 +2279,10 @@ class Vt extends f {
|
|
|
2233
2279
|
draw() {
|
|
2234
2280
|
const t = super.draw(), e = t.querySelector(".setting-group-content");
|
|
2235
2281
|
if (!e) return t;
|
|
2236
|
-
const i = Array.from(e.children), [s, n,
|
|
2282
|
+
const i = Array.from(e.children), [s, n, a] = i;
|
|
2237
2283
|
e.innerHTML = "", e.appendChild(s), e.appendChild(n);
|
|
2238
|
-
const
|
|
2239
|
-
return
|
|
2284
|
+
const o = document.createElement("div");
|
|
2285
|
+
return o.className = "bgset-or-label", o.textContent = "OR", e.appendChild(o), e.appendChild(a), t;
|
|
2240
2286
|
}
|
|
2241
2287
|
/**
|
|
2242
2288
|
* Helper method to generate CSS based on the current settings.
|
|
@@ -2253,44 +2299,44 @@ class Vt extends f {
|
|
|
2253
2299
|
`;
|
|
2254
2300
|
}
|
|
2255
2301
|
}
|
|
2256
|
-
function
|
|
2302
|
+
function Ot(c) {
|
|
2257
2303
|
return c instanceof f;
|
|
2258
2304
|
}
|
|
2259
|
-
function
|
|
2260
|
-
return c instanceof
|
|
2305
|
+
function Ht(c) {
|
|
2306
|
+
return c instanceof g;
|
|
2261
2307
|
}
|
|
2262
2308
|
export {
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2309
|
+
W as AlignSetting,
|
|
2310
|
+
kt as AnimationSetting,
|
|
2311
|
+
St as BackgroundSettingSet,
|
|
2312
|
+
Vt as BorderSettingSet,
|
|
2313
|
+
ft as ButtonSetting,
|
|
2268
2314
|
m as ColorSetting,
|
|
2269
2315
|
C as ColorWithOpacitySetting,
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2316
|
+
vt as DimensionSetting,
|
|
2317
|
+
Lt as GapSetting,
|
|
2318
|
+
Nt as HeaderTypographySettingSet,
|
|
2319
|
+
Ct as HeightSetting,
|
|
2320
|
+
mt as HtmlSetting,
|
|
2321
|
+
xt as MarginBottomSetting,
|
|
2322
|
+
It as MarginSettingGroup,
|
|
2323
|
+
yt as MarginTopSetting,
|
|
2324
|
+
Mt as MultiLanguageSetting,
|
|
2279
2325
|
v as NumberSetting,
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2326
|
+
j as OpacitySetting,
|
|
2327
|
+
Et as SelectApiSettings,
|
|
2328
|
+
k as SelectSetting,
|
|
2329
|
+
g as Setting,
|
|
2284
2330
|
f as SettingGroup,
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2331
|
+
$ as StringSetting,
|
|
2332
|
+
pt as TabSettingGroup,
|
|
2333
|
+
pt as TabsSettingGroup,
|
|
2334
|
+
bt as Toggle,
|
|
2335
|
+
Z as UploadSetting,
|
|
2336
|
+
wt as WidthSetting,
|
|
2337
|
+
gt as asSettingGroupWithSettings,
|
|
2338
|
+
R as createSettingGroup,
|
|
2339
|
+
Ht as isSetting,
|
|
2340
|
+
Ot as isSettingGroup,
|
|
2295
2341
|
w as iterateSettings
|
|
2296
2342
|
};
|