builder-settings-types 0.0.272 → 0.0.274
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.
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
const
|
|
2
|
-
let
|
|
1
|
+
const mt = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
2
|
+
let ct = (c = 21) => {
|
|
3
3
|
let t = "", e = crypto.getRandomValues(new Uint8Array(c |= 0));
|
|
4
4
|
for (; c--; )
|
|
5
|
-
t +=
|
|
5
|
+
t += mt[e[c] & 63];
|
|
6
6
|
return t;
|
|
7
7
|
};
|
|
8
|
-
function
|
|
8
|
+
function ft(c) {
|
|
9
9
|
let t = 0, e = c.parentElement;
|
|
10
10
|
for (; e; )
|
|
11
11
|
e.classList.contains("setting-group") && e !== c && t++, e = e.parentElement;
|
|
12
12
|
return t;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function _(c, t) {
|
|
15
15
|
const e = Math.min(Math.max(t, 0), 5);
|
|
16
16
|
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 = "");
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function tt(c, t = 0) {
|
|
19
19
|
c.querySelectorAll(":scope > .setting-group-content > .setting-group").forEach((i) => {
|
|
20
20
|
const s = i, n = t + 1;
|
|
21
|
-
|
|
21
|
+
_(s, n), tt(s, n);
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
const
|
|
24
|
+
const vt = {
|
|
25
25
|
maxLevel: 5,
|
|
26
26
|
spacingMultiplier: 1,
|
|
27
27
|
visualIndentMultiplier: 2,
|
|
28
28
|
enableAutoDetection: !0
|
|
29
29
|
};
|
|
30
|
-
class
|
|
30
|
+
class Ct {
|
|
31
31
|
constructor(t = {}) {
|
|
32
|
-
this.observedElements = /* @__PURE__ */ new Set(), this.config = { ...
|
|
32
|
+
this.observedElements = /* @__PURE__ */ new Set(), this.config = { ...vt, ...t }, this.config.enableAutoDetection && this.setupAutoDetection();
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* Setup automatic detection using MutationObserver
|
|
@@ -63,7 +63,7 @@ class ft {
|
|
|
63
63
|
* Update nesting for a specific element
|
|
64
64
|
*/
|
|
65
65
|
updateElementNesting(t) {
|
|
66
|
-
const e =
|
|
66
|
+
const e = ft(t);
|
|
67
67
|
this.applyNestingWithConfig(t, e);
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
@@ -111,20 +111,20 @@ class ft {
|
|
|
111
111
|
this.observer && (this.observer.disconnect(), this.observer = void 0), this.observedElements.clear();
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
const
|
|
115
|
-
function
|
|
114
|
+
const st = new Ct();
|
|
115
|
+
function J(c) {
|
|
116
116
|
if (c === null || typeof c != "object") return c;
|
|
117
117
|
if (c instanceof Date) return new Date(c.getTime());
|
|
118
|
-
if (c instanceof Array) return c.map((t) =>
|
|
118
|
+
if (c instanceof Array) return c.map((t) => J(t));
|
|
119
119
|
if (typeof c == "object") {
|
|
120
120
|
const t = {};
|
|
121
121
|
for (const e in c)
|
|
122
|
-
Object.prototype.hasOwnProperty.call(c, e) && (t[e] =
|
|
122
|
+
Object.prototype.hasOwnProperty.call(c, e) && (t[e] = J(c[e]));
|
|
123
123
|
return t;
|
|
124
124
|
}
|
|
125
125
|
return c;
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function yt(c) {
|
|
128
128
|
switch (c) {
|
|
129
129
|
case "number":
|
|
130
130
|
return 0;
|
|
@@ -142,15 +142,15 @@ function vt(c) {
|
|
|
142
142
|
return "";
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
class
|
|
145
|
+
class b {
|
|
146
146
|
constructor(t = {}) {
|
|
147
|
-
this.props = t, this.dataPropsPath = "", this.id = t.id ||
|
|
147
|
+
this.props = t, this.dataPropsPath = "", this.id = t.id || ct(), this.value = this.props.default, this.desktop = this.props.default, this.title = t.title || "", this.includeGetJson = t.includeGetJson !== void 0 ? t.includeGetJson : !0;
|
|
148
148
|
}
|
|
149
149
|
static SetUploadUrl(t) {
|
|
150
|
-
globalThis.DefaultUploadUrl = t,
|
|
150
|
+
globalThis.DefaultUploadUrl = t, b.DefaultUploadUrl = t;
|
|
151
151
|
}
|
|
152
152
|
static SetDefaultLanguage(t) {
|
|
153
|
-
globalThis.DefaultLanguage = t,
|
|
153
|
+
globalThis.DefaultLanguage = t, b.DefaultLanguage = t;
|
|
154
154
|
}
|
|
155
155
|
destroy() {
|
|
156
156
|
throw new Error("Method not implemented.");
|
|
@@ -171,8 +171,8 @@ class E {
|
|
|
171
171
|
this.value = t, this.inputEl && (this.inputEl.value = String(t)), this.onChange && this.onChange(t), this.props.detectChange && this.props.detectChange(t);
|
|
172
172
|
}
|
|
173
173
|
clone() {
|
|
174
|
-
const t = this.constructor, e =
|
|
175
|
-
return i.value =
|
|
174
|
+
const t = this.constructor, e = J(this.props), i = new t(e);
|
|
175
|
+
return i.value = J(this.value), i;
|
|
176
176
|
}
|
|
177
177
|
createInput(t) {
|
|
178
178
|
t = { ...this.props.inputProps, ...t };
|
|
@@ -192,7 +192,7 @@ class E {
|
|
|
192
192
|
const i = document.createElement("div");
|
|
193
193
|
i.className = t.wrapperClassName || "";
|
|
194
194
|
const s = document.createElement("input");
|
|
195
|
-
this.inputEl = s, s.value = String(t.value ||
|
|
195
|
+
this.inputEl = s, s.value = String(t.value || yt(t.inputType)), s.type = t.inputType, s.placeholder = t.placeholder || "", s.className = t.inputClassName || "", this.dataPropsPath && s.setAttribute("data-test-id", this.dataPropsPath);
|
|
196
196
|
const n = (a) => {
|
|
197
197
|
const l = a.target;
|
|
198
198
|
let r = l.value;
|
|
@@ -233,31 +233,31 @@ class E {
|
|
|
233
233
|
return i.className = "input-icon " + (e || ""), i.innerHTML = t, i;
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
|
-
function
|
|
237
|
-
return c instanceof
|
|
236
|
+
function D(c) {
|
|
237
|
+
return c instanceof b;
|
|
238
238
|
}
|
|
239
|
-
function
|
|
240
|
-
return c instanceof
|
|
239
|
+
function L(c) {
|
|
240
|
+
return c instanceof O;
|
|
241
241
|
}
|
|
242
|
-
function
|
|
243
|
-
return
|
|
242
|
+
function nt(c) {
|
|
243
|
+
return D(c) || L(c);
|
|
244
244
|
}
|
|
245
|
-
function
|
|
245
|
+
function U(c, t) {
|
|
246
246
|
for (const e in c)
|
|
247
247
|
if (Object.prototype.hasOwnProperty.call(c, e)) {
|
|
248
248
|
const i = c[e];
|
|
249
249
|
t(e, i);
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
|
-
const
|
|
252
|
+
const X = class X {
|
|
253
253
|
constructor(t) {
|
|
254
254
|
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 = () => {
|
|
255
|
-
}, this.pendingBlurHandler = null, this.originalDefaultValues = {}, this.nestingLevel = 0, this.dataPropsPath = "", this.hide = !1, this.id = t.id ||
|
|
255
|
+
}, this.pendingBlurHandler = null, this.originalDefaultValues = {}, this.nestingLevel = 0, this.dataPropsPath = "", this.hide = !1, this.id = t.id || ct(), this.title = t.title, this.settings = t.settings, this.isCollapsed = t.collapsed ?? !1, this.isMain = t.main ?? !1, this.custom = t.custom ?? !1, this.nestingLevel = 0, this.includeGetJson = t.includeGetJson ?? !0, this.addItemCfg = t.addItem, this.deleteItemCfg = t.deleteItem, this.dataProps = t.dataProps, this.dataPropsPath = t.dataProps || "", this.hide = t.hide ?? !1, Object.assign(this, t.settings), this.initialValues = this.getValues(), this.originalDefaultValues = this.getDefaultValues(), this.propagateNestingLevel(), this.propagateDataPropsPath();
|
|
256
256
|
}
|
|
257
257
|
propagateNestingLevel() {
|
|
258
258
|
const t = this.nestingLevel + 1;
|
|
259
|
-
|
|
260
|
-
|
|
259
|
+
U(this.settings, (e, i) => {
|
|
260
|
+
L(i) && (i.nestingLevel = t, i.propagateNestingLevel());
|
|
261
261
|
});
|
|
262
262
|
}
|
|
263
263
|
getNestingLevel() {
|
|
@@ -273,18 +273,18 @@ const Z = class Z {
|
|
|
273
273
|
this.dataPropsPath = t, this.propagateDataPropsPath();
|
|
274
274
|
}
|
|
275
275
|
propagateDataPropsPath() {
|
|
276
|
-
|
|
276
|
+
U(this.settings, (t, e) => {
|
|
277
277
|
const i = String(t), s = this.dataPropsPath ? `${this.dataPropsPath}_${i}` : i;
|
|
278
|
-
(
|
|
278
|
+
(L(e) || D(e) && typeof e.setDataPropsPath == "function") && e.setDataPropsPath(s);
|
|
279
279
|
});
|
|
280
280
|
}
|
|
281
281
|
updateNestingStyles() {
|
|
282
|
-
this.elementRef && (
|
|
282
|
+
this.elementRef && (_(this.elementRef, this.nestingLevel), tt(this.elementRef, this.nestingLevel));
|
|
283
283
|
}
|
|
284
284
|
forceChildUIRefresh() {
|
|
285
285
|
Object.entries(this.settings).forEach(([t, e]) => {
|
|
286
286
|
try {
|
|
287
|
-
if (
|
|
287
|
+
if (L(e)) {
|
|
288
288
|
const i = e.getValues();
|
|
289
289
|
e.setValue(i);
|
|
290
290
|
} else if (typeof e.setValue == "function") {
|
|
@@ -328,7 +328,7 @@ const Z = class Z {
|
|
|
328
328
|
}
|
|
329
329
|
clone() {
|
|
330
330
|
const t = {};
|
|
331
|
-
|
|
331
|
+
U(this.settings, (s, n) => {
|
|
332
332
|
const o = String(s);
|
|
333
333
|
typeof n.clone == "function" ? t[o] = n.clone() : (console.warn(
|
|
334
334
|
`Setting with key '${o}' does not have a clone method. Copying reference.`
|
|
@@ -345,7 +345,7 @@ const Z = class Z {
|
|
|
345
345
|
deleteItem: this.deleteItemCfg,
|
|
346
346
|
dataProps: this.dataProps,
|
|
347
347
|
hide: this.hide
|
|
348
|
-
}, i =
|
|
348
|
+
}, i = bt(e);
|
|
349
349
|
return i.initialValues = this.getValues(), i;
|
|
350
350
|
}
|
|
351
351
|
resetDefault() {
|
|
@@ -355,7 +355,7 @@ const Z = class Z {
|
|
|
355
355
|
setMobileValues(t) {
|
|
356
356
|
!t || typeof t != "object" || (Object.entries(t).forEach(([e, i]) => {
|
|
357
357
|
const s = this.settings[e];
|
|
358
|
-
s && (
|
|
358
|
+
s && (L(s) || D(s)) && typeof s.setMobileValue == "function" && s.setMobileValue(i);
|
|
359
359
|
}), this.setValue(t), this.onChange && this.onChange(this.getValues()));
|
|
360
360
|
}
|
|
361
361
|
getMobileValues(t) {
|
|
@@ -364,7 +364,7 @@ const Z = class Z {
|
|
|
364
364
|
for (const i in this.settings)
|
|
365
365
|
if (Object.prototype.hasOwnProperty.call(this.settings, i)) {
|
|
366
366
|
const s = this.settings[i];
|
|
367
|
-
if (
|
|
367
|
+
if (L(s))
|
|
368
368
|
e[i] = s.getMobileValues();
|
|
369
369
|
else {
|
|
370
370
|
const n = s;
|
|
@@ -375,7 +375,7 @@ const Z = class Z {
|
|
|
375
375
|
} else {
|
|
376
376
|
const e = this.settings[t];
|
|
377
377
|
if (!e) return;
|
|
378
|
-
if (
|
|
378
|
+
if (L(e)) return e.getMobileValues();
|
|
379
379
|
const i = e;
|
|
380
380
|
return i.mobileValue !== void 0 ? i.mobileValue : i.value;
|
|
381
381
|
}
|
|
@@ -391,14 +391,14 @@ const Z = class Z {
|
|
|
391
391
|
Object.keys(s).length > 0 && (this.lastChangeTime = Date.now(), this.initialValues = i, t(i), this.updateVisibility()), this.isHandlingChange = !1;
|
|
392
392
|
}, 50));
|
|
393
393
|
};
|
|
394
|
-
return this.changeHandlers.clear(),
|
|
394
|
+
return this.changeHandlers.clear(), U(this.settings, (i, s) => {
|
|
395
395
|
var n;
|
|
396
|
-
if (
|
|
396
|
+
if (L(s))
|
|
397
397
|
s.setOnChange(() => {
|
|
398
398
|
const o = this.getValues();
|
|
399
399
|
this.initialValues = o, t(o);
|
|
400
400
|
}), this.changeHandlers.add(() => t(this.getValues()));
|
|
401
|
-
else if (
|
|
401
|
+
else if (D(s)) {
|
|
402
402
|
const o = () => e();
|
|
403
403
|
this.changeHandlers.add(o), s.setOnChange(o);
|
|
404
404
|
} else {
|
|
@@ -421,10 +421,10 @@ const Z = class Z {
|
|
|
421
421
|
const o = i.slice(this.addItemCfg.keyPrefix.length), a = Number(o);
|
|
422
422
|
if (Number.isFinite(a)) {
|
|
423
423
|
const l = this.addItemCfg.createItem(a);
|
|
424
|
-
|
|
424
|
+
nt(l) && (this.addSetting(i, l), n = l);
|
|
425
425
|
}
|
|
426
426
|
}
|
|
427
|
-
n && (
|
|
427
|
+
n && (L(n) || D(n)) && typeof n.setValue == "function" && n.setValue(s);
|
|
428
428
|
}), setTimeout(() => {
|
|
429
429
|
this.forceChildUIRefresh();
|
|
430
430
|
}, 0);
|
|
@@ -438,7 +438,7 @@ const Z = class Z {
|
|
|
438
438
|
const s = this.getValues();
|
|
439
439
|
this.initialValues = s, (n = this.onChange) == null || n.call(this, s), this.updateVisibility();
|
|
440
440
|
};
|
|
441
|
-
|
|
441
|
+
L(t) ? t.setOnChange(() => e()) : D(t) ? t.setOnChange(() => e()) : (i = t.setOnChange) == null || i.call(t, () => e());
|
|
442
442
|
}
|
|
443
443
|
addSetting(t, e) {
|
|
444
444
|
var s, n;
|
|
@@ -447,14 +447,14 @@ const Z = class Z {
|
|
|
447
447
|
".setting-group-content"
|
|
448
448
|
);
|
|
449
449
|
if (o) {
|
|
450
|
-
|
|
450
|
+
L(e) && typeof e.setNestingLevel == "function" && e.setNestingLevel(this.nestingLevel + 1);
|
|
451
451
|
const a = e.draw(), l = this.deleteItemCfg ?? this.addItemCfg;
|
|
452
452
|
if (l) {
|
|
453
453
|
const p = l.keyPrefix ?? ((s = this.addItemCfg) == null ? void 0 : s.keyPrefix);
|
|
454
454
|
p && t.startsWith(p) && this.addDeleteButtonToElement(a, t);
|
|
455
455
|
}
|
|
456
456
|
const r = o.querySelector(".sg-add-button-bottom");
|
|
457
|
-
r ? o.insertBefore(a, r) : o.appendChild(a),
|
|
457
|
+
r ? o.insertBefore(a, r) : o.appendChild(a), st.trackElement(a), _(a, this.nestingLevel + 1), tt(a, this.nestingLevel + 1);
|
|
458
458
|
const h = a.style.display;
|
|
459
459
|
a.style.display = "none", a.offsetHeight, a.style.display = h, this.updateNestingStyles();
|
|
460
460
|
}
|
|
@@ -637,7 +637,7 @@ const Z = class Z {
|
|
|
637
637
|
for (const i in this.settings)
|
|
638
638
|
if (Object.prototype.hasOwnProperty.call(this.settings, i)) {
|
|
639
639
|
const s = this.settings[i];
|
|
640
|
-
if (
|
|
640
|
+
if (L(s))
|
|
641
641
|
e[i] = s.getValues();
|
|
642
642
|
else {
|
|
643
643
|
const n = s;
|
|
@@ -648,7 +648,7 @@ const Z = class Z {
|
|
|
648
648
|
} else {
|
|
649
649
|
const e = this.settings[t];
|
|
650
650
|
if (!e) return;
|
|
651
|
-
if (
|
|
651
|
+
if (L(e)) return e.getValues();
|
|
652
652
|
const i = e;
|
|
653
653
|
return i.getValue ? i.getValue() : i.value;
|
|
654
654
|
}
|
|
@@ -661,7 +661,7 @@ const Z = class Z {
|
|
|
661
661
|
for (const s in this.settings)
|
|
662
662
|
if (Object.prototype.hasOwnProperty.call(this.settings, s)) {
|
|
663
663
|
const n = this.settings[s];
|
|
664
|
-
if (
|
|
664
|
+
if (L(n)) {
|
|
665
665
|
const o = n.getValuesForJson();
|
|
666
666
|
o !== null && (i[s] = o);
|
|
667
667
|
} else {
|
|
@@ -673,7 +673,7 @@ const Z = class Z {
|
|
|
673
673
|
} else {
|
|
674
674
|
const i = this.settings[t];
|
|
675
675
|
if (!i) return;
|
|
676
|
-
if (
|
|
676
|
+
if (L(i))
|
|
677
677
|
return i.includeGetJson === !1 ? null : i.getValuesForJson();
|
|
678
678
|
{
|
|
679
679
|
const s = i;
|
|
@@ -687,7 +687,7 @@ const Z = class Z {
|
|
|
687
687
|
for (const i in this.settings)
|
|
688
688
|
if (Object.prototype.hasOwnProperty.call(this.settings, i)) {
|
|
689
689
|
const s = this.settings[i];
|
|
690
|
-
if (
|
|
690
|
+
if (L(s))
|
|
691
691
|
e[i] = s.getDefaultValues();
|
|
692
692
|
else {
|
|
693
693
|
const n = s;
|
|
@@ -698,14 +698,14 @@ const Z = class Z {
|
|
|
698
698
|
} else {
|
|
699
699
|
const e = this.settings[t];
|
|
700
700
|
if (!e) return;
|
|
701
|
-
if (
|
|
701
|
+
if (L(e)) return e.getDefaultValues();
|
|
702
702
|
const i = e;
|
|
703
703
|
return i.default !== void 0 ? i.default : i.value;
|
|
704
704
|
}
|
|
705
705
|
}
|
|
706
706
|
draw() {
|
|
707
707
|
const t = document.createElement("div");
|
|
708
|
-
t.className = "setting-group", t.id = `setting-group-${this.id}`,
|
|
708
|
+
t.className = "setting-group", t.id = `setting-group-${this.id}`, X.hiddenElements.add(t), this.hide && (t.style.display = "none"), this.isMain && t.classList.add("main-group"), this.custom && t.classList.add("custom_class"), _(t, this.nestingLevel);
|
|
709
709
|
const e = document.createElement("div");
|
|
710
710
|
e.className = "setting-group-title", this.isCollapsed && e.classList.add("collapsed-view"), e.setAttribute("role", "button"), e.setAttribute(
|
|
711
711
|
"aria-expanded",
|
|
@@ -737,9 +737,9 @@ const Z = class Z {
|
|
|
737
737
|
for (const h in this.settings)
|
|
738
738
|
if (Object.prototype.hasOwnProperty.call(this.settings, h)) {
|
|
739
739
|
const p = this.settings[h];
|
|
740
|
-
|
|
740
|
+
L(p) && typeof p.setNestingLevel == "function" && p.setNestingLevel(this.nestingLevel + 1);
|
|
741
741
|
const d = p.draw();
|
|
742
|
-
|
|
742
|
+
L(p) && p.deleteItemCfg && this.addDeleteButtonToElement(
|
|
743
743
|
d,
|
|
744
744
|
h,
|
|
745
745
|
p
|
|
@@ -761,13 +761,13 @@ const Z = class Z {
|
|
|
761
761
|
h.innerHTML = `${p}<span style="margin-left:4px;">${this.addItemCfg.buttonLabel ?? "Add"}</span>`, h.addEventListener("click", (d) => {
|
|
762
762
|
d.stopPropagation(), d.preventDefault();
|
|
763
763
|
const g = this.getNextIndexFromPrefix(this.addItemCfg.keyPrefix), u = this.addItemCfg.createItem(g);
|
|
764
|
-
if (
|
|
764
|
+
if (nt(u)) {
|
|
765
765
|
const m = `${this.addItemCfg.keyPrefix}${g}`;
|
|
766
766
|
this.addSetting(m, u);
|
|
767
767
|
}
|
|
768
768
|
}), a.appendChild(h);
|
|
769
769
|
}
|
|
770
|
-
return e.appendChild(i), e.appendChild(n), t.appendChild(e), t.appendChild(a), this.elementRef = t,
|
|
770
|
+
return e.appendChild(i), e.appendChild(n), t.appendChild(e), t.appendChild(a), this.elementRef = t, st.trackElement(t), setTimeout(() => {
|
|
771
771
|
this.updateNestingStyles();
|
|
772
772
|
}, 0), this.pendingBlurHandler && (this.pendingBlurHandler = null), t;
|
|
773
773
|
}
|
|
@@ -809,12 +809,12 @@ const Z = class Z {
|
|
|
809
809
|
}
|
|
810
810
|
}
|
|
811
811
|
};
|
|
812
|
-
|
|
813
|
-
let
|
|
814
|
-
function
|
|
815
|
-
return new
|
|
812
|
+
X.hiddenElements = /* @__PURE__ */ new Set();
|
|
813
|
+
let O = X;
|
|
814
|
+
function ae(c) {
|
|
815
|
+
return new Et(c);
|
|
816
816
|
}
|
|
817
|
-
class
|
|
817
|
+
class Et extends O {
|
|
818
818
|
constructor(t) {
|
|
819
819
|
super(t);
|
|
820
820
|
const e = Object.keys(this.settings)[0];
|
|
@@ -855,7 +855,7 @@ class Ct extends V {
|
|
|
855
855
|
const h = document.createElement("div");
|
|
856
856
|
h.className = "tab-panel", this.contentContainers[a] = h;
|
|
857
857
|
const p = this.settings[a];
|
|
858
|
-
p && (
|
|
858
|
+
p && (L(p) && typeof p.setNestingLevel == "function" && p.setNestingLevel(this.getNestingLevel() + 1), h.appendChild(
|
|
859
859
|
p.draw()
|
|
860
860
|
)), o.appendChild(h), l === 0 && !this.activeTabId && (this.activeTabId = a);
|
|
861
861
|
}), e.appendChild(i), e.appendChild(n), e.appendChild(o), !this.activeTabId) {
|
|
@@ -865,13 +865,13 @@ class Ct extends V {
|
|
|
865
865
|
return this.updateTabUI(), t;
|
|
866
866
|
}
|
|
867
867
|
}
|
|
868
|
-
function
|
|
869
|
-
return new
|
|
868
|
+
function bt(c) {
|
|
869
|
+
return new O(c);
|
|
870
870
|
}
|
|
871
|
-
function
|
|
871
|
+
function le(c) {
|
|
872
872
|
return c;
|
|
873
873
|
}
|
|
874
|
-
class
|
|
874
|
+
class wt extends b {
|
|
875
875
|
constructor(t = {}) {
|
|
876
876
|
super(t), this.inputType = "text", t.onChange && this.setOnChange(t.onChange);
|
|
877
877
|
}
|
|
@@ -891,12 +891,12 @@ class Et extends E {
|
|
|
891
891
|
});
|
|
892
892
|
}
|
|
893
893
|
}
|
|
894
|
-
const
|
|
895
|
-
class M extends
|
|
894
|
+
const xt = "<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>";
|
|
895
|
+
class M extends wt {
|
|
896
896
|
constructor(t) {
|
|
897
897
|
super({
|
|
898
898
|
...t,
|
|
899
|
-
icon: t.icon ||
|
|
899
|
+
icon: t.icon || xt,
|
|
900
900
|
title: t.title || "Color",
|
|
901
901
|
default: t.default ? M.normalizeColorValue(t.default) : "#000000"
|
|
902
902
|
}), this.inputType = "color", this.element = null, this.colorInputEl = null, this.textInputEl = null, this.detectChange = t.detectChange;
|
|
@@ -995,20 +995,20 @@ class M extends Et {
|
|
|
995
995
|
return this.isValidHex() ? this.hexToRgb(this.value) : "0, 0, 0";
|
|
996
996
|
}
|
|
997
997
|
}
|
|
998
|
-
const
|
|
998
|
+
const Lt = `
|
|
999
999
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1000
1000
|
<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"/>
|
|
1001
1001
|
<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"/>
|
|
1002
1002
|
<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"/>
|
|
1003
1003
|
</svg>`;
|
|
1004
|
-
class
|
|
1004
|
+
class T extends b {
|
|
1005
1005
|
constructor(t = {}) {
|
|
1006
1006
|
super({
|
|
1007
1007
|
...t,
|
|
1008
|
-
icon: t.icon ||
|
|
1008
|
+
icon: t.icon || Lt,
|
|
1009
1009
|
title: t.title || "Color & Opacity",
|
|
1010
1010
|
default: t.default || "#000000FF"
|
|
1011
|
-
}), 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 =
|
|
1011
|
+
}), 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 = T.normalizeHexWithOpacity(this.value));
|
|
1012
1012
|
}
|
|
1013
1013
|
static normalizeHexWithOpacity(t) {
|
|
1014
1014
|
return t = t.replace("#", ""), t.length === 3 && (t = t.split("").map((e) => e + e).join("")), t.length === 6 && (t = t + "FF"), t.length === 8 && /^[0-9A-Fa-f]{8}$/.test(t) ? `#${t.toUpperCase()}` : (console.warn(`Invalid hex value "${t}", using default "#000000FF"`), "#000000FF");
|
|
@@ -1026,7 +1026,7 @@ class P extends E {
|
|
|
1026
1026
|
return `#${i}${n}`;
|
|
1027
1027
|
}
|
|
1028
1028
|
setValue(t) {
|
|
1029
|
-
t === void 0 || t === "" ? this.value = "#000000FF" : this.value =
|
|
1029
|
+
t === void 0 || t === "" ? this.value = "#000000FF" : this.value = T.normalizeHexWithOpacity(t), this.updateInputElements(), this.updateColorPreview(), this.onChange && this.onChange(this.value), this.detectChange && this.detectChange(this.value);
|
|
1030
1030
|
}
|
|
1031
1031
|
updateInputElements() {
|
|
1032
1032
|
this.value && (this.colorInputEl && (this.colorInputEl.value = this.getRgbColor()), this.textInputEl && (this.textInputEl.value = this.value), this.opacityInputEl && (this.opacityInputEl.value = this.getOpacityPercent().toString()));
|
|
@@ -1037,7 +1037,7 @@ class P extends E {
|
|
|
1037
1037
|
this.colorPreviewEl.style.backgroundColor = `rgba(${s}, ${n}, ${o}, ${e})`;
|
|
1038
1038
|
}
|
|
1039
1039
|
handleColorChange(t) {
|
|
1040
|
-
const e = this.getOpacityPercent(), i =
|
|
1040
|
+
const e = this.getOpacityPercent(), i = T.combineColorOpacity(
|
|
1041
1041
|
t,
|
|
1042
1042
|
e
|
|
1043
1043
|
);
|
|
@@ -1048,7 +1048,7 @@ class P extends E {
|
|
|
1048
1048
|
return e || i ? (this.setValue(t), !0) : !1;
|
|
1049
1049
|
}
|
|
1050
1050
|
handleOpacityChange(t) {
|
|
1051
|
-
const e = this.getRgbColor(), i = Math.max(0, Math.min(100, t)), s =
|
|
1051
|
+
const e = this.getRgbColor(), i = Math.max(0, Math.min(100, t)), s = T.combineColorOpacity(
|
|
1052
1052
|
e,
|
|
1053
1053
|
i
|
|
1054
1054
|
);
|
|
@@ -1123,7 +1123,7 @@ class P extends E {
|
|
|
1123
1123
|
};
|
|
1124
1124
|
}
|
|
1125
1125
|
}
|
|
1126
|
-
class
|
|
1126
|
+
class re extends b {
|
|
1127
1127
|
constructor(t = {}) {
|
|
1128
1128
|
super(t), this.inputType = "text", t.onChange && this.setOnChange(t.onChange);
|
|
1129
1129
|
}
|
|
@@ -1155,7 +1155,7 @@ class ae extends E {
|
|
|
1155
1155
|
return e.addEventListener("input", i), e.addEventListener("change", i), e.addEventListener("blur", s), t.appendChild(e), t;
|
|
1156
1156
|
}
|
|
1157
1157
|
}
|
|
1158
|
-
class I extends
|
|
1158
|
+
class I extends b {
|
|
1159
1159
|
constructor(t) {
|
|
1160
1160
|
super(t), this.inputType = "number", this.inputElement = null, this.mobileValue = t.mobile, this.validateProps(), this.value = this.validateValue(this.value);
|
|
1161
1161
|
}
|
|
@@ -1214,12 +1214,12 @@ class I extends E {
|
|
|
1214
1214
|
);
|
|
1215
1215
|
}
|
|
1216
1216
|
}
|
|
1217
|
-
const
|
|
1217
|
+
const kt = `
|
|
1218
1218
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1219
1219
|
<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"/>
|
|
1220
1220
|
<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"/>
|
|
1221
1221
|
</svg>`;
|
|
1222
|
-
class
|
|
1222
|
+
class Mt extends I {
|
|
1223
1223
|
constructor(t = {}) {
|
|
1224
1224
|
const e = {
|
|
1225
1225
|
title: "Opacity",
|
|
@@ -1228,7 +1228,7 @@ class Lt extends I {
|
|
|
1228
1228
|
maxValue: 100,
|
|
1229
1229
|
step: 1,
|
|
1230
1230
|
default: t.default ?? 100,
|
|
1231
|
-
icon:
|
|
1231
|
+
icon: kt,
|
|
1232
1232
|
...t
|
|
1233
1233
|
};
|
|
1234
1234
|
super(e), this.inputType = "number", this.mobileValue = t.mobile;
|
|
@@ -1240,12 +1240,12 @@ class Lt extends I {
|
|
|
1240
1240
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
1241
1241
|
}
|
|
1242
1242
|
}
|
|
1243
|
-
const
|
|
1243
|
+
const St = `
|
|
1244
1244
|
<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">
|
|
1245
1245
|
<polyline points="6 9 12 15 18 9"></polyline>
|
|
1246
1246
|
</svg>
|
|
1247
1247
|
`;
|
|
1248
|
-
class
|
|
1248
|
+
class et extends b {
|
|
1249
1249
|
constructor(t = {}) {
|
|
1250
1250
|
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) {
|
|
1251
1251
|
const e = this._options.findIndex((i) => i.value === this.value);
|
|
@@ -1289,7 +1289,7 @@ class tt extends E {
|
|
|
1289
1289
|
a.onclick = (l) => this.selectOption(l, o, e), i.appendChild(a);
|
|
1290
1290
|
}), document.body.appendChild(i);
|
|
1291
1291
|
const s = document.createElement("div");
|
|
1292
|
-
return s.classList.add("svg-container"), s.innerHTML =
|
|
1292
|
+
return s.classList.add("svg-container"), s.innerHTML = St, t.appendChild(s), this.optionsListEl = i, this.svgContainer = s, this.props.getOptionsAsync && (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((n) => {
|
|
1293
1293
|
this._options.push(...n), this.isLoading = !1, this.updateOptionsList(), this.updateButtonText();
|
|
1294
1294
|
}).catch((n) => {
|
|
1295
1295
|
console.error("Failed to fetch async options:", n), this.isLoading = !1, this.updateButtonText("Failed to load options");
|
|
@@ -1358,7 +1358,7 @@ class tt extends E {
|
|
|
1358
1358
|
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();
|
|
1359
1359
|
}
|
|
1360
1360
|
}
|
|
1361
|
-
class
|
|
1361
|
+
class It extends b {
|
|
1362
1362
|
constructor(t = {}) {
|
|
1363
1363
|
super(t), this.inputType = "button", this.value || (this.value = "center");
|
|
1364
1364
|
}
|
|
@@ -1414,7 +1414,7 @@ class Mt extends E {
|
|
|
1414
1414
|
}), t.appendChild(i), t;
|
|
1415
1415
|
}
|
|
1416
1416
|
}
|
|
1417
|
-
class
|
|
1417
|
+
class ce extends b {
|
|
1418
1418
|
constructor(t) {
|
|
1419
1419
|
super(t), this.inputType = "button", this.bgWithAlpha = "rgba(145, 158, 171, 0.08)";
|
|
1420
1420
|
}
|
|
@@ -1443,7 +1443,7 @@ class le extends E {
|
|
|
1443
1443
|
return o.className = "button-setting-wrapper " + (this.props.wrapperClassName || ""), o.appendChild(t), o;
|
|
1444
1444
|
}
|
|
1445
1445
|
}
|
|
1446
|
-
class
|
|
1446
|
+
class he extends b {
|
|
1447
1447
|
constructor(t = {}) {
|
|
1448
1448
|
super(t), this.inputType = { width: "number", height: "number" }, this.aspectRatio = 1, this.isUpdating = !1;
|
|
1449
1449
|
const e = t.width || 0, i = t.height || 0;
|
|
@@ -1456,14 +1456,14 @@ class re extends E {
|
|
|
1456
1456
|
suffix: "px",
|
|
1457
1457
|
minValue: this.minWidth,
|
|
1458
1458
|
maxValue: this.maxWidth,
|
|
1459
|
-
icon:
|
|
1459
|
+
icon: Nt
|
|
1460
1460
|
}), this.heightSetting = new I({
|
|
1461
1461
|
title: "Height",
|
|
1462
1462
|
default: this.value.height,
|
|
1463
1463
|
suffix: "px",
|
|
1464
1464
|
minValue: this.minHeight,
|
|
1465
1465
|
maxValue: this.maxHeight,
|
|
1466
|
-
icon:
|
|
1466
|
+
icon: Vt
|
|
1467
1467
|
}), this.widthSetting.setOnChange(this.handleWidthChange.bind(this)), this.heightSetting.setOnChange(this.handleHeightChange.bind(this));
|
|
1468
1468
|
}
|
|
1469
1469
|
handleWidthChange(t) {
|
|
@@ -1557,24 +1557,24 @@ class re extends E {
|
|
|
1557
1557
|
}
|
|
1558
1558
|
}
|
|
1559
1559
|
}
|
|
1560
|
-
const
|
|
1560
|
+
const Nt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1561
1561
|
<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"/>
|
|
1562
|
-
</svg>`,
|
|
1562
|
+
</svg>`, Vt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1563
1563
|
<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"/>
|
|
1564
|
-
</svg>`,
|
|
1564
|
+
</svg>`, Y = `
|
|
1565
1565
|
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="16" viewBox="0 0 15 16" fill="none">
|
|
1566
1566
|
<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"/>
|
|
1567
1567
|
</svg>
|
|
1568
|
-
`,
|
|
1568
|
+
`, Ot = `
|
|
1569
1569
|
<svg width="91" height="71" viewBox="0 0 91 71" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1570
1570
|
<rect width="91" height="71" rx="4" fill="#F2F4F7"/>
|
|
1571
1571
|
<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"/>
|
|
1572
1572
|
</svg>
|
|
1573
|
-
`,
|
|
1573
|
+
`, Ht = `
|
|
1574
1574
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 12 12" fill="none">
|
|
1575
1575
|
<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"/>
|
|
1576
1576
|
</svg>
|
|
1577
|
-
`,
|
|
1577
|
+
`, Pt = `
|
|
1578
1578
|
<svg xmlns="http://www.w3.org/2000/svg" width="29" height="29" viewBox="0 0 29 29" fill="none">
|
|
1579
1579
|
<!-- Top dot -->
|
|
1580
1580
|
<circle cx="14.5" cy="3" r="1.5" fill="#02CC59" opacity="1"/>
|
|
@@ -1594,7 +1594,7 @@ const St = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewB
|
|
|
1594
1594
|
<circle cx="6.7" cy="6.7" r="1.5" fill="#02CC59" opacity="0.3"/>
|
|
1595
1595
|
</svg>
|
|
1596
1596
|
`;
|
|
1597
|
-
class
|
|
1597
|
+
class ht extends b {
|
|
1598
1598
|
constructor(t = {}) {
|
|
1599
1599
|
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();
|
|
1600
1600
|
}
|
|
@@ -1647,7 +1647,7 @@ class rt extends E {
|
|
|
1647
1647
|
);
|
|
1648
1648
|
if (t && t !== "") {
|
|
1649
1649
|
this.showLoading(), s && s instanceof HTMLElement && (s.style.display = "none"), e && e.classList.remove("no-image"), i && (i.innerHTML = `
|
|
1650
|
-
<span class="upload-icon">${
|
|
1650
|
+
<span class="upload-icon">${Y}</span>
|
|
1651
1651
|
<span class="upload-label">Replace</span>
|
|
1652
1652
|
`);
|
|
1653
1653
|
const n = () => {
|
|
@@ -1658,7 +1658,7 @@ class rt extends E {
|
|
|
1658
1658
|
this.previewEl.addEventListener("load", n), this.previewEl.addEventListener("error", o), this.previewEl.src = t;
|
|
1659
1659
|
} else
|
|
1660
1660
|
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 = `
|
|
1661
|
-
<span class="upload-icon">${
|
|
1661
|
+
<span class="upload-icon">${Y}</span>
|
|
1662
1662
|
<span class="upload-label">Upload</span>
|
|
1663
1663
|
`);
|
|
1664
1664
|
}
|
|
@@ -1691,9 +1691,9 @@ class rt extends E {
|
|
|
1691
1691
|
const s = this.value && this.value !== "";
|
|
1692
1692
|
s || i.classList.add("no-image");
|
|
1693
1693
|
const n = document.createElement("div");
|
|
1694
|
-
if (n.className = "preview-placeholder", n.innerHTML =
|
|
1694
|
+
if (n.className = "preview-placeholder", n.innerHTML = Ot, this.previewWrapper = document.createElement("div"), this.previewWrapper.className = "preview-wrapper", this.loadingSpinner = document.createElement("div"), this.loadingSpinner.className = "loading-spinner", this.loadingSpinner.innerHTML = Pt, this.loadingSpinner.style.display = "none", this.previewWrapper.appendChild(this.loadingSpinner), this.previewEl = document.createElement("img"), this.previewEl.className = "upload-preview", this.props.delete) {
|
|
1695
1695
|
const a = document.createElement("button");
|
|
1696
|
-
a.className = "delete-button", a.type = "button", a.title = "Delete image", a.innerHTML =
|
|
1696
|
+
a.className = "delete-button", a.type = "button", a.title = "Delete image", a.innerHTML = Ht, this.previewWrapper.appendChild(a), a.onclick = (l) => {
|
|
1697
1697
|
var r;
|
|
1698
1698
|
l.stopPropagation(), this.value = "", this.updatePreviewState(null), (r = this.onChange) == null || r.call(this, ""), this.hideError();
|
|
1699
1699
|
};
|
|
@@ -1701,7 +1701,7 @@ class rt extends E {
|
|
|
1701
1701
|
this.previewWrapper.appendChild(this.previewEl);
|
|
1702
1702
|
const o = document.createElement("button");
|
|
1703
1703
|
return o.className = "upload-button", this.getDataPropsPath() && o.setAttribute("data-test-id", this.getDataPropsPath()), o.innerHTML = `
|
|
1704
|
-
<span class="upload-icon">${
|
|
1704
|
+
<span class="upload-icon">${Y}</span>
|
|
1705
1705
|
<span class="upload-label">Upload</span>
|
|
1706
1706
|
`, i.appendChild(n), i.appendChild(this.previewWrapper), i.appendChild(o), t.appendChild(i), s ? this.updatePreviewState(this.value) : this.updatePreviewState(null), o.onclick = () => {
|
|
1707
1707
|
window.postMessage(
|
|
@@ -1714,14 +1714,14 @@ class rt extends E {
|
|
|
1714
1714
|
}, t;
|
|
1715
1715
|
}
|
|
1716
1716
|
}
|
|
1717
|
-
class
|
|
1717
|
+
class pe extends I {
|
|
1718
1718
|
constructor(t = {}) {
|
|
1719
1719
|
super({
|
|
1720
1720
|
...t,
|
|
1721
1721
|
title: t.title || "Height",
|
|
1722
1722
|
suffix: t.suffix || "px",
|
|
1723
1723
|
minValue: t.minValue ?? 0,
|
|
1724
|
-
icon: t.icon ||
|
|
1724
|
+
icon: t.icon || Tt,
|
|
1725
1725
|
default: t.default ?? 100
|
|
1726
1726
|
}), this.inputType = "number", this.mobileValue = t.mobile;
|
|
1727
1727
|
}
|
|
@@ -1732,17 +1732,17 @@ class ce extends I {
|
|
|
1732
1732
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
1733
1733
|
}
|
|
1734
1734
|
}
|
|
1735
|
-
const
|
|
1735
|
+
const Tt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1736
1736
|
<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"/>
|
|
1737
1737
|
</svg>`;
|
|
1738
|
-
class
|
|
1738
|
+
class de extends I {
|
|
1739
1739
|
constructor(t = {}) {
|
|
1740
1740
|
super({
|
|
1741
1741
|
...t,
|
|
1742
1742
|
title: t.title || "Width",
|
|
1743
1743
|
suffix: t.suffix || "px",
|
|
1744
1744
|
minValue: t.minValue ?? 0,
|
|
1745
|
-
icon: t.icon ||
|
|
1745
|
+
icon: t.icon || $t,
|
|
1746
1746
|
default: t.default ?? 100
|
|
1747
1747
|
}), this.inputType = "number", this.mobileValue = t.mobile;
|
|
1748
1748
|
}
|
|
@@ -1753,14 +1753,14 @@ class he extends I {
|
|
|
1753
1753
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
1754
1754
|
}
|
|
1755
1755
|
}
|
|
1756
|
-
const
|
|
1756
|
+
const $t = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1757
1757
|
<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"/>
|
|
1758
|
-
</svg>`,
|
|
1758
|
+
</svg>`, At = `
|
|
1759
1759
|
<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">
|
|
1760
1760
|
<polyline points="6 9 12 15 18 9"></polyline>
|
|
1761
1761
|
</svg>
|
|
1762
1762
|
`;
|
|
1763
|
-
class
|
|
1763
|
+
class ue extends b {
|
|
1764
1764
|
constructor(t = {}) {
|
|
1765
1765
|
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) {
|
|
1766
1766
|
const e = this._options.findIndex(
|
|
@@ -1815,7 +1815,7 @@ class pe extends E {
|
|
|
1815
1815
|
a.onclick = (l) => this.selectApiOption(l, o, e), i.appendChild(a);
|
|
1816
1816
|
}), t.appendChild(i);
|
|
1817
1817
|
const s = document.createElement("div");
|
|
1818
|
-
return s.classList.add("svg-container"), s.innerHTML =
|
|
1818
|
+
return s.classList.add("svg-container"), s.innerHTML = At, t.appendChild(s), s.onclick = () => {
|
|
1819
1819
|
var n, o;
|
|
1820
1820
|
this.isLoading || (this.isOpen = !this.isOpen, (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (o = this.svgContainer) == null || o.classList.toggle("open", this.isOpen));
|
|
1821
1821
|
}, this.optionsListEl = i, this.svgContainer = s, this.props.getOptionsAsync && !this.hasInitializedOptions ? (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((n) => {
|
|
@@ -1907,7 +1907,7 @@ class pe extends E {
|
|
|
1907
1907
|
), this.updateButtonText();
|
|
1908
1908
|
}
|
|
1909
1909
|
}
|
|
1910
|
-
class
|
|
1910
|
+
class ge extends b {
|
|
1911
1911
|
constructor(t) {
|
|
1912
1912
|
var e, i;
|
|
1913
1913
|
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;
|
|
@@ -1957,13 +1957,13 @@ class de extends E {
|
|
|
1957
1957
|
this.detectChangeCallback = t;
|
|
1958
1958
|
}
|
|
1959
1959
|
}
|
|
1960
|
-
const
|
|
1960
|
+
const Bt = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1961
1961
|
<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"/>
|
|
1962
1962
|
</svg>`;
|
|
1963
|
-
class
|
|
1963
|
+
class me extends b {
|
|
1964
1964
|
// Store mobile value
|
|
1965
1965
|
constructor(t = {}) {
|
|
1966
|
-
t.rowGap = t.rowGap ?? !0, t.columnGap = t.columnGap ?? !0, t.title = t.title ?? "Gap", t.icon = t.icon ??
|
|
1966
|
+
t.rowGap = t.rowGap ?? !0, t.columnGap = t.columnGap ?? !0, t.title = t.title ?? "Gap", t.icon = t.icon ?? Bt, 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);
|
|
1967
1967
|
}
|
|
1968
1968
|
draw() {
|
|
1969
1969
|
const t = document.createElement("div");
|
|
@@ -2014,42 +2014,42 @@ class ue extends E {
|
|
|
2014
2014
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
2015
2015
|
}
|
|
2016
2016
|
}
|
|
2017
|
-
const
|
|
2017
|
+
const Dt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2018
2018
|
<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"/>
|
|
2019
2019
|
</svg>`;
|
|
2020
|
-
class
|
|
2020
|
+
class fe extends I {
|
|
2021
2021
|
constructor(t = {}) {
|
|
2022
2022
|
super({
|
|
2023
2023
|
...t,
|
|
2024
2024
|
minValue: t.minValue ?? 0,
|
|
2025
2025
|
maxValue: t.maxValue ?? 1e3,
|
|
2026
|
-
icon: t.icon ||
|
|
2026
|
+
icon: t.icon || Dt,
|
|
2027
2027
|
title: t.title || "Margin Bottom",
|
|
2028
2028
|
default: t.default ?? 20,
|
|
2029
2029
|
wrapperClassName: "margin-bottom-wrapper " + (t.wrapperClassName || "")
|
|
2030
2030
|
}), this.inputType = "number";
|
|
2031
2031
|
}
|
|
2032
2032
|
}
|
|
2033
|
-
const
|
|
2033
|
+
const Rt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2034
2034
|
<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"
|
|
2035
2035
|
stroke="#667085" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2036
2036
|
</svg>`;
|
|
2037
|
-
class
|
|
2037
|
+
class ve extends I {
|
|
2038
2038
|
constructor(t = {}) {
|
|
2039
2039
|
super({
|
|
2040
2040
|
...t,
|
|
2041
2041
|
minValue: t.minValue ?? 0,
|
|
2042
2042
|
maxValue: t.maxValue ?? 1e3,
|
|
2043
|
-
icon: t.icon ||
|
|
2043
|
+
icon: t.icon || Rt,
|
|
2044
2044
|
title: t.title || "Margin Top",
|
|
2045
2045
|
default: t.default ?? 20,
|
|
2046
2046
|
wrapperClassName: "margin-top-wrapper " + (t.wrapperClassName || "")
|
|
2047
2047
|
}), this.inputType = "number";
|
|
2048
2048
|
}
|
|
2049
2049
|
}
|
|
2050
|
-
class
|
|
2050
|
+
class Ce extends b {
|
|
2051
2051
|
constructor(t) {
|
|
2052
|
-
super(t), this.inputType = {}, this.container = null, this.defaultLanguage = "", this.uploadSettings = /* @__PURE__ */ new Map(), t.default ? this.value = { ...t.default } : this.value || (this.value = {}), this.defaultLanguage = t.languages.includes(
|
|
2052
|
+
super(t), this.inputType = {}, this.container = null, this.defaultLanguage = "", this.uploadSettings = /* @__PURE__ */ new Map(), t.default ? this.value = { ...t.default } : this.value || (this.value = {}), this.defaultLanguage = t.languages.includes(b.DefaultLanguage) ? b.DefaultLanguage : t.languages[0];
|
|
2053
2053
|
const e = t.defaultValue || `Enter text in ${this.capitalizeFirstLetter(this.defaultLanguage)}`;
|
|
2054
2054
|
t.languages.forEach((i) => {
|
|
2055
2055
|
var s, n;
|
|
@@ -2098,7 +2098,7 @@ class fe extends E {
|
|
|
2098
2098
|
i.classList.add("simple-multi-language-row");
|
|
2099
2099
|
const s = document.createElement("label");
|
|
2100
2100
|
if (s.classList.add("simple-language-label"), s.textContent = t.toUpperCase(), s.setAttribute("for", `textarea-${t}`), i.appendChild(s), this.props.multiImg) {
|
|
2101
|
-
const n = new
|
|
2101
|
+
const n = new ht({
|
|
2102
2102
|
defaultUrl: e || "",
|
|
2103
2103
|
title: "",
|
|
2104
2104
|
id: `${this.id}_upload_${t}`
|
|
@@ -2194,7 +2194,7 @@ class fe extends E {
|
|
|
2194
2194
|
});
|
|
2195
2195
|
}
|
|
2196
2196
|
}
|
|
2197
|
-
class
|
|
2197
|
+
class ye extends b {
|
|
2198
2198
|
constructor(t = {}) {
|
|
2199
2199
|
super(t), this.inputType = "select";
|
|
2200
2200
|
const e = [
|
|
@@ -2205,7 +2205,7 @@ class ve extends E {
|
|
|
2205
2205
|
{ name: "Bounce", value: "bounce 1.5s ease-in-out infinite" },
|
|
2206
2206
|
{ name: "Pulse", value: "pulse 1.5s ease-in-out infinite" }
|
|
2207
2207
|
];
|
|
2208
|
-
this.selectSetting = new
|
|
2208
|
+
this.selectSetting = new et({
|
|
2209
2209
|
title: this.title || "Animation",
|
|
2210
2210
|
options: e,
|
|
2211
2211
|
default: this.props.default || "none"
|
|
@@ -2221,7 +2221,7 @@ class ve extends E {
|
|
|
2221
2221
|
this.selectSetting.destroy(), super.destroy();
|
|
2222
2222
|
}
|
|
2223
2223
|
}
|
|
2224
|
-
const
|
|
2224
|
+
const Ft = (c, t) => {
|
|
2225
2225
|
let e = !1, i = 0, s = 0, n = 0, o = 0;
|
|
2226
2226
|
const a = (h) => {
|
|
2227
2227
|
if (h.target.closest("button")) return;
|
|
@@ -2231,41 +2231,41 @@ const Dt = (c, t) => {
|
|
|
2231
2231
|
}, l = (h) => {
|
|
2232
2232
|
if (!e) return;
|
|
2233
2233
|
const p = h.clientX - i, d = h.clientY - s, g = window.innerWidth, u = window.innerHeight, m = t.offsetWidth, f = t.offsetHeight;
|
|
2234
|
-
let
|
|
2235
|
-
|
|
2234
|
+
let C = n + p, x = o + d;
|
|
2235
|
+
C = Math.max(8, Math.min(g - m - 8, C)), x = Math.max(8, Math.min(u - f - 8, x)), t.style.left = `${C}px`, t.style.top = `${x}px`;
|
|
2236
2236
|
}, r = () => {
|
|
2237
2237
|
e = !1, document.removeEventListener("mousemove", l), document.removeEventListener("mouseup", r), document.body.style.userSelect = "";
|
|
2238
2238
|
};
|
|
2239
2239
|
c.addEventListener("mousedown", a);
|
|
2240
|
-
},
|
|
2240
|
+
}, F = (c) => {
|
|
2241
2241
|
if (!c) return null;
|
|
2242
2242
|
let t = c.trim();
|
|
2243
2243
|
return !t.startsWith("#") || (t = t.slice(1), t.length === 3 && (t = t.split("").map((e) => e + e).join("")), !/^[0-9a-fA-F]{6}$/.test(t)) ? null : `#${t.toUpperCase()}`;
|
|
2244
|
-
},
|
|
2244
|
+
}, R = (c, t, e) => `#${[c, t, e].map((i) => Math.max(0, Math.min(255, i)).toString(16).padStart(2, "0")).join("")}`, S = (c) => {
|
|
2245
2245
|
const t = c.replace("#", ""), e = t.length === 3 ? t.split("").map((i) => i + i).join("") : t;
|
|
2246
2246
|
return {
|
|
2247
2247
|
r: parseInt(e.slice(0, 2), 16),
|
|
2248
2248
|
g: parseInt(e.slice(2, 4), 16),
|
|
2249
2249
|
b: parseInt(e.slice(4, 6), 16)
|
|
2250
2250
|
};
|
|
2251
|
-
},
|
|
2251
|
+
}, A = (c) => {
|
|
2252
2252
|
const { r: t, g: e, b: i } = S(c), s = t / 255, n = e / 255, o = i / 255, a = Math.max(s, n, o), l = Math.min(s, n, o), r = a - l;
|
|
2253
2253
|
let h = 0;
|
|
2254
|
-
r !== 0 && (a === s ? h = (n - o) / r % 6 : a === n ? h = (o - s) / r + 2 : h = (s - n) / r + 4);
|
|
2254
|
+
r !== 0 && (a === s ? h = (n - o) / r % 6 : a === n ? h = (o - s) / r + 2 : h = (s - n) / r + 4), h < 0 && (h += 6);
|
|
2255
2255
|
const p = a === 0 ? 0 : r / a, d = a;
|
|
2256
2256
|
return { h: h * 60, s: p, v: d };
|
|
2257
|
-
},
|
|
2258
|
-
const i = e * t,
|
|
2259
|
-
let
|
|
2260
|
-
return
|
|
2261
|
-
Math.round((
|
|
2262
|
-
Math.round((
|
|
2263
|
-
Math.round((
|
|
2257
|
+
}, z = (c, t, e) => {
|
|
2258
|
+
const i = (c % 360 + 360) % 360, s = e * t, n = s * (1 - Math.abs(i / 60 % 2 - 1)), o = e - s;
|
|
2259
|
+
let a = 0, l = 0, r = 0;
|
|
2260
|
+
return i < 60 ? (a = s, l = n, r = 0) : i < 120 ? (a = n, l = s, r = 0) : i < 180 ? (a = 0, l = s, r = n) : i < 240 ? (a = 0, l = n, r = s) : i < 300 ? (a = n, l = 0, r = s) : (a = s, l = 0, r = n), R(
|
|
2261
|
+
Math.round((a + o) * 255),
|
|
2262
|
+
Math.round((l + o) * 255),
|
|
2263
|
+
Math.round((r + o) * 255)
|
|
2264
2264
|
);
|
|
2265
|
-
},
|
|
2265
|
+
}, Gt = (c, t, e) => {
|
|
2266
2266
|
const i = e * (1 - t / 2), s = i === 0 || i === 1 ? 0 : (e - i) / Math.min(i, 1 - i);
|
|
2267
2267
|
return { hue: c, sat: s, lightness: i };
|
|
2268
|
-
},
|
|
2268
|
+
}, Z = (c, t, e) => {
|
|
2269
2269
|
const i = (1 - Math.abs(2 * e - 1)) * t, s = i * (1 - Math.abs(c / 60 % 2 - 1)), n = e - i / 2;
|
|
2270
2270
|
let o = 0, a = 0, l = 0;
|
|
2271
2271
|
return c < 60 ? (o = i, a = s, l = 0) : c < 120 ? (o = s, a = i, l = 0) : c < 180 ? (o = 0, a = i, l = s) : c < 240 ? (o = 0, a = s, l = i) : c < 300 ? (o = s, a = 0, l = i) : (o = i, a = 0, l = s), {
|
|
@@ -2273,7 +2273,7 @@ const Dt = (c, t) => {
|
|
|
2273
2273
|
g: Math.round((a + n) * 255),
|
|
2274
2274
|
b: Math.round((l + n) * 255)
|
|
2275
2275
|
};
|
|
2276
|
-
},
|
|
2276
|
+
}, pt = (c, t) => {
|
|
2277
2277
|
const e = Math.max(0, Math.min(100, t)) / 100;
|
|
2278
2278
|
if (c.startsWith("#")) {
|
|
2279
2279
|
const { r: s, g: n, b: o } = S(c);
|
|
@@ -2286,7 +2286,7 @@ const Dt = (c, t) => {
|
|
|
2286
2286
|
if (c.startsWith("hsl(")) {
|
|
2287
2287
|
const s = c.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);
|
|
2288
2288
|
if (s) {
|
|
2289
|
-
const { r: n, g: o, b: a } =
|
|
2289
|
+
const { r: n, g: o, b: a } = Z(
|
|
2290
2290
|
parseInt(s[1]),
|
|
2291
2291
|
parseInt(s[2]) / 100,
|
|
2292
2292
|
parseInt(s[3]) / 100
|
|
@@ -2297,7 +2297,7 @@ const Dt = (c, t) => {
|
|
|
2297
2297
|
if (c.startsWith("hsla(")) {
|
|
2298
2298
|
const s = c.match(/hsla\((\d+),\s*(\d+)%,\s*(\d+)%,\s*[\d.]+\)/);
|
|
2299
2299
|
if (s) {
|
|
2300
|
-
const { r: n, g: o, b: a } =
|
|
2300
|
+
const { r: n, g: o, b: a } = Z(
|
|
2301
2301
|
parseInt(s[1]),
|
|
2302
2302
|
parseInt(s[2]) / 100,
|
|
2303
2303
|
parseInt(s[3]) / 100
|
|
@@ -2305,13 +2305,13 @@ const Dt = (c, t) => {
|
|
|
2305
2305
|
return `rgba(${n}, ${o}, ${a}, ${e})`;
|
|
2306
2306
|
}
|
|
2307
2307
|
}
|
|
2308
|
-
const i =
|
|
2308
|
+
const i = F(c);
|
|
2309
2309
|
if (i) {
|
|
2310
2310
|
const { r: s, g: n, b: o } = S(i);
|
|
2311
2311
|
return `rgba(${s}, ${n}, ${o}, ${e})`;
|
|
2312
2312
|
}
|
|
2313
2313
|
return c;
|
|
2314
|
-
},
|
|
2314
|
+
}, Wt = (c) => [
|
|
2315
2315
|
"red",
|
|
2316
2316
|
"green",
|
|
2317
2317
|
"blue",
|
|
@@ -2335,22 +2335,22 @@ const Dt = (c, t) => {
|
|
|
2335
2335
|
"teal",
|
|
2336
2336
|
"fuchsia",
|
|
2337
2337
|
"transparent"
|
|
2338
|
-
].includes(c.toLowerCase()),
|
|
2338
|
+
].includes(c.toLowerCase()), dt = (c) => [
|
|
2339
2339
|
/^#[0-9a-fA-F]{3,8}$/,
|
|
2340
2340
|
/^rgba?\s*\([^)]+\)$/,
|
|
2341
2341
|
/^hsla?\s*\([^)]+\)$/,
|
|
2342
2342
|
/^[a-zA-Z]+$/
|
|
2343
|
-
].some((e) => e.test(c.trim())),
|
|
2343
|
+
].some((e) => e.test(c.trim())), zt = (c) => {
|
|
2344
2344
|
if (typeof document > "u")
|
|
2345
|
-
return
|
|
2345
|
+
return dt(c) || !!F(c);
|
|
2346
2346
|
const t = document.createElement("div");
|
|
2347
2347
|
return t.style.color = c, t.style.color !== "";
|
|
2348
|
-
},
|
|
2348
|
+
}, ut = (c) => {
|
|
2349
2349
|
const t = c.trim();
|
|
2350
2350
|
if (/^#[0-9A-Fa-f]{8}$/.test(t)) {
|
|
2351
2351
|
const n = t.slice(1), o = parseInt(n.slice(0, 2), 16), a = parseInt(n.slice(2, 4), 16), l = parseInt(n.slice(4, 6), 16), r = parseInt(n.slice(6, 8), 16);
|
|
2352
2352
|
return {
|
|
2353
|
-
color:
|
|
2353
|
+
color: R(o, a, l),
|
|
2354
2354
|
position: 0,
|
|
2355
2355
|
opacity: Math.round(r / 255 * 100)
|
|
2356
2356
|
};
|
|
@@ -2361,7 +2361,7 @@ const Dt = (c, t) => {
|
|
|
2361
2361
|
if (e) {
|
|
2362
2362
|
const n = parseInt(e[1]), o = parseInt(e[2]), a = parseInt(e[3]), l = e[4] ? parseFloat(e[4]) : 1;
|
|
2363
2363
|
return {
|
|
2364
|
-
color:
|
|
2364
|
+
color: R(n, o, a),
|
|
2365
2365
|
position: 0,
|
|
2366
2366
|
opacity: Math.round(l * 100)
|
|
2367
2367
|
};
|
|
@@ -2370,19 +2370,19 @@ const Dt = (c, t) => {
|
|
|
2370
2370
|
/hsla?\s*\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)/
|
|
2371
2371
|
);
|
|
2372
2372
|
if (i) {
|
|
2373
|
-
const { r: n, g: o, b: a } =
|
|
2373
|
+
const { r: n, g: o, b: a } = Z(
|
|
2374
2374
|
parseFloat(i[1]),
|
|
2375
2375
|
parseFloat(i[2]) / 100,
|
|
2376
2376
|
parseFloat(i[3]) / 100
|
|
2377
2377
|
), l = i[4] ? parseFloat(i[4]) : 1;
|
|
2378
2378
|
return {
|
|
2379
|
-
color:
|
|
2379
|
+
color: R(n, o, a),
|
|
2380
2380
|
position: 0,
|
|
2381
2381
|
opacity: Math.round(l * 100)
|
|
2382
2382
|
};
|
|
2383
2383
|
}
|
|
2384
|
-
return { color:
|
|
2385
|
-
},
|
|
2384
|
+
return { color: F(t) || t, position: 0, opacity: 100 };
|
|
2385
|
+
}, q = class q {
|
|
2386
2386
|
static defaults() {
|
|
2387
2387
|
return { solid: [], gradient: [] };
|
|
2388
2388
|
}
|
|
@@ -2395,7 +2395,7 @@ const Dt = (c, t) => {
|
|
|
2395
2395
|
const i = JSON.parse(e);
|
|
2396
2396
|
["solid", "gradient"].forEach((s) => {
|
|
2397
2397
|
const n = Array.isArray(i == null ? void 0 : i[s]) ? i[s] : [];
|
|
2398
|
-
this.colors[s] = n.map((o) =>
|
|
2398
|
+
this.colors[s] = n.map((o) => F(o)).filter((o) => !!o);
|
|
2399
2399
|
});
|
|
2400
2400
|
} catch {
|
|
2401
2401
|
this.colors = this.defaults();
|
|
@@ -2419,15 +2419,15 @@ const Dt = (c, t) => {
|
|
|
2419
2419
|
return [...this.list(t)];
|
|
2420
2420
|
}
|
|
2421
2421
|
static addColor(t, e) {
|
|
2422
|
-
const i =
|
|
2422
|
+
const i = F(t);
|
|
2423
2423
|
if (!i) return;
|
|
2424
2424
|
const s = this.list(e), n = s.indexOf(i);
|
|
2425
2425
|
n !== -1 && s.splice(n, 1), s.unshift(i), s.length > this.MAX_COLORS && (s.length = this.MAX_COLORS), this.persist();
|
|
2426
2426
|
}
|
|
2427
2427
|
};
|
|
2428
|
-
|
|
2429
|
-
let
|
|
2430
|
-
const
|
|
2428
|
+
q.STORAGE_KEY = "settingsLib_recentColors", q.MAX_COLORS = 12, q.colors = null;
|
|
2429
|
+
let V = q;
|
|
2430
|
+
const qt = (c, t) => {
|
|
2431
2431
|
const e = document.createElement("div");
|
|
2432
2432
|
e.className = "color-picker-recent-section";
|
|
2433
2433
|
const i = document.createElement("div");
|
|
@@ -2438,7 +2438,7 @@ const Wt = (c, t) => {
|
|
|
2438
2438
|
n.className = "color-picker-recent-placeholder", n.textContent = "No recent colors yet", e.appendChild(i), e.appendChild(s), e.appendChild(n);
|
|
2439
2439
|
const o = () => {
|
|
2440
2440
|
s.innerHTML = "";
|
|
2441
|
-
const a =
|
|
2441
|
+
const a = V.getColors(t);
|
|
2442
2442
|
if (a.length === 0) {
|
|
2443
2443
|
s.style.display = "none", n.style.display = "block";
|
|
2444
2444
|
return;
|
|
@@ -2449,25 +2449,25 @@ const Wt = (c, t) => {
|
|
|
2449
2449
|
});
|
|
2450
2450
|
};
|
|
2451
2451
|
return o(), { container: e, refresh: o };
|
|
2452
|
-
},
|
|
2452
|
+
}, gt = `<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2453
2453
|
<path fill-rule="evenodd" clip-rule="evenodd"
|
|
2454
2454
|
d="M6.12347 4.96653L1.41158 0.254304C1.25449 0.102568 1.04409 0.0186071 0.825694 0.0205049C0.607302 0.0224037 0.398393 0.110007 0.24396 0.26445C0.0895282 0.418893 0.0019303 0.627818 3.24698e-05 0.846225C-0.00186536 1.06463 0.0820894 1.27505 0.233815 1.43215L4.9457 6.14438L0.233814 10.8566C0.0820886 11.0137 -0.00186625 11.2241 3.15434e-05 11.4425C0.00192934 11.6609 0.0895272 11.8699 0.243959 12.0243C0.398392 12.1787 0.607301 12.2663 0.825693 12.2682C1.04408 12.2701 1.25449 12.1862 1.41158 12.0344L6.12347 7.32222L10.8354 12.0344C10.9932 12.1824 11.2023 12.2632 11.4186 12.2597C11.6349 12.2562 11.8414 12.1687 11.9943 12.0156C12.1472 11.8626 12.2346 11.6561 12.2379 11.4398C12.2413 11.2234 12.1604 11.0143 12.0123 10.8566L7.30123 6.14438L12.0131 1.43215C12.0927 1.35531 12.1561 1.2634 12.1998 1.16177C12.2434 1.06014 12.2664 0.950833 12.2674 0.84023C12.2683 0.729626 12.2473 0.61994 12.2054 0.517568C12.1635 0.415196 12.1017 0.322191 12.0234 0.243979C11.9452 0.165768 11.8522 0.103916 11.7499 0.0620327C11.6475 0.0201492 11.5378 -0.000927989 11.4272 3.33052e-05C11.3166 0.000993646 11.2073 0.0239743 11.1057 0.0676297C11.0041 0.111286 10.9122 0.174745 10.8354 0.254305L6.12347 4.96653Z"
|
|
2455
2455
|
fill="#919EAB"/>
|
|
2456
|
-
</svg>`,
|
|
2456
|
+
</svg>`, Ut = `<svg width="23" height="23" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2457
2457
|
<path fill-rule="evenodd" clip-rule="evenodd"
|
|
2458
2458
|
d="M19.1972 3.29156C18.936 3.03034 18.6259 2.82313 18.2847 2.68176C17.9434 2.54039 17.5777 2.46763 17.2083 2.46763C16.8389 2.46763 16.4731 2.54039 16.1319 2.68176C15.7906 2.82313 15.4805 3.03034 15.2194 3.29156L13.7822 4.72875C13.2585 4.4772 12.6697 4.39449 12.097 4.49207C11.5243 4.58964 10.9961 4.86267 10.5853 5.27343L9.91687 5.94281C9.74268 6.11693 9.6045 6.32366 9.51023 6.5512C9.41595 6.77873 9.36743 7.02261 9.36743 7.2689C9.36743 7.5152 9.41595 7.75907 9.51023 7.98661C9.6045 8.21414 9.74268 8.42088 9.91687 8.595L3.83625 14.6747C3.57512 14.936 3.36803 15.2462 3.2268 15.5875C3.08556 15.9288 3.01296 16.2947 3.01312 16.6641V18.3516C3.01312 18.6499 3.13165 18.9361 3.34263 19.1471C3.55361 19.358 3.83975 19.4766 4.13812 19.4766H5.82562C6.57129 19.4759 7.28618 19.1792 7.81312 18.6516L13.8937 12.5728C14.0679 12.747 14.2746 12.8852 14.5021 12.9795C14.7297 13.0737 14.9735 13.1223 15.2198 13.1223C15.4661 13.1223 15.71 13.0737 15.9375 12.9795C16.1651 12.8852 16.3718 12.747 16.5459 12.5728L17.2153 11.9025C17.6261 11.4917 17.8991 10.9635 17.9967 10.3908C18.0942 9.81811 18.0115 9.22926 17.76 8.70562L19.1972 7.26937C19.4584 7.0082 19.6656 6.69813 19.807 6.35687C19.9484 6.01561 20.0211 5.64985 20.0211 5.28047C20.0211 4.91108 19.9484 4.54532 19.807 4.20406C19.6656 3.8628 19.4584 3.55273 19.1972 3.29156Z"
|
|
2459
2459
|
fill="#353C47"/>
|
|
2460
|
-
</svg>`,
|
|
2460
|
+
</svg>`, jt = `<svg width="15" height="17" viewBox="0 0 15 17" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2461
2461
|
<path d="M14.1333 12.4667H0.8M0.8 12.4667L4.13333 9.13332M0.8 12.4667L4.13333 15.8M0.8 4.13332H14.1333M14.1333 4.13332L10.8 0.799988M14.1333 4.13332L10.8 7.46665" stroke="#919EAB" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2462
|
-
</svg>`,
|
|
2462
|
+
</svg>`, _t = `<svg width="14" height="2" viewBox="0 0 14 2" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2463
2463
|
<path d="M0.8 0.800003H12.4667" stroke="#919EAB" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2464
2464
|
</svg>`;
|
|
2465
|
-
class
|
|
2465
|
+
class Jt {
|
|
2466
2466
|
constructor(t, e = "gradient") {
|
|
2467
2467
|
this.isOpen = !1, this.currentColor = "#FF0000", this.currentOpacity = 100, this.outsideClick = (i) => {
|
|
2468
2468
|
if (!this.isOpen) return;
|
|
2469
2469
|
const s = i.target;
|
|
2470
|
-
if (
|
|
2470
|
+
if (this.element.contains(s)) return;
|
|
2471
2471
|
const n = document.querySelectorAll(".gstop-color-input");
|
|
2472
2472
|
Array.from(n).some(
|
|
2473
2473
|
(a) => a.contains(s)
|
|
@@ -2484,6 +2484,10 @@ class Ut {
|
|
|
2484
2484
|
}
|
|
2485
2485
|
}, this.onChange = t, this.recentScope = e, this.element = this.build(), this.backdrop = this.createBackdrop();
|
|
2486
2486
|
}
|
|
2487
|
+
parsePercentage(t) {
|
|
2488
|
+
const e = parseFloat(t);
|
|
2489
|
+
return isNaN(e) ? 0 : e / 100;
|
|
2490
|
+
}
|
|
2487
2491
|
build() {
|
|
2488
2492
|
const t = document.createElement("div");
|
|
2489
2493
|
t.className = "custom-color-picker", t.style.display = "none";
|
|
@@ -2492,7 +2496,7 @@ class Ut {
|
|
|
2492
2496
|
const i = document.createElement("span");
|
|
2493
2497
|
i.textContent = "Color";
|
|
2494
2498
|
const s = document.createElement("button");
|
|
2495
|
-
s.className = "color-picker-close", s.innerHTML =
|
|
2499
|
+
s.className = "color-picker-close", s.innerHTML = gt, s.addEventListener("click", () => this.close(!0)), e.appendChild(i), e.appendChild(s), Ft(e, t);
|
|
2496
2500
|
const n = document.createElement("div");
|
|
2497
2501
|
n.className = "color-picker-area", this.colorArea = n;
|
|
2498
2502
|
const o = document.createElement("div");
|
|
@@ -2500,7 +2504,7 @@ class Ut {
|
|
|
2500
2504
|
const a = document.createElement("div");
|
|
2501
2505
|
a.className = "color-picker-hue-container";
|
|
2502
2506
|
const l = document.createElement("button");
|
|
2503
|
-
l.className = "color-picker-eyedropper", l.type = "button", l.innerHTML =
|
|
2507
|
+
l.className = "color-picker-eyedropper", l.type = "button", l.innerHTML = Ut;
|
|
2504
2508
|
const r = document.createElement("div");
|
|
2505
2509
|
r.className = "color-picker-hue", this.hueSlider = r;
|
|
2506
2510
|
const h = document.createElement("div");
|
|
@@ -2509,9 +2513,9 @@ class Ut {
|
|
|
2509
2513
|
p.className = "color-picker-opacity", this.opacitySlider = p;
|
|
2510
2514
|
const d = document.createElement("div");
|
|
2511
2515
|
d.className = "color-picker-opacity-marker", this.opacityMarker = d, p.appendChild(d);
|
|
2512
|
-
const g =
|
|
2513
|
-
var
|
|
2514
|
-
this.setColor(
|
|
2516
|
+
const g = qt(($) => {
|
|
2517
|
+
var G, W;
|
|
2518
|
+
this.setColor($), (G = this.onChange) == null || G.call(this, $, this.currentOpacity), V.addColor($, this.recentScope), (W = this.recentSectionRefresh) == null || W.call(this);
|
|
2515
2519
|
}, this.recentScope);
|
|
2516
2520
|
this.recentSectionRefresh = g.refresh;
|
|
2517
2521
|
const u = document.createElement("div");
|
|
@@ -2520,16 +2524,16 @@ class Ut {
|
|
|
2520
2524
|
m.className = "color-picker-format-select", this.select = m;
|
|
2521
2525
|
const f = document.createElement("option");
|
|
2522
2526
|
f.value = "hex", f.textContent = "HEX";
|
|
2523
|
-
const
|
|
2524
|
-
|
|
2525
|
-
const
|
|
2526
|
-
|
|
2527
|
-
const
|
|
2528
|
-
|
|
2529
|
-
const
|
|
2530
|
-
|
|
2527
|
+
const C = document.createElement("option");
|
|
2528
|
+
C.value = "rgb", C.textContent = "RGB";
|
|
2529
|
+
const x = document.createElement("option");
|
|
2530
|
+
x.value = "hsl", x.textContent = "HSL", m.appendChild(f), m.appendChild(C), m.appendChild(x);
|
|
2531
|
+
const y = document.createElement("input");
|
|
2532
|
+
y.type = "text", y.className = "color-picker-color-input", y.value = this.currentColor, this.input = y;
|
|
2533
|
+
const H = document.createElement("div");
|
|
2534
|
+
H.className = "color-picker-input-container";
|
|
2531
2535
|
const k = document.createElement("button");
|
|
2532
|
-
return k.className = "color-picker-copy-inside", k.textContent = "Copy",
|
|
2536
|
+
return k.className = "color-picker-copy-inside", k.textContent = "Copy", H.appendChild(y), H.appendChild(k), u.appendChild(m), u.appendChild(H), t.appendChild(e), t.appendChild(n), t.appendChild(a), t.appendChild(p), t.appendChild(g.container), t.appendChild(u), t.addEventListener("click", ($) => $.stopPropagation()), this.bind(n, r, p, y, m, k, l), t;
|
|
2533
2537
|
}
|
|
2534
2538
|
createBackdrop() {
|
|
2535
2539
|
const t = document.createElement("div");
|
|
@@ -2539,16 +2543,18 @@ class Ut {
|
|
|
2539
2543
|
}
|
|
2540
2544
|
bind(t, e, i, s, n, o, a) {
|
|
2541
2545
|
const l = (p) => {
|
|
2546
|
+
var x;
|
|
2542
2547
|
const d = t.getBoundingClientRect(), g = Math.max(0, Math.min(1, (p.clientX - d.left) / d.width)), u = Math.max(0, Math.min(1, (p.clientY - d.top) / d.height));
|
|
2543
2548
|
this.colorMarker.style.left = `${g * 100}%`, this.colorMarker.style.top = `${u * 100}%`;
|
|
2544
|
-
const f =
|
|
2545
|
-
this.
|
|
2549
|
+
const f = this.parsePercentage(this.hueMarker.style.left || "0%") * 360, C = z(f, g, 1 - u);
|
|
2550
|
+
this.currentColor = C, this.syncInput(), this.updateOpacityBg(), (x = this.onChange) == null || x.call(this, C, this.currentOpacity);
|
|
2546
2551
|
}, r = (p) => {
|
|
2552
|
+
var x;
|
|
2547
2553
|
const d = e.getBoundingClientRect();
|
|
2548
|
-
let g = Math.max(
|
|
2554
|
+
let g = Math.max(0, Math.min(1, (p.clientX - d.left) / d.width));
|
|
2549
2555
|
this.hueMarker.style.left = `${g * 100}%`;
|
|
2550
|
-
const u = g * 360, m =
|
|
2551
|
-
this.colorArea.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${u}, 100%, 50%))`, this.
|
|
2556
|
+
const u = g * 360, m = this.parsePercentage(this.colorMarker.style.left || "0%"), f = this.parsePercentage(this.colorMarker.style.top || "0%"), C = z(u, m, 1 - f);
|
|
2557
|
+
this.currentColor = C, this.colorArea.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${u}, 100%, 50%))`, this.syncInput(), this.updateOpacityBg(), (x = this.onChange) == null || x.call(this, C, this.currentOpacity);
|
|
2552
2558
|
}, h = (p) => {
|
|
2553
2559
|
var u;
|
|
2554
2560
|
const d = i.getBoundingClientRect(), g = Math.max(0, Math.min(1, (p.clientX - d.left) / d.width));
|
|
@@ -2558,21 +2564,21 @@ class Ut {
|
|
|
2558
2564
|
p.preventDefault(), l(p);
|
|
2559
2565
|
const d = (u) => l(u), g = () => {
|
|
2560
2566
|
var u;
|
|
2561
|
-
document.removeEventListener("mousemove", d), document.removeEventListener("mouseup", g),
|
|
2567
|
+
document.removeEventListener("mousemove", d), document.removeEventListener("mouseup", g), V.addColor(this.currentColor, this.recentScope), (u = this.recentSectionRefresh) == null || u.call(this);
|
|
2562
2568
|
};
|
|
2563
2569
|
document.addEventListener("mousemove", d), document.addEventListener("mouseup", g);
|
|
2564
2570
|
}), e.addEventListener("mousedown", (p) => {
|
|
2565
2571
|
p.preventDefault(), r(p);
|
|
2566
2572
|
const d = (u) => r(u), g = () => {
|
|
2567
2573
|
var u;
|
|
2568
|
-
document.removeEventListener("mousemove", d), document.removeEventListener("mouseup", g),
|
|
2574
|
+
document.removeEventListener("mousemove", d), document.removeEventListener("mouseup", g), V.addColor(this.currentColor, this.recentScope), (u = this.recentSectionRefresh) == null || u.call(this);
|
|
2569
2575
|
};
|
|
2570
2576
|
document.addEventListener("mousemove", d), document.addEventListener("mouseup", g);
|
|
2571
2577
|
}), i.addEventListener("mousedown", (p) => {
|
|
2572
2578
|
p.preventDefault(), h(p);
|
|
2573
2579
|
const d = (u) => h(u), g = () => {
|
|
2574
2580
|
var u;
|
|
2575
|
-
document.removeEventListener("mousemove", d), document.removeEventListener("mouseup", g),
|
|
2581
|
+
document.removeEventListener("mousemove", d), document.removeEventListener("mouseup", g), V.addColor(this.currentColor, this.recentScope), (u = this.recentSectionRefresh) == null || u.call(this);
|
|
2576
2582
|
};
|
|
2577
2583
|
document.addEventListener("mousemove", d), document.addEventListener("mouseup", g);
|
|
2578
2584
|
}), n.addEventListener("change", () => this.syncInput()), s.addEventListener("input", () => this.applyFromInput()), s.addEventListener("blur", () => this.syncInput()), s.addEventListener("keydown", (p) => {
|
|
@@ -2591,7 +2597,7 @@ class Ut {
|
|
|
2591
2597
|
}
|
|
2592
2598
|
try {
|
|
2593
2599
|
const g = new window.EyeDropper(), { sRGBHex: u } = await g.open();
|
|
2594
|
-
this.setColor(u), (p = this.onChange) == null || p.call(this, u, this.currentOpacity),
|
|
2600
|
+
this.setColor(u), (p = this.onChange) == null || p.call(this, u, this.currentOpacity), V.addColor(u, this.recentScope), (d = this.recentSectionRefresh) == null || d.call(this);
|
|
2595
2601
|
} catch {
|
|
2596
2602
|
}
|
|
2597
2603
|
}), document.addEventListener("keydown", this.keyDown, !0), setTimeout(
|
|
@@ -2600,19 +2606,19 @@ class Ut {
|
|
|
2600
2606
|
);
|
|
2601
2607
|
}
|
|
2602
2608
|
setColor(t) {
|
|
2603
|
-
var
|
|
2609
|
+
var o;
|
|
2604
2610
|
this.currentColor = t;
|
|
2605
|
-
const { h: e, s: i, v: s } =
|
|
2606
|
-
this.hueMarker.style.left = `${
|
|
2611
|
+
const { h: e, s: i, v: s } = A(t), n = e >= 360 ? e % 360 : e;
|
|
2612
|
+
this.hueMarker.style.left = `${n / 360 * 100}%`, this.colorMarker.style.left = `${i * 100}%`, this.colorMarker.style.top = `${(1 - s) * 100}%`, this.colorArea.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${n}, 100%, 50%))`, this.syncInput(), this.updateOpacityBg(), (o = this.onChange) == null || o.call(this, t, this.currentOpacity);
|
|
2607
2613
|
}
|
|
2608
2614
|
syncInput() {
|
|
2609
|
-
const t = this.select.value, { h: e, s: i, v: s } =
|
|
2615
|
+
const t = this.select.value, { h: e, s: i, v: s } = A(this.currentColor);
|
|
2610
2616
|
if (t === "hex") this.input.value = this.currentColor;
|
|
2611
2617
|
else if (t === "rgb") {
|
|
2612
2618
|
const { r: n, g: o, b: a } = S(this.currentColor);
|
|
2613
2619
|
this.input.value = `rgb(${n}, ${o}, ${a})`;
|
|
2614
2620
|
} else {
|
|
2615
|
-
const { hue: n, sat: o, lightness: a } =
|
|
2621
|
+
const { hue: n, sat: o, lightness: a } = Gt(e, i, s);
|
|
2616
2622
|
this.input.value = `hsl(${Math.round(n)}, ${Math.round(
|
|
2617
2623
|
o * 100
|
|
2618
2624
|
)}%, ${Math.round(a * 100)}%)`;
|
|
@@ -2631,7 +2637,7 @@ class Ut {
|
|
|
2631
2637
|
const s = t.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);
|
|
2632
2638
|
if (s) {
|
|
2633
2639
|
const n = parseInt(s[1]), o = parseInt(s[2]) / 100, a = parseInt(s[3]) / 100, l = a + o * Math.min(a, 1 - a), r = l === 0 ? 0 : 2 * (1 - a / l);
|
|
2634
|
-
e =
|
|
2640
|
+
e = z(n, r, l);
|
|
2635
2641
|
}
|
|
2636
2642
|
}
|
|
2637
2643
|
}
|
|
@@ -2645,26 +2651,26 @@ class Ut {
|
|
|
2645
2651
|
);
|
|
2646
2652
|
}
|
|
2647
2653
|
open(t, e, i) {
|
|
2648
|
-
var
|
|
2654
|
+
var y;
|
|
2649
2655
|
this.currentColor = t, this.currentOpacity = i ?? 100, this.syncInput();
|
|
2650
|
-
const { h: s, s: n, v: o } =
|
|
2651
|
-
this.hueMarker.style.left = `${s / 360 * 100}%`, this.colorMarker.style.left = `${n * 100}%`, this.colorMarker.style.top = `${(1 - o) * 100}%`, this.colorArea.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${s}, 100%, 50%))`, this.updateOpacityBg(), this.opacityMarker.style.left = `${this.currentOpacity}%`, (
|
|
2656
|
+
const { h: s, s: n, v: o } = A(t);
|
|
2657
|
+
this.hueMarker.style.left = `${s / 360 * 100}%`, this.colorMarker.style.left = `${n * 100}%`, this.colorMarker.style.top = `${(1 - o) * 100}%`, this.colorArea.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${s}, 100%, 50%))`, this.updateOpacityBg(), this.opacityMarker.style.left = `${this.currentOpacity}%`, (y = this.recentSectionRefresh) == null || y.call(this), this.isOpen = !0, this.backdrop.style.display = "block", this.backdrop.parentElement || document.body.appendChild(this.backdrop), this.element.style.display = "block", this.element.style.position = "fixed", this.element.style.zIndex = "10002", this.element.style.left = "-9999px", this.element.style.top = "0px", this.element.parentElement || document.body.appendChild(this.element);
|
|
2652
2658
|
const a = this.element.offsetWidth, l = this.element.offsetHeight, r = e.getBoundingClientRect(), h = window.innerWidth, p = window.innerHeight, d = 16;
|
|
2653
2659
|
let g = r.right + 8, u = r.top;
|
|
2654
2660
|
const m = h - r.right, f = r.left;
|
|
2655
2661
|
m >= a + d ? g = r.right + 8 : f >= a + d ? g = r.left - a - 8 : g = Math.max(d, (h - a) / 2);
|
|
2656
|
-
const
|
|
2657
|
-
|
|
2662
|
+
const C = p - r.bottom, x = r.top;
|
|
2663
|
+
C >= l + d ? u = r.bottom + 8 : x >= l + d ? u = r.top - l - 8 : C > x ? (u = r.bottom + 8, u + l > p - d && (u = p - l - d)) : (u = r.top - l - 8, u < d && (u = d)), this.element.style.left = `${g}px`, this.element.style.top = `${u}px`;
|
|
2658
2664
|
}
|
|
2659
2665
|
close(t) {
|
|
2660
2666
|
var e;
|
|
2661
|
-
this.isOpen && (this.isOpen = !1, this.backdrop.style.display = "none", this.element.style.display = "none", document.removeEventListener("click", this.outsideClick, !0), document.removeEventListener("keydown", this.keyDown, !0), t && (
|
|
2667
|
+
this.isOpen && (this.isOpen = !1, this.backdrop.style.display = "none", this.element.style.display = "none", document.removeEventListener("click", this.outsideClick, !0), document.removeEventListener("keydown", this.keyDown, !0), t && (V.addColor(this.currentColor, this.recentScope), (e = this.recentSectionRefresh) == null || e.call(this)));
|
|
2662
2668
|
}
|
|
2663
2669
|
getElement() {
|
|
2664
2670
|
return this.element;
|
|
2665
2671
|
}
|
|
2666
2672
|
}
|
|
2667
|
-
class
|
|
2673
|
+
class Zt {
|
|
2668
2674
|
constructor(t) {
|
|
2669
2675
|
this.currentColor = t.initialColor, this.currentOpacity = t.initialOpacity, this.onColorChange = t.onColorChange, this.container = this.createContainer(), this.initializePicker();
|
|
2670
2676
|
}
|
|
@@ -2719,7 +2725,7 @@ class _t {
|
|
|
2719
2725
|
".color-picker-color-input"
|
|
2720
2726
|
), r = this.container.querySelector(
|
|
2721
2727
|
".color-picker-copy-inside"
|
|
2722
|
-
), { h, s: p, v: d } =
|
|
2728
|
+
), { h, s: p, v: d } = A(this.currentColor);
|
|
2723
2729
|
s.style.left = `${h / 360 * 100}%`, e.style.left = `${p * 100}%`, e.style.top = `${(1 - d) * 100}%`, t.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${h}, 100%, 50%))`, o.style.left = `${this.currentOpacity}%`, this.updateOpacityBackground(n), this.updateColorInput(a, l), this.setupColorAreaEvents(t, e, s), this.setupHueSliderEvents(
|
|
2724
2730
|
i,
|
|
2725
2731
|
s,
|
|
@@ -2747,7 +2753,7 @@ class _t {
|
|
|
2747
2753
|
e.value = `rgb(${s.r}, ${s.g}, ${s.b})`;
|
|
2748
2754
|
break;
|
|
2749
2755
|
case "hsl":
|
|
2750
|
-
const { h: n, s: o, v: a } =
|
|
2756
|
+
const { h: n, s: o, v: a } = A(this.currentColor), l = a * (1 - o / 2), r = l === 0 || l === 1 ? 0 : (a - l) / Math.min(l, 1 - l);
|
|
2751
2757
|
e.value = `hsl(${Math.round(n)}, ${Math.round(
|
|
2752
2758
|
r * 100
|
|
2753
2759
|
)}%, ${Math.round(l * 100)}%)`;
|
|
@@ -2758,7 +2764,7 @@ class _t {
|
|
|
2758
2764
|
const s = (n) => {
|
|
2759
2765
|
const o = t.getBoundingClientRect(), a = Math.max(0, Math.min(1, (n.clientX - o.left) / o.width)), l = Math.max(0, Math.min(1, (n.clientY - o.top) / o.height));
|
|
2760
2766
|
e.style.left = `${a * 100}%`, e.style.top = `${l * 100}%`;
|
|
2761
|
-
const r = parseFloat(i.style.left || "0%") / 100 * 360, h =
|
|
2767
|
+
const r = parseFloat(i.style.left || "0%") / 100 * 360, h = z(r, a, 1 - l);
|
|
2762
2768
|
this.currentColor = h;
|
|
2763
2769
|
const p = this.container.querySelector(
|
|
2764
2770
|
".color-picker-format-select"
|
|
@@ -2781,10 +2787,10 @@ class _t {
|
|
|
2781
2787
|
const l = (r) => {
|
|
2782
2788
|
const h = t.getBoundingClientRect();
|
|
2783
2789
|
let p = (r.clientX - h.left) / h.width;
|
|
2784
|
-
p = Math.max(
|
|
2790
|
+
p = Math.max(0, Math.min(1, p)), e.style.left = `${p * 100}%`;
|
|
2785
2791
|
const d = p * 360, g = parseFloat(s.style.left || "50%") / 100, u = parseFloat(s.style.top || "50%") / 100;
|
|
2786
2792
|
i.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${d}, 100%, 50%))`;
|
|
2787
|
-
const m =
|
|
2793
|
+
const m = z(d, g, 1 - u);
|
|
2788
2794
|
this.currentColor = m, this.updateColorInput(n, o), this.updateOpacityBackground(a), this.triggerChange();
|
|
2789
2795
|
};
|
|
2790
2796
|
t.addEventListener("mousedown", (r) => {
|
|
@@ -2839,7 +2845,7 @@ class _t {
|
|
|
2839
2845
|
}
|
|
2840
2846
|
parseHexInput(t) {
|
|
2841
2847
|
const e = t.startsWith("#") ? t : `#${t}`;
|
|
2842
|
-
return
|
|
2848
|
+
return F(e);
|
|
2843
2849
|
}
|
|
2844
2850
|
parseRgbInput(t) {
|
|
2845
2851
|
const e = t.match(
|
|
@@ -2848,7 +2854,7 @@ class _t {
|
|
|
2848
2854
|
if (e) {
|
|
2849
2855
|
const i = parseInt(e[1]), s = parseInt(e[2]), n = parseInt(e[3]);
|
|
2850
2856
|
if (i <= 255 && s <= 255 && n <= 255)
|
|
2851
|
-
return
|
|
2857
|
+
return R(i, s, n);
|
|
2852
2858
|
}
|
|
2853
2859
|
return null;
|
|
2854
2860
|
}
|
|
@@ -2859,8 +2865,8 @@ class _t {
|
|
|
2859
2865
|
if (e) {
|
|
2860
2866
|
const i = parseFloat(e[1]), s = parseFloat(e[2]) / 100, n = parseFloat(e[3]) / 100;
|
|
2861
2867
|
if (i >= 0 && i <= 360 && s >= 0 && s <= 1 && n >= 0 && n <= 1) {
|
|
2862
|
-
const o =
|
|
2863
|
-
return
|
|
2868
|
+
const o = Z(i, s, n);
|
|
2869
|
+
return R(o.r, o.g, o.b);
|
|
2864
2870
|
}
|
|
2865
2871
|
}
|
|
2866
2872
|
return null;
|
|
@@ -2882,13 +2888,7 @@ class _t {
|
|
|
2882
2888
|
".color-picker-hue-marker"
|
|
2883
2889
|
), s = this.container.querySelector(
|
|
2884
2890
|
".color-picker-opacity"
|
|
2885
|
-
);
|
|
2886
|
-
this.container.querySelector(
|
|
2887
|
-
".color-picker-format-select"
|
|
2888
|
-
), this.container.querySelector(
|
|
2889
|
-
".color-picker-color-input"
|
|
2890
|
-
);
|
|
2891
|
-
const { h: n, s: o, v: a } = $(this.currentColor);
|
|
2891
|
+
), { h: n, s: o, v: a } = A(this.currentColor);
|
|
2892
2892
|
i.style.left = `${n / 360 * 100}%`, e.style.left = `${o * 100}%`, e.style.top = `${(1 - a) * 100}%`, t.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${n}, 100%, 50%))`, this.updateOpacityBackground(s);
|
|
2893
2893
|
}
|
|
2894
2894
|
triggerChange() {
|
|
@@ -2913,11 +2913,11 @@ class _t {
|
|
|
2913
2913
|
".color-picker-format-select"
|
|
2914
2914
|
), r = this.container.querySelector(
|
|
2915
2915
|
".color-picker-color-input"
|
|
2916
|
-
), { h, s: p, v: d } =
|
|
2917
|
-
n.style.left = `${
|
|
2916
|
+
), { h, s: p, v: d } = A(t), g = h >= 360 ? h % 360 : h;
|
|
2917
|
+
n.style.left = `${g / 360 * 100}%`, s.style.left = `${p * 100}%`, s.style.top = `${(1 - d) * 100}%`, i.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${g}, 100%, 50%))`, o.style.left = `${e}%`, this.updateOpacityBackground(a), this.updateColorInput(l, r);
|
|
2918
2918
|
}
|
|
2919
2919
|
}
|
|
2920
|
-
const
|
|
2920
|
+
const ot = (c) => {
|
|
2921
2921
|
const t = [];
|
|
2922
2922
|
let e = "", i = 0;
|
|
2923
2923
|
for (let s = 0; s < c.length; s++) {
|
|
@@ -2931,7 +2931,7 @@ const nt = (c) => {
|
|
|
2931
2931
|
e += n;
|
|
2932
2932
|
}
|
|
2933
2933
|
return e.trim() && t.push(e.trim()), t;
|
|
2934
|
-
},
|
|
2934
|
+
}, at = (c, t) => {
|
|
2935
2935
|
const e = new RegExp(`${t}\\s*\\(`, "i"), i = c.match(e);
|
|
2936
2936
|
if (!i) return null;
|
|
2937
2937
|
const s = i.index + i[0].length;
|
|
@@ -2939,7 +2939,7 @@ const nt = (c) => {
|
|
|
2939
2939
|
for (let a = s; a < c.length && n > 0; a++)
|
|
2940
2940
|
c[a] === "(" ? n++ : c[a] === ")" && n--, o = a;
|
|
2941
2941
|
return n === 0 ? c.substring(s, o) : null;
|
|
2942
|
-
},
|
|
2942
|
+
}, Xt = (c) => {
|
|
2943
2943
|
const t = c.split(" ")[0].toLowerCase();
|
|
2944
2944
|
return [
|
|
2945
2945
|
"circle",
|
|
@@ -2951,19 +2951,19 @@ const nt = (c) => {
|
|
|
2951
2951
|
"at",
|
|
2952
2952
|
"contain",
|
|
2953
2953
|
"cover"
|
|
2954
|
-
].includes(t) ? !1 : /^#[0-9a-f]{3,8}$/i.test(t) || /^rgb/i.test(c) || /^hsl/i.test(c) ||
|
|
2955
|
-
},
|
|
2954
|
+
].includes(t) ? !1 : /^#[0-9a-f]{3,8}$/i.test(t) || /^rgb/i.test(c) || /^hsl/i.test(c) || Wt(t);
|
|
2955
|
+
}, lt = (c) => {
|
|
2956
2956
|
const t = [];
|
|
2957
2957
|
return c.forEach((e, i) => {
|
|
2958
2958
|
const s = e.trim();
|
|
2959
2959
|
if (!s) return;
|
|
2960
2960
|
let n = "", o = 0;
|
|
2961
2961
|
const a = s.match(/^(.+?)\s+(\d+(?:\.\d+)?)%?\s*$/);
|
|
2962
|
-
a &&
|
|
2963
|
-
const l =
|
|
2962
|
+
a && dt(a[1].trim()) ? (n = a[1].trim(), o = parseFloat(a[2])) : (n = s, o = c.length === 1 ? 0 : i / (c.length - 1) * 100);
|
|
2963
|
+
const l = ut(n);
|
|
2964
2964
|
l.position = Math.max(0, Math.min(100, Math.round(o))), t.push(l);
|
|
2965
2965
|
}), t;
|
|
2966
|
-
},
|
|
2966
|
+
}, B = (c) => {
|
|
2967
2967
|
const t = c.stops && c.stops.length ? c.stops : [{ color: "#000000", position: 0, opacity: 100 }];
|
|
2968
2968
|
return {
|
|
2969
2969
|
type: c.type && ["linear", "radial", "solid"].includes(c.type) ? c.type : "linear",
|
|
@@ -2974,15 +2974,15 @@ const nt = (c) => {
|
|
|
2974
2974
|
opacity: e.opacity === void 0 || Number.isNaN(e.opacity) ? 100 : e.opacity
|
|
2975
2975
|
}))
|
|
2976
2976
|
};
|
|
2977
|
-
},
|
|
2977
|
+
}, K = (c) => {
|
|
2978
2978
|
const t = c.replace(/;$/, "").trim();
|
|
2979
|
-
if (
|
|
2980
|
-
const s =
|
|
2981
|
-
return
|
|
2979
|
+
if (zt(t)) {
|
|
2980
|
+
const s = ut(t);
|
|
2981
|
+
return B({ type: "solid", angle: 0, stops: [s] });
|
|
2982
2982
|
}
|
|
2983
|
-
const e =
|
|
2983
|
+
const e = at(t, "linear-gradient");
|
|
2984
2984
|
if (e) {
|
|
2985
|
-
const s =
|
|
2985
|
+
const s = ot(e);
|
|
2986
2986
|
let n = 90, o = s;
|
|
2987
2987
|
const a = s[0];
|
|
2988
2988
|
if (a.includes("deg")) {
|
|
@@ -2998,32 +2998,31 @@ const nt = (c) => {
|
|
|
2998
2998
|
"to top right": 45,
|
|
2999
2999
|
"to top left": 315
|
|
3000
3000
|
}[a] ?? 90, o = s.slice(1));
|
|
3001
|
-
const l =
|
|
3002
|
-
return l.length ?
|
|
3001
|
+
const l = lt(o);
|
|
3002
|
+
return l.length ? B({ type: "linear", angle: n, stops: l }) : null;
|
|
3003
3003
|
}
|
|
3004
|
-
const i =
|
|
3004
|
+
const i = at(t, "radial-gradient");
|
|
3005
3005
|
if (i) {
|
|
3006
|
-
const s =
|
|
3007
|
-
return o.length ?
|
|
3006
|
+
const s = ot(i), n = s[0] && !Xt(s[0]) ? s.slice(1) : s, o = lt(n);
|
|
3007
|
+
return o.length ? B({ type: "radial", angle: 0, stops: o }) : null;
|
|
3008
3008
|
}
|
|
3009
3009
|
return null;
|
|
3010
|
-
},
|
|
3010
|
+
}, P = (c) => {
|
|
3011
3011
|
if (c.type === "solid") {
|
|
3012
3012
|
const e = c.stops[0], i = e.opacity ?? 100, s = e.color.replace("#", ""), n = Math.round(i / 100 * 255).toString(16).toUpperCase().padStart(2, "0");
|
|
3013
3013
|
return `#${s}${n}`;
|
|
3014
3014
|
}
|
|
3015
3015
|
const t = c.stops.map(
|
|
3016
|
-
(e) => `${
|
|
3016
|
+
(e) => `${pt(e.color, e.opacity ?? 100)} ${e.position}%`
|
|
3017
3017
|
).join(", ");
|
|
3018
3018
|
return c.type === "radial" ? `radial-gradient(circle, ${t})` : `linear-gradient(${c.angle}deg, ${t})`;
|
|
3019
|
-
},
|
|
3019
|
+
}, Q = (c) => {
|
|
3020
3020
|
if (c.type === "solid") {
|
|
3021
3021
|
const t = c.stops[0];
|
|
3022
3022
|
return t ? t.color.replace("#", "").toUpperCase() : "Color";
|
|
3023
3023
|
}
|
|
3024
3024
|
return c.type === "linear" ? `Linear ${c.angle}°` : "Radial Gradient";
|
|
3025
|
-
}
|
|
3026
|
-
class Ce extends E {
|
|
3025
|
+
}, N = class N extends b {
|
|
3027
3026
|
constructor(t = {}) {
|
|
3028
3027
|
const e = typeof t.default == "string" ? void 0 : t.default;
|
|
3029
3028
|
super({
|
|
@@ -3046,11 +3045,11 @@ class Ce extends E {
|
|
|
3046
3045
|
defaultValue() {
|
|
3047
3046
|
const t = this.originalDefault;
|
|
3048
3047
|
if (typeof t == "string") {
|
|
3049
|
-
const i =
|
|
3048
|
+
const i = K(t);
|
|
3050
3049
|
if (i)
|
|
3051
|
-
return
|
|
3050
|
+
return B(i);
|
|
3052
3051
|
}
|
|
3053
|
-
return
|
|
3052
|
+
return B(t && typeof t == "object" ? t : {
|
|
3054
3053
|
type: "linear",
|
|
3055
3054
|
angle: 90,
|
|
3056
3055
|
stops: [
|
|
@@ -3062,20 +3061,20 @@ class Ce extends E {
|
|
|
3062
3061
|
setValue(t) {
|
|
3063
3062
|
var i, s;
|
|
3064
3063
|
let e = null;
|
|
3065
|
-
typeof t == "string" ? e =
|
|
3064
|
+
typeof t == "string" ? e = K(t) : t && typeof t == "object" && (e = B(t)), e || (e = this.defaultValue()), this.value = e, this.updateUI(), this.isPopoverOpen && this.refreshPopoverContent(), (i = this.onChange) == null || i.call(this, this.value), (s = this.detectChange) == null || s.call(this, this.value);
|
|
3066
3065
|
}
|
|
3067
3066
|
updateUI() {
|
|
3068
3067
|
if (this.previewEl && this.value)
|
|
3069
3068
|
if (this.value.type === "solid") {
|
|
3070
3069
|
const t = this.value.stops[0], e = t.opacity ?? 100;
|
|
3071
|
-
this.previewEl.style.background =
|
|
3070
|
+
this.previewEl.style.background = pt(t.color, e);
|
|
3072
3071
|
} else
|
|
3073
|
-
this.previewEl.style.background =
|
|
3074
|
-
this.inputEl && this.value && !this.isEditing && (this.inputEl.value =
|
|
3072
|
+
this.previewEl.style.background = P(this.value);
|
|
3073
|
+
this.inputEl && this.value && !this.isEditing && (this.inputEl.value = Q(this.value));
|
|
3075
3074
|
}
|
|
3076
3075
|
cssForTextValue() {
|
|
3077
3076
|
return this.value ? {
|
|
3078
|
-
background:
|
|
3077
|
+
background: P(this.value),
|
|
3079
3078
|
"-webkit-background-clip": "text",
|
|
3080
3079
|
"background-clip": "text",
|
|
3081
3080
|
color: "transparent",
|
|
@@ -3091,17 +3090,17 @@ class Ce extends E {
|
|
|
3091
3090
|
s.className = "input-label", s.textContent = this.props.title, i.appendChild(s), t.appendChild(i);
|
|
3092
3091
|
}
|
|
3093
3092
|
const e = document.createElement("div");
|
|
3094
|
-
return e.className = "gradient-input-wrapper", this.previewEl = document.createElement("div"), this.previewEl.className = "gradient-mini-preview", this.previewEl.style.background = this.value ?
|
|
3093
|
+
return e.className = "gradient-input-wrapper", this.previewEl = document.createElement("div"), this.previewEl.className = "gradient-mini-preview", this.previewEl.style.background = this.value ? P(this.value) : "linear-gradient(90deg, #a84b4b 0%, #786666 100%)", this.previewEl.addEventListener("mousedown", (i) => {
|
|
3095
3094
|
i.preventDefault(), i.stopPropagation(), this.openPopover();
|
|
3096
|
-
}), this.inputEl = document.createElement("input"), this.inputEl.type = "text", this.inputEl.className = "gradient-text-input", this.inputEl.placeholder = "Enter gradient CSS or paste color...", this.inputEl.value = this.value ?
|
|
3097
|
-
this.isEditing = !0, this.value && (this.inputEl.value =
|
|
3095
|
+
}), this.inputEl = document.createElement("input"), this.inputEl.type = "text", this.inputEl.className = "gradient-text-input", this.inputEl.placeholder = "Enter gradient CSS or paste color...", this.inputEl.value = this.value ? Q(this.value) : "", this.inputEl.readOnly = !1, this.inputEl.addEventListener("focus", () => {
|
|
3096
|
+
this.isEditing = !0, this.value && (this.inputEl.value = P(this.value));
|
|
3098
3097
|
}), this.inputEl.addEventListener("blur", () => {
|
|
3099
|
-
this.isEditing = !1, this.value && (this.inputEl.value =
|
|
3098
|
+
this.isEditing = !1, this.value && (this.inputEl.value = Q(this.value));
|
|
3100
3099
|
}), this.inputEl.addEventListener(
|
|
3101
3100
|
"paste",
|
|
3102
3101
|
(i) => this.handlePaste(i)
|
|
3103
3102
|
), this.inputEl.addEventListener("input", (i) => this.handleTextInput(i)), this.inputEl.addEventListener("keydown", (i) => {
|
|
3104
|
-
i.key === "Enter" && (this.handleTextInput(i), this.inputEl.blur()), i.key === "Escape" && (this.value && (this.inputEl.value =
|
|
3103
|
+
i.key === "Enter" && (this.handleTextInput(i), this.inputEl.blur()), i.key === "Escape" && (this.value && (this.inputEl.value = P(this.value)), this.inputEl.blur());
|
|
3105
3104
|
}), e.appendChild(this.previewEl), e.appendChild(this.inputEl), t.appendChild(e), this.createPopover(), this.element = t, t;
|
|
3106
3105
|
}
|
|
3107
3106
|
createPopover() {
|
|
@@ -3112,7 +3111,7 @@ class Ce extends E {
|
|
|
3112
3111
|
const e = document.createElement("span");
|
|
3113
3112
|
e.textContent = "Fill";
|
|
3114
3113
|
const i = document.createElement("button");
|
|
3115
|
-
i.type = "button", i.className = "gradient-popover-close", i.innerHTML =
|
|
3114
|
+
i.type = "button", i.className = "gradient-popover-close", i.innerHTML = gt, i.addEventListener("click", () => this.closePopover()), t.appendChild(e), t.appendChild(i);
|
|
3116
3115
|
const s = document.createElement("div");
|
|
3117
3116
|
s.className = "gradient-editor";
|
|
3118
3117
|
const n = this.createTypeTabs();
|
|
@@ -3134,26 +3133,26 @@ class Ce extends E {
|
|
|
3134
3133
|
}), t.appendChild(e), t.appendChild(i), t;
|
|
3135
3134
|
}
|
|
3136
3135
|
switchType(t) {
|
|
3137
|
-
var i;
|
|
3136
|
+
var i, s;
|
|
3138
3137
|
if (!this.value) return;
|
|
3139
3138
|
if (this.value.type = t, t !== "solid" && (!this.value.stops || this.value.stops.length === 0) && (this.value.stops = [
|
|
3140
3139
|
{ color: "#a84b4b", position: 0, opacity: 100 },
|
|
3141
3140
|
{ color: "#786666", position: 100, opacity: 100 }
|
|
3142
3141
|
]), this.popoverEl) {
|
|
3143
|
-
const
|
|
3144
|
-
|
|
3145
|
-
const
|
|
3146
|
-
t === "solid" ?
|
|
3142
|
+
const n = this.popoverEl.querySelectorAll(".gradient-type-tab");
|
|
3143
|
+
n.forEach((l) => l.classList.remove("active"));
|
|
3144
|
+
const o = n[0], a = n[1];
|
|
3145
|
+
t === "solid" ? o == null || o.classList.add("active") : a == null || a.classList.add("active");
|
|
3147
3146
|
}
|
|
3148
3147
|
const e = (i = this.popoverEl) == null ? void 0 : i.querySelector(".gradient-editor-content");
|
|
3149
|
-
e && (this.updatePopoverContent(e), this.repositionPopover()), this.updateUI(), this.triggerChange();
|
|
3148
|
+
e && (this.updatePopoverContent(e), ((s = document.activeElement) == null ? void 0 : s.tagName) !== "INPUT" && this.repositionPopover()), this.updateUI(), this.triggerChange();
|
|
3150
3149
|
}
|
|
3151
3150
|
updatePopoverContent(t) {
|
|
3152
3151
|
t.innerHTML = "", this.value && (this.value.type === "solid" ? this.renderSolid(t) : this.renderGradient(t));
|
|
3153
3152
|
}
|
|
3154
3153
|
renderSolid(t) {
|
|
3155
3154
|
(!this.value || !this.value.stops || !this.value.stops.length) && (this.value || (this.value = this.defaultValue()), this.value.stops = [{ color: "#000000", position: 0, opacity: 100 }]);
|
|
3156
|
-
const e = this.value.stops[0], i = new
|
|
3155
|
+
const e = this.value.stops[0], i = new Zt({
|
|
3157
3156
|
initialColor: e.color,
|
|
3158
3157
|
initialOpacity: e.opacity ?? 100,
|
|
3159
3158
|
onColorChange: (s, n) => {
|
|
@@ -3174,7 +3173,7 @@ class Ce extends E {
|
|
|
3174
3173
|
const o = document.createElement("input");
|
|
3175
3174
|
o.type = "text", o.inputMode = "numeric", o.className = "gradient-degree-input", o.value = `${this.value.angle ?? 0}°`, o.style.width = "75px", o.style.textAlign = "center";
|
|
3176
3175
|
const a = document.createElement("button");
|
|
3177
|
-
a.type = "button", a.className = "gradient-flip-btn", a.innerHTML =
|
|
3176
|
+
a.type = "button", a.className = "gradient-flip-btn", a.innerHTML = jt, i.addEventListener("change", () => {
|
|
3178
3177
|
this.switchType(i.value === "radial" ? "radial" : "linear"), this.updateDegreeVisibility(o);
|
|
3179
3178
|
}), o.addEventListener("focus", (u) => {
|
|
3180
3179
|
const m = u.target;
|
|
@@ -3183,10 +3182,10 @@ class Ce extends E {
|
|
|
3183
3182
|
const m = parseInt(u.target.value);
|
|
3184
3183
|
!Number.isNaN(m) && this.value && (this.value.angle = Math.max(0, Math.min(360, m)), this.updateGradientPreview(), this.triggerChange());
|
|
3185
3184
|
}), o.addEventListener("blur", (u) => {
|
|
3186
|
-
var
|
|
3185
|
+
var C;
|
|
3187
3186
|
const m = u.target;
|
|
3188
3187
|
let f = parseInt(m.value);
|
|
3189
|
-
Number.isNaN(f) && (f = ((
|
|
3188
|
+
Number.isNaN(f) && (f = ((C = this.value) == null ? void 0 : C.angle) ?? 0), f = Math.max(0, Math.min(360, f)), this.value && (this.value.angle = f), m.value = `${f}°`, this.updateGradientPreview(), this.updateUI(), this.triggerChange();
|
|
3190
3189
|
}), a.addEventListener("click", () => {
|
|
3191
3190
|
!this.value || !this.value.stops || (this.value.stops.forEach((u) => {
|
|
3192
3191
|
u.position = 100 - u.position;
|
|
@@ -3204,7 +3203,8 @@ class Ce extends E {
|
|
|
3204
3203
|
d.type = "button", d.className = "gradient-add-stop", d.textContent = "+", h.appendChild(p), h.appendChild(d);
|
|
3205
3204
|
const g = document.createElement("div");
|
|
3206
3205
|
g.className = "gradient-stops", t.appendChild(h), t.appendChild(g), this.updateStopsList(g), d.addEventListener("click", () => {
|
|
3207
|
-
|
|
3206
|
+
var u;
|
|
3207
|
+
this.addStop(), this.updateStopsList(g), this.updateGradientPreview(l), this.createHandles(r, l), this.updateUI(), ((u = document.activeElement) == null ? void 0 : u.tagName) !== "INPUT" && this.repositionPopover(), this.triggerChange();
|
|
3208
3208
|
});
|
|
3209
3209
|
}
|
|
3210
3210
|
updateDegreeVisibility(t) {
|
|
@@ -3214,7 +3214,7 @@ class Ce extends E {
|
|
|
3214
3214
|
updateGradientPreview(t) {
|
|
3215
3215
|
var i;
|
|
3216
3216
|
const e = t || ((i = this.popoverEl) == null ? void 0 : i.querySelector(".gradient-preview"));
|
|
3217
|
-
e && this.value && (e.style.background =
|
|
3217
|
+
e && this.value && (e.style.background = P(this.value));
|
|
3218
3218
|
}
|
|
3219
3219
|
createHandles(t, e) {
|
|
3220
3220
|
t.innerHTML = "", !(!this.value || this.value.type === "solid" || !this.value.stops) && this.value.stops.forEach((i, s) => {
|
|
@@ -3246,9 +3246,9 @@ class Ce extends E {
|
|
|
3246
3246
|
(n, o) => n.position - o.position
|
|
3247
3247
|
);
|
|
3248
3248
|
i.forEach((n, o) => {
|
|
3249
|
-
var
|
|
3249
|
+
var G, W;
|
|
3250
3250
|
const a = this.value.stops.findIndex(
|
|
3251
|
-
(v,
|
|
3251
|
+
(v, E) => v.position === n.position && v.color === n.color && v.opacity === n.opacity && this.value.stops.slice(0, E).filter(
|
|
3252
3252
|
(w) => w.position === n.position && w.color === n.color && w.opacity === n.opacity
|
|
3253
3253
|
).length === i.slice(0, o).filter(
|
|
3254
3254
|
(w) => w.position === n.position && w.color === n.color && w.opacity === n.opacity
|
|
@@ -3268,24 +3268,24 @@ class Ce extends E {
|
|
|
3268
3268
|
const m = document.createElement("button");
|
|
3269
3269
|
m.type = "button", m.className = "gstop-color-copy", m.textContent = "Copy", d.appendChild(g), d.appendChild(u), d.appendChild(m);
|
|
3270
3270
|
const f = document.createElement("button");
|
|
3271
|
-
f.type = "button", f.className = "gstop-del", f.innerHTML =
|
|
3272
|
-
const
|
|
3273
|
-
|
|
3274
|
-
const
|
|
3275
|
-
|
|
3276
|
-
const
|
|
3277
|
-
|
|
3278
|
-
const
|
|
3279
|
-
|
|
3271
|
+
f.type = "button", f.className = "gstop-del", f.innerHTML = _t, f.disabled = (((W = (G = this.value) == null ? void 0 : G.stops) == null ? void 0 : W.length) || 0) <= 2, r.appendChild(h), r.appendChild(d), r.appendChild(f), e.appendChild(r);
|
|
3272
|
+
const C = document.createElement("span");
|
|
3273
|
+
C.className = "gstop-opacity-label", C.textContent = "Opacity";
|
|
3274
|
+
const x = document.createElement("div");
|
|
3275
|
+
x.className = "gstop-opacity-group";
|
|
3276
|
+
const y = document.createElement("input");
|
|
3277
|
+
y.type = "range", y.className = "gstop-opacity-slider", y.min = "0", y.max = "100", y.value = String(n.opacity ?? 100);
|
|
3278
|
+
const H = S(n.color);
|
|
3279
|
+
y.style.setProperty(
|
|
3280
3280
|
"--slider-color",
|
|
3281
|
-
`rgb(${
|
|
3281
|
+
`rgb(${H.r}, ${H.g}, ${H.b})`
|
|
3282
3282
|
);
|
|
3283
3283
|
const k = document.createElement("span");
|
|
3284
|
-
k.className = "gstop-opacity-value", k.textContent = `${n.opacity ?? 100}%`,
|
|
3285
|
-
const
|
|
3286
|
-
u.value = v.replace("#", "").toUpperCase(), g.style.backgroundColor = v, this.value.stops[l].color = v,
|
|
3284
|
+
k.className = "gstop-opacity-value", k.textContent = `${n.opacity ?? 100}%`, x.appendChild(y), x.appendChild(k);
|
|
3285
|
+
const $ = new Jt((v, E) => {
|
|
3286
|
+
u.value = v.replace("#", "").toUpperCase(), g.style.backgroundColor = v, this.value.stops[l].color = v, E !== void 0 && (this.value.stops[l].opacity = E, y.value = String(E), k.textContent = `${E}%`);
|
|
3287
3287
|
const w = S(v);
|
|
3288
|
-
|
|
3288
|
+
y.style.setProperty(
|
|
3289
3289
|
"--slider-color",
|
|
3290
3290
|
`rgb(${w.r}, ${w.g}, ${w.b})`
|
|
3291
3291
|
), this.updateGradientPreview(), this.createHandles(
|
|
@@ -3294,13 +3294,13 @@ class Ce extends E {
|
|
|
3294
3294
|
), this.updateUI(), this.triggerChange();
|
|
3295
3295
|
}, "gradient");
|
|
3296
3296
|
u.addEventListener("click", (v) => {
|
|
3297
|
-
v.preventDefault(), v.stopPropagation(),
|
|
3297
|
+
v.preventDefault(), v.stopPropagation(), $.open(n.color, u, n.opacity ?? 100);
|
|
3298
3298
|
}), u.addEventListener("input", () => {
|
|
3299
|
-
const v = u.value.trim(),
|
|
3300
|
-
if (/^#[0-9A-Fa-f]{6}$/.test(
|
|
3301
|
-
this.value.stops[l].color =
|
|
3302
|
-
const w = S(
|
|
3303
|
-
|
|
3299
|
+
const v = u.value.trim(), E = v.startsWith("#") ? v : `#${v}`;
|
|
3300
|
+
if (/^#[0-9A-Fa-f]{6}$/.test(E)) {
|
|
3301
|
+
this.value.stops[l].color = E, g.style.backgroundColor = E;
|
|
3302
|
+
const w = S(E);
|
|
3303
|
+
y.style.setProperty(
|
|
3304
3304
|
"--slider-color",
|
|
3305
3305
|
`rgb(${w.r}, ${w.g}, ${w.b})`
|
|
3306
3306
|
), this.updateGradientPreview(), this.updateUI(), this.triggerChange();
|
|
@@ -3312,27 +3312,28 @@ class Ce extends E {
|
|
|
3312
3312
|
} catch {
|
|
3313
3313
|
}
|
|
3314
3314
|
}), p.addEventListener("focus", (v) => {
|
|
3315
|
-
const
|
|
3316
|
-
|
|
3315
|
+
const E = v.target;
|
|
3316
|
+
E.value = E.value.replace("%", ""), E.select();
|
|
3317
3317
|
}), p.addEventListener("input", (v) => {
|
|
3318
|
-
const
|
|
3318
|
+
const E = v.target, w = parseInt(E.value.replace(/[^\d]/g, ""), 10);
|
|
3319
3319
|
if (!Number.isNaN(w)) {
|
|
3320
|
-
const
|
|
3321
|
-
this.value.stops[l].position =
|
|
3320
|
+
const it = Math.max(0, Math.min(100, w));
|
|
3321
|
+
this.value.stops[l].position = it, E.value = `${it}%`, this.updateGradientPreview(), this.createHandles(
|
|
3322
3322
|
this.popoverEl.querySelector(".gradient-handles"),
|
|
3323
3323
|
this.popoverEl.querySelector(".gradient-preview")
|
|
3324
3324
|
), this.updateUI(), this.triggerChange();
|
|
3325
3325
|
}
|
|
3326
3326
|
}), p.addEventListener("blur", (v) => {
|
|
3327
|
-
const
|
|
3328
|
-
Number.isNaN(w) ?
|
|
3327
|
+
const E = v.target, w = parseInt(E.value.replace(/[^\d]/g, ""), 10);
|
|
3328
|
+
Number.isNaN(w) ? E.value = `${this.value.stops[l].position}%` : E.value = `${Math.max(0, Math.min(100, w))}%`;
|
|
3329
3329
|
}), f.addEventListener("click", () => {
|
|
3330
|
+
var v;
|
|
3330
3331
|
(this.value.stops.length || 0) <= 2 || (this.value.stops.splice(l, 1), this.createHandles(
|
|
3331
3332
|
this.popoverEl.querySelector(".gradient-handles"),
|
|
3332
3333
|
this.popoverEl.querySelector(".gradient-preview")
|
|
3333
|
-
), this.updateStopsList(), this.updateGradientPreview(), this.updateUI(), this.repositionPopover(), this.triggerChange());
|
|
3334
|
-
}),
|
|
3335
|
-
const v = parseInt(
|
|
3334
|
+
), this.updateStopsList(), this.updateGradientPreview(), this.updateUI(), ((v = document.activeElement) == null ? void 0 : v.tagName) !== "INPUT" && this.repositionPopover(), this.triggerChange());
|
|
3335
|
+
}), y.addEventListener("input", () => {
|
|
3336
|
+
const v = parseInt(y.value, 10);
|
|
3336
3337
|
this.value.stops[l].opacity = Math.max(0, Math.min(100, v)), k.textContent = `${this.value.stops[l].opacity}%`, this.updateGradientPreview(), this.updateUI(), this.triggerChange();
|
|
3337
3338
|
});
|
|
3338
3339
|
});
|
|
@@ -3355,8 +3356,8 @@ class Ce extends E {
|
|
|
3355
3356
|
this.value.stops.push(n), this.value.stops.sort((o, a) => o.position - a.position);
|
|
3356
3357
|
}
|
|
3357
3358
|
openPopover() {
|
|
3358
|
-
if (
|
|
3359
|
-
if (this.isPopoverOpen = !0, this.popoverEl.style.display = "flex", this.refreshPopoverContent(), this.element) {
|
|
3359
|
+
if (this.popoverEl && (N.openInstance && N.openInstance !== this && N.openInstance.closePopover(), !this.isPopoverOpen)) {
|
|
3360
|
+
if (this.isPopoverOpen = !0, N.openInstance = this, this.popoverEl.style.display = "flex", this.refreshPopoverContent(), this.element) {
|
|
3360
3361
|
const t = this.element.getBoundingClientRect(), e = 306, i = window.innerWidth, s = window.innerHeight, n = 16;
|
|
3361
3362
|
this.popoverEl.style.position = "fixed", this.popoverEl.style.zIndex = "10000", this.popoverEl.style.left = "-9999px", this.popoverEl.style.top = "0px";
|
|
3362
3363
|
const o = this.popoverEl.offsetHeight;
|
|
@@ -3364,7 +3365,7 @@ class Ce extends E {
|
|
|
3364
3365
|
const r = i - t.right, h = t.left, p = e + n;
|
|
3365
3366
|
r < p && h > r + 100 && (a = t.left - e - 8);
|
|
3366
3367
|
const d = s - t.bottom, g = t.top;
|
|
3367
|
-
|
|
3368
|
+
g >= o + n ? l = t.top - o - 8 : d >= o + n ? l = t.bottom + 8 : g > d ? (l = t.top - o - 8, l < n && (l = n)) : (l = t.bottom + 8, l + o > s - n && (l = s - o - n)), this.popoverEl.style.left = `${a}px`, this.popoverEl.style.top = `${l}px`;
|
|
3368
3369
|
}
|
|
3369
3370
|
setTimeout(
|
|
3370
3371
|
() => document.addEventListener("click", this.onBackgroundClick, !0),
|
|
@@ -3373,16 +3374,17 @@ class Ce extends E {
|
|
|
3373
3374
|
}
|
|
3374
3375
|
}
|
|
3375
3376
|
repositionPopover() {
|
|
3376
|
-
|
|
3377
|
+
var t;
|
|
3378
|
+
!this.popoverEl || !this.isPopoverOpen || !this.element || ((t = document.activeElement) == null ? void 0 : t.tagName) !== "INPUT" && requestAnimationFrame(() => {
|
|
3377
3379
|
if (!this.popoverEl || !this.element) return;
|
|
3378
|
-
const
|
|
3380
|
+
const e = this.element.getBoundingClientRect(), i = 306, s = window.innerWidth, n = window.innerHeight, o = 16;
|
|
3379
3381
|
this.popoverEl.style.left, this.popoverEl.style.top, this.popoverEl.style.left = "-9999px", this.popoverEl.style.top = "0px";
|
|
3380
|
-
const
|
|
3381
|
-
let
|
|
3382
|
-
const
|
|
3383
|
-
|
|
3384
|
-
const
|
|
3385
|
-
|
|
3382
|
+
const a = this.popoverEl.offsetHeight;
|
|
3383
|
+
let l = e.right + 8, r = e.top;
|
|
3384
|
+
const h = s - e.right, p = e.left, d = i + o;
|
|
3385
|
+
h < d && p > h + 100 && (l = e.left - i - 8);
|
|
3386
|
+
const g = n - e.bottom, u = e.top;
|
|
3387
|
+
u >= a + o ? r = e.top - a - 8 : g >= a + o ? r = e.bottom + 8 : u > g ? (r = e.top - a - 8, r < o && (r = o)) : (r = e.bottom + 8, r + a > n - o && (r = n - a - o)), this.popoverEl.style.left = `${l}px`, this.popoverEl.style.top = `${r}px`;
|
|
3386
3388
|
});
|
|
3387
3389
|
}
|
|
3388
3390
|
refreshPopoverContent() {
|
|
@@ -3396,7 +3398,7 @@ class Ce extends E {
|
|
|
3396
3398
|
s && this.updatePopoverContent(s);
|
|
3397
3399
|
}
|
|
3398
3400
|
closePopover() {
|
|
3399
|
-
!this.popoverEl || !this.isPopoverOpen || (this.isPopoverOpen = !1, this.popoverEl.style.display = "none", document.removeEventListener("click", this.onBackgroundClick, !0));
|
|
3401
|
+
!this.popoverEl || !this.isPopoverOpen || (this.isPopoverOpen = !1, this.popoverEl.style.display = "none", document.removeEventListener("click", this.onBackgroundClick, !0), N.openInstance === this && (N.openInstance = null));
|
|
3400
3402
|
}
|
|
3401
3403
|
handlePaste(t) {
|
|
3402
3404
|
var i;
|
|
@@ -3409,7 +3411,7 @@ class Ce extends E {
|
|
|
3409
3411
|
this.parseAndSet(e.value);
|
|
3410
3412
|
}
|
|
3411
3413
|
parseAndSet(t) {
|
|
3412
|
-
const e =
|
|
3414
|
+
const e = K(t.trim());
|
|
3413
3415
|
e && this.setValue(e);
|
|
3414
3416
|
}
|
|
3415
3417
|
triggerChange() {
|
|
@@ -3420,25 +3422,27 @@ class Ce extends E {
|
|
|
3420
3422
|
return this.element;
|
|
3421
3423
|
}
|
|
3422
3424
|
getValue() {
|
|
3423
|
-
return this.value ? this.forText ? this.cssForTextValue() :
|
|
3425
|
+
return this.value ? this.forText ? this.cssForTextValue() : P(this.value) : this.forText ? {} : "";
|
|
3424
3426
|
}
|
|
3425
3427
|
getCSSValue() {
|
|
3426
|
-
return this.value ?
|
|
3428
|
+
return this.value ? P(this.value) : "";
|
|
3427
3429
|
}
|
|
3428
3430
|
getRawValue() {
|
|
3429
3431
|
return this.value;
|
|
3430
3432
|
}
|
|
3431
|
-
}
|
|
3432
|
-
|
|
3433
|
+
};
|
|
3434
|
+
N.openInstance = null;
|
|
3435
|
+
let rt = N;
|
|
3436
|
+
const Yt = `
|
|
3433
3437
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
3434
3438
|
<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"/>
|
|
3435
3439
|
</svg>
|
|
3436
|
-
`,
|
|
3440
|
+
`, Kt = `
|
|
3437
3441
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
3438
3442
|
<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"/>
|
|
3439
3443
|
</svg>
|
|
3440
3444
|
`;
|
|
3441
|
-
class
|
|
3445
|
+
class Ee extends O {
|
|
3442
3446
|
constructor(t) {
|
|
3443
3447
|
super({
|
|
3444
3448
|
title: "Border",
|
|
@@ -3446,16 +3450,16 @@ class ye extends V {
|
|
|
3446
3450
|
settings: {
|
|
3447
3451
|
size: new I({
|
|
3448
3452
|
title: "Size",
|
|
3449
|
-
icon:
|
|
3453
|
+
icon: Kt,
|
|
3450
3454
|
default: (t == null ? void 0 : t.size) ?? 0,
|
|
3451
3455
|
suffix: "px"
|
|
3452
3456
|
}),
|
|
3453
|
-
color: new
|
|
3457
|
+
color: new T({
|
|
3454
3458
|
default: (t == null ? void 0 : t.color) ?? "0, 0, 30"
|
|
3455
3459
|
}),
|
|
3456
3460
|
radius: new I({
|
|
3457
3461
|
title: "Radius",
|
|
3458
|
-
icon:
|
|
3462
|
+
icon: Yt,
|
|
3459
3463
|
default: (t == null ? void 0 : t.radius) ?? 12,
|
|
3460
3464
|
suffix: "px"
|
|
3461
3465
|
})
|
|
@@ -3474,20 +3478,20 @@ class ye extends V {
|
|
|
3474
3478
|
`;
|
|
3475
3479
|
}
|
|
3476
3480
|
}
|
|
3477
|
-
const
|
|
3481
|
+
const Qt = `
|
|
3478
3482
|
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="13" viewBox="0 0 14 13" fill="none">
|
|
3479
3483
|
<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"/>
|
|
3480
3484
|
</svg>
|
|
3481
|
-
`,
|
|
3485
|
+
`, te = `
|
|
3482
3486
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
3483
3487
|
<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"/>
|
|
3484
3488
|
</svg>
|
|
3485
|
-
`,
|
|
3489
|
+
`, ee = `
|
|
3486
3490
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
3487
3491
|
<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"/>
|
|
3488
3492
|
</svg>
|
|
3489
3493
|
`;
|
|
3490
|
-
class
|
|
3494
|
+
class be extends O {
|
|
3491
3495
|
constructor(t = {}) {
|
|
3492
3496
|
const { showAlign: e = t.showAlign ?? !0, ...i } = t;
|
|
3493
3497
|
super({
|
|
@@ -3495,12 +3499,12 @@ class Ee extends V {
|
|
|
3495
3499
|
collapsed: i.collapsed,
|
|
3496
3500
|
settings: (() => {
|
|
3497
3501
|
const s = {
|
|
3498
|
-
color: new
|
|
3502
|
+
color: new T({
|
|
3499
3503
|
default: i.colorDefault ?? "0, 0, 30"
|
|
3500
3504
|
}),
|
|
3501
|
-
fontFamily: new
|
|
3505
|
+
fontFamily: new et({
|
|
3502
3506
|
title: "Font",
|
|
3503
|
-
icon:
|
|
3507
|
+
icon: Qt,
|
|
3504
3508
|
default: i.fontFamilyDefault ?? "Satoshi",
|
|
3505
3509
|
options: i.fontFamilyOptions ?? [
|
|
3506
3510
|
{ name: "Alt", value: "Croco Sans Black Caps Alt" },
|
|
@@ -3511,9 +3515,9 @@ class Ee extends V {
|
|
|
3511
3515
|
getOptions: i.fontFamilyGetOptions,
|
|
3512
3516
|
getOptionsAsync: i.fontFamilyGetOptionsAsync
|
|
3513
3517
|
}),
|
|
3514
|
-
fontWeight: new
|
|
3518
|
+
fontWeight: new et({
|
|
3515
3519
|
title: "Weight",
|
|
3516
|
-
icon:
|
|
3520
|
+
icon: te,
|
|
3517
3521
|
default: i.fontWeightDefault ?? "400",
|
|
3518
3522
|
options: i.fontWeightOptions ?? [
|
|
3519
3523
|
{ name: "Regular", value: "400" },
|
|
@@ -3525,7 +3529,7 @@ class Ee extends V {
|
|
|
3525
3529
|
}),
|
|
3526
3530
|
fontSize: new I({
|
|
3527
3531
|
title: "Size",
|
|
3528
|
-
icon:
|
|
3532
|
+
icon: ee,
|
|
3529
3533
|
default: i.fontSizeDefault ?? 12,
|
|
3530
3534
|
suffix: "px",
|
|
3531
3535
|
mobile: i.fontSizeMobileDefault
|
|
@@ -3533,7 +3537,7 @@ class Ee extends V {
|
|
|
3533
3537
|
};
|
|
3534
3538
|
return e ? {
|
|
3535
3539
|
...s,
|
|
3536
|
-
align: new
|
|
3540
|
+
align: new It({
|
|
3537
3541
|
title: "Align",
|
|
3538
3542
|
default: i.alignDefault ?? "center"
|
|
3539
3543
|
})
|
|
@@ -3553,7 +3557,7 @@ class Ee extends V {
|
|
|
3553
3557
|
`;
|
|
3554
3558
|
}
|
|
3555
3559
|
}
|
|
3556
|
-
class j extends
|
|
3560
|
+
class j extends b {
|
|
3557
3561
|
constructor(t) {
|
|
3558
3562
|
super({
|
|
3559
3563
|
...t,
|
|
@@ -3599,7 +3603,7 @@ class j extends E {
|
|
|
3599
3603
|
}), i;
|
|
3600
3604
|
}
|
|
3601
3605
|
}
|
|
3602
|
-
class
|
|
3606
|
+
class we extends O {
|
|
3603
3607
|
constructor(t) {
|
|
3604
3608
|
super({
|
|
3605
3609
|
title: "Margins",
|
|
@@ -3607,25 +3611,25 @@ class be extends V {
|
|
|
3607
3611
|
settings: {
|
|
3608
3612
|
marginTop: new j({
|
|
3609
3613
|
title: "Top",
|
|
3610
|
-
icon:
|
|
3614
|
+
icon: ie,
|
|
3611
3615
|
suffix: "px",
|
|
3612
3616
|
default: (t == null ? void 0 : t.marginTop) ?? "auto"
|
|
3613
3617
|
}),
|
|
3614
3618
|
marginRight: new j({
|
|
3615
3619
|
title: "Right",
|
|
3616
|
-
icon:
|
|
3620
|
+
icon: se,
|
|
3617
3621
|
suffix: "px",
|
|
3618
3622
|
default: (t == null ? void 0 : t.marginRight) ?? 0
|
|
3619
3623
|
}),
|
|
3620
3624
|
marginBottom: new j({
|
|
3621
3625
|
title: "Bottom",
|
|
3622
|
-
icon:
|
|
3626
|
+
icon: ne,
|
|
3623
3627
|
suffix: "px",
|
|
3624
3628
|
default: (t == null ? void 0 : t.marginBottom) ?? 0
|
|
3625
3629
|
}),
|
|
3626
3630
|
marginLeft: new j({
|
|
3627
3631
|
title: "Left",
|
|
3628
|
-
icon:
|
|
3632
|
+
icon: oe,
|
|
3629
3633
|
suffix: "px",
|
|
3630
3634
|
default: (t == null ? void 0 : t.marginLeft) ?? 0
|
|
3631
3635
|
})
|
|
@@ -3642,29 +3646,29 @@ class be extends V {
|
|
|
3642
3646
|
`;
|
|
3643
3647
|
}
|
|
3644
3648
|
}
|
|
3645
|
-
const
|
|
3649
|
+
const ie = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
3646
3650
|
<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"/>
|
|
3647
|
-
</svg>`,
|
|
3651
|
+
</svg>`, se = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
3648
3652
|
<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"/>
|
|
3649
|
-
</svg>`,
|
|
3653
|
+
</svg>`, ne = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
3650
3654
|
<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"/>
|
|
3651
|
-
</svg>`,
|
|
3655
|
+
</svg>`, oe = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
3652
3656
|
<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"/>
|
|
3653
3657
|
</svg>`;
|
|
3654
|
-
class
|
|
3658
|
+
class xe extends O {
|
|
3655
3659
|
constructor(t) {
|
|
3656
3660
|
super({
|
|
3657
3661
|
title: "Background Image",
|
|
3658
3662
|
collapsed: t == null ? void 0 : t.collapsed,
|
|
3659
3663
|
settings: {
|
|
3660
|
-
backgroundImage: new
|
|
3664
|
+
backgroundImage: new ht({
|
|
3661
3665
|
...t == null ? void 0 : t.uploadProps,
|
|
3662
3666
|
default: (t == null ? void 0 : t.backgroundImage) ?? ""
|
|
3663
3667
|
}),
|
|
3664
|
-
opacity: new
|
|
3668
|
+
opacity: new Mt({
|
|
3665
3669
|
default: (t == null ? void 0 : t.opacity) ?? 100
|
|
3666
3670
|
}),
|
|
3667
|
-
backgroundColor: new
|
|
3671
|
+
backgroundColor: new T({
|
|
3668
3672
|
default: (t == null ? void 0 : t.backgroundColor) ?? "0, 0, 30"
|
|
3669
3673
|
})
|
|
3670
3674
|
}
|
|
@@ -3691,40 +3695,40 @@ class we extends V {
|
|
|
3691
3695
|
}
|
|
3692
3696
|
}
|
|
3693
3697
|
export {
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3698
|
+
It as AlignSetting,
|
|
3699
|
+
ye as AnimationSetting,
|
|
3700
|
+
xe as BackgroundSettingSet,
|
|
3701
|
+
Ee as BorderSettingSet,
|
|
3702
|
+
ce as ButtonSetting,
|
|
3699
3703
|
M as ColorSetting,
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3704
|
+
T as ColorWithOpacitySetting,
|
|
3705
|
+
he as DimensionSetting,
|
|
3706
|
+
me as GapSetting,
|
|
3707
|
+
rt as GradientSetting,
|
|
3708
|
+
be as HeaderTypographySettingSet,
|
|
3709
|
+
pe as HeightSetting,
|
|
3710
|
+
re as HtmlSetting,
|
|
3711
|
+
fe as MarginBottomSetting,
|
|
3712
|
+
we as MarginSettingGroup,
|
|
3713
|
+
ve as MarginTopSetting,
|
|
3714
|
+
Ce as MultiLanguageSetting,
|
|
3711
3715
|
I as NumberSetting,
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3716
|
+
Mt as OpacitySetting,
|
|
3717
|
+
ue as SelectApiSettings,
|
|
3718
|
+
et as SelectSetting,
|
|
3719
|
+
b as Setting,
|
|
3720
|
+
O as SettingGroup,
|
|
3721
|
+
wt as StringSetting,
|
|
3722
|
+
Et as TabSettingGroup,
|
|
3723
|
+
Et as TabsSettingGroup,
|
|
3724
|
+
ge as Toggle,
|
|
3725
|
+
ht as UploadSetting,
|
|
3726
|
+
de as WidthSetting,
|
|
3727
|
+
le as asSettingGroupWithSettings,
|
|
3728
|
+
bt as createSettingGroup,
|
|
3729
|
+
ae as createTabSettingGroup,
|
|
3730
|
+
D as isSetting,
|
|
3731
|
+
nt as isSettingChild,
|
|
3732
|
+
L as isSettingGroup,
|
|
3733
|
+
U as iterateSettings
|
|
3730
3734
|
};
|