builder-settings-types 0.0.263 → 0.0.264
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.
|
@@ -142,15 +142,15 @@ function pt(p) {
|
|
|
142
142
|
return "";
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
class
|
|
145
|
+
class I {
|
|
146
146
|
constructor(t = {}) {
|
|
147
147
|
this.props = t, this.dataPropsPath = "", this.id = t.id || ot(), 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, I.DefaultUploadUrl = t;
|
|
151
151
|
}
|
|
152
152
|
static SetDefaultLanguage(t) {
|
|
153
|
-
globalThis.DefaultLanguage = t,
|
|
153
|
+
globalThis.DefaultLanguage = t, I.DefaultLanguage = t;
|
|
154
154
|
}
|
|
155
155
|
destroy() {
|
|
156
156
|
throw new Error("Method not implemented.");
|
|
@@ -234,10 +234,10 @@ class S {
|
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
function j(p) {
|
|
237
|
-
return p instanceof
|
|
237
|
+
return p instanceof I;
|
|
238
238
|
}
|
|
239
239
|
function N(p) {
|
|
240
|
-
return p instanceof
|
|
240
|
+
return p instanceof z;
|
|
241
241
|
}
|
|
242
242
|
function st(p) {
|
|
243
243
|
return j(p) || N(p);
|
|
@@ -758,10 +758,10 @@ const Y = class Y {
|
|
|
758
758
|
</svg>`;
|
|
759
759
|
c.innerHTML = `${h}<span style="margin-left:4px;">${this.addItemCfg.buttonLabel ?? "Add"}</span>`, c.addEventListener("click", (d) => {
|
|
760
760
|
d.stopPropagation(), d.preventDefault();
|
|
761
|
-
const
|
|
762
|
-
if (st(
|
|
763
|
-
const
|
|
764
|
-
this.addSetting(
|
|
761
|
+
const u = this.getNextIndexFromPrefix(this.addItemCfg.keyPrefix), g = this.addItemCfg.createItem(u);
|
|
762
|
+
if (st(g)) {
|
|
763
|
+
const C = `${this.addItemCfg.keyPrefix}${u}`;
|
|
764
|
+
this.addSetting(C, g);
|
|
765
765
|
}
|
|
766
766
|
}), a.appendChild(c);
|
|
767
767
|
}
|
|
@@ -808,11 +808,11 @@ const Y = class Y {
|
|
|
808
808
|
}
|
|
809
809
|
};
|
|
810
810
|
Y.hiddenElements = /* @__PURE__ */ new Set();
|
|
811
|
-
let
|
|
811
|
+
let z = Y;
|
|
812
812
|
function zt(p) {
|
|
813
813
|
return new ut(p);
|
|
814
814
|
}
|
|
815
|
-
class ut extends
|
|
815
|
+
class ut extends z {
|
|
816
816
|
constructor(t) {
|
|
817
817
|
super(t);
|
|
818
818
|
const e = Object.keys(this.settings)[0];
|
|
@@ -864,12 +864,12 @@ class ut extends G {
|
|
|
864
864
|
}
|
|
865
865
|
}
|
|
866
866
|
function gt(p) {
|
|
867
|
-
return new
|
|
867
|
+
return new z(p);
|
|
868
868
|
}
|
|
869
869
|
function Ut(p) {
|
|
870
870
|
return p;
|
|
871
871
|
}
|
|
872
|
-
class mt extends
|
|
872
|
+
class mt extends I {
|
|
873
873
|
constructor(t = {}) {
|
|
874
874
|
super(t), this.inputType = "text", t.onChange && this.setOnChange(t.onChange);
|
|
875
875
|
}
|
|
@@ -890,17 +890,17 @@ class mt extends S {
|
|
|
890
890
|
}
|
|
891
891
|
}
|
|
892
892
|
const ft = "<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>";
|
|
893
|
-
class
|
|
893
|
+
class R extends mt {
|
|
894
894
|
constructor(t) {
|
|
895
895
|
super({
|
|
896
896
|
...t,
|
|
897
897
|
icon: t.icon || ft,
|
|
898
898
|
title: t.title || "Color",
|
|
899
|
-
default: t.default ?
|
|
899
|
+
default: t.default ? R.normalizeColorValue(t.default) : "#000000"
|
|
900
900
|
}), this.inputType = "color", this.element = null, this.colorInputEl = null, this.textInputEl = null, this.detectChange = t.detectChange;
|
|
901
901
|
}
|
|
902
902
|
static normalizeColorValue(t) {
|
|
903
|
-
return t.startsWith("#") ?
|
|
903
|
+
return t.startsWith("#") ? R.normalizeHexValue(t) : t.includes(",") ? R.rgbToHexStatic(t) : R.normalizeHexValue(t);
|
|
904
904
|
}
|
|
905
905
|
static normalizeHexValue(t) {
|
|
906
906
|
return t = t.replace("#", ""), t.length === 3 && (t = t.split("").map((e) => e + e).join("")), t.length !== 6 ? (console.warn(`Invalid hex value "${t}", using default "#000000"`), "#000000") : /^[0-9A-Fa-f]{6}$/.test(t) ? `#${t.toLowerCase()}` : (console.warn(`Invalid hex value "${t}", using default "#000000"`), "#000000");
|
|
@@ -921,7 +921,7 @@ class F extends mt {
|
|
|
921
921
|
return;
|
|
922
922
|
}
|
|
923
923
|
if (typeof t == "string") {
|
|
924
|
-
const e =
|
|
924
|
+
const e = R.normalizeColorValue(t);
|
|
925
925
|
this.value = e, this.colorInputEl && (this.colorInputEl.value = e), this.textInputEl && (this.textInputEl.value = e), this.onChange && this.onChange(e), this.props.detectChange && this.props.detectChange(e);
|
|
926
926
|
} else
|
|
927
927
|
this.value = "#000000", this.colorInputEl && (this.colorInputEl.value = "#000000"), this.textInputEl && (this.textInputEl.value = "#000000"), this.onChange && this.onChange("#000000"), this.props.detectChange && this.props.detectChange("#000000");
|
|
@@ -964,16 +964,16 @@ class F extends mt {
|
|
|
964
964
|
var c, h;
|
|
965
965
|
let r = l.target.value.trim();
|
|
966
966
|
if (this.textInputEl && i(this.textInputEl)) {
|
|
967
|
-
const d =
|
|
967
|
+
const d = R.normalizeColorValue(r);
|
|
968
968
|
this.value = d, (c = this.onChange) == null || c.call(this, d), (h = this.detectChange) == null || h.call(this, d), this.colorInputEl && (this.colorInputEl.value = d), n.style.backgroundColor = d;
|
|
969
969
|
}
|
|
970
970
|
}), this.colorInputEl.addEventListener("input", (l) => {
|
|
971
971
|
var h, d;
|
|
972
|
-
const r = l.target.value, c =
|
|
972
|
+
const r = l.target.value, c = R.normalizeColorValue(r);
|
|
973
973
|
this.value = c, (h = this.onChange) == null || h.call(this, c), (d = this.detectChange) == null || d.call(this, c), this.textInputEl && (this.textInputEl.value = c), n.style.backgroundColor = c, e.classList.remove("error");
|
|
974
974
|
}), this.colorInputEl.addEventListener("change", (l) => {
|
|
975
975
|
var h, d;
|
|
976
|
-
const r = l.target.value, c =
|
|
976
|
+
const r = l.target.value, c = R.normalizeColorValue(r);
|
|
977
977
|
this.value = c, (h = this.onChange) == null || h.call(this, c), (d = this.detectChange) == null || d.call(this, c), this.textInputEl && (this.textInputEl.value = c), n.style.backgroundColor = c;
|
|
978
978
|
}), e.appendChild(s), e.appendChild(n), e.appendChild(a), t.appendChild(e), this.element = t, t;
|
|
979
979
|
}
|
|
@@ -982,7 +982,7 @@ class F extends mt {
|
|
|
982
982
|
}
|
|
983
983
|
// Helper method to get normalized hex value
|
|
984
984
|
getNormalizedValue() {
|
|
985
|
-
return this.value ?
|
|
985
|
+
return this.value ? R.normalizeColorValue(this.value) : "#000000";
|
|
986
986
|
}
|
|
987
987
|
// Helper method to check if current value is valid hex
|
|
988
988
|
isValidHex() {
|
|
@@ -999,14 +999,14 @@ const vt = `
|
|
|
999
999
|
<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"/>
|
|
1000
1000
|
<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"/>
|
|
1001
1001
|
</svg>`;
|
|
1002
|
-
class
|
|
1002
|
+
class U extends I {
|
|
1003
1003
|
constructor(t = {}) {
|
|
1004
1004
|
super({
|
|
1005
1005
|
...t,
|
|
1006
1006
|
icon: t.icon || vt,
|
|
1007
1007
|
title: t.title || "Color & Opacity",
|
|
1008
1008
|
default: t.default || "#000000FF"
|
|
1009
|
-
}), 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 =
|
|
1009
|
+
}), 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 = U.normalizeHexWithOpacity(this.value));
|
|
1010
1010
|
}
|
|
1011
1011
|
static normalizeHexWithOpacity(t) {
|
|
1012
1012
|
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");
|
|
@@ -1024,7 +1024,7 @@ class W extends S {
|
|
|
1024
1024
|
return `#${i}${n}`;
|
|
1025
1025
|
}
|
|
1026
1026
|
setValue(t) {
|
|
1027
|
-
t === void 0 || t === "" ? this.value = "#000000FF" : this.value =
|
|
1027
|
+
t === void 0 || t === "" ? this.value = "#000000FF" : this.value = U.normalizeHexWithOpacity(t), this.updateInputElements(), this.updateColorPreview(), this.onChange && this.onChange(this.value), this.detectChange && this.detectChange(this.value);
|
|
1028
1028
|
}
|
|
1029
1029
|
updateInputElements() {
|
|
1030
1030
|
this.value && (this.colorInputEl && (this.colorInputEl.value = this.getRgbColor()), this.textInputEl && (this.textInputEl.value = this.value), this.opacityInputEl && (this.opacityInputEl.value = this.getOpacityPercent().toString()));
|
|
@@ -1035,7 +1035,7 @@ class W extends S {
|
|
|
1035
1035
|
this.colorPreviewEl.style.backgroundColor = `rgba(${s}, ${n}, ${o}, ${e})`;
|
|
1036
1036
|
}
|
|
1037
1037
|
handleColorChange(t) {
|
|
1038
|
-
const e = this.getOpacityPercent(), i =
|
|
1038
|
+
const e = this.getOpacityPercent(), i = U.combineColorOpacity(
|
|
1039
1039
|
t,
|
|
1040
1040
|
e
|
|
1041
1041
|
);
|
|
@@ -1046,7 +1046,7 @@ class W extends S {
|
|
|
1046
1046
|
return e || i ? (this.setValue(t), !0) : !1;
|
|
1047
1047
|
}
|
|
1048
1048
|
handleOpacityChange(t) {
|
|
1049
|
-
const e = this.getRgbColor(), i = Math.max(0, Math.min(100, t)), s =
|
|
1049
|
+
const e = this.getRgbColor(), i = Math.max(0, Math.min(100, t)), s = U.combineColorOpacity(
|
|
1050
1050
|
e,
|
|
1051
1051
|
i
|
|
1052
1052
|
);
|
|
@@ -1121,7 +1121,7 @@ class W extends S {
|
|
|
1121
1121
|
};
|
|
1122
1122
|
}
|
|
1123
1123
|
}
|
|
1124
|
-
class jt extends
|
|
1124
|
+
class jt extends I {
|
|
1125
1125
|
constructor(t = {}) {
|
|
1126
1126
|
super(t), this.inputType = "text", t.onChange && this.setOnChange(t.onChange);
|
|
1127
1127
|
}
|
|
@@ -1153,7 +1153,7 @@ class jt extends S {
|
|
|
1153
1153
|
return e.addEventListener("input", i), e.addEventListener("change", i), e.addEventListener("blur", s), t.appendChild(e), t;
|
|
1154
1154
|
}
|
|
1155
1155
|
}
|
|
1156
|
-
class
|
|
1156
|
+
class G extends I {
|
|
1157
1157
|
constructor(t) {
|
|
1158
1158
|
super(t), this.inputType = "number", this.inputElement = null, this.mobileValue = t.mobile, this.validateProps(), this.value = this.validateValue(this.value);
|
|
1159
1159
|
}
|
|
@@ -1217,7 +1217,7 @@ const Ct = `
|
|
|
1217
1217
|
<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"/>
|
|
1218
1218
|
<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"/>
|
|
1219
1219
|
</svg>`;
|
|
1220
|
-
class
|
|
1220
|
+
class Et extends G {
|
|
1221
1221
|
constructor(t = {}) {
|
|
1222
1222
|
const e = {
|
|
1223
1223
|
title: "Opacity",
|
|
@@ -1238,12 +1238,12 @@ class yt extends D {
|
|
|
1238
1238
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
1239
1239
|
}
|
|
1240
1240
|
}
|
|
1241
|
-
const
|
|
1241
|
+
const yt = `
|
|
1242
1242
|
<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">
|
|
1243
1243
|
<polyline points="6 9 12 15 18 9"></polyline>
|
|
1244
1244
|
</svg>
|
|
1245
1245
|
`;
|
|
1246
|
-
class et extends
|
|
1246
|
+
class et extends I {
|
|
1247
1247
|
constructor(t = {}) {
|
|
1248
1248
|
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) {
|
|
1249
1249
|
const e = this._options.findIndex((i) => i.value === this.value);
|
|
@@ -1287,7 +1287,7 @@ class et extends S {
|
|
|
1287
1287
|
a.onclick = (l) => this.selectOption(l, o, e), i.appendChild(a);
|
|
1288
1288
|
}), document.body.appendChild(i);
|
|
1289
1289
|
const s = document.createElement("div");
|
|
1290
|
-
return s.classList.add("svg-container"), s.innerHTML =
|
|
1290
|
+
return s.classList.add("svg-container"), s.innerHTML = yt, t.appendChild(s), this.optionsListEl = i, this.svgContainer = s, this.props.getOptionsAsync && (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((n) => {
|
|
1291
1291
|
this._options.push(...n), this.isLoading = !1, this.updateOptionsList(), this.updateButtonText();
|
|
1292
1292
|
}).catch((n) => {
|
|
1293
1293
|
console.error("Failed to fetch async options:", n), this.isLoading = !1, this.updateButtonText("Failed to load options");
|
|
@@ -1356,7 +1356,7 @@ class et extends S {
|
|
|
1356
1356
|
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();
|
|
1357
1357
|
}
|
|
1358
1358
|
}
|
|
1359
|
-
class bt extends
|
|
1359
|
+
class bt extends I {
|
|
1360
1360
|
constructor(t = {}) {
|
|
1361
1361
|
super(t), this.inputType = "button", this.value || (this.value = "center");
|
|
1362
1362
|
}
|
|
@@ -1412,7 +1412,7 @@ class bt extends S {
|
|
|
1412
1412
|
}), t.appendChild(i), t;
|
|
1413
1413
|
}
|
|
1414
1414
|
}
|
|
1415
|
-
class _t extends
|
|
1415
|
+
class _t extends I {
|
|
1416
1416
|
constructor(t) {
|
|
1417
1417
|
super(t), this.inputType = "button", this.bgWithAlpha = "rgba(145, 158, 171, 0.08)";
|
|
1418
1418
|
}
|
|
@@ -1441,21 +1441,21 @@ class _t extends S {
|
|
|
1441
1441
|
return o.className = "button-setting-wrapper " + (this.props.wrapperClassName || ""), o.appendChild(t), o;
|
|
1442
1442
|
}
|
|
1443
1443
|
}
|
|
1444
|
-
class qt extends
|
|
1444
|
+
class qt extends I {
|
|
1445
1445
|
constructor(t = {}) {
|
|
1446
1446
|
super(t), this.inputType = { width: "number", height: "number" }, this.aspectRatio = 1, this.isUpdating = !1;
|
|
1447
1447
|
const e = t.width || 0, i = t.height || 0;
|
|
1448
1448
|
this.value || (this.value = {
|
|
1449
1449
|
width: e,
|
|
1450
1450
|
height: i
|
|
1451
|
-
}), this.minWidth = t.minWidth ?? 0, this.maxWidth = t.maxWidth, this.minHeight = t.minHeight ?? 0, this.maxHeight = t.maxHeight, this.locked = t.locked ?? !1, this.value.height > 0 && (this.aspectRatio = this.value.width / this.value.height), this.widthSetting = new
|
|
1451
|
+
}), this.minWidth = t.minWidth ?? 0, this.maxWidth = t.maxWidth, this.minHeight = t.minHeight ?? 0, this.maxHeight = t.maxHeight, this.locked = t.locked ?? !1, this.value.height > 0 && (this.aspectRatio = this.value.width / this.value.height), this.widthSetting = new G({
|
|
1452
1452
|
title: "Width",
|
|
1453
1453
|
default: this.value.width,
|
|
1454
1454
|
suffix: "px",
|
|
1455
1455
|
minValue: this.minWidth,
|
|
1456
1456
|
maxValue: this.maxWidth,
|
|
1457
1457
|
icon: wt
|
|
1458
|
-
}), this.heightSetting = new
|
|
1458
|
+
}), this.heightSetting = new G({
|
|
1459
1459
|
title: "Height",
|
|
1460
1460
|
default: this.value.height,
|
|
1461
1461
|
suffix: "px",
|
|
@@ -1592,7 +1592,7 @@ const wt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewB
|
|
|
1592
1592
|
<circle cx="6.7" cy="6.7" r="1.5" fill="#02CC59" opacity="0.3"/>
|
|
1593
1593
|
</svg>
|
|
1594
1594
|
`;
|
|
1595
|
-
class at extends
|
|
1595
|
+
class at extends I {
|
|
1596
1596
|
constructor(t = {}) {
|
|
1597
1597
|
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();
|
|
1598
1598
|
}
|
|
@@ -1712,7 +1712,7 @@ class at extends S {
|
|
|
1712
1712
|
}, t;
|
|
1713
1713
|
}
|
|
1714
1714
|
}
|
|
1715
|
-
class Jt extends
|
|
1715
|
+
class Jt extends G {
|
|
1716
1716
|
constructor(t = {}) {
|
|
1717
1717
|
super({
|
|
1718
1718
|
...t,
|
|
@@ -1733,7 +1733,7 @@ class Jt extends D {
|
|
|
1733
1733
|
const St = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1734
1734
|
<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"/>
|
|
1735
1735
|
</svg>`;
|
|
1736
|
-
class Zt extends
|
|
1736
|
+
class Zt extends G {
|
|
1737
1737
|
constructor(t = {}) {
|
|
1738
1738
|
super({
|
|
1739
1739
|
...t,
|
|
@@ -1758,7 +1758,7 @@ const It = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewB
|
|
|
1758
1758
|
<polyline points="6 9 12 15 18 9"></polyline>
|
|
1759
1759
|
</svg>
|
|
1760
1760
|
`;
|
|
1761
|
-
class Xt extends
|
|
1761
|
+
class Xt extends I {
|
|
1762
1762
|
constructor(t = {}) {
|
|
1763
1763
|
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) {
|
|
1764
1764
|
const e = this._options.findIndex(
|
|
@@ -1905,7 +1905,7 @@ class Xt extends S {
|
|
|
1905
1905
|
), this.updateButtonText();
|
|
1906
1906
|
}
|
|
1907
1907
|
}
|
|
1908
|
-
class Yt extends
|
|
1908
|
+
class Yt extends I {
|
|
1909
1909
|
constructor(t) {
|
|
1910
1910
|
var e, i;
|
|
1911
1911
|
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;
|
|
@@ -1958,7 +1958,7 @@ class Yt extends S {
|
|
|
1958
1958
|
const Vt = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1959
1959
|
<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"/>
|
|
1960
1960
|
</svg>`;
|
|
1961
|
-
class Kt extends
|
|
1961
|
+
class Kt extends I {
|
|
1962
1962
|
// Store mobile value
|
|
1963
1963
|
constructor(t = {}) {
|
|
1964
1964
|
t.rowGap = t.rowGap ?? !0, t.columnGap = t.columnGap ?? !0, t.title = t.title ?? "Gap", t.icon = t.icon ?? Vt, 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);
|
|
@@ -2012,42 +2012,42 @@ class Kt extends S {
|
|
|
2012
2012
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
2013
2013
|
}
|
|
2014
2014
|
}
|
|
2015
|
-
const
|
|
2015
|
+
const Tt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2016
2016
|
<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"/>
|
|
2017
2017
|
</svg>`;
|
|
2018
|
-
class Qt extends
|
|
2018
|
+
class Qt extends G {
|
|
2019
2019
|
constructor(t = {}) {
|
|
2020
2020
|
super({
|
|
2021
2021
|
...t,
|
|
2022
2022
|
minValue: t.minValue ?? 0,
|
|
2023
2023
|
maxValue: t.maxValue ?? 1e3,
|
|
2024
|
-
icon: t.icon ||
|
|
2024
|
+
icon: t.icon || Tt,
|
|
2025
2025
|
title: t.title || "Margin Bottom",
|
|
2026
2026
|
default: t.default ?? 20,
|
|
2027
2027
|
wrapperClassName: "margin-bottom-wrapper " + (t.wrapperClassName || "")
|
|
2028
2028
|
}), this.inputType = "number";
|
|
2029
2029
|
}
|
|
2030
2030
|
}
|
|
2031
|
-
const
|
|
2031
|
+
const Ht = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
2032
2032
|
<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"
|
|
2033
2033
|
stroke="#667085" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2034
2034
|
</svg>`;
|
|
2035
|
-
class te extends
|
|
2035
|
+
class te extends G {
|
|
2036
2036
|
constructor(t = {}) {
|
|
2037
2037
|
super({
|
|
2038
2038
|
...t,
|
|
2039
2039
|
minValue: t.minValue ?? 0,
|
|
2040
2040
|
maxValue: t.maxValue ?? 1e3,
|
|
2041
|
-
icon: t.icon ||
|
|
2041
|
+
icon: t.icon || Ht,
|
|
2042
2042
|
title: t.title || "Margin Top",
|
|
2043
2043
|
default: t.default ?? 20,
|
|
2044
2044
|
wrapperClassName: "margin-top-wrapper " + (t.wrapperClassName || "")
|
|
2045
2045
|
}), this.inputType = "number";
|
|
2046
2046
|
}
|
|
2047
2047
|
}
|
|
2048
|
-
class ee extends
|
|
2048
|
+
class ee extends I {
|
|
2049
2049
|
constructor(t) {
|
|
2050
|
-
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(
|
|
2050
|
+
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(I.DefaultLanguage) ? I.DefaultLanguage : t.languages[0];
|
|
2051
2051
|
const e = t.defaultValue || `Enter text in ${this.capitalizeFirstLetter(this.defaultLanguage)}`;
|
|
2052
2052
|
t.languages.forEach((i) => {
|
|
2053
2053
|
var s, n;
|
|
@@ -2078,13 +2078,13 @@ class ee extends S {
|
|
|
2078
2078
|
return;
|
|
2079
2079
|
}
|
|
2080
2080
|
const c = "...";
|
|
2081
|
-
let h = 0, d = e.length,
|
|
2081
|
+
let h = 0, d = e.length, u = 0;
|
|
2082
2082
|
for (; h <= d; ) {
|
|
2083
|
-
const
|
|
2084
|
-
this.measureTextWidth(
|
|
2083
|
+
const C = Math.floor((h + d) / 2), m = e.slice(0, C).trimEnd() + c;
|
|
2084
|
+
this.measureTextWidth(m, i) <= l ? (u = C, h = C + 1) : d = C - 1;
|
|
2085
2085
|
}
|
|
2086
|
-
const
|
|
2087
|
-
t.placeholder =
|
|
2086
|
+
const g = e.slice(0, u).trimEnd() + c;
|
|
2087
|
+
t.placeholder = g;
|
|
2088
2088
|
}
|
|
2089
2089
|
autosizeTextarea(t, e = 3) {
|
|
2090
2090
|
t.style.height = "auto";
|
|
@@ -2192,7 +2192,7 @@ class ee extends S {
|
|
|
2192
2192
|
});
|
|
2193
2193
|
}
|
|
2194
2194
|
}
|
|
2195
|
-
class ie extends
|
|
2195
|
+
class ie extends I {
|
|
2196
2196
|
constructor(t = {}) {
|
|
2197
2197
|
super(t), this.inputType = "select";
|
|
2198
2198
|
const e = [
|
|
@@ -2235,75 +2235,82 @@ const lt = `<svg
|
|
|
2235
2235
|
</svg>`;
|
|
2236
2236
|
function nt(p) {
|
|
2237
2237
|
try {
|
|
2238
|
-
const t = p.match(/linear-gradient\(
|
|
2238
|
+
const t = p.match(/linear-gradient\s*\(/);
|
|
2239
2239
|
if (t) {
|
|
2240
|
-
const e = t[
|
|
2241
|
-
let i =
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
const
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
if (c.includes("deg") || c.includes("to ")) continue;
|
|
2255
|
-
let h = "", d = 0, m = 100;
|
|
2256
|
-
const u = c.match(/rgba?\(([^)]+)\)(?:\s*(\d+)%)?/);
|
|
2257
|
-
if (u) {
|
|
2258
|
-
const g = u[1].split(",").map((V) => V.trim()), f = parseInt(g[0]), y = parseInt(g[1]), v = parseInt(g[2]), w = g[3] ? parseFloat(g[3]) : 1;
|
|
2259
|
-
h = `#${f.toString(16).padStart(2, "0")}${y.toString(16).padStart(2, "0")}${v.toString(16).padStart(2, "0")}`, m = Math.round(w * 100), u[2] ? d = parseInt(u[2]) : d = Math.round(r / Math.max(n.length - 2, 1) * 100);
|
|
2260
|
-
} else {
|
|
2261
|
-
const g = c.match(/#([a-fA-F0-9]{3,8})(?:\s*(\d+)%)?/);
|
|
2262
|
-
g && (h = `#${g[1]}`, g[2] ? d = parseInt(g[2]) : d = Math.round(r / Math.max(n.length - 2, 1) * 100));
|
|
2240
|
+
const e = t.index + t[0].length;
|
|
2241
|
+
let i = 1, s = e;
|
|
2242
|
+
for (let n = e; n < p.length && i > 0; n++)
|
|
2243
|
+
p[n] === "(" ? i++ : p[n] === ")" && i--, s = n;
|
|
2244
|
+
if (i === 0) {
|
|
2245
|
+
const n = p.substring(e, s).trim();
|
|
2246
|
+
let o = 90;
|
|
2247
|
+
const a = n.match(/(\d+)deg/);
|
|
2248
|
+
a ? o = parseInt(a[1]) : n.includes("to right") ? o = 90 : n.includes("to left") ? o = 270 : n.includes("to top") ? o = 0 : n.includes("to bottom") ? o = 180 : n.includes("to top right") ? o = 45 : n.includes("to top left") ? o = 315 : n.includes("to bottom right") ? o = 135 : n.includes("to bottom left") && (o = 225);
|
|
2249
|
+
const l = [];
|
|
2250
|
+
let r = "", c = 0;
|
|
2251
|
+
for (let u = 0; u < n.length; u++) {
|
|
2252
|
+
const g = n[u];
|
|
2253
|
+
g === "(" && c++, g === ")" && c--, g === "," && c === 0 ? (l.push(r.trim()), r = "") : r += g;
|
|
2263
2254
|
}
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
if (u) {
|
|
2284
|
-
const g = u[1].split(",").map((V) => V.trim()), f = parseInt(g[0]), y = parseInt(g[1]), v = parseInt(g[2]), w = g[3] ? parseFloat(g[3]) : 1;
|
|
2285
|
-
d = `#${f.toString(16).padStart(2, "0")}${y.toString(16).padStart(2, "0")}${v.toString(16).padStart(2, "0")}`, m = Math.round(w * 100);
|
|
2286
|
-
}
|
|
2287
|
-
}
|
|
2288
|
-
if (d) {
|
|
2289
|
-
const u = Math.round(
|
|
2290
|
-
h / Math.max(r.length - 1, 1) * 100
|
|
2255
|
+
r.trim() && l.push(r.trim());
|
|
2256
|
+
const h = [];
|
|
2257
|
+
let d = [];
|
|
2258
|
+
for (let u = 0; u < l.length; u++) {
|
|
2259
|
+
const g = l[u];
|
|
2260
|
+
g.includes("deg") || g.includes("to ") || d.push(g);
|
|
2261
|
+
}
|
|
2262
|
+
for (let u = 0; u < d.length; u++) {
|
|
2263
|
+
const g = d[u];
|
|
2264
|
+
let C = "", m = 0, E = 100;
|
|
2265
|
+
const f = g.match(
|
|
2266
|
+
/rgba?\(([^)]+)\)(?:\s*(\d+(?:\.\d+)?)%)?/
|
|
2267
|
+
);
|
|
2268
|
+
if (f) {
|
|
2269
|
+
const y = f[1].split(",").map((b) => b.trim()), V = parseInt(y[0]), A = parseInt(y[1]), B = parseInt(y[2]), L = y[3] ? parseFloat(y[3]) : 1;
|
|
2270
|
+
C = `#${V.toString(16).padStart(2, "0")}${A.toString(16).padStart(2, "0")}${B.toString(16).padStart(2, "0")}`, E = Math.round(L * 100), f[2] ? m = parseFloat(f[2]) : m = d.length === 1 ? 0 : Math.round(u / (d.length - 1) * 100);
|
|
2271
|
+
} else {
|
|
2272
|
+
const y = g.match(
|
|
2273
|
+
/#([a-fA-F0-9]{3,8})(?:\s*(\d+(?:\.\d+)?)%)?/
|
|
2291
2274
|
);
|
|
2292
|
-
|
|
2293
|
-
`Auto-positioned stop: ${d} at ${u}% with ${m}% opacity`
|
|
2294
|
-
), l.push({
|
|
2295
|
-
color: d,
|
|
2296
|
-
position: u,
|
|
2297
|
-
opacity: m
|
|
2298
|
-
});
|
|
2275
|
+
y && (C = `#${y[1]}`, y[2] ? m = parseFloat(y[2]) : m = d.length === 1 ? 0 : Math.round(u / (d.length - 1) * 100));
|
|
2299
2276
|
}
|
|
2300
|
-
|
|
2277
|
+
C && h.push({
|
|
2278
|
+
color: C,
|
|
2279
|
+
position: m,
|
|
2280
|
+
opacity: E
|
|
2281
|
+
});
|
|
2282
|
+
}
|
|
2283
|
+
if (h.length === 0) {
|
|
2284
|
+
const u = n.match(
|
|
2285
|
+
/(#[a-fA-F0-9]{3,8}|rgba?\([^)]+\))/g
|
|
2286
|
+
);
|
|
2287
|
+
u && u.forEach((g, C) => {
|
|
2288
|
+
let m = "", E = 100;
|
|
2289
|
+
if (g.startsWith("#"))
|
|
2290
|
+
m = g;
|
|
2291
|
+
else {
|
|
2292
|
+
const f = g.match(/rgba?\(([^)]+)\)/);
|
|
2293
|
+
if (f) {
|
|
2294
|
+
const y = f[1].split(",").map((b) => b.trim()), V = parseInt(y[0]), A = parseInt(y[1]), B = parseInt(y[2]), L = y[3] ? parseFloat(y[3]) : 1;
|
|
2295
|
+
m = `#${V.toString(16).padStart(2, "0")}${A.toString(16).padStart(2, "0")}${B.toString(16).padStart(2, "0")}`, E = Math.round(L * 100);
|
|
2296
|
+
}
|
|
2297
|
+
}
|
|
2298
|
+
if (m) {
|
|
2299
|
+
const f = u.length === 1 ? 0 : Math.round(C / (u.length - 1) * 100);
|
|
2300
|
+
h.push({
|
|
2301
|
+
color: m,
|
|
2302
|
+
position: f,
|
|
2303
|
+
opacity: E
|
|
2304
|
+
});
|
|
2305
|
+
}
|
|
2306
|
+
});
|
|
2307
|
+
}
|
|
2308
|
+
return console.log("Color stops found:", h), {
|
|
2309
|
+
type: "linear",
|
|
2310
|
+
angle: o,
|
|
2311
|
+
stops: h
|
|
2312
|
+
};
|
|
2301
2313
|
}
|
|
2302
|
-
return {
|
|
2303
|
-
type: "linear",
|
|
2304
|
-
angle: i,
|
|
2305
|
-
stops: l
|
|
2306
|
-
};
|
|
2307
2314
|
}
|
|
2308
2315
|
return null;
|
|
2309
2316
|
} catch (t) {
|
|
@@ -2344,23 +2351,23 @@ class Pt {
|
|
|
2344
2351
|
h.className = "color-picker-opacity", this.opacitySlider = h;
|
|
2345
2352
|
const d = document.createElement("div");
|
|
2346
2353
|
d.className = "color-picker-opacity-marker", this.opacityMarker = d, h.appendChild(d);
|
|
2347
|
-
const
|
|
2348
|
-
|
|
2349
|
-
const
|
|
2350
|
-
|
|
2351
|
-
const
|
|
2352
|
-
|
|
2353
|
-
const
|
|
2354
|
-
|
|
2355
|
-
const
|
|
2356
|
-
|
|
2357
|
-
const
|
|
2358
|
-
|
|
2359
|
-
const
|
|
2360
|
-
|
|
2354
|
+
const u = document.createElement("div");
|
|
2355
|
+
u.className = "color-picker-format-section";
|
|
2356
|
+
const g = document.createElement("select");
|
|
2357
|
+
g.className = "color-picker-format-select", this.formatSelect = g;
|
|
2358
|
+
const C = document.createElement("option");
|
|
2359
|
+
C.value = "hex", C.textContent = "HEX";
|
|
2360
|
+
const m = document.createElement("option");
|
|
2361
|
+
m.value = "rgb", m.textContent = "RGB";
|
|
2362
|
+
const E = document.createElement("option");
|
|
2363
|
+
E.value = "hsl", E.textContent = "HSL", g.appendChild(C), g.appendChild(m), g.appendChild(E);
|
|
2364
|
+
const f = document.createElement("input");
|
|
2365
|
+
f.type = "text", f.className = "color-picker-color-input", f.value = this.currentColor, this.hexInput = f;
|
|
2366
|
+
const y = document.createElement("div");
|
|
2367
|
+
y.className = "color-picker-input-container";
|
|
2361
2368
|
const V = document.createElement("button");
|
|
2362
|
-
return V.className = "color-picker-copy-inside", V.textContent = "Copy", V.addEventListener("click", () => this.copyToClipboard()),
|
|
2363
|
-
|
|
2369
|
+
return V.className = "color-picker-copy-inside", V.textContent = "Copy", V.addEventListener("click", () => this.copyToClipboard()), y.appendChild(f), y.appendChild(V), u.appendChild(g), u.appendChild(y), t.appendChild(e), t.appendChild(n), t.appendChild(a), t.appendChild(h), t.appendChild(u), this.setupEyedropper(l), this.setupEventListeners(), t.addEventListener("click", (A) => {
|
|
2370
|
+
A.stopPropagation();
|
|
2364
2371
|
}), t;
|
|
2365
2372
|
}
|
|
2366
2373
|
setupEventListeners() {
|
|
@@ -2400,11 +2407,7 @@ class Pt {
|
|
|
2400
2407
|
this.isUpdatingHue = !0;
|
|
2401
2408
|
const e = this.hueSlider.getBoundingClientRect();
|
|
2402
2409
|
let i = (t.clientX - e.left) / e.width;
|
|
2403
|
-
i = Math.max(2e-3, Math.min(0.996, i)),
|
|
2404
|
-
x: i,
|
|
2405
|
-
hueValue: i * 360,
|
|
2406
|
-
percent: i * 100
|
|
2407
|
-
}), this.hueMarker.style.left = `${i * 100}%`;
|
|
2410
|
+
i = Math.max(2e-3, Math.min(0.996, i)), this.hueMarker.style.left = `${i * 100}%`;
|
|
2408
2411
|
const s = i * 360;
|
|
2409
2412
|
this.updateHue(s), this.isUpdatingHue = !1;
|
|
2410
2413
|
}
|
|
@@ -2413,16 +2416,15 @@ class Pt {
|
|
|
2413
2416
|
this.setColor(s);
|
|
2414
2417
|
}
|
|
2415
2418
|
updateHue(t) {
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
const i = parseFloat(this.colorMarker.style.left || "50%") / 100, s = parseFloat(this.colorMarker.style.top || "50%") / 100;
|
|
2419
|
+
t = Math.max(0.5, Math.min(358.5, t)), this.colorArea.getBoundingClientRect();
|
|
2420
|
+
const e = parseFloat(this.colorMarker.style.left || "50%") / 100, i = parseFloat(this.colorMarker.style.top || "50%") / 100;
|
|
2419
2421
|
this.colorArea.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${t}, 100%, 50%))`;
|
|
2420
|
-
const
|
|
2421
|
-
this.setColor(
|
|
2422
|
+
const s = e, n = 1 - i, o = this.hsvToHex(t, s, n);
|
|
2423
|
+
this.setColor(o);
|
|
2422
2424
|
}
|
|
2423
2425
|
getCurrentHue() {
|
|
2424
|
-
const
|
|
2425
|
-
return
|
|
2426
|
+
const e = parseFloat(this.hueMarker.style.left || "0%") / 100 * 360;
|
|
2427
|
+
return Math.max(0.5, Math.min(358.5, e));
|
|
2426
2428
|
}
|
|
2427
2429
|
updateColorInput() {
|
|
2428
2430
|
const t = this.formatSelect.value, { h: e, s: i, v: s } = this.hexToHsv(this.currentColor);
|
|
@@ -2490,7 +2492,7 @@ class Pt {
|
|
|
2490
2492
|
return /^#[0-9A-Fa-f]{6}$/.test(t);
|
|
2491
2493
|
}
|
|
2492
2494
|
hsvToHex(t, e, i) {
|
|
2493
|
-
t = Math.max(0, Math.min(359.9, t)), e = Math.max(0, Math.min(1, e)), i = Math.max(0, Math.min(1, i))
|
|
2495
|
+
t = Math.max(0, Math.min(359.9, t)), e = Math.max(0, Math.min(1, e)), i = Math.max(0, Math.min(1, i));
|
|
2494
2496
|
const s = i * e, n = s * (1 - Math.abs(t / 60 % 2 - 1)), o = i - s;
|
|
2495
2497
|
let a = 0, l = 0, r = 0;
|
|
2496
2498
|
return t < 60 ? (a = s, l = n, r = 0) : t < 120 ? (a = n, l = s, r = 0) : t < 180 ? (a = 0, l = s, r = n) : t < 240 ? (a = 0, l = n, r = s) : t < 300 ? (a = n, l = 0, r = s) : (a = s, l = 0, r = n), a = Math.round((a + o) * 255), l = Math.round((l + o) * 255), r = Math.round((r + o) * 255), `#${a.toString(16).padStart(2, "0")}${l.toString(16).padStart(2, "0")}${r.toString(16).padStart(2, "0")}`;
|
|
@@ -2560,10 +2562,10 @@ class Pt {
|
|
|
2560
2562
|
}, r = (h) => {
|
|
2561
2563
|
if (!i) return;
|
|
2562
2564
|
h.preventDefault(), h.stopPropagation();
|
|
2563
|
-
const d = h.clientX - s,
|
|
2564
|
-
let
|
|
2565
|
-
const
|
|
2566
|
-
|
|
2565
|
+
const d = h.clientX - s, u = h.clientY - n;
|
|
2566
|
+
let g = o + d, C = a + u;
|
|
2567
|
+
const m = window.innerWidth, E = window.innerHeight, f = e.offsetWidth, y = e.offsetHeight;
|
|
2568
|
+
g = Math.max(8, Math.min(m - f - 8, g)), C = Math.max(8, Math.min(E - y - 8, C)), e.style.left = `${g}px`, e.style.top = `${C}px`;
|
|
2567
2569
|
}, c = (h) => {
|
|
2568
2570
|
i && (i = !1, h.preventDefault(), h.stopPropagation(), e.classList.remove("dragging"), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", c), document.body.style.userSelect = "");
|
|
2569
2571
|
};
|
|
@@ -2576,7 +2578,7 @@ class Pt {
|
|
|
2576
2578
|
return this.element;
|
|
2577
2579
|
}
|
|
2578
2580
|
}
|
|
2579
|
-
class se extends
|
|
2581
|
+
class se extends I {
|
|
2580
2582
|
constructor(t = {}) {
|
|
2581
2583
|
let e;
|
|
2582
2584
|
if (typeof t.default == "string")
|
|
@@ -2609,7 +2611,10 @@ class se extends S {
|
|
|
2609
2611
|
{ color: "#786666", position: 100, opacity: 100 }
|
|
2610
2612
|
]
|
|
2611
2613
|
};
|
|
2612
|
-
|
|
2614
|
+
(!e.stops || e.stops.length === 0) && (e.stops = [
|
|
2615
|
+
{ color: "#a84b4b", position: 0, opacity: 100 },
|
|
2616
|
+
{ color: "#786666", position: 100, opacity: 100 }
|
|
2617
|
+
]), super({
|
|
2613
2618
|
...t,
|
|
2614
2619
|
title: t.title || "Gradient",
|
|
2615
2620
|
default: e
|
|
@@ -2628,26 +2633,12 @@ class se extends S {
|
|
|
2628
2633
|
}
|
|
2629
2634
|
// Safe getter for the value property
|
|
2630
2635
|
getSafeValue() {
|
|
2631
|
-
return !this.value || !this.isValidGradientValue(this.value) ? (console.warn("Invalid value detected, returning default:", this.value),
|
|
2632
|
-
type: "linear",
|
|
2633
|
-
angle: 90,
|
|
2634
|
-
stops: [
|
|
2635
|
-
{ color: "#a84b4b", position: 0, opacity: 100 },
|
|
2636
|
-
{ color: "#786666", position: 100, opacity: 100 }
|
|
2637
|
-
]
|
|
2638
|
-
}) : this.value;
|
|
2636
|
+
return !this.value || !this.isValidGradientValue(this.value) ? (console.warn("Invalid value detected, returning default:", this.value), this.getDefaultGradientValue()) : this.value;
|
|
2639
2637
|
}
|
|
2640
2638
|
setValue(t) {
|
|
2641
2639
|
let e;
|
|
2642
2640
|
if (!t)
|
|
2643
|
-
console.warn("Undefined value in setValue, using default"), e =
|
|
2644
|
-
type: "linear",
|
|
2645
|
-
angle: 90,
|
|
2646
|
-
stops: [
|
|
2647
|
-
{ color: "#a84b4b", position: 0, opacity: 100 },
|
|
2648
|
-
{ color: "#786666", position: 100, opacity: 100 }
|
|
2649
|
-
]
|
|
2650
|
-
};
|
|
2641
|
+
console.warn("Undefined value in setValue, using default"), e = this.getDefaultGradientValue();
|
|
2651
2642
|
else if (typeof t == "string")
|
|
2652
2643
|
if (t.match(/^#[a-fA-F0-9]{3,8}$/)) {
|
|
2653
2644
|
let i = t, s = 100;
|
|
@@ -2662,17 +2653,10 @@ class se extends S {
|
|
|
2662
2653
|
};
|
|
2663
2654
|
} else {
|
|
2664
2655
|
const i = nt(t);
|
|
2665
|
-
i ? e = i : (console.warn(
|
|
2656
|
+
i && this.isValidGradientValue(i) ? e = i : (console.warn(
|
|
2666
2657
|
"Failed to parse string value, using default:",
|
|
2667
2658
|
t
|
|
2668
|
-
), e =
|
|
2669
|
-
type: "linear",
|
|
2670
|
-
angle: 90,
|
|
2671
|
-
stops: [
|
|
2672
|
-
{ color: "#a84b4b", position: 0, opacity: 100 },
|
|
2673
|
-
{ color: "#786666", position: 100, opacity: 100 }
|
|
2674
|
-
]
|
|
2675
|
-
});
|
|
2659
|
+
), e = this.getDefaultGradientValue());
|
|
2676
2660
|
}
|
|
2677
2661
|
else if (typeof t == "object" && t.background) {
|
|
2678
2662
|
console.warn(
|
|
@@ -2684,28 +2668,27 @@ class se extends S {
|
|
|
2684
2668
|
this.setValue(i);
|
|
2685
2669
|
return;
|
|
2686
2670
|
} else
|
|
2687
|
-
e =
|
|
2688
|
-
|
|
2689
|
-
angle: 90,
|
|
2690
|
-
stops: [
|
|
2691
|
-
{ color: "#a84b4b", position: 0, opacity: 100 },
|
|
2692
|
-
{ color: "#786666", position: 100, opacity: 100 }
|
|
2693
|
-
]
|
|
2694
|
-
};
|
|
2695
|
-
} else this.isValidGradientValue(t) ? (e = t, e.stops && e.stops.forEach((i) => {
|
|
2671
|
+
e = this.getDefaultGradientValue();
|
|
2672
|
+
} else this.isValidGradientValue(t) ? (e = t, e.stops && e.stops.length > 0 ? e.stops.forEach((i) => {
|
|
2696
2673
|
i.opacity === void 0 && (i.opacity = 100);
|
|
2697
|
-
})
|
|
2674
|
+
}) : e.stops = [
|
|
2675
|
+
{ color: "#a84b4b", position: 0, opacity: 100 },
|
|
2676
|
+
{ color: "#786666", position: 100, opacity: 100 }
|
|
2677
|
+
]) : (console.warn(
|
|
2698
2678
|
"Invalid gradient value in setValue, using default:",
|
|
2699
2679
|
t
|
|
2700
|
-
), e =
|
|
2680
|
+
), e = this.getDefaultGradientValue());
|
|
2681
|
+
super.setValue(e), this.updateUI(), this.isPopoverOpen && this.refreshPopoverContent();
|
|
2682
|
+
}
|
|
2683
|
+
getDefaultGradientValue() {
|
|
2684
|
+
return this.props && this.props.default && this.isValidGradientValue(this.props.default) ? this.props.default : {
|
|
2701
2685
|
type: "linear",
|
|
2702
2686
|
angle: 90,
|
|
2703
2687
|
stops: [
|
|
2704
2688
|
{ color: "#a84b4b", position: 0, opacity: 100 },
|
|
2705
2689
|
{ color: "#786666", position: 100, opacity: 100 }
|
|
2706
2690
|
]
|
|
2707
|
-
}
|
|
2708
|
-
super.setValue(e), this.updateUI(), this.isPopoverOpen && this.refreshPopoverContent();
|
|
2691
|
+
};
|
|
2709
2692
|
}
|
|
2710
2693
|
updateUI() {
|
|
2711
2694
|
if (this.previewElement && this.value)
|
|
@@ -2884,8 +2867,8 @@ class se extends S {
|
|
|
2884
2867
|
const i = ((l = (a = (o = this.value) == null ? void 0 : o.stops) == null ? void 0 : a[0]) == null ? void 0 : l.color) || "#000000", s = ((h = (c = (r = this.value) == null ? void 0 : r.stops) == null ? void 0 : c[0]) == null ? void 0 : h.opacity) || 100, n = this.createEmbeddedColorPickerWithOpacity(
|
|
2885
2868
|
i,
|
|
2886
2869
|
s,
|
|
2887
|
-
(d,
|
|
2888
|
-
this.value && (!this.value.stops || this.value.stops.length === 0 ? this.value.stops = [{ color: d, position: 0, opacity:
|
|
2870
|
+
(d, u) => {
|
|
2871
|
+
this.value && (!this.value.stops || this.value.stops.length === 0 ? this.value.stops = [{ color: d, position: 0, opacity: u }] : (this.value.stops[0].color = d, this.value.stops[0].opacity = u), this.updateUI(), this.triggerChange());
|
|
2889
2872
|
}
|
|
2890
2873
|
);
|
|
2891
2874
|
e.appendChild(n), t.appendChild(e);
|
|
@@ -2911,28 +2894,28 @@ class se extends S {
|
|
|
2911
2894
|
h.className = "color-picker-opacity embedded";
|
|
2912
2895
|
const d = document.createElement("div");
|
|
2913
2896
|
d.className = "color-picker-opacity-marker", h.appendChild(d);
|
|
2914
|
-
const
|
|
2915
|
-
|
|
2916
|
-
const
|
|
2917
|
-
|
|
2918
|
-
const
|
|
2919
|
-
|
|
2920
|
-
const
|
|
2921
|
-
|
|
2922
|
-
const
|
|
2923
|
-
|
|
2924
|
-
const
|
|
2925
|
-
|
|
2926
|
-
const
|
|
2927
|
-
|
|
2897
|
+
const u = document.createElement("div");
|
|
2898
|
+
u.className = "color-picker-format-section embedded";
|
|
2899
|
+
const g = document.createElement("select");
|
|
2900
|
+
g.className = "color-picker-format-select";
|
|
2901
|
+
const C = document.createElement("option");
|
|
2902
|
+
C.value = "hex", C.textContent = "HEX";
|
|
2903
|
+
const m = document.createElement("option");
|
|
2904
|
+
m.value = "rgb", m.textContent = "RGB";
|
|
2905
|
+
const E = document.createElement("option");
|
|
2906
|
+
E.value = "hsl", E.textContent = "HSL", g.appendChild(C), g.appendChild(m), g.appendChild(E);
|
|
2907
|
+
const f = document.createElement("input");
|
|
2908
|
+
f.type = "text", f.className = "color-picker-color-input", f.value = t;
|
|
2909
|
+
const y = document.createElement("div");
|
|
2910
|
+
y.className = "color-picker-input-container";
|
|
2928
2911
|
const V = document.createElement("button");
|
|
2929
|
-
return V.className = "color-picker-copy-inside", V.textContent = "Copy",
|
|
2912
|
+
return V.className = "color-picker-copy-inside", V.textContent = "Copy", y.appendChild(f), y.appendChild(V), u.appendChild(g), u.appendChild(y), s.appendChild(n), s.appendChild(a), s.appendChild(h), s.appendChild(u), this.setupEmbeddedColorPicker(
|
|
2930
2913
|
n,
|
|
2931
2914
|
o,
|
|
2932
2915
|
r,
|
|
2933
2916
|
c,
|
|
2934
|
-
|
|
2935
|
-
|
|
2917
|
+
g,
|
|
2918
|
+
f,
|
|
2936
2919
|
V,
|
|
2937
2920
|
l,
|
|
2938
2921
|
t,
|
|
@@ -2967,25 +2950,25 @@ class se extends S {
|
|
|
2967
2950
|
h.className = "color-picker-format-section embedded";
|
|
2968
2951
|
const d = document.createElement("select");
|
|
2969
2952
|
d.className = "color-picker-format-select";
|
|
2970
|
-
const m = document.createElement("option");
|
|
2971
|
-
m.value = "hex", m.textContent = "HEX";
|
|
2972
2953
|
const u = document.createElement("option");
|
|
2973
|
-
u.value = "
|
|
2954
|
+
u.value = "hex", u.textContent = "HEX";
|
|
2974
2955
|
const g = document.createElement("option");
|
|
2975
|
-
g.value = "
|
|
2976
|
-
const
|
|
2977
|
-
|
|
2978
|
-
const
|
|
2979
|
-
|
|
2980
|
-
const
|
|
2981
|
-
|
|
2956
|
+
g.value = "rgb", g.textContent = "RGB";
|
|
2957
|
+
const C = document.createElement("option");
|
|
2958
|
+
C.value = "hsl", C.textContent = "HSL", d.appendChild(u), d.appendChild(g), d.appendChild(C);
|
|
2959
|
+
const m = document.createElement("input");
|
|
2960
|
+
m.type = "text", m.className = "color-picker-color-input", m.value = t;
|
|
2961
|
+
const E = document.createElement("div");
|
|
2962
|
+
E.className = "color-picker-input-container";
|
|
2963
|
+
const f = document.createElement("button");
|
|
2964
|
+
return f.className = "color-picker-copy-inside", f.textContent = "Copy", E.appendChild(m), E.appendChild(f), h.appendChild(d), h.appendChild(E), s.appendChild(n), s.appendChild(a), s.appendChild(h), this.setupEmbeddedColorPicker(
|
|
2982
2965
|
n,
|
|
2983
2966
|
o,
|
|
2984
2967
|
r,
|
|
2985
2968
|
c,
|
|
2986
2969
|
d,
|
|
2970
|
+
m,
|
|
2987
2971
|
f,
|
|
2988
|
-
v,
|
|
2989
2972
|
l,
|
|
2990
2973
|
t,
|
|
2991
2974
|
e,
|
|
@@ -2994,109 +2977,109 @@ class se extends S {
|
|
|
2994
2977
|
}
|
|
2995
2978
|
setupEmbeddedColorPicker(t, e, i, s, n, o, a, l, r, c, h) {
|
|
2996
2979
|
let d = r;
|
|
2997
|
-
const { h:
|
|
2998
|
-
let
|
|
2999
|
-
s.style.left = `${
|
|
3000
|
-
const
|
|
3001
|
-
d =
|
|
3002
|
-
},
|
|
3003
|
-
const
|
|
3004
|
-
switch (
|
|
2980
|
+
const { h: u, s: g, v: C } = this.hexToHsv(r);
|
|
2981
|
+
let m = c;
|
|
2982
|
+
s.style.left = `${u / 360 * 100}%`, e.style.left = `${g * 100}%`, e.style.top = `${(1 - C) * 100}%`, t.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${u}, 100%, 50%))`;
|
|
2983
|
+
const E = (v, w = m) => {
|
|
2984
|
+
d = v, m = Math.round(w), f(), h(v, m);
|
|
2985
|
+
}, f = () => {
|
|
2986
|
+
const v = n.value, { h: w, s: x, v: k } = this.hexToHsv(d);
|
|
2987
|
+
switch (v) {
|
|
3005
2988
|
case "hex":
|
|
3006
2989
|
o.value = d;
|
|
3007
2990
|
break;
|
|
3008
2991
|
case "rgb":
|
|
3009
|
-
const { r:
|
|
3010
|
-
o.value = `rgb(${
|
|
2992
|
+
const { r: T, g: $, b: W } = this.hexToRgb(d);
|
|
2993
|
+
o.value = `rgb(${T}, ${$}, ${W})`;
|
|
3011
2994
|
break;
|
|
3012
2995
|
case "hsl":
|
|
3013
|
-
const { hue:
|
|
3014
|
-
o.value = `hsl(${Math.round(
|
|
2996
|
+
const { hue: F, sat: _, lightness: K } = this.hsvToHsl(w, x, k);
|
|
2997
|
+
o.value = `hsl(${Math.round(F)}, ${Math.round(
|
|
3015
2998
|
_ * 100
|
|
3016
2999
|
)}%, ${Math.round(K * 100)}%)`;
|
|
3017
3000
|
break;
|
|
3018
3001
|
}
|
|
3019
|
-
},
|
|
3020
|
-
const x =
|
|
3021
|
-
|
|
3022
|
-
},
|
|
3023
|
-
|
|
3024
|
-
const
|
|
3025
|
-
t.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${
|
|
3026
|
-
const
|
|
3027
|
-
|
|
3028
|
-
},
|
|
3029
|
-
|
|
3030
|
-
const
|
|
3031
|
-
e.style.left = `${x * 100}%`, e.style.top = `${
|
|
3032
|
-
},
|
|
3033
|
-
|
|
3034
|
-
const
|
|
3035
|
-
document.removeEventListener("mousemove",
|
|
3002
|
+
}, y = () => parseFloat(s.style.left || "0%") / 100 * 360, V = (v, w) => {
|
|
3003
|
+
const x = y(), k = this.hsvToHex(x, v, w);
|
|
3004
|
+
E(k, m);
|
|
3005
|
+
}, A = (v) => {
|
|
3006
|
+
v = Math.max(0.1, Math.min(358.9, v));
|
|
3007
|
+
const w = parseFloat(e.style.left || "50%") / 100, x = parseFloat(e.style.top || "50%") / 100;
|
|
3008
|
+
t.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${v}, 100%, 50%))`;
|
|
3009
|
+
const k = w, T = 1 - x, $ = this.hsvToHex(v, k, T);
|
|
3010
|
+
E($, m);
|
|
3011
|
+
}, B = (v) => {
|
|
3012
|
+
v.stopPropagation();
|
|
3013
|
+
const w = t.getBoundingClientRect(), x = Math.max(0, Math.min(1, (v.clientX - w.left) / w.width)), k = Math.max(0, Math.min(1, (v.clientY - w.top) / w.height));
|
|
3014
|
+
e.style.left = `${x * 100}%`, e.style.top = `${k * 100}%`, V(x, 1 - k);
|
|
3015
|
+
}, L = (v) => {
|
|
3016
|
+
v.preventDefault(), v.stopPropagation(), B(v);
|
|
3017
|
+
const w = (k) => B(k), x = () => {
|
|
3018
|
+
document.removeEventListener("mousemove", w), document.removeEventListener("mouseup", x);
|
|
3036
3019
|
};
|
|
3037
|
-
document.addEventListener("mousemove",
|
|
3038
|
-
},
|
|
3039
|
-
|
|
3040
|
-
const
|
|
3041
|
-
let x = (
|
|
3020
|
+
document.addEventListener("mousemove", w), document.addEventListener("mouseup", x);
|
|
3021
|
+
}, b = (v) => {
|
|
3022
|
+
v.stopPropagation();
|
|
3023
|
+
const w = i.getBoundingClientRect();
|
|
3024
|
+
let x = (v.clientX - w.left) / w.width;
|
|
3042
3025
|
x = Math.max(1e-3, Math.min(0.998, x)), s.style.left = `${x * 100}%`;
|
|
3043
|
-
const
|
|
3044
|
-
|
|
3045
|
-
},
|
|
3046
|
-
|
|
3047
|
-
const
|
|
3048
|
-
document.removeEventListener("mousemove",
|
|
3026
|
+
const k = x * 360;
|
|
3027
|
+
A(k);
|
|
3028
|
+
}, M = (v) => {
|
|
3029
|
+
v.preventDefault(), v.stopPropagation(), b(v);
|
|
3030
|
+
const w = (k) => b(k), x = () => {
|
|
3031
|
+
document.removeEventListener("mousemove", w), document.removeEventListener("mouseup", x);
|
|
3049
3032
|
};
|
|
3050
|
-
document.addEventListener("mousemove",
|
|
3051
|
-
}, P = (
|
|
3052
|
-
const
|
|
3053
|
-
let
|
|
3054
|
-
if (x === "hex" && /^#[0-9A-Fa-f]{6}$/.test(
|
|
3055
|
-
|
|
3033
|
+
document.addEventListener("mousemove", w), document.addEventListener("mouseup", x);
|
|
3034
|
+
}, P = (v) => {
|
|
3035
|
+
const w = v.target.value, x = n.value;
|
|
3036
|
+
let k = "";
|
|
3037
|
+
if (x === "hex" && /^#[0-9A-Fa-f]{6}$/.test(w))
|
|
3038
|
+
k = w;
|
|
3056
3039
|
else if (x === "rgb") {
|
|
3057
|
-
const
|
|
3058
|
-
if (
|
|
3059
|
-
const $ = parseInt(
|
|
3060
|
-
$ <= 255 &&
|
|
3040
|
+
const T = w.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
|
|
3041
|
+
if (T) {
|
|
3042
|
+
const $ = parseInt(T[1]), W = parseInt(T[2]), F = parseInt(T[3]);
|
|
3043
|
+
$ <= 255 && W <= 255 && F <= 255 && (k = `#${$.toString(16).padStart(2, "0")}${W.toString(16).padStart(2, "0")}${F.toString(16).padStart(2, "0")}`);
|
|
3061
3044
|
}
|
|
3062
3045
|
} else if (x === "hsl") {
|
|
3063
|
-
const
|
|
3064
|
-
if (
|
|
3065
|
-
const $ = parseInt(
|
|
3066
|
-
if ($ <= 360 &&
|
|
3067
|
-
const _ =
|
|
3068
|
-
|
|
3046
|
+
const T = w.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);
|
|
3047
|
+
if (T) {
|
|
3048
|
+
const $ = parseInt(T[1]), W = parseInt(T[2]) / 100, F = parseInt(T[3]) / 100;
|
|
3049
|
+
if ($ <= 360 && W <= 1 && F <= 1) {
|
|
3050
|
+
const _ = F + W * Math.min(F, 1 - F), K = _ === 0 ? 0 : 2 * (1 - F / _);
|
|
3051
|
+
k = this.hsvToHex($, K, _);
|
|
3069
3052
|
}
|
|
3070
3053
|
}
|
|
3071
3054
|
}
|
|
3072
|
-
if (
|
|
3073
|
-
const { h:
|
|
3074
|
-
s.style.left = `${
|
|
3055
|
+
if (k) {
|
|
3056
|
+
const { h: T, s: $, v: W } = this.hexToHsv(k);
|
|
3057
|
+
s.style.left = `${T / 360 * 100}%`, e.style.left = `${$ * 100}%`, e.style.top = `${(1 - W) * 100}%`, t.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${T}, 100%, 50%))`, E(k, m);
|
|
3075
3058
|
}
|
|
3076
|
-
}, O = (
|
|
3077
|
-
|
|
3078
|
-
},
|
|
3079
|
-
|
|
3080
|
-
},
|
|
3059
|
+
}, O = (v) => {
|
|
3060
|
+
f();
|
|
3061
|
+
}, H = () => {
|
|
3062
|
+
f();
|
|
3063
|
+
}, S = () => {
|
|
3081
3064
|
navigator.clipboard.writeText(o.value).catch(() => {
|
|
3082
3065
|
o.select(), document.execCommand("copy");
|
|
3083
3066
|
});
|
|
3084
3067
|
};
|
|
3085
|
-
|
|
3086
|
-
const
|
|
3068
|
+
f(), t.addEventListener("mousedown", L), t.addEventListener("click", B), i.addEventListener("mousedown", M), i.addEventListener("click", b), n.addEventListener("change", H), o.addEventListener("input", P), o.addEventListener("blur", O), a.addEventListener("click", S);
|
|
3069
|
+
const D = async () => {
|
|
3087
3070
|
if ("EyeDropper" in window)
|
|
3088
3071
|
try {
|
|
3089
|
-
const x = (await new window.EyeDropper().open()).sRGBHex, { h:
|
|
3090
|
-
s.style.left = `${
|
|
3091
|
-
} catch (
|
|
3092
|
-
console.log("User cancelled eyedropper or error occurred:",
|
|
3072
|
+
const x = (await new window.EyeDropper().open()).sRGBHex, { h: k, s: T, v: $ } = this.hexToHsv(x);
|
|
3073
|
+
s.style.left = `${k / 360 * 100}%`, e.style.left = `${T * 100}%`, e.style.top = `${(1 - $) * 100}%`, t.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${k}, 100%, 50%))`, E(x, m);
|
|
3074
|
+
} catch (v) {
|
|
3075
|
+
console.log("User cancelled eyedropper or error occurred:", v);
|
|
3093
3076
|
}
|
|
3094
3077
|
else
|
|
3095
3078
|
alert(
|
|
3096
3079
|
"EyeDropper API is not supported in this browser. Try using Chrome 95+ or Edge 95+."
|
|
3097
3080
|
);
|
|
3098
3081
|
};
|
|
3099
|
-
l.addEventListener("click",
|
|
3082
|
+
l.addEventListener("click", D);
|
|
3100
3083
|
}
|
|
3101
3084
|
hsvToHex(t, e, i) {
|
|
3102
3085
|
const s = i * e, n = s * (1 - Math.abs(t / 60 % 2 - 1)), o = i - s;
|
|
@@ -3113,8 +3096,8 @@ class se extends S {
|
|
|
3113
3096
|
o(), a();
|
|
3114
3097
|
let l = !1;
|
|
3115
3098
|
const r = (c) => {
|
|
3116
|
-
const h = t.getBoundingClientRect(), d = c.clientX - h.left,
|
|
3117
|
-
s =
|
|
3099
|
+
const h = t.getBoundingClientRect(), d = c.clientX - h.left, u = Math.max(0, Math.min(100, d / h.width * 100)), g = Math.round(u);
|
|
3100
|
+
s = g, a(), n(i, g);
|
|
3118
3101
|
};
|
|
3119
3102
|
t.addEventListener("mousedown", (c) => {
|
|
3120
3103
|
l = !0, r(c);
|
|
@@ -3153,31 +3136,31 @@ class se extends S {
|
|
|
3153
3136
|
<svg width="15" height="17" viewBox="0 0 15 17" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3154
3137
|
<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"/>
|
|
3155
3138
|
</svg>
|
|
3156
|
-
`, l.title = "Flip gradient", i.addEventListener("change", (
|
|
3157
|
-
const
|
|
3158
|
-
this.switchType(
|
|
3159
|
-
}), o.addEventListener("input", (
|
|
3160
|
-
const
|
|
3161
|
-
if (this.value && !isNaN(
|
|
3162
|
-
const
|
|
3163
|
-
this.value.angle =
|
|
3139
|
+
`, l.title = "Flip gradient", i.addEventListener("change", (m) => {
|
|
3140
|
+
const E = m.target.value;
|
|
3141
|
+
this.switchType(E === "radial" ? "radial" : "linear");
|
|
3142
|
+
}), o.addEventListener("input", (m) => {
|
|
3143
|
+
const E = m.target.value, f = parseInt(E);
|
|
3144
|
+
if (this.value && !isNaN(f)) {
|
|
3145
|
+
const y = Math.max(0, Math.min(360, f));
|
|
3146
|
+
this.value.angle = y, this.updateGradientPreview(), this.updateUI(), this.triggerChange();
|
|
3164
3147
|
}
|
|
3165
|
-
}), o.addEventListener("focus", (
|
|
3166
|
-
const
|
|
3167
|
-
|
|
3168
|
-
}), o.addEventListener("blur", (
|
|
3169
|
-
var
|
|
3170
|
-
const
|
|
3171
|
-
let
|
|
3172
|
-
isNaN(
|
|
3148
|
+
}), o.addEventListener("focus", (m) => {
|
|
3149
|
+
const E = m.target;
|
|
3150
|
+
E.value = E.value.replace(/[^0-9-]/g, ""), setTimeout(() => E.select(), 0);
|
|
3151
|
+
}), o.addEventListener("blur", (m) => {
|
|
3152
|
+
var y;
|
|
3153
|
+
const E = m.target;
|
|
3154
|
+
let f = parseInt(E.value);
|
|
3155
|
+
isNaN(f) && (f = ((y = this.value) == null ? void 0 : y.angle) ?? 0), f = Math.max(0, Math.min(360, f)), this.value && (this.value.angle = f), E.value = `${f}°`, this.updateGradientPreview(), this.updateUI(), this.triggerChange();
|
|
3173
3156
|
}), l.addEventListener("click", () => {
|
|
3174
|
-
this.value && (this.value.stops = this.value.stops.map((
|
|
3175
|
-
...
|
|
3176
|
-
position: 100 -
|
|
3157
|
+
this.value && (this.value.stops = this.value.stops.map((m) => ({
|
|
3158
|
+
...m,
|
|
3159
|
+
position: 100 - m.position
|
|
3177
3160
|
})), this.updateGradientPreview(), this.updateStopsList(), this.updateUI(), this.triggerChange());
|
|
3178
3161
|
}), e.appendChild(i), e.appendChild(o), e.appendChild(l), t.appendChild(e), (() => {
|
|
3179
|
-
var
|
|
3180
|
-
((
|
|
3162
|
+
var m;
|
|
3163
|
+
((m = this.value) == null ? void 0 : m.type) === "radial" ? (o.disabled = !0, o.style.opacity = "0.5") : (o.disabled = !1, o.style.opacity = "1");
|
|
3181
3164
|
})();
|
|
3182
3165
|
const c = document.createElement("div");
|
|
3183
3166
|
c.className = "gradient-preview", this.updateGradientPreview(c);
|
|
@@ -3185,13 +3168,13 @@ class se extends S {
|
|
|
3185
3168
|
h.className = "gradient-handles", this.createGradientHandles(h, c), c.appendChild(h), t.appendChild(c);
|
|
3186
3169
|
const d = document.createElement("div");
|
|
3187
3170
|
d.className = "gradient-stops-header";
|
|
3188
|
-
const
|
|
3189
|
-
|
|
3190
|
-
const
|
|
3191
|
-
|
|
3192
|
-
const
|
|
3193
|
-
|
|
3194
|
-
this.addGradientStop(), this.updateStopsList(
|
|
3171
|
+
const u = document.createElement("span");
|
|
3172
|
+
u.textContent = "Stops";
|
|
3173
|
+
const g = document.createElement("button");
|
|
3174
|
+
g.type = "button", g.className = "gradient-add-stop", g.textContent = "+", d.appendChild(u), d.appendChild(g);
|
|
3175
|
+
const C = document.createElement("div");
|
|
3176
|
+
C.className = "gradient-stops", t.appendChild(d), t.appendChild(C), this.updateStopsList(C), g.addEventListener("click", () => {
|
|
3177
|
+
this.addGradientStop(), this.updateStopsList(C), this.updateGradientPreview(c), this.createGradientHandles(h, c), this.updateUI();
|
|
3195
3178
|
});
|
|
3196
3179
|
}
|
|
3197
3180
|
updateGradientPreview(t) {
|
|
@@ -3210,16 +3193,16 @@ class se extends S {
|
|
|
3210
3193
|
makeDraggable(t, e, i) {
|
|
3211
3194
|
let s = !1, n = 0, o = 0, a = null;
|
|
3212
3195
|
const l = (d) => "touches" in d && d.touches.length > 0 ? d.touches[0].clientX : d.clientX, r = (d) => {
|
|
3213
|
-
var
|
|
3214
|
-
s = !0, n = l(d), o = ((
|
|
3196
|
+
var u, g, C;
|
|
3197
|
+
s = !0, n = l(d), o = ((C = (g = (u = this.value) == null ? void 0 : u.stops) == null ? void 0 : g[i]) == null ? void 0 : C.position) || 0, t.classList.add("selected"), document.addEventListener("pointermove", c, { passive: !1 }), document.addEventListener("pointerup", h), document.addEventListener("mousemove", c, { passive: !1 }), document.addEventListener("mouseup", h), document.addEventListener("touchmove", c, {
|
|
3215
3198
|
passive: !1
|
|
3216
3199
|
}), document.addEventListener("touchend", h), d.preventDefault();
|
|
3217
3200
|
}, c = (d) => {
|
|
3218
|
-
var
|
|
3219
|
-
if (!s || !((
|
|
3220
|
-
const
|
|
3221
|
-
let
|
|
3222
|
-
|
|
3201
|
+
var E, f;
|
|
3202
|
+
if (!s || !((f = (E = this.value) == null ? void 0 : E.stops) != null && f[i])) return;
|
|
3203
|
+
const u = e.getBoundingClientRect(), C = (l(d) - n) / u.width * 100;
|
|
3204
|
+
let m = o + C;
|
|
3205
|
+
m = Math.max(0, Math.min(100, m)), this.value.stops[i].position = Math.round(m), t.style.left = `${m}%`, a && cancelAnimationFrame(a), a = requestAnimationFrame(() => {
|
|
3223
3206
|
this.updateGradientPreview(), this.updateStopsList(), this.updateUI(), a = null;
|
|
3224
3207
|
}), d.preventDefault();
|
|
3225
3208
|
}, h = () => {
|
|
@@ -3233,7 +3216,7 @@ class se extends S {
|
|
|
3233
3216
|
var i;
|
|
3234
3217
|
const e = t || ((i = this.popoverElement) == null ? void 0 : i.querySelector(".gradient-stops"));
|
|
3235
3218
|
!e || !this.value || this.value.type === "solid" || !this.value.stops || (e.innerHTML = "", this.value.stops.forEach((s, n) => {
|
|
3236
|
-
var
|
|
3219
|
+
var A, B;
|
|
3237
3220
|
const o = document.createElement("div");
|
|
3238
3221
|
o.className = "gstop-row";
|
|
3239
3222
|
const a = document.createElement("div");
|
|
@@ -3250,127 +3233,127 @@ class se extends S {
|
|
|
3250
3233
|
d.type = "button", d.className = "gstop-color-copy", d.innerHTML = `<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3251
3234
|
<path d="M14.5896 19.3033L13.4111 20.4818C11.7839 22.109 9.14575 22.109 7.51856 20.4818C5.89138 18.8546 5.89138 16.2164 7.51856 14.5892L8.69708 13.4107M19.3037 14.5892L20.4822 13.4107C22.1094 11.7835 22.1094 9.14535 20.4822 7.51816C18.855 5.89098 16.2168 5.89098 14.5896 7.51816L13.4111 8.69668M11.0837 16.9166L16.917 11.0833" stroke="#919EAB" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3252
3235
|
</svg>`, r.appendChild(c), r.appendChild(h), r.appendChild(d);
|
|
3253
|
-
const
|
|
3254
|
-
|
|
3236
|
+
const u = document.createElement("button");
|
|
3237
|
+
u.type = "button", u.className = "gstop-del", u.innerHTML = `<svg width="14" height="2" viewBox="0 0 14 2" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3255
3238
|
<path d="M0.8 0.800003H12.4667" stroke="#919EAB" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3256
|
-
</svg>`,
|
|
3239
|
+
</svg>`, u.disabled = (((B = (A = this.value) == null ? void 0 : A.stops) == null ? void 0 : B.length) || 0) <= 2, l.addEventListener("input", (L) => {
|
|
3257
3240
|
var O;
|
|
3258
|
-
const
|
|
3241
|
+
const b = L.target, M = b.value.replace(/[^\d]/g, ""), P = parseInt(M);
|
|
3259
3242
|
if (this.value && !isNaN(P)) {
|
|
3260
|
-
const
|
|
3261
|
-
this.value.stops[n].position =
|
|
3262
|
-
const
|
|
3243
|
+
const H = Math.max(0, Math.min(100, P));
|
|
3244
|
+
this.value.stops[n].position = H, b.value = `${H}%`;
|
|
3245
|
+
const S = (O = this.popoverElement) == null ? void 0 : O.querySelector(
|
|
3263
3246
|
".gradient-preview"
|
|
3264
|
-
),
|
|
3247
|
+
), D = S == null ? void 0 : S.querySelector(
|
|
3265
3248
|
".gradient-handles"
|
|
3266
3249
|
);
|
|
3267
|
-
|
|
3250
|
+
S && D && this.createGradientHandles(D, S), this.updateGradientPreview(), this.updateUI(), this.triggerChange();
|
|
3268
3251
|
}
|
|
3269
|
-
}), l.addEventListener("focus", (
|
|
3270
|
-
const
|
|
3271
|
-
|
|
3272
|
-
}), l.addEventListener("blur", (
|
|
3273
|
-
var O,
|
|
3274
|
-
const
|
|
3252
|
+
}), l.addEventListener("focus", (L) => {
|
|
3253
|
+
const b = L.target, M = b.value.replace("%", "");
|
|
3254
|
+
b.value = M, b.select();
|
|
3255
|
+
}), l.addEventListener("blur", (L) => {
|
|
3256
|
+
var O, H;
|
|
3257
|
+
const b = L.target, M = b.value.replace(/[^\d]/g, ""), P = parseInt(M);
|
|
3275
3258
|
if (isNaN(P))
|
|
3276
|
-
|
|
3259
|
+
b.value = `${((H = (O = this.value) == null ? void 0 : O.stops[n]) == null ? void 0 : H.position) || 0}%`;
|
|
3277
3260
|
else {
|
|
3278
|
-
const
|
|
3279
|
-
|
|
3261
|
+
const S = Math.max(0, Math.min(100, P));
|
|
3262
|
+
b.value = `${S}%`, this.value && (this.value.stops[n].position = S, this.updateGradientPreview(), this.updateUI(), this.triggerChange());
|
|
3280
3263
|
}
|
|
3281
3264
|
});
|
|
3282
|
-
const
|
|
3283
|
-
(
|
|
3284
|
-
var
|
|
3285
|
-
if (h.value =
|
|
3286
|
-
this.value.stops[n].color =
|
|
3287
|
-
const
|
|
3265
|
+
const g = new Pt(
|
|
3266
|
+
(L, b) => {
|
|
3267
|
+
var M, P, O;
|
|
3268
|
+
if (h.value = L.replace("#", "").toUpperCase(), c.style.backgroundColor = L, this.value) {
|
|
3269
|
+
this.value.stops[n].color = L, b !== void 0 && (this.value.stops[n].opacity = b);
|
|
3270
|
+
const H = (M = o.parentElement) == null ? void 0 : M.querySelector(
|
|
3288
3271
|
".gstop-opacity-slider"
|
|
3289
3272
|
);
|
|
3290
|
-
if (
|
|
3291
|
-
const
|
|
3292
|
-
|
|
3273
|
+
if (H) {
|
|
3274
|
+
const v = this.hexToRgb(L);
|
|
3275
|
+
H.style.setProperty(
|
|
3293
3276
|
"--slider-color",
|
|
3294
|
-
`rgb(${
|
|
3277
|
+
`rgb(${v.r}, ${v.g}, ${v.b})`
|
|
3295
3278
|
);
|
|
3296
3279
|
}
|
|
3297
|
-
if (
|
|
3298
|
-
const
|
|
3280
|
+
if (b !== void 0) {
|
|
3281
|
+
const v = (P = o.parentElement) == null ? void 0 : P.querySelector(
|
|
3299
3282
|
".gstop-opacity-value"
|
|
3300
3283
|
);
|
|
3301
|
-
|
|
3284
|
+
v && (v.textContent = `${b}%`), H && (H.value = b.toString());
|
|
3302
3285
|
}
|
|
3303
|
-
const
|
|
3286
|
+
const S = (O = this.popoverElement) == null ? void 0 : O.querySelector(
|
|
3304
3287
|
".gradient-preview"
|
|
3305
|
-
),
|
|
3288
|
+
), D = S == null ? void 0 : S.querySelector(
|
|
3306
3289
|
".gradient-handles"
|
|
3307
3290
|
);
|
|
3308
|
-
|
|
3291
|
+
S && D && this.createGradientHandles(D, S), this.updateGradientPreview(), this.updateUI(), this.triggerChange();
|
|
3309
3292
|
}
|
|
3310
3293
|
}
|
|
3311
3294
|
);
|
|
3312
|
-
h.addEventListener("click", (
|
|
3313
|
-
|
|
3314
|
-
}), h.addEventListener("input", (
|
|
3295
|
+
h.addEventListener("click", (L) => {
|
|
3296
|
+
L.stopPropagation(), g.open(s.color, h, s.opacity || 100);
|
|
3297
|
+
}), h.addEventListener("input", (L) => {
|
|
3315
3298
|
var P, O;
|
|
3316
|
-
const
|
|
3317
|
-
if (/^#[0-9A-Fa-f]{6}$/.test(
|
|
3318
|
-
this.value.stops[n].color =
|
|
3319
|
-
const
|
|
3299
|
+
const b = L.target.value.trim(), M = b.startsWith("#") ? b : `#${b}`;
|
|
3300
|
+
if (/^#[0-9A-Fa-f]{6}$/.test(M) && (c.style.backgroundColor = M, this.value)) {
|
|
3301
|
+
this.value.stops[n].color = M;
|
|
3302
|
+
const H = (P = o.parentElement) == null ? void 0 : P.querySelector(
|
|
3320
3303
|
".gstop-opacity-slider"
|
|
3321
3304
|
);
|
|
3322
|
-
if (
|
|
3323
|
-
const
|
|
3324
|
-
|
|
3305
|
+
if (H) {
|
|
3306
|
+
const v = this.hexToRgb(M);
|
|
3307
|
+
H.style.setProperty(
|
|
3325
3308
|
"--slider-color",
|
|
3326
|
-
`rgb(${
|
|
3309
|
+
`rgb(${v.r}, ${v.g}, ${v.b})`
|
|
3327
3310
|
);
|
|
3328
3311
|
}
|
|
3329
|
-
const
|
|
3312
|
+
const S = (O = this.popoverElement) == null ? void 0 : O.querySelector(
|
|
3330
3313
|
".gradient-preview"
|
|
3331
|
-
),
|
|
3314
|
+
), D = S == null ? void 0 : S.querySelector(
|
|
3332
3315
|
".gradient-handles"
|
|
3333
3316
|
);
|
|
3334
|
-
|
|
3317
|
+
S && D && this.createGradientHandles(D, S), this.updateGradientPreview(), this.updateUI(), this.triggerChange();
|
|
3335
3318
|
}
|
|
3336
|
-
}), d.addEventListener("click", async (
|
|
3337
|
-
|
|
3338
|
-
const
|
|
3319
|
+
}), d.addEventListener("click", async (L) => {
|
|
3320
|
+
L.stopPropagation();
|
|
3321
|
+
const b = `#${h.value}`;
|
|
3339
3322
|
try {
|
|
3340
|
-
await navigator.clipboard.writeText(
|
|
3341
|
-
const
|
|
3323
|
+
await navigator.clipboard.writeText(b);
|
|
3324
|
+
const M = d.innerHTML;
|
|
3342
3325
|
d.innerHTML = `<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3343
3326
|
<path d="M9.3335 14L12.2502 16.9167L18.6668 10.5" stroke="#00A76F" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3344
3327
|
</svg>`, setTimeout(() => {
|
|
3345
|
-
d.innerHTML =
|
|
3328
|
+
d.innerHTML = M;
|
|
3346
3329
|
}, 1e3);
|
|
3347
|
-
} catch (
|
|
3348
|
-
console.warn("Failed to copy color to clipboard:",
|
|
3330
|
+
} catch (M) {
|
|
3331
|
+
console.warn("Failed to copy color to clipboard:", M);
|
|
3349
3332
|
}
|
|
3350
|
-
}),
|
|
3351
|
-
var
|
|
3333
|
+
}), u.addEventListener("click", () => {
|
|
3334
|
+
var L;
|
|
3352
3335
|
if (this.value && this.value.stops.length > 2) {
|
|
3353
3336
|
this.value.stops.splice(n, 1);
|
|
3354
|
-
const
|
|
3337
|
+
const b = (L = this.popoverElement) == null ? void 0 : L.querySelector(
|
|
3355
3338
|
".gradient-preview"
|
|
3356
|
-
),
|
|
3339
|
+
), M = b == null ? void 0 : b.querySelector(
|
|
3357
3340
|
".gradient-handles"
|
|
3358
3341
|
);
|
|
3359
|
-
|
|
3342
|
+
b && M && this.createGradientHandles(M, b), this.updateStopsList(), this.updateGradientPreview(), this.updateUI(), this.triggerChange();
|
|
3360
3343
|
}
|
|
3361
|
-
}), o.appendChild(a), o.appendChild(r), o.appendChild(
|
|
3362
|
-
const
|
|
3363
|
-
|
|
3364
|
-
const
|
|
3365
|
-
|
|
3366
|
-
const
|
|
3367
|
-
|
|
3368
|
-
const
|
|
3369
|
-
|
|
3370
|
-
const
|
|
3371
|
-
|
|
3344
|
+
}), o.appendChild(a), o.appendChild(r), o.appendChild(u), e.appendChild(o);
|
|
3345
|
+
const C = document.createElement("div");
|
|
3346
|
+
C.className = "gstop-opacity-row";
|
|
3347
|
+
const m = document.createElement("span");
|
|
3348
|
+
m.className = "gstop-opacity-label", m.textContent = "Opacity";
|
|
3349
|
+
const E = document.createElement("div");
|
|
3350
|
+
E.className = "gstop-opacity-group";
|
|
3351
|
+
const f = document.createElement("input");
|
|
3352
|
+
f.type = "range", f.className = "gstop-opacity-slider", f.min = "0", f.max = "100", f.value = (s.opacity !== void 0 ? s.opacity : 100).toString();
|
|
3353
|
+
const y = this.hexToRgb(s.color);
|
|
3354
|
+
f.style.setProperty(
|
|
3372
3355
|
"--slider-color",
|
|
3373
|
-
`rgb(${
|
|
3356
|
+
`rgb(${y.r}, ${y.g}, ${y.b})`
|
|
3374
3357
|
);
|
|
3375
3358
|
const V = document.createElement("span");
|
|
3376
3359
|
V.className = "gstop-opacity-value", V.textContent = `${s.opacity !== void 0 ? s.opacity : 100}%`;
|
|
@@ -3625,16 +3608,24 @@ class se extends S {
|
|
|
3625
3608
|
return this.element;
|
|
3626
3609
|
}
|
|
3627
3610
|
getValue() {
|
|
3628
|
-
return this.value ? this.
|
|
3629
|
-
|
|
3611
|
+
return this.value ? this.generateCSS(this.getSafeValue()) : "";
|
|
3612
|
+
}
|
|
3613
|
+
getCSSValue() {
|
|
3614
|
+
return this.value ? this.generateCSS(this.getSafeValue()) : "";
|
|
3615
|
+
}
|
|
3616
|
+
// Method to get CSS properties object for text gradients
|
|
3617
|
+
getTextCSSProperties() {
|
|
3618
|
+
if (!this.value) return {};
|
|
3619
|
+
const t = this.generateCSS(this.getSafeValue());
|
|
3620
|
+
return t.includes("gradient") ? {
|
|
3621
|
+
background: t,
|
|
3630
3622
|
"-webkit-background-clip": "text",
|
|
3631
3623
|
"background-clip": "text",
|
|
3632
3624
|
color: "transparent",
|
|
3633
3625
|
"-webkit-text-fill-color": "transparent"
|
|
3634
|
-
} :
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
return this.value ? this.generateCSS(this.getSafeValue()) : "";
|
|
3626
|
+
} : {
|
|
3627
|
+
color: t
|
|
3628
|
+
};
|
|
3638
3629
|
}
|
|
3639
3630
|
// Add method to get the raw object value if needed
|
|
3640
3631
|
getRawValue() {
|
|
@@ -3650,22 +3641,22 @@ const Ot = `
|
|
|
3650
3641
|
<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"/>
|
|
3651
3642
|
</svg>
|
|
3652
3643
|
`;
|
|
3653
|
-
class ne extends
|
|
3644
|
+
class ne extends z {
|
|
3654
3645
|
constructor(t) {
|
|
3655
3646
|
super({
|
|
3656
3647
|
title: "Border",
|
|
3657
3648
|
collapsed: t == null ? void 0 : t.collapsed,
|
|
3658
3649
|
settings: {
|
|
3659
|
-
size: new
|
|
3650
|
+
size: new G({
|
|
3660
3651
|
title: "Size",
|
|
3661
3652
|
icon: $t,
|
|
3662
3653
|
default: (t == null ? void 0 : t.size) ?? 0,
|
|
3663
3654
|
suffix: "px"
|
|
3664
3655
|
}),
|
|
3665
|
-
color: new
|
|
3656
|
+
color: new U({
|
|
3666
3657
|
default: (t == null ? void 0 : t.color) ?? "0, 0, 30"
|
|
3667
3658
|
}),
|
|
3668
|
-
radius: new
|
|
3659
|
+
radius: new G({
|
|
3669
3660
|
title: "Radius",
|
|
3670
3661
|
icon: Ot,
|
|
3671
3662
|
default: (t == null ? void 0 : t.radius) ?? 12,
|
|
@@ -3694,12 +3685,12 @@ const At = `
|
|
|
3694
3685
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
3695
3686
|
<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"/>
|
|
3696
3687
|
</svg>
|
|
3697
|
-
`,
|
|
3688
|
+
`, Dt = `
|
|
3698
3689
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
3699
3690
|
<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"/>
|
|
3700
3691
|
</svg>
|
|
3701
3692
|
`;
|
|
3702
|
-
class oe extends
|
|
3693
|
+
class oe extends z {
|
|
3703
3694
|
constructor(t = {}) {
|
|
3704
3695
|
const { showAlign: e = t.showAlign ?? !0, ...i } = t;
|
|
3705
3696
|
super({
|
|
@@ -3707,7 +3698,7 @@ class oe extends G {
|
|
|
3707
3698
|
collapsed: i.collapsed,
|
|
3708
3699
|
settings: (() => {
|
|
3709
3700
|
const s = {
|
|
3710
|
-
color: new
|
|
3701
|
+
color: new U({
|
|
3711
3702
|
default: i.colorDefault ?? "0, 0, 30"
|
|
3712
3703
|
}),
|
|
3713
3704
|
fontFamily: new et({
|
|
@@ -3735,9 +3726,9 @@ class oe extends G {
|
|
|
3735
3726
|
getOptions: i.fontWeightGetOptions,
|
|
3736
3727
|
getOptionsAsync: i.fontWeightGetOptionsAsync
|
|
3737
3728
|
}),
|
|
3738
|
-
fontSize: new
|
|
3729
|
+
fontSize: new G({
|
|
3739
3730
|
title: "Size",
|
|
3740
|
-
icon:
|
|
3731
|
+
icon: Dt,
|
|
3741
3732
|
default: i.fontSizeDefault ?? 12,
|
|
3742
3733
|
suffix: "px",
|
|
3743
3734
|
mobile: i.fontSizeMobileDefault
|
|
@@ -3765,7 +3756,7 @@ class oe extends G {
|
|
|
3765
3756
|
`;
|
|
3766
3757
|
}
|
|
3767
3758
|
}
|
|
3768
|
-
class J extends
|
|
3759
|
+
class J extends I {
|
|
3769
3760
|
constructor(t) {
|
|
3770
3761
|
super({
|
|
3771
3762
|
...t,
|
|
@@ -3811,7 +3802,7 @@ class J extends S {
|
|
|
3811
3802
|
}), i;
|
|
3812
3803
|
}
|
|
3813
3804
|
}
|
|
3814
|
-
class ae extends
|
|
3805
|
+
class ae extends z {
|
|
3815
3806
|
constructor(t) {
|
|
3816
3807
|
super({
|
|
3817
3808
|
title: "Margins",
|
|
@@ -3819,7 +3810,7 @@ class ae extends G {
|
|
|
3819
3810
|
settings: {
|
|
3820
3811
|
marginTop: new J({
|
|
3821
3812
|
title: "Top",
|
|
3822
|
-
icon:
|
|
3813
|
+
icon: Ft,
|
|
3823
3814
|
suffix: "px",
|
|
3824
3815
|
default: (t == null ? void 0 : t.marginTop) ?? "auto"
|
|
3825
3816
|
}),
|
|
@@ -3854,7 +3845,7 @@ class ae extends G {
|
|
|
3854
3845
|
`;
|
|
3855
3846
|
}
|
|
3856
3847
|
}
|
|
3857
|
-
const
|
|
3848
|
+
const Ft = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
3858
3849
|
<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"/>
|
|
3859
3850
|
</svg>`, Rt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
3860
3851
|
<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"/>
|
|
@@ -3863,7 +3854,7 @@ const Dt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewB
|
|
|
3863
3854
|
</svg>`, Wt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
3864
3855
|
<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"/>
|
|
3865
3856
|
</svg>`;
|
|
3866
|
-
class le extends
|
|
3857
|
+
class le extends z {
|
|
3867
3858
|
constructor(t) {
|
|
3868
3859
|
super({
|
|
3869
3860
|
title: "Background Image",
|
|
@@ -3873,10 +3864,10 @@ class le extends G {
|
|
|
3873
3864
|
...t == null ? void 0 : t.uploadProps,
|
|
3874
3865
|
default: (t == null ? void 0 : t.backgroundImage) ?? ""
|
|
3875
3866
|
}),
|
|
3876
|
-
opacity: new
|
|
3867
|
+
opacity: new Et({
|
|
3877
3868
|
default: (t == null ? void 0 : t.opacity) ?? 100
|
|
3878
3869
|
}),
|
|
3879
|
-
backgroundColor: new
|
|
3870
|
+
backgroundColor: new U({
|
|
3880
3871
|
default: (t == null ? void 0 : t.backgroundColor) ?? "0, 0, 30"
|
|
3881
3872
|
})
|
|
3882
3873
|
}
|
|
@@ -3908,8 +3899,8 @@ export {
|
|
|
3908
3899
|
le as BackgroundSettingSet,
|
|
3909
3900
|
ne as BorderSettingSet,
|
|
3910
3901
|
_t as ButtonSetting,
|
|
3911
|
-
|
|
3912
|
-
|
|
3902
|
+
R as ColorSetting,
|
|
3903
|
+
U as ColorWithOpacitySetting,
|
|
3913
3904
|
qt as DimensionSetting,
|
|
3914
3905
|
Kt as GapSetting,
|
|
3915
3906
|
se as GradientSetting,
|
|
@@ -3920,12 +3911,12 @@ export {
|
|
|
3920
3911
|
ae as MarginSettingGroup,
|
|
3921
3912
|
te as MarginTopSetting,
|
|
3922
3913
|
ee as MultiLanguageSetting,
|
|
3923
|
-
|
|
3924
|
-
|
|
3914
|
+
G as NumberSetting,
|
|
3915
|
+
Et as OpacitySetting,
|
|
3925
3916
|
Xt as SelectApiSettings,
|
|
3926
3917
|
et as SelectSetting,
|
|
3927
|
-
|
|
3928
|
-
|
|
3918
|
+
I as Setting,
|
|
3919
|
+
z as SettingGroup,
|
|
3929
3920
|
mt as StringSetting,
|
|
3930
3921
|
ut as TabSettingGroup,
|
|
3931
3922
|
ut as TabsSettingGroup,
|