builder-settings-types 0.0.217 → 0.0.219
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 +432 -381
- package/dist/index.css +1 -1
- package/dist/index.d.ts +15 -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,35 @@ 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
|
-
|
|
351
|
-
|
|
346
|
+
let n = this.settings[i];
|
|
347
|
+
if (!n && this.addItemCfg && i.startsWith(this.addItemCfg.keyPrefix)) {
|
|
348
|
+
const a = i.slice(this.addItemCfg.keyPrefix.length), o = Number(a);
|
|
349
|
+
if (Number.isFinite(o)) {
|
|
350
|
+
const l = this.addItemCfg.createItem(o);
|
|
351
|
+
this.addSetting(i, l), n = l;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
n && (n instanceof p || n instanceof g) && typeof n.setValue == "function" && n.setValue(s);
|
|
352
355
|
}), setTimeout(() => {
|
|
353
356
|
this.forceChildUIRefresh();
|
|
354
357
|
}, 0);
|
|
355
358
|
const e = this.getValues();
|
|
356
359
|
this.initialValues = e, this.onChange && this.onChange(e);
|
|
357
360
|
}
|
|
358
|
-
/**
|
|
359
|
-
* Force UI refresh for all child settings
|
|
360
|
-
*/
|
|
361
|
+
/** Force UI refresh for all child settings */
|
|
361
362
|
forceChildUIRefresh() {
|
|
362
363
|
Object.entries(this.settings).forEach(([t, e]) => {
|
|
363
364
|
try {
|
|
364
|
-
if (e instanceof
|
|
365
|
+
if (e instanceof p) {
|
|
365
366
|
const i = e.getValues();
|
|
366
367
|
e.setValue(i);
|
|
367
368
|
} else if (typeof e.setValue == "function") {
|
|
@@ -373,17 +374,54 @@ const g = class g {
|
|
|
373
374
|
}
|
|
374
375
|
});
|
|
375
376
|
}
|
|
377
|
+
/** Attach change/blur bubbling for a newly added child */
|
|
378
|
+
wireChild(t) {
|
|
379
|
+
var i, s, n;
|
|
380
|
+
const e = () => {
|
|
381
|
+
var o;
|
|
382
|
+
const a = this.getValues();
|
|
383
|
+
this.initialValues = a, (o = this.onChange) == null || o.call(this, a), this.updateVisibility();
|
|
384
|
+
};
|
|
385
|
+
t instanceof p ? (t.setOnChange(() => e()), (i = t.setOnBlur) == null || i.call(t, () => {
|
|
386
|
+
var a;
|
|
387
|
+
return (a = this.onBlur) == null ? void 0 : a.call(this);
|
|
388
|
+
})) : t instanceof g ? (t.setOnChange(() => e()), (s = t.setOnBlur) == null || s.call(t, () => {
|
|
389
|
+
var a;
|
|
390
|
+
return (a = this.onBlur) == null ? void 0 : a.call(this);
|
|
391
|
+
})) : (n = t.setOnChange) == null || n.call(t, () => e());
|
|
392
|
+
}
|
|
393
|
+
addSetting(t, e) {
|
|
394
|
+
var s;
|
|
395
|
+
if (this.settings[t] = e, this.wireChild(e), this.elementRef) {
|
|
396
|
+
const n = this.elementRef.querySelector(
|
|
397
|
+
".setting-group-content"
|
|
398
|
+
);
|
|
399
|
+
if (n) {
|
|
400
|
+
e instanceof p && e.setNestingLevel(this.nestingLevel + 1);
|
|
401
|
+
const a = e.draw(), o = n.querySelector(".sg-add-button-bottom");
|
|
402
|
+
o ? n.insertBefore(a, o) : n.appendChild(a), N.trackElement(a), b(a, this.nestingLevel + 1), M(a, this.nestingLevel + 1);
|
|
403
|
+
const l = a.style.display;
|
|
404
|
+
a.style.display = "none", a.offsetHeight, a.style.display = l, this.updateNestingStyles();
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
const i = this.getValues();
|
|
408
|
+
this.initialValues = i, (s = this.onChange) == null || s.call(this, i);
|
|
409
|
+
}
|
|
410
|
+
getNextIndexFromPrefix(t) {
|
|
411
|
+
const e = Object.keys(this.settings).filter((i) => i.startsWith(t)).map((i) => {
|
|
412
|
+
const s = Number(i.slice(t.length));
|
|
413
|
+
return Number.isFinite(s) ? s : -1;
|
|
414
|
+
}).filter((i) => i >= 0);
|
|
415
|
+
return e.length ? Math.max(...e) + 1 : 0;
|
|
416
|
+
}
|
|
376
417
|
calculateChanges(t, e) {
|
|
377
418
|
const i = {};
|
|
378
419
|
return (/* @__PURE__ */ new Set([
|
|
379
420
|
...Object.keys(t),
|
|
380
421
|
...Object.keys(e)
|
|
381
422
|
])).forEach((n) => {
|
|
382
|
-
const
|
|
383
|
-
JSON.stringify(
|
|
384
|
-
from: o,
|
|
385
|
-
to: a
|
|
386
|
-
});
|
|
423
|
+
const a = t[n], o = e[n];
|
|
424
|
+
JSON.stringify(a) !== JSON.stringify(o) && (i[n] = { from: a, to: o });
|
|
387
425
|
}), i;
|
|
388
426
|
}
|
|
389
427
|
hide() {
|
|
@@ -396,53 +434,52 @@ const g = class g {
|
|
|
396
434
|
if (t === void 0) {
|
|
397
435
|
const e = {};
|
|
398
436
|
for (const i in this.settings)
|
|
399
|
-
if (
|
|
437
|
+
if (Object.prototype.hasOwnProperty.call(this.settings, i)) {
|
|
400
438
|
const s = this.settings[i];
|
|
401
|
-
s instanceof
|
|
439
|
+
s instanceof p ? e[i] = s.getValues() : e[i] = s.value;
|
|
402
440
|
}
|
|
403
441
|
return e;
|
|
404
442
|
} else {
|
|
405
443
|
const e = this.settings[t];
|
|
406
|
-
return e ? e instanceof
|
|
444
|
+
return e ? e instanceof p ? e.getValues() : e.value : void 0;
|
|
407
445
|
}
|
|
408
446
|
}
|
|
409
447
|
getValuesForJson(t) {
|
|
410
448
|
if (t === void 0) {
|
|
411
|
-
if (this.includeGetJson === !1)
|
|
412
|
-
return null;
|
|
449
|
+
if (this.includeGetJson === !1) return null;
|
|
413
450
|
const e = {};
|
|
414
451
|
for (const i in this.settings)
|
|
415
|
-
if (
|
|
452
|
+
if (Object.prototype.hasOwnProperty.call(this.settings, i)) {
|
|
416
453
|
const s = this.settings[i];
|
|
417
|
-
s instanceof
|
|
454
|
+
s instanceof p ? e[i] = s.getValuesForJson() : s.includeGetJson === !1 ? e[i] = null : e[i] = s.value;
|
|
418
455
|
}
|
|
419
456
|
return e;
|
|
420
457
|
} else {
|
|
421
458
|
const e = this.settings[t];
|
|
422
|
-
return e ? e instanceof
|
|
459
|
+
return e ? e instanceof p ? e.includeGetJson === !1 ? null : e.getValuesForJson() : e.includeGetJson === !1 ? null : e.value : void 0;
|
|
423
460
|
}
|
|
424
461
|
}
|
|
425
462
|
getDefaultValues(t) {
|
|
426
463
|
if (t === void 0) {
|
|
427
464
|
const e = {};
|
|
428
465
|
for (const i in this.settings)
|
|
429
|
-
if (
|
|
466
|
+
if (Object.prototype.hasOwnProperty.call(this.settings, i)) {
|
|
430
467
|
const s = this.settings[i];
|
|
431
|
-
s instanceof
|
|
468
|
+
s instanceof p ? e[i] = s.getDefaultValues() : e[i] = s.default !== void 0 ? s.default : s.value;
|
|
432
469
|
}
|
|
433
470
|
return e;
|
|
434
471
|
} else {
|
|
435
472
|
const e = this.settings[t];
|
|
436
|
-
return e ? e instanceof
|
|
473
|
+
return e ? e instanceof p ? e.getDefaultValues() : e.default !== void 0 ? e.default : e.value : void 0;
|
|
437
474
|
}
|
|
438
475
|
}
|
|
439
476
|
getMobileValues(t) {
|
|
440
477
|
if (t === void 0) {
|
|
441
478
|
const e = {};
|
|
442
479
|
for (const i in this.settings)
|
|
443
|
-
if (
|
|
480
|
+
if (Object.prototype.hasOwnProperty.call(this.settings, i)) {
|
|
444
481
|
const s = this.settings[i];
|
|
445
|
-
if (s instanceof
|
|
482
|
+
if (s instanceof p)
|
|
446
483
|
e[i] = s.getMobileValues();
|
|
447
484
|
else if (typeof s.getMobileValue == "function") {
|
|
448
485
|
const n = s.getMobileValue();
|
|
@@ -454,19 +491,18 @@ const g = class g {
|
|
|
454
491
|
} else {
|
|
455
492
|
const e = this.settings[t];
|
|
456
493
|
if (!e) return;
|
|
457
|
-
if (e instanceof
|
|
458
|
-
return e.getMobileValues();
|
|
494
|
+
if (e instanceof p) return e.getMobileValues();
|
|
459
495
|
if (typeof e.getMobileValue == "function") {
|
|
460
496
|
const i = e.getMobileValue();
|
|
461
497
|
return i !== void 0 ? i : e.value;
|
|
462
|
-
}
|
|
463
|
-
|
|
498
|
+
}
|
|
499
|
+
return e.value;
|
|
464
500
|
}
|
|
465
501
|
}
|
|
466
502
|
setMobileValues(t) {
|
|
467
503
|
if (!(!t || typeof t != "object") && (Object.entries(t).forEach(([e, i]) => {
|
|
468
504
|
const s = this.settings[e];
|
|
469
|
-
s && (s instanceof
|
|
505
|
+
s && (s instanceof p ? typeof i == "object" && i !== null && s.setMobileValues(i) : typeof s.setMobileValue == "function" && s.setMobileValue(i));
|
|
470
506
|
}), this.setValue(t), this.onChange)) {
|
|
471
507
|
const e = this.getValues();
|
|
472
508
|
this.onChange(e);
|
|
@@ -481,7 +517,7 @@ const g = class g {
|
|
|
481
517
|
}
|
|
482
518
|
draw() {
|
|
483
519
|
const t = document.createElement("div");
|
|
484
|
-
t.className = "setting-group", t.id = `setting-group-${this.id}`,
|
|
520
|
+
t.className = "setting-group", t.id = `setting-group-${this.id}`, p.hiddenElements.add(t), this.hideCondition && this.hideCondition() && (t.style.display = "none"), this.isMain && t.classList.add("main-group"), this.custom && t.classList.add("custom_class"), b(t, this.nestingLevel);
|
|
485
521
|
const e = document.createElement("div");
|
|
486
522
|
e.className = "setting-group-title", this.isCollapsed && e.classList.add("collapsed-view"), e.setAttribute("role", "button"), e.setAttribute(
|
|
487
523
|
"aria-expanded",
|
|
@@ -499,28 +535,28 @@ const g = class g {
|
|
|
499
535
|
const r = document.createElement("span");
|
|
500
536
|
r.className = "info-marker", r.innerHTML = `
|
|
501
537
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
502
|
-
<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"
|
|
538
|
+
<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"
|
|
503
539
|
stroke="currentColor" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>
|
|
504
540
|
</svg>
|
|
505
541
|
`, r.title = this.description, n.appendChild(r);
|
|
506
542
|
}
|
|
507
|
-
const
|
|
508
|
-
|
|
543
|
+
const a = document.createElement("span");
|
|
544
|
+
a.className = "setting-group-arrow", a.innerHTML = `
|
|
509
545
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
510
546
|
<path d="M4 6L8 10L12 6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
511
547
|
</svg>
|
|
512
|
-
`, this.isCollapsed &&
|
|
513
|
-
const
|
|
514
|
-
if (
|
|
548
|
+
`, this.isCollapsed && a.classList.add("rotated"), n.appendChild(a);
|
|
549
|
+
const o = document.createElement("div");
|
|
550
|
+
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) {
|
|
515
551
|
const r = document.createElement("div");
|
|
516
|
-
r.className = "setting-group-description", r.textContent = this.description,
|
|
552
|
+
r.className = "setting-group-description", r.textContent = this.description, o.appendChild(r);
|
|
517
553
|
}
|
|
518
554
|
const l = () => {
|
|
519
|
-
this.isCollapsed = !this.isCollapsed,
|
|
555
|
+
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(
|
|
520
556
|
"aria-expanded",
|
|
521
557
|
(!this.isCollapsed).toString()
|
|
522
558
|
);
|
|
523
|
-
const r =
|
|
559
|
+
const r = o.querySelector(
|
|
524
560
|
".setting-group-description"
|
|
525
561
|
), d = n.querySelector(".info-marker");
|
|
526
562
|
if (this.description)
|
|
@@ -529,17 +565,17 @@ const g = class g {
|
|
|
529
565
|
const u = document.createElement("span");
|
|
530
566
|
u.className = "info-marker", u.innerHTML = `
|
|
531
567
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
532
|
-
<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"
|
|
568
|
+
<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"
|
|
533
569
|
stroke="currentColor" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>
|
|
534
570
|
</svg>
|
|
535
|
-
`, u.title = this.description, n.insertBefore(u,
|
|
571
|
+
`, u.title = this.description, n.insertBefore(u, a);
|
|
536
572
|
}
|
|
537
573
|
} else {
|
|
538
574
|
if (!r) {
|
|
539
575
|
const u = document.createElement("div");
|
|
540
|
-
u.className = "setting-group-description", u.textContent = this.description,
|
|
576
|
+
u.className = "setting-group-description", u.textContent = this.description, o.insertBefore(
|
|
541
577
|
u,
|
|
542
|
-
|
|
578
|
+
o.firstChild
|
|
543
579
|
);
|
|
544
580
|
}
|
|
545
581
|
d && d.remove();
|
|
@@ -549,15 +585,30 @@ const g = class g {
|
|
|
549
585
|
(r.key === "Enter" || r.key === " ") && (r.preventDefault(), l());
|
|
550
586
|
}, Object.keys(this.settings).length > 0) {
|
|
551
587
|
for (const r in this.settings)
|
|
552
|
-
if (
|
|
588
|
+
if (Object.prototype.hasOwnProperty.call(this.settings, r)) {
|
|
553
589
|
const d = this.settings[r];
|
|
554
|
-
d instanceof
|
|
590
|
+
d instanceof p && d.setNestingLevel(this.nestingLevel + 1), o.appendChild(d.draw());
|
|
555
591
|
}
|
|
556
592
|
} else {
|
|
557
593
|
const r = document.createElement("div");
|
|
558
|
-
r.className = "setting-group-empty", r.textContent = "No settings in this group",
|
|
594
|
+
r.className = "setting-group-empty", r.textContent = "No settings in this group", o.appendChild(r);
|
|
595
|
+
}
|
|
596
|
+
if (this.addItemCfg) {
|
|
597
|
+
const r = document.createElement("button");
|
|
598
|
+
r.type = "button", r.className = "sg-add-button-bottom", r.style.marginTop = "8px";
|
|
599
|
+
const d = this.addItemCfg.buttonIconSvg ?? `
|
|
600
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none"
|
|
601
|
+
xmlns="http://www.w3.org/2000/svg">
|
|
602
|
+
<path d="M8 3.333v9.334M3.333 8h9.334" stroke="currentColor"
|
|
603
|
+
stroke-width="1.5" stroke-linecap="round"/>
|
|
604
|
+
</svg>`;
|
|
605
|
+
r.innerHTML = `${d}<span style="margin-left:4px;">${this.addItemCfg.buttonLabel ?? "Add"}</span>`, r.addEventListener("click", (u) => {
|
|
606
|
+
u.stopPropagation(), u.preventDefault();
|
|
607
|
+
const V = this.getNextIndexFromPrefix(this.addItemCfg.keyPrefix), x = this.addItemCfg.createItem(V), S = `${this.addItemCfg.keyPrefix}${V}`;
|
|
608
|
+
this.addSetting(S, x), this.addItemCfg.expandNewItem !== !1 && x.expand && x.expand();
|
|
609
|
+
}), o.appendChild(r);
|
|
559
610
|
}
|
|
560
|
-
return e.appendChild(i), e.appendChild(n), t.appendChild(e), t.appendChild(
|
|
611
|
+
return e.appendChild(i), e.appendChild(n), t.appendChild(e), t.appendChild(o), this.elementRef = t, N.trackElement(t), setTimeout(() => {
|
|
561
612
|
this.updateNestingStyles();
|
|
562
613
|
}, 0), this.pendingBlurHandler && (this.setupBlurHandlers(), this.pendingBlurHandler = null), t;
|
|
563
614
|
}
|
|
@@ -594,10 +645,10 @@ const g = class g {
|
|
|
594
645
|
let i = e;
|
|
595
646
|
const s = Object.keys(this.settings), n = Object.keys(e);
|
|
596
647
|
if (!s.some(
|
|
597
|
-
(
|
|
648
|
+
(o) => n.includes(o)
|
|
598
649
|
) && n.length === 1) {
|
|
599
|
-
const
|
|
600
|
-
i = e[
|
|
650
|
+
const o = n[0];
|
|
651
|
+
i = e[o];
|
|
601
652
|
}
|
|
602
653
|
this.setValue(i);
|
|
603
654
|
} catch (e) {
|
|
@@ -605,9 +656,9 @@ const g = class g {
|
|
|
605
656
|
}
|
|
606
657
|
}
|
|
607
658
|
};
|
|
608
|
-
|
|
609
|
-
let f =
|
|
610
|
-
class
|
|
659
|
+
p.hiddenElements = /* @__PURE__ */ new Set();
|
|
660
|
+
let f = p;
|
|
661
|
+
class pt extends f {
|
|
611
662
|
constructor(t) {
|
|
612
663
|
super(t);
|
|
613
664
|
const e = Object.keys(this.settings)[0];
|
|
@@ -641,28 +692,28 @@ class ct extends f {
|
|
|
641
692
|
s.textContent = this.title, i.appendChild(s);
|
|
642
693
|
const n = document.createElement("div");
|
|
643
694
|
n.className = "tabs-header", this.tabsContainer = n;
|
|
644
|
-
const
|
|
645
|
-
if (
|
|
695
|
+
const a = document.createElement("div");
|
|
696
|
+
if (a.className = "tab-content", this.contentContainers = {}, Object.keys(this.settings).forEach((o, l) => {
|
|
646
697
|
const h = document.createElement("button");
|
|
647
|
-
h.className = "tab-button", h.type = "button", h.setAttribute("data-tab-id",
|
|
698
|
+
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);
|
|
648
699
|
const r = document.createElement("div");
|
|
649
|
-
r.className = "tab-panel", this.contentContainers[
|
|
650
|
-
const d = this.settings[
|
|
651
|
-
d && (d instanceof f && d.setNestingLevel(this.getNestingLevel() + 1), r.appendChild(d.draw())),
|
|
652
|
-
}), e.appendChild(i), e.appendChild(n), e.appendChild(
|
|
653
|
-
const
|
|
654
|
-
this.activeTabId =
|
|
700
|
+
r.className = "tab-panel", this.contentContainers[o] = r;
|
|
701
|
+
const d = this.settings[o];
|
|
702
|
+
d && (d instanceof f && d.setNestingLevel(this.getNestingLevel() + 1), r.appendChild(d.draw())), a.appendChild(r), l === 0 && !this.activeTabId && (this.activeTabId = o);
|
|
703
|
+
}), e.appendChild(i), e.appendChild(n), e.appendChild(a), !this.activeTabId) {
|
|
704
|
+
const o = Object.keys(this.settings)[0];
|
|
705
|
+
this.activeTabId = o || "";
|
|
655
706
|
}
|
|
656
707
|
return this.updateTabUI(), t;
|
|
657
708
|
}
|
|
658
709
|
}
|
|
659
|
-
function
|
|
710
|
+
function R(c) {
|
|
660
711
|
return new f(c);
|
|
661
712
|
}
|
|
662
|
-
function
|
|
713
|
+
function gt(c) {
|
|
663
714
|
return c;
|
|
664
715
|
}
|
|
665
|
-
class
|
|
716
|
+
class $ extends g {
|
|
666
717
|
constructor(t = {}) {
|
|
667
718
|
super(t), this.inputType = "text", t.onChange && this.setOnChange(t.onChange);
|
|
668
719
|
}
|
|
@@ -682,12 +733,12 @@ class B extends p {
|
|
|
682
733
|
});
|
|
683
734
|
}
|
|
684
735
|
}
|
|
685
|
-
const
|
|
686
|
-
class m extends
|
|
736
|
+
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>";
|
|
737
|
+
class m extends $ {
|
|
687
738
|
constructor(t) {
|
|
688
739
|
super({
|
|
689
740
|
...t,
|
|
690
|
-
icon: t.icon ||
|
|
741
|
+
icon: t.icon || F,
|
|
691
742
|
title: t.title || "Color",
|
|
692
743
|
default: t.default ? m.normalizeColorValue(t.default) : "#000000"
|
|
693
744
|
}), this.inputType = "color", this.element = null, this.colorInputEl = null, this.textInputEl = null, this.detectChange = t.detectChange;
|
|
@@ -702,11 +753,11 @@ class m extends B {
|
|
|
702
753
|
const e = t.split(",").map((r) => parseInt(r.trim()));
|
|
703
754
|
if (e.length !== 3 || e.some(isNaN))
|
|
704
755
|
return console.warn(`Invalid RGB value "${t}", using default "#000000"`), "#000000";
|
|
705
|
-
const [i, s, n] = e,
|
|
756
|
+
const [i, s, n] = e, a = Math.max(0, Math.min(255, i)), o = Math.max(0, Math.min(255, s)), l = Math.max(0, Math.min(255, n)), h = (r) => {
|
|
706
757
|
const d = r.toString(16);
|
|
707
758
|
return d.length === 1 ? "0" + d : d;
|
|
708
759
|
};
|
|
709
|
-
return `#${h(
|
|
760
|
+
return `#${h(a)}${h(o)}${h(l)}`;
|
|
710
761
|
}
|
|
711
762
|
setValue(t) {
|
|
712
763
|
if (t === void 0) {
|
|
@@ -750,10 +801,10 @@ class m extends B {
|
|
|
750
801
|
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;
|
|
751
802
|
const n = document.createElement("div");
|
|
752
803
|
n.className = "color-preview";
|
|
753
|
-
const
|
|
754
|
-
n.style.backgroundColor =
|
|
755
|
-
const
|
|
756
|
-
return
|
|
804
|
+
const a = this.value || "#000000";
|
|
805
|
+
n.style.backgroundColor = a;
|
|
806
|
+
const o = document.createElement("input");
|
|
807
|
+
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) => {
|
|
757
808
|
var r, d;
|
|
758
809
|
let h = l.target.value.trim();
|
|
759
810
|
if (this.textInputEl && i(this.textInputEl)) {
|
|
@@ -768,7 +819,7 @@ class m extends B {
|
|
|
768
819
|
var d, u;
|
|
769
820
|
const h = l.target.value, r = m.normalizeColorValue(h);
|
|
770
821
|
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;
|
|
771
|
-
}), e.appendChild(s), e.appendChild(n), e.appendChild(
|
|
822
|
+
}), e.appendChild(s), e.appendChild(n), e.appendChild(o), t.appendChild(e), this.element = t, t;
|
|
772
823
|
}
|
|
773
824
|
getElement() {
|
|
774
825
|
return this.element;
|
|
@@ -786,17 +837,17 @@ class m extends B {
|
|
|
786
837
|
return this.isValidHex() ? this.hexToRgb(this.value) : "0, 0, 0";
|
|
787
838
|
}
|
|
788
839
|
}
|
|
789
|
-
const
|
|
840
|
+
const z = `
|
|
790
841
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
791
842
|
<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"/>
|
|
792
843
|
<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"/>
|
|
793
844
|
<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"/>
|
|
794
845
|
</svg>`;
|
|
795
|
-
class C extends
|
|
846
|
+
class C extends g {
|
|
796
847
|
constructor(t = {}) {
|
|
797
848
|
super({
|
|
798
849
|
...t,
|
|
799
|
-
icon: t.icon ||
|
|
850
|
+
icon: t.icon || z,
|
|
800
851
|
title: t.title || "Color & Opacity",
|
|
801
852
|
default: t.default || "#000000FF"
|
|
802
853
|
}), this.inputType = "color", this.element = null, this.colorInputEl = null, this.textInputEl = null, this.opacityInputEl = null, this.colorPreviewEl = null, this.detectChange = t.detectChange, this.value && (this.value = C.normalizeHexWithOpacity(this.value));
|
|
@@ -824,8 +875,8 @@ class C extends p {
|
|
|
824
875
|
}
|
|
825
876
|
updateColorPreview() {
|
|
826
877
|
if (!this.colorPreviewEl || !this.value) return;
|
|
827
|
-
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),
|
|
828
|
-
this.colorPreviewEl.style.backgroundColor = `rgba(${s}, ${n}, ${
|
|
878
|
+
const t = this.getRgbColor(), e = this.getOpacityPercent() / 100, i = t.replace("#", ""), s = parseInt(i.substring(0, 2), 16), n = parseInt(i.substring(2, 4), 16), a = parseInt(i.substring(4, 6), 16);
|
|
879
|
+
this.colorPreviewEl.style.backgroundColor = `rgba(${s}, ${n}, ${a}, ${e})`;
|
|
829
880
|
}
|
|
830
881
|
handleColorChange(t) {
|
|
831
882
|
const e = this.getOpacityPercent(), i = C.combineColorOpacity(t, e);
|
|
@@ -842,41 +893,41 @@ class C extends p {
|
|
|
842
893
|
draw() {
|
|
843
894
|
const t = document.createElement("div");
|
|
844
895
|
if (t.className = "color-with-opacity-setting-wrapper " + (this.props.wrapperClassName || ""), this.props.title || this.props.icon) {
|
|
845
|
-
const
|
|
846
|
-
if (
|
|
847
|
-
const
|
|
848
|
-
|
|
896
|
+
const a = document.createElement("div");
|
|
897
|
+
if (a.className = "icon-container", this.props.icon) {
|
|
898
|
+
const o = document.createElement("span");
|
|
899
|
+
o.className = "input-icon", o.innerHTML = this.props.icon, a.appendChild(o);
|
|
849
900
|
}
|
|
850
901
|
if (this.props.title) {
|
|
851
|
-
const
|
|
852
|
-
|
|
902
|
+
const o = document.createElement("span");
|
|
903
|
+
o.className = "input-label", o.textContent = this.props.title, a.appendChild(o);
|
|
853
904
|
}
|
|
854
|
-
t.appendChild(
|
|
905
|
+
t.appendChild(a);
|
|
855
906
|
}
|
|
856
907
|
const e = document.createElement("div");
|
|
857
|
-
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", (
|
|
858
|
-
const
|
|
859
|
-
this.handleColorChange(
|
|
860
|
-
}), this.textInputEl.addEventListener("input", (
|
|
861
|
-
const
|
|
862
|
-
this.handleTextInput(
|
|
863
|
-
}), this.textInputEl.addEventListener("blur", (
|
|
864
|
-
const
|
|
865
|
-
|
|
908
|
+
e.className = "color-with-opacity-input-wrapper", this.colorInputEl = document.createElement("input"), this.colorInputEl.type = "color", this.colorInputEl.className = "color-with-opacity-picker", this.colorPreviewEl = document.createElement("div"), this.colorPreviewEl.className = "color-with-opacity-preview", this.textInputEl = document.createElement("input"), this.textInputEl.type = "text", this.textInputEl.className = "color-with-opacity-text-input", this.textInputEl.placeholder = "#000000FF", this.updateInputElements(), this.updateColorPreview(), this.colorInputEl.addEventListener("input", (a) => {
|
|
909
|
+
const o = a.target;
|
|
910
|
+
this.handleColorChange(o.value), this.textInputEl && (this.textInputEl.value = this.value || "#000000FF"), this.updateColorPreview();
|
|
911
|
+
}), this.textInputEl.addEventListener("input", (a) => {
|
|
912
|
+
const o = a.target;
|
|
913
|
+
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");
|
|
914
|
+
}), this.textInputEl.addEventListener("blur", (a) => {
|
|
915
|
+
const o = a.target;
|
|
916
|
+
o.value.trim() === "" && (o.value = this.value || "#000000FF", e.classList.remove("error"));
|
|
866
917
|
}), this.colorPreviewEl.addEventListener("click", () => {
|
|
867
|
-
var
|
|
868
|
-
(
|
|
918
|
+
var a;
|
|
919
|
+
(a = this.colorInputEl) == null || a.click();
|
|
869
920
|
}), e.appendChild(this.colorInputEl), e.appendChild(this.colorPreviewEl), e.appendChild(this.textInputEl);
|
|
870
921
|
const i = document.createElement("div");
|
|
871
922
|
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";
|
|
872
923
|
const s = document.createElement("span");
|
|
873
|
-
s.className = "color-with-opacity-opacity-suffix", s.textContent = "%", this.opacityInputEl.addEventListener("input", (
|
|
874
|
-
const
|
|
924
|
+
s.className = "color-with-opacity-opacity-suffix", s.textContent = "%", this.opacityInputEl.addEventListener("input", (a) => {
|
|
925
|
+
const o = a.target, l = parseFloat(o.value);
|
|
875
926
|
isNaN(l) || (this.handleOpacityChange(l), this.textInputEl && (this.textInputEl.value = this.value || "#000000FF"), this.updateColorPreview());
|
|
876
|
-
}), this.opacityInputEl.addEventListener("blur", (
|
|
877
|
-
const
|
|
878
|
-
let l = parseFloat(
|
|
879
|
-
isNaN(l) && (l = this.getOpacityPercent()), l = Math.max(0, Math.min(100, l)),
|
|
927
|
+
}), this.opacityInputEl.addEventListener("blur", (a) => {
|
|
928
|
+
const o = a.target;
|
|
929
|
+
let l = parseFloat(o.value);
|
|
930
|
+
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();
|
|
880
931
|
}), i.appendChild(this.opacityInputEl), i.appendChild(s);
|
|
881
932
|
const n = document.createElement("div");
|
|
882
933
|
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;
|
|
@@ -889,8 +940,8 @@ class C extends p {
|
|
|
889
940
|
}
|
|
890
941
|
getRgbaValue() {
|
|
891
942
|
if (!this.value) return "rgba(0, 0, 0, 1)";
|
|
892
|
-
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),
|
|
893
|
-
return `rgba(${s}, ${n}, ${
|
|
943
|
+
const t = this.getRgbColor(), e = this.getOpacityPercent() / 100, i = t.replace("#", ""), s = parseInt(i.substring(0, 2), 16), n = parseInt(i.substring(2, 4), 16), a = parseInt(i.substring(4, 6), 16);
|
|
944
|
+
return `rgba(${s}, ${n}, ${a}, ${e})`;
|
|
894
945
|
}
|
|
895
946
|
getColorAndOpacity() {
|
|
896
947
|
return {
|
|
@@ -899,7 +950,7 @@ class C extends p {
|
|
|
899
950
|
};
|
|
900
951
|
}
|
|
901
952
|
}
|
|
902
|
-
class
|
|
953
|
+
class mt extends g {
|
|
903
954
|
constructor(t = {}) {
|
|
904
955
|
super(t), this.inputType = "text", t.onChange && this.setOnChange(t.onChange);
|
|
905
956
|
}
|
|
@@ -911,27 +962,27 @@ class ut extends p {
|
|
|
911
962
|
if (t.className = "html-setting-wrapper " + (this.props.wrapperClassName || ""), this.props.title || this.props.icon) {
|
|
912
963
|
const n = document.createElement("div");
|
|
913
964
|
if (n.className = "icon-container", this.props.icon) {
|
|
914
|
-
const
|
|
915
|
-
n.appendChild(
|
|
965
|
+
const a = this.createIcon(this.props.icon);
|
|
966
|
+
n.appendChild(a);
|
|
916
967
|
}
|
|
917
968
|
if (this.props.title) {
|
|
918
|
-
const
|
|
919
|
-
n.appendChild(
|
|
969
|
+
const a = this.createLabel(this.props.title);
|
|
970
|
+
n.appendChild(a);
|
|
920
971
|
}
|
|
921
972
|
t.appendChild(n);
|
|
922
973
|
}
|
|
923
974
|
const e = document.createElement("textarea");
|
|
924
975
|
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);
|
|
925
976
|
const i = (n) => {
|
|
926
|
-
const
|
|
927
|
-
this.value =
|
|
977
|
+
const o = n.target.value;
|
|
978
|
+
this.value = o, this.onChange && this.onChange(this.value), this.props.detectChange && this.props.detectChange(this.value);
|
|
928
979
|
}, s = (n) => {
|
|
929
980
|
this.onBlur && this.value !== void 0 && this.onBlur(this.value);
|
|
930
981
|
};
|
|
931
982
|
return e.addEventListener("input", i), e.addEventListener("change", i), e.addEventListener("blur", s), t.appendChild(e), t;
|
|
932
983
|
}
|
|
933
984
|
}
|
|
934
|
-
class v extends
|
|
985
|
+
class v extends g {
|
|
935
986
|
constructor(t) {
|
|
936
987
|
super(t), this.inputType = "number", this.inputElement = null, this.mobileValue = t.mobile, this.validateProps(), this.value = this.validateValue(this.value);
|
|
937
988
|
}
|
|
@@ -954,12 +1005,12 @@ class v extends p {
|
|
|
954
1005
|
const i = document.createElement("input");
|
|
955
1006
|
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", () => {
|
|
956
1007
|
const s = this.props.minValue ?? Number.MIN_SAFE_INTEGER, n = this.props.maxValue ?? Number.MAX_SAFE_INTEGER;
|
|
957
|
-
let
|
|
958
|
-
|
|
1008
|
+
let a = Number(i.value);
|
|
1009
|
+
a < s && (a = s), a > n && (a = n), String(a) !== i.value && (i.value = String(a)), this.setValue(a);
|
|
959
1010
|
}), i.addEventListener("blur", () => {
|
|
960
|
-
var n,
|
|
1011
|
+
var n, a;
|
|
961
1012
|
const s = this.validateValue(Number(i.value));
|
|
962
|
-
s !== Number(i.value) && (i.value = String(s), this.setValue(s)), (
|
|
1013
|
+
s !== Number(i.value) && (i.value = String(s), this.setValue(s)), (a = (n = this.props).onBlur) == null || a.call(n);
|
|
963
1014
|
}), e.appendChild(i), this.props.suffix && this.props.suffix !== "none") {
|
|
964
1015
|
const s = document.createElement("span");
|
|
965
1016
|
s.className = "suffix-label", s.textContent = this.props.suffix, e.appendChild(s);
|
|
@@ -990,12 +1041,12 @@ class v extends p {
|
|
|
990
1041
|
);
|
|
991
1042
|
}
|
|
992
1043
|
}
|
|
993
|
-
const
|
|
1044
|
+
const G = `
|
|
994
1045
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
995
1046
|
<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"/>
|
|
996
1047
|
<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"/>
|
|
997
1048
|
</svg>`;
|
|
998
|
-
class
|
|
1049
|
+
class j extends v {
|
|
999
1050
|
constructor(t = {}) {
|
|
1000
1051
|
const e = {
|
|
1001
1052
|
title: "Opacity",
|
|
@@ -1004,7 +1055,7 @@ class F extends v {
|
|
|
1004
1055
|
maxValue: 100,
|
|
1005
1056
|
step: 1,
|
|
1006
1057
|
default: t.default ?? 100,
|
|
1007
|
-
icon:
|
|
1058
|
+
icon: G,
|
|
1008
1059
|
...t
|
|
1009
1060
|
};
|
|
1010
1061
|
super(e), this.inputType = "number", this.mobileValue = t.mobile;
|
|
@@ -1016,12 +1067,12 @@ class F extends v {
|
|
|
1016
1067
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
1017
1068
|
}
|
|
1018
1069
|
}
|
|
1019
|
-
const
|
|
1070
|
+
const P = `
|
|
1020
1071
|
<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">
|
|
1021
1072
|
<polyline points="6 9 12 15 18 9"></polyline>
|
|
1022
1073
|
</svg>
|
|
1023
1074
|
`;
|
|
1024
|
-
class
|
|
1075
|
+
class k extends g {
|
|
1025
1076
|
constructor(t = {}) {
|
|
1026
1077
|
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) {
|
|
1027
1078
|
const e = this._options.findIndex((i) => i.value === this.value);
|
|
@@ -1042,12 +1093,12 @@ class y extends p {
|
|
|
1042
1093
|
if (t.classList.add("select-container"), this.container = t, this.props.icon || this.props.title) {
|
|
1043
1094
|
const n = document.createElement("div");
|
|
1044
1095
|
if (n.className = "icon-container", this.props.icon) {
|
|
1045
|
-
const
|
|
1046
|
-
n.appendChild(
|
|
1096
|
+
const a = this.createIcon(this.props.icon);
|
|
1097
|
+
n.appendChild(a);
|
|
1047
1098
|
}
|
|
1048
1099
|
if (this.props.title) {
|
|
1049
|
-
const
|
|
1050
|
-
n.appendChild(
|
|
1100
|
+
const a = this.createLabel(this.props.title);
|
|
1101
|
+
n.appendChild(a);
|
|
1051
1102
|
}
|
|
1052
1103
|
t.appendChild(n);
|
|
1053
1104
|
} else {
|
|
@@ -1056,22 +1107,22 @@ class y extends p {
|
|
|
1056
1107
|
}
|
|
1057
1108
|
const e = document.createElement("div");
|
|
1058
1109
|
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 = () => {
|
|
1059
|
-
var n,
|
|
1060
|
-
this.isLoading || (this.isOpen = !this.isOpen, this.isOpen ? this.checkDropdownPosition() : this.cleanupDropdownPosition(), (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (
|
|
1110
|
+
var n, a;
|
|
1111
|
+
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));
|
|
1061
1112
|
}, t.appendChild(e), this.buttonEl = e;
|
|
1062
1113
|
const i = document.createElement("ul");
|
|
1063
|
-
i.classList.add("select-options"), this._options.forEach((n,
|
|
1064
|
-
const
|
|
1065
|
-
|
|
1114
|
+
i.classList.add("select-options"), this._options.forEach((n, a) => {
|
|
1115
|
+
const o = this.createOption(n, a);
|
|
1116
|
+
o.onclick = (l) => this.selectOption(l, a, e), i.appendChild(o);
|
|
1066
1117
|
}), document.body.appendChild(i);
|
|
1067
1118
|
const s = document.createElement("div");
|
|
1068
|
-
return s.classList.add("svg-container"), s.innerHTML =
|
|
1119
|
+
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) => {
|
|
1069
1120
|
this._options.push(...n), this.isLoading = !1, this.updateOptionsList(), this.updateButtonText();
|
|
1070
1121
|
}).catch((n) => {
|
|
1071
1122
|
console.error("Failed to fetch async options:", n), this.isLoading = !1, this.updateButtonText("Failed to load options");
|
|
1072
1123
|
})), this.clickOutsideListener && document.removeEventListener("click", this.clickOutsideListener), this.clickOutsideListener = (n) => {
|
|
1073
|
-
var
|
|
1074
|
-
this.isOpen && !t.contains(n.target) && (this.isOpen = !1, (
|
|
1124
|
+
var a, o;
|
|
1125
|
+
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());
|
|
1075
1126
|
}, document.addEventListener("click", this.clickOutsideListener), this.resizeListener && window.removeEventListener("resize", this.resizeListener), this.resizeListener = () => {
|
|
1076
1127
|
this.isOpen && this.checkDropdownPosition();
|
|
1077
1128
|
}, window.addEventListener("resize", this.resizeListener), t;
|
|
@@ -1093,9 +1144,9 @@ class y extends p {
|
|
|
1093
1144
|
}
|
|
1094
1145
|
}
|
|
1095
1146
|
selectOption(t, e, i) {
|
|
1096
|
-
var n,
|
|
1147
|
+
var n, a, o;
|
|
1097
1148
|
const s = this._options[e];
|
|
1098
|
-
s && (this.value = s.value, (n = this.onChange) == null || n.call(this, this.value), this.selectedOptionIndex = e, this.isOpen = !1, i.textContent = s.name, (
|
|
1149
|
+
s && (this.value = s.value, (n = this.onChange) == null || n.call(this, this.value), this.selectedOptionIndex = e, this.isOpen = !1, i.textContent = s.name, (a = this.optionsListEl) == null || a.classList.remove("open"), (o = this.svgContainer) == null || o.classList.remove("open"), this.cleanupDropdownPosition(), this.optionsListEl && this.optionsListEl.querySelectorAll(".select-option").forEach((h, r) => {
|
|
1099
1150
|
r === e ? h.classList.add("selected") : h.classList.remove("selected");
|
|
1100
1151
|
}));
|
|
1101
1152
|
}
|
|
@@ -1134,7 +1185,7 @@ class y extends p {
|
|
|
1134
1185
|
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();
|
|
1135
1186
|
}
|
|
1136
1187
|
}
|
|
1137
|
-
class
|
|
1188
|
+
class W extends g {
|
|
1138
1189
|
constructor(t = {}) {
|
|
1139
1190
|
super(t), this.inputType = "button", this.value || (this.value = "center");
|
|
1140
1191
|
}
|
|
@@ -1179,15 +1230,15 @@ class G extends p {
|
|
|
1179
1230
|
`
|
|
1180
1231
|
}
|
|
1181
1232
|
].forEach((n) => {
|
|
1182
|
-
const
|
|
1183
|
-
|
|
1184
|
-
var
|
|
1185
|
-
i.querySelectorAll(".align-option-button").forEach((l) => l.classList.remove("selected")),
|
|
1186
|
-
}), i.appendChild(
|
|
1233
|
+
const a = document.createElement("button");
|
|
1234
|
+
a.className = "align-option-button", a.innerHTML = n.icon, this.value === n.name && a.classList.add("selected"), a.addEventListener("click", () => {
|
|
1235
|
+
var o;
|
|
1236
|
+
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);
|
|
1237
|
+
}), i.appendChild(a);
|
|
1187
1238
|
}), t.appendChild(i), t;
|
|
1188
1239
|
}
|
|
1189
1240
|
}
|
|
1190
|
-
class
|
|
1241
|
+
class ft extends g {
|
|
1191
1242
|
constructor(t) {
|
|
1192
1243
|
super(t), this.inputType = "button", this.bgWithAlpha = "rgba(145, 158, 171, 0.08)";
|
|
1193
1244
|
}
|
|
@@ -1201,22 +1252,22 @@ class pt extends p {
|
|
|
1201
1252
|
/^rgba\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)$/i
|
|
1202
1253
|
);
|
|
1203
1254
|
if (n) {
|
|
1204
|
-
let
|
|
1205
|
-
r >= 1 ? (
|
|
1255
|
+
let o = +n[1], l = +n[2], h = +n[3], r = +n[4];
|
|
1256
|
+
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})`;
|
|
1206
1257
|
}
|
|
1207
1258
|
t.addEventListener("mouseenter", () => {
|
|
1208
1259
|
console.log("hoverBg", s), t.style.setProperty("background-color", s, "important");
|
|
1209
1260
|
}), t.addEventListener("mouseleave", () => {
|
|
1210
1261
|
t.style.setProperty("background-color", e, "important");
|
|
1211
1262
|
}), t.addEventListener("click", () => {
|
|
1212
|
-
var
|
|
1213
|
-
return (l = (
|
|
1263
|
+
var o, l;
|
|
1264
|
+
return (l = (o = this.props).onClick) == null ? void 0 : l.call(o);
|
|
1214
1265
|
});
|
|
1215
|
-
const
|
|
1216
|
-
return
|
|
1266
|
+
const a = document.createElement("div");
|
|
1267
|
+
return a.className = "button-setting-wrapper " + (this.props.wrapperClassName || ""), a.appendChild(t), a;
|
|
1217
1268
|
}
|
|
1218
1269
|
}
|
|
1219
|
-
class
|
|
1270
|
+
class vt extends g {
|
|
1220
1271
|
constructor(t = {}) {
|
|
1221
1272
|
super(t), this.inputType = { width: "number", height: "number" }, this.aspectRatio = 1, this.isUpdating = !1;
|
|
1222
1273
|
const e = t.width || 0, i = t.height || 0;
|
|
@@ -1229,14 +1280,14 @@ class gt extends p {
|
|
|
1229
1280
|
suffix: "px",
|
|
1230
1281
|
minValue: this.minWidth,
|
|
1231
1282
|
maxValue: this.maxWidth,
|
|
1232
|
-
icon:
|
|
1283
|
+
icon: D
|
|
1233
1284
|
}), this.heightSetting = new v({
|
|
1234
1285
|
title: "Height",
|
|
1235
1286
|
default: this.value.height,
|
|
1236
1287
|
suffix: "px",
|
|
1237
1288
|
minValue: this.minHeight,
|
|
1238
1289
|
maxValue: this.maxHeight,
|
|
1239
|
-
icon:
|
|
1290
|
+
icon: J
|
|
1240
1291
|
}), this.widthSetting.setOnChange(this.handleWidthChange.bind(this)), this.heightSetting.setOnChange(this.handleHeightChange.bind(this));
|
|
1241
1292
|
}
|
|
1242
1293
|
handleWidthChange(t) {
|
|
@@ -1306,8 +1357,8 @@ class gt extends p {
|
|
|
1306
1357
|
return n.className = "dimension-lock-icon", n.setAttribute("type", "button"), n.setAttribute("aria-pressed", String(this.locked)), n.setAttribute(
|
|
1307
1358
|
"aria-label",
|
|
1308
1359
|
this.locked ? "Unlock aspect ratio" : "Lock aspect ratio"
|
|
1309
|
-
), n.title = this.locked ? "Unlock aspect ratio" : "Lock aspect ratio", n.innerHTML = this.getLockSVG(this.locked), n.onclick = (
|
|
1310
|
-
|
|
1360
|
+
), n.title = this.locked ? "Unlock aspect ratio" : "Lock aspect ratio", n.innerHTML = this.getLockSVG(this.locked), n.onclick = (a) => {
|
|
1361
|
+
a.preventDefault(), this.toggleLock(n);
|
|
1311
1362
|
}, s.appendChild(n), t.appendChild(e), t.appendChild(s), t.appendChild(i), t;
|
|
1312
1363
|
}
|
|
1313
1364
|
isLocked() {
|
|
@@ -1330,24 +1381,24 @@ class gt extends p {
|
|
|
1330
1381
|
}
|
|
1331
1382
|
}
|
|
1332
1383
|
}
|
|
1333
|
-
const
|
|
1384
|
+
const D = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1334
1385
|
<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"/>
|
|
1335
|
-
</svg>`,
|
|
1386
|
+
</svg>`, J = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1336
1387
|
<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"/>
|
|
1337
|
-
</svg>`,
|
|
1388
|
+
</svg>`, y = `
|
|
1338
1389
|
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="16" viewBox="0 0 15 16" fill="none">
|
|
1339
1390
|
<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"/>
|
|
1340
1391
|
</svg>
|
|
1341
|
-
`,
|
|
1392
|
+
`, U = `
|
|
1342
1393
|
<svg width="91" height="71" viewBox="0 0 91 71" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1343
1394
|
<rect width="91" height="71" rx="4" fill="#F2F4F7"/>
|
|
1344
1395
|
<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"/>
|
|
1345
1396
|
</svg>
|
|
1346
|
-
`,
|
|
1397
|
+
`, _ = `
|
|
1347
1398
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 12 12" fill="none">
|
|
1348
1399
|
<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"/>
|
|
1349
1400
|
</svg>
|
|
1350
|
-
`,
|
|
1401
|
+
`, q = `
|
|
1351
1402
|
<svg xmlns="http://www.w3.org/2000/svg" width="29" height="29" viewBox="0 0 29 29" fill="none">
|
|
1352
1403
|
<!-- Top dot -->
|
|
1353
1404
|
<circle cx="14.5" cy="3" r="1.5" fill="#02CC59" opacity="1"/>
|
|
@@ -1367,7 +1418,7 @@ const W = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBo
|
|
|
1367
1418
|
<circle cx="6.7" cy="6.7" r="1.5" fill="#02CC59" opacity="0.3"/>
|
|
1368
1419
|
</svg>
|
|
1369
1420
|
`;
|
|
1370
|
-
class
|
|
1421
|
+
class Z extends g {
|
|
1371
1422
|
constructor(t = {}) {
|
|
1372
1423
|
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();
|
|
1373
1424
|
}
|
|
@@ -1417,18 +1468,18 @@ class U extends p {
|
|
|
1417
1468
|
);
|
|
1418
1469
|
if (t && t !== "") {
|
|
1419
1470
|
this.showLoading(), s && s instanceof HTMLElement && (s.style.display = "none"), e && e.classList.remove("no-image"), i && (i.innerHTML = `
|
|
1420
|
-
<span class="upload-icon">${
|
|
1471
|
+
<span class="upload-icon">${y}</span>
|
|
1421
1472
|
<span class="upload-label">Replace</span>
|
|
1422
1473
|
`);
|
|
1423
1474
|
const n = () => {
|
|
1424
|
-
this.hideLoading(), this.previewWrapper.classList.add("has-image"), this.previewEl.style.display = "block", this.previewEl.removeEventListener("load", n), this.previewEl.removeEventListener("error",
|
|
1425
|
-
},
|
|
1426
|
-
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",
|
|
1475
|
+
this.hideLoading(), this.previewWrapper.classList.add("has-image"), this.previewEl.style.display = "block", this.previewEl.removeEventListener("load", n), this.previewEl.removeEventListener("error", a);
|
|
1476
|
+
}, a = () => {
|
|
1477
|
+
this.hideLoading(), this.showError("Failed to load image. Please try again."), this.previewWrapper.classList.remove("has-image"), this.previewEl.style.display = "none", this.previewWrapper.style.display = "none", s && s instanceof HTMLElement && (s.style.display = "block"), e && e.classList.add("no-image"), this.previewEl.removeEventListener("load", n), this.previewEl.removeEventListener("error", a);
|
|
1427
1478
|
};
|
|
1428
|
-
this.previewEl.addEventListener("load", n), this.previewEl.addEventListener("error",
|
|
1479
|
+
this.previewEl.addEventListener("load", n), this.previewEl.addEventListener("error", a), this.previewEl.src = t;
|
|
1429
1480
|
} else
|
|
1430
1481
|
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 = `
|
|
1431
|
-
<span class="upload-icon">${
|
|
1482
|
+
<span class="upload-icon">${y}</span>
|
|
1432
1483
|
<span class="upload-label">Upload</span>
|
|
1433
1484
|
`);
|
|
1434
1485
|
}
|
|
@@ -1436,24 +1487,24 @@ class U extends p {
|
|
|
1436
1487
|
const t = document.createElement("div");
|
|
1437
1488
|
t.className = "upload-setting-wrapper", t.setAttribute("data-setting-id", this.id), t.addEventListener(
|
|
1438
1489
|
"focusout",
|
|
1439
|
-
(
|
|
1490
|
+
(o) => {
|
|
1440
1491
|
var l;
|
|
1441
|
-
|
|
1492
|
+
o.relatedTarget && t.contains(o.relatedTarget) || (l = this.onBlur) == null || l.call(this, this.value ?? "");
|
|
1442
1493
|
},
|
|
1443
1494
|
!0
|
|
1444
1495
|
);
|
|
1445
1496
|
const e = !!(this.props.title || this.props.icon);
|
|
1446
1497
|
if (e || t.classList.add("no-label"), e) {
|
|
1447
|
-
const
|
|
1448
|
-
if (
|
|
1498
|
+
const o = document.createElement("div");
|
|
1499
|
+
if (o.className = "icon-title-container", this.props.icon) {
|
|
1449
1500
|
const l = this.createIcon(this.props.icon);
|
|
1450
|
-
|
|
1501
|
+
o.appendChild(l);
|
|
1451
1502
|
}
|
|
1452
1503
|
if (this.props.title) {
|
|
1453
1504
|
const l = this.createLabel(this.props.title);
|
|
1454
|
-
|
|
1505
|
+
o.appendChild(l);
|
|
1455
1506
|
}
|
|
1456
|
-
t.appendChild(
|
|
1507
|
+
t.appendChild(o);
|
|
1457
1508
|
}
|
|
1458
1509
|
this.errorContainer = document.createElement("div"), this.errorContainer.className = "error-message", this.errorContainer.style.display = "none", t.appendChild(this.errorContainer);
|
|
1459
1510
|
const i = document.createElement("div");
|
|
@@ -1461,19 +1512,19 @@ class U extends p {
|
|
|
1461
1512
|
const s = this.value && this.value !== "";
|
|
1462
1513
|
s || i.classList.add("no-image");
|
|
1463
1514
|
const n = document.createElement("div");
|
|
1464
|
-
if (n.className = "preview-placeholder", n.innerHTML =
|
|
1465
|
-
const
|
|
1466
|
-
|
|
1515
|
+
if (n.className = "preview-placeholder", n.innerHTML = U, this.previewWrapper = document.createElement("div"), this.previewWrapper.className = "preview-wrapper", this.loadingSpinner = document.createElement("div"), this.loadingSpinner.className = "loading-spinner", this.loadingSpinner.innerHTML = q, this.loadingSpinner.style.display = "none", this.previewWrapper.appendChild(this.loadingSpinner), this.previewEl = document.createElement("img"), this.previewEl.className = "upload-preview", this.props.delete) {
|
|
1516
|
+
const o = document.createElement("button");
|
|
1517
|
+
o.className = "delete-button", o.type = "button", o.title = "Delete image", o.innerHTML = _, this.previewWrapper.appendChild(o), o.onclick = (l) => {
|
|
1467
1518
|
var h;
|
|
1468
1519
|
l.stopPropagation(), this.value = "", this.updatePreviewState(null), (h = this.onChange) == null || h.call(this, ""), this.hideError();
|
|
1469
1520
|
};
|
|
1470
1521
|
}
|
|
1471
1522
|
this.previewWrapper.appendChild(this.previewEl);
|
|
1472
|
-
const
|
|
1473
|
-
return
|
|
1474
|
-
<span class="upload-icon">${
|
|
1523
|
+
const a = document.createElement("button");
|
|
1524
|
+
return a.className = "upload-button", a.innerHTML = `
|
|
1525
|
+
<span class="upload-icon">${y}</span>
|
|
1475
1526
|
<span class="upload-label">Upload</span>
|
|
1476
|
-
`, i.appendChild(n), i.appendChild(this.previewWrapper), i.appendChild(
|
|
1527
|
+
`, i.appendChild(n), i.appendChild(this.previewWrapper), i.appendChild(a), t.appendChild(i), s ? this.updatePreviewState(this.value) : this.updatePreviewState(null), a.onclick = () => {
|
|
1477
1528
|
window.postMessage(
|
|
1478
1529
|
{
|
|
1479
1530
|
type: "OPEN_FILE_MANAGER_MODAL",
|
|
@@ -1484,14 +1535,14 @@ class U extends p {
|
|
|
1484
1535
|
}, t;
|
|
1485
1536
|
}
|
|
1486
1537
|
}
|
|
1487
|
-
class
|
|
1538
|
+
class Ct extends v {
|
|
1488
1539
|
constructor(t = {}) {
|
|
1489
1540
|
super({
|
|
1490
1541
|
...t,
|
|
1491
1542
|
title: t.title || "Height",
|
|
1492
1543
|
suffix: t.suffix || "px",
|
|
1493
1544
|
minValue: t.minValue ?? 0,
|
|
1494
|
-
icon: t.icon ||
|
|
1545
|
+
icon: t.icon || K,
|
|
1495
1546
|
default: t.default ?? 100
|
|
1496
1547
|
}), this.inputType = "number", this.mobileValue = t.mobile;
|
|
1497
1548
|
}
|
|
@@ -1502,17 +1553,17 @@ class mt extends v {
|
|
|
1502
1553
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
1503
1554
|
}
|
|
1504
1555
|
}
|
|
1505
|
-
const
|
|
1556
|
+
const K = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1506
1557
|
<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"/>
|
|
1507
1558
|
</svg>`;
|
|
1508
|
-
class
|
|
1559
|
+
class wt extends v {
|
|
1509
1560
|
constructor(t = {}) {
|
|
1510
1561
|
super({
|
|
1511
1562
|
...t,
|
|
1512
1563
|
title: t.title || "Width",
|
|
1513
1564
|
suffix: t.suffix || "px",
|
|
1514
1565
|
minValue: t.minValue ?? 0,
|
|
1515
|
-
icon: t.icon ||
|
|
1566
|
+
icon: t.icon || X,
|
|
1516
1567
|
default: t.default ?? 100
|
|
1517
1568
|
}), this.inputType = "number", this.mobileValue = t.mobile;
|
|
1518
1569
|
}
|
|
@@ -1523,14 +1574,14 @@ class ft extends v {
|
|
|
1523
1574
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
1524
1575
|
}
|
|
1525
1576
|
}
|
|
1526
|
-
const
|
|
1577
|
+
const X = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1527
1578
|
<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"/>
|
|
1528
|
-
</svg>`,
|
|
1579
|
+
</svg>`, Q = `
|
|
1529
1580
|
<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">
|
|
1530
1581
|
<polyline points="6 9 12 15 18 9"></polyline>
|
|
1531
1582
|
</svg>
|
|
1532
1583
|
`;
|
|
1533
|
-
class
|
|
1584
|
+
class Et extends g {
|
|
1534
1585
|
constructor(t = {}) {
|
|
1535
1586
|
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) {
|
|
1536
1587
|
const e = this._options.findIndex(
|
|
@@ -1557,44 +1608,44 @@ class vt extends p {
|
|
|
1557
1608
|
e.classList.add("has-label");
|
|
1558
1609
|
const n = document.createElement("div");
|
|
1559
1610
|
n.className = "select-label", n.textContent = this.props.title, e.appendChild(n);
|
|
1560
|
-
const
|
|
1561
|
-
if (
|
|
1562
|
-
|
|
1611
|
+
const a = document.createElement("span");
|
|
1612
|
+
if (a.className = "select-value", this.isLoading)
|
|
1613
|
+
a.textContent = this.props.loadingText || "Loading options...";
|
|
1563
1614
|
else {
|
|
1564
|
-
const
|
|
1565
|
-
|
|
1615
|
+
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";
|
|
1616
|
+
a.textContent = l;
|
|
1566
1617
|
}
|
|
1567
|
-
e.appendChild(
|
|
1618
|
+
e.appendChild(a);
|
|
1568
1619
|
} else {
|
|
1569
1620
|
const n = document.createElement("span");
|
|
1570
1621
|
if (this.isLoading)
|
|
1571
1622
|
n.textContent = this.props.loadingText || "Loading options...";
|
|
1572
1623
|
else {
|
|
1573
|
-
const
|
|
1574
|
-
n.textContent =
|
|
1624
|
+
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";
|
|
1625
|
+
n.textContent = o;
|
|
1575
1626
|
}
|
|
1576
1627
|
e.appendChild(n);
|
|
1577
1628
|
}
|
|
1578
1629
|
e.onclick = () => {
|
|
1579
|
-
var n,
|
|
1580
|
-
this.isLoading || (this.isOpen = !this.isOpen, (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (
|
|
1630
|
+
var n, a;
|
|
1631
|
+
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));
|
|
1581
1632
|
}, t.appendChild(e), this.buttonEl = e;
|
|
1582
1633
|
const i = document.createElement("ul");
|
|
1583
|
-
i.classList.add("select-api-options"), this._options.forEach((n,
|
|
1584
|
-
const
|
|
1585
|
-
|
|
1634
|
+
i.classList.add("select-api-options"), this._options.forEach((n, a) => {
|
|
1635
|
+
const o = this.createOption(n, a);
|
|
1636
|
+
o.onclick = (l) => this.selectApiOption(l, a, e), i.appendChild(o);
|
|
1586
1637
|
}), t.appendChild(i);
|
|
1587
1638
|
const s = document.createElement("div");
|
|
1588
|
-
return s.classList.add("svg-container"), s.innerHTML =
|
|
1589
|
-
var n,
|
|
1590
|
-
this.isLoading || (this.isOpen = !this.isOpen, (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (
|
|
1639
|
+
return s.classList.add("svg-container"), s.innerHTML = Q, t.appendChild(s), s.onclick = () => {
|
|
1640
|
+
var n, a;
|
|
1641
|
+
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));
|
|
1591
1642
|
}, this.optionsListEl = i, this.svgContainer = s, this.props.getOptionsAsync && !this.hasInitializedOptions ? (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((n) => {
|
|
1592
|
-
const
|
|
1643
|
+
const a = new Set(
|
|
1593
1644
|
this._options.map((l) => JSON.stringify(l.value))
|
|
1594
|
-
),
|
|
1595
|
-
(l) => !
|
|
1645
|
+
), o = n.filter(
|
|
1646
|
+
(l) => !a.has(JSON.stringify(l.value))
|
|
1596
1647
|
);
|
|
1597
|
-
if (this._options.push(...
|
|
1648
|
+
if (this._options.push(...o), this.isLoading = !1, this.hasInitializedOptions = !0, this.value !== void 0) {
|
|
1598
1649
|
const l = this._options.findIndex(
|
|
1599
1650
|
(h) => JSON.stringify(h.value) === JSON.stringify(this.value)
|
|
1600
1651
|
);
|
|
@@ -1608,12 +1659,12 @@ class vt extends p {
|
|
|
1608
1659
|
!0
|
|
1609
1660
|
);
|
|
1610
1661
|
})) : this.props.getOptionsAsync && this._options.length <= 1 && (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((n) => {
|
|
1611
|
-
const
|
|
1662
|
+
const a = new Set(
|
|
1612
1663
|
this._options.map((l) => JSON.stringify(l.value))
|
|
1613
|
-
),
|
|
1614
|
-
(l) => !
|
|
1664
|
+
), o = n.filter(
|
|
1665
|
+
(l) => !a.has(JSON.stringify(l.value))
|
|
1615
1666
|
);
|
|
1616
|
-
if (this._options.push(...
|
|
1667
|
+
if (this._options.push(...o), this.isLoading = !1, this.value !== void 0) {
|
|
1617
1668
|
const l = this._options.findIndex(
|
|
1618
1669
|
(h) => JSON.stringify(h.value) === JSON.stringify(this.value)
|
|
1619
1670
|
);
|
|
@@ -1635,16 +1686,16 @@ class vt extends p {
|
|
|
1635
1686
|
var l, h, r, d;
|
|
1636
1687
|
const s = t.target, n = s.querySelector(".select-api-radio") || ((l = s.closest(".select-api-option")) == null ? void 0 : l.querySelector(".select-api-radio"));
|
|
1637
1688
|
n && (n.checked = !0), this.selectedOptionIndex = e;
|
|
1638
|
-
const
|
|
1639
|
-
this.value =
|
|
1640
|
-
const
|
|
1641
|
-
if (
|
|
1642
|
-
|
|
1689
|
+
const a = this._options[e].value;
|
|
1690
|
+
this.value = a;
|
|
1691
|
+
const o = i.querySelector(".select-value");
|
|
1692
|
+
if (o)
|
|
1693
|
+
o.textContent = this._options[e].name;
|
|
1643
1694
|
else {
|
|
1644
1695
|
const u = i.firstChild;
|
|
1645
1696
|
u && u.tagName === "SPAN" && (u.textContent = this._options[e].name);
|
|
1646
1697
|
}
|
|
1647
|
-
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,
|
|
1698
|
+
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);
|
|
1648
1699
|
}
|
|
1649
1700
|
updateOptionsList() {
|
|
1650
1701
|
!this.optionsListEl || !this.buttonEl || (this.optionsListEl.innerHTML = "", this._options.forEach((t, e) => {
|
|
@@ -1677,13 +1728,13 @@ class vt extends p {
|
|
|
1677
1728
|
), this.updateButtonText();
|
|
1678
1729
|
}
|
|
1679
1730
|
}
|
|
1680
|
-
class
|
|
1731
|
+
class bt extends g {
|
|
1681
1732
|
constructor(t) {
|
|
1682
1733
|
var e, i;
|
|
1683
1734
|
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;
|
|
1684
1735
|
}
|
|
1685
1736
|
draw() {
|
|
1686
|
-
var
|
|
1737
|
+
var a, o;
|
|
1687
1738
|
const t = document.createElement("div");
|
|
1688
1739
|
t.className = "toggle-setting-container", this.props.icon && t.classList.add("toggle-with-icon");
|
|
1689
1740
|
const e = document.createElement("div");
|
|
@@ -1699,7 +1750,7 @@ class Ct extends p {
|
|
|
1699
1750
|
const i = document.createElement("label");
|
|
1700
1751
|
i.className = "toggle-switch";
|
|
1701
1752
|
const s = document.createElement("input");
|
|
1702
|
-
s.type = "checkbox", s.checked = ((
|
|
1753
|
+
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", () => {
|
|
1703
1754
|
var h, r;
|
|
1704
1755
|
const l = ((r = (h = this.props.options) == null ? void 0 : h.find((d) => d.status === s.checked)) == null ? void 0 : r.value) ?? "";
|
|
1705
1756
|
this.value = l, this.onChange && this.onChange(this.value), this.detectChangeCallback && this.detectChangeCallback(this.value);
|
|
@@ -1722,13 +1773,13 @@ class Ct extends p {
|
|
|
1722
1773
|
this.detectChangeCallback = t;
|
|
1723
1774
|
}
|
|
1724
1775
|
}
|
|
1725
|
-
const
|
|
1776
|
+
const Y = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1726
1777
|
<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"/>
|
|
1727
1778
|
</svg>`;
|
|
1728
|
-
class
|
|
1779
|
+
class Lt extends g {
|
|
1729
1780
|
// Store mobile value
|
|
1730
1781
|
constructor(t = {}) {
|
|
1731
|
-
t.rowGap = t.rowGap ?? !0, t.columnGap = t.columnGap ?? !0, t.title = t.title ?? "Gap", t.icon = t.icon ??
|
|
1782
|
+
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);
|
|
1732
1783
|
}
|
|
1733
1784
|
draw() {
|
|
1734
1785
|
const t = document.createElement("div");
|
|
@@ -1739,27 +1790,27 @@ class wt extends p {
|
|
|
1739
1790
|
i.className = "setting-label", i.setAttribute("for", this.id + "-input");
|
|
1740
1791
|
const s = document.createElement("span");
|
|
1741
1792
|
if (s.textContent = this.props.title ?? "Gap", i.appendChild(s), this.props.icon) {
|
|
1742
|
-
const
|
|
1743
|
-
|
|
1793
|
+
const o = document.createElement("span");
|
|
1794
|
+
o.className = "setting-icon", o.innerHTML = this.props.icon, i.insertBefore(o, s);
|
|
1744
1795
|
}
|
|
1745
1796
|
const n = document.createElement("div");
|
|
1746
1797
|
n.className = `setting-input-wrapper ${this.props.wrapperClassName || ""}`, n.classList.add("gap-setting-wrapper");
|
|
1747
|
-
const
|
|
1748
|
-
return
|
|
1798
|
+
const a = document.createElement("div");
|
|
1799
|
+
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;
|
|
1749
1800
|
}
|
|
1750
1801
|
createGapInput(t, e) {
|
|
1751
1802
|
const i = document.createElement("div");
|
|
1752
1803
|
i.className = "gap-input-wrapper";
|
|
1753
1804
|
const s = document.createElement("input");
|
|
1754
1805
|
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) => {
|
|
1755
|
-
const
|
|
1756
|
-
let
|
|
1757
|
-
|
|
1806
|
+
const a = n.target;
|
|
1807
|
+
let o = parseFloat(a.value);
|
|
1808
|
+
o = this.validateValue(o), String(o) !== a.value && (a.value = String(o)), this.inputValues[t] = o, this.setValue(o);
|
|
1758
1809
|
}), s.addEventListener("blur", (n) => {
|
|
1759
1810
|
var l, h;
|
|
1760
|
-
const
|
|
1761
|
-
let
|
|
1762
|
-
|
|
1811
|
+
const a = n.target;
|
|
1812
|
+
let o = parseFloat(a.value);
|
|
1813
|
+
o = this.validateValue(o), String(o) !== a.value && (a.value = String(o), this.inputValues[t] = o, this.setValue(o)), (h = (l = this.props).onBlur) == null || h.call(l);
|
|
1763
1814
|
}), i.appendChild(s), this.props.suffix && this.props.suffix !== "none") {
|
|
1764
1815
|
const n = document.createElement("span");
|
|
1765
1816
|
n.className = "gap-suffix", n.textContent = this.props.suffix, i.appendChild(n), s.style.paddingRight = "30px";
|
|
@@ -1779,53 +1830,53 @@ class wt extends p {
|
|
|
1779
1830
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
1780
1831
|
}
|
|
1781
1832
|
}
|
|
1782
|
-
const
|
|
1833
|
+
const tt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1783
1834
|
<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"/>
|
|
1784
1835
|
</svg>`;
|
|
1785
|
-
class
|
|
1836
|
+
class xt extends v {
|
|
1786
1837
|
constructor(t = {}) {
|
|
1787
1838
|
super({
|
|
1788
1839
|
...t,
|
|
1789
1840
|
minValue: t.minValue ?? 0,
|
|
1790
1841
|
maxValue: t.maxValue ?? 1e3,
|
|
1791
|
-
icon: t.icon ||
|
|
1842
|
+
icon: t.icon || tt,
|
|
1792
1843
|
title: t.title || "Margin Bottom",
|
|
1793
1844
|
default: t.default ?? 20,
|
|
1794
1845
|
wrapperClassName: "margin-bottom-wrapper " + (t.wrapperClassName || "")
|
|
1795
1846
|
}), this.inputType = "number";
|
|
1796
1847
|
}
|
|
1797
1848
|
}
|
|
1798
|
-
const
|
|
1849
|
+
const et = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1799
1850
|
<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"
|
|
1800
1851
|
stroke="#667085" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
1801
1852
|
</svg>`;
|
|
1802
|
-
class
|
|
1853
|
+
class yt extends v {
|
|
1803
1854
|
constructor(t = {}) {
|
|
1804
1855
|
super({
|
|
1805
1856
|
...t,
|
|
1806
1857
|
minValue: t.minValue ?? 0,
|
|
1807
1858
|
maxValue: t.maxValue ?? 1e3,
|
|
1808
|
-
icon: t.icon ||
|
|
1859
|
+
icon: t.icon || et,
|
|
1809
1860
|
title: t.title || "Margin Top",
|
|
1810
1861
|
default: t.default ?? 20,
|
|
1811
1862
|
wrapperClassName: "margin-top-wrapper " + (t.wrapperClassName || "")
|
|
1812
1863
|
}), this.inputType = "number";
|
|
1813
1864
|
}
|
|
1814
1865
|
}
|
|
1815
|
-
const
|
|
1866
|
+
const it = `
|
|
1816
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">
|
|
1817
1868
|
<polyline points="3,6 5,6 21,6"></polyline>
|
|
1818
1869
|
<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>
|
|
1819
1870
|
<line x1="10" y1="11" x2="10" y2="17"></line>
|
|
1820
1871
|
<line x1="14" y1="11" x2="14" y2="17"></line>
|
|
1821
1872
|
</svg>
|
|
1822
|
-
`,
|
|
1873
|
+
`, st = `
|
|
1823
1874
|
<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">
|
|
1824
1875
|
<line x1="12" y1="5" x2="12" y2="19"></line>
|
|
1825
1876
|
<line x1="5" y1="12" x2="19" y2="12"></line>
|
|
1826
1877
|
</svg>
|
|
1827
1878
|
`;
|
|
1828
|
-
class
|
|
1879
|
+
class Mt extends g {
|
|
1829
1880
|
constructor(t = {}) {
|
|
1830
1881
|
super(t), this.inputType = {}, this.container = null, this.languagesContainer = null, this.addLanguageSelect = null, this.addButton = null, this.defaultLanguages = [
|
|
1831
1882
|
{ code: "en", name: "English" },
|
|
@@ -1867,15 +1918,15 @@ class bt extends p {
|
|
|
1867
1918
|
s.classList.add("language-label"), s.textContent = t.toUpperCase();
|
|
1868
1919
|
const n = document.createElement("div");
|
|
1869
1920
|
n.classList.add("language-input-group");
|
|
1870
|
-
const
|
|
1871
|
-
|
|
1921
|
+
const a = document.createElement("input");
|
|
1922
|
+
a.type = "text", a.classList.add("language-input"), a.value = e || "", a.placeholder = this.props.placeholder || "Enter text...", a.addEventListener("input", (l) => {
|
|
1872
1923
|
const h = l.target;
|
|
1873
1924
|
this.updateLanguageValue(t, h.value);
|
|
1874
1925
|
});
|
|
1875
|
-
const
|
|
1876
|
-
return
|
|
1926
|
+
const o = document.createElement("button");
|
|
1927
|
+
return o.type = "button", o.classList.add("delete-language-btn"), o.innerHTML = it, o.title = `Delete ${t.toUpperCase()}`, o.addEventListener("click", () => {
|
|
1877
1928
|
this.removeLanguage(t);
|
|
1878
|
-
}), n.appendChild(
|
|
1929
|
+
}), n.appendChild(a), n.appendChild(o), i.appendChild(s), i.appendChild(n), i;
|
|
1879
1930
|
}
|
|
1880
1931
|
updateLanguageValue(t, e) {
|
|
1881
1932
|
this.value || (this.value = {}), this.value[t] = e, this.onChange && this.onChange(this.value), this.props.detectChange && this.props.detectChange(this.value);
|
|
@@ -1906,9 +1957,9 @@ class bt extends p {
|
|
|
1906
1957
|
const s = document.createElement("select");
|
|
1907
1958
|
s.classList.add("add-language-select"), this.addLanguageSelect = s;
|
|
1908
1959
|
const n = document.createElement("button");
|
|
1909
|
-
return n.type = "button", n.classList.add("add-language-btn"), n.innerHTML = `${
|
|
1910
|
-
const
|
|
1911
|
-
|
|
1960
|
+
return n.type = "button", n.classList.add("add-language-btn"), n.innerHTML = `${st} Add`, this.addButton = n, n.addEventListener("click", () => {
|
|
1961
|
+
const a = s.value;
|
|
1962
|
+
a && this.addLanguage(a);
|
|
1912
1963
|
}), i.appendChild(s), i.appendChild(n), t.appendChild(e), t.appendChild(i), t;
|
|
1913
1964
|
}
|
|
1914
1965
|
draw() {
|
|
@@ -1920,9 +1971,9 @@ class bt extends p {
|
|
|
1920
1971
|
const e = document.createElement("div");
|
|
1921
1972
|
e.classList.add("multi-language-content");
|
|
1922
1973
|
const i = document.createElement("div");
|
|
1923
|
-
i.classList.add("languages-container"), this.languagesContainer = i, this.value && Object.entries(this.value).forEach(([n,
|
|
1924
|
-
const
|
|
1925
|
-
i.appendChild(
|
|
1974
|
+
i.classList.add("languages-container"), this.languagesContainer = i, this.value && Object.entries(this.value).forEach(([n, a]) => {
|
|
1975
|
+
const o = this.createLanguageRow(n, a);
|
|
1976
|
+
i.appendChild(o);
|
|
1926
1977
|
}), e.appendChild(i);
|
|
1927
1978
|
const s = this.createAddLanguageSection();
|
|
1928
1979
|
return e.appendChild(s), t.appendChild(e), this.updateAddLanguageSelect(), this.container = t, t;
|
|
@@ -1934,7 +1985,7 @@ class bt extends p {
|
|
|
1934
1985
|
}), this.updateAddLanguageSelect());
|
|
1935
1986
|
}
|
|
1936
1987
|
}
|
|
1937
|
-
class
|
|
1988
|
+
class kt extends g {
|
|
1938
1989
|
constructor(t = {}) {
|
|
1939
1990
|
super(t), this.inputType = "select";
|
|
1940
1991
|
const e = [
|
|
@@ -1945,7 +1996,7 @@ class xt extends p {
|
|
|
1945
1996
|
{ name: "Bounce", value: "bounce 1.5s ease-in-out infinite" },
|
|
1946
1997
|
{ name: "Pulse", value: "pulse 1.5s ease-in-out infinite" }
|
|
1947
1998
|
];
|
|
1948
|
-
this.selectSetting = new
|
|
1999
|
+
this.selectSetting = new k({
|
|
1949
2000
|
title: this.title || "Animation",
|
|
1950
2001
|
options: e,
|
|
1951
2002
|
default: this.props.default || "none"
|
|
@@ -1961,16 +2012,16 @@ class xt extends p {
|
|
|
1961
2012
|
this.selectSetting.destroy(), super.destroy();
|
|
1962
2013
|
}
|
|
1963
2014
|
}
|
|
1964
|
-
const
|
|
2015
|
+
const nt = `
|
|
1965
2016
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1966
2017
|
<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"/>
|
|
1967
2018
|
</svg>
|
|
1968
|
-
`,
|
|
2019
|
+
`, at = `
|
|
1969
2020
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1970
2021
|
<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"/>
|
|
1971
2022
|
</svg>
|
|
1972
2023
|
`;
|
|
1973
|
-
class
|
|
2024
|
+
class Vt extends f {
|
|
1974
2025
|
constructor(t) {
|
|
1975
2026
|
super({
|
|
1976
2027
|
title: "Border",
|
|
@@ -1979,7 +2030,7 @@ class yt extends f {
|
|
|
1979
2030
|
settings: {
|
|
1980
2031
|
size: new v({
|
|
1981
2032
|
title: "Size",
|
|
1982
|
-
icon:
|
|
2033
|
+
icon: at,
|
|
1983
2034
|
default: (t == null ? void 0 : t.size) ?? 0,
|
|
1984
2035
|
suffix: "px"
|
|
1985
2036
|
}),
|
|
@@ -1988,7 +2039,7 @@ class yt extends f {
|
|
|
1988
2039
|
}),
|
|
1989
2040
|
radius: new v({
|
|
1990
2041
|
title: "Radius",
|
|
1991
|
-
icon:
|
|
2042
|
+
icon: nt,
|
|
1992
2043
|
default: (t == null ? void 0 : t.radius) ?? 12,
|
|
1993
2044
|
suffix: "px"
|
|
1994
2045
|
})
|
|
@@ -2007,20 +2058,20 @@ class yt extends f {
|
|
|
2007
2058
|
`;
|
|
2008
2059
|
}
|
|
2009
2060
|
}
|
|
2010
|
-
const
|
|
2061
|
+
const ot = `
|
|
2011
2062
|
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="13" viewBox="0 0 14 13" fill="none">
|
|
2012
2063
|
<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"/>
|
|
2013
2064
|
</svg>
|
|
2014
|
-
`,
|
|
2065
|
+
`, lt = `
|
|
2015
2066
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2016
2067
|
<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"/>
|
|
2017
2068
|
</svg>
|
|
2018
|
-
`,
|
|
2069
|
+
`, rt = `
|
|
2019
2070
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2020
2071
|
<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"/>
|
|
2021
2072
|
</svg>
|
|
2022
2073
|
`;
|
|
2023
|
-
class
|
|
2074
|
+
class Nt extends f {
|
|
2024
2075
|
constructor(t = {}) {
|
|
2025
2076
|
const { showAlign: e = t.showAlign ?? !0, ...i } = t;
|
|
2026
2077
|
super({
|
|
@@ -2032,9 +2083,9 @@ class Mt extends f {
|
|
|
2032
2083
|
color: new C({
|
|
2033
2084
|
default: i.colorDefault ?? "0, 0, 30"
|
|
2034
2085
|
}),
|
|
2035
|
-
fontFamily: new
|
|
2086
|
+
fontFamily: new k({
|
|
2036
2087
|
title: "Font",
|
|
2037
|
-
icon:
|
|
2088
|
+
icon: ot,
|
|
2038
2089
|
default: i.fontFamilyDefault ?? "Satoshi",
|
|
2039
2090
|
options: i.fontFamilyOptions ?? [
|
|
2040
2091
|
{ name: "Alt", value: "Croco Sans Black Caps Alt" },
|
|
@@ -2045,9 +2096,9 @@ class Mt extends f {
|
|
|
2045
2096
|
getOptions: i.fontFamilyGetOptions,
|
|
2046
2097
|
getOptionsAsync: i.fontFamilyGetOptionsAsync
|
|
2047
2098
|
}),
|
|
2048
|
-
fontWeight: new
|
|
2099
|
+
fontWeight: new k({
|
|
2049
2100
|
title: "Weight",
|
|
2050
|
-
icon:
|
|
2101
|
+
icon: lt,
|
|
2051
2102
|
default: i.fontWeightDefault ?? "400",
|
|
2052
2103
|
options: i.fontWeightOptions ?? [
|
|
2053
2104
|
{ name: "Regular", value: "400" },
|
|
@@ -2059,7 +2110,7 @@ class Mt extends f {
|
|
|
2059
2110
|
}),
|
|
2060
2111
|
fontSize: new v({
|
|
2061
2112
|
title: "Size",
|
|
2062
|
-
icon:
|
|
2113
|
+
icon: rt,
|
|
2063
2114
|
default: i.fontSizeDefault ?? 12,
|
|
2064
2115
|
suffix: "px",
|
|
2065
2116
|
mobile: i.fontSizeMobileDefault
|
|
@@ -2067,7 +2118,7 @@ class Mt extends f {
|
|
|
2067
2118
|
};
|
|
2068
2119
|
return e ? {
|
|
2069
2120
|
...s,
|
|
2070
|
-
align: new
|
|
2121
|
+
align: new W({
|
|
2071
2122
|
title: "Align",
|
|
2072
2123
|
default: i.alignDefault ?? "center"
|
|
2073
2124
|
})
|
|
@@ -2076,8 +2127,8 @@ class Mt extends f {
|
|
|
2076
2127
|
});
|
|
2077
2128
|
}
|
|
2078
2129
|
getCssCode() {
|
|
2079
|
-
var
|
|
2080
|
-
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 = ((
|
|
2130
|
+
var a;
|
|
2131
|
+
const t = this.settings.color.value ?? "#000000", e = this.settings.fontFamily.value ?? "Satoshi", i = this.settings.fontWeight.value ?? "bold", s = this.settings.fontSize.value ?? 12, n = ((a = this.settings.align) == null ? void 0 : a.value) ?? "left";
|
|
2081
2132
|
return `
|
|
2082
2133
|
color: ${t};
|
|
2083
2134
|
font-family: ${e};
|
|
@@ -2087,7 +2138,7 @@ class Mt extends f {
|
|
|
2087
2138
|
`;
|
|
2088
2139
|
}
|
|
2089
2140
|
}
|
|
2090
|
-
class E extends
|
|
2141
|
+
class E extends g {
|
|
2091
2142
|
constructor(t) {
|
|
2092
2143
|
super({
|
|
2093
2144
|
...t,
|
|
@@ -2095,11 +2146,11 @@ class E extends p {
|
|
|
2095
2146
|
}), this.inputType = "number", this.value = t.default !== void 0 ? t.default : "auto";
|
|
2096
2147
|
}
|
|
2097
2148
|
draw() {
|
|
2098
|
-
const t = this.value === "auto" ? "text" : "number", e = (
|
|
2099
|
-
this.value !== "auto" && (this.props.minValue !== void 0 && (
|
|
2149
|
+
const t = this.value === "auto" ? "text" : "number", e = (o) => {
|
|
2150
|
+
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", () => {
|
|
2100
2151
|
const l = this.props.minValue ?? Number.MIN_SAFE_INTEGER, h = this.props.maxValue ?? Number.MAX_SAFE_INTEGER;
|
|
2101
|
-
let r = Number(
|
|
2102
|
-
r < l && (r = l), r > h && (r = h),
|
|
2152
|
+
let r = Number(o.value);
|
|
2153
|
+
r < l && (r = l), r > h && (r = h), o.value = String(r);
|
|
2103
2154
|
}));
|
|
2104
2155
|
}, i = this.createInput({
|
|
2105
2156
|
value: this.value,
|
|
@@ -2120,9 +2171,9 @@ class E extends p {
|
|
|
2120
2171
|
s && (s.style.paddingRight = "35px");
|
|
2121
2172
|
const n = document.createElement("span");
|
|
2122
2173
|
n.className = "suffix-label", n.textContent = this.props.suffix, i.appendChild(n);
|
|
2123
|
-
const
|
|
2124
|
-
return
|
|
2125
|
-
const l =
|
|
2174
|
+
const a = i.querySelector("input");
|
|
2175
|
+
return a && (a.oninput = (o) => {
|
|
2176
|
+
const l = o.target.value.trim();
|
|
2126
2177
|
if (l.toLowerCase() === "auto")
|
|
2127
2178
|
this.value = "auto";
|
|
2128
2179
|
else {
|
|
@@ -2133,7 +2184,7 @@ class E extends p {
|
|
|
2133
2184
|
}), i;
|
|
2134
2185
|
}
|
|
2135
2186
|
}
|
|
2136
|
-
class
|
|
2187
|
+
class It extends f {
|
|
2137
2188
|
constructor(t) {
|
|
2138
2189
|
super({
|
|
2139
2190
|
title: "Margins",
|
|
@@ -2142,25 +2193,25 @@ class kt extends f {
|
|
|
2142
2193
|
settings: {
|
|
2143
2194
|
marginTop: new E({
|
|
2144
2195
|
title: "Top",
|
|
2145
|
-
icon:
|
|
2196
|
+
icon: ht,
|
|
2146
2197
|
suffix: "px",
|
|
2147
2198
|
default: (t == null ? void 0 : t.marginTop) ?? "auto"
|
|
2148
2199
|
}),
|
|
2149
2200
|
marginRight: new E({
|
|
2150
2201
|
title: "Right",
|
|
2151
|
-
icon:
|
|
2202
|
+
icon: ct,
|
|
2152
2203
|
suffix: "px",
|
|
2153
2204
|
default: (t == null ? void 0 : t.marginRight) ?? 0
|
|
2154
2205
|
}),
|
|
2155
2206
|
marginBottom: new E({
|
|
2156
2207
|
title: "Bottom",
|
|
2157
|
-
icon:
|
|
2208
|
+
icon: dt,
|
|
2158
2209
|
suffix: "px",
|
|
2159
2210
|
default: (t == null ? void 0 : t.marginBottom) ?? 0
|
|
2160
2211
|
}),
|
|
2161
2212
|
marginLeft: new E({
|
|
2162
2213
|
title: "Left",
|
|
2163
|
-
icon:
|
|
2214
|
+
icon: ut,
|
|
2164
2215
|
suffix: "px",
|
|
2165
2216
|
default: (t == null ? void 0 : t.marginLeft) ?? 0
|
|
2166
2217
|
})
|
|
@@ -2177,16 +2228,16 @@ class kt extends f {
|
|
|
2177
2228
|
`;
|
|
2178
2229
|
}
|
|
2179
2230
|
}
|
|
2180
|
-
const
|
|
2231
|
+
const ht = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2181
2232
|
<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"/>
|
|
2182
|
-
</svg>`,
|
|
2233
|
+
</svg>`, ct = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2183
2234
|
<path d="M5.625 2.75H5.6325M5.625 9.5H5.6325M5.625 16.25H5.6325M12.375 2.75H12.3825M12.375 9.5H12.3825M12.375 16.25H12.3825M9 2.75H9.0075M9 9.5H9.0075M9 16.25H9.0075M9 12.875H9.0075M9 6.125H9.0075M2.25 2.75H2.2575M2.25 9.5H2.2575M2.25 16.25H2.2575M2.25 12.875H2.2575M2.25 6.125H2.2575M15.75 16.25V2.75" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2184
|
-
</svg>`,
|
|
2235
|
+
</svg>`, dt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2185
2236
|
<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"/>
|
|
2186
|
-
</svg>`,
|
|
2237
|
+
</svg>`, ut = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2187
2238
|
<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"/>
|
|
2188
2239
|
</svg>`;
|
|
2189
|
-
class
|
|
2240
|
+
class St extends f {
|
|
2190
2241
|
/**
|
|
2191
2242
|
* Constructs a new BackgroundSettingSet.
|
|
2192
2243
|
*
|
|
@@ -2216,11 +2267,11 @@ class Vt extends f {
|
|
|
2216
2267
|
collapsed: t == null ? void 0 : t.collapsed,
|
|
2217
2268
|
hideCondition: t == null ? void 0 : t.hideCondition,
|
|
2218
2269
|
settings: {
|
|
2219
|
-
backgroundImage: new
|
|
2270
|
+
backgroundImage: new Z({
|
|
2220
2271
|
...t == null ? void 0 : t.uploadProps,
|
|
2221
2272
|
default: (t == null ? void 0 : t.backgroundImage) ?? ""
|
|
2222
2273
|
}),
|
|
2223
|
-
opacity: new
|
|
2274
|
+
opacity: new j({
|
|
2224
2275
|
default: (t == null ? void 0 : t.opacity) ?? 100
|
|
2225
2276
|
}),
|
|
2226
2277
|
backgroundColor: new C({
|
|
@@ -2235,10 +2286,10 @@ class Vt extends f {
|
|
|
2235
2286
|
draw() {
|
|
2236
2287
|
const t = super.draw(), e = t.querySelector(".setting-group-content");
|
|
2237
2288
|
if (!e) return t;
|
|
2238
|
-
const i = Array.from(e.children), [s, n,
|
|
2289
|
+
const i = Array.from(e.children), [s, n, a] = i;
|
|
2239
2290
|
e.innerHTML = "", e.appendChild(s), e.appendChild(n);
|
|
2240
|
-
const
|
|
2241
|
-
return
|
|
2291
|
+
const o = document.createElement("div");
|
|
2292
|
+
return o.className = "bgset-or-label", o.textContent = "OR", e.appendChild(o), e.appendChild(a), t;
|
|
2242
2293
|
}
|
|
2243
2294
|
/**
|
|
2244
2295
|
* Helper method to generate CSS based on the current settings.
|
|
@@ -2255,44 +2306,44 @@ class Vt extends f {
|
|
|
2255
2306
|
`;
|
|
2256
2307
|
}
|
|
2257
2308
|
}
|
|
2258
|
-
function
|
|
2309
|
+
function Ot(c) {
|
|
2259
2310
|
return c instanceof f;
|
|
2260
2311
|
}
|
|
2261
|
-
function
|
|
2262
|
-
return c instanceof
|
|
2312
|
+
function Ht(c) {
|
|
2313
|
+
return c instanceof g;
|
|
2263
2314
|
}
|
|
2264
2315
|
export {
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2316
|
+
W as AlignSetting,
|
|
2317
|
+
kt as AnimationSetting,
|
|
2318
|
+
St as BackgroundSettingSet,
|
|
2319
|
+
Vt as BorderSettingSet,
|
|
2320
|
+
ft as ButtonSetting,
|
|
2270
2321
|
m as ColorSetting,
|
|
2271
2322
|
C as ColorWithOpacitySetting,
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2323
|
+
vt as DimensionSetting,
|
|
2324
|
+
Lt as GapSetting,
|
|
2325
|
+
Nt as HeaderTypographySettingSet,
|
|
2326
|
+
Ct as HeightSetting,
|
|
2327
|
+
mt as HtmlSetting,
|
|
2328
|
+
xt as MarginBottomSetting,
|
|
2329
|
+
It as MarginSettingGroup,
|
|
2330
|
+
yt as MarginTopSetting,
|
|
2331
|
+
Mt as MultiLanguageSetting,
|
|
2281
2332
|
v as NumberSetting,
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2333
|
+
j as OpacitySetting,
|
|
2334
|
+
Et as SelectApiSettings,
|
|
2335
|
+
k as SelectSetting,
|
|
2336
|
+
g as Setting,
|
|
2286
2337
|
f as SettingGroup,
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2338
|
+
$ as StringSetting,
|
|
2339
|
+
pt as TabSettingGroup,
|
|
2340
|
+
pt as TabsSettingGroup,
|
|
2341
|
+
bt as Toggle,
|
|
2342
|
+
Z as UploadSetting,
|
|
2343
|
+
wt as WidthSetting,
|
|
2344
|
+
gt as asSettingGroupWithSettings,
|
|
2345
|
+
R as createSettingGroup,
|
|
2346
|
+
Ht as isSetting,
|
|
2347
|
+
Ot as isSettingGroup,
|
|
2297
2348
|
w as iterateSettings
|
|
2298
2349
|
};
|