builder-settings-types 0.0.274 → 0.0.276
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.
|
@@ -11,14 +11,14 @@ function ft(c) {
|
|
|
11
11
|
e.classList.contains("setting-group") && e !== c && t++, e = e.parentElement;
|
|
12
12
|
return t;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function J(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 et(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
|
+
J(s, n), et(s, n);
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
const vt = {
|
|
@@ -112,14 +112,14 @@ class Ct {
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
const st = new Ct();
|
|
115
|
-
function
|
|
115
|
+
function Z(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) => Z(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] = Z(c[e]));
|
|
123
123
|
return t;
|
|
124
124
|
}
|
|
125
125
|
return c;
|
|
@@ -171,8 +171,8 @@ class b {
|
|
|
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 = Z(this.props), i = new t(e);
|
|
175
|
+
return i.value = Z(this.value), i;
|
|
176
176
|
}
|
|
177
177
|
createInput(t) {
|
|
178
178
|
t = { ...this.props.inputProps, ...t };
|
|
@@ -237,26 +237,26 @@ function D(c) {
|
|
|
237
237
|
return c instanceof b;
|
|
238
238
|
}
|
|
239
239
|
function L(c) {
|
|
240
|
-
return c instanceof
|
|
240
|
+
return c instanceof T;
|
|
241
241
|
}
|
|
242
242
|
function nt(c) {
|
|
243
243
|
return D(c) || L(c);
|
|
244
244
|
}
|
|
245
|
-
function
|
|
245
|
+
function j(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 Y = class Y {
|
|
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
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
|
-
|
|
259
|
+
j(this.settings, (e, i) => {
|
|
260
260
|
L(i) && (i.nestingLevel = t, i.propagateNestingLevel());
|
|
261
261
|
});
|
|
262
262
|
}
|
|
@@ -273,13 +273,13 @@ const X = class X {
|
|
|
273
273
|
this.dataPropsPath = t, this.propagateDataPropsPath();
|
|
274
274
|
}
|
|
275
275
|
propagateDataPropsPath() {
|
|
276
|
-
|
|
276
|
+
j(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 && (J(this.elementRef, this.nestingLevel), et(this.elementRef, this.nestingLevel));
|
|
283
283
|
}
|
|
284
284
|
forceChildUIRefresh() {
|
|
285
285
|
Object.entries(this.settings).forEach(([t, e]) => {
|
|
@@ -328,7 +328,7 @@ const X = class X {
|
|
|
328
328
|
}
|
|
329
329
|
clone() {
|
|
330
330
|
const t = {};
|
|
331
|
-
|
|
331
|
+
j(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.`
|
|
@@ -391,7 +391,7 @@ const X = class X {
|
|
|
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(), j(this.settings, (i, s) => {
|
|
395
395
|
var n;
|
|
396
396
|
if (L(s))
|
|
397
397
|
s.setOnChange(() => {
|
|
@@ -454,7 +454,7 @@ const X = class X {
|
|
|
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), st.trackElement(a),
|
|
457
|
+
r ? o.insertBefore(a, r) : o.appendChild(a), st.trackElement(a), J(a, this.nestingLevel + 1), et(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
|
}
|
|
@@ -705,7 +705,7 @@ const X = class X {
|
|
|
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}`, Y.hiddenElements.add(t), this.hide && (t.style.display = "none"), this.isMain && t.classList.add("main-group"), this.custom && t.classList.add("custom_class"), J(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",
|
|
@@ -809,12 +809,12 @@ const X = class X {
|
|
|
809
809
|
}
|
|
810
810
|
}
|
|
811
811
|
};
|
|
812
|
-
|
|
813
|
-
let
|
|
812
|
+
Y.hiddenElements = /* @__PURE__ */ new Set();
|
|
813
|
+
let T = Y;
|
|
814
814
|
function ae(c) {
|
|
815
815
|
return new Et(c);
|
|
816
816
|
}
|
|
817
|
-
class Et extends
|
|
817
|
+
class Et extends T {
|
|
818
818
|
constructor(t) {
|
|
819
819
|
super(t);
|
|
820
820
|
const e = Object.keys(this.settings)[0];
|
|
@@ -866,7 +866,7 @@ class Et extends O {
|
|
|
866
866
|
}
|
|
867
867
|
}
|
|
868
868
|
function bt(c) {
|
|
869
|
-
return new
|
|
869
|
+
return new T(c);
|
|
870
870
|
}
|
|
871
871
|
function le(c) {
|
|
872
872
|
return c;
|
|
@@ -1001,14 +1001,14 @@ const Lt = `
|
|
|
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 H extends b {
|
|
1005
1005
|
constructor(t = {}) {
|
|
1006
1006
|
super({
|
|
1007
1007
|
...t,
|
|
1008
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 = H.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 T extends b {
|
|
|
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 = H.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 T extends b {
|
|
|
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 = H.combineColorOpacity(
|
|
1041
1041
|
t,
|
|
1042
1042
|
e
|
|
1043
1043
|
);
|
|
@@ -1048,7 +1048,7 @@ class T extends b {
|
|
|
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 = H.combineColorOpacity(
|
|
1052
1052
|
e,
|
|
1053
1053
|
i
|
|
1054
1054
|
);
|
|
@@ -1245,7 +1245,7 @@ const St = `
|
|
|
1245
1245
|
<polyline points="6 9 12 15 18 9"></polyline>
|
|
1246
1246
|
</svg>
|
|
1247
1247
|
`;
|
|
1248
|
-
class
|
|
1248
|
+
class it 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);
|
|
@@ -1561,16 +1561,16 @@ const Nt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewB
|
|
|
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
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>`, K = `
|
|
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
|
+
`, Tt = `
|
|
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
|
+
`, Ot = `
|
|
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>
|
|
@@ -1647,7 +1647,7 @@ class ht extends b {
|
|
|
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">${K}</span>
|
|
1651
1651
|
<span class="upload-label">Replace</span>
|
|
1652
1652
|
`);
|
|
1653
1653
|
const n = () => {
|
|
@@ -1658,7 +1658,7 @@ class ht extends b {
|
|
|
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">${K}</span>
|
|
1662
1662
|
<span class="upload-label">Upload</span>
|
|
1663
1663
|
`);
|
|
1664
1664
|
}
|
|
@@ -1691,9 +1691,9 @@ class ht extends b {
|
|
|
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 = Tt, 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 = Ot, 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 ht extends b {
|
|
|
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">${K}</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(
|
|
@@ -1721,7 +1721,7 @@ class pe extends I {
|
|
|
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 || Ht,
|
|
1725
1725
|
default: t.default ?? 100
|
|
1726
1726
|
}), this.inputType = "number", this.mobileValue = t.mobile;
|
|
1727
1727
|
}
|
|
@@ -1732,7 +1732,7 @@ class pe extends I {
|
|
|
1732
1732
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
1733
1733
|
}
|
|
1734
1734
|
}
|
|
1735
|
-
const
|
|
1735
|
+
const Ht = `<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
1738
|
class de extends I {
|
|
@@ -2205,7 +2205,7 @@ class ye extends b {
|
|
|
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 it({
|
|
2209
2209
|
title: this.title || "Animation",
|
|
2210
2210
|
options: e,
|
|
2211
2211
|
default: this.props.default || "none"
|
|
@@ -2262,10 +2262,10 @@ const Ft = (c, t) => {
|
|
|
2262
2262
|
Math.round((l + o) * 255),
|
|
2263
2263
|
Math.round((r + o) * 255)
|
|
2264
2264
|
);
|
|
2265
|
-
},
|
|
2265
|
+
}, Ut = (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
|
+
}, X = (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), {
|
|
@@ -2286,7 +2286,7 @@ const Ft = (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 } = X(
|
|
2290
2290
|
parseInt(s[1]),
|
|
2291
2291
|
parseInt(s[2]) / 100,
|
|
2292
2292
|
parseInt(s[3]) / 100
|
|
@@ -2297,7 +2297,7 @@ const Ft = (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 } = X(
|
|
2301
2301
|
parseInt(s[1]),
|
|
2302
2302
|
parseInt(s[2]) / 100,
|
|
2303
2303
|
parseInt(s[3]) / 100
|
|
@@ -2311,7 +2311,7 @@ const Ft = (c, t) => {
|
|
|
2311
2311
|
return `rgba(${s}, ${n}, ${o}, ${e})`;
|
|
2312
2312
|
}
|
|
2313
2313
|
return c;
|
|
2314
|
-
},
|
|
2314
|
+
}, Gt = (c) => [
|
|
2315
2315
|
"red",
|
|
2316
2316
|
"green",
|
|
2317
2317
|
"blue",
|
|
@@ -2340,7 +2340,7 @@ const Ft = (c, t) => {
|
|
|
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())), Wt = (c) => {
|
|
2344
2344
|
if (typeof document > "u")
|
|
2345
2345
|
return dt(c) || !!F(c);
|
|
2346
2346
|
const t = document.createElement("div");
|
|
@@ -2370,7 +2370,7 @@ const Ft = (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 } = X(
|
|
2374
2374
|
parseFloat(i[1]),
|
|
2375
2375
|
parseFloat(i[2]) / 100,
|
|
2376
2376
|
parseFloat(i[3]) / 100
|
|
@@ -2427,7 +2427,7 @@ const Ft = (c, t) => {
|
|
|
2427
2427
|
};
|
|
2428
2428
|
q.STORAGE_KEY = "settingsLib_recentColors", q.MAX_COLORS = 12, q.colors = null;
|
|
2429
2429
|
let V = q;
|
|
2430
|
-
const
|
|
2430
|
+
const zt = (c, t) => {
|
|
2431
2431
|
const e = document.createElement("div");
|
|
2432
2432
|
e.className = "color-picker-recent-section";
|
|
2433
2433
|
const i = document.createElement("div");
|
|
@@ -2453,7 +2453,7 @@ const qt = (c, t) => {
|
|
|
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>`, qt = `<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"/>
|
|
@@ -2504,7 +2504,7 @@ class Jt {
|
|
|
2504
2504
|
const a = document.createElement("div");
|
|
2505
2505
|
a.className = "color-picker-hue-container";
|
|
2506
2506
|
const l = document.createElement("button");
|
|
2507
|
-
l.className = "color-picker-eyedropper", l.type = "button", l.innerHTML =
|
|
2507
|
+
l.className = "color-picker-eyedropper", l.type = "button", l.innerHTML = qt;
|
|
2508
2508
|
const r = document.createElement("div");
|
|
2509
2509
|
r.className = "color-picker-hue", this.hueSlider = r;
|
|
2510
2510
|
const h = document.createElement("div");
|
|
@@ -2513,9 +2513,9 @@ class Jt {
|
|
|
2513
2513
|
p.className = "color-picker-opacity", this.opacitySlider = p;
|
|
2514
2514
|
const d = document.createElement("div");
|
|
2515
2515
|
d.className = "color-picker-opacity-marker", this.opacityMarker = d, p.appendChild(d);
|
|
2516
|
-
const g =
|
|
2517
|
-
var
|
|
2518
|
-
this.setColor($), (
|
|
2516
|
+
const g = zt(($) => {
|
|
2517
|
+
var U, G;
|
|
2518
|
+
this.setColor($), (U = this.onChange) == null || U.call(this, $, this.currentOpacity), V.addColor($, this.recentScope), (G = this.recentSectionRefresh) == null || G.call(this);
|
|
2519
2519
|
}, this.recentScope);
|
|
2520
2520
|
this.recentSectionRefresh = g.refresh;
|
|
2521
2521
|
const u = document.createElement("div");
|
|
@@ -2530,10 +2530,10 @@ class Jt {
|
|
|
2530
2530
|
x.value = "hsl", x.textContent = "HSL", m.appendChild(f), m.appendChild(C), m.appendChild(x);
|
|
2531
2531
|
const y = document.createElement("input");
|
|
2532
2532
|
y.type = "text", y.className = "color-picker-color-input", y.value = this.currentColor, this.input = y;
|
|
2533
|
-
const
|
|
2534
|
-
|
|
2533
|
+
const O = document.createElement("div");
|
|
2534
|
+
O.className = "color-picker-input-container";
|
|
2535
2535
|
const k = document.createElement("button");
|
|
2536
|
-
return k.className = "color-picker-copy-inside", k.textContent = "Copy",
|
|
2536
|
+
return k.className = "color-picker-copy-inside", k.textContent = "Copy", O.appendChild(y), O.appendChild(k), u.appendChild(m), u.appendChild(O), 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;
|
|
2537
2537
|
}
|
|
2538
2538
|
createBackdrop() {
|
|
2539
2539
|
const t = document.createElement("div");
|
|
@@ -2618,7 +2618,7 @@ class Jt {
|
|
|
2618
2618
|
const { r: n, g: o, b: a } = S(this.currentColor);
|
|
2619
2619
|
this.input.value = `rgb(${n}, ${o}, ${a})`;
|
|
2620
2620
|
} else {
|
|
2621
|
-
const { hue: n, sat: o, lightness: a } =
|
|
2621
|
+
const { hue: n, sat: o, lightness: a } = Ut(e, i, s);
|
|
2622
2622
|
this.input.value = `hsl(${Math.round(n)}, ${Math.round(
|
|
2623
2623
|
o * 100
|
|
2624
2624
|
)}%, ${Math.round(a * 100)}%)`;
|
|
@@ -2865,7 +2865,7 @@ class Zt {
|
|
|
2865
2865
|
if (e) {
|
|
2866
2866
|
const i = parseFloat(e[1]), s = parseFloat(e[2]) / 100, n = parseFloat(e[3]) / 100;
|
|
2867
2867
|
if (i >= 0 && i <= 360 && s >= 0 && s <= 1 && n >= 0 && n <= 1) {
|
|
2868
|
-
const o =
|
|
2868
|
+
const o = X(i, s, n);
|
|
2869
2869
|
return R(o.r, o.g, o.b);
|
|
2870
2870
|
}
|
|
2871
2871
|
}
|
|
@@ -2951,7 +2951,7 @@ const ot = (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) ||
|
|
2954
|
+
].includes(t) ? !1 : /^#[0-9a-f]{3,8}$/i.test(t) || /^rgb/i.test(c) || /^hsl/i.test(c) || Gt(t);
|
|
2955
2955
|
}, lt = (c) => {
|
|
2956
2956
|
const t = [];
|
|
2957
2957
|
return c.forEach((e, i) => {
|
|
@@ -2974,9 +2974,9 @@ const ot = (c) => {
|
|
|
2974
2974
|
opacity: e.opacity === void 0 || Number.isNaN(e.opacity) ? 100 : e.opacity
|
|
2975
2975
|
}))
|
|
2976
2976
|
};
|
|
2977
|
-
},
|
|
2977
|
+
}, Q = (c) => {
|
|
2978
2978
|
const t = c.replace(/;$/, "").trim();
|
|
2979
|
-
if (
|
|
2979
|
+
if (Wt(t)) {
|
|
2980
2980
|
const s = ut(t);
|
|
2981
2981
|
return B({ type: "solid", angle: 0, stops: [s] });
|
|
2982
2982
|
}
|
|
@@ -3016,7 +3016,7 @@ const ot = (c) => {
|
|
|
3016
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
|
+
}, tt = (c) => {
|
|
3020
3020
|
if (c.type === "solid") {
|
|
3021
3021
|
const t = c.stops[0];
|
|
3022
3022
|
return t ? t.color.replace("#", "").toUpperCase() : "Color";
|
|
@@ -3033,7 +3033,7 @@ const ot = (c) => {
|
|
|
3033
3033
|
type: "text",
|
|
3034
3034
|
angle: "number",
|
|
3035
3035
|
stops: "text"
|
|
3036
|
-
}, this.element = null, this.previewEl = null, this.inputEl = void 0, this.popoverEl = null, this.isPopoverOpen = !1, this.isEditing = !1, this.onBackgroundClick = (i) => {
|
|
3036
|
+
}, this.element = null, this.previewEl = null, this.inputEl = void 0, this.popoverEl = null, this.isPopoverOpen = !1, this.isEditing = !1, this.previewUpdateTimeout = null, this.onBackgroundClick = (i) => {
|
|
3037
3037
|
var p;
|
|
3038
3038
|
if (!this.popoverEl || !this.isPopoverOpen) return;
|
|
3039
3039
|
const s = i.target, n = this.popoverEl.contains(s), o = (p = this.element) == null ? void 0 : p.contains(s), a = document.querySelectorAll(".custom-color-picker"), l = Array.from(a).some((d) => d.contains(s)), r = s.closest(
|
|
@@ -3045,7 +3045,7 @@ const ot = (c) => {
|
|
|
3045
3045
|
defaultValue() {
|
|
3046
3046
|
const t = this.originalDefault;
|
|
3047
3047
|
if (typeof t == "string") {
|
|
3048
|
-
const i =
|
|
3048
|
+
const i = Q(t);
|
|
3049
3049
|
if (i)
|
|
3050
3050
|
return B(i);
|
|
3051
3051
|
}
|
|
@@ -3061,7 +3061,7 @@ const ot = (c) => {
|
|
|
3061
3061
|
setValue(t) {
|
|
3062
3062
|
var i, s;
|
|
3063
3063
|
let e = null;
|
|
3064
|
-
typeof t == "string" ? e =
|
|
3064
|
+
typeof t == "string" ? e = Q(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);
|
|
3065
3065
|
}
|
|
3066
3066
|
updateUI() {
|
|
3067
3067
|
if (this.previewEl && this.value)
|
|
@@ -3070,7 +3070,7 @@ const ot = (c) => {
|
|
|
3070
3070
|
this.previewEl.style.background = pt(t.color, e);
|
|
3071
3071
|
} else
|
|
3072
3072
|
this.previewEl.style.background = P(this.value);
|
|
3073
|
-
this.inputEl && this.value && !this.isEditing && (this.inputEl.value =
|
|
3073
|
+
this.inputEl && this.value && !this.isEditing && (this.inputEl.value = tt(this.value));
|
|
3074
3074
|
}
|
|
3075
3075
|
cssForTextValue() {
|
|
3076
3076
|
return this.value ? {
|
|
@@ -3092,10 +3092,10 @@ const ot = (c) => {
|
|
|
3092
3092
|
const e = document.createElement("div");
|
|
3093
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) => {
|
|
3094
3094
|
i.preventDefault(), i.stopPropagation(), this.openPopover();
|
|
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 ?
|
|
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 ? tt(this.value) : "", this.inputEl.readOnly = !1, this.inputEl.addEventListener("focus", () => {
|
|
3096
3096
|
this.isEditing = !0, this.value && (this.inputEl.value = P(this.value));
|
|
3097
3097
|
}), this.inputEl.addEventListener("blur", () => {
|
|
3098
|
-
this.isEditing = !1, this.value && (this.inputEl.value =
|
|
3098
|
+
this.isEditing = !1, this.value && (this.inputEl.value = tt(this.value));
|
|
3099
3099
|
}), this.inputEl.addEventListener(
|
|
3100
3100
|
"paste",
|
|
3101
3101
|
(i) => this.handlePaste(i)
|
|
@@ -3180,9 +3180,10 @@ const ot = (c) => {
|
|
|
3180
3180
|
m.value = m.value.replace(/[^0-9-]/g, ""), setTimeout(() => m.select(), 0);
|
|
3181
3181
|
}), o.addEventListener("input", (u) => {
|
|
3182
3182
|
const m = parseInt(u.target.value);
|
|
3183
|
-
!Number.isNaN(m) && this.value && (this.value.angle = Math.max(0, Math.min(360, m)), this.
|
|
3183
|
+
!Number.isNaN(m) && this.value && (this.value.angle = Math.max(0, Math.min(360, m)), this.debouncedPreviewUpdate());
|
|
3184
3184
|
}), o.addEventListener("blur", (u) => {
|
|
3185
3185
|
var C;
|
|
3186
|
+
this.previewUpdateTimeout && (clearTimeout(this.previewUpdateTimeout), this.previewUpdateTimeout = null);
|
|
3186
3187
|
const m = u.target;
|
|
3187
3188
|
let f = parseInt(m.value);
|
|
3188
3189
|
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();
|
|
@@ -3216,6 +3217,11 @@ const ot = (c) => {
|
|
|
3216
3217
|
const e = t || ((i = this.popoverEl) == null ? void 0 : i.querySelector(".gradient-preview"));
|
|
3217
3218
|
e && this.value && (e.style.background = P(this.value));
|
|
3218
3219
|
}
|
|
3220
|
+
debouncedPreviewUpdate(t) {
|
|
3221
|
+
this.previewUpdateTimeout && clearTimeout(this.previewUpdateTimeout), this.previewUpdateTimeout = window.setTimeout(() => {
|
|
3222
|
+
this.updateGradientPreview(t), this.previewUpdateTimeout = null;
|
|
3223
|
+
}, 16);
|
|
3224
|
+
}
|
|
3219
3225
|
createHandles(t, e) {
|
|
3220
3226
|
t.innerHTML = "", !(!this.value || this.value.type === "solid" || !this.value.stops) && this.value.stops.forEach((i, s) => {
|
|
3221
3227
|
const n = document.createElement("div");
|
|
@@ -3246,7 +3252,7 @@ const ot = (c) => {
|
|
|
3246
3252
|
(n, o) => n.position - o.position
|
|
3247
3253
|
);
|
|
3248
3254
|
i.forEach((n, o) => {
|
|
3249
|
-
var
|
|
3255
|
+
var U, G;
|
|
3250
3256
|
const a = this.value.stops.findIndex(
|
|
3251
3257
|
(v, E) => v.position === n.position && v.color === n.color && v.opacity === n.opacity && this.value.stops.slice(0, E).filter(
|
|
3252
3258
|
(w) => w.position === n.position && w.color === n.color && w.opacity === n.opacity
|
|
@@ -3268,17 +3274,17 @@ const ot = (c) => {
|
|
|
3268
3274
|
const m = document.createElement("button");
|
|
3269
3275
|
m.type = "button", m.className = "gstop-color-copy", m.textContent = "Copy", d.appendChild(g), d.appendChild(u), d.appendChild(m);
|
|
3270
3276
|
const f = document.createElement("button");
|
|
3271
|
-
f.type = "button", f.className = "gstop-del", f.innerHTML = _t, f.disabled = (((
|
|
3277
|
+
f.type = "button", f.className = "gstop-del", f.innerHTML = _t, f.disabled = (((G = (U = this.value) == null ? void 0 : U.stops) == null ? void 0 : G.length) || 0) <= 2, r.appendChild(h), r.appendChild(d), r.appendChild(f), e.appendChild(r);
|
|
3272
3278
|
const C = document.createElement("span");
|
|
3273
3279
|
C.className = "gstop-opacity-label", C.textContent = "Opacity";
|
|
3274
3280
|
const x = document.createElement("div");
|
|
3275
3281
|
x.className = "gstop-opacity-group";
|
|
3276
3282
|
const y = document.createElement("input");
|
|
3277
3283
|
y.type = "range", y.className = "gstop-opacity-slider", y.min = "0", y.max = "100", y.value = String(n.opacity ?? 100);
|
|
3278
|
-
const
|
|
3284
|
+
const O = S(n.color);
|
|
3279
3285
|
y.style.setProperty(
|
|
3280
3286
|
"--slider-color",
|
|
3281
|
-
`rgb(${
|
|
3287
|
+
`rgb(${O.r}, ${O.g}, ${O.b})`
|
|
3282
3288
|
);
|
|
3283
3289
|
const k = document.createElement("span");
|
|
3284
3290
|
k.className = "gstop-opacity-value", k.textContent = `${n.opacity ?? 100}%`, x.appendChild(y), x.appendChild(k);
|
|
@@ -3303,8 +3309,10 @@ const ot = (c) => {
|
|
|
3303
3309
|
y.style.setProperty(
|
|
3304
3310
|
"--slider-color",
|
|
3305
3311
|
`rgb(${w.r}, ${w.g}, ${w.b})`
|
|
3306
|
-
), this.
|
|
3312
|
+
), this.debouncedPreviewUpdate();
|
|
3307
3313
|
}
|
|
3314
|
+
}), u.addEventListener("blur", () => {
|
|
3315
|
+
this.previewUpdateTimeout && (clearTimeout(this.previewUpdateTimeout), this.previewUpdateTimeout = null), this.updateGradientPreview(), this.updateUI(), this.triggerChange();
|
|
3308
3316
|
}), m.addEventListener("click", async (v) => {
|
|
3309
3317
|
v.stopPropagation();
|
|
3310
3318
|
try {
|
|
@@ -3317,15 +3325,22 @@ const ot = (c) => {
|
|
|
3317
3325
|
}), p.addEventListener("input", (v) => {
|
|
3318
3326
|
const E = v.target, w = parseInt(E.value.replace(/[^\d]/g, ""), 10);
|
|
3319
3327
|
if (!Number.isNaN(w)) {
|
|
3320
|
-
const
|
|
3321
|
-
this.value.stops[l].position =
|
|
3322
|
-
this.popoverEl.querySelector(".gradient-handles"),
|
|
3323
|
-
this.popoverEl.querySelector(".gradient-preview")
|
|
3324
|
-
), this.updateUI(), this.triggerChange();
|
|
3328
|
+
const W = Math.max(0, Math.min(100, w));
|
|
3329
|
+
this.value.stops[l].position = W, E.value = `${W}%`, this.debouncedPreviewUpdate();
|
|
3325
3330
|
}
|
|
3326
3331
|
}), p.addEventListener("blur", (v) => {
|
|
3332
|
+
this.previewUpdateTimeout && (clearTimeout(this.previewUpdateTimeout), this.previewUpdateTimeout = null);
|
|
3327
3333
|
const E = v.target, w = parseInt(E.value.replace(/[^\d]/g, ""), 10);
|
|
3328
|
-
Number.isNaN(w)
|
|
3334
|
+
if (Number.isNaN(w))
|
|
3335
|
+
E.value = `${this.value.stops[l].position}%`;
|
|
3336
|
+
else {
|
|
3337
|
+
const W = Math.max(0, Math.min(100, w));
|
|
3338
|
+
this.value.stops[l].position = W, E.value = `${W}%`;
|
|
3339
|
+
}
|
|
3340
|
+
this.updateGradientPreview(), this.createHandles(
|
|
3341
|
+
this.popoverEl.querySelector(".gradient-handles"),
|
|
3342
|
+
this.popoverEl.querySelector(".gradient-preview")
|
|
3343
|
+
), this.updateStopsList(), this.updateUI(), this.triggerChange();
|
|
3329
3344
|
}), f.addEventListener("click", () => {
|
|
3330
3345
|
var v;
|
|
3331
3346
|
(this.value.stops.length || 0) <= 2 || (this.value.stops.splice(l, 1), this.createHandles(
|
|
@@ -3334,7 +3349,9 @@ const ot = (c) => {
|
|
|
3334
3349
|
), this.updateStopsList(), this.updateGradientPreview(), this.updateUI(), ((v = document.activeElement) == null ? void 0 : v.tagName) !== "INPUT" && this.repositionPopover(), this.triggerChange());
|
|
3335
3350
|
}), y.addEventListener("input", () => {
|
|
3336
3351
|
const v = parseInt(y.value, 10);
|
|
3337
|
-
this.value.stops[l].opacity = Math.max(0, Math.min(100, v)), k.textContent = `${this.value.stops[l].opacity}%`, this.
|
|
3352
|
+
this.value.stops[l].opacity = Math.max(0, Math.min(100, v)), k.textContent = `${this.value.stops[l].opacity}%`, this.debouncedPreviewUpdate();
|
|
3353
|
+
}), y.addEventListener("change", () => {
|
|
3354
|
+
this.previewUpdateTimeout && (clearTimeout(this.previewUpdateTimeout), this.previewUpdateTimeout = null), this.updateGradientPreview(), this.updateUI(), this.triggerChange();
|
|
3338
3355
|
});
|
|
3339
3356
|
});
|
|
3340
3357
|
}
|
|
@@ -3398,7 +3415,7 @@ const ot = (c) => {
|
|
|
3398
3415
|
s && this.updatePopoverContent(s);
|
|
3399
3416
|
}
|
|
3400
3417
|
closePopover() {
|
|
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));
|
|
3418
|
+
!this.popoverEl || !this.isPopoverOpen || (this.isPopoverOpen = !1, this.popoverEl.style.display = "none", document.removeEventListener("click", this.onBackgroundClick, !0), this.previewUpdateTimeout && (clearTimeout(this.previewUpdateTimeout), this.previewUpdateTimeout = null), N.openInstance === this && (N.openInstance = null));
|
|
3402
3419
|
}
|
|
3403
3420
|
handlePaste(t) {
|
|
3404
3421
|
var i;
|
|
@@ -3411,7 +3428,7 @@ const ot = (c) => {
|
|
|
3411
3428
|
this.parseAndSet(e.value);
|
|
3412
3429
|
}
|
|
3413
3430
|
parseAndSet(t) {
|
|
3414
|
-
const e =
|
|
3431
|
+
const e = Q(t.trim());
|
|
3415
3432
|
e && this.setValue(e);
|
|
3416
3433
|
}
|
|
3417
3434
|
triggerChange() {
|
|
@@ -3442,7 +3459,7 @@ const Yt = `
|
|
|
3442
3459
|
<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"/>
|
|
3443
3460
|
</svg>
|
|
3444
3461
|
`;
|
|
3445
|
-
class Ee extends
|
|
3462
|
+
class Ee extends T {
|
|
3446
3463
|
constructor(t) {
|
|
3447
3464
|
super({
|
|
3448
3465
|
title: "Border",
|
|
@@ -3454,7 +3471,7 @@ class Ee extends O {
|
|
|
3454
3471
|
default: (t == null ? void 0 : t.size) ?? 0,
|
|
3455
3472
|
suffix: "px"
|
|
3456
3473
|
}),
|
|
3457
|
-
color: new
|
|
3474
|
+
color: new H({
|
|
3458
3475
|
default: (t == null ? void 0 : t.color) ?? "0, 0, 30"
|
|
3459
3476
|
}),
|
|
3460
3477
|
radius: new I({
|
|
@@ -3491,7 +3508,7 @@ const Qt = `
|
|
|
3491
3508
|
<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"/>
|
|
3492
3509
|
</svg>
|
|
3493
3510
|
`;
|
|
3494
|
-
class be extends
|
|
3511
|
+
class be extends T {
|
|
3495
3512
|
constructor(t = {}) {
|
|
3496
3513
|
const { showAlign: e = t.showAlign ?? !0, ...i } = t;
|
|
3497
3514
|
super({
|
|
@@ -3499,10 +3516,10 @@ class be extends O {
|
|
|
3499
3516
|
collapsed: i.collapsed,
|
|
3500
3517
|
settings: (() => {
|
|
3501
3518
|
const s = {
|
|
3502
|
-
color: new
|
|
3519
|
+
color: new H({
|
|
3503
3520
|
default: i.colorDefault ?? "0, 0, 30"
|
|
3504
3521
|
}),
|
|
3505
|
-
fontFamily: new
|
|
3522
|
+
fontFamily: new it({
|
|
3506
3523
|
title: "Font",
|
|
3507
3524
|
icon: Qt,
|
|
3508
3525
|
default: i.fontFamilyDefault ?? "Satoshi",
|
|
@@ -3515,7 +3532,7 @@ class be extends O {
|
|
|
3515
3532
|
getOptions: i.fontFamilyGetOptions,
|
|
3516
3533
|
getOptionsAsync: i.fontFamilyGetOptionsAsync
|
|
3517
3534
|
}),
|
|
3518
|
-
fontWeight: new
|
|
3535
|
+
fontWeight: new it({
|
|
3519
3536
|
title: "Weight",
|
|
3520
3537
|
icon: te,
|
|
3521
3538
|
default: i.fontWeightDefault ?? "400",
|
|
@@ -3557,7 +3574,7 @@ class be extends O {
|
|
|
3557
3574
|
`;
|
|
3558
3575
|
}
|
|
3559
3576
|
}
|
|
3560
|
-
class
|
|
3577
|
+
class _ extends b {
|
|
3561
3578
|
constructor(t) {
|
|
3562
3579
|
super({
|
|
3563
3580
|
...t,
|
|
@@ -3603,31 +3620,31 @@ class j extends b {
|
|
|
3603
3620
|
}), i;
|
|
3604
3621
|
}
|
|
3605
3622
|
}
|
|
3606
|
-
class we extends
|
|
3623
|
+
class we extends T {
|
|
3607
3624
|
constructor(t) {
|
|
3608
3625
|
super({
|
|
3609
3626
|
title: "Margins",
|
|
3610
3627
|
collapsed: t == null ? void 0 : t.collapsed,
|
|
3611
3628
|
settings: {
|
|
3612
|
-
marginTop: new
|
|
3629
|
+
marginTop: new _({
|
|
3613
3630
|
title: "Top",
|
|
3614
3631
|
icon: ie,
|
|
3615
3632
|
suffix: "px",
|
|
3616
3633
|
default: (t == null ? void 0 : t.marginTop) ?? "auto"
|
|
3617
3634
|
}),
|
|
3618
|
-
marginRight: new
|
|
3635
|
+
marginRight: new _({
|
|
3619
3636
|
title: "Right",
|
|
3620
3637
|
icon: se,
|
|
3621
3638
|
suffix: "px",
|
|
3622
3639
|
default: (t == null ? void 0 : t.marginRight) ?? 0
|
|
3623
3640
|
}),
|
|
3624
|
-
marginBottom: new
|
|
3641
|
+
marginBottom: new _({
|
|
3625
3642
|
title: "Bottom",
|
|
3626
3643
|
icon: ne,
|
|
3627
3644
|
suffix: "px",
|
|
3628
3645
|
default: (t == null ? void 0 : t.marginBottom) ?? 0
|
|
3629
3646
|
}),
|
|
3630
|
-
marginLeft: new
|
|
3647
|
+
marginLeft: new _({
|
|
3631
3648
|
title: "Left",
|
|
3632
3649
|
icon: oe,
|
|
3633
3650
|
suffix: "px",
|
|
@@ -3655,7 +3672,7 @@ const ie = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewB
|
|
|
3655
3672
|
</svg>`, oe = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
3656
3673
|
<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"/>
|
|
3657
3674
|
</svg>`;
|
|
3658
|
-
class xe extends
|
|
3675
|
+
class xe extends T {
|
|
3659
3676
|
constructor(t) {
|
|
3660
3677
|
super({
|
|
3661
3678
|
title: "Background Image",
|
|
@@ -3668,7 +3685,7 @@ class xe extends O {
|
|
|
3668
3685
|
opacity: new Mt({
|
|
3669
3686
|
default: (t == null ? void 0 : t.opacity) ?? 100
|
|
3670
3687
|
}),
|
|
3671
|
-
backgroundColor: new
|
|
3688
|
+
backgroundColor: new H({
|
|
3672
3689
|
default: (t == null ? void 0 : t.backgroundColor) ?? "0, 0, 30"
|
|
3673
3690
|
})
|
|
3674
3691
|
}
|
|
@@ -3701,7 +3718,7 @@ export {
|
|
|
3701
3718
|
Ee as BorderSettingSet,
|
|
3702
3719
|
ce as ButtonSetting,
|
|
3703
3720
|
M as ColorSetting,
|
|
3704
|
-
|
|
3721
|
+
H as ColorWithOpacitySetting,
|
|
3705
3722
|
he as DimensionSetting,
|
|
3706
3723
|
me as GapSetting,
|
|
3707
3724
|
rt as GradientSetting,
|
|
@@ -3715,9 +3732,9 @@ export {
|
|
|
3715
3732
|
I as NumberSetting,
|
|
3716
3733
|
Mt as OpacitySetting,
|
|
3717
3734
|
ue as SelectApiSettings,
|
|
3718
|
-
|
|
3735
|
+
it as SelectSetting,
|
|
3719
3736
|
b as Setting,
|
|
3720
|
-
|
|
3737
|
+
T as SettingGroup,
|
|
3721
3738
|
wt as StringSetting,
|
|
3722
3739
|
Et as TabSettingGroup,
|
|
3723
3740
|
Et as TabsSettingGroup,
|
|
@@ -3730,5 +3747,5 @@ export {
|
|
|
3730
3747
|
D as isSetting,
|
|
3731
3748
|
nt as isSettingChild,
|
|
3732
3749
|
L as isSettingGroup,
|
|
3733
|
-
|
|
3750
|
+
j as iterateSettings
|
|
3734
3751
|
};
|